/* ══════════════════════════════════════════════
   FAKGLOBALS Dashboard — main.css
   ══════════════════════════════════════════════ */

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

:root {
  --bg:          #0D0E13;
  --surface:     #16181F;
  --surface2:    #1E2028;
  --surface3:    #12141A;
  --border:      #2A2D3A;
  --border2:     #363A4F;
  --text:        #E8EAF0;
  --muted:       #8890A8;
  --faint:       #4A5068;
  --accent:      #6C63FF;
  --accent-glow: #6C63FF28;
  --cyan:        #38BDF8;
  --cyan-glow:   #38BDF818;
  --purple-soft: #A78BFA;
  --danger:      #F87166;
  --success:     #34D399;
  --gradient:    linear-gradient(135deg, #6C63FF, #38BDF8);

  --sidebar-w:   240px;
  --radius:      12px;
  --radius-sm:   8px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
}

a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface3);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.sidebar-top { flex: 1; padding: 0 0 16px; }

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo { height: 34px; display: block; }

.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 20px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
  margin: 1px 0;
  position: relative;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-item.active {
  color: var(--text);
  background: var(--accent-glow);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gradient);
  border-radius: 0 2px 2px 0;
}

/* ── Sidebar bottom ── */
.sidebar-bottom {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border);
}

.session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.session-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex-shrink: 0;
}

.session-dot.warning { background: #FBBF24; box-shadow: 0 0 6px #FBBF24; }
.session-dot.danger  { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

.session-label {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.3;
}

#session-timer {
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  font-size: 11px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: left;
}

.btn-logout:hover {
  background: #F8716614;
  border-color: var(--danger);
  color: var(--danger);
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 48px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ── Page header ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.page-sub {
  font-size: 13px;
  color: var(--faint);
}

.page-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  background: var(--cyan-glow);
  border: 1px solid #38BDF830;
  padding: 6px 14px;
  border-radius: 20px;
}

.dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

/* ══════════════════════════════════════════════
   FORM CARD
   ══════════════════════════════════════════════ */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 820px;
}

.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title svg { flex-shrink: 0; }

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.req { color: var(--accent); }
.opt { font-weight: 400; color: var(--faint); font-style: italic; }

.field input,
.field textarea,
.field select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ── Form footer ── */
.form-footer {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface3);
}

.form-hint {
  font-size: 12px;
  color: var(--faint);
}

.form-hint strong { color: var(--muted); }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 26px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; justify-content: center; }

/* Spinner animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.8s linear infinite; }

/* ══════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 24px;
  border: 1px solid;
}

.alert-success, .alert.success {
  background: #34D39910;
  border-color: #34D39940;
  color: var(--success);
}

.alert-error, .alert.error {
  background: #F8716610;
  border-color: #F8716640;
  color: var(--danger);
}

.alert-warning {
  background: #FBBF2410;
  border-color: #FBBF2440;
  color: #FBBF24;
}

/* ══════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
  background: var(--bg);
  flex-direction: column;
}

.login-glow {
  position: fixed;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, #6C63FF1A 0%, transparent 70%);
  pointer-events: none;
}

.login-shell {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand img { height: 38px; }

.accent-top {
  height: 3px;
  background: var(--gradient);
  border-radius: 3px 3px 0 0;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.login-card-body { padding: 32px; }

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-hint {
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  margin-top: 16px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 24px 16px;
  }

  .grid-2 { grid-template-columns: 1fr; }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary { justify-content: center; }
}
