/* Weight Program — Premium Admin UI v2 */
:root {
  --font: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --sidebar-bg: #0a1628;
  --sidebar-bg-2: #0f2137;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #f8fafc;
  --accent: #14b8a6;
  --accent-2: #0d9488;
  --accent-glow: rgba(20, 184, 166, 0.35);
  --primary: #0f766e;
  --primary-dark: #0c4a4e;
  --bg: #f1f5f9;
  --bg-mesh: radial-gradient(ellipse 80% 50% at 20% -10%, rgba(20, 184, 166, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(15, 118, 110, 0.08), transparent),
    #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-soft: rgba(148, 163, 184, 0.25);
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --success: #059669;
  --success-bg: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 280px;
  --sidebar-w-mini: 56px;
  --sidebar-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 72px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --table-row: var(--surface);
  --table-row-alt: #f8fafc;
  --table-row-hover: #f0fdfa;
  --table-head-start: var(--primary-dark);
  --table-head-end: var(--primary);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

/* لا تُصغّر أيقونات Leaflet — قاعدة svg أعلاه كانت تخفي نقاط الخريطة */
.leaflet-container svg {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

/* ═══════════════ AUTH (Login) ═══════════════ */
.auth-body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-backdrop-media {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.02);
}

.auth-backdrop-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, rgba(15, 23, 42, 0.35) 0%, rgba(6, 16, 24, 0.92) 72%),
    linear-gradient(160deg, rgba(6, 24, 28, 0.88) 0%, rgba(12, 74, 78, 0.55) 42%, rgba(15, 23, 42, 0.9) 100%);
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 24px 32px;
}

.auth-panel-inner {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.auth-panel-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 16px 0;
  font-size: 0.8rem;
  color: rgba(248, 250, 252, 0.55);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
  animation: fadeUp 0.55s ease backwards;
}

.login-brand-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  padding: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-brand-title {
  margin: 18px 0 8px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.login-brand-tagline {
  margin: 0 auto;
  max-width: 360px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(241, 245, 249, 0.82);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.login-card {
  width: 100%;
  padding: 36px 32px 32px;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeUp 0.6s ease 0.08s backwards;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.login-card .sub {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.login-card .form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.input-wrap {
  position: relative;
}

.input-wrap .form-control {
  padding-right: 44px;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ═══════════════ ADMIN SHELL ═══════════════ */
.admin-body {
  background: var(--bg-mesh);
  min-height: 100vh;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  border-inline-start: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--sidebar-transition);
  overflow: visible;
}

.sidebar-rail-toggle {
  display: none;
  position: absolute;
  top: 72px;
  inset-inline-end: -14px;
  z-index: 120;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--sidebar-bg-2), var(--sidebar-bg));
  color: #cbd5e1;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition:
    transform var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.sidebar-rail-toggle:hover {
  color: #f8fafc;
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow:
    0 6px 18px rgba(20, 184, 166, 0.25),
    0 0 0 1px rgba(20, 184, 166, 0.2) inset;
}

.sidebar-rail-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-rail-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: transform var(--sidebar-transition);
}

.sidebar-rail-toggle-icon svg {
  width: 1rem;
  height: 1rem;
}

html[dir="rtl"] .sidebar-rail-toggle-icon svg {
  transform: scaleX(-1);
}

.admin-shell.sidebar-collapsed .sidebar-rail-toggle-icon {
  transform: rotate(180deg);
}

html[dir="rtl"] .admin-shell.sidebar-collapsed .sidebar-rail-toggle-icon {
  transform: scaleX(-1) rotate(180deg);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--accent-glow);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark-img {
  background: #fff;
  padding: 3px;
}

.brand-mark-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.brand-mark svg {
  width: 1.5rem;
  height: 1.5rem;
}

.btn-header-glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  backdrop-filter: blur(10px);
}

.btn-header-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.brand-text strong {
  display: block;
  color: #f1f5f9;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
}

.brand-text,
.sidebar-section,
.nav-label,
.user-meta {
  transition:
    opacity var(--sidebar-transition),
    max-width var(--sidebar-transition),
    margin var(--sidebar-transition),
    padding var(--sidebar-transition);
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  font-weight: 500;
}

.sidebar-section {
  margin: 10px 10px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.6);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.25;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-active);
}

.nav-link.is-active {
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.05));
  color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.nav-icon svg {
  width: 15px;
  height: 15px;
}

.nav-link.is-active .nav-icon {
  background: rgba(20, 184, 166, 0.25);
  color: var(--accent);
}

.nav-link.is-active .nav-icon svg {
  stroke: #5eead4;
}

.nav-group {
  margin: 0;
}

.nav-group-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.25;
  user-select: none;
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary::after {
  content: '';
  margin-inline-start: auto;
  width: 7px;
  height: 7px;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-group[open] .nav-group-summary::after {
  transform: rotate(-135deg);
}

.nav-group-summary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-active);
}

.nav-group-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 4px;
  margin-inline-start: 6px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-group--nested {
  margin: 0;
}

.nav-group-summary--nested {
  padding: 5px 8px 5px 14px;
  font-size: 0.76rem;
}

.nav-group-children--nested {
  padding-inline-start: 6px;
  margin-inline-start: 2px;
}

.nav-link--nested {
  padding-inline-start: 18px;
  font-size: 0.74rem;
}

.nav-link--child {
  padding: 5px 8px;
  font-size: 0.76rem;
}

.nav-indicator {
  position: absolute;
  left: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.sidebar-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta strong {
  display: block;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.user-meta span {
  font-size: 0.75rem;
  color: var(--sidebar-text);
}

/* ── Sidebar collapse (desktop rail) ── */
@media (min-width: 961px) {
  .sidebar-rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .admin-shell.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-w-mini);
  }

  .admin-shell.sidebar-collapsed .admin-sidebar::after {
    content: '';
    position: absolute;
    top: 12%;
    bottom: 12%;
    inset-inline-end: 0;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, transparent, rgba(20, 184, 166, 0.85), transparent);
    opacity: 0.65;
    pointer-events: none;
  }

  .admin-shell.sidebar-collapsed .sidebar-inner {
    padding-inline: 8px;
  }

  .admin-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 6px;
    gap: 0;
  }

  .admin-shell.sidebar-collapsed .brand-text,
  .admin-shell.sidebar-collapsed .sidebar-section,
  .admin-shell.sidebar-collapsed .nav-label,
  .admin-shell.sidebar-collapsed .user-meta,
  .admin-shell.sidebar-collapsed .nav-group-summary::after,
  .admin-shell.sidebar-collapsed .nav-indicator {
    opacity: 0;
    width: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
    margin: 0;
    padding: 0;
  }

  .admin-shell.sidebar-collapsed .nav-link,
  .admin-shell.sidebar-collapsed .nav-group-summary {
    justify-content: center;
    gap: 0;
    padding-inline: 8px;
  }

  .admin-shell.sidebar-collapsed .nav-link--child,
  .admin-shell.sidebar-collapsed .nav-link--nested,
  .admin-shell.sidebar-collapsed .nav-group-summary--nested {
    justify-content: flex-start;
    padding-inline: 12px;
    gap: 10px;
  }

  .admin-shell.sidebar-collapsed .nav-link.is-active {
    box-shadow: none;
  }

  .admin-shell.sidebar-collapsed .nav-link.is-active .nav-icon {
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.55);
  }

  .admin-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding-inline: 6px;
  }

  .admin-shell.sidebar-collapsed .nav-group > .nav-group-children {
    position: absolute;
    inset-inline-start: calc(100% + 10px);
    top: 0;
    min-width: 220px;
    max-height: none;
    overflow: visible;
    margin-inline-start: 0;
    padding: 8px;
    border-inline-start: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(165deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    pointer-events: none;
    transition:
      opacity var(--transition),
      visibility var(--transition),
      transform var(--transition);
    z-index: 210;
  }

  html[dir="rtl"] .admin-shell.sidebar-collapsed .nav-group > .nav-group-children {
    transform: translateX(6px);
  }

  .admin-shell.sidebar-collapsed .nav-group:hover > .nav-group-children,
  .admin-shell.sidebar-collapsed .nav-group:focus-within > .nav-group-children,
  .admin-shell.sidebar-collapsed .nav-group.is-flyout-open > .nav-group-children {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }

  .admin-shell.sidebar-collapsed .nav-group > .nav-group-children .nav-label,
  .admin-shell.sidebar-collapsed .nav-group > .nav-group-children .nav-group-summary::after {
    opacity: 1;
    width: auto;
    max-width: none;
    overflow: visible;
    pointer-events: auto;
  }

  .admin-shell.sidebar-collapsed .nav-group {
    position: relative;
  }

  .admin-shell.sidebar-collapsed .nav-group > summary {
    list-style: none;
  }

  .admin-shell.sidebar-collapsed .nav-group > summary::-webkit-details-marker {
    display: none;
  }

  .admin-shell.sidebar-collapsed .nav-link[data-nav-tip],
  .admin-shell.sidebar-collapsed .nav-group-summary[data-nav-tip] {
    position: relative;
  }

  .admin-shell.sidebar-collapsed .nav-link[data-nav-tip]::before,
  .admin-shell.sidebar-collapsed .nav-group-summary[data-nav-tip]::before {
    content: attr(data-nav-tip);
    position: absolute;
    inset-inline-start: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity var(--transition),
      visibility var(--transition),
      transform var(--transition);
    z-index: 220;
  }

  html[dir="rtl"] .admin-shell.sidebar-collapsed .nav-link[data-nav-tip]::before,
  html[dir="rtl"] .admin-shell.sidebar-collapsed .nav-group-summary[data-nav-tip]::before {
    transform: translateY(-50%) translateX(4px);
  }

  .admin-shell.sidebar-collapsed .nav-link[data-nav-tip]:hover::before,
  .admin-shell.sidebar-collapsed .nav-link[data-nav-tip]:focus-visible::before,
  .admin-shell.sidebar-collapsed .nav-group-summary[data-nav-tip]:hover::before,
  .admin-shell.sidebar-collapsed .nav-group-summary[data-nav-tip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }

  .admin-shell.sidebar-collapsed .nav-group:hover > .nav-group-summary[data-nav-tip]::before,
  .admin-shell.sidebar-collapsed .nav-group:focus-within > .nav-group-summary[data-nav-tip]::before,
  .admin-shell.sidebar-collapsed .nav-group.is-flyout-open > .nav-group-summary[data-nav-tip]::before {
    opacity: 0;
    visibility: hidden;
  }
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.header-eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-start {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.header-titles {
  flex: 1;
  min-width: 0;
}

.btn.btn-sidebar-toggle {
  display: none;
  flex-shrink: 0;
  padding: 10px 12px;
}

.sidebar-backdrop {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.sidebar-drawer-open {
  overflow: hidden;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.admin-content {
  flex: 1;
  padding: 28px 32px 32px;
}

/* صفحات نموذج مركّزة (بروفايل، تعديل الحساب، …) */
.page-form-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.page-form-center > .alert {
  width: 100%;
  max-width: 640px;
  margin-bottom: 0;
}

.page-form-center > .alert + .card {
  margin-top: 16px;
}

.page-form-center > .card {
  width: 100%;
  margin-bottom: 0;
}

.page-form-center .card--profile {
  max-width: 640px;
}

.page-form-center .card--form {
  max-width: 480px;
}

.page-form-center .card--form-wide {
  max-width: 760px;
}

.page-form-center .card--form-wide .filter-grid {
  margin-top: 4px;
}

.page-form-center .card--form-wide .filter-grid .form-group--full-span {
  grid-column: 1 / -1;
}

.page-form-center .card--form-wide .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.page-form-center .card form .btn-primary {
  width: 100%;
}

.page-form-center .card--form-wide form .btn-primary {
  width: auto;
  flex: 1;
  min-width: 160px;
}

.admin-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-dot {
  opacity: 0.5;
}

.footer-spacer {
  flex: 1;
}

/* ═══════════════ COMPONENTS ═══════════════ */
.welcome-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  margin-bottom: 28px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 50%, #14b8a6 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.45s ease;
}

.welcome-banner h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.welcome-banner p {
  margin: 0;
  opacity: 0.9;
  max-width: 520px;
  line-height: 1.6;
}

.welcome-banner .banner-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.welcome-banner .banner-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
  animation: fadeUp 0.5s ease backwards;
}

.stat-card:nth-child(2) {
  animation-delay: 0.08s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.16s;
}

.stat-card:nth-child(4) {
  animation-delay: 0.2s;
}

.stat-card:nth-child(5) {
  animation-delay: 0.24s;
}

.stat-card:nth-child(6) {
  animation-delay: 0.28s;
}

.stats-grid-dashboard {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid-dashboard .stat-card {
  padding: 14px 16px;
}

.stats-grid-dashboard .stat-card .stat-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

.stats-grid-dashboard .stat-card .stat-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.stats-grid-dashboard .stat-card .label {
  font-size: 0.78rem;
  line-height: 1.3;
}

.stats-grid-dashboard .stat-card .value {
  font-size: 1.4rem;
  margin-top: 4px;
}

.stats-grid-dashboard .stat-card .stat-trend {
  margin-top: 4px;
  font-size: 0.7rem;
  line-height: 1.35;
}

.stat-card--companies::before {
  background: #7c3aed;
}

.stat-card--companies .stat-icon {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.stat-card--violating::before {
  background: #dc2626;
}

.stat-card--violating .stat-icon {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.stat-card--violating-month::before {
  background: #f97316;
}

.stat-card--violating-month .stat-icon {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.stat-card--fines-total::before {
  background: #0891b2;
}

.stat-card--fines-total .stat-icon {
  background: rgba(8, 145, 178, 0.12);
  color: #0891b2;
}

.stat-card--fines-month::before {
  background: #2563eb;
}

.stat-card--fines-month .stat-icon {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.stat-card--revenue-total::before {
  background: #059669;
}

.stat-card--revenue-total .stat-icon {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.stat-card--revenue-month::before {
  background: #0d9488;
}

.stat-card--revenue-month .stat-icon {
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
}

.stats-grid-dashboard-row2 {
  margin-top: -8px;
}

@media (max-width: 1200px) {
  .stats-grid-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stats-grid-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.stat-card--online::before {
  background: #34a853;
}

.stat-card--offline::before {
  background: #ea4335;
}

.stat-card--weights::before {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.stat-card--online .stat-icon {
  background: rgba(52, 168, 83, 0.14);
  color: #34a853;
}

.stat-card--offline .stat-icon {
  background: rgba(234, 67, 53, 0.12);
  color: #ea4335;
}

.stat-card--weights .stat-icon {
  background: rgba(20, 184, 166, 0.14);
  color: var(--primary);
}

.stat-trend--online {
  color: #34a853;
}

.stat-trend--offline {
  color: #ea4335;
}

.stat-card--total::before {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card--total .stat-icon {
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary);
}

.stat-card--platform-active::before {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.stat-card--platform-active .stat-icon {
  background: rgba(20, 184, 166, 0.14);
  color: var(--primary);
}

.stat-card--platform-inactive::before {
  background: #94a3b8;
}

.stat-card--platform-inactive .stat-icon {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.stat-card--platform-inactive .value {
  color: #64748b;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-card .stat-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.stat-card .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 6px;
  letter-spacing: -0.03em;
}

.stat-card .stat-trend {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.55s ease backwards;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.card p {
  margin: 0 0 12px;
  color: var(--text-muted);
  line-height: 1.65;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.coming-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f0fdfa;
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 12px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #f8fafc;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow var(--transition), background var(--transition);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.4);
}

.btn-secondary {
  background: #f0fdfa;
  color: var(--primary-dark);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.btn-secondary:hover {
  background: #ccfbf1;
}

.btn-ghost,
.btn-header {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 0.85rem;
}

.btn-header:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.btn-header-danger:hover {
  border-color: #fecaca;
  color: var(--danger);
  background: var(--danger-bg);
}

.btn-icon svg {
  width: 1rem;
  height: 1rem;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

.alert-error {
  background: var(--danger-bg);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.profile-grid {
  display: grid;
  gap: 20px;
}

.profile-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.profile-row dt {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.coming-soon {
  color: var(--text-muted);
}

.breadcrumb-link {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb-link a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb-link a:hover {
  text-decoration: underline;
}

/* ═══════════════ DATA TABLE (Stations) ═══════════════ */
.data-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeUp 0.45s ease;
}

.data-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.data-panel-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.data-panel-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.data-panel-desc code {
  font-size: 0.85em;
  padding: 2px 6px;
  background: #f0fdfa;
  border-radius: 6px;
  color: var(--primary);
}

.data-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.summary-chip strong {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.summary-chip span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.summary-chip-accent {
  border-color: rgba(20, 184, 166, 0.4);
  background: linear-gradient(180deg, #f0fdfa, #fff);
}

.summary-chip-accent strong {
  color: var(--primary);
}

.summary-chip-warn {
  border-color: #f59e0b;
  background: #fffbeb;
}

.summary-chip-warn strong {
  color: #b45309;
}

.cell-coord {
  font-size: 0.8rem;
  white-space: nowrap;
}

.icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  line-height: 0;
  flex-shrink: 0;
}

.icon-glyph svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  stroke: currentColor;
}

.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-toolbar-icons {
  justify-content: space-between;
}

.data-toolbar--reports {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.toolbar-report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 200px;
  min-width: 0;
}

.toolbar-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
}

.toolbar-meta-chip strong {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.toolbar-meta-chip--accent strong {
  color: var(--accent);
}

.toolbar-icon-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-lead-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.toolbar-date-quick-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.toolbar-date-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toolbar-date-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar-date-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.toolbar-date-btn.is-active:hover {
  color: #fff;
  filter: brightness(1.05);
}

.toolbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary-dark);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.toolbar-icon-btn:hover {
  border-color: var(--accent);
  background: #f0fdfa;
  box-shadow: var(--shadow-sm);
}

.toolbar-icon-btn-download {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
  background: #eff6ff;
}

.toolbar-icon-btn-download:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e40af;
}

.toolbar-icon-btn-print {
  color: #475569;
  border-color: rgba(71, 85, 105, 0.25);
  background: #f8fafc;
}

.toolbar-icon-btn-print:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.export-dropdown {
  position: relative;
  display: inline-flex;
}

.export-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 120;
}

.export-dropdown-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.export-dropdown-item:hover {
  background: #f0fdfa;
  color: var(--primary-dark);
}

/* ═══════════════ EXPORT PROGRESS MODAL ═══════════════ */
.export-progress-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.export-progress-modal[hidden] {
  display: none;
}

.export-progress-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.export-progress-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 28px 28px 24px;
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg);
  animation: settings-modal-in 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.export-progress-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.export-progress-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(15, 118, 110, 0.12));
  color: var(--primary);
  flex-shrink: 0;
}

.export-progress-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.export-progress-head-text h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.export-progress-format {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.export-progress-hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.82rem;
  line-height: 1.55;
}

.export-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

.export-progress-bar {
  position: relative;
  z-index: 2;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.35s ease;
}

.export-progress-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: export-progress-shimmer 1.4s ease-in-out infinite;
}

.export-progress-modal.is-downloading .export-progress-shimmer {
  animation: none;
  opacity: 0;
}

@keyframes export-progress-shimmer {
  100% {
    transform: translateX(100%);
  }
}

.export-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.export-progress-message {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.export-progress-percent {
  font-size: 0.95rem;
  color: var(--primary-dark);
  font-weight: 800;
  flex-shrink: 0;
}

.export-progress-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.85rem;
  line-height: 1.5;
}

.export-progress-actions {
  display: flex;
  justify-content: flex-end;
}

.export-progress-modal.is-busy .js-export-cancel {
  pointer-events: auto;
}

[data-theme="dark"] .export-progress-hint {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

[data-theme="dark"] .export-progress-track {
  background: rgba(148, 163, 184, 0.2);
}

.toolbar-icon-btn-export {
  color: #166534;
  border-color: rgba(22, 101, 52, 0.25);
  background: #f0fdf4;
}

.toolbar-icon-btn-export:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

.toolbar-icon-btn-warn {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-bg);
}

.toolbar-icon-btn-warn:hover {
  background: #fee2e2;
}

.toolbar-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px var(--accent-glow);
}

.toolbar-per-page-form {
  display: flex;
  align-items: center;
  margin-right: auto;
}

.toolbar-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.toolbar-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.toolbar-search .form-control {
  padding-right: 42px;
}

.toolbar-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.toolbar-per-page select {
  width: auto;
  min-width: 72px;
  padding: 10px 12px;
}

.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table-wrap-wide {
  max-width: 100%;
}

.data-table-weights {
  min-width: 2000px;
}

.data-table-weights th,
.data-table-weights td {
  white-space: nowrap;
  max-width: 280px;
}

.data-table-weights .cell-truncate {
  max-width: 200px;
}

.data-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead {
  background: linear-gradient(180deg, var(--table-head-start) 0%, var(--table-head-end) 100%);
  color: #fff;
}

.data-table th {
  padding: 14px 16px;
  text-align: right;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tbody tr {
  background: var(--table-row);
}

.data-table tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

.data-table td {
  padding: 12px 16px;
  vertical-align: middle;
  max-width: 200px;
  color: var(--text);
}

.col-sticky-start {
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.04);
}

.col-actions.col-sticky-start,
.col-sticky-start.col-actions {
  z-index: 3;
}

.data-table thead .col-sticky-start {
  background: var(--table-head-start);
}

.data-table tbody tr .col-sticky-start {
  background: var(--table-row);
}

.data-table tbody tr:hover .col-sticky-start {
  background: var(--table-row-hover);
}

.data-table tbody tr:nth-child(even) .col-sticky-start {
  background: var(--table-row-alt);
}

.col-actions {
  min-width: 168px;
  text-align: center;
  white-space: nowrap;
}

.cell-mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.cell-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cell-truncate {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-empty {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--text-muted);
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.status-inactive {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* حالة الاتصال بالإنترنت (جدول المحطات) */
.status-online {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #6ee7b7;
}

.status-offline {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.icon-action:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.icon-action-teal {
  color: var(--primary);
  border-color: rgba(20, 184, 166, 0.4);
  background: #f0fdfa;
}

.icon-action-teal:hover {
  background: #ccfbf1;
}

.icon-action-map {
  color: #0369a1;
  border-color: rgba(59, 130, 246, 0.35);
  background: #eff6ff;
}

.icon-action-map:hover {
  background: #dbeafe;
}

.icon-action-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

button.icon-action {
  padding: 0;
  font: inherit;
}

.icon-action-danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
  background: var(--danger-bg);
}

.icon-action-danger:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

.action-group .admin-delete-form {
  display: inline-flex;
  margin: 0;
}

.data-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
}

.pagination-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pagination-meta strong {
  color: var(--text);
}

.pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.page-btn,
.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.page-btn:hover,
.page-num:hover {
  border-color: var(--accent);
  background: #f0fdfa;
  color: var(--primary);
}

.page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.page-btn-extra svg {
  margin-right: -10px;
  opacity: 0.5;
}

.page-num.is-current {
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.page-ellipsis {
  padding: 0 6px;
  color: var(--text-muted);
  font-weight: 700;
}

/* ═══════════════ MAP MODAL (OpenStreetMap / Leaflet) ═══════════════ */
body.modal-open {
  overflow: hidden;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.map-modal[hidden] {
  display: none !important;
}

.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.map-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: fadeUp 0.25s ease;
}

.map-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f0fdfa, #fff);
}

.map-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.map-modal-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.map-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.map-modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

.map-modal-close .icon-glyph {
  width: 1.35rem;
  height: 1.35rem;
}

.map-modal-canvas {
  width: 100%;
  height: min(420px, 55vh);
  min-height: 280px;
  background: #e2e8f0;
}

.map-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.map-modal-coords {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ═══════════════ STATIONS OVERVIEW MAP ═══════════════ */
.map-overview-panel .data-panel-head {
  flex-wrap: wrap;
}

.map-overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.map-toolbar-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  pointer-events: none;
  cursor: default;
  white-space: nowrap;
}

.map-toolbar-stat-value {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.map-toolbar-stat-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.map-toolbar-stat--online .map-toolbar-stat-value {
  color: #34a853;
}

.map-toolbar-stat--offline .map-toolbar-stat-value {
  color: #ea580c;
}

.map-toolbar-stat--stopped .map-toolbar-stat-value {
  color: #dc2626;
}

.map-toolbar-table-link {
  width: auto;
  white-space: nowrap;
}

.map-governorate-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(220px, 100%);
}

.map-gov-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.map-gov-select {
  min-width: 200px;
  max-width: 280px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.map-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.map-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.map-filter-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.map-filter-btn.is-active {
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.map-filter-btn.is-active.map-filter-btn-online {
  background: #34a853;
}

.map-filter-btn.is-active.map-filter-btn-offline {
  background: linear-gradient(135deg, #fbbf24, #dc2626);
}

.map-filter-btn.is-active:not(.map-filter-btn-online):not(.map-filter-btn-offline) {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.map-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.08);
}

.map-filter-btn.is-active .map-filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.map-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  flex-shrink: 0;
}

.map-filter-btn-online .map-legend-dot {
  background: #34a853;
}

.map-filter-btn-offline .map-legend-dot {
  background: linear-gradient(135deg, #fbbf24 50%, #dc2626 50%);
}

.map-filter-btn-stopped .map-legend-dot {
  background: #dc2626;
}

.map-filter-btn.is-active.map-filter-btn-stopped {
  background: #dc2626;
  border-color: #dc2626;
}

.map-legend-dot-all {
  background: linear-gradient(135deg, #34a853 33%, #fbbf24 33%, #fbbf24 66%, #dc2626 66%);
}

.stations-overview-map-wrap {
  position: relative;
  margin: 0 28px 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.stations-overview-map-wrap:fullscreen,
.stations-overview-map-wrap:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  margin: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  border: none;
  background: #e2e8f0;
}

.stations-overview-map-wrap--fullscreen .stations-overview-map,
.stations-overview-map-wrap:fullscreen .stations-overview-map,
.stations-overview-map-wrap:-webkit-full-screen .stations-overview-map {
  flex: 1 1 auto;
  width: 100%;
  height: auto !important;
  min-height: 0;
}

.stations-overview-map-wrap.stations-overview-map-wrap--fullscreen:not(:fullscreen):not(:-webkit-full-screen) {
  position: fixed;
  inset: 0;
  z-index: 2500;
  margin: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  background: #e2e8f0;
}

body.map-page-fullscreen {
  overflow: hidden;
}

.map-floating-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

[dir="rtl"] .map-floating-controls {
  right: auto;
  left: 12px;
  align-items: flex-start;
}

.map-layer-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: auto;
}

.map-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  pointer-events: auto;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.map-ctrl-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.map-ctrl-btn:hover {
  border-color: var(--accent);
}

.map-ctrl-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
}

.map-fullscreen-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  pointer-events: none;
}

.map-fullscreen-toggle .map-ctrl-btn {
  pointer-events: auto;
}

.map-fullscreen-toggle .map-ctrl-btn[hidden] {
  display: none !important;
}

.map-ctrl-btn-icon {
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

.map-ctrl-btn-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

[data-theme="dark"] .map-ctrl-btn {
  background: rgba(30, 41, 59, 0.94);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .map-ctrl-btn.is-active {
  color: #fff;
}

.stations-overview-map {
  width: 100%;
  height: min(640px, calc(100vh - 260px));
  min-height: 420px;
  background: #e2e8f0;
  z-index: 1;
}

.stations-overview-map--google {
  background: #e5e3df;
}

.stations-overview-map--google .gm-style {
  font: inherit;
}

.stations-overview-map.leaflet-container {
  font: inherit;
}

.map-load-error,
.map-load-error-inner {
  margin: 0;
  padding: 14px 18px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
}

#stations-map-load-error {
  margin: 0 28px 16px;
}

.map-key-check-link {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.map-probe-alert {
  margin: 0 0 12px;
}

.alert-success.map-probe-alert {
  color: #166534;
  background: #ecfdf5;
  border: 1px solid #34d399;
}

.map-check-dl {
  margin: 0 0 1.25rem;
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: minmax(140px, 220px) 1fr;
}

.map-check-dl dt {
  font-weight: 600;
  margin: 0;
}

.map-check-dl dd {
  margin: 0;
}

.map-check-steps {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
  line-height: 1.6;
}

.map-check-warn {
  margin: 0 0 1.25rem;
  padding: 12px 14px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.stations-overview-map--failed {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.map-overview-empty-overlay {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  margin: 0;
  padding: 12px 20px;
  max-width: 90%;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.map-overview-empty-overlay p {
  margin: 0;
}

.map-overview-empty-hint {
  margin-top: 8px !important;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.map-overview-panel {
  overflow: visible;
}

.wp-gmap-pin-marker {
  background: transparent !important;
  border: none !important;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
  padding: 10px 12px 6px;
  margin: -10px -12px -6px;
}

.wp-gmap-pin {
  display: block;
  line-height: 0;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.45));
}

.wp-gmap-pin svg {
  width: 34px;
  height: 44px;
  display: block;
}

.wp-gmap-pin-offline-active {
  position: relative;
}

.wp-gmap-pin-pulse {
  transform-origin: 50% 100%;
  animation: wp-gmap-pin-pulse 1.6s ease-in-out infinite;
}

.wp-gmap-pin-offline-active.wp-gmap-pin-pulse::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.45);
  animation: wp-gmap-pin-ring 1.6s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes wp-gmap-pin-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.45));
  }
  50% {
    transform: scale(1.14);
    filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.45))
      drop-shadow(0 0 10px rgba(251, 191, 36, 0.85));
  }
}

@keyframes wp-gmap-pin-ring {
  0% {
    transform: scale(0.55);
    opacity: 0.75;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.map-popup-row dd.map-popup-status-inactive {
  color: #dc2626;
  font-weight: 700;
}

/* ── Google Maps station popup (compact) ── */
.map-popup-card {
  min-width: min(92vw, 480px);
  max-width: 500px;
  font-size: 0.8rem;
  color: #0f172a;
}

.map-popup-head {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.map-popup-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
}

.map-popup-station-status {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.map-popup-status-key {
  color: #94a3b8;
  font-weight: 700;
}

.map-popup-station-status.is-connected .map-popup-status-val {
  color: #16a34a;
}

.map-popup-station-status.is-stopped .map-popup-status-val,
.map-popup-station-status.is-offline .map-popup-status-val {
  color: #dc2626;
}

.map-popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}

.map-popup-btn {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-2) 100%);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.32);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.map-popup-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.4);
}

.map-popup-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.map-popup-scales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.map-popup-scales-table thead th {
  padding: 8px 10px;
  text-align: start;
  font-weight: 800;
  color: #334155;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.map-popup-scales-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.map-popup-scales-table tbody tr:last-child td {
  border-bottom: none;
}

.map-popup-td-name {
  font-weight: 700;
  color: #0f172a;
  max-width: 120px;
}

.map-popup-td-status {
  font-weight: 700;
  white-space: nowrap;
}

.map-popup-td-status.is-connected {
  color: #16a34a;
}

.map-popup-td-status.is-stopped {
  color: #ca8a04;
}

.map-popup-td-time {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
  color: #475569;
  direction: ltr;
  text-align: start;
  white-space: nowrap;
}

.map-popup-empty {
  margin: 0;
  padding: 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
}

[data-theme="dark"] .map-popup-card {
  color: #e2e8f0;
}

[data-theme="dark"] .map-popup-title {
  color: #f8fafc;
}

[data-theme="dark"] .map-popup-head {
  border-bottom-color: #334155;
}

[data-theme="dark"] .map-popup-table-wrap {
  border-color: #334155;
}

[data-theme="dark"] .map-popup-scales-table thead th {
  background: #1e293b;
  color: #cbd5e1;
  border-bottom-color: #334155;
}

[data-theme="dark"] .map-popup-scales-table tbody td {
  border-bottom-color: #1e293b;
  color: #e2e8f0;
}

[data-theme="dark"] .map-popup-td-name {
  color: #f1f5f9;
}

[data-theme="dark"] .map-popup-td-time {
  color: #94a3b8;
}

.gm-style .gm-style-iw-c {
  max-width: min(92vw, 520px) !important;
  padding: 0 !important;
  background: #fff !important;
  color: #0f172a;
}

.gm-style .gm-style-iw-d {
  overflow: auto !important;
  max-height: min(70vh, 420px);
  padding: 14px 16px !important;
  background: #fff !important;
  color: #0f172a;
}

.gm-style .gm-style-iw-tc::after {
  background: #fff !important;
}

.map-popup-card .map-popup-title {
  color: #0f172a;
}

.map-popup-card .map-popup-station-status {
  color: #64748b;
}

html[data-theme="dark"] .gm-style .gm-style-iw-c,
html[data-theme="dark"] .gm-style .gm-style-iw-d,
.gm-style .gm-style-iw-c.map-infowindow--dark,
.gm-style .gm-style-iw-c.map-infowindow--dark .gm-style-iw-d {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .gm-style .gm-style-iw-tc::after,
.gm-style .gm-style-iw-c.map-infowindow--dark .gm-style-iw-tc::after {
  background: #1e293b !important;
}

html[data-theme="dark"] .map-popup-card .map-popup-title,
.gm-style .map-infowindow--dark .map-popup-title {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .map-popup-card .map-popup-station-status,
.gm-style .map-infowindow--dark .map-popup-station-status {
  color: #94a3b8;
}

html[data-theme="dark"] .map-popup-card .map-popup-status-key,
.gm-style .map-infowindow--dark .map-popup-status-key {
  color: #64748b;
}

html[data-theme="dark"] .map-popup-card .map-popup-empty,
.gm-style .map-infowindow--dark .map-popup-empty {
  color: #94a3b8;
}

.gm-style .gm-style-iw-c.map-infowindow--light,
.gm-style .gm-style-iw-c.map-infowindow--light .gm-style-iw-d {
  background: #fff !important;
  color: #0f172a !important;
}

.gm-style .gm-style-iw-c.map-infowindow--light .gm-style-iw-tc::after {
  background: #fff !important;
}

.gm-style .map-infowindow--light .map-popup-title {
  color: #0f172a !important;
}

.map-popup-station {
  min-width: 200px;
}

.map-popup-station--wide {
  min-width: min(92vw, 420px);
  max-width: 460px;
}

.map-popup-section-title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-muted, #64748b);
}

.map-popup-scales-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.map-popup-scales-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent, #0d9488);
}

.map-popup-scale-block {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.04);
  border-inline-start: 3px solid #94a3b8;
}

.map-popup-scale-block--online {
  border-inline-start-color: #34a853;
}

.map-popup-scale-block--offline-active {
  border-inline-start-color: #fbbf24;
}

.map-popup-scale-block--offline-inactive {
  border-inline-start-color: #dc2626;
}

.map-popup-scale-title {
  margin: 0 0 4px;
  font-size: 0.74rem;
  font-weight: 800;
}

.map-popup-no-scales {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
}

.report-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 4px;
}

.report-unit-fee-note {
  margin: 0;
  padding: 12px 16px 0;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
}

.data-table-reports .col-num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.scales-count-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--accent, #0d9488);
  text-decoration: none;
  transition: color var(--transition);
}

.scales-count-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.scales-count-link .scales-count-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.9;
}

.scales-count-link .scales-count-icon svg {
  width: 100%;
  height: 100%;
}

.map-popup-list {
  margin: 0;
  padding: 0;
}

.map-popup-list--compact .map-popup-row {
  padding: 4px 0;
  font-size: 0.72rem;
  gap: 4px 8px;
  grid-template-columns: minmax(6.5rem, 40%) 1fr;
}

.map-popup-row {
  display: grid;
  grid-template-columns: minmax(7rem, 42%) 1fr;
  gap: 6px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

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

.map-popup-row dt {
  margin: 0;
  font-weight: 700;
}

.map-popup-row dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.map-popup-row dd.map-popup-mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.84rem;
  direction: ltr;
  text-align: start;
}

.map-popup-list--compact .map-popup-row dd.map-popup-mono {
  font-size: 0.68rem;
}

.map-popup-row dd.map-popup-status-online {
  color: #34a853;
  font-weight: 700;
}

.map-popup-row dd.map-popup-status-offline {
  color: #ea4335;
  font-weight: 700;
}

.map-popup-row-status dd.is-online {
  color: #34a853;
}

.map-popup-row-status dd.is-offline {
  color: #ea4335;
}

.leaflet-popup.map-station-popup .leaflet-popup-content {
  margin: 12px 14px;
}

.leaflet-popup.map-station-popup .leaflet-popup-content-wrapper {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup.map-station-popup .leaflet-popup-tip {
  background: #ffffff;
}

.map-popup-row dt {
  color: #64748b;
}

.map-popup-row dd {
  color: #0f172a;
}

.leaflet-tooltip.map-station-tooltip {
  margin: 0 !important;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.leaflet-tooltip-top.map-station-tooltip,
.leaflet-tooltip-bottom.map-station-tooltip {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.leaflet-tooltip.map-station-tooltip::before {
  display: none;
}

.leaflet-tooltip.map-station-tooltip .leaflet-tooltip-content {
  margin: 0;
  padding: 0;
}

.leaflet-tooltip.map-station-tooltip .map-popup-station {
  min-width: 200px;
  padding: 10px 12px;
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.leaflet-tooltip.map-station-tooltip-online .map-popup-station {
  border-top: 3px solid #34a853;
}

.leaflet-tooltip.map-station-tooltip-offline .map-popup-station {
  border-top: 3px solid #ea4335;
}

[data-theme="dark"] .leaflet-tooltip.map-station-tooltip .map-popup-station {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .leaflet-tooltip.map-station-tooltip .map-popup-row dt {
  color: #e2e8f0;
}

[data-theme="dark"] .leaflet-tooltip.map-station-tooltip .map-popup-row dd {
  color: #f8fafc;
}

.leaflet-tooltip.map-tooltip-online,
.leaflet-tooltip.map-tooltip-offline {
  margin-top: 2px;
  padding: 3px 8px;
  font-size: 0.78rem;
  line-height: 1.25;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.leaflet-tooltip.map-tooltip-online {
  background: #059669;
  color: #fff;
  border: none;
  font-weight: 600;
}

.leaflet-tooltip.map-tooltip-offline {
  background: #ef4444;
  color: #fff;
  border: none;
  font-weight: 600;
}

[data-theme="dark"] .stations-overview-map {
  background: #0f172a;
}

[data-theme="dark"] .map-overview-empty {
  background: #172033;
}

[data-theme="dark"] .leaflet-popup.map-station-popup .leaflet-popup-content-wrapper {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

[data-theme="dark"] .leaflet-popup.map-station-popup .leaflet-popup-tip {
  background: var(--surface);
}

[data-theme="dark"] .map-popup-row {
  border-bottom-color: var(--border);
}

[data-theme="dark"] .map-popup-row dt {
  color: #e2e8f0;
}

[data-theme="dark"] .map-popup-row dd {
  color: #f8fafc;
}

/* خريطة المحطات — الوضع الليلي: نص أبيض واضح (بدون أخضر/teal) */
[data-theme="dark"] .map-overview-panel .data-panel-title,
[data-theme="dark"] .map-overview-panel .summary-chip strong,
[data-theme="dark"] .map-overview-panel .summary-chip-accent strong,
[data-theme="dark"] .map-overview-panel .map-filter-btn:not(.is-active),
[data-theme="dark"] .map-overview-panel .map-overview-toolbar .btn-secondary,
[data-theme="dark"] .map-overview-panel .map-overview-empty-overlay,
[data-theme="dark"] .map-overview-panel .map-overview-empty-overlay p,
[data-theme="dark"] .map-overview-panel .map-load-error,
[data-theme="dark"] .map-overview-panel .map-load-error-inner,
[data-theme="dark"] .map-overview-panel .stations-overview-map--failed .map-load-error-inner {
  color: #f8fafc;
}

[data-theme="dark"] .map-overview-panel .data-panel-desc,
[data-theme="dark"] .map-overview-panel .summary-chip span,
[data-theme="dark"] .map-overview-panel .map-overview-empty-hint {
  color: #e2e8f0;
}

[data-theme="dark"] .map-overview-panel .summary-chip-accent {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .map-overview-panel .map-filter-btn:not(.is-active) .map-filter-count {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

[data-theme="dark"] .map-overview-panel .map-overview-toolbar .btn-secondary {
  background: #334155;
  border-color: var(--border);
}

[data-theme="dark"] .map-overview-panel .map-overview-toolbar .btn-secondary:hover {
  background: #475569;
  color: #fff;
  border-color: #64748b;
}

[data-theme="dark"] .map-overview-panel .summary-chip-warn {
  background: rgba(245, 158, 11, 0.18);
  border-color: #b45309;
}

[data-theme="dark"] .map-overview-panel .summary-chip-warn strong,
[data-theme="dark"] .map-overview-panel .summary-chip-warn span {
  color: #fde68a;
}

[data-theme="dark"] .map-overview-panel .map-overview-empty-overlay {
  background: rgba(30, 41, 59, 0.96);
  color: #f8fafc;
  border-color: var(--border);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 0.85rem;
  width: auto;
}

/* ═══════════════ FILTER SHEET (bottom) ═══════════════ */
.filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.filter-sheet[hidden] {
  display: none !important;
}

.filter-sheet:not([hidden]) {
  pointer-events: auto;
}

.filter-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
}

.filter-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border);
  border-bottom: none;
  animation: sheetUp 0.3s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f0fdfa, #fff);
}

.filter-sheet-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.filter-sheet-form {
  padding: 20px 22px 24px;
}

.filter-sheet-hint {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.scale-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scale-settings-body {
  padding: 24px 28px 28px;
}

.scale-settings-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.scale-settings-form .scale-settings-meta {
  margin-top: 16px;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .scale-settings-grid {
    grid-template-columns: 1fr;
  }
}

.reports-filter-grid .form-group--full-span {
  grid-column: 1 / -1;
}

.form-control.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.filter-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.filter-sheet-actions .btn-primary {
  width: auto;
  flex: 1;
  min-width: 140px;
}

.filter-sheet-actions .btn-ghost,
.filter-sheet-actions .btn-secondary {
  width: auto;
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 960px) {
  .auth-page {
    padding-top: 72px;
  }

  .login-card {
    padding: 28px 22px 24px;
  }

  .btn.btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), visibility var(--transition);
  }

  .admin-shell.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 86vw);
    height: 100vh;
    height: 100dvh;
    z-index: 1200;
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }

  html[dir="rtl"] .admin-sidebar {
    right: 0;
    left: auto;
    transform: translateX(100%);
  }

  html[dir="ltr"] .admin-sidebar {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }

  .admin-shell.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .admin-content {
    padding: 20px 16px;
  }

  .welcome-banner {
    flex-direction: column;
    padding: 22px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .data-panel-head {
    padding: 18px 16px;
  }

  .data-toolbar {
    padding: 14px 16px;
  }

  .toolbar-per-page {
    margin-right: 0;
    width: 100%;
  }

  .data-pagination {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .pagination-nav {
    justify-content: center;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-per-page-form {
    width: 100%;
  }
}

/* ═══════════════ DARK THEME ═══════════════ */
[data-theme="dark"] {
  --sidebar-bg: #060d18;
  --sidebar-bg-2: #0a1424;
  --sidebar-text: #8b9cb8;
  --sidebar-text-active: #f1f5f9;
  --bg: #0f172a;
  --bg-mesh: radial-gradient(ellipse 80% 50% at 20% -10%, rgba(20, 184, 166, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(15, 118, 110, 0.06), transparent),
    #0f172a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-soft: rgba(148, 163, 184, 0.15);
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success-bg: rgba(5, 150, 105, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.45);
  --table-row: #1e293b;
  --table-row-alt: #172033;
  --table-row-hover: rgba(20, 184, 166, 0.1);
  --table-head-start: #1a2740;
  --table-head-end: #0f4c5c;
}

[data-theme="dark"] .form-control {
  background: #0f172a;
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .form-control:focus {
  background: #0f172a;
  border-color: var(--accent);
}

[data-theme="dark"] .data-table thead {
  background: linear-gradient(180deg, var(--table-head-start) 0%, var(--table-head-end) 100%);
}

[data-theme="dark"] .data-table th {
  background: transparent;
  color: #f1f5f9;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .data-table thead .col-sticky-start {
  background: var(--table-head-start);
}

[data-theme="dark"] .data-table tbody tr,
[data-theme="dark"] .data-table tbody tr .col-sticky-start {
  background: var(--table-row);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even),
[data-theme="dark"] .data-table tbody tr:nth-child(even) .col-sticky-start {
  background: var(--table-row-alt);
}

[data-theme="dark"] .data-table tbody tr:hover,
[data-theme="dark"] .data-table tbody tr:hover .col-sticky-start {
  background: var(--table-row-hover);
}

[data-theme="dark"] .data-table td {
  color: var(--text);
}

[data-theme="dark"] .cell-mono {
  color: #5eead4;
}

[data-theme="dark"] .data-panel-head {
  background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
}

[data-theme="dark"] .data-panel-title {
  color: #f8fafc;
}

[data-theme="dark"] .data-panel-desc {
  color: #e2e8f0;
}

[data-theme="dark"] .data-panel-desc code {
  background: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .summary-chip strong {
  color: #f8fafc;
}

[data-theme="dark"] .summary-chip span {
  color: #e2e8f0;
}

[data-theme="dark"] .summary-chip-accent {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .summary-chip-accent strong {
  color: #f8fafc;
}

/* أزرار/أيقونات التصفية في الجداول — نص وأيقونة بيضاء في الليلي */
[data-theme="dark"] .data-toolbar {
  background: #172033;
  border-bottom-color: var(--border);
}

[data-theme="dark"] .toolbar-icon-btn {
  background: var(--surface);
  border-color: var(--border);
  color: #f8fafc;
}

[data-theme="dark"] .toolbar-icon-btn .icon-glyph,
[data-theme="dark"] .toolbar-icon-btn .icon-glyph svg {
  color: #f8fafc;
  stroke: #f8fafc;
}

[data-theme="dark"] .toolbar-icon-btn:hover {
  background: #334155;
  border-color: #64748b;
  color: #fff;
}

[data-theme="dark"] .toolbar-icon-btn:hover .icon-glyph svg {
  stroke: #fff;
}

[data-theme="dark"] .toolbar-icon-btn-download {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}

[data-theme="dark"] .toolbar-icon-btn-download:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

[data-theme="dark"] .export-dropdown-menu {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .export-dropdown-item:hover {
  background: rgba(20, 184, 166, 0.12);
  color: #5eead4;
}

[data-theme="dark"] .toolbar-icon-btn-export {
  color: #f8fafc;
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .toolbar-icon-btn-export .icon-glyph svg {
  stroke: #f8fafc;
}

[data-theme="dark"] .toolbar-icon-btn-export:hover {
  background: #334155;
  border-color: #64748b;
  color: #fff;
}

[data-theme="dark"] .toolbar-icon-btn-export:hover .icon-glyph svg {
  stroke: #fff;
}

[data-theme="dark"] .toolbar-icon-btn-warn {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .toolbar-icon-btn-warn .icon-glyph svg {
  stroke: #fca5a5;
}

[data-theme="dark"] .toolbar-icon-btn-warn:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fee2e2;
}

[data-theme="dark"] .toolbar-icon-btn-warn:hover .icon-glyph svg {
  stroke: #fee2e2;
}

[data-theme="dark"] .toolbar-date-btn {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

[data-theme="dark"] .toolbar-date-btn:hover {
  border-color: #5eead4;
  color: #5eead4;
}

[data-theme="dark"] .toolbar-date-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

[data-theme="dark"] .toolbar-per-page,
[data-theme="dark"] .toolbar-per-page span {
  color: #e2e8f0;
}

[data-theme="dark"] .map-filter-btn:not(.is-active) {
  color: #f8fafc;
}

[data-theme="dark"] .map-filter-btn:not(.is-active):hover {
  background: #334155;
  border-color: #64748b;
  color: #fff;
}

[data-theme="dark"] .btn-secondary {
  background: rgba(20, 184, 166, 0.1);
  color: #5eead4;
  border-color: rgba(20, 184, 166, 0.25);
}

[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .btn-header {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .card,
[data-theme="dark"] .data-panel,
[data-theme="dark"] .stat-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .admin-header,
[data-theme="dark"] .admin-footer {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .filter-sheet-panel,
[data-theme="dark"] .map-modal-dialog {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .filter-sheet-header {
  background: linear-gradient(180deg, #1a2740 0%, var(--surface) 100%);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .filter-sheet-header h3 {
  color: var(--text);
}

[data-theme="dark"] .filter-sheet-header .map-modal-close,
[data-theme="dark"] .filter-sheet-header .map-modal-close .icon-glyph svg {
  color: var(--text);
  stroke: var(--text);
}

[data-theme="dark"] .filter-sheet-hint,
[data-theme="dark"] .filter-sheet-form .form-group label {
  color: var(--text-muted);
}

[data-theme="dark"] .data-pagination {
  background: #172033;
  border-top-color: var(--border);
}

[data-theme="dark"] .pagination-meta {
  color: var(--text-muted);
}

[data-theme="dark"] .pagination-meta strong {
  color: var(--text);
}

[data-theme="dark"] .page-btn,
[data-theme="dark"] .page-num {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .page-btn:hover,
[data-theme="dark"] .page-num:hover {
  background: var(--table-row-hover);
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .page-ellipsis {
  color: var(--text-muted);
}

[data-theme="dark"] .status-inactive {
  background: var(--danger-bg);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

html[lang="en"] body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
}

/* ═══════════════ SETTINGS MODAL ═══════════════ */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.settings-modal[hidden] {
  display: none !important;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

.settings-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: settings-modal-in 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes settings-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.settings-modal-head-text h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.settings-modal-head-text p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-modal-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.settings-modal-close:hover {
  color: var(--text);
  background: var(--surface);
}

.settings-modal-body {
  padding: 20px 24px 8px;
}

.settings-section + .settings-section {
  margin-top: 24px;
}

.settings-section-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.settings-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.settings-theme-card:hover {
  border-color: var(--accent);
}

.settings-theme-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.settings-theme-preview {
  width: 100%;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}

.settings-theme-preview-light {
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
}

.settings-theme-preview-dark {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
}

.settings-theme-card-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.settings-theme-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-lang-switch {
  display: flex;
  gap: 0;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.settings-lang-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.settings-lang-btn:hover {
  color: var(--text);
}

.settings-lang-btn.is-selected {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .settings-lang-btn.is-selected {
  color: #5eead4;
}

.settings-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border-soft);
}

.settings-save-hint {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
}

.settings-save-hint[hidden] {
  display: none !important;
}

.settings-modal-footer .btn-secondary {
  width: auto;
  margin: 0;
}

.auth-panel-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  pointer-events: none;
}

.auth-panel-toolbar .btn {
  pointer-events: auto;
}

[dir="ltr"] .auth-panel-toolbar {
  justify-content: flex-start;
}

/* ═══════════════ HEADER ICON TOOLBAR ═══════════════ */
.header-actions--icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-header-icon:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.btn-header-icon .btn-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-header-icon--glass {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

.btn-header-icon--glass:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.header-user-menu {
  position: relative;
}

.header-user-trigger {
  display: inline-flex;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  width: 42px;
  height: 42px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-user-trigger:hover,
.header-user-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 200;
}

.header-user-dropdown-name {
  margin: 4px 12px 10px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
}

.header-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  text-align: start;
}

.header-user-dropdown-item:hover {
  background: var(--surface-2, #f0fdfa);
  color: var(--primary);
}

.header-user-dropdown-item--danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.header-user-dropdown-item .icon-glyph svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.user-avatar-img {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: transparent;
  display: block;
}

/* ═══════════════ APP MODALS (admins / account) ═══════════════ */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.app-modal[hidden] {
  display: none !important;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.app-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: settings-modal-in 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.app-modal-panel--wide {
  width: min(920px, 100%);
}

.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.app-modal-header h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.app-modal-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--surface-2, #f1f5f9);
  color: var(--text-muted);
  cursor: pointer;
}

.app-modal-close:hover {
  background: #e2e8f0;
  color: var(--text);
}

.app-modal-toolbar {
  padding: 12px 24px;
}

.app-modal-body {
  padding: 0 24px 24px;
}

.app-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.app-modal-footer .btn {
  width: auto;
}

.account-modal-form .form-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.account-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.account-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.account-password-fieldset {
  margin: 16px 0 0;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.account-password-fieldset legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  width: auto;
}

.login-logs-filter {
  margin: 0 0 20px;
  padding: 20px;
}

.login-logs-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.login-logs-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.companies-add-card {
  margin-bottom: 0;
}

.companies-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* ═══════════════ NOTIFICATIONS BELL ═══════════════ */
.header-notifications {
  position: relative;
}

.btn-header-icon {
  position: relative;
}

.header-notifications-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  display: none;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 220;
  overflow: hidden;
}

.notifications-panel.is-open {
  display: flex;
}

.notifications-panel[hidden] {
  display: none !important;
}

.notifications-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.notifications-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.notifications-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-header-icon--sm {
  width: 34px;
  height: 34px;
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}

.notifications-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.notifications-item.is-unread {
  background: rgba(20, 184, 166, 0.08);
}

.notifications-item-msg {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.notifications-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notifications-item-time {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 0.8125rem;
}

.notifications-item-time-primary {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.notifications-item-time-ago {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.notifications-item-read {
  border: none;
  background: transparent;
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.notifications-item-read:hover {
  text-decoration: underline;
}

.notifications-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.notifications-panel-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--border-soft);
}

.notifications-panel-foot .btn {
  width: 100%;
}

.notifications-page-panel {
  max-width: 960px;
  margin-inline: auto;
  padding: 28px 32px;
}

.notifications-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.notifications-page-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
}

.notifications-page-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.notifications-page-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.notifications-list--page {
  max-height: none;
  overflow: visible;
  padding: 0;
}

.notifications-list--page .notifications-item {
  padding: 18px 4px;
}

.notifications-list--page .notifications-item-msg {
  font-size: 0.95rem;
}

.notifications-page-foot {
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.notification-prefs-form .notify-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

.notification-prefs-form .notify-switch-row--master {
  font-weight: 800;
}

.notification-prefs-group.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.notify-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.notify-switch-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}

.notify-switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
}

.notify-switch-input:checked + .notify-switch-ui {
  background: var(--accent);
}

.notify-switch-input:checked + .notify-switch-ui::after {
  transform: translateX(20px);
}

html[dir="rtl"] .notify-switch-input:checked + .notify-switch-ui::after {
  transform: translateX(-20px);
}

[data-theme="dark"] .header-user-dropdown {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .notifications-panel {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
}

/* ═══════════════ PRINT (جدول القائمة الحالية) ═══════════════ */
@media print {
  .admin-sidebar,
  .admin-header,
  .admin-drawer-backdrop,
  .data-toolbar,
  .data-pagination,
  .breadcrumb-link,
  .alert,
  .map-overview-panel,
  .export-dropdown,
  .js-table-print,
  .toolbar-icon-group,
  .filter-sheet,
  .modal-overlay {
    display: none !important;
  }

  .data-panel--printable .no-print,
  .data-table .no-print {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .admin-shell,
  .admin-main,
  .admin-content {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }

  .data-panel--printable {
    box-shadow: none !important;
    border: none !important;
    animation: none !important;
    overflow: visible !important;
  }

  .data-panel--printable::before {
    content: attr(data-print-title);
    display: block;
    margin: 0 0 10px;
    font-size: 16pt;
    font-weight: 800;
    color: #0f172a;
  }

  .data-panel--printable[data-print-subtitle]:not([data-print-subtitle=""])::after {
    content: attr(data-print-subtitle);
    display: block;
    margin: 0 0 14px;
    font-size: 10pt;
    color: #475569;
  }

  .data-table-wrap {
    overflow: visible !important;
    border: none !important;
  }

  .data-table {
    width: 100% !important;
    font-size: 9pt;
    border-collapse: collapse !important;
  }

  .data-table th,
  .data-table td {
    border: 1px solid #94a3b8 !important;
    padding: 4px 6px !important;
    color: #0f172a !important;
    background: #fff !important;
  }

  .data-table thead th {
    background: #e2e8f0 !important;
    font-weight: 700 !important;
  }

  .data-panel--print-landscape .data-table {
    font-size: 8.5pt;
  }

  .data-panel--print-landscape .data-table th,
  .data-panel--print-landscape .data-table td {
    padding: 3px 5px !important;
  }

  .col-sticky-start,
  .data-table .col-sticky-start {
    position: static !important;
    box-shadow: none !important;
  }

  .btn,
  .map-link-btn,
  a[href^="tel:"] {
    color: inherit !important;
    text-decoration: none !important;
  }
}

[data-theme="dark"] .app-modal-panel {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .login-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

[data-theme="dark"] .login-card h1 {
  color: #f1f5f9;
}

[data-theme="dark"] .login-card .sub {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .settings-theme-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-wrap: wrap;
  }
}

.fine-preview-sheet {
  border-radius: 12px;
  overflow: hidden;
}

.fine-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.fine-preview-item {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-height: 0;
  padding: 12px 16px;
  background: var(--surface);
}

.fine-preview-label {
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  white-space: nowrap;
}

.fine-preview-label::after {
  content: ':';
  margin-inline-start: 2px;
}

.fine-preview-value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.fine-preview-print-icon {
  display: inline-flex;
  margin-inline-end: 6px;
}

.fine-preview-print-icon svg {
  width: 16px;
  height: 16px;
}

.app-modal-footer--split {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.fine-settled-cell {
  white-space: nowrap;
  min-width: 7.5rem;
  text-align: center;
}

.fine-settled-head {
  min-width: 7.5rem;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .fine-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-modal-footer--split {
    flex-direction: column;
    align-items: stretch;
  }

  .app-modal-footer-actions {
    margin-inline-start: 0;
    justify-content: flex-end;
  }
}

/* ── Dashboard: station activity ── */
.dash-station-activity {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.dash-company-activity {
  margin-top: 28px;
}

.dash-station-activity-head {
  margin-bottom: 20px;
}

.dash-station-activity-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.dash-station-activity-subtitle {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.dash-station-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(150px, 1fr)) auto;
  gap: 16px;
  align-items: end;
}

.dash-station-filter-action .btn-primary {
  width: auto;
  min-width: 148px;
  white-space: nowrap;
}

.dash-station-filter-action-label {
  display: block;
  visibility: hidden;
  height: 0;
  margin: 0;
}

.dash-station-activity.is-loading {
  opacity: 0.82;
  pointer-events: none;
}

.dash-station-empty {
  margin-top: 20px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
}

.dash-station-results {
  margin-top: 20px;
}

.dash-station-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dash-station-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.dash-station-panel-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08) 0%, rgba(20, 184, 166, 0.04) 100%);
  border-bottom: 1px solid #e2e8f0;
}

.dash-station-panel-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f766e;
}

.dash-station-table-wrap {
  overflow-x: hidden;
  max-width: 100%;
}

.dash-station-table.data-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.dash-station-table {
  width: 100%;
  font-size: 0.82rem;
}

.dash-station-table th,
.dash-station-table td {
  padding: 8px 6px;
  vertical-align: middle;
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dash-station-table th {
  white-space: normal;
  line-height: 1.35;
  font-size: 0.72rem;
  hyphens: auto;
}

.dash-station-table td:nth-child(n + 2),
.dash-station-table th:nth-child(n + 2) {
  text-align: center;
}

.dash-station-table.js-dash-companies-table th:first-child,
.dash-station-table.js-dash-companies-table td:first-child,
.dash-station-table.js-dash-stations-table th:first-child,
.dash-station-table.js-dash-stations-table td:first-child {
  width: 38%;
  text-align: start;
}

.dash-station-table.js-dash-companies-table th:nth-child(n + 2),
.dash-station-table.js-dash-companies-table td:nth-child(n + 2),
.dash-station-table.js-dash-stations-table th:nth-child(n + 2),
.dash-station-table.js-dash-stations-table td:nth-child(n + 2) {
  width: 20.66%;
}

.dash-station-table.js-dash-top-axles-table th,
.dash-station-table.js-dash-top-axles-table td,
.dash-station-table.js-dash-bottom-axles-table th,
.dash-station-table.js-dash-bottom-axles-table td {
  width: 33.33%;
}

.dash-station-table-total td {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
}

.dash-station-table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 18px 12px !important;
}

.dash-station-chart-wrap {
  padding: 12px 14px 18px;
  margin-top: auto;
  min-height: 260px;
}

.dash-station-chart-wrap canvas {
  max-height: 240px;
}

@media (max-width: 1180px) {
  .dash-station-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .dash-station-filter-grid {
    grid-template-columns: 1fr;
  }

  .dash-station-filter-action .btn-primary {
    width: 100%;
  }
}

[data-theme="dark"] .dash-station-activity {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .dash-station-panel {
  background: rgba(15, 23, 42, 0.55);
  border-color: var(--border);
}

[data-theme="dark"] .dash-station-panel-head {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.12) 0%, rgba(15, 118, 110, 0.06) 100%);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .dash-station-empty {
  background: rgba(15, 23, 42, 0.45);
  border-color: var(--border);
}

[data-theme="dark"] .dash-station-table-total td {
  background: rgba(15, 23, 42, 0.35);
}

/* ── Backup page ── */
.backup-body {
  padding: 24px 28px 28px;
}

.backup-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: end;
}

.backup-filter-action {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.backup-filter-action-label {
  display: block;
  visibility: hidden;
  height: 0;
  margin: 0;
}

.backup-export-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.backup-export-icon svg {
  width: 18px;
  height: 18px;
}

.backup-sql-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.backup-sql-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backup-sql-db {
  margin: 0;
  font-size: 0.95rem;
}

.backup-sql-db-label {
  color: var(--text-muted);
  margin-inline-end: 6px;
}

.backup-sql-note {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.backup-sql-actions .backup-export-btn {
  width: auto;
  min-width: 220px;
}

.backup-sql-status {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.5;
}

.backup-sql-status--info {
  background: rgba(20, 184, 166, 0.1);
  color: #0f766e;
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.backup-sql-status--success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.backup-sql-status--error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.backup-export-btn.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

@media (max-width: 980px) {
  .backup-body {
    padding: 20px 22px 24px;
  }

  .backup-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .backup-body {
    padding: 16px 18px 20px;
  }

  .backup-filter-grid {
    grid-template-columns: 1fr;
  }
}
