@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0d0d0d;
  --bg2:     #141414;
  --bg3:     #1c1c1c;
  --bg4:     #222;
  --border:  #252525;
  --border2: #303030;
  --text:    #e8e8e8;
  --text2:   #888;
  --text3:   #4a4a4a;
  --green:        #22c55e;
  --green-hover:  #16c957;
  --green-dim:    rgba(34,197,94,0.12);
  --green-border: rgba(34,197,94,0.25);
  --red:     #f87171;
  --red-dim: rgba(248,113,113,0.1);
  --radius:  10px;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ─── LOGO ─── */
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px rgba(34,197,94,0.22);
  flex-shrink: 0;
}
.logo-icon svg { width: 20px; height: 20px; color: #fff; }
.logo-sm { width: 34px; height: 34px; border-radius: 8px; }
.logo-sm svg { width: 17px; height: 17px; }

/* ─── LOGIN ─── */
.login-screen {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 300;
  align-items: center; justify-content: center;
}
.login-screen.active { display: flex; }

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 36px 40px;
  width: 380px; max-width: 92vw;
}
.login-logo {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.login-logo h1 { font-size: 16px; font-weight: 700; }
.login-logo p  { font-size: 12px; color: var(--text2); }
.login-fields  { display: flex; flex-direction: column; gap: 14px; }
.login-err { color: var(--red); font-size: 12px; min-height: 16px; }

/* ─── APP ─── */
.app-hidden { display: none; }
.app-visible { display: block; }

/* ─── NAVBAR ─── */
nav {
  height: 58px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 0;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  display: flex; align-items: center; gap: 11px;
  min-width: 200px; flex-shrink: 0;
}
.nav-title { line-height: 1.25; }
.nav-name  { display: block; font-size: 14px; font-weight: 700; }
.nav-sub   { display: block; font-size: 11px; color: var(--text2); }

.nav-tabs {
  flex: 1; display: flex; align-items: center;
  justify-content: center; gap: 3px;
}
.nav-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 8px;
  border: none; background: transparent;
  color: var(--text2); font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.nav-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-tab:hover { background: var(--bg3); color: var(--text); }
.nav-tab.active { background: var(--green); color: #000; font-weight: 600; }

.nav-right {
  min-width: 120px; display: flex;
  justify-content: flex-end; flex-shrink: 0;
}
.btn-logout {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text2); font-family: 'Inter', sans-serif;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn-logout svg { width: 14px; height: 14px; }
.btn-logout:hover { color: var(--text); border-color: var(--text3); }

/* ─── MAIN ─── */
#main-content { padding: 36px 32px; max-width: 1400px; margin: 0 auto; }

/* ─── PAGES ─── */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 3px; }
.page-header p  { font-size: 13px; color: var(--text2); }

/* ─── CARDS ─── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 22px;
}
.card-title { font-size: 17px; font-weight: 700; }
.card-sub   { font-size: 13px; color: var(--text2); margin-top: 3px; }
.card-heading {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700; margin-bottom: 18px;
}

/* ─── FORM ─── */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 120px; }
.field label {
  font-size: 10px; font-weight: 600; color: var(--text2);
  letter-spacing: .08em; text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px; padding: 9px 13px;
  color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 13px; outline: none; transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus { border-color: var(--green); }
input::placeholder { color: var(--text3); }
select option { background: var(--bg3); }

.form-row {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.form-row .field { flex: 1; min-width: 130px; }

/* ─── BUTTONS ─── */
.btn-primary {
  background: var(--green); color: #000;
  border: none; border-radius: 8px;
  padding: 9px 22px; font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .15s;
  white-space: nowrap; height: 38px; align-self: flex-end;
}
.btn-primary:hover { background: var(--green-hover); }
.btn-full { width: 100%; height: 42px; }

.btn-secondary {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border2); border-radius: 8px;
  padding: 8px 14px; font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border2); background: var(--bg4); }
.btn-danger { color: var(--red) !important; border-color: rgba(248,113,113,0.3) !important; }
.btn-danger:hover { background: var(--red-dim) !important; }

.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 5px; border-radius: 6px;
  transition: all .15s; display: flex; align-items: center;
}
.btn-icon:hover { color: var(--text); background: var(--bg3); }
.btn-icon svg { width: 14px; height: 14px; }
.btn-icon.del:hover { color: var(--red); }

/* ─── TABLES ─── */
.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg3); }
thead th {
  padding: 13px 18px; text-align: left;
  font-size: 10px; font-weight: 600; color: var(--text2);
  letter-spacing: .08em; text-transform: uppercase;
}
tbody tr { border-top: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--bg3); }
tbody td { padding: 13px 18px; font-size: 13px; }

.empty-state {
  text-align: center; padding: 40px;
  color: var(--text3); font-size: 13px;
}

/* ─── ROLE BADGES ─── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 5px; font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.badge-tech    { background: rgba(167,139,250,.14); color: #a78bfa; border: 1px solid rgba(167,139,250,.3); }
.badge-chief   { background: rgba(251,191,36,.14);  color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.badge-fadmin  { background: rgba(96,165,250,.14);  color: #60a5fa; border: 1px solid rgba(96,165,250,.3); }
.badge-admin   { background: rgba(52,211,153,.14);  color: #34d399; border: 1px solid rgba(52,211,153,.3); }
.badge-loghunt { background: rgba(251,146,60,.14);  color: #fb923c; border: 1px solid rgba(251,146,60,.3); }
.badge-seniadm { background: rgba(239,68,68,.14);   color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.badge-cheat   { background: rgba(244,114,182,.14); color: #f472b6; border: 1px solid rgba(244,114,182,.3); }
.badge-custom1 { background: rgba(148,163,184,.14); color: #94a3b8; border: 1px solid rgba(148,163,184,.3); }
.badge-custom2 { background: rgba(56,189,248,.14);  color: #38bdf8; border: 1px solid rgba(56,189,248,.3); }

/* ─── PUNISHMENTS ─── */
.punishment-form { margin-bottom: 24px; }

.list-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 14px;
}
.list-header h3 { font-size: 17px; font-weight: 700; }
.list-actions   { display: flex; align-items: center; gap: 8px; }

.btn-filter {
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border2); border-radius: 7px;
  padding: 5px 13px; font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; cursor: pointer; transition: all .15s;
}
.btn-filter:hover { color: var(--text); }
.btn-filter.active { border-color: var(--text2); color: var(--text); }

.btn-copy-all {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: var(--green); font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; cursor: pointer;
  padding: 5px 10px; border-radius: 7px; transition: background .15s;
}
.btn-copy-all:hover { background: var(--green-dim); }
.btn-copy-all svg { width: 13px; height: 13px; }

.cmd-pill {
  background: var(--bg3); color: var(--green);
  padding: 3px 9px; border-radius: 6px;
  font-size: 12px; font-family: monospace;
  display: inline-block;
}

/* ─── STATS ─── */
.stats-cards {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 14px; margin-top: 20px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.stat-icon {
  width: 42px; height: 42px; background: var(--bg3);
  border-radius: 10px; display: flex;
  align-items: center; justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-label {
  font-size: 10px; font-weight: 600; color: var(--text2);
  letter-spacing: .1em; text-transform: uppercase;
}

.status-done { color: var(--green); font-size: 11px; font-weight: 700; }
.status-prog { color: #fbbf24;     font-size: 11px; font-weight: 700; }
.status-none { color: var(--text3); font-size: 11px; }

/* ─── PANEL ─── */
.panel-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 22px;
  flex-wrap: wrap; gap: 14px;
}
.panel-tabs { display: flex; gap: 4px; flex-shrink: 0; }
.ptab {
  padding: 7px 16px; border-radius: 8px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text2); font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; cursor: pointer; transition: all .15s;
}
.ptab:hover { color: var(--text); }
.ptab.active { background: var(--green); color: #000; border-color: var(--green); }

.psec { display: none; }
.psec.active { display: block; }

/* Password reveal */
.pw-cell { display: flex; align-items: center; gap: 8px; }
.pw-dots { display: flex; gap: 3px; }
.pw-dot  { width: 6px; height: 6px; background: var(--text2); border-radius: 50%; display: inline-block; }
.pw-text { font-size: 12px; font-family: monospace; color: var(--text); }
.pw-toggle { background: none; border: none; cursor: pointer; color: var(--text3); padding: 2px; transition: color .15s; }
.pw-toggle:hover { color: var(--text2); }
.pw-toggle svg { width: 13px; height: 13px; display: block; }

/* DB Section */
.db-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.db-overview {
  font-size: 13px; color: var(--text2); line-height: 1.9;
}
.db-overview b { color: var(--text); font-weight: 600; }
.db-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── MODAL ─── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.65); backdrop-filter: blur(3px);
  z-index: 500; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; width: 460px; max-width: 94vw;
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 16px; transition: color .15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body .field { margin-bottom: 14px; }
.modal-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--bg3); border: 1px solid var(--green-border);
  color: var(--green); padding: 10px 18px;
  border-radius: 10px; font-size: 13px; font-weight: 500;
  z-index: 999; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  #main-content { padding: 20px 14px; }
  nav { padding: 0 14px; }
  .nav-brand { min-width: auto; }
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .db-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav-tab span { display: none; }
  .stats-cards { grid-template-columns: 1fr; }
}
