/* ══════════════════════════════════════════════════════
   KHANH DUONG ERP - SHARED STYLES
   ══════════════════════════════════════════════════════ */

:root {
  --bg-body: #0c1017;
  --bg-sidebar: #111820;
  --bg-main: #0f151d;
  --bg-card: #161e2a;
  --bg-card-hover: #1a2535;
  --bg-input: #1a2231;
  --bg-table-header: #1a2535;
  --bg-table-row: #161e2a;
  --bg-table-row-alt: #131a24;
  --bg-table-row-hover: #1e2d40;
  --bg-modal: rgba(0,0,0,0.6);
  --border: rgba(255,255,255,0.06);
  --border-card: rgba(255,255,255,0.08);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: rgba(59,130,246,0.15);
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  --orange: #f59e0b;
  --orange-dim: rgba(245,158,11,0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.12);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6,182,212,0.12);
  --text-primary: #e8ecf1;
  --text-secondary: #7a8a9e;
  --text-muted: #4a5568;
  --text-white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-w: 260px;
  --header-h: 60px;
  --font-body: 'Be Vietnam Pro', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;
  --transition: 0.2s ease;
}

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

html, body {
  height: 100%;
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* LAYOUT */
.app { display: flex; height: 100vh; }

/* ══════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sidebar-brand .logo-icon {
  width: 40%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
  margin-bottom: 10px;
}

.sidebar-brand .logo-icon img {
  width: 100%; height: auto;
  object-fit: cover;
  display: block;
}

.sidebar-brand .logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 0.5px;
}

.sidebar-brand .company-name {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-section {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  user-select: none;
}
.nav-section:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.nav-section:active { background: rgba(255,255,255,0.07); }
.nav-section .nav-arrow {
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
  margin-left: auto;
}
.nav-group.open > .nav-section .nav-arrow { transform: rotate(90deg); }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

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

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

.nav-item .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 10px;
}

.nav-badge.phase {
  background: var(--purple-dim);
  color: var(--purple);
}

/* Sub-menu / Nav Group */
.nav-group { position: relative; }

.nav-item .nav-arrow {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.nav-item .nav-badge ~ .nav-arrow { margin-left: 6px; }

.nav-group.open > .nav-item .nav-arrow { transform: rotate(90deg); }

.nav-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 8px;
}

.nav-group.open > .nav-children { max-height: 600px; }

.nav-sub {
  display: block;
  padding: 6px 12px 6px 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}

.nav-sub::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  transform: translateY(-50%);
  transition: all var(--transition);
}

.nav-sub:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.nav-sub:hover::before { background: var(--text-secondary); }

.nav-sub.active {
  color: var(--accent);
  background: rgba(59,130,246,0.08);
}

.nav-sub.active::before {
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}

.sidebar-footer .user-name {
  font-size: 12px; font-weight: 600; color: var(--text-primary);
}

.sidebar-footer .user-role {
  font-size: 11px; color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

.header .page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-white);
}

.header .page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: -8px;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right .period-select {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
}

.header-right .period-select:focus { border-color: var(--accent); }

.header-right .btn-refresh {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}

.header-right .btn-refresh:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
}

/* ══════════════════════════════════════════════════════
   PROCESS GUIDE CARD
   ══════════════════════════════════════════════════════ */
.process-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}
.process-card summary {
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  list-style: none;
}
.process-card summary::-webkit-details-marker { display: none; }
.process-card summary::after {
  content: '▸';
  margin-left: auto;
  transition: transform .2s;
  color: var(--text-secondary);
}
.process-card[open] summary::after { transform: rotate(90deg); }
.process-content { padding: 0 20px 16px; }
.process-flow {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
  text-align: center;
}
.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.step-icon.green { background: var(--green-dim); }
.step-icon.orange { background: var(--orange-dim); }
.step-icon.purple { background: var(--purple-dim); }
.step-icon.red { background: var(--red-dim); }
.step-name { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.step-desc { font-size: 10px; color: var(--text-secondary); line-height: 1.3; max-width: 90px; }
.process-arrow {
  color: var(--text-secondary);
  font-size: 16px;
  padding-top: 10px;
  flex-shrink: 0;
}
.process-notes {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.process-notes p {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.process-flow-dual { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.process-flow-row { display: flex; align-items: flex-start; gap: 4px; flex-wrap: wrap; }
.process-flow-label { font-size: 12px; font-weight: 600; color: var(--accent); min-width: 70px; padding-top: 12px; }
@media (max-width: 768px) {
  .process-flow { flex-direction: column; align-items: flex-start; gap: 8px; }
  .process-arrow { transform: rotate(90deg); padding: 0 0 0 16px; }
  .process-step { flex-direction: row; min-width: unset; text-align: left; }
  .step-name, .step-desc { max-width: unset; }
  .process-flow-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ══════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card .kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-card .kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-card .kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}

.kpi-card .kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.kpi-card .kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-card .kpi-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.kpi-trend.up { background: var(--green-dim); color: var(--green); }
.kpi-trend.down { background: var(--red-dim); color: var(--red); }

.kpi-card .kpi-glow {
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.15;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════
   CARD / PANEL
   ══════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon { font-size: 16px; }

.card-actions { display: flex; gap: 6px; }

.card-actions .tab-btn {
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.card-actions .tab-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.card-actions .tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(59,130,246,0.3);
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ══════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-table-header);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  white-space: nowrap;
}

table tbody tr:hover td { background: var(--bg-table-row-hover); }
table tbody tr:nth-child(even) td { background: var(--bg-table-row-alt); }
table tbody tr:nth-child(even):hover td { background: var(--bg-table-row-hover); }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); font-size: 12px; }
.text-bold { font-weight: 700; color: var(--text-white); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-accent { color: var(--accent); }
.text-purple { color: var(--purple); }

.badge {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-blue { background: var(--accent-dim); color: var(--accent); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-cyan { background: var(--cyan-dim); color: var(--cyan); }
.badge-gold { background: rgba(245,158,11,0.12); color: #f59e0b; }
.badge-gray { background: rgba(107,114,128,0.15); color: #9ca3af; }

/* ══════════════════════════════════════════════════════
   CHART CONTAINERS
   ══════════════════════════════════════════════════════ */
.chart-container { position: relative; width: 100%; height: 280px; }
.chart-container-sm { position: relative; width: 100%; height: 200px; }

/* ══════════════════════════════════════════════════════
   STAT ROW
   ══════════════════════════════════════════════════════ */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child { border-bottom: none; }

.stat-row .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-row .stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
}

.stat-row.indent { padding-left: 24px; }
.stat-row.indent .stat-label { color: var(--text-muted); font-size: 12px; }
.stat-row.indent .stat-value { color: var(--text-secondary); font-weight: 500; }

.stat-row.total {
  border-top: 2px solid var(--border-card);
  border-bottom: none;
  padding-top: 12px;
  margin-top: 4px;
}

.stat-row.total .stat-label {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.stat-row.total .stat-value { font-size: 15px; font-weight: 700; }

/* ══════════════════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ══════════════════════════════════════════════════════
   AI SECTION
   ══════════════════════════════════════════════════════ */
.ai-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 48px);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}

.ai-msg {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.ai-msg .ai-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.ai-msg.bot .ai-avatar { background: linear-gradient(135deg, var(--accent), var(--purple)); }
.ai-msg.user .ai-avatar { background: linear-gradient(135deg, var(--green), var(--cyan)); }

.ai-msg .ai-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  max-width: 680px;
  font-size: 13px;
  line-height: 1.65;
}

.ai-msg .ai-bubble b { color: var(--text-white); font-weight: 600; }

.ai-input-bar {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.ai-input-bar input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.ai-input-bar input:focus { border-color: var(--accent); }
.ai-input-bar input::placeholder { color: var(--text-muted); }

.ai-input-bar button {
  padding: 0 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.ai-input-bar button:hover { background: var(--accent-hover); }

/* ══════════════════════════════════════════════════════
   BREADCRUMB
   ══════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb .sep { color: var(--text-muted); font-size: 10px; }

.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

/* ══════════════════════════════════════════════════════
   DETAIL INFO GRID
   ══════════════════════════════════════════════════════ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.info-item {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.info-item .info-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.info-item .info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════ */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-card);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
}

.timeline-item.green::before { background: var(--green); }
.timeline-item.red::before { background: var(--red); }
.timeline-item.orange::before { background: var(--orange); }

.timeline-item .tl-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timeline-item .tl-content {
  font-size: 13px;
  color: var(--text-primary);
}

.timeline-item .tl-amount {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════
   STATUS INDICATORS
   ══════════════════════════════════════════════════════ */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-dot.orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.status-dot.blue { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ══════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237a8a9e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-inline { display: flex; align-items: center; gap: 10px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-warning { background: var(--orange); color: #fff; }
.btn-warning:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}
.btn-ghost { background: transparent; border: none; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(59,130,246,0.3); }
.btn-group { display: flex; gap: 8px; }

/* ══════════════════════════════════════════════════════
   TOOLBAR / ACTION BAR
   ══════════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-box {
  position: relative;
  min-width: 200px;
  max-width: 320px;
  flex: 1;
}
.search-box input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}
.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 7px 28px 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237a8a9e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filter-select:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════
   MODAL / DIALOG
   ══════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-modal);
  z-index: 100;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-white); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ══════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
}
.page-info { font-size: 12px; color: var(--text-secondary); }
.page-btns { display: flex; gap: 4px; }
.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════
   CHECKBOX
   ══════════════════════════════════════════════════════ */
.checkbox-wrap { display: flex; align-items: center; justify-content: center; }
.checkbox-wrap input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 80px; right: 24px;
  z-index: 200;
  display: flex; flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--accent); }
.toast.warning { background: var(--orange); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }

/* ══════════════════════════════════════════════════════
   LINE ITEMS TABLE (Order form)
   ══════════════════════════════════════════════════════ */
.line-items { table-layout: fixed; }
.line-items .form-control { padding: 7px 10px; font-size: 12px; }
.line-items td { vertical-align: middle; padding: 6px 4px; overflow: hidden; }
.line-items td select { width: 100%; min-width: 0; display: block; }
.line-items td input[type="number"] { width: 100%; min-width: 0; padding: 7px 6px; }
.line-items td input[type="text"] { width: 100%; min-width: 0; box-sizing: border-box; display: block; }
.line-items .item-product-name { margin-top: 4px; }
.line-items .btn-remove {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--red-dim);
  color: var(--red);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.line-items .btn-remove:hover { background: var(--red); color: #fff; }
.line-items .btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 12px;
}
.line-items .btn-add-row:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ══════════════════════════════════════════════════════
   INVOICE PRINT
   ══════════════════════════════════════════════════════ */
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.invoice-company { font-size: 11px; color: var(--text-secondary); line-height: 1.6; }
.invoice-company .company-name { font-size: 16px; font-weight: 700; color: var(--text-white); margin-bottom: 4px; }
.invoice-title { text-align: right; }
.invoice-title h2 { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.invoice-title .invoice-no { font-family: var(--font-mono); font-size: 14px; color: var(--text-secondary); }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.invoice-meta .meta-block { }
.invoice-meta .meta-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.invoice-meta .meta-value { font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.invoice-totals { text-align: right; margin-top: 16px; }
.invoice-totals .total-row { display: flex; justify-content: flex-end; gap: 40px; padding: 6px 0; font-size: 13px; }
.invoice-totals .total-row .total-label { color: var(--text-secondary); min-width: 120px; text-align: right; }
.invoice-totals .total-row .total-value { font-family: var(--font-mono); color: var(--text-primary); min-width: 120px; text-align: right; }
.invoice-totals .total-row.grand { font-size: 16px; font-weight: 700; padding-top: 12px; border-top: 2px solid var(--border-card); }
.invoice-totals .total-row.grand .total-label { color: var(--text-white); }
.invoice-totals .total-row.grand .total-value { color: var(--accent); }

/* ══════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════ */
@media print {
  body { background: #fff !important; color: #000 !important; overflow: visible !important; font-size: 12px; }
  .sidebar, .overlay, .header, .breadcrumb, .toolbar, .pagination, .toast-container, .btn, .btn-detail, .mobile-toggle, .no-print { display: none !important; }
  .app { display: block !important; }
  .main { overflow: visible !important; }
  .content { padding: 0 !important; overflow: visible !important; }
  .card { border: 1px solid #ddd !important; background: #fff !important; box-shadow: none !important; break-inside: avoid; }
  .kpi-card { background: #f8f8f8 !important; border: 1px solid #ddd !important; }
  .kpi-glow { display: none !important; }
  table thead th { background: #f0f0f0 !important; color: #333 !important; }
  table tbody td { color: #333 !important; background: #fff !important; }
  .badge { border: 1px solid currentColor; }
  a { color: inherit !important; text-decoration: none !important; }
  .invoice-company .company-name { color: #000 !important; }
  .invoice-title h2 { color: #1a56db !important; }
  .invoice-totals .total-row.grand .total-value { color: #1a56db !important; }
}

/* ══════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-text { font-size: 14px; margin-bottom: 16px; }

/* ══════════════════════════════════════════════════════
   EXCEL-LIKE TABLE SORT & FILTER
   ══════════════════════════════════════════════════════ */
th[data-sort] {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  white-space: nowrap;
}
th[data-sort]:hover { color: var(--accent); }
th[data-sort] .sort-arrows {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: 3px;
  line-height: 1;
  font-size: 7px;
  color: var(--text-muted);
  opacity: 0.35;
  transition: opacity 0.15s;
}
th[data-sort]:hover .sort-arrows { opacity: 0.7; }
th[data-sort] .sort-arrows .arr-u,
th[data-sort] .sort-arrows .arr-d { display: block; line-height: 7px; }
th[data-sort].sort-asc .sort-arrows,
th[data-sort].sort-desc .sort-arrows { opacity: 1; }
th[data-sort].sort-asc .sort-arrows .arr-u { color: var(--accent); font-weight: bold; }
th[data-sort].sort-desc .sort-arrows .arr-d { color: var(--accent); font-weight: bold; }

th[data-filter] { position: relative; }
.col-fbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  margin-left: 2px;
  vertical-align: middle;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 3px;
  font-size: 8px;
  opacity: 0.35;
  transition: all 0.15s;
  padding: 0;
}
.col-fbtn:hover { opacity: 1; background: var(--accent-dim); color: var(--accent); }
.col-fbtn.active { opacity: 1; color: var(--accent); background: var(--accent-dim); }

.col-fdrop {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 210px;
  max-height: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  overflow: hidden;
  flex-direction: column;
}
.col-fdrop.open { display: flex; }
.col-fdrop .cfd-search {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.col-fdrop .cfd-search input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--font-body);
  outline: none;
}
.col-fdrop .cfd-search input:focus { border-color: var(--accent); }
.col-fdrop .cfd-search input::placeholder { color: var(--text-muted); }
.col-fdrop .cfd-list {
  overflow-y: auto;
  max-height: 210px;
  padding: 4px 0;
  flex: 1;
}
.col-fdrop .cfd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
}
.col-fdrop .cfd-item:hover { background: rgba(255,255,255,0.04); }
.col-fdrop .cfd-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px; height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.col-fdrop .cfd-item.all-item {
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 2px;
}
.col-fdrop .cfd-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.col-fdrop .cfd-actions .btn { flex: 1; justify-content: center; }

/* Date range filter */
.cfd-daterange { padding: 10px; }
.cfd-dr-row { margin-bottom: 8px; }
.cfd-dr-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.cfd-dr-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
  color-scheme: dark;
}
.cfd-dr-input:focus { border-color: var(--accent); }
.cfd-dr-quick {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.cfd-dr-quick .cfd-qbtn { flex: 1; justify-content: center; font-size: 11px; padding: 4px 6px; }
.cfd-dr-quick .cfd-qbtn.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(59,130,246,0.3); }

tr.col-filtered { display: none !important; }
tr.page-hidden { display: none !important; }

/* ── DataGrid Pagination ── */
.dg-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  gap: 12px;
  flex-wrap: wrap;
}
.dg-pagination .dg-page-info {
  font-family: var(--font-mono);
  white-space: nowrap;
}
.dg-pagination .dg-page-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dg-pagination .dg-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-card);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.dg-pagination .dg-page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.dg-pagination .dg-page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.dg-pagination .dg-page-btn.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.dg-pagination .dg-page-btn.ellipsis {
  border: none;
  background: none;
  cursor: default;
  min-width: 20px;
  padding: 0;
  pointer-events: none;
}
.dg-pagination .dg-page-size {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dg-pagination .dg-page-size select {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}
.dg-pagination .dg-page-size select:focus {
  border-color: var(--accent);
}
@media (max-width: 600px) {
  .dg-pagination { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media print {
  .dg-pagination { display: none; }
  tr.page-hidden { display: table-row !important; }
}

/* Scrollable table container — added by JS to data-grid tables */
/* Enables sticky header by creating a scroll context with max-height */
.table-wrap.grid-scroll {
  overflow: auto;
  max-height: calc(100vh - 240px);
}
@media print {
  .table-wrap.grid-scroll { max-height: none; overflow: visible; }
}

.col-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ══════════════════════════════════════════════════════
   BATCH ACTION BAR
   ══════════════════════════════════════════════════════ */
.batch-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease;
}
.batch-bar.active { display: flex; }
.batch-count { font-size: 13px; font-weight: 600; color: var(--accent); }
.batch-actions { display: flex; gap: 8px; }

/* ══════════════════════════════════════════════════════
   CLICKABLE LINKS & BUTTONS
   ══════════════════════════════════════════════════════ */
.table-wrap a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.table-wrap a:hover { color: var(--accent-hover); text-decoration: underline; }

tr.clickable { cursor: pointer; transition: background var(--transition); }
tr.clickable:hover { background: rgba(59,130,246,0.06); }

.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-detail:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ══════════════════════════════════════════════════════
   OVERLAY & RESPONSIVE
   ══════════════════════════════════════════════════════ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.login-logo .logo-icon img {
  width: 40%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
  display: block;
}

.login-logo .logo-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  letter-spacing: 1px;
}

.login-logo .logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-form .form-control {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}

.login-form .form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.login-form .btn-login {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.login-form .btn-login:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════
   NOTIFICATION ITEMS
   ══════════════════════════════════════════════════════ */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.notification-item:hover {
  background: rgba(255,255,255,0.03);
  border-color: var(--accent);
}

.notification-item.unread {
  border-left: 3px solid var(--accent);
}

.notification-item .noti-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.noti-icon.order { background: var(--accent-dim); }
.noti-icon.warning { background: var(--orange-dim); }
.noti-icon.success { background: var(--green-dim); }
.noti-icon.danger { background: var(--red-dim); }
.noti-icon.info { background: var(--purple-dim); }

.notification-item .noti-content {
  flex: 1;
  min-width: 0;
}

.notification-item .noti-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notification-item .noti-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.notification-item .noti-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.noti-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════
   SETTINGS FORMS
   ══════════════════════════════════════════════════════ */
.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section .section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: flex !important; }
  .overlay { display: block; }
  .overlay.active { opacity: 1; pointer-events: auto; }
  .content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-card .kpi-value { font-size: 17px; }
  .header { padding: 0 16px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   LIGHT THEME
   ══════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-body: #f0f2f5;
  --bg-sidebar: #ffffff;
  --bg-main: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fb;
  --bg-input: #f0f2f5;
  --bg-table-header: #f5f7fa;
  --bg-table-row: #ffffff;
  --bg-table-row-alt: #f8fafb;
  --bg-table-row-hover: #eef2f7;
  --bg-modal: rgba(0,0,0,0.4);
  --border: rgba(0,0,0,0.08);
  --border-card: rgba(0,0,0,0.1);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37,99,235,0.1);
  --green: #16a34a;
  --green-dim: rgba(22,163,74,0.1);
  --red: #dc2626;
  --red-dim: rgba(220,38,38,0.1);
  --orange: #d97706;
  --orange-dim: rgba(217,119,6,0.1);
  --purple: #9333ea;
  --purple-dim: rgba(147,51,234,0.1);
  --cyan: #0891b2;
  --cyan-dim: rgba(8,145,178,0.1);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #0f172a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
}

/* Light theme — scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* Light theme — hover overlays (replace rgba(255,255,255,...)) */
[data-theme="light"] .nav-item:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .nav-sub:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .card-actions .tab-btn:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .kpi-card:hover { border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .progress-bar { background: rgba(0,0,0,0.06); }
[data-theme="light"] .btn-outline:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.18); }
[data-theme="light"] .btn-ghost:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .modal-close:hover { background: rgba(0,0,0,0.06); }
[data-theme="light"] .page-btn:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .col-fdrop .cfd-item:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .notification-item:hover { background: rgba(0,0,0,0.02); }
[data-theme="light"] .login-form .form-control { background: rgba(0,0,0,0.03); }
[data-theme="light"] .overlay { background: rgba(0,0,0,0.3); }
[data-theme="light"] .sidebar { box-shadow: 1px 0 4px rgba(0,0,0,0.06); }

/* Light theme — date input color scheme */
[data-theme="light"] .cfd-dr-input { color-scheme: light; }

/* Light theme — kpi glow reduce */
[data-theme="light"] .kpi-card .kpi-glow { opacity: 0.08; }

/* Light theme — login card shadow */
[data-theme="light"] .login-card { box-shadow: 0 20px 60px rgba(0,0,0,0.1); }

/* Light theme — sidebar mobile shadow */
@media (max-width: 768px) {
  [data-theme="light"] .sidebar { box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
}

/* ══════════════════════════════════════════════════════
   THEME SWITCHER UI
   ══════════════════════════════════════════════════════ */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  margin-bottom: 12px;
}

.theme-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-btn:hover { color: var(--text-secondary); }

.theme-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.theme-btn .theme-icon { font-size: 13px; line-height: 1; }

/* ══════════════════════════════════════════════════════
   PRICE LIST VERSIONING
   ══════════════════════════════════════════════════════ */

/* Version Timeline - horizontal scroll */
.version-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x mandatory;
}
.version-timeline::-webkit-scrollbar { height: 4px; }

.version-card {
  flex: 0 0 210px;
  scroll-snap-align: start;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.version-card:hover {
  border-color: rgba(59,130,246,0.3);
  background: var(--bg-card-hover);
}
.version-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.version-card.selected-compare {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(245,158,11,0.3);
}
.vc-status { margin-bottom: 8px; }
.vc-name { font-size: 13px; font-weight: 600; color: var(--text-white); margin-bottom: 4px; }
.vc-date { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }
.vc-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.vc-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

/* Compare Bar */
.compare-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--orange-dim);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}
.compare-label { font-weight: 600; color: var(--text-primary); }
.compare-vs { color: var(--text-muted); font-weight: 500; }

/* Price Change Indicators */
.price-up { color: var(--green); }
.price-down { color: var(--red); }
.price-unchanged { color: var(--text-muted); }
.price-arrow { font-size: 11px; margin-right: 2px; }

/* Tier CK Grid */
.tier-ck-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

/* Excel Dropzone */
.excel-dropzone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}
.excel-dropzone:hover,
.excel-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dropzone-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.dropzone-text { font-size: 14px; color: var(--text-primary); margin-bottom: 8px; }
.dropzone-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.dropzone-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Price List Badge */
.pricelist-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* Import Tabs (inside modal) */
.import-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding-bottom: 0;
}
.import-tabs .tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border-card);
  border-bottom: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.import-tabs .tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.import-tabs .tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(59,130,246,0.3);
}

/* Light theme overrides for price list */
[data-theme="light"] .version-card { background: #f0f2f5; }
[data-theme="light"] .version-card:hover { background: #e8ecf1; }
[data-theme="light"] .version-card.active { background: rgba(37,99,235,0.08); }
[data-theme="light"] .excel-dropzone:hover,
[data-theme="light"] .excel-dropzone.dragover { background: rgba(37,99,235,0.06); }
[data-theme="light"] .compare-bar { background: rgba(217,119,6,0.08); }

/* Responsive */
@media (max-width: 768px) {
  .tier-ck-grid { grid-template-columns: repeat(3, 1fr); }
  .version-card { flex: 0 0 170px; padding: 12px; }
}

/* ══════════════════════════════════════════════════════
   MATERIAL PRICE TABLE (Bang gia Tier x Material)
   ══════════════════════════════════════════════════════ */
.material-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.material-col {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.ambassador-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: var(--radius-sm);
  color: #a855f7;
  font-size: 11px;
  font-weight: 600;
}
.volume-info-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.volume-info-bar .vol-item {
  padding: 2px 8px;
  background: rgba(59,130,246,0.08);
  border-radius: 4px;
}
.volume-info-bar .vol-item strong {
  color: var(--accent);
  margin-left: 3px;
}
.base-note {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.box-price {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
}

/* Light theme */
[data-theme="light"] .ambassador-badge {
  background: rgba(168,85,247,0.06);
}
[data-theme="light"] .volume-info-bar {
  background: #f0f2f5;
}

/* Responsive: material table */
@media (max-width: 768px) {
  .base-note, .box-price { display: none; }
  .material-header { font-size: 10px; }
  .material-col { font-size: 11px; }
}

/* AG Grid overrides */
.ag-custom-grid .ag-header-cell { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.ag-custom-grid .ag-cell { padding: 0 10px; display: flex; align-items: center; }
.ag-custom-grid .ag-row { border-bottom: 1px solid var(--border); }
.ag-custom-grid .ag-pinned-left-header, .ag-custom-grid .ag-pinned-left-cols-container { border-right: 2px solid var(--border-card); }

/* ══════════════════════════════════════════════════════
   SIDEBAR FAVORITES & MENU PANEL
   ══════════════════════════════════════════════════════ */

/* Favorites header */
.fav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.fav-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.fav-edit-btn:hover { color: var(--accent); background: var(--accent-dim); }
.fav-edit-btn.active { color: var(--accent); background: var(--accent-dim); }

/* Favorites container */
.sidebar-favorites {
  min-height: 8px;
  transition: background 0.15s;
}
.sidebar-favorites.drag-over {
  background: rgba(59,130,246,0.05);
  border-radius: var(--radius-sm);
}

/* Favorite item */
.fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  text-decoration: none;
}
.fav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}
.fav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.fav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.fav-item .fav-icon {
  width: 22px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.fav-item .fav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drag handle & remove button (edit mode) */
.fav-item .fav-drag {
  display: none;
  cursor: grab;
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 2px;
  flex-shrink: 0;
}
.fav-item .fav-remove {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.fav-item .fav-remove:hover { color: var(--red); }
.sidebar-favorites.editing .fav-drag { display: block; }
.sidebar-favorites.editing .fav-remove { display: block; }
.sidebar-favorites.editing .fav-item { cursor: default; }

/* Drag ghost */
.fav-item.dragging {
  opacity: 0.4;
  background: var(--accent-dim);
}
.fav-item.drag-above {
  border-top: 2px solid var(--accent);
}
.fav-item.drag-below {
  border-bottom: 2px solid var(--accent);
}

/* Empty state */
.fav-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

/* ── Sidebar Module Groups ── */
.sidebar-modules-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
  opacity: 0.5;
}
.sidebar-modules {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 8px;
}
.sm-group {
  border-radius: 8px;
}
.sm-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  user-select: none;
}
.sm-group-header:hover { color: var(--text-secondary); background: rgba(255,255,255,0.03); }
.sm-group-link { display:flex; align-items:center; gap:8px; text-decoration:none; color:inherit; flex:1; min-width:0; }
.sm-group-link:hover { color: var(--accent); }
.sm-group-header .sm-icon { font-size: 13px; }
.sm-group-header .sm-arrow {
  margin-left: auto;
  font-size: 9px;
  opacity: 0.4;
  transition: transform 0.2s;
}
.sm-group.open .sm-group-header { color: var(--text-secondary); }
.sm-group.open .sm-group-header .sm-arrow { transform: rotate(180deg); }
.sm-group-items {
  display: none;
  padding: 0 0 4px;
}
.sm-group.open .sm-group-items { display: block; }
.sm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 28px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.12s;
  font-weight: 450;
}
.sm-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.sm-item.active { color: var(--accent); background: var(--accent-dim); }
.sm-item .sm-item-icon { font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; }

[data-theme="light"] .sm-group-header:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .sm-item:hover { background: rgba(0,0,0,0.04); }

/* ── Header Tab Menu — flat sub-items ── */
.header-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-left: 16px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  height: 100%;
}
.header-tabs::-webkit-scrollbar { height: 0; }
.header-tabs:empty { border: none; }

.ht-tab {
  position: relative;
  flex-shrink: 0;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: 0;
  transition: color 0.2s;
  white-space: nowrap;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.ht-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 6px;
  right: 6px;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background 0.2s;
}
.ht-tab:hover { color: var(--text-primary); }
.ht-tab:hover::after { background: rgba(255,255,255,0.12); }
.ht-tab.active { color: var(--accent); }
.ht-tab.active::after { background: var(--accent); }

/* Light theme overrides */
[data-theme="light"] .fav-item:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .ht-tab:hover::after { background: rgba(0,0,0,0.1); }

/* Responsive: hide header tabs on mobile */
@media (max-width: 768px) {
  .header-tabs { display: none; }
}

/* ══════════════════════════════════════════════════════
   NOTIFICATION CENTER
   ══════════════════════════════════════════════════════ */
.notif-wrapper { position: relative; }
.notif-bell { position: relative; }
.notif-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px); right: 0;
  width: 360px;
  max-height: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  flex-direction: column;
}
.notif-dropdown.open { display: flex; }
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-dropdown-list {
  overflow-y: auto;
  max-height: 340px;
  flex: 1;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item.unread .notif-item-title { font-weight: 600; }
.notif-item-msg {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time {
  font-size: 11px; color: var(--text-muted);
  margin-top: 3px;
}
.notif-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.notif-dropdown-footer {
  display: block;
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.notif-dropdown-footer:hover { background: var(--bg-card-hover); }
.notif-row.unread { border-left: 3px solid var(--accent); }
[data-theme="light"] .notif-dropdown { background: #fff; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .notif-item:hover { background: rgba(0,0,0,0.03); }
@media (max-width: 480px) {
  .notif-dropdown { width: calc(100vw - 20px); right: -10px; }
}
