/* =============================================
   愛窩集團 企業大腦 - Design System
   ============================================= */

:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #0d1526;
  --bg-card: #111827;
  --bg-card-hover: #1a2540;
  --bg-glass: rgba(17, 24, 39, 0.7);
  
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-teal: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border: rgba(99, 102, 241, 0.2);
  --border-hover: rgba(99, 102, 241, 0.5);
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.3);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --font-sans: 'Noto Sans TC', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background glow */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(6,182,212,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

/* ==================== LAYOUT ==================== */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: rgba(10,15,30,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.topbar-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(6,182,212,0.2));
  color: #fff;
  border: 1px solid rgba(99,102,241,0.4);
  box-shadow: 0 0 16px rgba(99,102,241,0.2);
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Role selector */
.role-selector-wrap { position: relative; }
.role-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color 0.2s;
  -webkit-user-select: none;
  user-select: none;
}
.role-selector:hover { border-color: var(--accent-primary); }
.role-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.role-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  animation: dropIn 0.15s ease;
}
@keyframes dropIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.role-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.875rem;
}
.role-option:hover { background: var(--bg-card-hover); }
.role-option.selected { background: rgba(99,102,241,0.15); }
.role-option-label { font-weight: 600; color: var(--text-primary); }
.role-option-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ==================== MAIN CONTENT ==================== */
.main-content { flex: 1; padding: 28px; max-width: 1600px; margin: 0 auto; width: 100%; }

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.card-sm { padding: 16px; border-radius: var(--radius-md); }

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3px;
}
.badge-required { background: rgba(99,102,241,0.2); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.badge-optional { background: rgba(6,182,212,0.15); color: #22d3ee; border: 1px solid rgba(6,182,212,0.25); }
.badge-locked { background: rgba(100,116,139,0.2); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.25); }
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-amber { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-purple { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(99,102,241,0.5); }
.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: var(--border-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-xs { padding: 4px 9px; font-size: 0.75rem; border-radius: var(--radius-sm); }

/* ==================== SECTION HEADER ==================== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }

/* ==================== MODULE 1: LMS ==================== */

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Tab switcher */
.tab-switcher {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1; padding: 9px; border: none; background: transparent;
  color: var(--text-muted); font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 16px rgba(99,102,241,0.4);
}

/* Matrix Table */
.matrix-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  max-height: 64vh;
}
.matrix-table { border-collapse: collapse; min-width: 100%; white-space: nowrap; }
.matrix-table th {
  background: rgba(10,15,30,0.8);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.matrix-table th.col-sticky { position: sticky; left: 0; z-index: 20; text-align: left; }
.matrix-table th.col-sticky2 { position: sticky; left: 120px; z-index: 20; text-align: left; }
.matrix-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.82rem;
  vertical-align: middle;
  text-align: center;
}
.matrix-table td.cell-sticky {
  position: sticky; left: 0; z-index: 5;
  background: var(--bg-card);
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.78rem;
  min-width: 120px;
  max-width: 120px;
  border-right: 1px solid var(--border);
}
.matrix-table td.cell-sticky2 {
  position: sticky; left: 120px; z-index: 5;
  background: var(--bg-card);
  text-align: left;
  font-size: 0.82rem;
  font-weight: 500;
  min-width: 200px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid var(--border);
}
.matrix-table tr:hover td { background: rgba(99,102,241,0.05); }
.matrix-table tr:hover .cell-sticky,
.matrix-table tr:hover .cell-sticky2 { background: rgba(13,21,38,0.95); }
.matrix-table .group-header td {
  background: rgba(99,102,241,0.08) !important;
  color: var(--accent-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 14px;
  letter-spacing: 0.5px;
}
.matrix-V {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(79,70,229,0.4));
  color: #818cf8; font-size: 0.75rem; font-weight: 800;
  border: 1px solid rgba(99,102,241,0.5);
}
.matrix-O {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(6,182,212,0.15);
  color: #22d3ee; font-size: 0.75rem; font-weight: 700;
  border: 1px solid rgba(6,182,212,0.3);
}
.matrix-empty { color: var(--text-muted); font-size: 0.7rem; }
.col-dept { font-size: 0.78rem; color: var(--text-secondary); }

/* Kanban */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-col {
  min-width: 260px; max-width: 280px; flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.kanban-col-title {
  font-size: 0.875rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.kanban-col-dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-count {
  background: rgba(255,255,255,0.08); color: var(--text-muted);
  font-size: 0.75rem; border-radius: 20px; padding: 1px 8px;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.kanban-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kanban-card-title { font-size: 0.83rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.kanban-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-card-owner {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; color: var(--text-muted);
}
.avatar-xs {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700;
  flex-shrink: 0;
}

/* ==================== MODULE 2: KMS ==================== */
.kms-search-hero {
  text-align: center; padding: 40px 20px 32px;
  background: linear-gradient(180deg, rgba(99,102,241,0.05) 0%, transparent 100%);
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
  border: 1px solid var(--border);
}
.kms-search-title {
  font-size: 1.6rem; font-weight: 800; margin-bottom: 8px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kms-search-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; }
.kms-search-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 12px 20px;
  max-width: 700px; margin: 0 auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.kms-search-bar:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.kms-search-icon { color: var(--text-muted); flex-shrink: 0; font-size: 1.1rem; }
.kms-search-input {
  flex: 1; border: none; background: transparent;
  font-family: var(--font-sans); font-size: 0.95rem; color: var(--text-primary);
  outline: none;
}
.kms-search-input::placeholder { color: var(--text-muted); }
.kms-search-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.kms-tag {
  padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.kms-tag:hover { border-color: var(--accent-primary); color: var(--accent-secondary); }
.kms-tag.active { background: rgba(99,102,241,0.2); border-color: var(--accent-primary); color: var(--accent-secondary); }

.kms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* QA Tickets */
.qa-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.qa-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.qa-item {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.qa-item:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.04); transform: translateX(2px); }
.qa-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.qa-item-title { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }
.qa-item-excerpt { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.qa-item-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qa-meta { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.qa-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.qa-status-open { background: var(--accent-amber); }
.qa-status-answered { background: var(--accent-green); }
.qa-status-official { background: var(--accent-purple); }
.qa-votes { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-muted); }

/* Knowledge Articles */
.article-item {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  position: relative; overflow: hidden;
}
.article-item::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  border-radius: 2px 0 0 2px;
}
.article-item.tier-gold::before { background: var(--accent-amber); }
.article-item.tier-blue::before { background: var(--accent-primary); }
.article-item.tier-teal::before { background: var(--accent-teal); }
.article-item:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.04); transform: translateX(2px); }
.article-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.article-item-title { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }
.article-item-excerpt { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.article-item-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==================== MODULE 3: EMPLOYEE PORTAL ==================== */
.portal-hero {
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(6,182,212,0.08) 100%);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 24px;
}
.portal-avatar {
  width: 70px; height: 70px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
  box-shadow: 0 0 24px rgba(99,102,241,0.4);
}
.portal-welcome { flex: 1; }
.portal-name { font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }
.portal-info { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.portal-progress-bar {
  height: 6px; border-radius: 10px;
  background: rgba(255,255,255,0.08);
  overflow: hidden; margin-bottom: 6px;
}
.portal-progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  transition: width 0.6s ease;
}
.portal-progress-label { font-size: 0.75rem; color: var(--text-muted); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.course-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.course-card.locked { opacity: 0.7; }
.course-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.course-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.course-card-title { font-size: 0.9rem; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.course-card-category { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; }
.course-card-footer { display: flex; align-items: center; justify-content: space-between; }
.course-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lock-overlay {
  position: absolute; inset: 0;
  background: rgba(10,15,30,0.5);
  border-radius: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 2rem;
}
.lock-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.course-progress-ring { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.course-progress-ring svg { transform: rotate(-90deg); }
.course-progress-ring circle { fill: none; stroke-width: 3; }
.course-progress-ring .bg-ring { stroke: rgba(255,255,255,0.08); }
.course-progress-ring .fg-ring { stroke: var(--accent-primary); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.course-progress-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; }

/* Category filter pills */
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-pill {
  padding: 6px 14px; border-radius: 20px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
}
.filter-pill:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.filter-pill.active {
  background: rgba(99,102,241,0.2); border-color: var(--accent-primary); color: #a5b4fc;
}

/* ==================== MISC ==================== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-text { font-size: 0.9rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.35s ease; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s infinite; }

/* Tooltip */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip-wrap:hover .tooltip { opacity: 1; pointer-events: auto; }
.tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
  z-index: 999;
}

/* Notification dot */
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-red);
  position: absolute; top: -2px; right: -2px;
  animation: pulse 1.5s infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .kms-grid { grid-template-columns: 1fr; }
  .topbar-nav .nav-btn span { display: none; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .main-content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
