/* Weight Program — Premium Admin UI v2 */
:root {
  --font: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --sidebar-bg: #ffffff;
  --sidebar-bg-2: #f8fafc;
  --sidebar-text: #64748b;
  --sidebar-text-active: #0f172a;
  --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: 300px;
  --sidebar-w-mini: 52px;
  --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);
}

[hidden] {
  display: none !important;
}

*,
*::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;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  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);
}

.auth-panel-version {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(248, 250, 252, 0.72);
}

.auth-panel-footer-sep {
  opacity: 0.45;
}

.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-chooser-panel {
  width: min(440px, 100%);
}

.login-chooser-user {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-chooser-actions {
  display: grid;
  gap: 10px;
}

.login-chooser-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: start;
  padding: 14px 16px;
  height: auto;
  white-space: normal;
}

.login-chooser-btn strong {
  font-size: 0.95rem;
}

.login-chooser-btn small {
  font-weight: 500;
  opacity: 0.85;
  line-height: 1.35;
}

.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-wrap.has-password-toggle .form-control {
  padding-left: 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;
}

.password-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  outline: none;
}

.password-toggle .icon-glyph svg {
  width: 1.1rem;
  height: 1.1rem;
}

[dir="ltr"] .input-wrap .form-control {
  padding-right: 12px;
  padding-left: 44px;
}

[dir="ltr"] .input-wrap.has-password-toggle .form-control {
  padding-right: 44px;
}

[dir="ltr"] .input-icon {
  right: auto;
  left: 14px;
}

[dir="ltr"] .password-toggle {
  left: auto;
  right: 8px;
}

/* ═══════════════ 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-end: 1px solid #e2e8f0;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 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 #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f766e;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  transition:
    transform var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.sidebar-rail-toggle:hover {
  color: #0f172a;
  border-color: rgba(20, 184, 166, 0.55);
  background: #f0fdfa;
  box-shadow:
    0 6px 18px rgba(20, 184, 166, 0.2),
    0 0 0 1px rgba(20, 184, 166, 0.15) 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: 10px;
  padding: 8px 8px 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px var(--accent-glow);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark-img {
  background: #fff;
  padding: 2px;
}

.brand-mark-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.brand-mark svg {
  width: 1.1rem;
  height: 1.1rem;
}

.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 {
  min-width: 0;
}

.brand-text strong {
  display: block;
  color: #0f172a;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.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.62rem;
  color: var(--sidebar-text);
  font-weight: 500;
  line-height: 1.2;
}

.sidebar-section {
  margin: 10px 10px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px 8px;
  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: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #0f766e;
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.76rem;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 8px rgba(15, 118, 110, 0.22);
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.nav-link .nav-label,
.nav-group-summary .nav-label {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.nav-link:hover {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
  border-color: #0d9488;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 6px 16px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.nav-link.is-active {
  background: linear-gradient(135deg, #0d9488 0%, #115e59 100%);
  border-color: #0f766e;
  color: #ffffff;
  box-shadow:
    0 0 0 2px rgba(20, 184, 166, 0.25),
    0 8px 20px rgba(15, 118, 110, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.nav-icon svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.nav-link.is-active .nav-icon,
.nav-group-summary:hover .nav-icon,
.nav-group[open] > .nav-group-summary .nav-icon {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.nav-link.is-active .nav-icon svg {
  stroke: #ffffff;
}

.nav-group {
  margin: 0;
}

.nav-group-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #0f766e;
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 0.76rem;
  line-height: 1.25;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 2px 8px rgba(15, 118, 110, 0.22);
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary::after {
  content: '';
  margin-inline-start: auto;
  width: 5px;
  height: 5px;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.95;
  transition: transform 0.15s ease;
}

.nav-group[open] > .nav-group-summary {
  border-color: #115e59;
  background: linear-gradient(180deg, #0d9488 0%, #115e59 100%);
  color: #ffffff;
  box-shadow:
    0 0 0 2px rgba(20, 184, 166, 0.2),
    0 8px 18px rgba(15, 118, 110, 0.3);
}

.nav-group[open] > .nav-group-summary::after {
  transform: rotate(-135deg);
}

.nav-group-summary:hover {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
  border-color: #0d9488;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 6px 16px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.nav-group-children {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0 2px 2px;
  margin-inline-start: 3px;
  border-inline-start: 2px solid #38bdf8;
}

/* أزرار الأبناء عند فتح الزر الرئيسي — أزرق مميز */
.nav-group[open] > .nav-group-children > .nav-link,
.nav-group[open] > .nav-group-children > .nav-group > .nav-group-summary {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border-color: #0369a1;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 12px rgba(2, 132, 199, 0.28);
}

.nav-group[open] > .nav-group-children > .nav-link:hover,
.nav-group[open] > .nav-group-children > .nav-group > .nav-group-summary:hover {
  background: linear-gradient(180deg, #7dd3fc 0%, #0ea5e9 100%);
  border-color: #0284c7;
  color: #ffffff;
}

.nav-group[open] > .nav-group-children > .nav-link.is-active {
  background: linear-gradient(135deg, #0284c7 0%, #075985 100%);
  border-color: #075985;
  color: #ffffff;
}

.nav-group[open] > .nav-group-children > .nav-link .nav-icon,
.nav-group[open] > .nav-group-children > .nav-group > .nav-group-summary .nav-icon {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

.nav-group[open] > .nav-group-children > .nav-link .nav-icon svg,
.nav-group[open] > .nav-group-children > .nav-group > .nav-group-summary .nav-icon svg {
  stroke: #ffffff;
}

.nav-group--nested {
  margin: 0;
}

.nav-group-summary--nested {
  padding: 5px 8px;
  font-size: 0.76rem;
  border-radius: 8px;
}

.nav-group-children--nested {
  padding-inline-start: 4px;
  margin-inline-start: 2px;
}

/* أحفاد المجموعة المفتوحة */
.nav-group[open] .nav-group-children--nested > .nav-link {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
  border-color: #6d28d9;
  color: #ffffff;
}

.nav-group[open] .nav-group-children--nested > .nav-link:hover {
  background: linear-gradient(180deg, #c4b5fd 0%, #8b5cf6 100%);
  border-color: #7c3aed;
}

.nav-group[open] .nav-group-children--nested > .nav-link.is-active {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border-color: #5b21b6;
}

.nav-link--nested,
.nav-link--child {
  padding: 5px 8px;
  font-size: 0.76rem;
  border-radius: 8px;
  font-weight: 700;
  gap: 6px;
}

.nav-indicator {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7), 0 0 14px var(--accent);
}

.sidebar-footer {
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.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: #0f172a;
  font-size: 0.9rem;
}

.user-meta span {
  font-size: 0.75rem;
  color: var(--sidebar-text);
}

.user-meta-machine {
  display: block;
  font-size: 0.68rem;
  color: var(--sidebar-text);
  opacity: 0.85;
}

/* ── 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: 6px;
  }

  .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: 8px;
    gap: 6px;
  }

  .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 #e2e8f0;
    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%;
}

.admin-content > .data-panel + .page-form-center {
  margin-top: 24px;
}

.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 h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}

.page-form-center .card--form-wide .filter-grid {
  margin-top: 4px;
}

.weight-invoice-create-primary {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0;
}

.weight-invoice-create-primary .form-control {
  font-size: 1.05rem;
  font-weight: 600;
}

.weight-invoice-create-meta {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.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);
}

.scale-current-account {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2, #f8fafc);
}

.scale-current-account.is-linked {
  border-color: rgba(20, 184, 166, 0.35);
  background: #f0fdfa;
}

.scale-current-account__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scale-current-account__value {
  font-size: 1.05rem;
  font-weight: 700;
}

.page-form-center .card--form-wide {
  overflow: visible;
}

.page-form-center .card--form-wide .filter-grid {
  overflow: visible;
  position: relative;
  z-index: 6;
}

.scale-chart-search-select {
  width: 100%;
}

.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-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.req {
  color: var(--danger);
  font-weight: 700;
}

.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-danger {
  background: var(--danger-bg);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: var(--danger);
  color: var(--danger);
}

.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;
}

.voucher-created-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 0 0 18px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #6ee7b7;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.08));
  box-shadow: var(--shadow-sm);
}

.voucher-created-banner__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.voucher-created-banner__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

.voucher-created-banner__no {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary-dark);
  line-height: 1.15;
  word-break: break-all;
}

.voucher-created-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.voucher-created-banner__msg {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.voucher-created-inline {
  margin: 6px 0 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.voucher-created-inline strong {
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 800;
}

[data-theme="dark"] .voucher-created-banner {
  border-color: rgba(52, 211, 153, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(15, 118, 110, 0.1));
}

[data-theme="dark"] .voucher-created-banner__no,
[data-theme="dark"] .voucher-created-inline strong {
  color: #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:has(.station-search-select) {
  overflow: visible;
}

.filter-grid:has(.station-search-select) {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.filter-sheet-panel:has(.station-search-select.is-open) {
  /* أبقِ ارتفاع اللوحة ثابتاً؛ القائمة المنسدلة تُدار عبر z-index داخل النموذج */
  overflow: hidden;
}

.filter-sheet-form:has(.station-search-select.is-open) {
  overflow-x: visible;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

.dash-station-filter-grid:has(.station-search-select) {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.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;
}

.stats-grid-weights-hosts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.weights-host-breakdown {
  margin-bottom: 16px;
}

.weights-host-breakdown .data-panel-head {
  padding-bottom: 8px;
}

.weights-host-breakdown .data-panel-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.weights-host-breakdown .data-panel-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.weights-host-chips {
  padding: 0 18px 16px;
}

.weights-host-chip-sub {
  font-size: 0.68rem !important;
  font-weight: 500 !important;
  color: var(--text-muted);
  margin-top: 2px !important;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .stats-grid-weights-hosts {
    grid-template-columns: 1fr;
  }
}

.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-custody-quick-filters {
  padding-inline-end: 10px;
  border-inline-end: 1px solid var(--border);
  margin-inline-end: 4px;
}

.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;
  gap: 8px;
  margin-right: auto;
}

.js-wp-table-cols-open {
  flex-shrink: 0;
}

.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: auto;
  max-height: calc(100dvh - 13.5rem);
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--table-row);
}

.data-table-wrap-wide {
  max-width: 100%;
}

/* تجميد صف عناوين الأعمدة عند التمرير للأسفل */
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: linear-gradient(180deg, var(--table-head-start) 0%, var(--table-head-end) 100%);
  color: #fff;
}

.data-table thead th.col-sticky-start,
.data-table thead th.col-sticky-address,
.data-table thead th.col-actions.col-sticky-start {
  z-index: 8;
  background: var(--table-head-start);
}

.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-weights tbody tr.weights-row--violating,
.data-table-weights tbody tr.weights-row--violating .col-sticky-start,
.data-table-weights tbody tr.weights-row--violating .col-sticky-address {
  background: var(--danger-bg) !important;
  color: var(--danger);
}

.data-table-weights tbody tr.weights-row--violating td {
  color: var(--danger) !important;
  font-weight: 600;
}

.data-table-weights tbody tr.weights-row--violating:nth-child(even),
.data-table-weights tbody tr.weights-row--violating:nth-child(even) .col-sticky-start,
.data-table-weights tbody tr.weights-row--violating:nth-child(even) .col-sticky-address {
  background: color-mix(in srgb, var(--danger-bg) 88%, var(--danger) 12%) !important;
}

.data-table-weights tbody tr.weights-row--violating:hover,
.data-table-weights tbody tr.weights-row--violating:hover .col-sticky-start,
.data-table-weights tbody tr.weights-row--violating:hover .col-sticky-address {
  background: color-mix(in srgb, var(--danger-bg) 70%, var(--danger) 30%) !important;
}

[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating .col-sticky-start,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating .col-sticky-address,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:nth-child(even),
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:nth-child(even) .col-sticky-start,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:nth-child(even) .col-sticky-address {
  background: rgba(239, 68, 68, 0.18) !important;
}

[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:hover,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:hover .col-sticky-start,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:hover .col-sticky-address {
  background: rgba(239, 68, 68, 0.28) !important;
}

[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating td {
  color: #fca5a5 !important;
}

.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);
}

/* عمود البيان في قوائم السندات: العرض حسب نص الخلية دون ضغطه */
.data-table-vouchers th.col-desc,
.data-table-vouchers td.col-desc {
  max-width: none;
  width: auto;
  min-width: 12rem;
  min-width: max-content;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.data-table-vouchers {
  width: max-content;
  min-width: 100%;
}

/* إجراءات السندات: أقصى اليمين دائماً (بداية الجدول في RTL) */
.data-table-vouchers th.col-actions.col-sticky-start,
.data-table-vouchers td.col-actions.col-sticky-start {
  position: sticky;
  inset-inline-start: 0;
  right: 0;
  left: auto;
  z-index: 5;
  max-width: none;
  min-width: 11rem;
  background: var(--table-row);
  box-shadow: -6px 0 14px rgba(15, 23, 42, 0.08);
}

html[dir="ltr"] .data-table-vouchers th.col-actions.col-sticky-start,
html[dir="ltr"] .data-table-vouchers td.col-actions.col-sticky-start {
  right: auto;
  left: 0;
  box-shadow: 6px 0 14px rgba(15, 23, 42, 0.08);
}

.data-table-vouchers thead th.col-actions.col-sticky-start {
  z-index: 6;
  background: var(--table-head-start);
}

.data-table-vouchers tbody tr:nth-child(even) td.col-actions.col-sticky-start {
  background: var(--table-row-alt);
}

.data-table-vouchers tbody tr:hover td.col-actions.col-sticky-start {
  background: var(--table-row-hover);
}

[data-theme="dark"] .data-table-vouchers th.col-actions.col-sticky-start,
[data-theme="dark"] .data-table-vouchers td.col-actions.col-sticky-start {
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.35);
}

.col-sticky-start {
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.04);
}

/* تجميد عمود العنوان (Address) في كل تقارير الأوزان/المركبات */
.col-sticky-address {
  position: sticky;
  inset-inline-end: 0;
  z-index: 2;
  background: inherit;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.04);
  min-width: 8.5rem;
  max-width: 14rem;
}

html[dir="ltr"] .col-sticky-address {
  box-shadow: 4px 0 8px rgba(15, 23, 42, 0.04);
}

.data-table thead .col-sticky-address {
  background: var(--table-head-start);
  z-index: 4;
}

.data-table tbody tr .col-sticky-address {
  background: var(--table-row);
}

.data-table tbody tr:nth-child(even) .col-sticky-address {
  background: var(--table-row-alt);
}

.data-table tbody tr:hover .col-sticky-address {
  background: var(--table-row-hover);
}

/* عند وجود عمود إجراءات مجمّد: العنوان بعده مباشرة */
.data-table:has(.col-actions.col-sticky-start) .col-sticky-address {
  inset-inline-end: 10.5rem;
}

.data-table:has(.col-actions.col-sticky-start) .col-actions.col-sticky-start {
  z-index: 5;
}

.data-table-weights tbody tr.weights-row--violating .col-sticky-address {
  background: var(--danger-bg);
  color: var(--danger);
}

.data-table-weights tbody tr.weights-row--violating:nth-child(even) .col-sticky-address {
  background: color-mix(in srgb, var(--danger-bg) 88%, var(--danger) 12%);
}

.data-table-weights tbody tr.weights-row--violating:hover .col-sticky-address {
  background: color-mix(in srgb, var(--danger-bg) 70%, var(--danger) 30%);
}

[data-theme="dark"] .data-table thead .col-sticky-address {
  background: var(--table-head-start);
}

[data-theme="dark"] .data-table tbody tr .col-sticky-address {
  background: var(--table-row);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) .col-sticky-address {
  background: var(--table-row-alt);
}

[data-theme="dark"] .data-table tbody tr:hover .col-sticky-address {
  background: var(--table-row-hover);
}

[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating .col-sticky-address,
[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:nth-child(even) .col-sticky-address {
  background: rgba(239, 68, 68, 0.18);
}

[data-theme="dark"] .data-table-weights tbody tr.weights-row--violating:hover .col-sticky-address {
  background: rgba(239, 68, 68, 0.28);
}

.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;
}

/* جدول المحطات: عمود الإجراءات يتسع ولا يطفح فوق اسم المحطة */
.data-table--stations th.col-actions.col-sticky-start,
.data-table--stations td.col-actions.col-sticky-start {
  min-width: 15.5rem;
  max-width: none;
  width: 15.5rem;
  padding-inline: 10px;
  overflow: hidden;
  vertical-align: middle;
  background: var(--table-row);
  box-shadow: -8px 0 16px rgba(15, 23, 42, 0.1);
  z-index: 5;
}

.data-table--stations thead th.col-actions.col-sticky-start {
  background: var(--table-head-start);
  z-index: 6;
}

.data-table--stations tbody tr:nth-child(even) td.col-actions.col-sticky-start {
  background: var(--table-row-alt);
}

.data-table--stations tbody tr:hover td.col-actions.col-sticky-start {
  background: var(--table-row-hover);
}

.data-table--stations .action-group {
  flex-wrap: wrap;
  max-width: 100%;
  gap: 4px;
  justify-content: flex-start;
}

.data-table--stations .stations-name-cell {
  position: relative;
  z-index: 1;
  min-width: max-content;
  width: auto;
  max-width: none;
  padding-inline-start: 12px;
  background: inherit;
  white-space: nowrap;
}

.data-table--stations .stations-name-cell strong {
  display: inline;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  vertical-align: middle;
}

.data-table--stations .stations-name-cell .icon-action,
.data-table--stations .stations-name-cell .icon-glyph {
  display: none !important;
}

.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-redirected {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  margin-inline-start: 8px;
  font-weight: 700;
}

.status-unknown {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  margin-inline-start: 8px;
  font-weight: 700;
}

.stations-name-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}

.stations-row--redirected td {
  background: color-mix(in srgb, #fff7ed 55%, transparent);
}

.stations-row--unknown td {
  background: color-mix(in srgb, #f1f5f9 70%, transparent);
}

[data-theme="dark"] .status-redirected {
  background: rgba(194, 65, 12, 0.2);
  color: #fdba74;
  border-color: rgba(253, 186, 116, 0.35);
}

[data-theme="dark"] .status-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] .stations-row--redirected td {
  background: rgba(194, 65, 12, 0.08);
}

[data-theme="dark"] .stations-row--unknown td {
  background: rgba(148, 163, 184, 0.08);
}

/* حالة الاتصال بالإنترنت (جدول المحطات) */
.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;
}

.status-badge.status-station-hub {
  background: rgba(12, 74, 78, 0.12);
  color: #0c4a4e;
  border: 1px solid rgba(12, 74, 78, 0.25);
  font-weight: 800;
}

.status-badge.status-scale-linked {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  border: 1px solid rgba(20, 184, 166, 0.28);
  font-weight: 700;
}

.scale-row--station {
  background: linear-gradient(90deg, rgba(12, 74, 78, 0.08), transparent 55%);
}

.scale-row--station td {
  border-bottom-color: rgba(12, 74, 78, 0.18);
}

.scale-row--linked td:first-child {
  box-shadow: inset 3px 0 0 rgba(20, 184, 166, 0.55);
}

[dir="rtl"] .scale-row--linked td:first-child {
  box-shadow: inset -3px 0 0 rgba(20, 184, 166, 0.55);
}

.scale-row-sub {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

[data-theme="dark"] .status-badge.status-station-hub {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.28);
}

[data-theme="dark"] .status-badge.status-scale-linked {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.28);
}

[data-theme="dark"] .scale-row--station {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.1), transparent 55%);
}

.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);
}

.icon-action-merge {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.28);
}

.icon-action-merge:hover {
  color: #115e59;
  background: rgba(20, 184, 166, 0.14);
}

.icon-action-split {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.28);
}

.icon-action-split:hover {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
}

.scale-chart-account-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-width: 220px;
}

.scale-chart-account-form .station-search-select {
  flex: 1 1 180px;
  min-width: 160px;
}

.data-table-wrap:has(.scale-chart-account-form .station-search-select.is-open),
.data-panel:has(.scale-chart-account-form .station-search-select.is-open) {
  overflow: visible;
}

.station-merge-panel {
  max-width: 520px;
}

.station-merge-hint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.station-merge-form .form-group {
  margin-bottom: 12px;
}

.station-merge-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}

.station-merge-confirm input {
  margin-top: 3px;
  flex-shrink: 0;
}

.station-merge-progress {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(240, 253, 250, 0.7);
}

.station-merge-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text);
}

.station-merge-progress__track {
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  overflow: hidden;
}

.station-merge-progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  transition: width 0.25s ease;
}

.station-merge-progress__detail {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

[data-theme="dark"] .station-merge-progress {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(45, 212, 191, 0.22);
}

.action-group .admin-delete-form {
  display: inline-flex;
  margin: 0;
}

.users-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 28px 16px;
}

.users-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.users-view-toggle__btn:hover {
  border-color: var(--primary, #0f766e);
  color: var(--primary, #0f766e);
}

.users-view-toggle__btn.is-active {
  background: var(--primary, #0f766e);
  border-color: var(--primary, #0f766e);
  color: #fff;
}

.users-view-toggle__count {
  display: inline-flex;
  min-width: 1.5rem;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
}

.users-view-toggle__btn.is-active .users-view-toggle__count {
  background: rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .users-view-toggle__btn {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text);
}

[data-theme="dark"] .users-view-toggle__btn.is-active {
  background: var(--primary, #0f766e);
  border-color: var(--primary, #0f766e);
  color: #fff;
}

.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-toolbar-actions .js-map-refresh {
  pointer-events: auto;
  cursor: pointer;
}

.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: #f59e0b;
}

.map-filter-btn.is-active:not(.map-filter-btn-online):not(.map-filter-btn-offline):not(.map-filter-btn-stopped) {
  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: #f59e0b;
}

.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%, #f59e0b 33%, #f59e0b 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);
}

/* أزرار أعلى الخريطة: قائمة المحطات + ملء الشاشة جنباً إلى جنب */
.map-top-controls {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 1020;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  max-width: calc(100% - 24px);
  pointer-events: none;
}

.map-top-controls > * {
  pointer-events: auto;
}

/* قائمة المحطات — شريط جانبي صغير عمودي */
.map-stations-rail {
  position: relative;
  top: auto;
  inset-inline-start: auto;
  z-index: 1;
  width: 188px;
  max-width: min(188px, calc(100vw - 90px));
  max-height: min(58%, 340px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(
    160deg,
    rgba(248, 250, 252, 0.96) 0%,
    rgba(241, 245, 249, 0.9) 100%
  );
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.map-stations-rail.is-collapsed {
  display: none !important;
}

.map-stations-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.map-stations-rail-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.map-stations-rail-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(52, 168, 83, 0.12);
  color: #15803d;
  flex-shrink: 0;
}

.map-stations-rail-icon svg {
  width: 12px;
  height: 12px;
}

.map-stations-rail-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-stations-rail-count {
  flex-shrink: 0;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f172a;
  background: rgba(15, 23, 42, 0.07);
}

.map-stations-rail-toggle {
  appearance: none;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.map-stations-rail-toggle svg {
  width: 13px;
  height: 13px;
}

.map-stations-rail-toggle:hover {
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.65);
  background: #fff;
}

.map-stations-rail-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 280px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.map-stations-rail-group + .map-stations-rail-group {
  margin-top: 6px;
}

.map-stations-rail-group-label {
  display: block;
  margin: 0 2px 4px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.map-stations-rail-chips {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 2px;
  width: 100%;
}

.map-station-chip {
  appearance: none;
  width: 100%;
  border: none;
  background: transparent;
  color: #0f172a;
  border-radius: 6px;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: start;
  box-sizing: border-box;
  box-shadow: none;
  transition: background 0.12s ease;
}

.map-station-chip:hover {
  transform: none;
  box-shadow: none;
  background: rgba(15, 23, 42, 0.05);
}

.map-station-chip.is-active {
  border: none;
  box-shadow: none;
  background: rgba(37, 99, 235, 0.1);
}

.map-station-chip-signal {
  width: 16px;
  height: 16px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent !important;
  box-shadow: none !important;
  animation: none !important;
}

.map-station-chip-signal svg {
  width: 13px;
  height: 13px;
}

.map-station-chip.is-online .map-station-chip-signal {
  color: #15803d;
}

.map-station-chip.is-offline .map-station-chip-signal {
  color: #b45309;
}

.map-station-chip.is-stopped .map-station-chip-signal {
  color: #b91c1c;
}

.map-station-chip-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.map-station-chip-name {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.map-station-chip-status {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 1;
}

.map-station-chip.is-online .map-station-chip-status {
  color: #15803d;
}

.map-station-chip.is-offline .map-station-chip-status {
  color: #b45309;
}

.map-station-chip.is-stopped .map-station-chip-status {
  color: #b91c1c;
}

.map-stations-rail-empty {
  margin: 2px;
  font-size: 0.72rem;
  color: #64748b;
}

.map-stations-rail-fab {
  position: relative;
  top: auto;
  inset-inline-start: auto;
  z-index: 1;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(248, 250, 252, 0.95);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.map-stations-rail-fab[hidden] {
  display: none !important;
}

.map-stations-rail-fab-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(52, 168, 83, 0.16);
  color: #15803d;
}

.map-stations-rail-fab-icon svg {
  width: 12px;
  height: 12px;
}

.map-stations-rail-fab-count {
  min-width: 1.2rem;
  font-size: 0.72rem;
  font-weight: 800;
}

[data-theme="dark"] .map-stations-rail,
[data-theme="dark"] .map-stations-rail-fab {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(
    160deg,
    rgba(15, 23, 42, 0.94) 0%,
    rgba(30, 41, 59, 0.9) 100%
  );
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
}

[data-theme="dark"] .map-stations-rail-title,
[data-theme="dark"] .map-stations-rail-count,
[data-theme="dark"] .map-station-chip {
  color: #e2e8f0;
}

[data-theme="dark"] .map-stations-rail-count,
[data-theme="dark"] .map-stations-rail-toggle {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

[data-theme="dark"] .map-station-chip:hover {
  background: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .map-station-chip.is-active {
  background: rgba(59, 130, 246, 0.18);
}

[data-theme="dark"] .map-stations-rail-group-label,
[data-theme="dark"] .map-stations-rail-empty {
  color: #94a3b8;
}

@media (max-width: 720px) {
  .map-top-controls {
    top: 56px;
    max-width: calc(100% - 16px);
  }

  .map-stations-rail {
    width: 168px;
    max-height: min(48%, 280px);
  }
}

.stations-overview-map-wrap:fullscreen,
.stations-overview-map-wrap:-webkit-full-screen {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  width: 100% !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  background: #e2e8f0;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* وضع ملء الشاشة (CSS) — يعمل على Safari/ماك حتى بدون Fullscreen API */
.stations-overview-map-wrap.stations-overview-map-wrap--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 2500 !important;
  margin: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  background: #e2e8f0;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.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 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.map-page-fullscreen {
  overflow: hidden !important;
  height: 100% !important;
}

body.map-page-fullscreen .map-overview-panel,
body.map-page-fullscreen .data-panel {
  overflow: visible !important;
}

.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: relative;
  top: auto;
  inset-inline-end: auto;
  right: auto;
  left: auto;
  z-index: 1;
  flex-shrink: 0;
  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;
}

.map-ctrl-btn.is-loading svg {
  animation: map-refresh-spin 0.85s linear infinite;
}

@keyframes map-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

[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;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0;
  line-height: 0;
}

.wp-gmap-pin-nc {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  padding: 4px 8px 4px 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #111827 0%, #020617 100%);
  border: 1px solid #334155;
  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
  direction: rtl;
}

.wp-gmap-pin-nc-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  letter-spacing: 0;
}

.wp-gmap-pin-nc-value {
  display: inline-block;
  min-width: 2.4em;
  padding: 3px 7px;
  border-radius: 4px;
  background: #02140a;
  border: 1px solid #065f46;
  color: #4ade80;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Courier New', ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 0 6px rgba(74, 222, 128, 0.55);
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.18);
}

.wp-gmap-pin-nc-value.is-updated {
  animation: dash-live-flash 0.55s ease;
}

[data-theme='dark'] .wp-gmap-pin-nc {
  border-color: #475569;
}

[data-theme='dark'] .wp-gmap-pin-nc-value {
  color: #86efac;
  border-color: #059669;
}

.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,
.wp-gmap-pin-online,
.wp-gmap-pin-offline-inactive {
  position: relative;
}

.wp-gmap-pin-pulse {
  transform-origin: 50% 100%;
  animation: wp-gmap-pin-pulse 1.6s ease-in-out infinite;
}

.wp-gmap-pin-online.wp-gmap-pin-pulse {
  animation-name: wp-gmap-pin-pulse-online;
}

.wp-gmap-pin-offline-inactive.wp-gmap-pin-pulse {
  animation-name: wp-gmap-pin-pulse-offline;
}

.wp-gmap-pin-offline-active.wp-gmap-pin-pulse::before,
.wp-gmap-pin-online.wp-gmap-pin-pulse::before,
.wp-gmap-pin-offline-inactive.wp-gmap-pin-pulse::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  animation: wp-gmap-pin-ring 1.6s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

.wp-gmap-pin-offline-active.wp-gmap-pin-pulse::before {
  background: rgba(245, 158, 11, 0.45);
}

.wp-gmap-pin-online.wp-gmap-pin-pulse::before {
  background: rgba(52, 168, 83, 0.45);
}

.wp-gmap-pin-offline-inactive.wp-gmap-pin-pulse::before {
  background: rgba(220, 38, 38, 0.45);
}

@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-pulse-online {
  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(52, 168, 83, 0.85));
  }
}

@keyframes wp-gmap-pin-pulse-offline {
  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(220, 38, 38, 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-meta-line {
  margin: 4px 0 0;
  font-size: 0.8rem;
  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-offline .map-popup-status-val {
  color: #d97706;
}

.map-popup-station-status.is-stopped .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: #f59e0b;
}

.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;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: min(92dvh, 85vh);
  overflow: hidden;
  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;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@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;
  flex: 0 0 auto;
  padding: 16px 18px;
  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 {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 18px 0;
}

.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: 14px;
  width: 100%;
  min-width: 0;
}

.filter-grid .form-group,
.filter-grid .form-group .form-control,
.filter-grid .form-group select,
.filter-grid .form-group input {
  min-width: 0;
  max-width: 100%;
}

.filter-grid .form-group--full-span {
  grid-column: 1 / -1;
}

.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;
}

/* النظام المحاسبي — تسليم واستلام العهدة */
.custody-receive-summary {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.custody-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 0;
}

.custody-summary-grid > div {
  margin: 0;
}

.custody-summary-grid dt {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.custody-summary-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.custody-summary-grid-full {
  grid-column: 1 / -1;
}

.custody-summary-grid--compact {
  margin-bottom: 20px;
}

.weight-invoice-next-no {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary, #0f766e);
  letter-spacing: 0.02em;
}

.weight-invoice-print-number {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 2px solid var(--primary, #0f766e);
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
}

.weight-invoice-print-number-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.weight-invoice-print-number-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary, #0f766e);
  letter-spacing: 0.03em;
}

@media print {
  .weight-invoice-print-number {
    border-color: #0f766e;
    background: transparent;
  }

  .weight-invoice-print-number-value {
    font-size: 22pt;
  }
}

.custody-voucher-print-title {
  display: none;
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: var(--primary, #0f766e);
}

.custody-voucher-print-meta {
  margin: 0 0 16px;
  color: var(--muted, #64748b);
}

.custody-voucher-edit {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.custody-voucher-edit h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

@media print {
  .custody-voucher-print-title {
    display: block;
  }

  .custody-voucher-edit {
    display: none !important;
  }
}

.custody-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
}

.custody-confirm-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.card-empty {
  padding: 24px 28px 28px;
}

@media (max-width: 640px) {
  .custody-summary-grid {
    grid-template-columns: 1fr;
  }
}

@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;
  align-items: stretch;
  gap: 10px;
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin: 16px -18px 0;
  padding: 14px 18px max(14px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.08);
}

.filter-sheet-actions .btn-primary {
  width: auto;
  flex: 1 1 160px;
  min-width: min(160px, 100%);
}

.filter-sheet-actions .btn-ghost,
.filter-sheet-actions .btn-secondary {
  width: auto;
  flex: 0 1 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;
  }

  .filter-sheet-panel {
    width: 100%;
    max-height: min(94dvh, 92vh);
    border-radius: 16px 16px 0 0;
  }

  .filter-sheet-header {
    padding: 14px 16px;
  }

  .filter-sheet-form {
    padding: 14px 16px 0;
  }

  .filter-sheet-actions {
    margin-left: -16px;
    margin-right: -16px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom, 0px));
  }

  .filter-sheet-actions .btn-primary,
  .filter-sheet-actions .btn-ghost,
  .filter-sheet-actions .btn-secondary {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .toolbar-per-page-form {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-sheet-header h3 {
    font-size: 1rem;
  }

  .filter-sheet-hint {
    font-size: 0.82rem;
  }
}

@media (max-width: 420px) {
  .filter-sheet-actions {
    gap: 8px;
  }
}

/* ═══════════════ DARK THEME ═══════════════ */
[data-theme="dark"] {
  --sidebar-bg: #ffffff;
  --sidebar-bg-2: #f8fafc;
  --sidebar-text: #64748b;
  --sidebar-text-active: #0f172a;
  --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 th {
  background: linear-gradient(180deg, var(--table-head-start) 0%, var(--table-head-end) 100%);
  color: #f1f5f9;
}

[data-theme="dark"] .data-table thead .col-sticky-start,
[data-theme="dark"] .data-table thead .col-sticky-address {
  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"] .filter-sheet-actions {
  background: var(--surface);
  border-top-color: var(--border);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
}

[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;
}

.header-custody-alert {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, 46vw);
  padding: 7px 12px 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  text-decoration: none;
  position: relative;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.header-custody-alert:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(217, 119, 6, 0.7);
  color: #78350f;
}

.header-custody-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.25);
}

.header-custody-alert-icon .icon-glyph svg {
  width: 15px;
  height: 15px;
}

.header-custody-alert-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.header-custody-alert-text strong {
  font-size: 0.82rem;
  font-weight: 800;
}

.header-custody-alert-meta {
  font-size: 0.72rem;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-custody-alert-badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  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);
}

html[data-theme="dark"] .header-custody-alert {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

html[data-theme="dark"] .header-custody-alert:hover {
  background: rgba(245, 158, 11, 0.24);
  color: #fde68a;
}

@media (max-width: 900px) {
  .header-custody-alert-meta {
    display: none;
  }

  .header-custody-alert {
    max-width: none;
    padding: 8px 10px;
  }
}

@media (max-width: 640px) {
  .header-custody-alert-text strong {
    font-size: 0.75rem;
  }
}

.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-meta {
  margin: -6px 12px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.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%);
}

#station-invoice-edit-modal .app-modal-body {
  max-height: min(78vh, 820px);
  overflow: auto;
}

#station-invoice-edit-modal .js-station-invoice-edit-fields {
  margin-bottom: 0.75rem;
}

.station-invoice-edit-page {
  padding: 0.75rem 1rem 1rem;
}

.station-invoice-edit-page .filter-grid {
  gap: 8px 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .station-invoice-edit-page .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .station-invoice-edit-page .filter-grid {
    grid-template-columns: 1fr;
  }
}

.station-invoice-edit-page .form-group {
  margin-bottom: 0;
}

.station-invoice-edit-page .form-group label {
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.station-invoice-edit-page .form-control,
.station-invoice-edit-page select.form-control,
.station-invoice-edit-page textarea.form-control {
  padding: 6px 10px;
  min-height: 34px;
  font-size: 0.875rem;
}

.station-invoice-edit-page textarea.form-control {
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.station-invoice-edit-page .form-hint {
  margin-top: 2px;
  font-size: 0.75rem;
}

.station-invoice-edit-page .form-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.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 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: default;
  transition: background 0.15s ease;
}

.notifications-item.is-unread {
  background: rgba(20, 184, 166, 0.08);
  cursor: pointer;
}

.notifications-item.is-unread:hover {
  background: rgba(20, 184, 166, 0.14);
}

.notifications-item-kind {
  flex: 0 0 8px;
  width: 8px;
  min-height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: #94a3b8;
}

.notifications-item.is-kind-offline .notifications-item-kind {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.notifications-item.is-kind-online .notifications-item-kind,
.notifications-item.is-kind-started .notifications-item-kind {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.notifications-item.is-kind-stopped .notifications-item-kind {
  background: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.notifications-item.is-kind-offline {
  border-inline-start: 3px solid #dc2626;
}

.notifications-item.is-kind-online,
.notifications-item.is-kind-started {
  border-inline-start: 3px solid #16a34a;
}

.notifications-item.is-kind-stopped {
  border-inline-start: 3px solid #ea580c;
}

.notifications-item.is-kind-offline.is-unread {
  background: rgba(220, 38, 38, 0.08);
}

.notifications-item.is-kind-online.is-unread,
.notifications-item.is-kind-started.is-unread {
  background: rgba(22, 163, 74, 0.08);
}

.notifications-item.is-kind-stopped.is-unread {
  background: rgba(234, 88, 12, 0.1);
}

.notifications-item-body {
  flex: 1;
  min-width: 0;
}

.notifications-item-msg {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.notifications-item.is-kind-offline .notifications-item-msg {
  color: #991b1b;
}

.notifications-item.is-kind-online .notifications-item-msg,
.notifications-item.is-kind-started .notifications-item-msg {
  color: #166534;
}

.notifications-item.is-kind-stopped .notifications-item-msg {
  color: #9a3412;
}

.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);
}

@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;
    max-height: none !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;
  }

  .voucher-view-panel .data-panel-head {
    margin-bottom: 8px;
  }

  .voucher-view-panel .voucher-view-meta {
    margin-bottom: 12px;
  }

  .voucher-view-panel .form-static {
    margin: 0;
  }

  .col-sticky-start,
  .data-table .col-sticky-start,
  .col-sticky-address,
  .data-table .col-sticky-address {
    position: static !important;
    box-shadow: none !important;
  }

  .data-table thead th {
    position: static !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;
}

.station-invoice-images {
  margin-top: 18px;
  padding-top: 4px;
}

.station-invoice-images-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.station-invoice-images-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.station-invoice-image-card {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.station-invoice-image-card img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  background: #0f172a0d;
  cursor: zoom-in;
}

.station-invoice-image-label {
  margin-top: 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.station-invoice-images-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .station-invoice-images-grid {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] .station-invoice-image-card img {
  background: rgba(15, 23, 42, 0.45);
}

.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-main-filter {
  margin-bottom: 20px;
}

.dash-filter-scope-hint {
  margin: 12px 0 0;
  color: var(--accent, #0f766e);
  font-weight: 600;
  font-size: 0.9rem;
}

.dash-live-hint {
  margin: 8px 0 0;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
}

.js-dash-live.is-updated,
.js-dash-station-period-vehicles.is-updated,
.js-dash-station-period-violating.is-updated,
.js-dash-station-period-revenue.is-updated {
  animation: dash-live-flash 0.55s ease;
}

@keyframes dash-live-flash {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}

.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(180px, 1.4fr) minmax(150px, 1.1fr) repeat(2, minmax(190px, 1.2fr)) auto;
  gap: 14px;
  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-period-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dash-period-stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.dash-period-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dash-period-stat .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.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 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  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;
  }

  .dash-period-stats {
    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;
  }
}

/* ═══════════════ TABLE COLUMN VISIBILITY ═══════════════ */
.data-table .wp-col-hidden {
  display: none !important;
}

.wp-table-cols-toolbar {
  padding: 0 24px 8px;
}

.wp-table-cols-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  padding: 8px 24px 20px;
  max-height: min(52vh, 480px);
  overflow: auto;
}

.wp-table-cols-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-2, #f8fafc);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
}

.wp-table-cols-check input {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.wp-table-cols-check span {
  flex: 1;
  word-break: break-word;
}

[data-theme="dark"] .wp-table-cols-check {
  background: rgba(15, 23, 42, 0.45);
}

@media print {
  .data-table .wp-col-hidden {
    display: table-cell !important;
  }

  .js-wp-table-cols-open {
    display: none !important;
  }
}

.perm-action-list,
.perm-template-checks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.perm-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.perm-action-item:last-child {
  border-bottom: none;
}

.perm-action-key {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.perm-action-label {
  flex: 1;
  min-width: 0;
}

.perm-template-checks li {
  padding: 6px 0;
}

.perm-template-checks .checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.perm-template-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.perm-template-card-titles {
  min-width: 0;
  flex: 1;
}

.perm-template-card-titles h3 {
  margin: 0 0 0.2rem;
}

.perm-template-card-head .perm-page-file {
  margin: 0;
}

.perm-template-meta-card {
  margin-bottom: 1.5rem;
}

.perm-nav-group {
  margin: 0 0 1.75rem;
}

.perm-nav-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.perm-nav-group-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.perm-nav-group-count {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.perm-nav-group-grid {
  margin: 0;
}

.perm-template-card {
  margin: 0;
}

.perm-template-card-titles h3 {
  font-size: 1rem;
  line-height: 1.35;
}

.perm-save-actions-bottom {
  margin-top: 1.5rem;
}

.perm-template-permissions-form {
  position: relative;
  padding-bottom: 5.5rem;
}

.perm-save-dock {
  position: sticky;
  top: 0.75rem;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.perm-save-dock-hint {
  margin: 0;
  flex: 1 1 14rem;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.perm-save-dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

html[data-theme="dark"] .perm-save-dock {
  background: color-mix(in srgb, var(--surface) 92%, #000);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

@media (max-width: 720px) {
  .perm-save-dock {
    top: 0.4rem;
    position: sticky;
  }

  .perm-save-dock-actions {
    width: 100%;
  }

  .perm-save-dock-actions .btn {
    flex: 1 1 auto;
  }
}

.perm-card-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  margin: 0.15rem 0 0;
}

.perm-card-switch-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.perm-card-switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.perm-card-switch-ui {
  position: relative;
  width: 2.4rem;
  height: 1.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border, #cbd5e1) 80%, #94a3b8);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.perm-card-switch-ui::after {
  content: '';
  position: absolute;
  top: 1px;
  inset-inline-start: 2px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.perm-card-switch-input:checked + .perm-card-switch-ui {
  background: var(--accent, #14b8a6);
  border-color: color-mix(in srgb, var(--accent, #14b8a6) 70%, transparent);
}

.perm-card-switch-input:checked + .perm-card-switch-ui::after {
  transform: translateX(1rem);
}

html[dir="rtl"] .perm-card-switch-input:checked + .perm-card-switch-ui::after {
  transform: translateX(-1rem);
}

.perm-card-switch-input:indeterminate + .perm-card-switch-ui {
  background: color-mix(in srgb, var(--accent, #14b8a6) 45%, var(--border, #cbd5e1));
}

.perm-card-switch-input:focus-visible + .perm-card-switch-ui {
  outline: 2px solid var(--accent, #14b8a6);
  outline-offset: 2px;
}

.perm-action-list--fixed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.perm-action-item--fixed {
  border: none;
  padding: 0;
}

.perm-action-badge {
  font-weight: 700;
}

/* ═══════════════ PORTAL (محاسب / قالب صلاحيات) ═══════════════ */
.portal-page {
  position: relative;
  padding: 8px 4px 32px;
  overflow: hidden;
}

.portal-hero {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  pointer-events: none;
  z-index: 0;
}

.portal-hero-logo {
  width: min(40vw, 320px);
  height: auto;
  opacity: 0.08;
  filter: grayscale(20%);
  user-select: none;
}

.portal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  text-align: start;
}

.portal-intro {
  margin-bottom: 20px;
  max-width: 52rem;
}

.portal-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 14px 0 4px;
  padding: 0;
}

.portal-identity-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 9.5rem;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}

.portal-identity-item dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.portal-identity-item dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.portal-identity-item--warn {
  border-color: color-mix(in srgb, #b45309 35%, var(--border));
  background: color-mix(in srgb, #f59e0b 10%, var(--surface));
}

.portal-identity-item--warn dd {
  color: #92400e;
  font-weight: 600;
  font-size: 0.85rem;
}

html[data-theme="dark"] .portal-identity-item {
  background: color-mix(in srgb, var(--surface) 88%, #000);
}

html[data-theme="dark"] .portal-identity-item--warn {
  background: color-mix(in srgb, #f59e0b 14%, var(--surface));
}

html[data-theme="dark"] .portal-identity-item--warn dd {
  color: #fbbf24;
}

.portal-custody-alert {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 22px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #92400e;
}

.portal-custody-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
}

.portal-custody-alert-icon .icon-glyph svg {
  width: 22px;
  height: 22px;
}

.portal-custody-alert-body {
  flex: 1 1 240px;
  min-width: 0;
}

.portal-custody-alert-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.portal-custody-alert-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.portal-custody-alert-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

html[data-theme="dark"] .portal-custody-alert {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.portal-eyebrow {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: 0.02em;
}

.portal-title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--text);
}

.portal-greeting {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.portal-desc {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.portal-empty {
  margin: 0;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

.portal-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  text-align: start;
}

@media (min-width: 640px) {
  .portal-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .portal-tiles {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.portal-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 132px;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.portal-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: var(--shadow-lg);
}

.portal-tile-group {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-2);
}

.portal-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.16), rgba(15, 118, 110, 0.08));
  color: var(--primary);
}

.portal-tile-icon .icon-glyph svg {
  width: 1.35rem;
  height: 1.35rem;
}

.portal-tile-label {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

html[data-theme="dark"] .portal-tile {
  background: rgba(15, 23, 42, 0.82);
}

html[data-theme="dark"] .portal-hero-logo {
  opacity: 0.08;
  filter: grayscale(10%) brightness(1.2);
}

/* فواتير المناوبة — عرض للتحاسب والتصوير */
.invoice-shift-report {
  max-width: 1100px;
  margin: 0 auto;
}

.invoice-shift-report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.invoice-shift-report-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
}

.invoice-shift-report-meta {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.invoice-shift-settlement-hint {
  margin: 8px 0 0;
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 600;
}

.invoice-shift-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 720px) {
  .invoice-shift-compare {
    grid-template-columns: 1fr;
  }
}

.invoice-shift-compare-col {
  padding: 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.invoice-shift-compare-col--invoices {
  border-color: rgba(20, 184, 166, 0.45);
  background: linear-gradient(180deg, #f0fdfa, var(--surface));
}

.invoice-shift-compare-col--weights {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(180deg, #eff6ff, var(--surface));
}

.invoice-shift-compare-col h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
}

.invoice-shift-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.invoice-shift-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2, var(--surface));
}

.invoice-shift-stats .invoice-shift-stat {
  padding: 4px 0;
  border-bottom: none;
}

.invoice-shift-stat:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.invoice-shift-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.invoice-shift-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.invoice-shift-stat-value--money {
  font-size: 1.25rem;
  color: var(--primary);
}

.invoice-shift-table-panel {
  margin-top: 0;
}

@media print {
  .admin-sidebar,
  .admin-header,
  .invoice-shift-report-actions,
  .no-print {
    display: none !important;
  }

  .admin-main {
    margin: 0 !important;
    padding: 0 !important;
  }

  .invoice-shift-report {
    max-width: none;
  }

  .invoice-shift-compare-col {
    break-inside: avoid;
  }
}

.shift-reminder-modal[hidden],
.shift-reminder-mini[hidden] {
  display: none !important;
}

.shift-reminder-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.shift-reminder-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.shift-reminder-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 800;
}

.shift-reminder-text {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.shift-reminder-meta {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.shift-reminder-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.shift-reminder-mini {
  position: fixed;
  inset-inline-end: 18px;
  inset-block-end: 18px;
  z-index: 2000;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
}

.shift-reminder-mini-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.shift-reminder-mini-time {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.shift-reminder-modal.is-urgent .shift-reminder-card,
.shift-reminder-mini.is-urgent {
  border-color: #ef4444;
  background: #fff1f2;
}

.shift-reminder-modal.is-urgent .shift-reminder-meta,
.shift-reminder-mini.is-urgent .shift-reminder-mini-time {
  color: #b91c1c;
}

/* ——— General ledger (دفتر الاستاذ) ——— */
.general-ledger-panel .general-ledger-table {
  font-size: 0.92rem;
}

.general-ledger-table .ledger-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.general-ledger-table .ledger-box-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}

.general-ledger-table .ledger-box-icon {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--primary);
}

.general-ledger-table .ledger-box-icon svg {
  width: 100%;
  height: 100%;
}

.general-ledger-table .ledger-desc {
  color: var(--text-muted, #64748b);
  font-size: 0.86rem;
  max-width: 28rem;
  min-width: 12rem;
  white-space: normal;
  line-height: 1.45;
  word-break: break-word;
}

.general-ledger-row--category-start td {
  border-top: 2px solid rgba(15, 118, 110, 0.18);
}

.general-ledger-row--total td {
  background: rgba(15, 118, 110, 0.06);
  border-top: 2px solid rgba(15, 118, 110, 0.28);
}

html[data-theme="dark"] .general-ledger-table .ledger-code {
  background: rgba(45, 212, 191, 0.12);
}

html[data-theme="dark"] .general-ledger-row--total td {
  background: rgba(45, 212, 191, 0.08);
}

/* —— Chart of accounts tree —— */
.chart-tree-wrap {
  padding: 0.25rem 0 0.75rem;
}

.chart-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chart-tree-list--root > .chart-tree-item {
  margin-bottom: 0.55rem;
}

.chart-tree-list .chart-tree-list {
  margin: 0.35rem 0 0.15rem 1.1rem;
  padding-right: 0.85rem;
  border-right: 1px dashed rgba(15, 118, 110, 0.22);
}

.chart-tree-item.is-inactive .chart-tree-name {
  opacity: 0.55;
  text-decoration: line-through;
}

.chart-tree-branch {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.85);
  padding: 0.35rem 0.55rem 0.45rem;
}

.chart-tree-summary {
  list-style: none;
  cursor: pointer;
}

.chart-tree-summary::-webkit-details-marker {
  display: none;
}

.chart-tree-leaf {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  background: #fff;
  padding: 0.45rem 0.65rem;
}

.chart-tree-row {
  display: block;
}

.chart-tree-summary,
.chart-tree-leaf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.chart-tree-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.chart-tree-name {
  font-weight: 600;
  color: var(--text, #0f172a);
}

.chart-tree-type {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.chart-tree-type--general { background: rgba(100, 116, 139, 0.14); color: #334155; }
.chart-tree-type--customers { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.chart-tree-type--revenue { background: rgba(16, 185, 129, 0.14); color: #047857; }
.chart-tree-type--expense { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

.chart-tree-balance {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: #475569;
  min-width: 4.5rem;
  text-align: end;
}

.chart-tree-badge {
  font-size: 0.72rem;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

.chart-tree-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-inline-start: auto;
}

.chart-panel-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.22);
}

.chart-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.chart-add-btn {
  white-space: nowrap;
  min-width: 8.5rem;
}

html[data-theme="dark"] .chart-panel-head {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.92) 100%);
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.12);
}

.chart-account-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.chart-account-modal[hidden] {
  display: none !important;
}

.chart-account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.chart-account-modal-panel {
  position: relative;
  width: min(34rem, 100%);
  max-height: min(92vh, 40rem);
  overflow: auto;
  background: var(--surface, #fff);
  border-radius: 16px;
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.28));
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.chart-account-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.chart-account-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.chart-account-modal-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.chart-account-modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.95);
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-account-modal-close .icon-glyph,
.chart-account-modal-close svg {
  width: 1rem;
  height: 1rem;
}

.chart-account-modal-form {
  padding: 0.9rem 1.1rem 1.1rem;
}

.chart-dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.chart-dialog-grid .form-group--full {
  grid-column: 1 / -1;
}

.chart-account-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

@media (max-width: 640px) {
  .chart-dialog-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .chart-account-modal-panel {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .chart-account-modal-close {
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.chart-inline-form {
  display: inline;
  margin: 0;
}

.chart-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.chart-form-grid .form-group--full {
  grid-column: 1 / -1;
}

.chart-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .chart-form-grid {
    grid-template-columns: 1fr;
  }

  .chart-tree-list .chart-tree-list {
    margin-right: 0.45rem;
    padding-right: 0.45rem;
  }

  .chart-tree-actions {
    width: 100%;
    margin-inline-start: 0;
  }
}

html[data-theme="dark"] .chart-tree-branch {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .chart-tree-leaf {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .chart-tree-list .chart-tree-list {
  border-right-color: rgba(45, 212, 191, 0.25);
}

html[data-theme="dark"] .chart-tree-code {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

html[data-theme="dark"] .chart-tree-balance {
  color: #94a3b8;
}

.acc-home-page {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.5rem;
  min-height: calc(100vh - 6.5rem);
}

.acc-home-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.95);
  flex-shrink: 0;
}

.acc-home-view-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.acc-home-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.acc-home-view-toggle input {
  margin: 0;
  accent-color: #0f766e;
}

.acc-home-section--favs {
  background:
    linear-gradient(180deg, rgba(254, 249, 195, 0.35) 0%, #ffffff 55%);
  border-color: rgba(202, 138, 4, 0.28);
}

.acc-home-favs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.acc-home-favs-empty {
  margin: 0;
}

.acc-home-fav-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.acc-home-fav-chip--op {
  border-color: rgba(13, 148, 136, 0.35);
}

.acc-home-fav-chip--station {
  border-color: rgba(59, 130, 246, 0.35);
}

.acc-home-fav-chip--account {
  border-color: rgba(202, 138, 4, 0.4);
}

.acc-home-fav-chip-link {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.acc-home-fav-chip-type {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.acc-home-fav-chip-label {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
}

.acc-home-fav-chip-remove {
  border: 0;
  border-inline-start: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  padding: 0 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.acc-home-fav-chip-remove:hover {
  background: rgba(254, 226, 226, 0.9);
  color: #b91c1c;
}

.acc-home-fav-btn {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.acc-home-fav-btn .icon-glyph,
.acc-home-fav-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.acc-home-fav-btn:hover {
  color: #ca8a04;
  border-color: rgba(202, 138, 4, 0.45);
}

.acc-home-fav-btn.is-active {
  color: #ca8a04;
  background: rgba(254, 249, 195, 0.85);
  border-color: rgba(202, 138, 4, 0.55);
}

.acc-home-fav-btn.is-active svg {
  fill: currentColor;
}

.acc-home-op-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.acc-home-op-row .acc-home-op-card {
  flex: 1 1 auto;
  min-width: 0;
}

.acc-home-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.25));
  background:
    radial-gradient(ellipse 70% 120% at 100% 0%, rgba(20, 184, 166, 0.14), transparent 55%),
    linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.acc-home-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text, #0f172a);
}

.acc-home-lead {
  display: none;
}

.acc-home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.acc-home-hero-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.acc-home-today-pill {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  min-width: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(13, 148, 136, 0.28);
  background: linear-gradient(160deg, rgba(240, 253, 250, 0.95) 0%, #fff 80%);
  text-align: start;
}

.acc-home-today-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.acc-home-today-value {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #0f766e;
}

.acc-home-today-meta {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
}

.acc-home-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 0.85fr) minmax(17rem, 1.25fr) minmax(15rem, 1.1fr);
  gap: 0.7rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.acc-home-section {
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.25));
  border-radius: var(--radius, 14px);
  padding: 0.7rem 0.75rem 0.8rem;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.acc-home-section--ops {
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.55) 0%, #ffffff 40%);
}

.acc-home-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}

.acc-home-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text, #0f172a);
}

.acc-home-section-desc {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 0.72rem;
  line-height: 1.35;
}

.acc-home-ops {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  flex: 1 1 auto;
}

.acc-home-op-card {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.48rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  min-height: 0;
}

.acc-home-op-card:hover {
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.acc-home-op-card--primary {
  background:
    linear-gradient(160deg, rgba(240, 253, 250, 0.98) 0%, #ffffff 72%);
  border-color: rgba(20, 184, 166, 0.32);
}

.acc-home-op-card--primary .acc-home-op-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.14);
}

.acc-home-op-card--primary .acc-home-op-icon svg {
  width: 0.9rem;
  height: 0.9rem;
}

.acc-home-op-card--primary .acc-home-op-body strong {
  font-size: 0.82rem;
}

.acc-home-op-icon {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
}

.acc-home-op-icon svg {
  width: 0.85rem;
  height: 0.85rem;
}

.acc-home-op-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.acc-home-op-body strong {
  font-size: 0.8rem;
  line-height: 1.25;
  font-weight: 700;
}

.acc-home-op-body span {
  display: none;
}

.acc-home-tree {
  flex: 1 1 auto;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0.15rem;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.acc-home-page .acc-home-tree.chart-tree-wrap {
  padding: 0.3rem 0.35rem;
}

.acc-home-page .chart-tree-list--root > .chart-tree-item {
  margin-bottom: 0.25rem;
}

.acc-home-page .chart-tree-list .chart-tree-list {
  margin: 0.2rem 0 0.05rem 0.55rem;
  padding-inline-start: 0.45rem;
  border-inline-start: 1px solid rgba(148, 163, 184, 0.28);
}

.acc-home-page .chart-tree-branch,
.acc-home-page .chart-tree-leaf {
  border-radius: 8px;
  padding: 0.28rem 0.35rem;
  background: #fff;
  border: 1px solid transparent;
}

.acc-home-page .chart-tree-branch:hover,
.acc-home-page .chart-tree-leaf:hover {
  border-color: rgba(20, 184, 166, 0.25);
}

.acc-home-page .chart-tree-summary,
.acc-home-page .chart-tree-leaf {
  gap: 0.25rem 0.4rem;
  align-items: center;
}

.acc-home-page .chart-tree-summary .acc-home-fav-btn,
.acc-home-page .chart-tree-leaf .acc-home-fav-btn {
  margin-inline-end: 0.1rem;
}

.acc-home-page .chart-tree-code {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.32rem;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.acc-home-page .chart-tree-name {
  font-size: 0.78rem;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
}

.acc-home-page .chart-tree-balance {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary-dark, #0c4a4e);
}

.acc-home-account-today {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  margin-inline-start: auto;
  padding: 0.12rem 0.4rem;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.22);
  line-height: 1.15;
}

.acc-home-account-today-amount {
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #b45309;
}

.acc-home-account-today-count {
  font-size: 0.62rem;
  font-weight: 600;
  color: #92400e;
  opacity: 0.9;
}

html[data-theme="dark"] .acc-home-account-today {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.22);
}

html[data-theme="dark"] .acc-home-account-today-amount {
  color: #fbbf24;
}

html[data-theme="dark"] .acc-home-account-today-count {
  color: #fcd34d;
}

.acc-home-stmt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--primary, #0f766e);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.22);
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.acc-home-stmt-link:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(13, 148, 136, 0.4);
}

@media (max-width: 1100px) {
  .acc-home-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }

  .acc-home-section--accounts {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .acc-home-page {
    min-height: 0;
  }

  .acc-home-grid {
    grid-template-columns: 1fr;
  }

  .acc-home-section--accounts {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .acc-home-hero {
    padding: 0.9rem 1rem;
  }

  .acc-home-page .chart-tree-summary,
  .acc-home-page .chart-tree-leaf {
    flex-wrap: wrap;
  }
}

html[data-theme="dark"] .acc-home-hero {
  background:
    radial-gradient(ellipse 70% 120% at 100% 0%, rgba(20, 184, 166, 0.16), transparent 55%),
    linear-gradient(165deg, #0f172a 0%, #111827 100%);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .acc-home-section {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .acc-home-section--ops {
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.12) 0%, rgba(15, 23, 42, 0.78) 45%);
}

html[data-theme="dark"] .acc-home-op-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .acc-home-op-card--primary {
  background: linear-gradient(160deg, rgba(13, 148, 136, 0.18) 0%, rgba(15, 23, 42, 0.75) 70%);
  border-color: rgba(20, 184, 166, 0.28);
}

html[data-theme="dark"] .acc-home-tree {
  background: rgba(2, 6, 23, 0.45);
  border-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .acc-home-page .chart-tree-branch,
html[data-theme="dark"] .acc-home-page .chart-tree-leaf {
  background: rgba(15, 23, 42, 0.85);
}

html[data-theme="dark"] .acc-home-page .chart-tree-balance {
  color: #5eead4;
}

html[data-theme="dark"] .acc-home-stmt-link {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(45, 212, 191, 0.28);
}

.acc-home-section-head--row {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

.acc-home-stations-count {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f766e;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(13, 148, 136, 0.22);
}

.acc-home-stations {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
}

.acc-home-station {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.acc-home-station[open] {
  border-color: rgba(13, 148, 136, 0.45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.acc-home-station-summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.4rem 0.45rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  user-select: none;
}

.acc-home-station-summary::-webkit-details-marker {
  display: none;
}

.acc-home-station-status {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.acc-home-station-status.is-online {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.acc-home-station-status.is-offline {
  background: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

.acc-home-station-main {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.acc-home-station-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text, #0f172a);
}

.acc-home-station-meta {
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}

.acc-home-station-today {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.02rem;
  text-align: end;
  min-width: 4.8rem;
}

.acc-home-station-today-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.acc-home-station-today strong {
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f766e;
}

.acc-home-station-today-count {
  font-size: 0.66rem;
  color: var(--text-muted, #64748b);
}

.acc-home-station-body {
  padding: 0 0.55rem 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.7);
}

.acc-home-scales-empty {
  margin: 0.55rem 0 0.15rem;
}

.acc-home-scales-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
}

.acc-home-scales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.acc-home-scales-table th,
.acc-home-scales-table td {
  padding: 0.4rem 0.5rem;
  text-align: start;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  vertical-align: middle;
}

.acc-home-scales-table th {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: rgba(248, 250, 252, 0.95);
}

.acc-home-scales-table tbody tr:last-child td {
  border-bottom: 0;
}

.acc-home-scales-total-row td {
  border-top: 1px solid rgba(13, 148, 136, 0.28);
  background: rgba(240, 253, 250, 0.7);
  font-variant-numeric: tabular-nums;
}

.acc-home-scales-total-row .acc-home-scale-amount {
  color: #0f766e;
}

.acc-home-scales-table td:nth-child(3),
.acc-home-scales-table td:nth-child(4),
.acc-home-scales-table th:nth-child(3),
.acc-home-scales-table th:nth-child(4) {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.acc-home-scale-code {
  display: inline-block;
  margin-inline-start: 0.3rem;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.acc-home-scale-amount {
  font-weight: 800;
  color: #0f766e;
}

.acc-home-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.acc-home-badge--on {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.acc-home-badge--off {
  color: #c2410c;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

@media (max-width: 720px) {
  .acc-home-hero-side {
    width: 100%;
  }

  .acc-home-station-summary {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .acc-home-station-today {
    grid-column: 3;
    align-items: flex-start;
    text-align: start;
  }

  .acc-home-section-head--row {
    flex-direction: column;
    align-items: flex-start;
  }
}

html[data-theme="dark"] .acc-home-today-pill {
  background: linear-gradient(160deg, rgba(13, 148, 136, 0.2) 0%, rgba(15, 23, 42, 0.85) 80%);
  border-color: rgba(45, 212, 191, 0.28);
}

html[data-theme="dark"] .acc-home-today-value,
html[data-theme="dark"] .acc-home-station-today strong,
html[data-theme="dark"] .acc-home-scale-amount {
  color: #5eead4;
}

html[data-theme="dark"] .acc-home-stations-count {
  color: #5eead4;
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(45, 212, 191, 0.28);
}

html[data-theme="dark"] .acc-home-station {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .acc-home-station-body {
  background: rgba(2, 6, 23, 0.35);
  border-top-color: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .acc-home-scales-table-wrap {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme="dark"] .acc-home-scales-table th {
  background: rgba(2, 6, 23, 0.45);
}

/* —— Searchable station dropdown —— */
.station-search-select {
  position: relative;
  width: 100%;
  z-index: 1;
}

.station-search-select.is-open {
  z-index: 60;
}

.station-search-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: start;
  cursor: pointer;
}

.station-search-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.station-search-select__chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-inline-end: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.station-search-select.is-open .station-search-select__chevron {
  transform: rotate(225deg);
  margin-top: 0.2rem;
}

.station-search-select__panel {
  position: absolute;
  z-index: 40;
  inset-inline: 0;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  max-height: min(18rem, 55vh);
}

.station-search-select__panel[hidden] {
  display: none !important;
}

.station-search-select__search-wrap {
  padding: 0.55rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.station-search-select__query {
  width: 100%;
}

.station-search-select__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.station-search-select__option {
  padding: 0.55rem 0.7rem;
  border-radius: 0.45rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1.35;
}

.station-search-select__option:hover,
.station-search-select__option:focus {
  outline: none;
  background: var(--table-row-hover);
  color: var(--primary-dark);
}

.station-search-select__option.is-selected {
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-dark);
  font-weight: 700;
}

.station-search-select__multi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem 0.55rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.station-search-select--multi .station-search-select__option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
}

.station-search-select--multi .station-search-select__check {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  border: 1.5px solid var(--border);
  border-radius: 0.25rem;
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
}

.station-search-select--multi .station-search-select__option.is-selected .station-search-select__check {
  border-color: var(--primary);
  background: var(--primary);
}

.station-search-select--multi .station-search-select__option.is-selected .station-search-select__check::after {
  content: '';
  position: absolute;
  inset-inline-start: 0.22rem;
  top: 0.05rem;
  width: 0.28rem;
  height: 0.5rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.station-search-select--multi .station-search-select__option-text {
  flex: 1;
  min-width: 0;
}

.station-search-select__empty {
  margin: 0;
  padding: 0.75rem 0.9rem 1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.station-search-select.is-invalid .station-search-select__trigger {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.station-search-select.is-disabled {
  opacity: 0.72;
  pointer-events: none;
}

.station-search-select.is-loading .station-search-select__trigger {
  color: var(--text-muted);
}

html[data-theme="dark"] .station-search-select__panel {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .station-search-select__search-wrap {
  background: rgba(15, 23, 42, 0.75);
}

.account-statement-ledger {
  font-size: 0.92rem;
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.account-statement-ledger thead th {
  white-space: nowrap;
}

.account-statement-ledger__row--focus {
  background: var(--table-row-hover);
}

.account-statement-ledger__entry a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.account-statement-ledger__entry a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

/* تجاوز max-width: 200px العام على .data-table td — البيان حتى سطرين */
.account-statement-ledger th.account-statement-ledger__narration,
.account-statement-ledger td.account-statement-ledger__narration {
  max-width: 18rem;
  min-width: 14rem;
  width: 18rem;
  white-space: normal !important;
  vertical-align: middle;
}

.account-statement-ledger__narration-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
  max-height: 2.8em;
}

.account-statement-ledger th.col-num,
.account-statement-ledger td.col-num {
  max-width: none;
  width: 7.5rem;
  white-space: nowrap;
}

.account-statement-ledger th.account-statement-ledger__entry,
.account-statement-ledger td.account-statement-ledger__entry,
.account-statement-ledger th.account-statement-ledger__when,
.account-statement-ledger td.account-statement-ledger__when {
  max-width: none;
  white-space: nowrap;
}

.account-statement-ledger td {
  max-width: 12rem;
}

/* الإجراءات ثابتة دائماً أثناء التمرير الأفقي */
.account-statement-ledger th.col-actions.col-sticky-start,
.account-statement-ledger td.col-actions.col-sticky-start {
  max-width: none;
  min-width: 5.5rem;
  z-index: 4;
  /* في RTL آخر عمود يظهر يساراً — ثبّته على اليسار ليبقى ظاهراً */
  right: auto;
  left: 0;
  box-shadow: 4px 0 12px rgba(15, 23, 42, 0.08);
}

html[dir="ltr"] .account-statement-ledger th.col-actions.col-sticky-start,
html[dir="ltr"] .account-statement-ledger td.col-actions.col-sticky-start {
  left: auto;
  right: 0;
  box-shadow: -4px 0 12px rgba(15, 23, 42, 0.08);
}

.account-statement-ledger thead th.col-actions.col-sticky-start {
  z-index: 5;
}

.account-statement-ledger tbody tr.account-statement-ledger__row--focus .col-sticky-start {
  background: var(--table-row-hover);
}

.account-statement-ledger__total td {
  background: rgba(15, 118, 110, 0.08);
  border-top: 2px solid rgba(15, 118, 110, 0.28);
  color: var(--text);
  font-weight: 700;
  max-width: none;
}

.account-statement-ledger__total td.col-sticky-start {
  background: rgba(15, 118, 110, 0.08);
}

.account-statement-ledger-foot {
  margin-top: 0.85rem;
}

.account-statement-ledger-foot__table {
  width: min(100%, 42rem);
  margin-inline-start: auto;
}

html[data-theme="dark"] .account-statement-ledger__total td {
  background: rgba(45, 212, 191, 0.1);
  border-top-color: rgba(45, 212, 191, 0.28);
}

html[data-theme="dark"] .account-statement-ledger__total td.col-sticky-start {
  background: rgba(45, 212, 191, 0.1);
}

/* —— AI Chatbot floating widget —— */
.ai-chat-root {
  position: fixed;
  inset-inline-end: 1.15rem;
  bottom: 1.15rem;
  z-index: 1200;
  font-family: inherit;
}

.ai-chat-fab {
  width: 3.4rem;
  height: 3.4rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #0f766e, #115e59);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-fab:hover {
  filter: brightness(1.05);
}

.ai-chat-fab .icon-glyph {
  width: 1.35rem;
  height: 1.35rem;
}

.ai-chat-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: 4.1rem;
  width: min(24rem, calc(100vw - 1.5rem));
  height: min(32rem, calc(100vh - 6rem));
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #0f766e, #134e4a);
  color: #ecfdf5;
}

.ai-chat-header h3 {
  margin: 0;
  font-size: 1rem;
}

.ai-chat-header p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  opacity: 0.88;
}

.ai-chat-close {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}

.ai-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 0.9rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ai-chat-bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-chat-bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.ai-chat-bubble--user {
  align-self: flex-end;
  background: #0f766e;
  color: #fff;
}

.ai-chat-typing {
  align-self: flex-start;
  font-size: 0.82rem;
  color: #64748b;
  padding: 0.2rem 0.35rem;
}

.ai-chat-suggests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.9rem 0.55rem;
  background: #f8fafc;
}

.ai-chat-suggest {
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: #fff;
  color: #0f766e;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.ai-chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.ai-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.ai-chat-form button {
  border: 0;
  border-radius: 10px;
  background: #0f766e;
  color: #fff;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font: inherit;
}

.ai-chat-form button:disabled,
.ai-chat-form input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

html[data-theme="dark"] .ai-chat-panel {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .ai-chat-messages,
html[data-theme="dark"] .ai-chat-suggests {
  background: #111827;
}

html[data-theme="dark"] .ai-chat-bubble--bot,
html[data-theme="dark"] .ai-chat-suggest,
html[data-theme="dark"] .ai-chat-form {
  background: #1e293b;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .ai-chat-form input {
  background: #0f172a;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.22);
}

@media (max-width: 520px) {
  .ai-chat-root {
    inset-inline-end: 0.75rem;
    bottom: 0.75rem;
  }

  .ai-chat-panel {
    width: calc(100vw - 1.2rem);
    height: min(70vh, 30rem);
  }
}

/* اختيار عدة محطات لسندات الدفع (إيراد شهري/سنوي) */
.station-multi {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.station-multi__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.station-multi__toolbar .form-control {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.station-multi__list {
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 0.5rem;
  background: var(--surface, #fff);
  padding: 0.35rem;
}

.station-multi__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.35rem;
  cursor: pointer;
  line-height: 1.35;
}

.station-multi__item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.station-multi__item input {
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.station-multi__item span {
  flex: 1 1 auto;
}

html[data-theme="dark"] .station-multi__list {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .station-multi__item:hover {
  background: rgba(148, 163, 184, 0.1);
}

/* Voucher create (receipt shift) compact layout + sales ledger */
.voucher-create-page .voucher-create-panel > .data-panel-head,
.voucher-create-page .voucher-search-panel > .data-panel-head,
.voucher-create-page .voucher-ledger-panel > .data-panel-head {
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
}

.voucher-create-page .voucher-create-panel > .data-panel-head h2,
.voucher-create-page .voucher-search-panel > .data-panel-head h2,
.voucher-create-page .voucher-ledger-panel > .data-panel-head h2 {
  margin: 0;
  font-size: 1.02rem;
}

.voucher-create-page .voucher-create-panel > .data-panel-head p,
.voucher-create-page .voucher-search-panel > .data-panel-head p,
.voucher-create-page .voucher-ledger-panel > .data-panel-head p {
  margin: 0.1rem 0 0;
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
}

.voucher-intake-root {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.voucher-box--search-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.voucher-box--search-actions .btn {
  width: 100%;
  min-height: 2rem;
}

.voucher-create-page .toolbar-date-quick-filters {
  margin: 0.35rem 0.65rem 0.45rem;
  gap: 0.35rem;
}

.voucher-create-page .toolbar-date-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.voucher-create-card {
  margin: 0 0.55rem 0.55rem;
  padding: 0.55rem 0.65rem 0.7rem !important;
}

.voucher-create-grid {
  gap: 0.45rem !important;
}

.voucher-box {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.28));
  border-radius: 8px;
  padding: 0.4rem 0.5rem 0.45rem;
  margin: 0 !important;
  background: var(--surface, #fff);
}

.voucher-box label {
  margin-bottom: 0.2rem !important;
  font-size: 0.75rem !important;
  font-weight: 700;
}

.voucher-box .form-control,
.voucher-box .station-search-select__trigger {
  min-height: 2rem;
  padding: 0.28rem 0.5rem;
  font-size: 0.82rem;
}

.voucher-box--stats .invoice-shift-stats {
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.voucher-box--stats .invoice-shift-stat {
  padding: 0.35rem 0.45rem;
}

.voucher-box--stats .invoice-shift-stat-label {
  font-size: 0.7rem;
}

.voucher-box--stats .invoice-shift-stat-value {
  font-size: 0.92rem;
}

.voucher-create-page .form-actions {
  margin-top: 0.45rem;
  gap: 0.4rem;
}

.voucher-ledger-wrap {
  position: relative;
  max-height: min(58vh, 28rem);
  overflow: auto;
}

.voucher-search-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: color-mix(in srgb, var(--surface, #fff) 78%, transparent);
  color: var(--text, #0f172a);
  font-size: 0.88rem;
  font-weight: 600;
}

.voucher-search-loading[hidden] {
  display: none !important;
}

.voucher-search-spinner,
.voucher-search-btn-spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: var(--primary, #2563eb);
  border-radius: 50%;
  animation: voucher-search-spin 0.75s linear infinite;
  flex-shrink: 0;
}

.voucher-search-btn-spinner {
  display: none;
  width: 0.95rem;
  height: 0.95rem;
  border-width: 2px;
}

.js-voucher-intake-search.is-loading {
  opacity: 0.85;
  pointer-events: none;
  cursor: wait;
}

.js-voucher-intake-search.is-loading .voucher-search-btn-spinner {
  display: inline-block;
  vertical-align: -0.15rem;
  margin-inline-end: 0.35rem;
}

.js-voucher-ledger-load.is-loading {
  opacity: 0.85;
  pointer-events: none;
  cursor: wait;
}

.js-voucher-ledger-load.is-loading .voucher-search-btn-spinner {
  display: inline-block;
  vertical-align: -0.15rem;
  margin-inline-end: 0.35rem;
}

.invoice-shift-stat--wide {
  grid-column: 1 / -1;
}

.voucher-ledger-wrap.is-loading {
  min-height: 8rem;
}

@keyframes voucher-search-spin {
  to {
    transform: rotate(360deg);
  }
}

.voucher-ledger-table {
  table-layout: fixed;
  font-size: 0.78rem;
  min-width: 0;
}

.voucher-ledger-table th,
.voucher-ledger-table td {
  padding: 0.45rem 0.55rem !important;
  line-height: 1.35;
  vertical-align: top;
}

.voucher-ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.voucher-ledger-col-entry { width: 7.5rem; white-space: nowrap; }
.voucher-ledger-col-date { width: 9.5rem; white-space: nowrap; }
.voucher-ledger-col-narration {
  width: auto;
  min-width: 14rem;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.voucher-ledger-col-num {
  width: 7.2rem;
  white-space: nowrap !important;
  text-align: end !important;
  font-variant-numeric: tabular-nums;
}
.voucher-amount-input-wrap {
  position: relative;
}

.voucher-amount-field.is-loading .js-voucher-intake-amount-input {
  opacity: 0.45;
  pointer-events: none;
}

.voucher-amount-loading,
.voucher-open-amount-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.voucher-amount-loading {
  position: absolute;
  inset: 0;
  justify-content: center;
  background: color-mix(in srgb, var(--surface, #fff) 82%, transparent);
  border-radius: 8px;
}

.voucher-amount-loading[hidden],
.voucher-open-amount-loading[hidden] {
  display: none !important;
}

.invoice-shift-stat-value--money.is-loading [data-voucher-open-amount-value] {
  display: none;
}

.voucher-create-modal-body {
  padding-top: 0.25rem;
}

.voucher-create-modal-footer {
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft, rgba(148, 163, 184, 0.28));
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.voucher-create-grid--receipt-modal {
  grid-template-columns: 1fr 1fr;
}

.voucher-accounts-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: stretch;
  margin: 0 !important;
}

.voucher-accounts-flow > .voucher-box {
  min-width: 0;
}

.voucher-box--debit {
  border-color: color-mix(in srgb, var(--primary, #0f766e) 45%, var(--border, #cbd5e1));
  background: color-mix(in srgb, var(--success-bg, #ecfdf5) 70%, var(--surface, #fff));
}

.voucher-box--debit label {
  color: var(--primary-dark, #0c4a4e);
}

.voucher-box--credit {
  border-color: color-mix(in srgb, #b45309 35%, var(--border, #cbd5e1));
  background: color-mix(in srgb, #fff7ed 75%, var(--surface, #fff));
}

.voucher-box--credit label {
  color: #9a3412;
}

.voucher-accounts-flow-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1.15rem;
}

.voucher-accounts-flow-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary-dark, #0c4a4e);
  background: color-mix(in srgb, var(--accent, #14b8a6) 22%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, var(--accent, #14b8a6) 45%, transparent);
}

.voucher-box--amount-hero {
  border-color: color-mix(in srgb, var(--accent, #14b8a6) 55%, var(--border, #cbd5e1));
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent, #14b8a6) 16%, var(--surface, #fff)) 0%,
      color-mix(in srgb, var(--primary, #0f766e) 10%, var(--surface, #fff)) 100%
    );
  padding: 0.65rem 0.75rem 0.75rem;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #14b8a6) 18%, transparent);
}

.voucher-box--amount-hero label {
  font-size: 0.88rem !important;
  font-weight: 800;
  color: var(--primary-dark, #0c4a4e);
}

.voucher-amount-hero-input {
  min-height: 3.15rem !important;
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.01em;
  color: var(--primary-dark, #0c4a4e) !important;
  text-align: center;
  border-color: color-mix(in srgb, var(--accent, #14b8a6) 50%, var(--border, #cbd5e1)) !important;
  background: color-mix(in srgb, #ffffff 88%, var(--accent, #14b8a6)) !important;
  font-variant-numeric: tabular-nums;
}

.voucher-amount-hero-input:focus {
  outline: none;
  border-color: var(--accent, #14b8a6) !important;
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(20, 184, 166, 0.35));
}

html[data-theme="dark"] .voucher-box--debit {
  background: color-mix(in srgb, var(--primary, #0f766e) 18%, var(--surface, #111827));
}

html[data-theme="dark"] .voucher-box--credit {
  background: color-mix(in srgb, #b45309 16%, var(--surface, #111827));
  border-color: color-mix(in srgb, #fb923c 35%, var(--border, #334155));
}

html[data-theme="dark"] .voucher-box--credit label {
  color: #fdba74;
}

html[data-theme="dark"] .voucher-box--amount-hero {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent, #14b8a6) 22%, var(--surface, #111827)) 0%,
    color-mix(in srgb, var(--primary, #0f766e) 16%, var(--surface, #111827)) 100%
  );
}

html[data-theme="dark"] .voucher-amount-hero-input {
  color: #5eead4 !important;
  background: color-mix(in srgb, var(--surface, #111827) 70%, #042f2e) !important;
}

@media (max-width: 720px) {
  .voucher-create-grid--receipt-modal {
    grid-template-columns: 1fr;
  }

  .voucher-accounts-flow {
    grid-template-columns: 1fr;
  }

  .voucher-accounts-flow-sep {
    padding-top: 0;
  }

  .voucher-amount-hero-input {
    font-size: 1.35rem !important;
    min-height: 2.85rem !important;
  }
}

.voucher-ledger-panel > .data-panel-head .data-panel-actions {
  flex-shrink: 0;
}

.voucher-ledger-col-doctype { width: 5rem; white-space: nowrap; }
.voucher-ledger-col-docno { width: 5.5rem; white-space: nowrap; }
.voucher-ledger-col-creator { width: 6.5rem; white-space: normal; word-break: break-word; }
.voucher-ledger-col-created { width: 9rem; white-space: nowrap; }

.voucher-ledger-row--sale_open.is-first td,
.voucher-ledger-row--sale.is-first td,
.voucher-ledger-row--receipt td,
.voucher-ledger-row--open_header td {
  font-weight: 700;
}

.voucher-ledger-foot td {
  font-weight: 700;
  font-size: 0.8rem;
  white-space: normal !important;
  background: var(--table-head-end, #1e3a5f);
  color: #fff;
  border-color: transparent;
}

.voucher-ledger-foot.is-cleared td {
  background: var(--table-head-start, #2563eb);
}

/* ===== Floating Windows update FAB (عكس زاوية مساعد AI) ===== */
.wp-windows-fab {
  position: fixed;
  z-index: 1190;
  inset-inline-start: 1.15rem;
  bottom: 1.15rem;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}
.wp-windows-fab:hover,
.wp-windows-fab:focus-visible {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.45);
  outline: none;
}
.wp-windows-fab.has-update {
  background: linear-gradient(145deg, #fb923c, #ea580c);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.38);
}
.wp-windows-fab.is-loading {
  opacity: 0.75;
  pointer-events: none;
}
.wp-windows-fab-icon {
  position: relative;
  z-index: 2;
  display: flex;
}
.wp-windows-fab-icon svg {
  width: 17px;
  height: 17px;
}
.wp-windows-fab-badge {
  position: absolute;
  top: -0.1rem;
  right: -0.05rem;
  z-index: 3;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: #facc15;
  color: #78350f;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.wp-windows-fab-pulse {
  position: absolute;
  inset: -0.35rem;
  border-radius: 999px;
  border: 2px solid rgba(20, 184, 166, 0.45);
  opacity: 0;
  pointer-events: none;
}
.wp-windows-fab.has-update .wp-windows-fab-pulse {
  border-color: rgba(251, 146, 60, 0.55);
  animation: wp-fab-pulse 1.8s ease-out infinite;
}
@keyframes wp-fab-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}
.wp-windows-fab-tip {
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #0f172a;
  color: #ecfeff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.wp-windows-fab:hover .wp-windows-fab-tip,
.wp-windows-fab:focus-visible .wp-windows-fab-tip {
  opacity: 1;
}
@media (max-width: 640px) {
  .wp-windows-fab {
    inset-inline-start: 0.85rem;
    bottom: 0.85rem;
    width: 2.65rem;
    height: 2.65rem;
  }
}

/* ═══════════════ VOUCHER DOCUMENT VIEW ═══════════════ */
.voucher-doc-page {
  max-width: 980px;
  margin-inline: auto;
}

.voucher-doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.voucher-doc-toolbar__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.voucher-doc-toolbar__hint .icon-glyph {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--primary);
}

.voucher-doc-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.voucher-doc-toolbar__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

.voucher-doc-toolbar__actions .icon-glyph {
  width: 1rem;
  height: 1rem;
}

.voucher-doc {
  --voucher-accent: #0f766e;
  --voucher-accent-soft: rgba(15, 118, 110, 0.12);
  --voucher-accent-ring: rgba(15, 118, 110, 0.28);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(15, 118, 110, 0.03) 18px,
      rgba(15, 118, 110, 0.03) 19px
    );
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 18px 48px rgba(15, 23, 42, 0.1);
  padding: 0 0 8px;
  animation: voucherDocSlide 0.45s ease both;
}

.voucher-doc::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--voucher-accent), #14b8a6 55%, var(--voucher-accent));
  z-index: 2;
}

.voucher-doc.is-receipt {
  --voucher-accent: #047857;
  --voucher-accent-soft: rgba(4, 120, 87, 0.12);
  --voucher-accent-ring: rgba(4, 120, 87, 0.28);
}

.voucher-doc.is-payment {
  --voucher-accent: #b45309;
  --voucher-accent-soft: rgba(180, 83, 9, 0.12);
  --voucher-accent-ring: rgba(180, 83, 9, 0.28);
}

.voucher-doc.is-transfer {
  --voucher-accent: #1d4ed8;
  --voucher-accent-soft: rgba(29, 78, 216, 0.12);
  --voucher-accent-ring: rgba(29, 78, 216, 0.28);
}

.voucher-doc.is-sale {
  --voucher-accent: #6d28d9;
  --voucher-accent-soft: rgba(109, 40, 217, 0.12);
  --voucher-accent-ring: rgba(109, 40, 217, 0.28);
}

.voucher-doc.is-journal {
  --voucher-accent: #0f766e;
  --voucher-accent-soft: rgba(15, 118, 110, 0.12);
  --voucher-accent-ring: rgba(15, 118, 110, 0.28);
}

@keyframes voucherDocIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes voucherDocSlide {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.voucher-doc__watermark {
  position: absolute;
  inset-inline-end: -2%;
  top: 18%;
  font-size: clamp(3.5rem, 9vw, 6.5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--voucher-accent);
  opacity: 0.055;
  transform: rotate(-18deg);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}

.voucher-doc__masthead,
.voucher-doc__amount-band,
.voucher-doc__narration,
.voucher-doc__meta,
.voucher-doc__ledger,
.voucher-doc__footer {
  position: relative;
  z-index: 1;
}

.voucher-doc__masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 24px;
  padding: 28px 28px 20px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.12);
}

.voucher-doc__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.voucher-doc__seal {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--voucher-accent-soft);
  border: 1px solid var(--voucher-accent-ring);
  color: var(--voucher-accent);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.65);
  animation: voucherSealPulse 2.8s ease-in-out infinite;
}

.voucher-doc__seal .icon-glyph {
  width: 1.45rem;
  height: 1.45rem;
}

@keyframes voucherSealPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.65);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 7px var(--voucher-accent-soft);
  }
}

.voucher-doc__org {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--voucher-accent);
  letter-spacing: 0.02em;
}

.voucher-doc__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.voucher-doc__id-block {
  text-align: start;
  min-width: min(100%, 220px);
}

.voucher-doc__type-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--voucher-accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 10px;
  box-shadow: 0 8px 18px var(--voucher-accent-soft);
}

.voucher-doc__no-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.voucher-doc__no {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--voucher-accent);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  word-break: break-all;
}

.voucher-doc__amount-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 18px 22px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--voucher-accent-soft), rgba(255, 255, 255, 0.55));
  border: 1px solid var(--voucher-accent-ring);
  animation: voucherBandIn 0.55s ease 0.08s both;
}

@keyframes voucherBandIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.voucher-doc__amount-label {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.voucher-doc__amount-value {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--voucher-accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.voucher-doc__amount-value span {
  font-size: 0.95rem;
  font-weight: 700;
  margin-inline-start: 6px;
  opacity: 0.85;
}

.voucher-doc__balance-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.voucher-doc__balance-pill.is-ok {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.25);
}

.voucher-doc__balance-pill.is-warn {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.22);
}

.voucher-doc__narration {
  margin: 16px 28px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-soft);
}

.voucher-doc__narration h2 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}

.voucher-doc__narration p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.voucher-doc__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 28px 0;
}

.voucher-doc__meta-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-soft);
  min-width: 0;
}

.voucher-doc__meta-item span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.voucher-doc__meta-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

.voucher-doc__ledger {
  margin: 22px 22px 0;
  padding: 0 0 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.voucher-doc__ledger-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--voucher-accent-soft), transparent);
}

.voucher-doc__ledger-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--voucher-accent);
}

.voucher-doc__table {
  margin: 0;
  width: 100%;
}

.voucher-doc__table td,
.voucher-doc__table th {
  max-width: none;
}

.voucher-doc__table td.voucher-doc__memo {
  max-width: 16rem;
  white-space: normal;
  word-break: break-word;
}

.voucher-doc__code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.voucher-doc__table .is-debit {
  color: #b45309;
  font-weight: 700;
}

.voucher-doc__table .is-credit {
  color: #047857;
  font-weight: 700;
}

.voucher-doc__totals td {
  background: rgba(15, 23, 42, 0.04);
  border-top: 2px solid var(--voucher-accent-ring);
  font-weight: 800;
}

.voucher-doc__footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 28px 24px;
  padding-top: 8px;
}

.voucher-doc__sign {
  min-height: 88px;
  padding: 12px 14px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.voucher-doc__sign span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.voucher-doc__sign strong {
  font-size: 0.95rem;
  color: var(--text);
  text-align: center;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  padding-top: 10px;
}

[data-theme="dark"] .voucher-doc {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(45, 212, 191, 0.035) 18px,
      rgba(45, 212, 191, 0.035) 19px
    );
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .voucher-doc__masthead {
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .voucher-doc__narration,
[data-theme="dark"] .voucher-doc__meta-item,
[data-theme="dark"] .voucher-doc__ledger,
[data-theme="dark"] .voucher-doc__sign {
  background: rgba(15, 23, 42, 0.55);
}

[data-theme="dark"] .voucher-doc__amount-band {
  background: linear-gradient(135deg, var(--voucher-accent-soft), rgba(15, 23, 42, 0.35));
}

[data-theme="dark"] .voucher-doc__seal {
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.55);
}

[data-theme="dark"] .voucher-doc__totals td {
  background: rgba(45, 212, 191, 0.08);
}

@media (max-width: 900px) {
  .voucher-doc__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .voucher-doc__masthead,
  .voucher-doc__amount-band,
  .voucher-doc__narration,
  .voucher-doc__meta,
  .voucher-doc__ledger,
  .voucher-doc__footer {
    margin-left: 14px;
    margin-right: 14px;
  }

  .voucher-doc__masthead {
    margin: 0;
    padding: 22px 16px 16px;
  }

  .voucher-doc__amount-band {
    margin-top: 14px;
  }

  .voucher-doc__meta,
  .voucher-doc__footer {
    grid-template-columns: 1fr;
  }

  .voucher-doc__ledger {
    margin-top: 16px;
  }
}

@media print {
  .voucher-doc-toolbar {
    display: none !important;
  }

  .voucher-doc {
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
    animation: none !important;
  }

  .voucher-doc__seal {
    animation: none !important;
  }

  .voucher-doc__watermark {
    opacity: 0.04 !important;
  }
}

/* —— سند القبض: إنشاء + قائمة —— */
.voucher-doc--compose,
.voucher-doc--list-hero {
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.voucher-doc__compose-desc {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 36rem;
}

.voucher-doc__no--sm {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  line-height: 1.35 !important;
  color: var(--text) !important;
}

.voucher-doc__compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.voucher-create-page--receipt {
  max-width: 1100px;
  margin-inline: auto;
}

.voucher-create-page--receipt .voucher-intake-root {
  gap: 14px;
}

.voucher-doc-section.is-receipt {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(4, 120, 87, 0.22);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(4, 120, 87, 0.08);
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.65), rgba(255, 255, 255, 0.95));
  /* opacity فقط — أي transform يكسر position:fixed للقائمة المنسدلة */
  animation: voucherDocIn 0.4s ease both;
  z-index: 1;
}

.voucher-doc-section.is-receipt:has(.station-search-select),
.voucher-doc-section.is-receipt:has(.station-search-select.is-open) {
  overflow: visible;
  z-index: 30;
}

.voucher-create-page--receipt .voucher-search-panel,
.voucher-create-page--receipt .voucher-search-card,
.voucher-create-page--receipt .voucher-create-grid,
.voucher-create-page--receipt .voucher-box--station {
  overflow: visible;
  position: relative;
}

.voucher-create-page--receipt .voucher-box--station .station-search-select {
  position: relative;
  z-index: 20;
}

.voucher-create-page--receipt .voucher-box--station .station-search-select.is-open {
  z-index: 80;
}

.voucher-create-page--receipt .voucher-box--station .station-search-select__panel {
  position: absolute !important;
  inset-inline: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 4px) !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  z-index: 90 !important;
}

.voucher-doc-section.is-receipt::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #047857, #10b981 55%, #047857);
  z-index: 1;
}

.voucher-doc-section.is-receipt > .data-panel-head {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.08), transparent);
  border-bottom: 1px dashed rgba(4, 120, 87, 0.18);
}

.voucher-doc-section.is-receipt > .data-panel-head h2 {
  color: #047857;
}

.voucher-list-page.is-receipt,
.voucher-list-page.is-payment {
  max-width: 1200px;
  margin-inline: auto;
}

.voucher-list-panel.is-receipt,
.voucher-list-panel.is-payment {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.voucher-list-panel.is-receipt {
  border-color: rgba(4, 120, 87, 0.22);
  box-shadow: 0 14px 36px rgba(4, 120, 87, 0.08);
}

.voucher-list-panel.is-receipt::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #047857, #10b981 55%, #047857);
  z-index: 1;
}

.voucher-list-panel.is-payment::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #b45309, #f59e0b 55%, #b45309);
  z-index: 1;
}

.voucher-list-panel__toolbar {
  justify-content: flex-end;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.1);
}

.voucher-list-panel__actions {
  margin-inline-start: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voucher-list-page.is-receipt .data-table-vouchers thead th {
  background: linear-gradient(180deg, #065f46 0%, #047857 100%);
}

.voucher-list-page.is-receipt .data-table-vouchers thead th.col-sticky-start {
  background: #065f46;
}

.voucher-create-page--receipt .voucher-create-modal-panel {
  border-top: 4px solid #047857;
}

[data-theme="dark"] .voucher-doc-section.is-receipt,
[data-theme="dark"] .voucher-list-panel.is-receipt {
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.12), rgba(15, 23, 42, 0.92));
  border-color: rgba(16, 185, 129, 0.28);
}

[data-theme="dark"] .voucher-doc-section.is-receipt > .data-panel-head h2 {
  color: #6ee7b7;
}

/* ═══════════════ DASHBOARD PAGE POLISH ═══════════════ */
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1280px;
  margin-inline: auto;
  padding-bottom: 12px;
  isolation: isolate;
}

.dash-top-split {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  position: relative;
  z-index: 40;
  width: 100%;
  min-width: 0;
}

.dash-top-split--solo {
  grid-template-columns: 1fr;
}

.dash-top-split:has(.dash-media.is-collapsed) {
  grid-template-columns: 1fr;
}

.dash-top-split:has(.dash-media.is-collapsed) .dash-media {
  order: 2;
}

.dash-media {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.96));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  animation: dashFadeIn 0.45s ease both;
}

.dash-media__toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 6px;
}

.dash-media__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.dash-media__desc {
  display: none;
}

.dash-media__toggle {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  font-weight: 700;
}

.dash-media__toggle:hover {
  background: rgba(15, 118, 110, 0.14);
}

.dash-media__frame {
  margin: 0 8px 8px;
  border-radius: 10px;
  overflow: hidden;
  background: #ecfeff;
  border: 1px solid rgba(15, 118, 110, 0.12);
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  max-height: 140px;
}

.dash-media__img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 140px;
  object-fit: cover;
  object-position: center;
}

.dash-media--svg .dash-media__img {
  object-fit: contain;
  background: linear-gradient(180deg, #e0f2fe, #f0fdfa);
  max-height: 130px;
}

.dash-media__restore {
  display: none !important;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.06);
  color: #0f766e;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
}

.dash-media__restore:hover {
  background: rgba(15, 118, 110, 0.12);
}

.dash-media.is-collapsed {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  overflow: visible;
}

.dash-media.is-collapsed .dash-media__restore {
  display: block !important;
}

.dash-media.is-collapsed .dash-media__toolbar,
.dash-media.is-collapsed .dash-media__frame {
  display: none !important;
}

.dash-page .dash-top-split .dash-main-filter {
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.dash-page .dash-station-activity,
.dash-page .dash-company-activity {
  position: relative;
  z-index: 1;
}

.dash-page .station-search-select.is-open {
  z-index: 130;
}

.dash-page .station-search-select.is-open .station-search-select__panel {
  z-index: 140;
}

.dash-hero {
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.95) 0%, rgba(255, 255, 255, 0.92) 55%, rgba(236, 254, 255, 0.88) 100%);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  animation: dashFadeIn 0.45s ease both;
}

.dash-hero--compact {
  padding: 12px 16px;
  border-radius: 14px;
  gap: 10px 16px;
}

.dash-hero--compact .dash-hero__title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.dash-hero--compact .dash-hero__desc {
  font-size: 0.84rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dash-hero__glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  inset-inline-end: -40px;
  top: -80px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.28), transparent 70%);
  pointer-events: none;
}

.dash-hero__content {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.dash-hero__kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0f766e;
  text-transform: uppercase;
}

.dash-hero__title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.dash-hero__desc {
  margin: 0;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.dash-hero__badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #0f766e;
  font-size: 0.85rem;
  font-weight: 800;
}

.dash-hero__pulse {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.4);
}

.dash-hero__pulse.is-on {
  background: #10b981;
  animation: dashPulse 1.8s ease-in-out infinite;
}

@keyframes dashPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

@keyframes dashFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dash-page .dash-panel,
.dash-page .dash-main-filter.data-panel {
  border-radius: 16px;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  /* بدون transform حتى لا ينكسر dropdown المحطات */
  animation: dashFadeIn 0.4s ease both;
  overflow: visible;
}

.dash-page .dash-main-filter {
  margin-bottom: 0;
  padding-bottom: 8px;
  position: relative;
  z-index: 50;
  overflow: visible !important;
}

.dash-page .dash-main-filter:has(.station-search-select.is-open) {
  z-index: 120;
}

.dash-page .dash-main-filter .dash-station-activity-filters,
.dash-page .dash-main-filter .dash-station-filter-grid,
.dash-page .dash-main-filter .form-group {
  overflow: visible;
}

.dash-page .dash-main-filter .dash-station-filter-grid {
  position: relative;
  z-index: 2;
}

.dash-page .dash-main-filter .form-group:has(.station-search-select) {
  position: relative;
  z-index: 3;
}

.dash-page .dash-main-filter .station-search-select.is-open {
  z-index: 130;
}

.dash-page .dash-main-filter .station-search-select.is-open .station-search-select__panel {
  z-index: 140;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.dash-page .dash-top-split .dash-main-filter > .data-panel-head {
  padding: 12px 14px 8px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), transparent);
  border-bottom: 1px dashed rgba(15, 118, 110, 0.16);
}

.dash-page .dash-top-split .dash-station-activity-filters,
.dash-page .dash-top-split .dash-main-filter .dash-station-filter-grid {
  padding: 10px 14px 12px;
}

.dash-page .dash-main-filter .dash-station-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 10px 12px;
  align-items: end;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dash-page .dash-main-filter .dash-station-filter-grid > .form-group {
  min-width: 0;
  width: 100%;
  margin: 0;
}

.dash-page .dash-main-filter .dash-station-filter-grid > .form-group > label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-page .dash-main-filter .dash-station-filter-grid .form-control,
.dash-page .dash-main-filter .dash-station-filter-grid .station-search-select,
.dash-page .dash-main-filter .dash-station-filter-grid .station-search-select__trigger {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dash-page .dash-main-filter .dash-station-filter-grid input[type="datetime-local"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.dash-page .dash-main-filter .dash-station-filter-action {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.dash-page .dash-main-filter .dash-station-filter-action .btn-primary {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

@media (min-width: 1100px) {
  .dash-page .dash-top-split:not(.dash-top-split--solo):not(:has(.dash-media.is-collapsed))
    .dash-main-filter
    .dash-station-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  }
}

@media (max-width: 900px) {
  .dash-page .dash-main-filter .dash-station-filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  }
}

@media (max-width: 560px) {
  .dash-page .dash-main-filter .dash-station-filter-grid {
    grid-template-columns: 1fr;
  }
}

.dash-page .dash-live-hint,
.dash-page .dash-filter-scope-hint {
  margin: 0 14px 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.06);
}

.dash-stats-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.dash-page .stats-grid-dashboard {
  gap: 12px;
  margin-bottom: 0;
}

.dash-page .stats-grid-dashboard-row2 {
  margin-top: 0;
}

.dash-page .stat-card {
  border-radius: 14px;
  padding: 14px 15px 13px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  animation: dashFadeIn 0.45s ease both;
}

.dash-page .stat-card:hover {
  transform: none;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09);
  border-color: rgba(20, 184, 166, 0.35);
}

.dash-page .stat-card::before {
  height: 4px;
  border-radius: 14px 14px 0 0;
}

.dash-page .stats-grid-dashboard .stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  margin-bottom: 10px;
}

.dash-page .stats-grid-dashboard .stat-card .value {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.dash-page .dash-station-activity {
  margin-top: 0;
  padding: 18px;
  position: relative;
  z-index: 2;
}

.dash-page .dash-station-activity:has(.station-search-select.is-open),
.dash-page .dash-company-activity:has(.station-search-select.is-open) {
  z-index: 90;
}

.dash-page .dash-company-activity {
  margin-top: 0;
}

.dash-page .dash-station-activity-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.dash-page .dash-station-activity-title {
  font-size: 1.2rem;
}

.dash-page .dash-period-stats {
  gap: 10px;
  margin-bottom: 14px;
}

.dash-page .dash-period-stat {
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.7), var(--surface));
  border-color: rgba(15, 118, 110, 0.16);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dash-page .dash-period-stat:hover {
  border-color: rgba(20, 184, 166, 0.4);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.08);
}

.dash-page .dash-station-summary-grid {
  gap: 14px;
}

.dash-page .dash-station-panel {
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-page .dash-station-panel:hover {
  border-color: rgba(20, 184, 166, 0.35);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.dash-page .dash-station-panel-head {
  padding: 12px 14px;
}

.dash-page .dash-station-empty {
  margin-top: 8px;
  border-radius: 12px;
  padding: 22px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.dash-page .dash-station-results {
  margin-top: 8px;
}

[data-theme="dark"] .dash-hero {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(30, 41, 59, 0.95));
  border-color: rgba(45, 212, 191, 0.22);
}

[data-theme="dark"] .dash-hero__title {
  color: var(--text);
}

[data-theme="dark"] .dash-hero__badge {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.28);
  color: #5eead4;
}

[data-theme="dark"] .dash-page .dash-period-stat {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.08), rgba(15, 23, 42, 0.55));
}

[data-theme="dark"] .dash-page .dash-station-empty {
  background: rgba(15, 23, 42, 0.55);
}

@media (max-width: 720px) {
  .dash-page {
    gap: 12px;
  }

  .dash-top-split {
    grid-template-columns: 1fr;
  }

  .dash-media__frame,
  .dash-media__img,
  .dash-media--svg .dash-media__img {
    max-height: 110px;
  }

  .dash-hero,
  .dash-hero--compact {
    padding: 12px 14px;
  }

  .dash-media__img {
    max-height: 110px;
  }

  .dash-page .dash-station-activity {
    padding: 14px;
  }

  .dash-page .dash-station-activity-filters,
  .dash-page .dash-main-filter .dash-station-filter-grid {
    padding: 12px 14px 14px;
  }
}

[data-theme="dark"] .dash-media {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.16), rgba(30, 41, 59, 0.95));
  border-color: rgba(45, 212, 191, 0.22);
}

[data-theme="dark"] .dash-media__frame {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(45, 212, 191, 0.18);
}

[data-theme="dark"] .dash-media__restore,
[data-theme="dark"] .dash-media__toggle {
  color: #5eead4;
}



