/* ============================================================
   DISTRICT PLATFORM — EKTA ORANGE THEME v3
   Matching Landing Page Design
   ============================================================ */

:root {
  --bg-primary:    #fafafa;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input:      #f8fafc;
  --border:        #e2e8f0;
  --border-light:  #cbd5e1;
  --text-primary:   #0f172a;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;
  --accent:         #f97316;
  --accent-hover:   #ea580c;
  --accent-dark:    #c2410c;
  --accent-glow:    rgba(249, 115, 22, 0.12);
  --accent-subtle:  rgba(249, 115, 22, 0.06);
  --danger:         #ef4444;
  --danger-glow:    rgba(239, 68, 68, 0.1);
  --warning:        #f59e0b;
  --warning-glow:   rgba(245, 158, 11, 0.1);
  --info:           #06b6d4;
  --info-glow:      rgba(6, 182, 212, 0.1);
  --success:        #10b981;
  --success-glow:   rgba(16, 185, 129, 0.1);
  --pink:           #ec4899;
  --purple:         #8b5cf6;
  --sidebar-width:  260px;
  --topbar-height:  64px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl: 18px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.12);
  --font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --grad-accent: linear-gradient(135deg, #f97316, #ea580c, #c2410c);
  --grad-text:   linear-gradient(135deg, #f97316, #f59e0b, #fbbf24);
}

/* =========================================================
   DARK THEME OVERRIDE
========================================================= */
/* ✅ सही — actual dark values */
body.dark-theme {
  --bg-primary: #0f1117;     /* dark background */
  --bg-card: #1c1f2e;        /* dark card */
  --text-primary: #e8eaed;   /* light text */
}

/* --- RESET --- */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; }

/* --- TYPOGRAPHY --- */
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1.3; }
h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.3px; line-height: 1.3; }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
p  { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* --- SCROLLBAR (Landing Page Style) --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-height);
  flex-shrink: 0;
}

.sidebar-brand .logo-icon {
  width: 38px; height: 38px;
  background: var(--grad-accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
  flex-shrink: 0;
}

.sidebar-brand span {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.nav-section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 14px 8px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item i { width: 20px; text-align: center; font-size: 14px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--bg-card-hover); }

.sidebar-user .avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-size: 12.5px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .user-role { font-size: 11px; color: var(--text-muted); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-overlay.show { display: block; opacity: 1; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-content::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(249,115,22,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.main-content::after {
  content: '';
  position: fixed;
  bottom: -300px; left: 200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  width: 340px;
  flex-shrink: 0;
  min-width: 0;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 14px 9px 40px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.search-box i {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
  pointer-events: none;
}

.search-box .shortcut {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  position: relative;
  flex-shrink: 0;
}

.topbar-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--border);
}

.topbar-btn .badge-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  cursor: pointer;
  transition: box-shadow var(--transition);
  flex-shrink: 0;
}

.topbar-avatar:hover { box-shadow: 0 0 0 3px var(--accent-glow); }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.notif-dropdown {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 28px;
  width: min(360px, calc(100vw - 56px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
}

.notif-dropdown.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.notif-dropdown-header h4 { font-size: 14px; font-weight: 700; }

.mark-read-btn {
  background: none; border: none;
  color: var(--accent); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.mark-read-btn:hover { background: var(--accent-glow); }

.notif-dropdown-body { max-height: 340px; overflow-y: auto; }

.notif-dropdown-body::-webkit-scrollbar { width: 4px; }
.notif-dropdown-body::-webkit-scrollbar-track { background: transparent; }
.notif-dropdown-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition); cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: var(--accent-subtle); }

.notif-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-secondary); flex-shrink: 0;
}
.notif-item.unread .notif-icon {
  background: var(--accent-glow); border-color: rgba(249,115,22,0.2); color: var(--accent);
}

.notif-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.notif-item.unread .notif-text { color: var(--text-primary); font-weight: 500; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.notif-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; }

.notif-dropdown-footer {
  padding: 10px; text-align: center;
  border-top: 1px solid var(--border);
}
.notif-dropdown-footer a { font-size: 12px; color: var(--accent); font-weight: 600; }

.user-dropdown {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: 28px;
  width: min(190px, calc(100vw - 56px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 5px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
}

.user-dropdown.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: all var(--transition);
}
.user-dropdown a:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.user-dropdown a.danger:hover { color: var(--danger); background: var(--danger-glow); }
.user-dropdown .divider { height: 1px; background: var(--border); margin: 4px 8px; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  padding: 24px 28px 40px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.page-header { margin-bottom: 24px; }

.page-greeting {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 2px;
}
.page-greeting .accent { color: var(--accent); }
.page-subtitle { font-size: 14px; color: var(--text-secondary); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: default;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.04;
  transform: translate(30%, -30%);
  pointer-events: none;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 14px;
}

.stat-value {
  font-size: 28px; font-weight: 800;
  letter-spacing: -1px; margin-bottom: 2px;
  color: var(--text-primary);
}

.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.stat-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; margin-top: 8px;
  padding: 3px 8px; border-radius: 6px;
}
.stat-trend.up { background: var(--success-glow); color: var(--success); }
.stat-trend.down { background: var(--danger-glow); color: var(--danger); }

/* ============================================================
   PANELS
   ============================================================ */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.panel-title i { color: var(--accent); font-size: 14px; }

.panel-link {
  font-size: 12px; color: var(--accent);
  text-decoration: none; font-weight: 600;
  transition: color var(--transition);
  white-space: nowrap;
}
.panel-link:hover { color: var(--accent-hover); }

.panel-body {
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ============================================================
   GRIDS
   ============================================================ */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  margin-bottom: 20px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.main-grid > *,
.bottom-grid > * {
  min-width: 0;
  overflow: hidden;
}

/* ============================================================
   LIST ITEMS
   ============================================================ */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-card-hover); }

.list-item .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.dot.green { background: var(--success); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
.dot.yellow { background: var(--warning); box-shadow: 0 0 8px rgba(245,158,11,0.4); }
.dot.red { background: var(--danger); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.dot.orange { background: var(--accent); box-shadow: 0 0 8px rgba(249,115,22,0.4); }

.list-item .content { flex: 1; min-width: 0; }
.list-item .title-text { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; line-height: 1.4; }
.list-item .meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--text-muted);
  flex-wrap: wrap;
}
.list-item .meta i { margin-right: 3px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-success { background: var(--success-glow); color: var(--success); }
.badge-danger  { background: var(--danger-glow); color: var(--danger); }
.badge-warning { background: var(--warning-glow); color: var(--warning); }
.badge-info    { background: var(--info-glow); color: var(--info); }
.badge-purple { background: rgba(139,92,246,0.1); color: var(--purple); }
.badge-pink   { background: rgba(236,72,153,0.1); color: var(--pink); }
.badge-orange { background: var(--accent-glow); color: var(--accent); }

.badge-sm {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 5px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  display: inline-block;
}

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.quick-actions > * { min-width: 0; overflow: hidden; }

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s ease;
  min-width: 0;
}

.quick-action:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.quick-action .qa-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.quick-action .qa-text { font-size: 12.5px; font-weight: 600; }
.quick-action .qa-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-family);
  outline: none;
  transition: all var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-glow);
}

.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: block; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-select option { background: var(--bg-card); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  font-size: 13.5px; font-weight: 600;
  font-family: var(--font-family);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-success { background: var(--success-glow); border-color: rgba(16,185,129,0.2); color: var(--success); }
.alert-error   { background: var(--danger-glow); border-color: rgba(239,68,68,0.2); color: var(--danger); }
.alert-warning { background: var(--warning-glow); border-color: rgba(245,158,11,0.2); color: var(--warning); }
.alert-info    { background: var(--info-glow); border-color: rgba(6,182,212,0.2); color: var(--info); }
.alert i { font-size: 15px; flex-shrink: 0; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  padding: 12px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s ease;
  min-width: 0;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ============================================================
   CHART
   ============================================================ */
.chart-wrapper { padding: 16px 18px; height: 220px; position: relative; }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.auth-wrapper::before {
  content: '';
  position: absolute; top: -150px; left: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(249,115,22,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.auth-wrapper::after {
  content: '';
  position: absolute; bottom: -200px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative; z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--grad-accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}
.auth-logo span { font-size: 20px; font-weight: 700; color: var(--text-primary); }

.auth-title { font-size: 1.35rem; font-weight: 800; text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-secondary); }
.auth-footer a { font-weight: 600; }

.role-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.role-option { position: relative; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option label {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition);
  font-size: 11px; font-weight: 600; color: var(--text-secondary); text-align: center;
}
.role-option label i { font-size: 18px; }
.role-option input:checked + label {
  border-color: var(--accent); background: var(--accent-glow); color: var(--accent);
}
.role-option label:hover { border-color: var(--border-light); background: var(--bg-card-hover); }

.divider-text {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 12px;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 18px;
  font-size: 13px; color: var(--text-primary);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease; min-width: 260px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast i { font-size: 15px; }
.toast.toast-success i { color: var(--success); }
.toast.toast-error i { color: var(--danger); }
.toast.toast-info i { color: var(--info); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
  70% { box-shadow: 0 0 0 6px rgba(249,115,22,0); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

.animate-in { animation: fadeInUp 0.45s ease forwards; opacity: 0; }
.delay-1  { animation-delay: 0.05s; }
.delay-2  { animation-delay: 0.1s; }
.delay-3  { animation-delay: 0.15s; }
.delay-4  { animation-delay: 0.2s; }
.delay-5  { animation-delay: 0.25s; }
.delay-6  { animation-delay: 0.3s; }
.delay-7  { animation-delay: 0.35s; }
.delay-8  { animation-delay: 0.4s; }
.delay-9  { animation-delay: 0.45s; }
.delay-10 { animation-delay: 0.5s; }
.pulse { animation: pulseRing 2s infinite; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-accent  { color: var(--accent) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info    { color: var(--info) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-sm      { font-size: 12px !important; }

.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  .main-grid { grid-template-columns: 1fr 320px; }
  .bottom-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .search-box { width: 200px; }
  .search-box .shortcut { display: none; }
  .page-content { padding: 20px 16px 32px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-actions { grid-template-columns: 1fr; }
  .notif-dropdown { width: 300px; right: -40px; }
}

@media (max-width: 480px) {
  .search-box { width: 150px; }
  .stats-grid { grid-template-columns: 1fr; }
  .role-selector { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   FINAL LAYOUT FIX
========================================================= */
:root { --topbar-height: 56px; }

.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  transition: all 0.3s ease;
}

.main-content {
  margin-top: var(--topbar-height);
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  padding: 20px;
  transition: all 0.3s ease;
}

.mobile-menu-btn {
  display: none; width: 36px; height: 36px;
  border: none; outline: none; background: transparent;
  color: var(--text-primary); border-radius: 8px;
  align-items: center; justify-content: center; cursor: pointer;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; opacity: 1; }
  .topbar { left: 0; width: 100%; padding: 0 16px; }
  .main-content { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; padding: 16px; }
  .mobile-menu-btn { display: flex; }
  .search-box { width: 180px; }
  .search-box .shortcut { display: none; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .main-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 12px; }
  .search-box { width: 140px; }
  .main-content { padding: 12px; }
  .page-content { padding: 12px; }
}

.notif-count {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 20px; background: var(--accent);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-secondary); line-height: 1;
}