:root {
  --bg: #f4f6fb;
  --sidebar-bg: #1a1f36;
  --sidebar-hover: #2d3454;
  --topbar-bg: #fff;
  --card-bg: #fff;
  --border: #e5e7eb;
  --text: #1a1f36;
  --text-muted: #6b7280;
}
[data-theme="dark"] {
  --bg: #0f1117;
  --sidebar-bg: #0d1117;
  --sidebar-hover: #1f2937;
  --topbar-bg: #161b22;
  --card-bg: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
}
body { background: var(--bg); font-family: 'Segoe UI', sans-serif; color: var(--text); transition: background 0.3s; }
.sidebar {
  width: 250px; height: 100vh; background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; z-index: 100;
  padding-top: 1rem; overflow-y: auto; transition: background 0.3s, transform 0.3s ease;
}
.sidebar .brand {
  color: #fff; font-size: 1.2rem; font-weight: 700;
  padding: 1rem 1.5rem 1.5rem; border-bottom: 1px solid #2d3454;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .nav-section {
  font-size: 10px; color: #6b7280; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 1.2rem 1.5rem 0.4rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.sidebar .nav-section:hover { color: #9ca3af; }
.sidebar .nav-section .toggle-icon { font-size: 10px; transition: transform 0.2s; }
.sidebar .nav-section.collapsed .toggle-icon { transform: rotate(-90deg); }
.sidebar .nav-group { overflow: hidden; transition: max-height 0.3s ease; }
.sidebar .nav-group.collapsed { max-height: 0 !important; }
.sidebar .nav-link {
  color: #9ca3af; padding: 0.55rem 1.5rem;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; border-radius: 0; transition: all 0.15s;
  text-decoration: none;
}
.sidebar .nav-link:hover { color: #fff; background: var(--sidebar-hover); }
.sidebar .nav-link.active {
  color: #fff; background: #4f46e5;
  border-left: 3px solid #818cf8;
}
.sidebar .nav-link i { font-size: 16px; width: 20px; }
.topbar {
  margin-left: 250px; background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 99; transition: background 0.3s;
}
.main-content { margin-left: 250px; padding: 2rem 1.5rem; }
.stat-card {
  background: var(--card-bg); border-radius: 12px;
  border: 1px solid var(--border); padding: 1.25rem;
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); }
.card-header { background: var(--card-bg); border-bottom: 1px solid var(--border); font-weight: 600; }
.table { color: var(--text); }
.theme-toggle { cursor: pointer; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px; color: var(--text); font-size: 14px; }
.lang-switch-anon {
  position: fixed; top: 16px; right: 16px; z-index: 1050;
  display: flex; gap: 2px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.lang-switch-anon form { margin: 0; }
.lang-switch-anon button {
  border: none; background: transparent; color: var(--text-muted);
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}
.lang-switch-anon button.active { background: #4f46e5; color: white; }
.notif-btn { position: relative; cursor: pointer; background: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px;
  color: var(--text); font-size: 14px; }
.notif-badge { position: absolute; top: -5px; right: -5px; background: #dc2626;
  color: white; border-radius: 50%; width: 16px; height: 16px;
  font-size: 10px; display: flex; align-items: center; justify-content: center; }
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-250px);
    z-index: 200;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .topbar, .main-content { margin-left: 0; }
}
