/* EMP Pro — Dark Professional UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base:      #0d0f14;
  --bg-surface:   #13161e;
  --bg-card:      #191d28;
  --bg-hover:     #1e2333;
  --border:       #252a38;
  --border-light: #2e3447;

  --text-primary:   #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted:     #525d72;

  --accent:         #4f7fff;
  --accent-hover:   #3d6ee8;
  --accent-glow:    rgba(79,127,255,.18);

  --phase-planning:       #6366f1;
  --phase-design:         #8b5cf6;
  --phase-construction:   #f59e0b;
  --phase-testing_qa:     #ef4444;
  --phase-implementation: #10b981;
  --phase-maintenance:    #06b6d4;

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #06b6d4;

  --sidebar-w: 260px;
  --topbar-h:  64px;
  --radius:    10px;
  --radius-sm: 6px;
  --shadow:    0 2px 16px rgba(0,0,0,.4);
  --transition: .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* ── Layout ───────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sidebar-brand .brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text-primary);
}
.sidebar-brand .brand-sub {
  font-size: .65rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-group-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-link .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
  color: #fff;
  flex-shrink: 0;
}
.user-avatar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.user-info .user-name { font-size: .82rem; font-weight: 600; }
.user-info .user-role {
  font-size: .68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-title { font-size: 1rem; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  transition: all var(--transition);
  color: var(--text-secondary);
  text-decoration: none;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn .badge-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

.page-content { flex: 1; padding: 28px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header h3 { font-size: .9rem; font-weight: 700; flex: 1; }
.card-body { padding: 20px; }

/* ── Stats grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: .72rem; margin-top: 6px; font-weight: 600; }

/* ── Phase pipeline ───────────────────────────────────────── */
.phase-pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 20px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.phase-step {
  flex: 1;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-right: none;
  padding: 14px 10px;
  position: relative;
  text-align: center;
  transition: background var(--transition);
}
.phase-step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.phase-step:last-child  { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.phase-step.active-phase { background: var(--accent-glow); }
.phase-step.done-phase   { background: rgba(16,185,129,.08); }

.phase-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin: 0 auto 8px;
  background: var(--bg-hover);
  border: 2px solid var(--border-light);
}
.phase-step.done-phase .phase-dot   { border-color: var(--success); background: rgba(16,185,129,.15); }
.phase-step.active-phase .phase-dot { border-color: var(--accent); background: var(--accent-glow); }

.phase-name { font-size: .72rem; font-weight: 600; color: var(--text-secondary); }
.phase-step.active-phase .phase-name { color: var(--accent); }
.phase-step.done-phase .phase-name   { color: var(--success); }
.phase-pct  { font-size: .65rem; color: var(--text-muted); margin-top: 3px; }

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg-hover);
  border-radius: 20px;
  height: 7px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width .4s ease;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-pending    { background: rgba(82,93,114,.25);  color: #8892a4; }
.badge-progress   { background: rgba(79,127,255,.15); color: #4f7fff; }
.badge-review     { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-revisions  { background: rgba(239,68,68,.15);  color: #ef4444; }
.badge-updated    { background: rgba(6,182,212,.15);  color: #06b6d4; }
.badge-completed  { background: rgba(16,185,129,.15); color: #10b981; }
.badge-active     { background: rgba(16,185,129,.15); color: #10b981; }
.badge-hold       { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-cancelled  { background: rgba(239,68,68,.15);  color: #ef4444; }
.badge-low        { background: rgba(82,93,114,.2);   color: #8892a4; }
.badge-medium     { background: rgba(79,127,255,.15); color: #4f7fff; }
.badge-high       { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-critical   { background: rgba(239,68,68,.15);  color: #ef4444; }
.badge-default    { background: var(--bg-hover);      color: var(--text-secondary); }

/* ── Table ────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table .td-primary { color: var(--text-primary); font-weight: 600; }
.data-table a.row-link:hover { color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.btn-secondary:hover { background: var(--border); }
.btn-success   { background: rgba(16,185,129,.15); color: var(--success); border-color: rgba(16,185,129,.3); }
.btn-success:hover { background: rgba(16,185,129,.25); }
.btn-danger    { background: rgba(239,68,68,.12); color: var(--danger); border-color: rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.22); }
.btn-warning   { background: rgba(245,158,11,.12); color: var(--warning); border-color: rgba(245,158,11,.3); }
.btn-warning:hover { background: rgba(245,158,11,.22); }
.btn-sm { padding: 5px 10px; font-size: .76rem; }
.btn-icon { padding: 7px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-control {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: .875rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Alert / Flash ────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #34d399; }
.alert-danger  { background: rgba(239,68,68,.1);   border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.3); color: #fbbf24; }
.alert-info    { background: rgba(79,127,255,.1);  border: 1px solid rgba(79,127,255,.3); color: #60a5fa; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h3 { flex: 1; font-size: .95rem; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── File tree (source code) ─────────────────────────────── */
.file-tree-wrap { display: none; margin-top: 10px; padding: 12px; background: var(--bg-base); border: 1px solid var(--border); border-radius: 8px; max-height: 320px; overflow-y: auto; }
.file-tree-wrap.open { display: block; }
.file-tree { list-style: none; padding-left: 0; }
.file-tree-folder { font-size: .8rem; font-weight: 600; color: var(--text-primary); margin: 4px 0; }
.file-tree-file { font-size: .78rem; color: var(--text-secondary); margin: 3px 0; padding-left: 18px; }
.file-tree-icon { margin-right: 4px; }
.file-tree-clickable { cursor: pointer; border-radius: 4px; padding: 2px 4px 2px 14px; transition: background .15s; }
.file-tree-clickable:hover { background: var(--bg-hover); color: var(--accent); }
.file-tree-view-hint { font-size: .65rem; color: var(--accent); opacity: 0; margin-left: 4px; transition: opacity .15s; }
.file-tree-clickable:hover .file-tree-view-hint { opacity: 1; }

/* ── Code viewer modal ────────────────────────────────────── */
.code-viewer-modal { max-width: 920px; width: 95vw; }
.code-viewer-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.code-viewer-filename { font-family: 'JetBrains Mono', monospace; font-size: .85rem; font-weight: 700; flex: 1; }
.code-viewer-meta { font-size: .72rem; color: var(--text-muted); }
.code-viewer-body { max-height: 70vh; overflow: auto; background: #0a0c10; }
.code-viewer-body pre { margin: 0; padding: 18px; }
.code-viewer-body code { font-family: 'JetBrains Mono', monospace; font-size: .8rem; line-height: 1.6; }
.code-viewer-loading, .code-viewer-error { padding: 40px; text-align: center; color: var(--text-muted); }
.code-viewer-error { color: var(--danger); }
.code-line-numbers { user-select: none; }
hr.hljs-ln-numbers { display: none; }
table.hljs-ln { border-collapse: collapse; width: 100%; }
table.hljs-ln td.hljs-ln-numbers { text-align: right; padding-right: 14px; opacity: .35; user-select: none; border-right: 1px solid var(--border); }
table.hljs-ln td.hljs-ln-code { padding-left: 14px; width: 100%; }

/* ── Project discussion thread ───────────────────────────── */
.thread-box { max-height: 480px; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.thread-msg { display: flex; gap: 10px; }
.thread-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .72rem; flex-shrink: 0; }
.thread-msg-mine .thread-avatar { background: linear-gradient(135deg, #10b981, #06b6d4); }
.thread-msg-body { flex: 1; }
.thread-msg-meta { font-size: .76rem; color: var(--text-muted); margin-bottom: 3px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.thread-msg-meta strong { color: var(--text-primary); font-size: .8rem; }
.thread-msg-text { font-size: .85rem; color: var(--text-secondary); line-height: 1.55; background: var(--bg-surface); padding: 8px 12px; border-radius: 8px; display: inline-block; max-width: 100%; }
.thread-composer { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); align-items: flex-start; }
.thread-composer textarea { resize: none; }

/* ── Vault / files ────────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.file-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: border-color var(--transition);
}
.file-card:hover { border-color: var(--accent); }
.file-icon { font-size: 2rem; margin-bottom: 8px; }
.file-name { font-size: .82rem; font-weight: 600; color: var(--text-primary); word-break: break-all; }
.file-meta { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.file-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ── Login page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(79,127,255,.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .logo-big {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin: 0 auto 12px;
}
.login-logo h1 { font-size: 1.6rem; font-weight: 800; }
.login-logo p  { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Project header ───────────────────────────────────────── */
.project-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.project-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 12px; }
.meta-item { font-size: .8rem; color: var(--text-secondary); }
.meta-item strong { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 2px; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-nav { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Phase submission panel ───────────────────────────────── */
.submit-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.phase-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.phase-row:last-child { border-bottom: none; }
.phase-row-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.phase-row-info { flex: 1; }
.phase-row-name { font-weight: 600; font-size: .88rem; }
.phase-row-sub  { font-size: .74rem; color: var(--text-muted); margin-top: 2px; }
.phase-row-actions { display: flex; align-items: center; gap: 8px; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute;
  left: -20px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-base);
}
.timeline-time { font-size: .7rem; color: var(--text-muted); margin-bottom: 4px; }
.timeline-text { font-size: .82rem; color: var(--text-secondary); }
.timeline-text strong { color: var(--text-primary); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 1.25rem; font-weight: 800; }
.page-header p  { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.page-header-actions { display: flex; gap: 10px; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.empty-state h4 { font-size: .95rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: .82rem; }

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 4px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  min-width: 160px;
  z-index: 200;
  box-shadow: var(--shadow);
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: .82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

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

/* ── Hamburger (mobile) ───────────────────────────────────── */
.hamburger { display: none; cursor: pointer; font-size: 1.3rem; color: var(--text-secondary); background: none; border: none; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

/* ── Utilities ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex    { display: flex; align-items: center; }
.gap-sm  { gap: 8px; }
.gap-md  { gap: 14px; }
.mt-sm   { margin-top: 12px; }
.mt-md   { margin-top: 20px; }
.mt-lg   { margin-top: 32px; }
.mb-md   { margin-bottom: 20px; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .8rem; }
.font-bold    { font-weight: 700; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.w-full       { width: 100%; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider      { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}
@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-box { padding: 28px 20px; }
}
