/* EasyCallDriver Admin — clean white-sidebar dashboard (UI only) */

:root,
html:not(.dark-theme) {
  --navy: #1e293b;
  --navy-deep: #0f172a;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --primary-border: #dbeafe;
  --bg: #f8fafc;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #64748b;
  --text-dark: #334155;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius: 10px;
  --radius-lg: 12px;
  --sidebar-width: 248px;
}

* {
  font-family: "Inter", "Manrope", system-ui, sans-serif;
}

body {
  background: var(--body-bg) !important;
  color: var(--navy-deep);
}

/* —— Sidebar: white —— */
.sidebar {
  width: var(--sidebar-width) !important;
  background: #fff !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: none !important;
  padding: 18px 14px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.main {
  margin-left: var(--sidebar-width) !important;
  background: var(--bg);
  padding: 16px 20px 24px;
}

.logo {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-bottom: 22px !important;
  padding: 0 6px !important;
  background: transparent !important;
  border: none !important;
}

.logo-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: var(--navy) !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  display: grid !important;
  place-items: center !important;
  box-shadow: none !important;
  flex-shrink: 0;
}

.logo-icon i {
  display: none;
}

.logo-copy {
  min-width: 0;
  flex: 1;
}

.logo h2 {
  margin: 0 !important;
  color: var(--navy-deep) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.2;
}

.logo-copy small {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.menu {
  gap: 4px !important;
}

.menu a {
  color: var(--text-dark) !important;
  padding: 10px 12px !important;
  border-radius: var(--radius) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  border: none !important;
  box-shadow: none !important;
}

.menu a i {
  color: #94a3b8 !important;
  opacity: 1 !important;
  font-size: 16px !important;
  width: 20px !important;
}

.menu a .menu-label {
  color: inherit !important;
  font-weight: 500 !important;
}

.menu a:hover {
  background: #f1f5f9 !important;
  color: var(--navy-deep) !important;
}

.menu a:hover i {
  color: var(--navy) !important;
}

.menu a.active {
  background: var(--navy) !important;
  color: #fff !important;
}

.menu a.active .menu-label,
.menu a.active i {
  color: #fff !important;
}

.menu a[data-section="settings"] {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.menu-count {
  background: var(--primary) !important;
  color: #fff !important;
  font-size: 11px !important;
  min-width: 20px !important;
  height: 20px !important;
}

.menu-logout {
  border-top: 1px solid var(--border) !important;
  margin-top: 8px;
  padding-top: 12px !important;
}

.menu-logout button {
  color: var(--text-dark) !important;
  padding: 10px 12px !important;
  border-radius: var(--radius) !important;
  font-weight: 500 !important;
}

.menu-logout button i {
  color: #94a3b8 !important;
}

.menu-logout button:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: transparent !important;
}

.menu-logout button:hover i {
  color: #dc2626 !important;
}

/* —— Topbar —— */
.topbar {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  padding: 10px 14px !important;
  margin-bottom: 18px;
  gap: 12px !important;
}

.search {
  flex: 1;
  max-width: none !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 10px 14px !important;
  min-height: 42px;
}

.search i {
  color: #94a3b8;
}

.search input {
  font-size: 14px;
}

.search input::placeholder {
  color: #94a3b8;
}

.top-actions {
  gap: 8px !important;
}

.date-box,
.icon-btn,
.admin {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 8px 12px !important;
  color: var(--text-dark) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.icon-btn {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  color: #64748b !important;
  position: relative;
}

.icon-btn:hover,
.theme-toggle.active-theme {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: var(--navy) !important;
}

.avatar {
  width: 32px !important;
  height: 32px !important;
  background: var(--navy) !important;
  color: #fff !important;
  font-size: 13px !important;
}

.admin {
  gap: 8px !important;
  padding: 6px 10px 6px 6px !important;
  cursor: pointer;
}

.admin.topbar-live-tracking {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
}

.topbar-tracking-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 12px !important;
}

.admin span {
  color: var(--navy-deep) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

.admin-chevron {
  font-size: 11px;
  color: #94a3b8;
}

/* —— Stat cards —— */
.cards {
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  padding: 18px 18px 16px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.stat-card {
  align-items: center !important;
}

.stat-card::after {
  display: none !important;
}

.stat-card h4 {
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-bottom: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.stat-card h2 {
  color: var(--navy-deep) !important;
  font-size: 26px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-meta {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.stat-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--radius) !important;
  border: none !important;
  font-size: 18px !important;
}

.cards .stat-card:nth-child(1) .stat-icon {
  background: #eff6ff;
  color: #2563eb;
}

.cards .stat-card:nth-child(2) .stat-icon {
  background: #ecfdf5;
  color: #059669;
}

.cards .stat-card:nth-child(3) .stat-icon {
  background: #eff6ff;
  color: #1d4ed8;
}

.cards .stat-card:nth-child(4) .stat-icon {
  background: #f5f3ff;
  color: #7c3aed;
}

.stat-card-clickable:hover {
  transform: none !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

.stat-card-clickable.active-stat {
  border-color: var(--primary-border) !important;
  background: #fff !important;
}

/* —— Sections & tables —— */
.section-title {
  margin-bottom: 14px;
}

.section-title h3 {
  color: var(--navy-deep) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  gap: 8px;
}

.section-title h3 i {
  color: #64748b !important;
  font-size: 14px !important;
}

.section-title > span:not(.view-all-btn) {
  color: var(--text) !important;
  background: #f1f5f9 !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.view-all-btn {
  color: var(--primary) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.view-all-btn:hover {
  opacity: 0.75 !important;
  background: transparent !important;
}

.driver-assign-hint {
  color: var(--text);
  font-size: 13px;
  margin: -4px 0 12px;
  line-height: 1.5;
}

.filter-bar {
  gap: 8px;
  margin-bottom: 14px;
}

.filter-btn {
  background: #f1f5f9 !important;
  border: 1px solid transparent !important;
  color: var(--text-dark) !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.filter-btn:hover {
  background: #e2e8f0 !important;
  color: var(--navy-deep) !important;
}

.filter-btn.active {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border-color: var(--primary-border) !important;
  box-shadow: none !important;
}

.driver-assign-section-search,
.booking-section-search {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 12px;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: auto;
}

th {
  background: #f8fafc !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 14px !important;
  border-bottom: 1px solid var(--border) !important;
}

td {
  padding: 12px 14px !important;
  color: var(--text-dark) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #fafbfc;
}

.grid,
.mini-grid {
  gap: 14px;
  margin-bottom: 18px;
}

.info-item {
  background: #f8fafc !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: var(--radius) !important;
  padding: 12px 14px !important;
}

.info-item strong {
  color: var(--navy-deep) !important;
}

.bar {
  background: linear-gradient(180deg, #93c5fd, #2563eb) !important;
  border-radius: 8px 8px 3px 3px !important;
}

.donut-wrap {
  padding: 12px 0;
}

.legend p {
  color: var(--text);
  font-size: 13px;
}

.legend .dot.blue {
  background: #22c55e !important;
}

.legend .dot.light {
  background: #cbd5e1 !important;
}

.page-header h1 {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: var(--navy-deep) !important;
}

.page-header p {
  color: var(--text) !important;
}

.action-btn {
  background: #f1f5f9 !important;
  color: var(--navy) !important;
  border-radius: 8px !important;
}

.action-btn:hover {
  background: var(--navy) !important;
  color: #fff !important;
}

.menu-toggle {
  background: #f1f5f9 !important;
  color: var(--navy) !important;
  border-radius: var(--radius) !important;
}

.icon-btn-bell {
  position: relative;
  cursor: pointer;
}

.notify-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notify-badge[hidden] {
  display: none !important;
}

.notification-panel-wrap {
  position: relative;
  z-index: 1300;
}

.notification-panel {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 10050;
  width: min(92vw, 300px);
  max-height: min(55vh, 320px);
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.notification-panel.is-open {
  display: flex !important;
}

.notification-panel[hidden] {
  display: none !important;
}

.topbar,
.top-actions,
.main {
  overflow: visible !important;
}

.notification-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.notification-panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-deep);
}

.notification-panel-head span {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.notification-panel-list {
  display: flex;
  flex-direction: column;
  max-height: min(45vh, 260px);
  overflow-y: auto;
}

.notification-panel-empty {
  margin: 0;
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.notification-panel-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.notification-panel-item:last-child {
  border-bottom: 0;
}

.notification-panel-item:hover {
  background: #f8fafc;
}

.notification-panel-item.is-unread {
  background: rgba(37, 99, 235, 0.05);
}

.notification-panel-item-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-deep);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-panel-item-meta {
  font-size: 11px;
  line-height: 1.3;
  color: #64748b;
}

html.dark-theme .notification-panel {
  background: #1c1c1c;
  border-color: rgba(255, 255, 255, 0.08);
}

html.dark-theme .notification-panel-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

html.dark-theme .notification-panel-item.is-unread {
  background: rgba(77, 182, 172, 0.12);
}

html.dark-theme .notification-panel-head h3,
html.dark-theme .notification-panel-item-title {
  color: #fff;
}

html.dark-theme .notification-panel-head span,
html.dark-theme .notification-panel-item-text,
html.dark-theme .notification-panel-item-meta,
html.dark-theme .notification-panel-empty {
  color: #94a3b8;
}

.notification-preview-item {
  cursor: pointer;
}

.notification-preview-item:hover span {
  color: var(--navy);
}


/* —— Dark theme: charcoal + teal clinical dashboard —— */
html.dark-theme {
  --primary: #4db6ac;
  --primary-soft: rgba(77, 182, 172, 0.16);
  --primary-border: rgba(77, 182, 172, 0.28);
  --bg: #0f0f0f;
  --body-bg: #0f0f0f;
  --card-bg: #1c1c1c;
  --card-elevated: #242424;
  --border: rgba(255, 255, 255, 0.08);
  --navy: #ffffff;
  --navy-deep: #ffffff;
  --text: #a0a0a0;
  --text-dark: #ffffff;
  --shadow: none;
  --radius: 14px;
  --radius-lg: 16px;

  --primary-rgb: 77, 182, 172;
  --primary-2: #26a69a;
  --primary-light: rgba(77, 182, 172, 0.14);
  --donut-inner: #1c1c1c;
  --chart-light: #2a2a2a;
  --glass: #1c1c1c;
  --glass-border: rgba(255, 255, 255, 0.07);
  --card-bg-active: #242424;
  --input-bg: rgba(255, 255, 255, 0.05);
  --surface-soft: #171717;
  --surface-muted: #1c1c1c;
  --white: #1c1c1c;
  --dark: #ffffff;
  --text-muted: #737373;
}

html.dark-theme body {
  background: var(--body-bg) !important;
  color: #ffffff;
  letter-spacing: -0.01em;
}

html.dark-theme .main {
  background: var(--bg) !important;
}

/* Sidebar */
html.dark-theme .sidebar {
  background: #141414 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
}

html.dark-theme .logo h2 {
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

html.dark-theme .logo-copy small {
  color: #737373;
  font-weight: 500;
}

html.dark-theme .logo-icon {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html.dark-theme .menu-group {
  border-top-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .menu-group-label {
  color: #737373 !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

html.dark-theme .menu-group:nth-of-type(1) .menu-group-label::before {
  background: #4db6ac;
}

html.dark-theme .menu-group:nth-of-type(2) .menu-group-label::before {
  background: #80cbc4;
}

html.dark-theme .menu-group:nth-of-type(3) .menu-group-label::before {
  background: #616161;
}

html.dark-theme .menu a {
  color: #a0a0a0 !important;
  border-radius: 12px !important;
  font-weight: 500;
}

html.dark-theme .menu a .menu-label {
  color: #d4d4d4 !important;
  font-weight: 500;
}

html.dark-theme .menu a i {
  color: #737373 !important;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

html.dark-theme .menu a:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

html.dark-theme .menu a:hover .menu-label {
  color: #ffffff !important;
}

html.dark-theme .menu a:hover i {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
}

html.dark-theme .menu a.active {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

html.dark-theme .menu a.active i {
  background: #ffffff !important;
  color: #0f0f0f !important;
}

html.dark-theme .menu a.active .menu-label {
  color: #ffffff !important;
}

html.dark-theme .menu-count {
  background: rgba(77, 182, 172, 0.2) !important;
  color: #4db6ac !important;
}

html.dark-theme .menu-logout {
  border-top-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .menu-logout button {
  color: #a0a0a0 !important;
  border-radius: 12px;
}

html.dark-theme .menu-logout button:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
}

/* Topbar */
html.dark-theme .topbar {
  background: #1c1c1c !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

html.dark-theme .search,
html.dark-theme .date-box,
html.dark-theme .icon-btn,
html.dark-theme .admin {
  background: #242424 !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
}

html.dark-theme .search input {
  color: #ffffff !important;
  font-weight: 500;
}

html.dark-theme .search input::placeholder {
  color: #737373 !important;
}

html.dark-theme .search i {
  color: #737373 !important;
}

html.dark-theme .icon-btn {
  color: #a0a0a0 !important;
}

html.dark-theme .icon-btn:hover,
html.dark-theme .theme-toggle.active-theme {
  background: rgba(77, 182, 172, 0.14) !important;
  border-color: rgba(77, 182, 172, 0.28) !important;
  color: #4db6ac !important;
}

html.dark-theme .avatar {
  background: #4db6ac !important;
  color: #0f0f0f !important;
  font-weight: 700;
}

html.dark-theme .admin span {
  color: #ffffff !important;
  font-weight: 600;
}

html.dark-theme .admin-chevron {
  color: #737373;
}

html.dark-theme .notify-badge {
  background: #4db6ac;
  color: #0f0f0f;
  font-weight: 700;
  box-shadow: 0 0 0 2px #242424;
}

/* Cards & stats */
html.dark-theme .card {
  background: #1c1c1c !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

html.dark-theme .stat-card h4 {
  color: #737373 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

html.dark-theme .stat-card h2 {
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
}

html.dark-theme .stat-meta {
  color: #737373;
}

html.dark-theme .cards .stat-card:nth-child(1) .stat-icon,
html.dark-theme .cards .stat-card:nth-child(3) .stat-icon {
  background: rgba(77, 182, 172, 0.16);
  color: #4db6ac;
}

html.dark-theme .cards .stat-card:nth-child(2) .stat-icon {
  background: rgba(255, 183, 77, 0.14);
  color: #ffb74d;
}

html.dark-theme .cards .stat-card:nth-child(4) .stat-icon {
  background: rgba(129, 199, 132, 0.14);
  color: #81c784;
}

html.dark-theme .stat-card-clickable:hover {
  border-color: rgba(77, 182, 172, 0.22) !important;
  background: #242424 !important;
}

/* Sections */
html.dark-theme .section-title h3 {
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

html.dark-theme .section-title h3 i {
  color: #737373 !important;
}

html.dark-theme .section-title > span:not(.view-all-btn) {
  background: rgba(77, 182, 172, 0.14) !important;
  color: #4db6ac !important;
  border: 1px solid rgba(77, 182, 172, 0.22);
  font-weight: 600;
  border-radius: 999px;
}

html.dark-theme .view-all-btn {
  color: #4db6ac !important;
}

html.dark-theme .driver-assign-hint {
  color: #737373;
}

html.dark-theme .driver-assign-hint i {
  color: #4db6ac;
}

/* Filters — teal pill active state */
html.dark-theme .filter-btn {
  background: #242424 !important;
  color: #a0a0a0 !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 999px !important;
  font-weight: 600;
}

html.dark-theme .filter-btn:hover {
  background: #2a2a2a !important;
  color: #ffffff !important;
}

html.dark-theme .filter-btn.active {
  background: #4db6ac !important;
  color: #0f0f0f !important;
  border-color: #4db6ac !important;
  box-shadow: none !important;
}

/* Search bars in sections */
html.dark-theme .driver-assign-section-search,
html.dark-theme .booking-section-search {
  background: #242424 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
}

html.dark-theme .driver-assign-section-search input,
html.dark-theme .booking-section-search input {
  color: #ffffff !important;
}

html.dark-theme .driver-assign-section-search i,
html.dark-theme .booking-section-search i {
  color: #737373;
}

/* Tables */
html.dark-theme .table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c1c1c;
  border-radius: 14px;
}

html.dark-theme th {
  background: #242424 !important;
  color: #737373 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme td {
  color: #d4d4d4 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

html.dark-theme tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

html.dark-theme tbody tr:last-child td {
  border-bottom: none;
}

/* Info widgets */
html.dark-theme .info-item {
  background: #242424 !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 12px !important;
}

html.dark-theme .info-item strong {
  color: #ffffff !important;
}

html.dark-theme .info-item span {
  color: #737373;
}

/* Charts */
html.dark-theme .bar,
html.dark-theme .analytics-bar {
  background: linear-gradient(180deg, #80cbc4, #4db6ac) !important;
}

html.dark-theme .donut::before {
  background: var(--donut-inner) !important;
}

html.dark-theme .donut span {
  color: #ffffff;
  font-weight: 700;
}

html.dark-theme .legend p {
  color: #737373;
}

html.dark-theme .legend .dot.blue {
  background: #4db6ac !important;
}

html.dark-theme .legend .dot.light {
  background: #616161 !important;
}

/* Page headers & actions */
html.dark-theme .page-header h1 {
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
}

html.dark-theme .page-header p {
  color: #737373 !important;
}

html.dark-theme .action-btn {
  background: #242424 !important;
  color: #4db6ac !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

html.dark-theme .action-btn:hover {
  background: rgba(77, 182, 172, 0.16) !important;
  color: #80cbc4 !important;
  border-color: rgba(77, 182, 172, 0.28);
}

html.dark-theme .menu-toggle {
  background: #242424 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html.dark-theme .firebase-status {
  background: rgba(77, 182, 172, 0.12) !important;
  border-color: rgba(77, 182, 172, 0.22) !important;
  color: #4db6ac !important;
}

html.dark-theme .firebase-status.offline {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
}

/* Badges & status pills */
html.dark-theme .badge {
  border-radius: 999px;
  font-weight: 600;
}

html.dark-theme .badge.pending {
  background: rgba(255, 183, 77, 0.14);
  color: #ffb74d;
}

html.dark-theme .badge.completed,
html.dark-theme .completed {
  background: rgba(77, 182, 172, 0.16);
  color: #4db6ac;
}

html.dark-theme .badge.ongoing,
html.dark-theme .ongoing {
  background: rgba(77, 182, 172, 0.12);
  color: #80cbc4;
}

html.dark-theme .badge.approved,
html.dark-theme .approved {
  background: rgba(77, 182, 172, 0.16);
  color: #4db6ac;
}

html.dark-theme .badge.online {
  background: rgba(129, 199, 132, 0.14);
  color: #81c784;
}

html.dark-theme .rejected,
html.dark-theme .badge.rejected,
html.dark-theme .badge.cancelled {
  background: rgba(239, 68, 68, 0.14);
  color: #ef5350;
}

/* Side panels & overlays */
html.dark-theme .stat-panel-overlay {
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(8px);
}

html.dark-theme .stat-panel {
  background: #1c1c1c !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

html.dark-theme .stat-panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .stat-panel-header h3,
html.dark-theme .stat-panel-summary strong,
html.dark-theme .stat-detail-item strong {
  color: #ffffff !important;
}

html.dark-theme .stat-panel-summary span,
html.dark-theme .stat-detail-item span,
html.dark-theme .stat-detail-divider {
  color: #737373 !important;
}

html.dark-theme .stat-panel-close {
  background: #242424 !important;
  color: #a0a0a0 !important;
}

html.dark-theme .stat-panel-close:hover {
  background: rgba(77, 182, 172, 0.14) !important;
  color: #4db6ac !important;
}

html.dark-theme .dashboard-field span {
  color: #737373 !important;
}

html.dark-theme .dashboard-field input,
html.dark-theme .dashboard-field select,
html.dark-theme .dashboard-field textarea {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

html.dark-theme .dashboard-primary {
  background: #4db6ac !important;
  color: #0f0f0f !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: none !important;
}

html.dark-theme .dashboard-primary:hover {
  background: #26a69a !important;
}

html.dark-theme .dashboard-primary:disabled {
  background: #2a2a2a !important;
  color: #737373 !important;
}

/* Driver assign panel */
html.dark-theme .driver-assign-status-alert {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .driver-assign-status-alert.accepted,
html.dark-theme .driver-assign-status-alert.completed {
  border-color: rgba(77, 182, 172, 0.24) !important;
  background: rgba(77, 182, 172, 0.08) !important;
}

html.dark-theme .driver-assign-status-alert.accepted strong,
html.dark-theme .driver-assign-status-alert.completed strong {
  color: #4db6ac !important;
}

html.dark-theme .driver-assign-list,
html.dark-theme .driver-assign-option {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .driver-assign-option:hover,
html.dark-theme .driver-assign-option.selected {
  border-color: rgba(77, 182, 172, 0.28) !important;
  background: rgba(77, 182, 172, 0.08) !important;
}

html.dark-theme .driver-assign-payout-breakdown .stat-detail-item.payout-company strong {
  color: #ffb74d !important;
}

html.dark-theme .driver-assign-payout-breakdown .stat-detail-item.payout-driver strong {
  color: #4db6ac !important;
}

html.dark-theme .driver-assign-method-hint,
html.dark-theme .driver-assign-reject-hint {
  color: #737373 !important;
}

html.dark-theme .message-item,
html.dark-theme .message-thread-panel,
html.dark-theme .chat-bubble {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .message-item.unread {
  border-color: rgba(77, 182, 172, 0.24) !important;
  background: rgba(77, 182, 172, 0.06) !important;
}

html.dark-theme .glass-card,
html.dark-theme .route-search-card {
  background: #1c1c1c !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .live-tracking-row:hover td {
  background: rgba(255, 255, 255, 0.03) !important;
}

html.dark-theme .doc-preview {
  background: #242424 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* —— Dark scrollbars (all scroll areas) —— */
html.dark-theme {
  --scrollbar-size: 8px;
  --scrollbar-track: #1c1c1c;
  --scrollbar-thumb: #404040;
  --scrollbar-thumb-hover: #4db6ac;
  --scrollbar-thumb-border: #1c1c1c;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html.dark-theme *,
html.dark-theme *::before,
html.dark-theme *::after {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html.dark-theme ::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

html.dark-theme ::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

html.dark-theme ::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-thumb-border);
  min-height: 40px;
}

html.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  border-color: rgba(77, 182, 172, 0.2);
}

html.dark-theme ::-webkit-scrollbar-thumb:active {
  background: #26a69a;
}

html.dark-theme ::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

html.dark-theme ::-webkit-scrollbar-button,
html.dark-theme ::-webkit-scrollbar-button:single-button,
html.dark-theme ::-webkit-scrollbar-button:vertical:start:decrement,
html.dark-theme ::-webkit-scrollbar-button:vertical:end:increment,
html.dark-theme ::-webkit-scrollbar-button:horizontal:start:decrement,
html.dark-theme ::-webkit-scrollbar-button:horizontal:end:increment {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

html.dark-theme .table-wrap,
html.dark-theme .scroll-section,
html.dark-theme .stat-panel-body,
html.dark-theme .message-list,
html.dark-theme .driver-assign-list,
html.dark-theme .driver-rejected-list,
html.dark-theme .recent-visitors-scroll,
html.dark-theme .route-search-table-wrap,
html.dark-theme .tracking-table-wrap,
html.dark-theme .cookies-cache-table-wrap,
html.dark-theme .driver-assign-table-wrap,
html.dark-theme .menu,
html.dark-theme .sidebar {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html.dark-theme .table-wrap,
html.dark-theme .scroll-section,
html.dark-theme .route-search-table-wrap,
html.dark-theme .tracking-table-wrap,
html.dark-theme .cookies-cache-table-wrap,
html.dark-theme .driver-assign-table-wrap,
html.dark-theme .recent-visitors-scroll,
html.dark-theme .driver-rejected-list {
  background-color: #1c1c1c;
}

html.dark-theme .stat-panel-body,
html.dark-theme .message-list,
html.dark-theme .driver-assign-list {
  background-color: #1c1c1c;
}

html.dark-theme .menu {
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

html.dark-theme .menu::-webkit-scrollbar-track {
  background: transparent;
}

html.dark-theme .sidebar {
  scrollbar-color: var(--scrollbar-thumb) #141414;
}

html.dark-theme .sidebar::-webkit-scrollbar-track {
  background: #141414;
}

html.dark-theme .table-wrap::-webkit-scrollbar-track,
html.dark-theme .scroll-section::-webkit-scrollbar-track,
html.dark-theme .stat-panel-body::-webkit-scrollbar-track,
html.dark-theme .message-list::-webkit-scrollbar-track,
html.dark-theme .driver-assign-list::-webkit-scrollbar-track,
html.dark-theme .route-search-table-wrap::-webkit-scrollbar-track,
html.dark-theme .tracking-table-wrap::-webkit-scrollbar-track,
html.dark-theme .cookies-cache-table-wrap::-webkit-scrollbar-track,
html.dark-theme .driver-assign-table-wrap::-webkit-scrollbar-track,
html.dark-theme .recent-visitors-scroll::-webkit-scrollbar-track,
html.dark-theme .driver-rejected-list::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

html.dark-theme .settings-nav,
html.dark-theme .settings-mini-card,
html.dark-theme .settings-profile-hero {
  background: #1c1c1c !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .settings-nav-btn {
  color: #d4d4d4 !important;
}

html.dark-theme .settings-nav-btn:hover,
html.dark-theme .settings-nav-btn.active {
  background: rgba(21, 116, 255, 0.16) !important;
  color: #93c5fd !important;
}

html.dark-theme .settings-field input,
html.dark-theme .settings-field select,
html.dark-theme .settings-toggle {
  background: #141414 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f5f5f5 !important;
}

html.dark-theme .settings-profile-hero strong,
html.dark-theme .settings-mini-card h4,
html.dark-theme .settings-table td {
  color: #ffffff !important;
}

html.dark-theme .settings-badge,
html.dark-theme .settings-field span,
html.dark-theme .settings-profile-hero p,
html.dark-theme .settings-mini-card p,
html.dark-theme .settings-table th {
  color: #a3a3a3 !important;
}

@media (max-width: 768px) {
  .main {
    margin-left: 0 !important;
    padding: 12px;
  }

  .sidebar {
    width: 260px !important;
  }
}
