@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cormorant+Garamond:wght@500;600;700&display=swap');

/* =============================================
   CSS VARIABLES — Design System
   ============================================= */
:root {
  --color-primary:         #0E4A31;
  --color-primary-dark:    #0b3828;
  --color-primary-light:   #174f39;
  --color-primary-surface: #edf4f0;
  --color-primary-muted:   #9bb7a9;

  --color-accent:          #FDC421;
  --color-accent-dark:     #c99300;
  --color-accent-surface:  #fff6d9;

  --color-ink:             #1b2b25;
  --color-ink-secondary:   #4a5f56;
  --color-ink-muted:       #73877e;

  --color-surface:         #ffffff;
  --color-surface-raised:  #f6f7f4;
  --color-background:      #f5f6f3;

  --color-border:          #e3e8e3;
  --color-border-strong:   #ccd7d1;

  --color-danger:          #c0392b;
  --color-danger-surface:  #fdecea;
  --color-success:         #166043;
  --color-success-surface: #e8f4ef;
  --color-warning-text:    #7a4800;
  --color-warning-surface: #fef3d0;
  --color-info-text:       #1255a0;
  --color-info-surface:    #e0eeff;

  --input-bg:              var(--color-surface);
  --input-color:           var(--color-ink);
  --input-border:          var(--color-border);
  --input-placeholder:     var(--color-ink-muted);
  --input-readonly-bg:     var(--color-surface-raised);
  --input-readonly-color:  var(--color-ink-muted);

  --radius-sm:   7px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  --shadow-sm:    0 1px 3px rgba(17, 39, 31, 0.035);
  --shadow-md:    0 8px 24px rgba(17, 39, 31, 0.08);
  --shadow-lg:    0 12px 32px rgba(17, 39, 31, 0.11);
  --shadow-modal: 0 18px 54px rgba(17, 39, 31, 0.16);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  --page-header-compact-height: 64px;
  --page-header-sticky-height: 0px;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font: var(--font-sans);
  --transition-fast: 0.12s ease;
  --transition-base: 0.18s ease;
  color-scheme: light;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-background);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-dashboard-theme="dark"],
body[data-theme="dark"],
html[data-dashboard-theme="dark"],
html[data-theme="dark"] {
  --color-primary: #2f9a70;
  --color-primary-dark: #1c6a4d;
  --color-primary-light: #47b887;
  --color-primary-surface: #17382c;
  --color-primary-muted: #83b69f;
  --color-accent: #f7c948;
  --color-accent-dark: #d3a72b;
  --color-accent-surface: #413719;
  --color-ink: #edf5f0;
  --color-ink-secondary: #c5d6cd;
  --color-ink-muted: #97ada1;
  --color-surface: #1b2420;
  --color-surface-raised: #242f2a;
  --color-background: #111714;
  --color-border: #39483f;
  --color-border-strong: #53665b;
  --color-danger: #ff887c;
  --color-danger-surface: #4b2522;
  --color-success: #6bd39d;
  --color-success-surface: #173b2a;
  --color-warning-text: #ffd26d;
  --color-warning-surface: #4d3d18;
  --color-info-text: #8dc4ff;
  --color-info-surface: #173754;

  --input-bg:              var(--color-surface-raised);
  --input-color:           var(--color-ink);
  --input-border:          var(--color-border);
  --input-placeholder:     var(--color-ink-muted);
  --input-readonly-bg:     var(--color-surface);
  --input-readonly-color:  var(--color-ink-secondary);

  --shadow-sm: 0 1px 3px rgb(0 0 0 / 22%);
  --shadow-md: 0 8px 24px rgb(0 0 0 / 28%);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 34%);
  color-scheme: dark;
}

::selection {
  background: var(--color-primary-surface);
  color: var(--color-ink);
}

.auth-pending { visibility: hidden; }

/* =============================================
   LAYOUT
   ============================================= */
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1800px;
  margin: 0 auto;
}
.app-shell > main { min-width: 0; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 14px 18px;
  background: var(--color-surface);
  color: var(--color-ink-secondary);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
  border-right: 1px solid var(--color-border);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  max-width: 190px;
  padding: 2px 4px;
  flex-shrink: 0;
}

.brand-mark .sidebar-logo,
.brand-mark img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 38px;
  object-fit: contain;
}

.brand-name {
  margin: 10px 6px 20px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-ink-muted);
}
.brand-name strong { display: block; font-size: 15px; color: var(--color-ink); font-weight: 600; letter-spacing: -0.01em; margin-top: 1px; }

.mobile-nav-toggle {
  display: none;
}

nav {
  display: grid;
  gap: 12px;
  margin-top: 2px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-group { gap: 2px; }

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-ink-muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}

.nav-group-toggle:hover,
.nav-group > .nav-group-toggle:hover,
.nav-group.is-open > .nav-group-toggle:hover {
  color: var(--color-surface);
  background: var(--color-primary);
  box-shadow: none;
}

.nav-group-toggle:hover .nav-chevron,
.nav-group.is-open > .nav-group-toggle:hover .nav-chevron {
  opacity: 1;
  color: var(--color-surface);
}

.nav-group-toggle:hover .nav-icon,
.nav-group.is-open > .nav-group-toggle:hover .nav-icon {
  opacity: 1;
  color: var(--color-surface);
}

.nav-group-toggle:active {
  transform: none;
}

.nav-group.is-open > .nav-group-toggle {
  color: var(--color-ink);
  background: transparent;
}

body[data-dashboard-theme="dark"] .nav-group-toggle:hover,
body[data-theme="dark"] .nav-group-toggle:hover,
body[data-dashboard-theme="dark"] .nav-group.is-open > .nav-group-toggle:hover,
body[data-theme="dark"] .nav-group.is-open > .nav-group-toggle:hover {
  color: var(--color-ink);
  background: var(--color-surface-raised);
}

body[data-dashboard-theme="dark"] .nav-group-toggle:hover .nav-chevron,
body[data-theme="dark"] .nav-group-toggle:hover .nav-chevron,
body[data-dashboard-theme="dark"] .nav-group.is-open > .nav-group-toggle:hover .nav-chevron,
body[data-theme="dark"] .nav-group.is-open > .nav-group-toggle:hover .nav-chevron,
body[data-dashboard-theme="dark"] .nav-group-toggle:hover .nav-icon,
body[data-theme="dark"] .nav-group-toggle:hover .nav-icon,
body[data-dashboard-theme="dark"] .nav-group.is-open > .nav-group-toggle:hover .nav-icon,
body[data-theme="dark"] .nav-group.is-open > .nav-group-toggle:hover .nav-icon {
  color: var(--color-ink);
  opacity: 1;
}

body[data-dashboard-theme="dark"] .nav-group.is-open > .nav-group-toggle,
body[data-theme="dark"] .nav-group.is-open > .nav-group-toggle {
  color: var(--color-ink);
  background: transparent;
}

.nav-group-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-chevron {
  font-size: 13px;
  line-height: 1;
  opacity: 0.65;
  transform: rotate(-90deg);
  transition: transform 0.24s ease, opacity var(--transition-fast);
}

.nav-group.is-open > .nav-group-toggle .nav-chevron {
  transform: rotate(0deg);
  opacity: 1;
}

.nav-group-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: max-height 0.18s ease, opacity 0.15s ease, transform 0.18s ease, visibility 0.18s;
}

.nav-group.is-open > .nav-group-panel {
  max-height: 520px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-nested-group {
  margin-left: 8px;
  border-left: 1px solid var(--color-border);
}

.nav-child-toggle {
  padding-left: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.nav-group-panel > a {
  margin-left: 12px;
  padding: 8px 12px;
  font-size: 12px;
}

.nav-nested-group > .nav-group-panel > a {
  margin-left: 12px;
  padding-left: 18px;
  font-size: 11.5px;
}

.nav-group-panel .nav-icon {
  width: 16px;
  height: 16px;
  font-size: 13px;
}

.nav-section-label {
  padding: 0 10px;
  color: #89968f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-group-toggle:focus-visible,
nav a:focus-visible,
.logout-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--color-ink-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 55%;
  border-radius: 0 3px 3px 0;
  background: var(--color-primary);
  transition: transform var(--transition-base);
}

nav a:hover {
  color: var(--color-primary);
  background: var(--color-primary-surface);
}
nav a.active {
  color: var(--color-primary);
  background: var(--color-primary-surface);
  font-weight: 600;
  box-shadow: none;
}
nav a.active::before { transform: translateY(-50%) scaleY(1); }

body[data-dashboard-theme="dark"] nav a:hover,
body[data-theme="dark"] nav a:hover {
  color: var(--color-ink);
  background: var(--color-surface-raised);
}
body[data-dashboard-theme="dark"] nav a.active,
body[data-theme="dark"] nav a.active {
  color: #ffffff;
  background: var(--color-primary-surface);
}

.nav-subitem {
  margin-left: 14px;
  padding-left: 18px;
  border-left: 1px solid var(--color-border);
}

.user-session {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 0;
  color: var(--color-ink-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--color-border);
}

.logout-button {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink-secondary);
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.logout-button:hover { background: #f1f5f2; color: var(--color-primary); }

.firebase-status {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink-muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.firebase-status.is-ready { color: var(--color-success); border-color: #d8e9df; background: #f3f8f4; }

/* =============================================
   MAIN CONTENT
   ============================================= */
main { padding: 32px clamp(20px, 3.5vw, 42px); }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.view-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  scroll-margin-top: calc(var(--page-header-compact-height) + var(--space-3));
  transition: min-height 200ms ease-out, padding 200ms ease-out, margin 200ms ease-out, background-color 200ms ease-out, border-color 200ms ease-out, box-shadow 200ms ease-out;
}

.view-sticky-header .eyebrow {
  max-height: 24px;
  overflow: hidden;
  transition: max-height 200ms ease-out, margin 200ms ease-out, opacity 180ms ease-out;
}
.view-sticky-header h2 { transition: font-size 200ms ease-out; }

.view-sticky-header.is-compact {
  margin-bottom: 16px;
  min-height: var(--page-header-compact-height);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
  box-shadow: 0 8px 18px rgb(17 39 31 / 8%);
}

.app-view.data-panel > .view-sticky-header.is-compact {
  padding: 8px 20px;
  background: var(--color-surface);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--color-primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--color-ink);
  line-height: 1.08;
  font-family: var(--font-display);
  transition: font-size 200ms ease-out, transform 200ms ease-out;
}

.subtitle {
  max-height: 48px;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--color-ink-muted);
  font-size: 15px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 200ms ease-out, margin 200ms ease-out, opacity 180ms ease-out, transform 200ms ease-out;
}

.view-sticky-header.is-compact .eyebrow {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}
.view-sticky-header.is-compact h1 { font-size: clamp(1.55rem, 2vw, 1.8rem); }
.view-sticky-header.is-compact h2 { font-size: clamp(1.35rem, 1.8vw, 1.55rem); }
.view-sticky-header.is-compact .subtitle,
.view-sticky-header.is-compact > div > p:not(.eyebrow) {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  transform: translateY(-4px);
}

.view-sticky-header > div > p:not(.eyebrow) {
  max-height: 48px;
  overflow: hidden;
  transition: max-height 200ms ease-out, margin 200ms ease-out, opacity 180ms ease-out, transform 200ms ease-out;
}

.view-sticky-header.is-compact .button-link,
.view-sticky-header.is-compact .button-group button,
.view-sticky-header.is-compact .button-group > label.button-link {
  min-height: 32px;
  padding: 7px 11px;
  font-size: 12px;
  transition: min-height 200ms ease-out, padding 200ms ease-out, font-size 200ms ease-out;
}

/* =============================================
   THEME TOGGLE SLIDER (Compact Light / Dark)
   ============================================= */
.theme-control-container {
  display: inline-flex;
  align-items: center;
}

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

.theme-slider-toggle {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 66px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  user-select: none;
  -webkit-user-select: none;
}

.theme-slider-toggle:hover {
  border-color: var(--color-border-strong);
}

.theme-slider-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0 5px;
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  z-index: 1;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.theme-icon-sun {
  color: #d97706;
  opacity: 1;
}

.theme-icon-moon {
  color: var(--color-ink-muted);
  opacity: 0.35;
}

.theme-slider-thumb {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  transform: translateY(-50%);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), background-color 200ms ease, border-color 200ms ease;
  z-index: 2;
}

body[data-dashboard-theme="dark"] .theme-slider-toggle,
body[data-theme="dark"] .theme-slider-toggle {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
}

body[data-dashboard-theme="dark"] .theme-icon-sun,
body[data-theme="dark"] .theme-icon-sun {
  color: var(--color-ink-muted);
  opacity: 0.35;
}

body[data-dashboard-theme="dark"] .theme-icon-moon,
body[data-theme="dark"] .theme-icon-moon {
  color: var(--color-accent);
  opacity: 1;
}

body[data-dashboard-theme="dark"] .theme-slider-thumb,
body[data-theme="dark"] .theme-slider-thumb {
  transform: translate(32px, -50%);
  background: var(--color-primary-surface);
  border-color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.view-sticky-header.is-compact .theme-slider-toggle {
  width: 60px;
  height: 28px;
}
.view-sticky-header.is-compact .theme-slider-thumb {
  width: 22px;
  height: 22px;
}
body[data-dashboard-theme="dark"] .view-sticky-header.is-compact .theme-slider-thumb,
body[data-theme="dark"] .view-sticky-header.is-compact .theme-slider-thumb {
  transform: translate(30px, -50%);
}

/* =============================================
   BUTTONS
   ============================================= */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--color-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform 0.08s ease;
}
button:hover:not(:disabled) { background: var(--color-primary-light); box-shadow: var(--shadow-sm); }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
button:disabled, select:disabled { cursor: not-allowed; opacity: 0.50; }.secondary {
  color: var(--color-primary);
  background: var(--color-primary-surface);
  border: 1px solid var(--color-border);
}
.secondary:hover:not(:disabled) { background: #d4eae0; border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }

body[data-dashboard-theme="dark"] .secondary,
body[data-theme="dark"] .secondary {
  color: var(--color-primary-light);
  background: var(--color-primary-surface);
  border-color: var(--color-border);
}
body[data-dashboard-theme="dark"] .secondary:hover:not(:disabled),
body[data-theme="dark"] .secondary:hover:not(:disabled) {
  background: #1f4738;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.danger { background: var(--color-danger); }
.danger:hover:not(:disabled) { background: #a62c21; }

.text-button {
  color: var(--color-ink-muted);
  background: transparent;
}
.text-button:hover:not(:disabled) {
  color: var(--color-primary);
  background: var(--color-primary-surface);
  box-shadow: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--color-primary);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform 0.08s ease;
}
.button-link:hover { background: var(--color-primary-light); box-shadow: var(--shadow-sm); }
.button-link:active { transform: translateY(1px); box-shadow: none; }
.button-link.secondary {
  color: var(--color-primary);
  background: var(--color-primary-surface);
  border: 1px solid var(--color-border);
}
.button-link.secondary:hover { background: #d4eae0; border-color: var(--color-border-strong); }

body[data-dashboard-theme="dark"] .button-link.secondary,
body[data-theme="dark"] .button-link.secondary {
  color: var(--color-primary-light);
  background: var(--color-primary-surface);
  border-color: var(--color-border);
}
body[data-dashboard-theme="dark"] .button-link.secondary:hover,
body[data-theme="dark"] .button-link.secondary:hover {
  background: #1f4738;
  border-color: var(--color-primary);
}

.button-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* =============================================
   FILTERS
   ============================================= */
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.filters label {
  display: grid;
  gap: 5px;
  color: var(--color-ink-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filters select, .filters input,
.booking-form input, .booking-form select, .booking-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--input-color);
  background: var(--input-bg);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.filters select::placeholder, .filters input::placeholder,
.booking-form input::placeholder, .booking-form textarea::placeholder {
  color: var(--input-placeholder);
}
.filters select:focus, .filters input:focus,
.booking-form input:focus, .booking-form select:focus, .booking-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 154, 112, 0.28);
}
.filters select:not(:disabled):hover, .filters input:hover,
.booking-form input:not([readonly]):hover, .booking-form select:not(:disabled):hover,
.booking-form textarea:hover { border-color: var(--color-border-strong); }

/* =============================================
   KPI GRID
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-grid article {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-fast);
  cursor: default;
}
.kpi-grid article:hover { box-shadow: var(--shadow-sm); border-color: var(--color-border-strong); }

.kpi-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-surface);
  color: var(--color-primary);
  flex-shrink: 0;
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-icon.accent { background: var(--color-accent-surface); color: var(--color-accent-dark); }
.kpi-icon.muted { background: var(--color-surface-raised); color: var(--color-ink-muted); }

.kpi-content { flex: 1; min-width: 0; }

.kpi-grid span {
  display: block;
  color: var(--color-ink-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--color-ink);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.kpi-grid .kpi-revenue strong {
  font-size: 20px;
  white-space: nowrap;
}

.kpi-grid .kpi-revenue small {
  display: block;
  margin-top: 6px;
  color: var(--color-ink-muted);
  font-size: 10px;
  line-height: 1.35;
}

.kpi-grid article:nth-child(n + 5):not(.kpi-revenue) {
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  box-shadow: none;
}

.kpi-grid article:nth-child(n + 5):not(.kpi-revenue) .kpi-icon {
  width: 26px;
  height: 26px;
  background: transparent;
  color: var(--color-ink-muted);
}

.kpi-grid article:nth-child(n + 5):not(.kpi-revenue) .kpi-content {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.kpi-grid article:nth-child(n + 5):not(.kpi-revenue) .kpi-content strong {
  margin-top: 0;
  font-size: 18px;
}

/* =============================================
   DATA PANEL (shared table wrapper)
   ============================================= */
.data-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: clip;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}
.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.panel-heading p { margin: 4px 0 0; color: var(--color-ink-muted); font-size: 12px; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--color-border); }

table { width: 100%; min-width: 1040px; border-collapse: collapse; }

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 12.5px;
  white-space: nowrap;
}

th {
  color: var(--color-ink-secondary);
  background: var(--color-surface-raised);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  position: sticky;
  top: var(--page-header-sticky-height);
  z-index: 1;
  border-bottom: 1px solid var(--color-border-strong);
}

.sticky-table-header-overlay {
  position: fixed;
  z-index: 19;
  overflow: clip;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 4px 12px rgb(17 39 31 / 8%);
  pointer-events: auto;
}
.sticky-table-header-overlay table { margin: 0; }
.sticky-table-header-overlay th {
  position: static;
  top: auto;
  z-index: auto;
}

main :is(a, button, input, select, textarea, [tabindex]):focus {
  scroll-margin-top: calc(var(--page-header-sticky-height) + var(--space-3));
}

#buat-nota-dinas .table-wrap th,
.nota-doc-table th,
.offer-panel .table-wrap th,
.offer-preview-table th,
.confirmation-panel .table-wrap th,
.confirmation-preview-table th {
  position: static;
  top: auto;
}

tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover td { background: var(--color-primary-surface); }
tbody tr:nth-child(even) td { background: rgba(27, 43, 37, 0.012); }
tbody tr:nth-child(even):hover td { background: var(--color-primary-surface); }

.empty-state {
  padding: 48px 20px;
  color: var(--color-ink-muted);
  text-align: center;
  font-size: 13px;
}

.compact-filters {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  padding: 0 20px 16px;
  margin: 0;
  text-transform: none;
}

.stat-inline {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink-muted);
  background: var(--color-surface-raised);
  font-size: 11px;
}
.stat-inline strong { margin-top: 3px; color: var(--color-ink); font-size: 20px; font-weight: 700; }

/* =============================================
   DASHBOARD — Charts & Analytics
   ============================================= */
.dashboard-charts-pt {
  margin-bottom: 14px;
}

.dashboard-charts-overview {
  align-items: stretch;
}

.dashboard-charts-overview > .chart-card {
  min-width: 0;
}

.dashboard-revenue-card {
  margin-bottom: 14px;
  padding: 18px 20px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-revenue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-revenue-header h2 {
  margin: 0;
  font-size: 17px;
}

.dashboard-revenue-header .eyebrow {
  margin-bottom: 4px;
}

.dashboard-revenue-header p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--color-ink-muted);
  font-size: 12px;
}

.dashboard-revenue-total {
  min-width: 220px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-primary-surface);
  text-align: right;
}

.dashboard-revenue-total span {
  display: block;
  color: var(--color-ink-muted);
  font-size: 11px;
}

.dashboard-revenue-total strong {
  display: block;
  margin-top: 4px;
  color: var(--color-primary);
  font-size: 22px;
}

.dashboard-revenue-chart-wrap {
  position: relative;
  height: 220px;
  max-height: 220px;
  margin-top: 14px;
  overflow: hidden;
}

.dashboard-revenue-chart-wrap canvas {
  display: block;
  max-height: 100%;
}

.dashboard-active-branding {
  margin-bottom: 14px;
}

.dashboard-calendar-panel,
.dashboard-expiration-panel {
  width: 100%;
  margin-bottom: 14px;
}

.dashboard-calendar-heading { align-items: center; }
.dashboard-calendar-navigation {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dashboard-calendar-navigation button {
  min-width: 34px;
  min-height: 34px;
  padding: 5px 9px;
  font-size: 19px;
  line-height: 1;
}
.dashboard-calendar-navigation strong {
  min-width: 145px;
  color: var(--color-primary);
  text-align: center;
  font-size: 14px;
  text-transform: capitalize;
}
.dashboard-calendar-filters {
  margin-bottom: 0;
}
.dashboard-company-filter {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.dashboard-company-filter-label {
  color: var(--color-ink-secondary);
  font-size: 11px;
  font-weight: 600;
}
.dashboard-company-select {
  position: relative;
  min-width: 0;
}
.dashboard-company-select > summary {
  position: relative;
  padding: 9px 34px 9px 11px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  list-style: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.dashboard-company-select > summary::-webkit-details-marker { display: none; }
.dashboard-company-select > summary::after {
  position: absolute;
  right: 12px;
  content: '▾';
  color: var(--color-ink-muted);
}
.dashboard-company-select[open] > summary {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-surface);
}
.dashboard-company-options {
  position: absolute;
  z-index: 10;
  top: calc(100% + 5px);
  left: 0;
  width: min(320px, calc(100vw - 48px));
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.dashboard-company-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--color-ink-secondary);
  cursor: pointer;
  font-size: 12px;
}
.dashboard-company-option:hover { background: var(--color-primary-surface); }
.dashboard-company-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--color-primary);
}
.dashboard-calendar-content {
  padding: 0 20px 18px;
}
.dashboard-calendar-scroll {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--color-border-strong);
  padding-top: 0;
  background: var(--color-surface);
}
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: 210px minmax(700px, 1fr) 90px;
  column-gap: 10px;
  min-width: 1020px;
  align-items: stretch;
}
.dashboard-calendar-date-label,
.dashboard-calendar-days {
  box-sizing: border-box;
  min-height: 38px;
  color: var(--color-ink);
  font-size: 10px;
  font-weight: 700;
}
.dashboard-calendar-date-label {
  display: flex;
  align-items: center;
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--color-border-strong);
  color: var(--color-ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-raised) 100%);
}
.dashboard-calendar-days {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--calendar-days), minmax(0, 1fr));
  overflow: hidden;
  border-left: 1px solid var(--color-border-strong);
  border-right: 1px solid var(--color-border-strong);
  border-bottom: 1px solid var(--color-border-strong);
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-raised) 100%);
  box-shadow: inset 0 -1px 0 var(--color-border-strong);
  text-align: center;
}
.dashboard-calendar-days span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  overflow: hidden;
  padding: 6px 2px;
  border-right: 1px solid var(--color-border-strong);
  color: var(--color-ink);
  background: transparent;
}
.dashboard-calendar-days span:last-child { border-right: 0; }

body[data-dashboard-theme="dark"] .dashboard-calendar-scroll,
body[data-theme="dark"] .dashboard-calendar-scroll {
  background: var(--color-surface);
}
body[data-dashboard-theme="dark"] .dashboard-calendar-date-label,
body[data-theme="dark"] .dashboard-calendar-date-label,
body[data-dashboard-theme="dark"] .dashboard-calendar-days,
body[data-theme="dark"] .dashboard-calendar-days {
  color: var(--color-ink);
}
body[data-dashboard-theme="dark"] .dashboard-calendar-date-label,
body[data-theme="dark"] .dashboard-calendar-date-label {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-raised) 100%);
  border-bottom-color: var(--color-border-strong);
}
body[data-dashboard-theme="dark"] .dashboard-calendar-days,
body[data-theme="dark"] .dashboard-calendar-days {
  border-left-color: var(--color-border-strong);
  border-right-color: var(--color-border-strong);
  border-bottom-color: var(--color-border-strong);
  box-shadow: inset 0 -1px 0 var(--color-border-strong);
}
body[data-dashboard-theme="dark"] .dashboard-calendar-days span,
body[data-theme="dark"] .dashboard-calendar-days span {
  border-right-color: var(--color-border-strong);
  color: var(--color-ink);
}
.dashboard-calendar-company-group {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-border);
}
.dashboard-calendar-company-header {
  display: grid;
  grid-template-columns: 210px minmax(700px, 1fr) 90px;
  align-items: center;
  column-gap: 10px;
  min-height: 46px;
  padding: 5px 0;
  background: var(--color-primary-surface);
  border-bottom: 1px solid var(--color-border);
}
.dashboard-calendar-company-header .dashboard-calendar-track {
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.24);
}
.dashboard-calendar-company-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-primary-dark);
  text-align: left;
}
.dashboard-calendar-company-toggle:hover {
  background: var(--color-primary-surface);
  box-shadow: none;
}
.dashboard-calendar-company-chevron {
  display: inline-block;
  flex: 0 0 12px;
  color: var(--color-primary);
  text-align: center;
  font-size: 13px;
  line-height: 1;
  transform: rotate(0deg);
  animation: calendar-chevron-collapse 180ms ease both;
}
.dashboard-calendar-company-chevron.is-expanded {
  transform: rotate(90deg);
  animation-name: calendar-chevron-expand;
}
.dashboard-calendar-company-chevron.is-collapsed { transform: rotate(0deg); }
@keyframes calendar-chevron-expand {
  from { transform: rotate(0deg); }
  to { transform: rotate(90deg); }
}
@keyframes calendar-chevron-collapse {
  from { transform: rotate(90deg); }
  to { transform: rotate(0deg); }
}
.dashboard-calendar-company-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-primary-dark);
}
.dashboard-calendar-company-count {
  padding-right: 8px;
  color: var(--color-ink-muted);
  text-align: right;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-calendar-company-preview {
  width: 100%;
  min-width: 0;
  background-color: transparent;
}
.dashboard-calendar-preview-more {
  position: absolute;
  right: 3px;
  bottom: 2px;
  z-index: 2;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--color-surface);
  color: var(--color-ink-muted);
  font-size: 9px;
  line-height: 13px;
  white-space: nowrap;
}
.dashboard-calendar-company-body {
  padding: 4px 0 8px;
}
.dashboard-calendar-row {
  display: grid;
  grid-template-columns: 210px minmax(700px, 1fr) 90px;
  align-items: stretch;
  gap: 10px;
  min-height: 40px;
  border-bottom: 1px solid var(--color-border);
}
.dashboard-calendar-row-label {
  display: flex;
  min-width: 0;
  align-self: center;
  flex-direction: column;
  gap: 3px;
  padding: 5px 4px 5px 0;
}
.dashboard-calendar-row-label strong,
.dashboard-calendar-row-label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-calendar-row-label strong { color: var(--color-ink); font-size: 11px; }
.dashboard-calendar-row-label small { color: var(--color-ink-muted); font-size: 10px; }
.dashboard-calendar-track {
  position: relative;
  align-self: stretch;
  min-height: 32px;
  border-radius: 4px;
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--color-border) calc(100% - 1px));
  background-size: calc(100% / var(--calendar-days)) 100%;
  background-repeat: repeat;
  background-color: rgba(255, 255, 255, 0.12);
}
body[data-dashboard-theme="dark"] .dashboard-calendar-track,
body[data-theme="dark"] .dashboard-calendar-track {
  background-color: rgba(255, 255, 255, 0.02);
}
.dashboard-calendar-bar {
  position: absolute;
  min-width: 0;
  height: 24px;
  overflow: hidden;
  isolation: isolate;
  padding: 3px 6px;
  border-left: 3px solid var(--color-accent);
  border-radius: 3px;
  background: transparent;
  color: #fff;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 16px;
}
.dashboard-calendar-bar::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--color-primary);
  content: '';
  transform: scaleX(0.025);
  transform-origin: left center;
  animation: calendar-bar-grow 560ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
.dashboard-calendar-bar:hover::before { background: var(--color-primary-light); }
.dashboard-calendar-company-preview .dashboard-calendar-bar::before { background: var(--color-primary-dark); }
.dashboard-calendar-company-preview .dashboard-calendar-bar:hover::before { background: var(--color-primary); }
.dashboard-calendar-row .dashboard-calendar-bar::before { background: var(--color-primary-light); }
.dashboard-calendar-row .dashboard-calendar-bar:hover::before { background: var(--color-primary); }
.dashboard-calendar-bar span { position: relative; z-index: 1; }
.dashboard-calendar-bar.is-preview {
  height: 15px;
  padding: 0;
  border-left-width: 2px;
  cursor: pointer;
}
.dashboard-calendar-bar.is-preview::before { border-radius: 3px; }
@keyframes calendar-bar-grow {
  to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-calendar-bar::before { animation-duration: 1ms; }
  .dashboard-calendar-company-chevron { animation-duration: 1ms; }
}
.dashboard-calendar-empty {
  margin: 0;
  padding: 24px 12px;
  border-top: 1px solid var(--color-border);
  color: var(--color-ink-muted);
  text-align: center;
  font-size: 12px;
}
.dashboard-expiration-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 16px;
}
.dashboard-expiration-summary article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-surface);
}
.dashboard-expiration-summary article.is-expired {
  background: #fff4f2;
  border-color: #f2c9c3;
}
.dashboard-expiration-summary span {
  color: var(--color-ink-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dashboard-expiration-summary strong {
  grid-row: span 2;
  color: var(--color-primary);
  font-size: 22px;
}
.dashboard-expiration-summary .is-expired strong { color: #a83224; }
.dashboard-expiration-summary small {
  color: var(--color-ink-muted);
  font-size: 10px;
}
.dashboard-expiration-table { min-width: 760px; }
.dashboard-expiration-table th,
.dashboard-expiration-table td { white-space: nowrap; }
.dashboard-expiration-state {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
}
.dashboard-expiration-open {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-primary);
  text-align: left;
  font: inherit;
  font-weight: 650;
}
.dashboard-expiration-open:hover {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
}
.status-expired { color: #a83224; background: #fee8e5; }
.status-soon { color: #9a5c00; background: var(--color-accent-surface); }
.status-upcoming { color: var(--color-primary); background: var(--color-primary-surface); }
.dashboard-expiration-summary article {
  border-color: #e8e4d8;
  background: #faf9f5;
}
.dashboard-expiration-summary article.is-expired {
  border-color: #ead8d4;
  background: #faf5f4;
}
.dashboard-expiration-summary .is-expired strong { color: #9a5149; }
.status-expired { color: #94554e; background: #f8eeec; }

.chart-header-badge {
  font-size: 12px;
  color: var(--color-ink-secondary);
  background: var(--color-primary-surface);
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.chart-header-badge strong,
.chart-header-badge span {
  color: var(--color-primary);
  font-weight: 700;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-charts-row2 { margin-bottom: 14px; }

.dashboard-bottom {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.chart-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}
.chart-card-header h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--color-ink); }
.chart-subtitle { font-size: 11px; color: var(--color-ink-muted); margin-top: 2px; display: block; }

.chart-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  min-height: 220px;
  position: relative;
}

.chart-body-bar { padding: 14px 18px; min-height: 220px; }

.chart-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.chart-pt-wrap {
  gap: 26px;
  align-items: center;
}

.chart-donut-canvas {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.chart-pt-canvas-box {
  width: 210px;
  height: 210px;
}

.chart-pt-canvas-box canvas,
.chart-body-bar canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: grid;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.chart-pt-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 18px;
  flex: 1;
  min-width: 0;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--color-ink-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.chart-legend-item:hover {
  background: var(--color-primary-surface);
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; color: var(--color-ink); }
.chart-legend-stat { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--color-ink-muted); }
.chart-legend-value { font-weight: 700; color: var(--color-primary); font-size: 13px; }

.chart-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.chart-center-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.chart-center-sub { display: block; font-size: 10px; color: var(--color-ink-muted); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* =============================================
   UPCOMING EXPIRATION
   ============================================= */
.upcoming-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.upcoming-header h3 { margin: 0; font-size: 13.5px; font-weight: 700; }

.upcoming-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.upcoming-body {
  overflow-y: auto;
  flex: 1;
  max-height: 360px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.upcoming-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}
.upcoming-item:last-child { border-bottom: 0; }
.upcoming-item:hover { background: var(--color-surface-raised); }

.upcoming-brand { font-size: 13px; font-weight: 700; color: var(--color-ink); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-meta { font-size: 11px; color: var(--color-ink-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.upcoming-days { display: flex; flex-direction: column; align-items: center; text-align: center; flex-shrink: 0; }
.upcoming-days-num { font-size: 20px; font-weight: 800; line-height: 1; }
.upcoming-days-label { font-size: 10px; color: var(--color-ink-muted); margin-top: 2px; }

.upcoming-urgent .upcoming-days-num { color: var(--color-danger); }
.upcoming-warning .upcoming-days-num { color: #c05a00; }
.upcoming-ok .upcoming-days-num { color: var(--color-primary); }

.upcoming-empty { padding: 32px 20px; color: var(--color-ink-muted); text-align: center; font-size: 12.5px; line-height: 1.6; }

/* =============================================
   STATUS BADGES
   ============================================= */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-berjalan { color: #166043; background: #e8f4ef; }
.status-proses   { color: #b45309; background: #fef3c7; }
.status-booking  { color: #1d4ed8; background: #dbeafe; }
.status-selesai  { color: var(--color-ink-muted); background: var(--color-surface-raised); border: 1px solid var(--color-border); }
.status-none     { color: var(--color-ink-muted); background: var(--color-surface-raised); border: 1px solid var(--color-border); }
.status-none::before { display: none; }

/* =============================================
   REKAP BRANDING — Summary & Filters
   ============================================= */
.rekap-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.rekap-summary-card {
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.rekap-summary-card span {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
}

.rekap-summary-card strong {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-ink);
}

.rekap-summary-card.status-berjalan-card {
  border-left: 4px solid #166043;
}
.rekap-summary-card.status-berjalan-card strong {
  color: #166043;
}

.rekap-summary-card.status-proses-card {
  border-left: 4px solid #b45309;
}
.rekap-summary-card.status-proses-card strong {
  color: #b45309;
}

.rekap-summary-card.status-booking-card {
  border-left: 4px solid #1d4ed8;
}
.rekap-summary-card.status-booking-card strong {
  color: #1d4ed8;
}

.rekap-summary-card.status-none-card {
  border-left: 4px solid var(--color-ink-muted);
}

.rekap-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.rekap-audit-cell {
  min-width: 105px;
  white-space: normal;
}

.rekap-audit-time {
  color: var(--color-ink-muted);
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .rekap-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .rekap-filters {
    grid-template-columns: 1fr 1fr;
  }
}

/* =============================================
   TABLE SORTING
   ============================================= */
th.sortable, th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color var(--transition-fast);
}
th.sortable:hover, th[data-sort-key]:hover {
  background-color: var(--color-surface-raised);
}
th.sortable::after, th[data-sort-key]::after {
  content: ' ⇅';
  opacity: 0.3;
  font-size: 10px;
  margin-left: 5px;
  display: inline-block;
}
th.sort-asc::after {
  content: ' ▲' !important;
  opacity: 1 !important;
  color: var(--color-primary) !important;
}
th.sort-desc::after {
  content: ' ▼' !important;
  opacity: 1 !important;
  color: var(--color-primary) !important;
}

/* =============================================
   DASHBOARD TABS
   ============================================= */
.dashboard-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--color-surface-raised);
  padding: 5px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
}
.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--color-ink-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dash-tab:hover {
  color: var(--color-primary);
  background: var(--color-primary-surface);
}
.dash-tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
body[data-dashboard-theme="dark"] .dash-tab:hover,
body[data-theme="dark"] .dash-tab:hover {
  color: var(--color-ink);
  background: var(--color-surface);
}
body[data-dashboard-theme="dark"] .dash-tab.active,
body[data-theme="dark"] .dash-tab.active {
  background: var(--color-primary-surface);
  color: #ffffff;
  border: 1px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.dash-tab svg {
  flex-shrink: 0;
}

/* =============================================
   MASTER TABLE
   ============================================= */
[hidden] { display: none !important; }
.master-table { min-width: 1040px; table-layout: fixed; }
.master-table .col-no      { width: 48px;  }
.master-table .col-polisi  { width: 126px; }
.master-table .col-jalur   { width: 92px;  }
.master-table .col-lamb    { width: 84px;  }
.master-table .col-trayek  { width: 190px; }
.master-table .col-tipe    { width: 160px; }
.master-table .col-warna   { width: 115px; }
.master-table .col-karoseri{ width: 130px; }
.master-table .col-aksi    { width: 150px; }
.master-table th, .master-table td { overflow: hidden; text-overflow: ellipsis; }
.master-table .bus-no { text-align: center; }
.master-table td.bus-trayek { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.master-table .bus-trayek-missing { color: var(--color-warning-text); background: var(--color-warning-surface); font-weight: 600; }
.master-table .action-cell { overflow: visible; white-space: normal; }

.admin-config-note {
  margin: 12px 0;
  color: var(--color-ink-muted);
  font-size: 13px;
}
.admin-account-tabs {
  display: flex;
  gap: 4px;
  margin: 0 20px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
}
.admin-account-tab {
  min-width: 92px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-ink-secondary);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.admin-account-tab:hover:not(.is-active) { color: var(--color-primary); background: var(--color-surface); }
.admin-account-tab.is-active { border-color: var(--color-primary); color: #fff; background: var(--color-primary); }
.admin-account-tab:focus-visible,
.admin-permission-row input:focus-visible,
.icon-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.admin-account-panel { min-width: 0; }
.admin-account-panel > .admin-config-note { margin: 12px 20px; }
.admin-account-actions { white-space: nowrap; }
.admin-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  color: var(--color-ink-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-presence-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--color-border-strong);
}
.admin-presence.is-online { color: var(--color-success); }
.admin-presence.is-online .admin-presence-dot { background: var(--color-success); }
.admin-presence.is-offline .admin-presence-dot { background: var(--color-ink-muted); }
.admin-presence.is-unknown .admin-presence-dot {
  border: 1px solid var(--color-border-strong);
  background: transparent;
}
.admin-current-account {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px;
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink-muted);
  font-size: 11.5px;
  font-weight: 600;
}
.action-button.danger { border-color: var(--color-danger); color: var(--color-danger); }
.action-button.danger:hover:not(:disabled) { color: #fff; background: var(--color-danger); }
.admin-access-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 280px);
  gap: 7px;
  margin: 18px 20px 10px;
}
.admin-access-toolbar label,
.admin-account-details dt,
.admin-delete-account-details dt {
  color: var(--color-ink-secondary);
  font-size: 11px;
  font-weight: 700;
}
.admin-access-toolbar select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  background: var(--color-surface);
  font: inherit;
}
.admin-access-empty {
  margin: 0 20px 20px;
  padding: 24px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-ink-muted);
  text-align: center;
}
.admin-selected-account,
.admin-effective-access {
  margin: 16px 20px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.admin-selected-account-heading,
.admin-effective-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-selected-account-heading h3,
.admin-effective-heading h3 {
  margin: 0;
  color: var(--color-ink);
  font-size: 15px;
}
.admin-selected-account-heading .eyebrow,
.admin-effective-heading .eyebrow { margin: 0 0 4px; }
.admin-account-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-success);
  background: var(--color-surface-raised);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.admin-account-status.is-inactive { color: var(--color-danger); }
.admin-account-details,
.admin-delete-account-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 18px 0 0;
}
.admin-account-details div,
.admin-delete-account-details div { min-width: 0; }
.admin-account-details dd,
.admin-delete-account-details dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--color-ink);
  font-size: 13px;
  font-weight: 600;
}
.admin-effective-heading { align-items: flex-start; }
.admin-effective-heading .admin-config-note { margin: 0; text-align: right; }
.admin-superadmin-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--color-primary-muted);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-primary-surface);
  font-size: 12px;
}
.admin-permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.admin-permission-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
}
.admin-permission-group h4 {
  margin: 0 0 8px;
  color: var(--color-ink-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.admin-permission-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  cursor: pointer;
}
.admin-permission-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
}
.admin-permission-row input:disabled { cursor: default; }
.admin-permission-row strong {
  display: block;
  color: var(--color-ink);
  font-size: 12px;
}
.admin-permission-row small {
  display: block;
  margin-top: 3px;
  color: var(--color-ink-muted);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.4;
}
.admin-permission-source {
  padding-top: 2px;
  color: var(--color-ink-muted);
  font-size: 9.5px;
  white-space: nowrap;
}
.admin-effective-access .modal-actions { margin-top: 16px; }
.admin-delete-account-details { margin: 8px 0 14px; }
.admin-delete-warning {
  margin: 0;
  padding: 12px;
  border-left: 3px solid var(--color-danger);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  background: var(--color-surface-raised);
  font-size: 12.5px;
}
.confirm-modal .modal-actions button.danger:focus-visible {
  outline: 2px solid var(--color-danger);
  outline-offset: 2px;
}
.admin-master-data-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 12px 0 18px;
}
.admin-master-data-form label { flex: 1; max-width: 360px; }
.admin-account-active span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-ink);
}
.admin-account-active input { width: auto; accent-color: var(--color-primary); }

.action-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px;
  padding: 5px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-surface);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.08s;
}
.action-button:hover { background: var(--color-primary-surface); border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }
.action-button:active { transform: translateY(1px); }
.action-button.danger { color: var(--color-danger); border-color: #f0bfba; background: var(--color-danger-surface); }
.action-button.danger:hover { background: #fbdad8; border-color: var(--color-danger); }

/* =============================================
   BOOKING FORM
   ============================================= */
.booking-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 20px 22px;
}

.booking-form label {
  display: grid;
  gap: 5px;
  color: var(--color-ink-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.booking-form textarea { resize: vertical; }
.booking-form small { color: var(--color-ink-muted); font-size: 11.5px; font-weight: 400; line-height: 1.4; text-transform: none; letter-spacing: 0; }
.wide-field { grid-column: 1 / -1; }
.form-action { display: flex !important; align-items: flex-end; }
/* Bus Picker */
.bus-picker { display: grid; gap: 12px; }
.bus-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bus-picker-heading label { color: var(--color-ink-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.bus-picker-heading small { display: block; margin-top: 5px; color: var(--color-ink-muted); text-transform: none; letter-spacing: 0; }
.bus-picker-heading strong {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--color-primary);
  background: var(--color-primary-surface);
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 700;
}

.bus-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bus-picker-actions button { padding: 7px 10px; font-size: 12px; }

.bus-list {
  display: grid;
  max-height: 370px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.bus-option {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(160px, 0.85fr);
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.bus-option:last-child { border-bottom: 0; }
.bus-option:not(.is-disabled):hover { background: var(--color-primary-surface); }
.bus-option input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--color-primary); }
.bus-option-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.bus-option-main strong { min-width: 44px; color: var(--color-ink); font-size: 13px; font-weight: 700; }
.bus-option small { color: var(--color-ink-muted); text-align: right; font-size: 11.5px; }
.bus-option.is-disabled { cursor: not-allowed; background: var(--color-surface-raised); opacity: 0.60; }
.bus-option.is-disabled input { cursor: not-allowed; }
.bus-list-empty { margin: 0; padding: 24px; color: var(--color-ink-muted); text-align: center; font-size: 13px; }

/* =============================================
   MODALS
   ============================================= */
.bus-modal {
  width: min(680px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-ink);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
  animation: modal-in 0.18s ease;
}
.bus-modal::backdrop { background: rgba(14, 74, 49, 0.30); animation: backdrop-in 0.18s ease; }
.bus-modal form { padding: 22px; }

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

.modal-heading, .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-heading h2 { margin: 0; font-size: 17px; font-weight: 700; }

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink-muted);
  background: var(--color-surface-raised);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-button:hover { background: var(--color-border); color: var(--color-ink); }

.modal-note {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary-muted);
  color: var(--color-ink-secondary);
  background: var(--color-primary-surface);
  font-size: 12px;
  line-height: 1.5;
}

.bus-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.bus-edit-grid label { display: grid; gap: 5px; color: var(--color-ink-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.bus-edit-grid input, .bus-edit-grid select, .bus-edit-grid textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--input-color);
  background: var(--input-bg);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.bus-edit-grid input::placeholder, .bus-edit-grid textarea::placeholder {
  color: var(--input-placeholder);
}
.bus-edit-grid input:focus, .bus-edit-grid select:focus, .bus-edit-grid textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 154, 112, 0.28);
}
.bus-edit-grid input[readonly] { color: var(--input-readonly-color); background: var(--input-readonly-bg); cursor: not-allowed; }
.bus-edit-grid select, .bus-edit-grid textarea { cursor: pointer; }
.bus-edit-grid textarea { resize: vertical; cursor: text; }
.bus-edit-grid select:not(:disabled):hover, .bus-edit-grid input:not([readonly]):hover, .branding-edit-grid select:hover, .branding-edit-grid textarea:hover { border-color: var(--color-border-strong); }

.modal-wide { grid-column: 1 / -1; }
.modal-actions { justify-content: flex-end; margin-top: 8px; }
.modal-actions button { min-width: 100px; }
.modal-error { min-height: 18px; margin: -4px 0 10px; color: var(--color-danger); font-size: 12.5px; }

.confirm-modal { width: min(440px, calc(100vw - 32px)); }
.confirm-message-wrapper { padding: 18px 0; font-size: 13.5px; line-height: 1.65; color: var(--color-ink); white-space: pre-wrap; }
.confirm-modal .modal-actions button.danger { background: var(--color-danger); color: #fff; }
.confirm-modal .modal-actions button.danger:hover { background: #a62c21; }

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.app-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 380px;
  margin: 0;
  padding: 13px 17px;
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--color-success);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}
.app-notice.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.app-notice.error { background: var(--color-danger); }

code {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--color-surface-raised);
  color: var(--color-primary);
  font-size: 12px;
  border: 1px solid var(--color-border);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page { background: #edf4f0; }
.login-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(360px, 0.9fr);
  min-height: 100vh;
}
.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 7vw, 100px);
  color: #fff;
  background: var(--color-primary);
  position: relative;
  overflow: hidden;
}
.login-intro::before {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(253,196,33,0.07);
  pointer-events: none;
}
.login-intro::after {
  content: '';
  position: absolute;
  top: -60px;
  left: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}
.login-intro .brand-mark { margin-bottom: 38px; position: relative; z-index: 1; }
.login-intro .eyebrow { color: var(--color-accent); position: relative; z-index: 1; }
.login-intro h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  position: relative;
  z-index: 1;
}
.login-intro > p:last-child {
  max-width: 380px;
  margin: 16px 0 0;
  color: rgba(255,255,255,0.60);
  line-height: 1.65;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.login-right-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 32px 24px 24px;
  min-height: 100vh;
}

.login-card {
  align-self: center;
  width: min(100% - 40px, 420px);
  margin: auto;
  padding: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}
.login-card h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.03em; }
.login-copy { margin: 7px 0 24px; color: var(--color-ink-muted); font-size: 13px; line-height: 1.55; }
.login-card form { display: grid; gap: 7px; }
.login-card label { margin-top: 7px; color: var(--color-ink-secondary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  background: var(--color-surface);
  font: inherit;
  font-size: 13.5px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.login-card input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-surface); }
.login-card button { width: 100%; margin-top: 12px; }
.login-message { min-height: 20px; margin: 4px 0 0; color: var(--color-ink-muted); font-size: 12.5px; }
.login-message.is-error { color: var(--color-danger); }

.login-footer {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--color-ink-muted);
}
.login-footer p { margin: 2px 0; }

/* =============================================
   APP FOOTER
   ============================================= */
.app-footer {
  margin-top: 36px;
  padding-top: 20px;
  padding-bottom: 8px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-ink-muted);
  text-align: center;
  width: 100%;
}

.app-footer-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

@media (max-width: 850px) {
  .dashboard-revenue-chart-wrap {
    height: 180px;
    max-height: 180px;
  }
  .admin-permission-groups { grid-template-columns: minmax(0, 1fr); }
  .admin-access-toolbar { grid-template-columns: minmax(0, 1fr); }

  .revenue-chart-card .chart-body-bar {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
  }

  .revenue-chart-card .chart-body-bar canvas {
    max-height: 200px;
  }

  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    height: auto;
    padding: 14px;
  }
  .brand-mark { grid-column: 1; grid-row: 1; }
  .brand-name { grid-column: 1; grid-row: 2; margin: 6px 4px 0; }
  .mobile-nav-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-ink-secondary);
    background: var(--color-surface);
  }
  .mobile-nav-toggle:hover:not(:disabled) {
    color: var(--color-primary);
    background: var(--color-primary-surface);
    box-shadow: none;
  }
  .mobile-nav-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
  nav {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.2s ease, margin-top 0.2s ease, opacity 0.15s ease, visibility 0.2s;
  }
  .sidebar.is-nav-open nav {
    max-height: 70vh;
    margin-top: 14px;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
  }
  .nav-section { min-width: 0; }
  .nav-section-label { padding-left: 8px; }
  .firebase-status, .user-session { display: none; }
  main { padding: 22px 16px; }
  .filters, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .view-sticky-header.is-compact { padding-block: 8px; }
  .view-sticky-header.is-compact {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .view-sticky-header.is-compact > div:first-child { min-width: 0; }
  .view-sticky-header.is-compact .button-group {
    flex: 1 1 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .login-layout { grid-template-columns: 1fr; }
  .login-right-wrapper { min-height: auto; padding: 24px 16px; }
  .login-intro { min-height: 220px; padding: 32px; }
  .login-intro .brand-mark { margin-bottom: 22px; }
  .login-intro h1 { font-size: 34px; }
  .booking-form { grid-template-columns: 1fr; }
  .button-group { justify-content: flex-start; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .compact-filters { padding: 0 14px 14px; }
  .bus-option { grid-template-columns: auto minmax(0, 1fr); }
  .bus-option small { grid-column: 2; text-align: left; }
  .bus-edit-grid { grid-template-columns: 1fr; }
  .bus-picker-heading { align-items: flex-start; flex-direction: column; }
  .bus-modal form { padding: 16px; }
  .dashboard-charts-overview {
    grid-template-columns: 1fr;
  }

  .dashboard-revenue-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-revenue-total {
    min-width: 0;
    text-align: left;
  }

  .dashboard-calendar-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-calendar-navigation { align-self: stretch; justify-content: space-between; }
  .dashboard-expiration-summary { grid-template-columns: 1fr; }

  .dashboard-bottom { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
}

.pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.pricing-table-card,
.ppn-card,
.revenue-chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pricing-table-card,
.revenue-chart-card {
  padding: 12px;
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
}

.pricing-table th,
.pricing-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-size: 12.5px;
}

.pricing-table th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-secondary);
  background: var(--color-surface-raised);
}

.pricing-table input {
  width: 100%;
  min-width: 110px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #1b2b25;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.pricing-table input::placeholder {
  color: #73877e;
}

.pricing-table input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 154, 112, 0.25);
  color: #1b2b25;
}

.pricing-table input:disabled,
.pricing-table input[readonly] {
  background: #f6f7f4;
  color: #73877e;
  cursor: not-allowed;
}

body[data-dashboard-theme="dark"] .pricing-table input,
body[data-theme="dark"] .pricing-table input {
  border-color: var(--color-border-strong);
}

.ppn-card {
  padding: 18px;
}

.ppn-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.ppn-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(14, 74, 49, 0.2);
  transition: all var(--transition-base);
}

.slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);
  transition: all var(--transition-base);
}

.switch input:checked + .slider {
  background: var(--color-primary);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.slider-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--color-ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.slider-field input[type="range"] {
  width: 100%;
}

.ppn-preview {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.ppn-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-ink-secondary);
  font-size: 12.5px;
}

.ppn-preview-row.total-row {
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
  font-weight: 700;
  color: var(--color-ink);
}

.revenue-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.revenue-summary-card {
  display: grid;
  gap: 8px;
  padding: 18px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.revenue-summary-card span {
  color: var(--color-ink-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.revenue-summary-card strong {
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  word-break: break-word;
}

.accent-card {
  background: var(--color-primary-surface);
}

.revenue-chart-card {
  margin-bottom: 20px;
}

.revenue-chart-card .chart-body-bar {
  display: block;
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  overflow: hidden;
}

.revenue-chart-card .chart-body-bar canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 240px;
}

.revenue-table-wrap {
  overflow-x: auto;
}

#revenue-table {
  min-width: 980px;
}

#revenue-table th,
#revenue-table td {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .pricing-layout,
  .revenue-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 851px) and (max-width: 1100px) {
  .filters,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  nav {
    grid-template-columns: 1fr;
  }

  .nav-section-label {
    letter-spacing: 0.1em;
  }

  .nav-subitem {
    margin-left: 8px;
    padding-left: 12px;
  }

  .ppn-toggle-row {
    flex-wrap: wrap;
  }
}

/* =============================================
   BRANDING SUB-TABS
   ============================================= */
.branding-tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--color-surface-raised);
  padding: 5px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
}

.branding-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--color-ink-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.branding-tab:hover {
  color: var(--color-primary);
  background: var(--color-primary-surface);
  box-shadow: none;
}

.branding-tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

body[data-dashboard-theme="dark"] .branding-tab:hover,
body[data-theme="dark"] .branding-tab:hover {
  color: var(--color-ink);
  background: var(--color-surface);
}

body[data-dashboard-theme="dark"] .branding-tab.active,
body[data-theme="dark"] .branding-tab.active {
  background: var(--color-primary-surface);
  color: #ffffff;
  border: 1px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.branding-tab svg {
  flex-shrink: 0;
}

/* =============================================
   ADMIN TABLE — Kelengkapan column
   ============================================= */
.admin-completion-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-completion-badge.complete {
  background: var(--color-success-surface);
  color: var(--color-success);
  border: 1px solid rgba(22, 96, 67, 0.18);
}

.admin-completion-badge.partial {
  background: var(--color-warning-surface);
  color: var(--color-warning-text);
  border: 1px solid rgba(229, 167, 0, 0.20);
}

.admin-completion-badge.empty {
  background: var(--color-surface-raised);
  color: var(--color-ink-muted);
  border: 1px solid var(--color-border);
}

.admin-period-filters {
  grid-template-columns: minmax(220px, 420px);
  padding-bottom: 14px;
}
.admin-period-groups {
  border-top: 1px solid var(--color-border);
}
.admin-period-empty { margin: 0; }
.admin-year-group {
  border-bottom: 1px solid var(--color-border-strong);
}
.admin-year-toggle,
.admin-month-toggle {
  display: grid;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 0;
  text-align: left;
  box-shadow: none;
}
.admin-year-toggle {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 52px;
  padding: 9px 20px;
  background: var(--color-primary-surface);
  color: var(--color-primary);
  font-size: 17px;
  font-weight: 800;
}
.admin-year-toggle:hover { background: #dcefe7; box-shadow: none; }
.admin-year-summary {
  color: var(--color-ink-muted);
  font-size: 11px;
  font-weight: 600;
}
.admin-year-months { padding: 0 12px 10px 24px; }
.admin-month-group {
  overflow: hidden;
  margin-top: 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.admin-month-toggle {
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--color-surface-raised);
  color: var(--color-ink-secondary);
  font-size: 12px;
  font-weight: 700;
}
.admin-month-toggle:hover { background: var(--color-primary-surface); box-shadow: none; }
.admin-accordion-chevron {
  display: inline-block;
  color: var(--color-primary);
  font-size: 12px;
  line-height: 1;
  transform: rotate(0);
  transition: transform 180ms ease;
}
.admin-accordion-chevron.is-expanded { transform: rotate(90deg); }
.admin-month-name { font-weight: 700; }
.admin-month-summary {
  color: var(--color-ink-muted);
  font-size: 10px;
  font-weight: 600;
}
.admin-period-table-wrap {
  border-top: 1px solid var(--color-border);
}
.admin-period-table { min-width: 760px; }
.admin-undated-group { background: var(--color-surface); }
@media (prefers-reduced-motion: reduce) {
  .admin-accordion-chevron { transition-duration: 1ms; }
}

/* Eye icon button */
.eye-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  background: var(--color-surface);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.eye-button:hover {
  background: var(--color-primary-surface);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.eye-button svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* =============================================
   ADMIN DETAIL MODAL
   ============================================= */
.admin-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

.admin-modal[open] {
  display: flex;
  flex-direction: column;
}

.admin-modal:not([open]) {
  display: none !important;
}

.admin-modal-inner {
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - 80px);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.admin-modal-subtitle {
  margin: 4px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-ink-secondary);
}

/* Bus section */
.admin-bus-section {
  padding: 14px 16px;
  background: var(--color-primary-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.admin-section-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.admin-bus-list {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink);
  line-height: 1.7;
  word-break: break-word;
}

/* Document grid */
.admin-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-doc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: box-shadow var(--transition-fast);
}

.admin-doc-card:hover {
  box-shadow: var(--shadow-sm);
}

.admin-doc-card-wide {
  grid-column: 1 / -1;
}

.admin-doc-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-doc-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.admin-doc-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.admin-doc-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
}

.admin-doc-hint {
  font-size: 11px;
  color: var(--color-ink-muted);
  font-weight: 500;
  line-height: 1.2;
}

/* Document status */
.admin-doc-status {
  font-size: 12px;
  color: var(--color-ink-muted);
  min-height: 20px;
}

.admin-doc-status.has-file {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-success);
  font-weight: 600;
}

.admin-doc-status.has-file::before {
  content: '✓';
  font-size: 13px;
  font-weight: 800;
}

/* Document actions */
.admin-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-surface);
  color: var(--color-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.admin-upload-btn:hover:not(:disabled) {
  background: #d4eae0;
  border-color: var(--color-border-strong);
}
.admin-upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.admin-view-btn:hover {
  background: var(--color-primary-surface);
  border-color: var(--color-border-strong);
}

.admin-replace-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid #f0bfba;
  border-radius: var(--radius-sm);
  background: var(--color-danger-surface);
  color: var(--color-danger);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.admin-replace-btn:hover:not(:disabled) {
  background: #fbdad8;
  border-color: var(--color-danger);
}
.admin-replace-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Upload progress */
.admin-upload-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-ink-secondary);
}

.admin-upload-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: admin-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes admin-spin {
  to { transform: rotate(360deg); }
}

/* Upload error */
.admin-upload-error {
  margin: 0;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--color-danger);
  font-weight: 500;
}

/* Foto branding */
.admin-foto-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--color-primary-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.admin-foto-bus-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.admin-foto-bus-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  font-size: 12px;
}

.admin-foto-bus-label {
  font-weight: 700;
  color: var(--color-ink);
  font-size: 12.5px;
}

.admin-foto-bus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-foto-bus-actions .admin-upload-btn,
.admin-foto-bus-actions .admin-view-btn,
.admin-foto-bus-actions .admin-replace-btn {
  font-size: 11px;
  padding: 5px 10px;
}

.admin-foto-status {
  font-size: 11px;
  color: var(--color-success);
  font-weight: 600;
}

.admin-foto-status.missing {
  color: var(--color-ink-muted);
}

/* Responsive admin */
@media (max-width: 640px) {
  .admin-doc-grid { grid-template-columns: 1fr; }
  .admin-doc-card-wide { grid-column: 1; }
  .branding-tabs { flex-wrap: wrap; }
  .branding-tab { font-size: 12px; padding: 7px 12px; }
}

/* Surat Penawaran: fixed-page A4 preview and source selection */
.offer-panel { min-width: 0; }
.offer-heading { align-items: flex-start; }
.offer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.offer-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(480px, 1.1fr);
  align-items: start;
  gap: 18px;
}
.offer-form { display: grid; gap: 14px; min-width: 0; }
.offer-card, .offer-preview-area {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.offer-card-heading, .offer-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.offer-card-heading { justify-content: flex-start; }
.offer-card-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--color-primary);
  background: var(--color-primary-surface);
  font-size: 12px;
  font-weight: 800;
}
.offer-card-heading h3, .offer-preview-heading h3 { margin: 0; font-size: 16px; }
.offer-card-heading p, .offer-preview-heading p { margin: 4px 0 0; color: var(--color-ink-muted); font-size: 12px; }
.offer-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.offer-form-grid > label { display: grid; gap: 5px; color: var(--color-ink); font-size: 12px; font-weight: 700; }
.offer-form-grid input, .offer-form-grid select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  background: var(--color-surface);
  font: inherit;
  font-size: 13px;
}
.offer-field-wide, .offer-record-options, .offer-record-empty, .offer-selected-wrap { grid-column: 1 / -1; }
.offer-record-options { display: grid; max-height: 260px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.offer-record-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-ink);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
}
.offer-record-choice:last-child { border-bottom: 0; }
.offer-record-choice:hover, .offer-record-choice.is-selected { background: var(--color-primary-surface); }
.offer-record-choice > span, .offer-selected-table td > small { display: grid; gap: 3px; }
.offer-record-choice strong { font-size: 12px; }
.offer-record-choice small, .offer-selected-table td small { color: var(--color-ink-muted); font-size: 11px; }
.offer-record-bus { flex: 0 0 auto; text-align: right; }
.offer-help { margin: 0; color: var(--color-ink-muted); font-size: 12px; line-height: 1.5; }
.offer-selected-wrap h4 { margin: 0 0 8px; font-size: 13px; }
.offer-selected-wrap h4 span { color: var(--color-primary); }
.offer-selected-table { min-width: 580px; font-size: 11px; }
.offer-selected-table td { vertical-align: top; }
.offer-selected-table td > small { margin-top: 3px; }
.offer-price-error { color: var(--color-danger, #a32020); font-size: 11px; }
.offer-remove-record { padding: 5px 8px; font-size: 11px; }
.offer-message {
  margin: 0 0 12px;
  color: var(--color-ink-muted);
  font-size: 13px;
}
.offer-message.is-error { color: var(--color-danger, #a32020); }
.offer-message.is-success { color: var(--color-success, #167346); }
.offer-preview-area { position: sticky; top: 12px; max-height: calc(100vh - 110px); overflow: auto; }
.offer-preview-heading { position: sticky; z-index: 1; top: -18px; margin: -18px -18px 14px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.offer-preview-heading > span { flex: 0 0 auto; color: var(--color-ink-muted); font-size: 11px; }
.offer-pages { display: grid; gap: 16px; justify-items: center; }
.offer-sheet {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff url("assets/surat-penawaran/image1.png") center / 100% 100% no-repeat;
  box-shadow: 0 4px 16px rgb(20 34 26 / 15%);
  color: #252d28;
  font: 10px/1.32 Arial, sans-serif;
}
.offer-sheet-content { position: absolute; inset: 14% 12% 10%; overflow: hidden; }
.offer-sheet-content p { margin: 0 0 5px; }
.offer-document-meta { margin-bottom: 9px; }
.offer-recipient-preview { margin: 7px 0 10px; }
.offer-preview-section-title { margin-top: 8px !important; font-weight: 700; }
.offer-preview-table-wrap { width: 100%; overflow: hidden; }
.offer-preview-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7px; }
.offer-preview-table th, .offer-preview-table td { padding: 3px; border: 1px solid #6e756f; overflow-wrap: anywhere; vertical-align: top; }
.offer-pricing-preview th:first-child, .offer-pricing-preview td:first-child { width: 5%; text-align: center; }
.offer-preview-table th { color: #fff; background: #0e4a31; font-size: 6.5px; }
.offer-preview-table small { display: block; margin-top: 2px; color: #626862; font-size: 6px; }
.offer-letter-second-page h4, .offer-appendix-sheet h4 { margin: 0 0 6px; font-size: 10px; }
.offer-letter-second-page .offer-preview-table { font-size: 6px; }
.offer-letter-second-page ol { margin: 3px 0 6px; padding-left: 15px; font-size: 8px; }
.offer-letter-second-page li { margin-bottom: 3px; }
.offer-letter-second-page .offer-preview-date { margin-top: 9px; text-align: right; }
.offer-signature-space { height: 32px; }
.offer-appendix-label { color: #0e4a31; font-size: 8px; font-weight: 700; letter-spacing: 0.12em; }
.offer-appendix-sheet .offer-sheet-content > p:not(.offer-appendix-label) { margin-bottom: 7px; }
.offer-appendix-images { display: grid; gap: 9px; justify-items: center; margin-top: 12px; }
.offer-appendix-images img { display: block; width: 100%; max-height: 34%; object-fit: contain; }
.offer-appendix-images img + img { max-width: 42%; max-height: 16%; }

.confirmation-heading { align-items: center; }
.confirmation-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.confirmation-workspace { display: grid; grid-template-columns: minmax(400px, 0.9fr) minmax(420px, 1.1fr); align-items: start; gap: 18px; }
.confirmation-form { display: grid; gap: 14px; min-width: 0; }
.confirmation-card, .confirmation-preview-area {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.confirmation-card-heading, .confirmation-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.confirmation-card-heading { justify-content: flex-start; }
.confirmation-card-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--color-primary);
  background: var(--color-primary-surface);
  font-size: 12px;
  font-weight: 800;
}
.confirmation-card-heading h3, .confirmation-preview-heading h3 { margin: 0; font-size: 16px; }
.confirmation-card-heading p, .confirmation-preview-heading p { margin: 4px 0 0; color: var(--color-ink-muted); font-size: 12px; }
.confirmation-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.confirmation-form-grid > label { display: grid; gap: 5px; color: var(--color-ink); font-size: 12px; font-weight: 700; }
.confirmation-form-grid input, .confirmation-form-grid select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  background: var(--color-surface);
  font: inherit;
  font-size: 13px;
}
.confirmation-field-wide, .confirmation-record-options, .confirmation-record-empty, .confirmation-selected-wrap { grid-column: 1 / -1; }
.confirmation-record-options { display: grid; max-height: 260px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.confirmation-record-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-ink);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
}
.confirmation-record-choice:last-child { border-bottom: 0; }
.confirmation-record-choice:hover, .confirmation-record-choice.is-selected { background: var(--color-primary-surface); }
.confirmation-record-choice > span, .confirmation-selected-table td > small { display: grid; gap: 3px; }
.confirmation-record-choice strong { font-size: 12px; }
.confirmation-record-choice small, .confirmation-selected-table td small { color: var(--color-ink-muted); font-size: 11px; }
.confirmation-record-price { flex: 0 0 auto; text-align: right; }
.confirmation-help { margin: 0; color: var(--color-ink-muted); font-size: 12px; line-height: 1.5; }
.confirmation-selected-wrap h4 { margin: 0 0 8px; font-size: 13px; }
.confirmation-selected-wrap h4 span { color: var(--color-primary); }
.confirmation-selected-table { min-width: 560px; font-size: 11px; }
.confirmation-selected-table td { vertical-align: top; }
.confirmation-selected-table td > small { margin-top: 3px; }
.confirmation-remove-record { padding: 5px 8px; font-size: 11px; }
.confirmation-price-error, .confirmation-preview-error { color: var(--color-danger, #a32020) !important; }
.confirmation-message { margin: 0 0 12px; color: var(--color-ink-muted); font-size: 13px; }
.confirmation-message.is-error { color: var(--color-danger, #a32020); }
.confirmation-message.is-success { color: var(--color-success, #167346); }
.confirmation-message.is-info { color: var(--color-ink-muted); }
.confirmation-preview-area { position: sticky; top: 12px; max-height: calc(100vh - 110px); overflow: auto; }
.confirmation-preview-heading { position: sticky; z-index: 1; top: -18px; margin: -18px -18px 14px; padding: 14px 18px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.confirmation-preview-heading > span { flex: 0 0 auto; color: var(--color-ink-muted); font-size: 11px; }
.confirmation-pages { display: grid; gap: 16px; justify-items: center; }
.confirmation-sheet {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff url("assets/surat-konfirmasi/image1.png") center / 100% 100% no-repeat;
  box-shadow: 0 4px 16px rgb(20 34 26 / 15%);
  color: #252d28;
  font: 9px/1.25 Arial, sans-serif;
}
.confirmation-sheet-content { position: absolute; inset: 14% 12% 10%; overflow: hidden; }
.confirmation-sheet-content p { margin: 0 0 4px; }
.confirmation-document-meta { margin-bottom: 8px; }
.confirmation-recipient { margin-bottom: 7px; }
.confirmation-subject-line { margin-bottom: 6px !important; }
.confirmation-table-caption, .confirmation-terms-heading { margin: 5px 0 3px !important; font-weight: 700; }
.confirmation-pricing-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 6.2px; }
.confirmation-pricing-table th, .confirmation-pricing-table td { padding: 2px; border: 1px solid #6e756f; overflow-wrap: anywhere; vertical-align: top; }
.confirmation-pricing-table th { color: #fff; background: #0e4a31; font-size: 5.8px; }
.confirmation-pricing-table th:first-child, .confirmation-pricing-table td:first-child { width: 5%; text-align: center; }
.confirmation-pricing-table th:nth-child(2) { width: 20%; }
.confirmation-pricing-table th:nth-child(3) { width: 15%; }
.confirmation-pricing-table th:nth-child(4) { width: 12%; }
.confirmation-pricing-table th:nth-child(5) { width: 12%; }
.confirmation-pricing-table th:nth-child(6), .confirmation-pricing-table th:nth-child(7) { width: 18%; }
.confirmation-total-row { display: flex; justify-content: flex-end; gap: 14px; margin-top: 2px; font-size: 7px; }
.confirmation-total-row strong { min-width: 76px; text-align: right; }
.confirmation-total-row.is-grand { font-weight: 700; }
.confirmation-terbilang, .confirmation-price-terms { margin: 4px 0 !important; font-size: 7px; }
.confirmation-terms-heading, .confirmation-continuation { font-weight: 700; }
.confirmation-terms { margin: 2px 0 6px; padding-left: 15px; font-size: 7px; line-height: 1.2; }
.confirmation-terms li { margin-bottom: 3px; padding-left: 1px; }
.confirmation-signature { margin: 8px 0 0 auto; width: 46%; }
.confirmation-signature-space { height: 34px; }
.confirmation-signature strong { font-weight: 700; }
@media (max-width: 1200px) {
  .offer-workspace { grid-template-columns: 1fr; }
  .offer-preview-area { position: static; max-height: none; }
  .offer-sheet { max-width: 720px; }
  .confirmation-workspace { grid-template-columns: 1fr; }
  .confirmation-preview-area { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .offer-heading { flex-direction: column; }
  .offer-form-grid { grid-template-columns: 1fr; }
  .offer-field-wide, .offer-record-options, .offer-record-empty, .offer-selected-wrap { grid-column: 1; }
  .offer-card, .offer-preview-area { padding: 12px; }
  .offer-preview-heading { top: -12px; margin: -12px -12px 12px; padding: 12px; }
  .confirmation-heading { align-items: flex-start; flex-direction: column; }
  .confirmation-actions { width: 100%; }
  .confirmation-actions button { flex: 1; }
  .confirmation-form-grid { grid-template-columns: 1fr; }
  .confirmation-field-wide, .confirmation-record-options, .confirmation-record-empty, .confirmation-selected-wrap { grid-column: 1; }
  .confirmation-card, .confirmation-preview-area { padding: 12px; }
  .confirmation-preview-heading { top: -12px; margin: -12px -12px 12px; padding: 12px; }
}

/* =============================================
   PRODUCT POLISH — shared responsive surfaces
   ============================================= */
.dashboard-calendar-panel {
  overflow: visible;
}

.dashboard-calendar-filters {
  position: relative;
  z-index: 2;
}

.dashboard-company-options {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

#rekap-branding-table th:nth-child(11),
#rekap-branding-table td:nth-child(11) {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rekap-branding-table th:nth-child(12),
#rekap-branding-table td:nth-child(12),
#rekap-branding-table th:nth-child(13),
#rekap-branding-table td:nth-child(13) {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
main select,
main textarea {
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
}

main input:focus-visible,
main select:focus-visible,
main textarea:focus-visible {
  outline: 2px solid rgba(14, 74, 49, 0.28);
  outline-offset: 1px;
}

@media (max-width: 850px) {
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
  }

  .dashboard-charts,
  .dashboard-bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.15rem);
  }
}

@media (max-width: 560px) {
  main {
    padding: 20px 14px;
  }

  .sidebar {
    padding: 14px;
  }

  .brand-mark {
    max-width: 170px;
  }

  .page-header {
    gap: 14px;
    margin-bottom: 20px;
  }

  .view-sticky-header.is-compact {
    margin-bottom: 12px;
    padding-inline: 12px;
  }
  .app-view:not(.data-panel) > .view-sticky-header.is-compact {
    padding-inline: 0;
  }
  .view-sticky-header.is-compact h1,
  .view-sticky-header.is-compact h2 {
    font-size: 1.35rem;
  }
  .view-sticky-header.is-compact .button-group button,
  .view-sticky-header.is-compact .button-group > .button-link {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .subtitle {
    font-size: 13px;
  }

  .filters,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-grid article {
    gap: 9px;
    padding: 13px;
  }

  .kpi-grid article:nth-child(n + 5):not(.kpi-revenue) .kpi-content {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .kpi-grid .kpi-revenue strong {
    font-size: 17px;
  }

  .chart-card-header,
  .dashboard-revenue-header {
    align-items: flex-start;
  }

  .chart-pt-wrap {
    flex-direction: column;
  }

  .chart-pt-legend {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 180px;
  }
}

/* =============================================
   GLOBAL DARK THEME COMPONENT REFINEMENTS
   ============================================= */

/* Global Transition for smooth theme switching */
body,
.sidebar,
.page-header,
.panel-heading,
.data-panel,
.kpi-grid article,
.theme-slider-toggle,
nav a,
.nav-group-toggle {
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .view-sticky-header,
  .view-sticky-header h1,
  .view-sticky-header h2,
  .view-sticky-header .eyebrow,
  .view-sticky-header .subtitle,
  .view-sticky-header > div > p:not(.eyebrow),
  .view-sticky-header .button-group button,
  .view-sticky-header .button-group > .button-link {
    transition-duration: 1ms;
  }
  .sticky-table-header-overlay { transition-duration: 1ms; }
}

@media print {
  .sticky-table-header-overlay { display: none !important; }
  .view-sticky-header { position: static; box-shadow: none; }
  th { position: static !important; top: auto !important; }
}

/* Modals & Dialogs */
.bus-modal,
.confirm-modal,
.admin-modal {
  background: var(--color-surface);
  color: var(--color-ink);
  border-color: var(--color-border);
}

body[data-dashboard-theme="dark"] .bus-modal::backdrop,
body[data-theme="dark"] .bus-modal::backdrop,
body[data-dashboard-theme="dark"] .confirm-modal::backdrop,
body[data-theme="dark"] .confirm-modal::backdrop,
body[data-dashboard-theme="dark"] .admin-modal::backdrop,
body[data-theme="dark"] .admin-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

/* Date picker calendar indicator & Native Select Options in Dark Theme */
body[data-dashboard-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  cursor: pointer;
}

body[data-dashboard-theme="dark"] select option,
body[data-theme="dark"] select option {
  background: var(--color-surface-raised);
  color: var(--color-ink);
}

/* Status Badges */
body[data-dashboard-theme="dark"] .status-berjalan,
body[data-theme="dark"] .status-berjalan {
  color: var(--color-success);
  background: var(--color-success-surface);
}

body[data-dashboard-theme="dark"] .status-proses,
body[data-theme="dark"] .status-proses {
  color: var(--color-warning-text);
  background: var(--color-warning-surface);
}

body[data-dashboard-theme="dark"] .status-booking,
body[data-theme="dark"] .status-booking {
  color: var(--color-info-text);
  background: var(--color-info-surface);
}

body[data-dashboard-theme="dark"] .status-expired,
body[data-theme="dark"] .status-expired {
  color: var(--color-danger);
  background: var(--color-danger-surface);
}

/* Rekap Summary Cards */
body[data-dashboard-theme="dark"] .rekap-summary-card.status-berjalan-card strong,
body[data-theme="dark"] .rekap-summary-card.status-berjalan-card strong {
  color: var(--color-success);
}

body[data-dashboard-theme="dark"] .rekap-summary-card.status-proses-card strong,
body[data-theme="dark"] .rekap-summary-card.status-proses-card strong {
  color: var(--color-warning-text);
}

body[data-dashboard-theme="dark"] .rekap-summary-card.status-booking-card strong,
body[data-theme="dark"] .rekap-summary-card.status-booking-card strong {
  color: var(--color-info-text);
}

/* Expiration Cards */
body[data-dashboard-theme="dark"] .dashboard-expiration-summary article.is-expired,
body[data-theme="dark"] .dashboard-expiration-summary article.is-expired {
  background: var(--color-danger-surface);
  border-color: var(--color-danger);
}

/* Calendar */
body[data-dashboard-theme="dark"] .dashboard-calendar-company-header,
body[data-theme="dark"] .dashboard-calendar-company-header {
  background: var(--color-surface-raised);
}

body[data-dashboard-theme="dark"] .dashboard-calendar-company-toggle,
body[data-theme="dark"] .dashboard-calendar-company-toggle,
body[data-dashboard-theme="dark"] .dashboard-calendar-company-name,
body[data-theme="dark"] .dashboard-calendar-company-name {
  color: var(--color-primary-light);
}

body[data-dashboard-theme="dark"] .dashboard-calendar-company-count,
body[data-theme="dark"] .dashboard-calendar-company-count {
  color: var(--color-ink-muted);
}

body[data-dashboard-theme="dark"] .dashboard-calendar-days,
body[data-theme="dark"] .dashboard-calendar-days {
  background: var(--color-surface-raised);
  color: var(--color-ink-muted);
}

body[data-dashboard-theme="dark"] .dashboard-calendar-row,
body[data-theme="dark"] .dashboard-calendar-row {
  background: var(--color-surface);
}

body[data-dashboard-theme="dark"] .dashboard-calendar-empty,
body[data-theme="dark"] .dashboard-calendar-empty {
  background: var(--color-surface-raised);
  color: var(--color-ink-muted);
}

/* Forms Focus Rings in Dark Mode */
body[data-dashboard-theme="dark"] .filters select:focus,
body[data-theme="dark"] .filters select:focus,
body[data-dashboard-theme="dark"] .filters input:focus,
body[data-theme="dark"] .filters input:focus,
body[data-dashboard-theme="dark"] .booking-form input:focus,
body[data-theme="dark"] .booking-form input:focus,
body[data-dashboard-theme="dark"] .booking-form select:focus,
body[data-theme="dark"] .booking-form select:focus,
body[data-dashboard-theme="dark"] .booking-form textarea:focus,
body[data-theme="dark"] .booking-form textarea:focus {
  box-shadow: 0 0 0 3px rgba(47, 154, 112, 0.28);
}

/* Table zebra and hover in Dark Mode */
body[data-dashboard-theme="dark"] tbody tr:nth-child(even) td,
body[data-theme="dark"] tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

body[data-dashboard-theme="dark"] tbody tr:hover td,
body[data-theme="dark"] tbody tr:hover td,
body[data-dashboard-theme="dark"] tbody tr:nth-child(even):hover td,
body[data-theme="dark"] tbody tr:nth-child(even):hover td {
  background: var(--color-primary-surface);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
