:root {
  color-scheme: dark;
  --bg: #060B14;
  --surface: #11161C;
  --surface2: #141A21;
  --border: rgba(34, 197, 94, 0.14);
  --line: #1E2630;
  --text: #E6EAFA;
  --muted: #A0A6B2;
  --accent: #00D26A;
  --accent-dark: #00A85A;
  --accent-hover: #39FF88;
  --danger: #E5484D;
  --warning: #F5B942;
  --info: #3B82F6;
  --status-success: #22C55E;
  --status-waiting-customer: #8B5CF6;
  --status-waiting-parts: #F97316;
  --status-in-progress: #06B6D4;
  --status-completed: #22C55E;
  --sidebar-bg: #060B14;
  --field-bg: rgba(255,255,255,0.03);
  --field-border: #1E2630;
  --button-secondary-bg: #141A21;
  --alert-bg: #2e0a0a;
  --alert-border: #4d1212;
  --alert-text: #ff8787;
  --login-bg: linear-gradient(180deg, #0B0F14 0%, #141A22 100%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.3);
  --shadow-raise: 0 18px 36px rgba(0, 0, 0, 0.38);
}
html.theme-light {
  color-scheme: light;
  --bg: #F5F7FA;
  --bg-soft: #EEF2F7;
  --surface: #FFFFFF;
  --surface2: #EEF2F7;
  --border: rgba(0, 210, 106, 0.2);
  --line: #DCE3EC;
  --text: #1E293B;
  --muted: #64748B;
  --accent: #00D26A;
  --accent-dark: #00A85A;
  --accent-hover: #39FF88;
  --danger: #E5484D;
  --warning: #F5B942;
  --info: #3B82F6;
  --status-success: #22C55E;
  --status-waiting-customer: #8B5CF6;
  --status-waiting-parts: #F97316;
  --status-in-progress: #06B6D4;
  --status-completed: #22C55E;
  --sidebar-bg: #FFFFFF;
  --field-bg: #FFFFFF;
  --field-border: #DCE3EC;
  --button-secondary-bg: #F1F5F9;
  --alert-bg: #ffe9e7;
  --alert-border: #e2b3ad;
  --alert-text: #8a2f24;
  --login-bg: linear-gradient(180deg, #F5F7FA 0%, #E8EAEF 100%);
  --shadow-soft: 0 6px 16px rgba(148, 163, 184, 0.16);
  --shadow-raise: 0 10px 24px rgba(148, 163, 184, 0.22);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scrollbar-gutter: stable;
}
:focus-visible {
  outline: 2px solid rgba(0, 210, 106, 0.85);
  outline-offset: 2px;
}
button, input, select, textarea {
  font: inherit;
}

.required-indicator {
  color: var(--danger);
  font-weight: 700;
  margin-left: 0.18rem;
  line-height: 1;
}

.app-shell {
  display: grid;
  grid-template-columns: 234px 1fr;
  min-height: 100vh;
  align-items: start;
  transition: grid-template-columns 180ms ease;
}
html.ui-preload .app-shell,
html.ui-preload .sidebar {
  transition: none !important;
}
html.ui-preload .sidebar-nav {
  visibility: hidden;
}
html.ui-sidebar-collapsed .app-shell {
  grid-template-columns: 82px 1fr;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 82px 1fr;
}
.sidebar {
  background: linear-gradient(180deg, rgba(6, 11, 20, 0.98), rgba(10, 14, 24, 0.92));
  border-right: 1px solid var(--line);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-gutter: stable;
  transition: padding 180ms ease;
}
html.ui-sidebar-collapsed .app-shell .sidebar {
  padding: 12px 8px;
}
html.ui-sidebar-collapsed .app-shell .brand strong,
html.ui-sidebar-collapsed .app-shell .brand span,
html.ui-sidebar-collapsed .app-shell .sidebar-user,
html.ui-sidebar-collapsed .app-shell .sidebar-footer .btn-secondary {
  display: none;
}
html.ui-sidebar-collapsed .app-shell .sidebar-lock-toggle {
  width: 100%;
  padding: 0;
  justify-content: center;
}
html.ui-sidebar-collapsed .app-shell .sidebar-lock-label,
html.ui-sidebar-collapsed .app-shell .brand {
  justify-content: center;
}
html.ui-sidebar-collapsed .app-shell .brand-logo,
html.ui-sidebar-collapsed .app-shell .brand-mark {
  width: 34px;
  height: 34px;
}
html.ui-sidebar-collapsed .app-shell .nav-link {
  font-size: 0;
  padding: 8px;
  text-align: center;
  position: relative;
}
html.ui-sidebar-collapsed .app-shell .nav-link::before {
  content: attr(data-short);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: inherit;
}
.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-actions {
  position: relative;
  overflow: visible;
}
.mobile-nav-toggle {
  display: none !important;
}
.mobile-nav-backdrop {
  display: none;
}
.pwa-mobile-only {
  display: none;
}
.pwa-tech-dock {
  display: none;
}
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--surface2);
  border: 1px solid var(--line);
  padding: 4px;
}
.brand strong {
  display: block;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.brand span {
  color: var(--muted);
  font-size: 0.74rem;
}
.brand .brand-powered {
  font-size: 0.68rem;
  color: rgba(160, 166, 178, 0.9);
}
.sidebar-lock-panel {
  display: grid;
  gap: 8px;
  margin: 4px 0 10px;
}
.sidebar-nav {
  display: grid;
  gap: 10px;
}
.nav-section {
  display: grid;
  gap: 4px;
}
.nav-section::before {
  content: attr(aria-label);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px 2px;
}

.nav-section:not([aria-label])::before {
  content: none;
  display: none;
  padding: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.sidebar-nav.sidebar-unlocked .nav-link {
  cursor: grab;
}
.sidebar-nav.sidebar-unlocked .nav-link:active {
  cursor: grabbing;
}
.sidebar-nav .nav-link.is-dragging {
  opacity: 0.45;
  transform: scale(0.985);
}
.sidebar-nav.sidebar-unlocked .nav-section {
  outline: 1px solid transparent;
  outline-offset: 3px;
}
.sidebar-nav.sidebar-unlocked .nav-section.drag-over {
  outline-color: rgba(255, 255, 255, 0.16);
}
.nav-link::before {
  content: attr(data-short);
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.14);
  color: var(--text);
}
.nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.22), 0 0 18px rgba(34, 197, 94, 0.06);
}
.nav-link.active::before {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.14);
}
.nav-link:hover {
  transform: translateX(2px);
}
.sidebar-lock-toggle {
  flex-shrink: 0;
}
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.sidebar-user {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted);
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0), var(--sidebar-bg) 18%);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 0;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(6, 11, 20, 0.96), rgba(6, 11, 20, 0.68));
}
.topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.sidebar-collapse-toggle {
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(16, 24, 36, 0.86), rgba(10, 16, 26, 0.86));
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 30, 0.92);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.admin-tab:hover {
  background: rgba(20, 30, 44, 0.96);
  color: var(--text);
  border-color: rgba(0, 210, 106, 0.35);
}
.admin-tab.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}
.theme-toggle {
  padding: 8px 14px;
  font-size: 0.85rem;
  min-width: 105px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.dashboard-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 28, 42, 0.9), rgba(12, 18, 28, 0.9));
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-tab:hover {
  color: var(--text);
  border-color: rgba(0, 210, 106, 0.28);
  transform: translateY(-1px);
}

.admin-tab.active {
  color: #0b0f14;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}
.stats-card {
  text-align: center;
  padding: 12px 14px;
}
.past-due-card {
  padding: 14px 16px;
}
.past-due-card-alert {
  border-color: #b83232;
  background: linear-gradient(180deg, rgba(184,50,50,0.22) 0%, rgba(112,24,24,0.28) 100%);
}
.past-due-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.topbar-profile {
  position: relative;
}
.profile-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.16);
  background: linear-gradient(180deg, rgba(20, 28, 42, 0.98), rgba(14, 20, 30, 0.98));
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  cursor: pointer;
  min-height: 38px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.profile-toggle:hover {
  border-color: rgba(0, 210, 106, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 210, 106, 0.28), rgba(59, 130, 246, 0.28));
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
}
.profile-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1rem;
  border-color: rgba(255,255,255,0.24);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-name {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
  font-weight: 600;
}
.profile-caret {
  font-size: 0.72rem;
  color: var(--muted);
}
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(390px, 92vw);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(16, 24, 36, 0.97), rgba(10, 16, 26, 0.97));
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.46);
  padding: 10px;
  display: none;
  z-index: 110;
  max-height: none;
  overflow: visible;
  gap: 6px;
}
.topbar-profile.open .profile-dropdown {
  display: grid;
}
.topbar-profile:focus-within .profile-dropdown {
  display: grid;
}
.profile-dropdown-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
}
.profile-dropdown-header-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.profile-dropdown-header-copy strong {
  font-size: 1.05rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.profile-dropdown-header-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}
.profile-dropdown-header-copy small {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.84rem;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.profile-dropdown a:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.09);
  transform: translateX(1px);
}
.profile-nav-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.profile-dropdown-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  margin: 0;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.84rem;
}
.profile-dropdown-theme-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.profile-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.profile-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.profile-switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  transition: background 0.2s ease;
}
.profile-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}
.profile-switch input:checked + .profile-switch-track {
  background: rgba(0, 210, 106, 0.8);
}
.profile-switch input:checked + .profile-switch-track .profile-switch-thumb {
  transform: translateX(18px);
}
.profile-dropdown a[href="/logout"] {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 10px;
  padding-top: 12px;
}
.profile-dropdown-section-label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
}
.profile-dropdown-location-lite {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.02);
  position: static;
}
.profile-location-trigger {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 10px;
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.profile-location-trigger:hover {
  border-color: rgba(0, 210, 106, 0.34);
  background: rgba(0, 210, 106, 0.08);
}
.profile-location-trigger-left {
  display: inline-flex;
  gap: 8px;
  min-width: 0;
  align-items: center;
}
.profile-location-trigger-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.88rem;
}
.profile-location-form-lite {
  display: none;
}
.profile-location-flyout {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: calc(100vw - 20px);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(14, 20, 30, 0.98), rgba(10, 16, 24, 0.98));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.46);
  padding: 8px;
  display: grid;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transform-origin: top left;
  transition: opacity 170ms ease, transform 170ms ease, visibility 170ms ease;
  z-index: 230;
}
.profile-location-flyout[data-placement="side"] {
  transform: translateX(10px) scale(0.98);
  transform-origin: left top;
}
.profile-location-flyout[data-placement="below"] {
  transform: translateY(8px) scale(0.98);
  transform-origin: top center;
}
.profile-location-flyout[data-placement="mobile"] {
  left: 50%;
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(72vh, 560px);
  border-radius: 18px;
  transform: translateX(-50%) translateY(14px) scale(0.98);
  transform-origin: center bottom;
}
.profile-location-flyout.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translate(0, 0) scale(1);
}
.profile-location-flyout.open[data-placement="mobile"] {
  transform: translateX(-50%) translateY(0) scale(1);
}
.profile-location-flyout-header {
  padding: 6px 8px;
}
.profile-location-flyout-header strong {
  font-size: 0.82rem;
  color: var(--muted);
}
.profile-location-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 0.84rem;
}
.profile-location-option:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}
.profile-location-option-icon {
  width: 16px;
  color: var(--accent);
  display: inline-flex;
  justify-content: center;
}
.profile-location-empty {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 6px 0 2px;
}
.profile-location-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  z-index: 220;
}
.profile-location-backdrop.open {
  display: block;
}

@media (max-width: 700px) {
  .topbar-profile {
    position: static;
  }

  .profile-dropdown {
    width: min(92vw, 390px);
    max-width: min(92vw, 390px);
  }

  .profile-location-flyout {
    width: min(420px, calc(100vw - 24px));
  }
}

/* Phase 1: Enterprise design system foundation */
:root {
  --ds-gap-1: 6px;
  --ds-gap-2: 10px;
  --ds-gap-3: 14px;
  --ds-gap-4: 18px;
  --ds-gap-5: 24px;
  --ds-surface-glass: linear-gradient(145deg, rgba(18, 27, 40, 0.9), rgba(11, 17, 28, 0.9));
  --ds-surface-glass-light: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 253, 0.96));
  --ds-shadow-layer: 0 12px 28px rgba(2, 6, 12, 0.34);
}

.sidebar-nav {
  gap: var(--ds-gap-3);
}

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

.nav-section-label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(168, 179, 194, 0.72);
  padding: 0 10px;
}

.topbar {
  gap: var(--ds-gap-3);
  border-bottom: 1px solid rgba(45, 55, 70, 0.54);
}

.topbar-center {
  flex: 1;
  min-width: 240px;
  display: flex;
  justify-content: center;
}

.enterprise-search {
  width: min(640px, 100%);
  height: 40px;
  border: 1px solid rgba(45, 55, 70, 0.86);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(8, 12, 20, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.enterprise-search:focus-within {
  border-color: rgba(0, 210, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 210, 106, 0.12);
}

.enterprise-search-icon {
  font-size: 0.88rem;
  color: var(--muted);
}

.enterprise-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.enterprise-search input::placeholder {
  color: rgba(168, 179, 194, 0.84);
}

.topbar-utilities {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 2px;
}

.utility-pill {
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(45, 55, 70, 0.9);
  background: rgba(14, 20, 30, 0.84);
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

.utility-pill strong {
  color: var(--text);
  font-weight: 600;
}

.icon-utility-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(45, 55, 70, 0.9);
  background: rgba(14, 20, 30, 0.84);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-utility-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 210, 106, 0.5);
  background: rgba(17, 26, 38, 0.92);
}

.sidebar-lock-toggle {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border-radius: 999px;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(0, 210, 106, 0.2), rgba(14, 20, 30, 0.88));
  border-color: rgba(0, 210, 106, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 210, 106, 0.08) inset;
  flex-shrink: 0;
}

.sidebar-lock-toggle:hover {
  border-color: rgba(0, 210, 106, 0.65);
  background: linear-gradient(135deg, rgba(0, 210, 106, 0.28), rgba(17, 26, 38, 0.96));
}

.sidebar-lock-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.sidebar-lock-label {
  display: inline-block;
  min-width: 62px;
  white-space: nowrap;
}

.sidebar-lock-help {
  margin: 0;
  padding: 0 2px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.icon-utility-btn-badged {
  position: relative;
}

.icon-utility-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  background: #ff4444;
  color: #fff;
  font-size: 0.58rem;
  line-height: 1;
  font-weight: 700;
}

.icon-utility-badge.hidden {
  display: none;
}

.notification-shell {
  position: relative;
}

.notification-popout {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 18px));
  max-height: min(70vh, 620px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(45, 55, 70, 0.95);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(16, 24, 36, 0.98), rgba(8, 12, 20, 0.98));
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
  transform-origin: top right;
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  z-index: 240;
}

.notification-popout.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.notification-popout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(45, 55, 70, 0.72);
}

.notification-popout-title-wrap {
  display: grid;
  gap: 2px;
}

.notification-popout-title-wrap strong {
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.notification-popout-unread {
  font-size: 0.74rem;
  color: var(--muted);
}

.notification-mark-all {
  border: 1px solid rgba(0, 210, 106, 0.22);
  background: rgba(0, 210, 106, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.notification-mark-all:hover {
  background: rgba(0, 210, 106, 0.16);
  border-color: rgba(0, 210, 106, 0.34);
  transform: translateY(-1px);
}

.notification-mark-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.notification-popout-body {
  min-height: 180px;
  overflow: auto;
  padding-right: 2px;
}

.notification-loading,
.notification-empty {
  padding: 22px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.notification-groups {
  display: grid;
  gap: 10px;
}

.notification-group {
  display: grid;
  gap: 8px;
}

.notification-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 4px;
}

.notification-item {
  width: 100%;
  border: 1px solid rgba(45, 55, 70, 0.76);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.notification-item:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 210, 106, 0.3);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.notification-item.unread {
  border-color: rgba(0, 210, 106, 0.26);
  background: linear-gradient(180deg, rgba(0, 210, 106, 0.08), rgba(255, 255, 255, 0.03));
}

.notification-item.read {
  opacity: 0.86;
}

.notification-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #0b0f14;
  background: linear-gradient(135deg, var(--accent), #f2d06b);
  flex-shrink: 0;
}
.sidebar-lock-toggle {
  flex-shrink: 0;
}

.notification-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notification-copy strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.notification-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.notification-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 70px;
}

.notification-time {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.notification-read-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  align-self: center;
}

.notification-item.unread .notification-read-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 210, 106, 0.14);
}

.notification-item-action {
  color: var(--accent-hover);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}

.notification-item-action:hover {
  text-decoration: underline;
}

html.theme-light .notification-popout {
  border-color: rgba(148, 163, 184, 0.34);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

html.theme-light .notification-popout-header {
  border-bottom-color: rgba(148, 163, 184, 0.28);
}

html.theme-light .notification-item {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.8);
}

html.theme-light .notification-item:hover {
  background: rgba(248, 250, 252, 0.96);
}

html.theme-light .notification-copy p,
html.theme-light .notification-popout-unread,
html.theme-light .notification-time,
html.theme-light .notification-group-title,
html.theme-light .notification-loading,
html.theme-light .notification-empty {
  color: rgba(71, 85, 105, 0.92);
}

@media (max-width: 700px) {
  .notification-shell {
    position: static;
  }

  .notification-popout {
    right: 8px;
    left: 8px;
    width: auto;
    max-height: min(72vh, 560px);
  }

  .notification-item {
    grid-template-columns: auto 1fr;
  }

  .notification-meta {
    grid-column: 2;
    justify-items: start;
  }
}

.topbar-schedule {
  padding-top: 2px;
}

.topbar-schedule .topbar-left h1 {
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.schedule-topbar-mark {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(45, 55, 70, 0.9);
  background: rgba(14, 20, 30, 0.84);
  color: #dce8fa;
  font-size: 0.86rem;
  font-weight: 700;
}

.topbar-schedule .enterprise-search {
  max-width: 720px;
  background: rgba(5, 11, 21, 0.82);
}

.enterprise-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(72, 88, 115, 0.9);
  background: rgba(17, 24, 38, 0.86);
  color: #c9daef;
  font-size: 0.7rem;
  font-weight: 700;
}

.utility-pill-schedule {
  background: linear-gradient(180deg, rgba(17, 28, 43, 0.98), rgba(10, 19, 31, 0.98));
}

.ds-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--ds-gap-3);
}

.ds-kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ds-surface-glass);
  box-shadow: var(--ds-shadow-layer);
  padding: 14px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.ds-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(2, 8, 16, 0.4);
  border-color: rgba(0, 210, 106, 0.35);
}

.ds-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-gap-3);
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ds-surface-glass);
  padding: 10px 12px;
}

.ds-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ds-table-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ds-surface-glass);
  overflow: hidden;
}

.ds-table-compact th,
.ds-table-compact td {
  padding-top: 9px;
  padding-bottom: 9px;
}

html.theme-light .nav-section-label {
  color: rgba(71, 85, 105, 0.82);
}

html.theme-light .topbar {
  border-bottom-color: rgba(148, 163, 184, 0.25);
}

html.theme-light .enterprise-search {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html.theme-light .enterprise-search input::placeholder {
  color: rgba(100, 116, 139, 0.85);
}

html.theme-light .utility-pill,
html.theme-light .icon-utility-btn {
  border-color: rgba(148, 163, 184, 0.46);
  background: rgba(255, 255, 255, 0.94);
  color: #1E293B;
}

html.theme-light .ds-kpi-card,
html.theme-light .ds-toolbar,
html.theme-light .ds-table-shell {
  background: var(--ds-surface-glass-light);
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
}

@media (max-width: 1200px) {
  .utility-pill {
    display: none;
  }
}

@media (max-width: 980px) {
  .topbar-center {
    order: 3;
    min-width: 100%;
    justify-content: flex-start;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .topbar-utilities {
    gap: 6px;
  }

  .enterprise-search {
    height: 38px;
  }
}

/* Phase 2: Users benchmark module */
.phase-two-users {
  display: grid;
  gap: 14px;
  position: relative;
}

.users-kpi-grid {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

.users-kpi-card h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.users-kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.65rem;
}

.users-kpi-card p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.kpi-admin strong { color: #22C55E; }
.kpi-manager strong { color: #3B82F6; }
.kpi-technician strong { color: #F59E0B; }
.kpi-frontdesk strong { color: #06B6D4; }

.users-toolbar {
  align-items: center;
}

.users-toolbar-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.users-search,
.users-filter-select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 30, 0.84);
  color: var(--text);
  padding: 0 10px;
}

.users-search {
  min-width: 240px;
}

.users-bulk-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.users-table-shell {
  overflow-x: auto;
}

.users-table th {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.users-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.users-name-cell small {
  display: block;
  color: var(--muted);
}

.users-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2fdf0;
  background: linear-gradient(135deg, #14532d, #0f766e);
  flex-shrink: 0;
}

.role-pill,
.status-pill,
.users-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.role-admin { background: rgba(34, 197, 94, 0.16); color: #4ADE80; border-color: rgba(34, 197, 94, 0.4); }
.role-manager { background: rgba(59, 130, 246, 0.16); color: #60A5FA; border-color: rgba(59, 130, 246, 0.4); }
.role-technician { background: rgba(245, 158, 11, 0.16); color: #FBBF24; border-color: rgba(245, 158, 11, 0.4); }
.role-frontdesk { background: rgba(6, 182, 212, 0.16); color: #22D3EE; border-color: rgba(6, 182, 212, 0.4); }
.role-legacy { background: rgba(148, 163, 184, 0.16); color: #CBD5E1; border-color: rgba(148, 163, 184, 0.4); }

.status-active { background: rgba(34, 197, 94, 0.16); color: #4ADE80; border-color: rgba(34, 197, 94, 0.35); }
.status-disabled { background: rgba(239, 68, 68, 0.16); color: #FCA5A5; border-color: rgba(239, 68, 68, 0.35); }
.status-locked { background: rgba(249, 115, 22, 0.16); color: #FDBA74; border-color: rgba(249, 115, 22, 0.35); }
.status-pending-invite { background: rgba(250, 204, 21, 0.16); color: #FDE047; border-color: rgba(250, 204, 21, 0.35); }

.users-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.users-context-menu-wrap {
  position: relative;
}

.users-context-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 13, 22, 0.97);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  padding: 6px;
  display: none;
  z-index: 30;
}

.users-context-menu.open {
  display: grid;
}

.users-context-menu a,
.users-context-menu button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
}

.users-context-menu a:hover,
.users-context-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.users-pagination {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.users-edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(430px, 100vw);
  height: 100dvh;
  background: linear-gradient(160deg, rgba(13, 20, 32, 0.98), rgba(9, 15, 24, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 34px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr;
}

.users-edit-panel.open {
  transform: translateX(0);
}

.users-edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.users-edit-form {
  overflow-y: auto;
  padding: 12px 14px 20px;
  display: grid;
  gap: 12px;
}

.users-panel-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 20, 32, 0.72);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.users-panel-section h3 {
  margin: 0 0 2px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.users-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.users-profile-head small {
  display: block;
  color: var(--muted);
}

.users-panel-section label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
}

.users-panel-section input,
.users-panel-section select {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 22, 0.8);
  color: var(--text);
  padding: 0 10px;
}

.users-location-options {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding-right: 4px;
}

.users-location-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.users-location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.users-chip {
  background: rgba(56, 189, 248, 0.16);
  color: #67E8F9;
  border-color: rgba(6, 182, 212, 0.35);
}

.users-panel-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0), rgba(11, 15, 20, 0.96) 30%);
  padding-top: 12px;
}

.users-panel-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(1, 4, 10, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 50;
}

.users-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

html.theme-light .users-search,
html.theme-light .users-filter-select,
html.theme-light .users-panel-section input,
html.theme-light .users-panel-section select {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.5);
  color: #1E293B;
}

html.theme-light .users-edit-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
  border-left-color: rgba(148, 163, 184, 0.45);
}

html.theme-light .users-panel-section {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.35);
}

html.theme-light .users-context-menu {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);
}

html.theme-light .users-context-menu a,
html.theme-light .users-context-menu button {
  color: #1E293B;
}

@media (max-width: 1180px) {
  .users-kpi-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 820px) {
  .users-kpi-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .users-search {
    min-width: 170px;
  }
}

@media (max-width: 620px) {
  .users-kpi-grid {
    grid-template-columns: 1fr;
  }

  .users-toolbar-main,
  .ds-toolbar-actions {
    width: 100%;
  }

  .users-search,
  .users-filter-select {
    width: 100%;
  }
}

/* Phase 7: Audit benchmark module */
.audit-phase-seven {
  display: grid;
  gap: 14px;
}

.audit-kpi-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.audit-kpi-card h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.audit-kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.audit-kpi-card p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.audit-filter-shell {
  align-items: flex-end;
}

.audit-filter-grid {
  flex: 1;
  min-width: 320px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.audit-filter-grid label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
}

.audit-filter-grid select,
.audit-filter-grid input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 20, 30, 0.84);
  color: var(--text);
  padding: 0 10px;
}

.audit-search-field {
  grid-column: 1 / -1;
}

.audit-search-input {
  width: 100%;
}

.audit-results-shell h2 {
  margin: 0;
  font-size: 1rem;
}

.audit-results-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.audit-results-count {
  color: var(--text);
  font-weight: 600;
}

.audit-table-shell {
  overflow-x: auto;
}

.audit-table-shell th {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.audit-pagination {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

html.theme-light .audit-filter-grid select,
html.theme-light .audit-filter-grid input {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.48);
  color: #1E293B;
}

@media (max-width: 980px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

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

@media (max-width: 700px) {
  .audit-kpi-grid,
  .audit-filter-grid {
    grid-template-columns: 1fr;
  }

  .audit-filter-grid,
  .audit-filter-grid label,
  .audit-filter-grid select,
  .audit-filter-grid input,
  .audit-filter-grid button {
    width: 100%;
  }
}

/* Phase 8: Locations benchmark module */
.locations-phase-eight {
  display: grid;
  gap: 14px;
}

.locations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.locations-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.locations-header-actions {
  margin: 0;
}

.locations-kpi-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.locations-kpi-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.locations-kpi-card p {
  margin: 8px 0 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.locations-results-header h2 {
  margin: 0;
  font-size: 1rem;
}

.locations-toolbar-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.locations-search,
.locations-filter-select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 30, 0.84);
  color: var(--text);
  padding: 0 10px;
}

.locations-search {
  min-width: 280px;
}

.locations-results-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.locations-table-shell {
  overflow-x: auto;
}

.locations-table th {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.locations-action-buttons {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.locations-action-buttons a,
.locations-action-buttons button {
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: 7px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.locations-action-buttons a:hover,
.locations-action-buttons button:hover {
  border-color: rgba(0, 210, 106, 0.42);
  color: #66f2aa;
}

.locations-pagination {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.locations-empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}

html.theme-light .locations-search,
html.theme-light .locations-filter-select {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.48);
  color: #1E293B;
}

@media (max-width: 1080px) {
  .locations-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 700px) {
  .locations-kpi-grid {
    grid-template-columns: 1fr;
  }

  .locations-toolbar-main,
  .locations-search,
  .locations-filter-select {
    width: 100%;
  }
}

/* Phase 9: Companies benchmark module */
.companies-phase-nine {
  display: grid;
  gap: 14px;
}

.companies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.companies-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.companies-header-actions {
  margin: 0;
}

.companies-kpi-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.companies-kpi-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.companies-kpi-card p {
  margin: 8px 0 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.companies-callout {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.companies-alert {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(13, 20, 32, 0.88);
}

.companies-table-toolbar h2 {
  margin: 0;
  font-size: 1rem;
}

.companies-toolbar-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.companies-search,
.companies-filter-select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 30, 0.84);
  color: var(--text);
  padding: 0 10px;
}

.companies-search {
  min-width: 280px;
}

.companies-results-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.companies-table-shell {
  overflow-x: auto;
}

.companies-table th {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.companies-action-buttons {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.companies-action-buttons a,
.companies-action-buttons button {
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: 7px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.companies-action-buttons a:hover,
.companies-action-buttons button:hover {
  border-color: rgba(0, 210, 106, 0.42);
  color: #66f2aa;
}

.companies-pagination {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.companies-empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}

html.theme-light .companies-search,
html.theme-light .companies-filter-select {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.48);
  color: #1E293B;
}

@media (max-width: 1080px) {
  .companies-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 700px) {
  .companies-kpi-grid {
    grid-template-columns: 1fr;
  }

  .companies-toolbar-main,
  .companies-search,
  .companies-filter-select {
    width: 100%;
  }
}

/* Phase 10: Orders benchmark module */
.orders-phase-ten {
  display: grid;
  gap: 12px;
}

.orders-alert {
  margin-bottom: 0;
}

.orders-section-shell,
.orders-debug-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ds-surface-glass);
}

.orders-debug-shell {
  border-color: var(--alert-border);
}

.orders-import-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.orders-results-shell h2 {
  margin: 0;
  font-size: 1rem;
}

.orders-results-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.orders-results-count {
  color: var(--text);
  font-weight: 600;
}

.orders-table-shell {
  overflow-x: auto;
}

.orders-table th {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.orders-source-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: inline-block;
}

.orders-pagination {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .orders-table th,
  .orders-table td {
    white-space: nowrap;
  }
}

@media (max-width: 700px) {
  .orders-results-meta {
    width: 100%;
  }
}

.profile-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 210, 106, 0.4);
  background: rgba(8, 28, 19, 0.95);
  color: #E7FFF2;
  font-size: 0.82rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  z-index: 140;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.profile-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.user-chip .user-chip-name {
  color: inherit;
}
.user-chip-sm .profile-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.68rem;
}
.past-due-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.past-due-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #d13939;
  color: #fff;
  font-weight: 700;
}
.past-due-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.past-due-list li a {
  display: grid;
  gap: 2px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.16);
}
.past-due-list li a:hover {
  border-color: #ef6666;
  background: rgba(0,0,0,0.26);
}
.past-due-list li a small {
  color: #ffb6b6;
}
.past-due-empty {
  margin: 0;
  color: var(--muted);
}
.stats-card h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}
.stat-value {
  display: inline-block;
  margin: 8px 0 0;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
  text-decoration: none;
}
.stat-value:hover {
  text-decoration: underline;
}
.full-width {
  grid-column: span 3;
}
.half-width {
  grid-column: span 1.5;
}
.list-simple {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}
.issue-report-trigger {
  width: 100%;
}
.issue-report-banner {
  margin-bottom: 12px;
  background: rgba(0, 210, 106, 0.12);
  border: 1px solid rgba(0, 210, 106, 0.28);
  color: var(--text);
}
.issue-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  display: none;
  z-index: 120;
}
.issue-modal-backdrop.is-open {
  display: grid;
  place-items: center;
  padding: 20px;
}
.issue-modal {
  width: min(820px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.issue-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.issue-modal header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.issue-modal-close {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--button-secondary-bg);
  color: var(--text);
  border-radius: 8px;
}
.issue-modal form {
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
}
.ticket-photo-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.ticket-photo-link:hover {
  border-color: rgba(0, 210, 106, 0.35);
  background: rgba(0, 210, 106, 0.08);
}

.ticket-photo-list {
  gap: 8px;
}

.ticket-photo-toolbar {
  margin-top: 12px;
}

.ticket-photo-toolbar label {
  display: grid;
  gap: 6px;
}

.ticket-photo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.ticket-photo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  z-index: 140;
  padding: 20px;
}

.ticket-photo-modal-backdrop.is-open {
  display: grid;
  place-items: center;
}

.ticket-photo-modal {
  width: min(1040px, 100%);
  max-height: min(92vh, 980px);
  display: grid;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  padding: 12px;
}

.ticket-photo-modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ticket-photo-modal-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.ticket-photo-modal-index {
  min-width: 66px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.ticket-photo-modal-close {
  min-width: 82px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-secondary-bg);
  color: var(--text);
  cursor: pointer;
}

.ticket-photo-modal-close[disabled] {
  opacity: 0.5;
  cursor: default;
}

.ticket-photo-modal-image-wrap {
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: 76vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
}

.ticket-photo-modal-image {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ticket-photo-modal-caption {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 2px 6px 6px;
}

body.photo-modal-open {
  overflow: hidden;
}
.issue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.issue-grid .full {
  grid-column: 1 / -1;
}
.issue-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.issue-meta {
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 18px 14px;
}
.issue-meta code {
  white-space: pre-wrap;
  word-break: break-word;
}
.btn-secondary {
  background: var(--button-secondary-bg);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}
.alert {
  background: var(--alert-bg);
  border: 1px solid var(--alert-border);
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--alert-text);
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 15% 0%, rgba(0, 210, 106, 0.16), transparent 60%),
    radial-gradient(900px 420px at 100% 100%, rgba(10, 132, 255, 0.14), transparent 58%),
    var(--login-bg);
}
.login-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}
.login-shell {
  width: min(420px, calc(100vw - 40px));
}
.login-shell-brand {
  width: min(760px, calc(100vw - 40px));
}
.login-card {
  background: linear-gradient(180deg, rgba(21, 28, 40, 0.9), rgba(14, 20, 30, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow-raise);
  backdrop-filter: blur(6px);
}
.login-card-brand {
  padding: 30px;
}
.login-brand {
  display: grid;
  place-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.login-brand .brand-logo {
  width: min(240px, 72vw);
  height: auto;
  border-radius: 18px;
  padding: 0;
  background: transparent;
  border: 0;
}
.login-brand h2 {
  margin: 0;
  letter-spacing: 0.02em;
}
.login-tagline {
  margin: 0;
  color: var(--text);
  text-align: center;
  font-weight: 600;
}
.login-powered {
  margin: -2px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}
.login-features {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}
.login-features h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.login-features ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

/* ForgeDesk commercial homepage login experience */
.login-homepage {
  display: block;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 620px at 4% -10%, rgba(255, 121, 0, 0.2), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(255, 176, 84, 0.16), transparent 56%),
    linear-gradient(165deg, #07090f 0%, #0b0f17 35%, #111824 75%, #0b0f17 100%);
}
.fd-bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.fd-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
}
.fd-orb-a {
  width: 360px;
  height: 360px;
  left: -80px;
  top: -90px;
  background: rgba(255, 121, 0, 0.24);
}
.fd-orb-b {
  width: 320px;
  height: 320px;
  right: -90px;
  top: 90px;
  background: rgba(255, 180, 92, 0.2);
}
.fd-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 50% 35%, rgba(0,0,0,0.9), transparent 80%);
}
.fd-nav,
.fd-main {
  position: relative;
  z-index: 1;
}
.fd-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 10, 16, 0.72);
  backdrop-filter: blur(10px);
}
.fd-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fd-nav-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 8px 20px rgba(0,0,0,0.4);
}
.fd-nav-brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.03em;
}
.fd-nav-brand span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
.fd-nav-links {
  display: inline-flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.fd-nav-links a,
.fd-portal-meta a {
  color: #dbe4f2;
  text-decoration: none;
}
.fd-nav-links a:hover,
.fd-portal-meta a:hover {
  color: #ff9a3d;
}
.fd-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fd-theme-btn {
  min-width: 88px;
  padding: 7px 10px;
}
.fd-portal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff7a00, #ff9f46);
}
.fd-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 44px) 44px;
  display: grid;
  gap: 26px;
}
.fd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.85fr);
  gap: 22px;
  align-items: start;
}
.fd-hero-left {
  background: linear-gradient(165deg, rgba(15, 20, 32, 0.86), rgba(9, 12, 20, 0.9));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.fd-hero-logo {
  width: min(260px, 58vw);
  border-radius: 18px;
  display: block;
  margin-bottom: 18px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 18px 42px rgba(255,122,0,0.16);
}
.fd-hero-left h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
}
.fd-hero-left > p {
  margin: 14px 0 0;
  color: #b7c2d5;
  font-size: 1.02rem;
  max-width: 70ch;
}
.fd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}
.fd-badges span {
  border-radius: 999px;
  border: 1px solid rgba(255, 169, 99, 0.44);
  color: #ffd0aa;
  background: rgba(255, 122, 0, 0.14);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}
.fd-stats {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.fd-stats article {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
}
.fd-stats strong {
  display: block;
  font-size: 0.85rem;
}
.fd-stats em {
  display: block;
  margin-top: 3px;
  color: #9aa8bf;
  font-style: normal;
  font-size: 0.77rem;
}
.fd-portal {
  border: 1px solid rgba(255, 160, 88, 0.34);
  border-radius: 22px;
  padding: clamp(18px, 2.3vw, 26px);
  background: linear-gradient(165deg, rgba(16, 20, 31, 0.95), rgba(10, 12, 20, 0.96));
  box-shadow: 0 24px 54px rgba(0,0,0,0.44), 0 0 24px rgba(255,122,0,0.15);
}
.fd-portal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}
.fd-portal-head p {
  margin: 8px 0 0;
  color: #a8b4cb;
  font-size: 0.92rem;
}
.fd-login-form {
  margin-top: 12px;
}
.fd-remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}
.fd-remember-row input {
  width: 16px;
  height: 16px;
}
.fd-portal-meta {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}
.fd-section {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: clamp(16px, 2.6vw, 24px);
  background: linear-gradient(150deg, rgba(14, 18, 28, 0.86), rgba(10, 12, 21, 0.9));
}
.fd-section-head h3 {
  margin: 0;
  font-size: 1.25rem;
}
.fd-section-head p {
  margin: 8px 0 0;
  color: #a7b4cb;
}
.fd-feature-grid,
.fd-proof-grid {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.fd-feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.fd-proof-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.fd-feature-grid article,
.fd-proof-grid article {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  font-weight: 600;
  color: #dde6f6;
}
.fd-footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  color: #96a5bd;
  font-size: 0.85rem;
  padding: 6px 4px 2px;
}

@media (max-width: 1040px) {
  .fd-nav {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 12px;
  }
  .fd-nav-links {
    justify-content: flex-start;
  }
  .fd-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .fd-main {
    padding-top: 20px;
  }
  .fd-stats {
    grid-template-columns: 1fr;
  }
  .fd-nav-actions {
    width: 100%;
    justify-content: space-between;
  }
}

html.theme-light .login-homepage {
  background:
    radial-gradient(1200px 620px at 4% -10%, rgba(255, 121, 0, 0.14), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(255, 176, 84, 0.12), transparent 56%),
    linear-gradient(165deg, #f5f7fb 0%, #edf2f8 35%, #e8eef6 75%, #edf3fb 100%);
}
html.theme-light .fd-nav {
  background: rgba(255,255,255,0.88);
  border-bottom-color: #dce3ec;
}
html.theme-light .fd-nav-brand span,
html.theme-light .fd-portal-meta,
html.theme-light .fd-footer,
html.theme-light .fd-hero-left > p,
html.theme-light .fd-section-head p,
html.theme-light .fd-stats em {
  color: #5f6f86;
}
html.theme-light .fd-nav-links a,
html.theme-light .fd-portal-meta a,
html.theme-light .fd-feature-grid article,
html.theme-light .fd-proof-grid article {
  color: #213147;
}
html.theme-light .fd-hero-left,
html.theme-light .fd-portal,
html.theme-light .fd-section {
  background: rgba(255,255,255,0.86);
  border-color: #dce3ec;
  box-shadow: 0 16px 30px rgba(80, 103, 134, 0.12);
}
html.theme-light .fd-feature-grid article,
html.theme-light .fd-proof-grid article,
html.theme-light .fd-stats article {
  background: #f7fafc;
  border-color: #dce3ec;
}
.form-grid {
  display: grid;
  gap: 12px;
}
.device-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
}
.device-form-grid input,
.device-form-grid select,
.device-form-grid textarea {
  padding: 10px 12px;
}
.device-form-grid .device-form-wide {
  grid-column: 1 / -1;
}
.device-form-grid button {
  justify-self: start;
}
.ticket-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
}
.ticket-form-grid input,
.ticket-form-grid select,
.ticket-form-grid textarea {
  padding: 10px 12px;
}
.ticket-form-grid .ticket-form-wide {
  grid-column: 1 / -1;
}
.ticket-form-grid .ticket-form-action {
  justify-self: start;
}
.customer-form-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px 12px;
  max-width: 100%;
}
.customer-form-grid input,
.customer-form-grid select,
.customer-form-grid textarea {
  padding: 10px 12px;
}
.customer-form-grid .customer-form-wide {
  grid-column: 1 / -1;
}
.customer-form-grid button {
  justify-self: start;
}
.ticket-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
}
.ticket-view-grid p {
  margin: 0;
}
.ticket-view-grid .ticket-view-wide {
  grid-column: 1 / -1;
}
.search-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
}
.search-grid button {
  align-self: end;
}
.ticket-quick-status-form {
  display: grid;
  gap: 8px;
}
.ticket-action-buttons {
  display: flex;
  gap: 8px;
}
.ticket-action-buttons .btn-secondary {
  flex: 1;
  min-width: 74px;
}
.status-list {
  display: grid;
  gap: 8px;
}
.status-add-form {
  grid-template-columns: minmax(220px, 320px) auto;
  max-width: 50%;
}
.status-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface2);
}
.status-list-row-disabled {
  opacity: 0.75;
}
.status-list-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-list-state {
  color: var(--muted);
  font-size: 0.85rem;
}
.status-list-actions {
  display: flex;
  gap: 6px;
}
.status-list-actions form {
  margin: 0;
}
.status-icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--field-border);
  background: var(--button-secondary-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.status-icon-delete {
  color: #fff;
  background: #8b2d2d;
  border-color: #a73a3a;
}
label {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 210, 106, 0.62);
  box-shadow: 0 0 0 2px rgba(0, 210, 106, 0.18);
  outline: none;
}

/* Keep select dropdown items readable on Windows/native menus. */
select option,
select optgroup {
  color: #111;
  background: #fff;
}

select option:checked {
  color: #fff;
  background: #0a84ff;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}
.table-default {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}
.table-default th,
.table-default td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.table-default th {
  color: var(--muted);
  text-align: left;
  position: sticky;
  top: 0;
  background: var(--surface2);
  z-index: 2;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.badge.status-new { background: #3B82F6; }
.badge.status-scheduled { background: #06B6D4; }
.badge.status-pending-review { background: #FACC15; color: #0B0F14; }
.badge.status-closed { background: #6B7280; }
.badge.status-escalated { background: #EF4444; }
.badge.status-completed {
  background: var(--status-completed);
}
.badge.status-in-progress {
  background: var(--status-in-progress);
}
.badge.status-waiting-customer {
  background: var(--status-waiting-customer);
}
.badge.status-waiting-parts {
  background: var(--status-waiting-parts);
}
.badge.status-success {
  background: var(--status-success);
}
.badge.badge-warning {
  background: var(--warning);
}
.badge.badge-danger {
  background: var(--danger);
}
.badge.badge-info {
  background: var(--info);
}
.ticket-cards {
  display: none;
}
.ticket-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: grid;
  gap: 8px;
  background: var(--surface2);
  box-shadow: var(--shadow-soft);
}
.ticket-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.ticket-card-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.mobile-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.upload-inline {
  display: grid;
  gap: 10px;
}
.upload-inline input[type='file'] {
  border: 1px dashed var(--field-border);
  padding: 10px;
  border-radius: 10px;
}
.signature-pad {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
}
.scanner-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.ticket-card-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
}
.order-assign-select {
  min-width: 180px;
  min-height: 36px;
  padding: 8px 10px;
}
.past-due-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.past-due-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.past-due-minimize-btn {
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  line-height: 1;
}
.past-due-minimize-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.past-due-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.past-due-minimized {
  position: fixed;
  top: 60px;
  left: auto;
  right: 16px;
  transform: none;
  width: auto;
  height: auto;
  padding: 8px 12px !important;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 50;
}
.past-due-minimized .past-due-header {
  margin-bottom: 0;
  flex-direction: column;
  gap: 4px;
}
.past-due-minimized .past-due-header h2 {
  display: none;
}
.past-due-minimized .past-due-header-actions {
  gap: 4px;
  flex-direction: row;
  align-items: center;
}
.past-due-minimized .past-due-count {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}
.past-due-minimized .past-due-minimize-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.past-due-minimized .past-due-minimize-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}
.past-due-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.past-due-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface2);
  color: inherit;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.past-due-item:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.main-content {
  padding: 14px 18px 20px;
  min-width: 0;
}
.page-body {
  display: grid;
  gap: 12px;
}

/* Make admin pages match enterprise card depth consistently. */
.admin-tabs + .page-body > .card {
  background: linear-gradient(145deg, rgba(16, 24, 36, 0.94), rgba(10, 16, 26, 0.94));
  border-color: var(--line);
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 70px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(11,15,20,0.9), rgba(11,15,20,0.72));
  padding: 8px 0;
}

.detail-enterprise-shell,
.documents-enterprise,
.invoices-enterprise,
.tickets-enterprise {
  display: grid;
  gap: 14px;
}

.detail-hero,
.summary-strip,
.invoice-filter-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(16, 24, 36, 0.94), rgba(10, 16, 26, 0.94));
  box-shadow: var(--shadow-soft);
}

.detail-hero {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.detail-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.detail-hero h2,
.detail-hero h3,
.summary-strip h3 {
  margin: 0;
}

.detail-hero-kpis,
.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.summary-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 700;
}

.summary-card strong {
  font-size: 1rem;
  line-height: 1.2;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(16, 24, 36, 0.92), rgba(10, 16, 26, 0.92));
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.detail-section h3,
.detail-section h4 {
  margin-top: 0;
}

.detail-enterprise-shell .card,
.invoices-enterprise .card,
.detail-enterprise-shell .page-actions {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(16, 24, 36, 0.92), rgba(10, 16, 26, 0.92));
  box-shadow: var(--shadow-soft);
}

.detail-enterprise-shell .page-actions,
.invoices-enterprise .page-actions {
  border: 0;
  box-shadow: none;
}

.payments-center {
  gap: 12px;
}

.payments-hero {
  padding: 18px;
}

.payments-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.payments-hero h2 {
  margin: 0;
  font-size: 1.5rem;
}

.payments-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.payments-header-search {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.payments-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.payments-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.payments-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.04);
}

.payments-pill.is-positive {
  border-color: rgba(56, 189, 98, 0.45);
  color: #98f5b4;
}

.payments-pill.is-negative {
  border-color: rgba(248, 113, 113, 0.45);
  color: #ffb3b3;
}

.payments-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.payments-kpis .summary-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

.payments-kpis .summary-card small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.payments-tabs {
  margin-top: 0;
}

.payments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.payments-main {
  display: grid;
  gap: 12px;
}

.payments-filter-card {
  margin-top: 0;
}

.payments-filter-form {
  display: grid;
  gap: 10px;
}

.payments-filter-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto auto;
  gap: 8px;
  align-items: end;
}

.payments-source-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.payments-source-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}

.payments-source-chip.active,
.payments-source-chip:hover {
  border-color: var(--accent);
  background: rgba(90, 163, 255, 0.14);
}

.payments-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.payments-table-card {
  margin-top: 0;
}

.payments-table {
  font-size: 0.92rem;
}

.payments-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payments-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.03);
}

.payments-tag.is-failed {
  border-color: rgba(248, 113, 113, 0.5);
  color: #ffb3b3;
}

.payments-side {
  position: sticky;
  top: 74px;
}

.payments-detail-panel {
  display: grid;
  gap: 10px;
}

.payments-empty-detail {
  margin: 0;
  color: var(--muted);
}

.payments-detail-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.payments-detail-list div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
}

.payments-detail-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.payments-detail-list dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.payments-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payments-alert {
  margin-bottom: 12px;
}

.payments-alert-error {
  background: #5b1d1d;
  border-color: #a94f4f;
}

.payments-alert-success {
  background: #10401f;
  border-color: #1f8a45;
}

.payments-inline-form {
  display: inline-block;
}

.payments-inline-form-spaced {
  margin-bottom: 12px;
}

.payments-muted-note {
  margin-top: 10px;
  color: var(--muted);
}

.payments-readiness-note {
  margin-top: 12px;
}

.dashboard-enterprise {
  display: grid;
  gap: 12px;
}

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

.dashboard-header h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.dashboard-kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(140deg, rgba(18, 27, 40, 0.92), rgba(10, 16, 24, 0.92));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255,255,255,0.02);
  display: grid;
  gap: 6px;
}

.dashboard-kpi-card h3 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-kpi-link,
.dashboard-kpi-value {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  text-decoration: none;
}

.dashboard-kpi-link:hover {
  color: #7eb4ff;
  text-decoration: underline;
}

.dashboard-filter-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 20, 32, 0.88);
  backdrop-filter: blur(8px);
  padding: 8px 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.dashboard-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) auto;
  gap: 6px;
  align-items: end;
  justify-content: center;
}

.dashboard-filter-grid .btn-secondary {
  min-height: 34px;
  padding: 0.45rem 0.9rem;
  width: fit-content;
  justify-self: center;
  align-self: end;
}

.dashboard-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dashboard-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  align-items: start;
}

.dashboard-due-card,
.dashboard-activity-card,
.dashboard-assigned-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(16,24,36,0.94), rgba(10,16,26,0.94));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255,255,255,0.02);
}

.dashboard-assigned-card {
  grid-column: 1 / -1;
}

.dashboard-due-card.dashboard-due-alert {
  border-color: rgba(229, 72, 77, 0.65);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(229, 72, 77, 0.22);
}

.dashboard-due-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.dashboard-due-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.dashboard-due-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dashboard-due-minimize-btn {
  background: rgba(13, 20, 32, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.dashboard-due-minimize-btn:hover {
  border-color: rgba(0, 210, 106, 0.45);
  background: rgba(20, 30, 44, 0.96);
}

.dashboard-due-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #d13939;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0 9px;
}

.dashboard-due-grid,
.dashboard-assigned-list {
  display: grid;
  gap: 8px;
}

.dashboard-due-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.dashboard-assigned-list {
  list-style: none;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.dashboard-due-item,
.dashboard-assigned-item,
.dashboard-activity-list li a {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 20, 32, 0.88);
  color: inherit;
  text-decoration: none;
  transition: all 0.18s ease;
}

.dashboard-due-item:hover,
.dashboard-assigned-item:hover,
.dashboard-activity-list li a:hover {
  border-color: rgba(0, 210, 106, 0.42);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.32);
}

.dashboard-due-date,
.dashboard-assigned-meta,
.dashboard-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-empty {
  margin: 0;
  font-size: 0.92rem;
}

.dashboard-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dashboard-due-minimized {
  position: fixed;
  top: 72px;
  right: 16px;
  width: auto;
  padding: 8px 10px !important;
  z-index: 52;
  border-radius: 12px;
}

.dashboard-due-minimized .dashboard-due-header {
  margin-bottom: 0;
}

.dashboard-due-minimized .dashboard-due-header h2 {
  display: none;
}

.customers-enterprise {
  display: grid;
  gap: 14px;
}

.customers-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.customers-kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(140deg, rgba(18, 27, 40, 0.92), rgba(10, 16, 24, 0.92));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255,255,255,0.02);
  display: grid;
  gap: 6px;
}

.customers-kpi-card h3 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.customers-kpi-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
}

.customers-filter-shell,
.customers-results-shell,
.customers-table-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 20, 32, 0.88);
  backdrop-filter: blur(8px);
}

.customers-filter-shell {
  padding: 12px;
}

.customers-results-shell {
  padding: 10px 12px;
}

.customers-filter-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(6, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.customers-filter-grid input,
.customers-filter-grid select {
  min-height: 38px;
}

.customers-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customers-tools h2 {
  margin: 0;
  font-size: 1.05rem;
}

.customers-tools-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.customers-name {
  display: grid;
  gap: 3px;
}

.customers-subtle {
  color: var(--muted);
  font-size: 0.8rem;
}

.customers-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 3px 8px;
  font-size: 0.72rem;
  line-height: 1;
}

.customers-badge.business {
  background: rgba(0, 210, 106, 0.18);
  border-color: rgba(0, 210, 106, 0.38);
}

.customers-badge.residential {
  background: rgba(90, 147, 255, 0.2);
  border-color: rgba(90, 147, 255, 0.38);
}

.customers-kpi-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.customers-results-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.customers-row-actions {
  display: inline-flex;
  gap: 6px;
}

.customers-pagination {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customers-edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(470px, 100vw);
  height: 100dvh;
  background: linear-gradient(160deg, rgba(13, 20, 32, 0.98), rgba(9, 15, 24, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 34px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr;
}

.customers-edit-panel.open {
  transform: translateX(0);
}

.customers-edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.customers-edit-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.customers-edit-form {
  overflow-y: auto;
  padding: 12px 14px 20px;
  display: grid;
  gap: 12px;
}

.customers-panel-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 20, 32, 0.72);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.customers-panel-section h3 {
  margin: 0 0 2px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.customers-panel-section label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
}

.customers-panel-section input,
.customers-panel-section select,
.customers-panel-section textarea {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 22, 0.8);
  color: var(--text);
  padding: 7px 10px;
}

.customers-panel-section textarea {
  min-height: 92px;
  resize: vertical;
}

.customers-panel-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0), rgba(11, 15, 20, 0.96) 30%);
  padding-top: 12px;
}

.customers-panel-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(1, 4, 10, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 50;
}

.customers-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

html.theme-light .customers-panel-section input,
html.theme-light .customers-panel-section select,
html.theme-light .customers-panel-section textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.5);
  color: #1E293B;
}

html.theme-light .customers-edit-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
  border-left-color: rgba(148, 163, 184, 0.45);
}

html.theme-light .customers-panel-section {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.35);
}

.devices-enterprise {
  display: grid;
  gap: 14px;
}

.devices-kpi-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.devices-filter-shell,
.devices-results-shell,
.devices-table-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 20, 32, 0.88);
  backdrop-filter: blur(8px);
}

.devices-filter-shell {
  padding: 12px;
}

.devices-results-shell {
  padding: 10px 12px;
}

.devices-filter-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(5, minmax(120px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.devices-filter-grid input,
.devices-filter-grid select {
  min-height: 38px;
}

.devices-results-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.devices-results-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.devices-row-actions {
  display: inline-flex;
  gap: 6px;
}

.devices-pagination {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.devices-edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(500px, 100vw);
  height: 100dvh;
  background: linear-gradient(160deg, rgba(13, 20, 32, 0.98), rgba(9, 15, 24, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 34px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr;
}

.devices-edit-panel.open {
  transform: translateX(0);
}

.devices-edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.devices-edit-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.devices-edit-form {
  overflow-y: auto;
  padding: 12px 14px 20px;
  display: grid;
  gap: 12px;
}

.devices-panel-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 20, 32, 0.72);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.devices-panel-section h3 {
  margin: 0 0 2px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.devices-panel-section label {
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
}

.devices-panel-section input,
.devices-panel-section select,
.devices-panel-section textarea {
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 22, 0.8);
  color: var(--text);
  padding: 7px 10px;
}

.devices-panel-section textarea {
  min-height: 92px;
  resize: vertical;
}

.devices-panel-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0), rgba(11, 15, 20, 0.96) 30%);
  padding-top: 12px;
}

.devices-panel-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(1, 4, 10, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 50;
}

.devices-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

html.theme-light .devices-panel-section input,
html.theme-light .devices-panel-section select,
html.theme-light .devices-panel-section textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.5);
  color: #1E293B;
}

html.theme-light .devices-edit-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98));
  border-left-color: rgba(148, 163, 184, 0.45);
}

html.theme-light .devices-panel-section {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(148, 163, 184, 0.35);
}

.invoices-enterprise {
  display: grid;
  gap: 14px;
}

.invoices-kpi-grid {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.invoices-kpi-card h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.invoices-kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.invoices-kpi-card p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.invoice-filter-shell {
  padding: 12px;
}

.invoice-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr auto;
  gap: 8px;
  align-items: end;
}

.invoices-results-shell {
  padding: 10px 12px;
}

.invoices-results-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invoices-results-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.invoices-row-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.invoices-pagination {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.documents-enterprise {
  display: grid;
  gap: 14px;
}

.documents-kpi-grid {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.documents-kpi-card h3 {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.documents-kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.documents-kpi-card p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.documents-filter-shell {
  padding: 12px;
}

.documents-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 8px;
  align-items: end;
}

.documents-results-shell {
  padding: 10px 12px;
}

.documents-results-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.documents-results-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.documents-row-actions {
  display: inline-flex;
  gap: 6px;
}

.documents-pagination {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1180px) {
  .invoices-kpi-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

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

  .documents-kpi-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

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

@media (max-width: 760px) {
  .invoices-kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .documents-kpi-grid {
    grid-template-columns: 1fr;
  }

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

.tickets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tickets-header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(130px, 1fr));
  gap: 10px;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(18,27,40,0.92), rgba(10,16,24,0.92));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255,255,255,0.02);
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 106, 0.5);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(0, 210, 106, 0.15);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-trend {
  font-size: 0.72rem;
  color: #6ef7a8;
}

.kpi-spark {
  width: 100%;
  height: 24px;
  opacity: 0.85;
}

.tickets-search-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(13, 20, 32, 0.88);
  backdrop-filter: blur(8px);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.tickets-filter-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 8px;
}

.tickets-filter-grid label,
.tickets-advanced-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.tickets-filter-grid input,
.tickets-filter-grid select,
.tickets-advanced-grid input,
.tickets-advanced-grid select {
  width: 100%;
  min-height: 38px;
}

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

.tickets-advanced-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.tickets-advanced-grid.open {
  display: grid;
}

.bulk-toolbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(0, 210, 106, 0.35);
  background: rgba(0, 210, 106, 0.08);
  border-radius: 12px;
  padding: 10px;
}

.bulk-toolbar.active {
  display: flex;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.ticket-card-enterprise {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(16,24,36,0.94), rgba(10,16,26,0.94));
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  min-width: 0;
}

.ticket-card-enterprise:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.42), 0 0 22px rgba(0, 210, 106, 0.12);
  border-color: rgba(0, 210, 106, 0.35);
}

.ticket-top-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
}

.ticket-number-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: #69a7ff;
  text-decoration: none;
}

.ticket-number-link:hover {
  text-decoration: underline;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  white-space: nowrap;
}

.chip-priority-high {
  background: rgba(238, 68, 68, 0.22);
  border-color: rgba(238, 68, 68, 0.45);
}

.chip-priority-medium {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.45);
}

.chip-priority-low {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
}

.tech-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(0, 210, 106, 0.35), rgba(59,130,246,0.35));
  border: 1px solid rgba(255,255,255,0.16);
}

.tech-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-grid {
  display: grid;
  gap: 4px;
  font-size: 0.83rem;
  color: var(--muted);
}

.issue-preview {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.ticket-actions .btn-secondary {
  padding: 7px 6px;
  font-size: 0.78rem;
}

.status-new {
  border-left-color: #3b82f6;
}

.status-waiting-customer {
  border-left-color: #8b5cf6;
}

.status-waiting-parts {
  border-left-color: #f97316;
}

.status-scheduled {
  border-left-color: #06b6d4;
}

.status-in-progress {
  border-left-color: #22c55e;
}

.status-pending-review {
  border-left-color: #facc15;
}

.status-completed {
  border-left-color: #10b981;
}

.status-closed {
  border-left-color: #6b7280;
}

.status-escalated {
  border-left-color: #ef4444;
}

.page-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.pager button {
  min-width: 34px;
}

.tickets-empty {
  display: none;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

.tickets-empty.active {
  display: block;
}

.tickets-skeleton {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.tickets-skeleton.active {
  display: grid;
}

.tickets-skeleton .s-card {
  border-radius: 14px;
  height: 220px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite linear;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  display: grid;
  gap: 8px;
}

.toast {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12,18,28,0.95);
  color: var(--text);
  padding: 10px 12px;
  min-width: 220px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  animation: toastIn 180ms ease;
}

.toast.success {
  border-color: rgba(34,197,94,0.45);
}

.toast.error {
  border-color: rgba(239,68,68,0.45);
}

@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1200px) {
  .customers-filter-grid,
  .devices-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .tickets-filter-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 860px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

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

  .tickets-advanced-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 560px) {
  .tickets-filter-grid,
  .tickets-advanced-grid,
  .ticket-actions {
    grid-template-columns: 1fr;
  }

  .ticket-board,
  .tickets-skeleton {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

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

@media (max-width: 760px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .dashboard-filter-grid,
  .customers-filter-grid,
  .devices-filter-grid {
    grid-template-columns: 1fr;
  }
}

html.theme-light .payments-pill {
  background: rgba(15, 23, 42, 0.04);
}

html.theme-light .payments-pill.is-positive {
  color: #1f8a45;
  border-color: rgba(31, 138, 69, 0.35);
}

html.theme-light .payments-pill.is-negative {
  color: #b22b2b;
  border-color: rgba(178, 43, 43, 0.35);
}

html.theme-light .payments-source-chip.active,
html.theme-light .payments-source-chip:hover {
  background: rgba(12, 74, 140, 0.1);
}

html.theme-light .payments-tag,
html.theme-light .payments-detail-list div {
  background: rgba(15, 23, 42, 0.03);
}

.invoice-filter-shell {
  padding: 12px;
}

.invoice-filter-shell form {
  display: grid;
  gap: 10px;
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: end;
}

.invoice-filter-shell input,
.invoice-filter-shell select {
  min-height: 38px;
}

.invoice-table-shell,
.invoice-detail-table-shell {
  overflow: hidden;
}

.skeleton-line,
.skeleton-block {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line { height: 12px; }
.skeleton-block { min-height: 120px; }

.toast-stack-global {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 150;
  display: grid;
  gap: 8px;
}
.toast-global {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(15, 22, 34, 0.95);
  color: var(--text);
  padding: 10px 12px;
  box-shadow: var(--shadow-raise);
}

.fd-schedule-shell {
  display: grid;
  gap: 12px;
}

.fd-surface-card {
  border: 1px solid rgba(83, 114, 168, 0.2);
  border-radius: 14px;
  background: radial-gradient(120% 150% at 90% 0%, rgba(31, 79, 164, 0.14), rgba(7, 16, 31, 0.95) 55%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.fd-schedule-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.fd-schedule-header-row h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
}

.fd-schedule-header-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.fd-schedule-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fd-schedule-cta {
  background: linear-gradient(135deg, rgba(14, 190, 110, 0.95), rgba(6, 129, 74, 0.95));
  border-color: rgba(19, 199, 117, 0.75);
  color: #ecfff6;
}

.fd-schedule-filter-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.5fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.fd-schedule-filter-row label,
.fd-date-nav {
  display: grid;
  gap: 6px;
}

.fd-schedule-filter-row span,
.fd-date-nav span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fd-schedule-filter-row select,
.fd-schedule-filter-row input {
  min-height: 38px;
  border: 1px solid rgba(89, 120, 173, 0.24);
  border-radius: 10px;
  background: rgba(5, 14, 28, 0.85);
  color: var(--text);
  padding: 8px 10px;
}

.fd-date-nav-controls {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 6px;
}

.fd-date-nav-controls button {
  border-radius: 9px;
  border: 1px solid rgba(89, 120, 173, 0.24);
  background: rgba(5, 14, 28, 0.85);
  color: var(--text);
}

.fd-date-nav small {
  color: #9bb6df;
}

.fd-schedule-main-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 350px;
  gap: 12px;
  min-height: 700px;
}

.fd-schedule-left-rail {
  display: grid;
  gap: 12px;
  align-content: start;
}

.fd-mini-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 0;
}

.fd-mini-cal-header button {
  background: transparent;
  border: 1px solid rgba(89, 120, 173, 0.24);
  border-radius: 8px;
  color: #d8e8ff;
  width: 28px;
  height: 28px;
}

.fd-mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 10px;
}

.fd-mini-cal-dow {
  color: var(--muted);
  text-align: center;
  font-size: 0.7rem;
}

.fd-mini-cal-day {
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #dce7f8;
  height: 30px;
}

.fd-mini-cal-day.active {
  border-color: rgba(20, 210, 120, 0.8);
  background: rgba(20, 210, 120, 0.16);
  box-shadow: 0 0 18px rgba(20, 210, 120, 0.22);
}

.fd-mini-cal-day.muted {
  opacity: 0.45;
}

.fd-mini-cal-day.today:not(.active) {
  border-color: rgba(107, 146, 220, 0.36);
}

.fd-staff-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 0;
}

.fd-staff-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.fd-staff-card-head button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(89, 120, 173, 0.24);
  background: rgba(9, 20, 38, 0.9);
  color: #d8e8ff;
}

.fd-staff-search {
  display: block;
  padding: 10px 12px 0;
}

.fd-staff-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(89, 120, 173, 0.24);
  border-radius: 10px;
  background: rgba(7, 15, 29, 0.92);
  color: var(--text);
  padding: 8px 10px;
}

.fd-staff-list {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.fd-staff-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(89, 120, 173, 0.2);
  background: rgba(8, 18, 34, 0.9);
}

.fd-staff-row.active {
  border-color: rgba(0, 210, 106, 0.45);
  background: linear-gradient(145deg, rgba(7, 31, 22, 0.96), rgba(8, 18, 34, 0.96));
  box-shadow: 0 0 16px rgba(0, 210, 106, 0.08);
}

.fd-staff-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(145deg, rgba(25, 62, 132, 0.68), rgba(8, 26, 58, 0.8));
}

.fd-staff-copy strong {
  display: block;
  font-size: 0.84rem;
}

.fd-staff-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.fd-availability-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b7688;
}

.fd-availability-dot.available {
  background: #0bc96f;
}

.fd-availability-dot.busy {
  background: #ffc22e;
}

.fd-availability-dot.pto {
  background: #ff5959;
}

.fd-staff-status-wrap {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.fd-staff-status-label {
  color: #9db7dc;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fd-manage-cal {
  margin: 0 12px 12px;
  text-align: center;
}

.fd-schedule-center-column {
  display: grid;
  gap: 12px;
}

.fd-calendar-shell {
  overflow: hidden;
}

.fd-week-header-row {
  display: grid;
  grid-template-columns: 70px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid rgba(89, 120, 173, 0.22);
}

.fd-time-col {
  padding: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.fd-day-col-head {
  padding: 8px 10px;
  border-left: 1px solid rgba(89, 120, 173, 0.14);
}

.fd-day-col-head small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.fd-day-col-head strong {
  font-size: 1rem;
}

.fd-day-col-head.active {
  background: linear-gradient(180deg, rgba(17, 208, 120, 0.2), rgba(17, 208, 120, 0));
}

.fd-week-grid-wrap {
  display: grid;
  grid-template-columns: 70px 1fr;
  min-height: 680px;
}

.fd-time-axis {
  display: grid;
  grid-template-rows: repeat(11, 64px);
  padding-top: 4px;
}

.fd-time-axis span {
  color: #88a0c8;
  font-size: 0.75rem;
  padding-left: 10px;
}

.fd-week-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid rgba(89, 120, 173, 0.18);
}

.fd-day-column {
  border-left: 1px solid rgba(89, 120, 173, 0.14);
  position: relative;
}

.fd-hour-cell {
  height: 64px;
  border-bottom: 1px solid rgba(89, 120, 173, 0.12);
}

.fd-appointment-card {
  position: absolute;
  border-radius: 9px;
  border: 1px solid rgba(111, 151, 224, 0.26);
  background: rgba(33, 75, 142, 0.42);
  color: #f1f7ff;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}

.fd-appointment-card small {
  display: block;
  color: #d6e8ff;
  font-size: 0.7rem;
}

.fd-appointment-card strong {
  display: block;
  font-size: 0.8rem;
  margin-top: 2px;
}

.fd-appointment-card span {
  color: #c6daff;
  font-size: 0.72rem;
}

.fd-card-diagnostic { background: rgba(119, 70, 214, 0.45); border-color: rgba(169, 122, 255, 0.5); }
.fd-card-repair { background: rgba(42, 108, 211, 0.45); border-color: rgba(96, 151, 239, 0.5); }
.fd-card-remote { background: rgba(19, 151, 85, 0.42); border-color: rgba(76, 204, 132, 0.5); }
.fd-card-consultation { background: rgba(196, 136, 32, 0.42); border-color: rgba(247, 194, 92, 0.5); }
.fd-card-training { background: rgba(153, 126, 44, 0.42); border-color: rgba(238, 198, 90, 0.5); }
.fd-card-pto { background: rgba(198, 53, 73, 0.44); border-color: rgba(246, 110, 128, 0.55); }
.fd-card-travel { background: rgba(83, 95, 118, 0.5); border-color: rgba(146, 160, 186, 0.5); }
.fd-card-completed { background: rgba(21, 98, 60, 0.15); border: 1px dashed rgba(27, 208, 117, 0.9); }
.fd-card-cancelled { background: rgba(83, 90, 104, 0.3); border-color: rgba(134, 144, 164, 0.5); opacity: 0.75; }

.fd-current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 66, 66, 0.95);
  box-shadow: 0 0 14px rgba(255, 66, 66, 0.45);
  z-index: 3;
}

.fd-upcoming-card {
  padding: 10px 12px;
}

.fd-upcoming-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.fd-upcoming-head h3 {
  margin: 0;
}

.fd-upcoming-head div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fd-upcoming-head select {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(89, 120, 173, 0.24);
  background: rgba(8, 16, 30, 0.9);
  color: var(--text);
}

.fd-upcoming-head a {
  color: #b8d8ff;
  text-decoration: none;
}

.fd-sched-today-btn {
  min-height: 38px;
}

.fd-upcoming-table-wrap {
  margin-top: 8px;
  overflow: auto;
}

.fd-upcoming-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.fd-upcoming-table-wrap th,
.fd-upcoming-table-wrap td {
  border-bottom: 1px solid rgba(89, 120, 173, 0.16);
  padding: 8px 10px;
  font-size: 0.82rem;
  text-align: left;
}

.fd-sched-pill {
  display: inline-flex;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 3px 8px;
  border: 1px solid rgba(122, 145, 184, 0.4);
  text-transform: capitalize;
}

.fd-sched-status-confirmed { background: rgba(20, 186, 107, 0.2); color: #8ff1b8; border-color: rgba(47, 221, 136, 0.45); }
.fd-sched-status-pending { background: rgba(205, 151, 23, 0.2); color: #fbd97f; border-color: rgba(239, 187, 65, 0.45); }
.fd-sched-status-cancelled { background: rgba(111, 124, 146, 0.2); color: #d0dae7; border-color: rgba(147, 158, 176, 0.45); }
.fd-sched-status-completed { background: rgba(20, 186, 107, 0.1); color: #90f5c4; border: 1px dashed rgba(47, 221, 136, 0.7); }
.fd-sched-status-neutral { background: rgba(63, 109, 192, 0.2); color: #b9d7ff; border-color: rgba(107, 146, 220, 0.45); }

.fd-schedule-right-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.fd-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fd-detail-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(89, 120, 173, 0.2);
  background: rgba(8, 18, 34, 0.9);
  color: #dbe8fb;
}

.fd-schedule-right-panel h3 {
  margin: 0;
}

.fd-detail-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.fd-detail-meta li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: #d6e6ff;
  font-size: 0.84rem;
}

.fd-detail-meta strong {
  color: #9eb7dc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fd-contact-card {
  border: 1px solid rgba(89, 120, 173, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: rgba(8, 18, 34, 0.9);
}

.fd-contact-card h4 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: #9eb7dc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fd-contact-card p {
  margin: 0;
}

.fd-detail-person {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
}

.fd-detail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(25, 62, 132, 0.68), rgba(8, 26, 58, 0.8));
  color: #fff;
  font-weight: 700;
  font-size: 0.76rem;
  border: 1px solid rgba(145, 177, 225, 0.24);
}

.fd-detail-person-copy {
  display: grid;
  gap: 3px;
}

.fd-detail-person-copy p {
  font-weight: 600;
}

.fd-detail-person-copy small {
  color: #9db7dc;
}

.fd-links-list {
  display: grid;
  gap: 6px;
}

.fd-links-list a {
  border: 1px solid rgba(89, 120, 173, 0.2);
  border-radius: 9px;
  padding: 7px 9px;
  text-decoration: none;
  color: #dbe8fb;
  display: flex;
  justify-content: space-between;
}

.fd-detail-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(8, 16, 30, 0), rgba(8, 16, 30, 0.95) 35%);
}

.fd-danger-btn {
  border-color: rgba(236, 88, 88, 0.7);
  color: #ff9090;
}

@media (max-width: 1360px) {
  .fd-schedule-main-grid {
    grid-template-columns: 260px minmax(0, 1fr) 320px;
  }
}

@media (max-width: 1080px) {
  .fd-schedule-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .fd-schedule-main-grid {
    grid-template-columns: 1fr;
  }

  .fd-schedule-right-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .fd-schedule-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .fd-schedule-header-actions {
    width: 100%;
  }

  .fd-schedule-header-actions .btn-secondary {
    flex: 1;
  }

  .fd-week-grid-wrap {
    grid-template-columns: 52px 1fr;
  }

  .fd-week-header-row {
    grid-template-columns: 52px repeat(7, minmax(88px, 1fr));
    overflow: auto;
  }

  .fd-week-grid {
    min-width: 700px;
  }
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.reports-center {
  display: grid;
  gap: 12px;
}

.reports-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(16, 24, 36, 0.94), rgba(9, 15, 24, 0.94));
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.reports-header {
  display: grid;
  gap: 10px;
}

.reports-header h2 {
  margin: 0;
  font-size: 1.36rem;
  letter-spacing: 0.02em;
}

.reports-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.reports-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) repeat(4, auto);
  gap: 8px;
  align-items: end;
}

.reports-filters label {
  gap: 5px;
  font-size: 0.82rem;
}

.reports-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.reports-kpi-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: var(--text);
  text-decoration: none;
  display: grid;
  gap: 7px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reports-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.reports-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reports-kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.reports-kpi-trend {
  font-size: 0.74rem;
  font-weight: 700;
}

.reports-kpi-trend.is-positive {
  color: #83f5ad;
}

.reports-kpi-trend.is-negative {
  color: #ff9b9b;
}

.reports-kpi-card h3 {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.reports-kpi-card strong {
  font-size: 1.34rem;
  line-height: 1.1;
}

.reports-kpi-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.reports-empty-metric,
.reports-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.reports-tabs-shell {
  padding: 10px;
  display: grid;
  gap: 10px;
}

.reports-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reports-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.reports-tab:hover,
.reports-tab.is-active {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.13);
}

.reports-panels {
  display: grid;
}

.reports-panel {
  display: none;
  gap: 10px;
}

.reports-panel.is-active {
  display: grid;
}

.reports-grid-two,
.reports-grid-three,
.reports-scorecard-grid {
  display: grid;
  gap: 10px;
}

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

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

.reports-scorecard-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.reports-card h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.reports-card > strong {
  font-size: 1.42rem;
}

.reports-list-chart,
.reports-funnel-list,
.reports-stat-lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.reports-list-chart li,
.reports-funnel-list li,
.reports-stat-lines div {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.reports-list-chart.compact li {
  padding: 6px 8px;
}

.reports-stat-lines dt {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reports-stat-lines dd {
  margin: 0;
  font-weight: 700;
}

.reports-schedule-shell {
  display: grid;
  gap: 10px;
}

.reports-schedule-shell h3,
.reports-schedule-shell h4 {
  margin: 0;
}

.reports-schedule-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

@media (max-width: 1350px) {
  .reports-kpi-strip {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }

  .reports-filters {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .reports-filters .btn-secondary,
  .reports-filters .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .reports-schedule-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 980px) {
  .reports-kpi-strip,
  .reports-grid-three {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .reports-grid-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .reports-kpi-strip,
  .reports-grid-three,
  .reports-schedule-form,
  .reports-filters {
    grid-template-columns: 1fr;
  }

  .reports-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 12px 8px;
}
.app-shell.sidebar-collapsed .brand strong,
.app-shell.sidebar-collapsed .brand span,
.app-shell.sidebar-collapsed .sidebar-user,
.app-shell.sidebar-collapsed .sidebar-footer .btn-secondary {
  display: none;
}
.app-shell.sidebar-collapsed .sidebar-lock-toggle {
  width: 100%;
  padding: 0;
  justify-content: center;
}
.app-shell.sidebar-collapsed .sidebar-lock-label,
.app-shell.sidebar-collapsed .brand {
  justify-content: center;
}
.app-shell.sidebar-collapsed .brand-logo,
.app-shell.sidebar-collapsed .brand-mark {
  width: 34px;
  height: 34px;
}
.app-shell.sidebar-collapsed .nav-link {
  font-size: 0;
  padding: 8px;
  text-align: center;
  position: relative;
}
.app-shell.sidebar-collapsed .nav-link::before {
  content: attr(data-short);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: inherit;
}
.app-shell.sidebar-collapsed .sidebar-footer {
  justify-items: center;
}
.app-shell.sidebar-collapsed .issue-report-trigger {
  width: 100%;
  min-height: 34px;
  font-size: 0;
}
.app-shell.sidebar-collapsed .issue-report-trigger::before {
  content: 'ISSUE';
  font-size: 0.64rem;
  font-weight: 700;
}
.past-due-ticket {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}
.past-due-customer {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.past-due-date {
  font-size: 0.8rem;
  color: var(--muted);
}
.past-due-empty {
  text-align: center;
  padding: 14px;
  color: var(--muted);
  font-style: italic;
}
@media (max-width: 1200px) {
  .main-content {
    padding: 10px;
  }
  .profile-name {
    display: none;
  }
  .profile-toggle {
    padding-right: 6px;
  }
  .sidebar-collapse-toggle {
    display: none;
  }
  .page-actions {
    position: static;
    padding: 0;
    background: transparent;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 18px;
  }
  html.is-installed-pwa .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    z-index: 60;
    padding: 20px 16px;
  }
  html.is-installed-pwa .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
  }
  html.is-installed-pwa .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 50;
  }
  html.is-installed-pwa .app-shell.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: all;
  }
  html.is-installed-pwa .main-content {
    padding: 9px;
    padding-bottom: 84px;
  }
  html.is-installed-pwa .topbar {
    margin-bottom: 8px;
  }
  html.is-installed-pwa .topbar h1 {
    font-size: 1.05rem;
  }
  html.is-installed-pwa .admin-tabs {
    gap: 6px;
    margin-bottom: 10px;
  }
  html.is-installed-pwa .admin-tab {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  html.is-installed-pwa .topbar-actions {
    gap: 6px;
  }
  html.is-installed-pwa .card {
    padding: 10px;
    border-radius: 12px;
  }
  html.is-installed-pwa label {
    gap: 5px;
    font-size: 0.84rem;
  }
  html.is-installed-pwa input,
  html.is-installed-pwa select,
  html.is-installed-pwa textarea {
    padding: 8px 10px;
    border-radius: 10px;
  }
  html.is-installed-pwa textarea {
    min-height: 90px;
  }
  html.is-installed-pwa .topbar-actions .btn-secondary,
  html.is-installed-pwa .ticket-action-buttons .btn-secondary,
  html.is-installed-pwa .btn-primary,
  html.is-installed-pwa .btn-secondary {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.84rem;
  }
  html.is-installed-pwa .page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  html.is-installed-pwa .page-actions form {
    margin: 0;
  }
  html.is-installed-pwa .mobile-quick-actions {
    gap: 6px;
  }
  html.is-installed-pwa .ticket-card {
    padding: 9px;
    gap: 6px;
  }
  html.is-installed-pwa .ticket-card-title strong {
    font-size: 0.95rem;
  }
  html.is-installed-pwa .ticket-card-meta {
    font-size: 0.8rem;
    line-height: 1.25;
  }
  html.is-installed-pwa .ticket-quick-status-form {
    gap: 6px;
  }
  html.is-installed-pwa .ticket-view-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
  }
  html.is-installed-pwa .ticket-view-grid p {
    font-size: 0.85rem;
    line-height: 1.25;
  }
  html.is-installed-pwa .upload-inline {
    gap: 8px;
  }
  html.is-installed-pwa .table-wrapper.mobile-hide-table {
    display: none;
  }
  html.is-installed-pwa .ticket-cards {
    display: grid;
    gap: 12px;
  }
  html.is-installed-pwa .pwa-mobile-only {
    display: grid;
  }
  html.is-installed-pwa .pwa-tech-dock {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 7px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(16, 16, 16, 0.96);
    backdrop-filter: blur(6px);
    z-index: 70;
  }
  html.is-installed-pwa .pwa-tech-dock a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.78rem;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.04);
  }
  html.is-installed-pwa .pwa-tech-dock a.active {
    color: var(--text);
    border-color: var(--line);
    background: var(--surface2);
  }
  .dashboard-grid,
  .page-body {
    grid-template-columns: 1fr;
  }
  .full-width,
  .half-width {
    grid-column: span 1;
  }
  .device-form-grid {
    grid-template-columns: 1fr;
  }
  .ticket-form-grid {
    grid-template-columns: 1fr;
  }
  .customer-form-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .status-add-form {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .ticket-view-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) and (hover: none) and (pointer: coarse) {
  .mobile-nav-toggle {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 1.2rem;
  }
  html.is-installed-pwa .card {
    padding: 8px;
  }
  html.is-installed-pwa .ticket-card {
    padding: 8px;
  }
  html.is-installed-pwa .ticket-card-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3px 8px;
  }
  html.is-installed-pwa .mobile-quick-actions {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  html.is-installed-pwa .ticket-view-grid {
    grid-template-columns: 1fr;
    gap: 4px 6px;
  }
}

@media (max-width: 480px) {
  html.is-installed-pwa .main-content {
    padding: 6px;
    padding-bottom: 80px;
  }
  html.is-installed-pwa .topbar h1 {
    font-size: 0.95rem;
  }
  html.is-installed-pwa .btn-primary,
  html.is-installed-pwa .btn-secondary {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.8rem;
  }
  html.is-installed-pwa .ticket-card-info-grid {
    grid-template-columns: 1fr;
  }
  html.is-installed-pwa .order-assign-select {
    min-width: 100%;
    min-height: 36px;
    padding: 8px 10px;
  }
  html.is-installed-pwa .page-actions {
    grid-template-columns: 1fr;
  }
  html.is-installed-pwa .pwa-tech-dock {
    left: 6px;
    right: 6px;
    gap: 4px;
    padding: 6px;
  }
  html.is-installed-pwa .pwa-tech-dock a {
    font-size: 0.72rem;
    min-height: 32px;
  }
}

.hidden { display: none; }

/* Legacy template compatibility layer: enterprise look without route or logic changes. */
.page-body > .card > h2,
.page-body > .card > h3 {
  margin-top: 0;
  letter-spacing: 0.02em;
}

.page-body > .card > p {
  color: var(--muted);
}

.page-body > div[style*="display:flex"][style*="justify-content:space-between"] {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(18, 27, 40, 0.92), rgba(10, 16, 24, 0.92));
  padding: 10px 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255,255,255,0.02);
}

.page-body > div[style*="display:flex"][style*="justify-content:space-between"] h2,
.page-body > div[style*="display:flex"][style*="justify-content:space-between"] h3 {
  margin: 0;
  font-size: 1rem;
}

.page-body .card table,
.page-body .table,
.page-body .table-default {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.page-body .card table th,
.page-body .card table td,
.page-body .table th,
.page-body .table td,
.page-body .table-default th,
.page-body .table-default td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.page-body .card table th,
.page-body .table th,
.page-body .table-default th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

.page-body .card table tbody tr:hover,
.page-body .table tbody tr:hover,
.page-body .table-default tbody tr:hover {
  background: var(--surface2);
}

.page-body .card form[style*="grid-template-columns"],
.page-body .card .form-grid {
  gap: 10px 12px;
}

.page-body .card form[style*="grid-template-columns"] label,
.page-body .card .form-grid label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.page-body .card form[style*="grid-template-columns"] input,
.page-body .card form[style*="grid-template-columns"] select,
.page-body .card form[style*="grid-template-columns"] textarea {
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 8px;
}

.page-body .card form[style*="display:inline"],
.page-body .card form[style*="display:inline-block"] {
  display: inline-flex;
  align-items: center;
}

.page-body .card td[style*="display:flex"] {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 980px) {
  .page-body > div[style*="display:flex"][style*="justify-content:space-between"] {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .page-body > div[style*="display:flex"][style*="justify-content:space-between"] > div {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .page-body .table-wrapper,
  .page-body .card.table-wrapper,
.page-body .mobile-hide-table {
  overflow-x: auto;
}

.page-body .stripe-report-table-wrapper {
  max-width: 100%;
  overflow-x: auto !important;
}

  .page-body .card table,
  .page-body .table,
  .page-body .table-default {
    table-layout: fixed;
  }

  .page-body .card table th,
  .page-body .card table td,
  .page-body .table th,
  .page-body .table td,
  .page-body .table-default th,
  .page-body .table-default td {
    white-space: normal !important;
    word-break: break-word;
  }

  .page-body .order-assign-select {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 700px) {
  .login-card-brand {
    padding: 24px 20px;
  }

  .page-body .ticket-cards {
    display: grid;
    gap: 10px;
  }

  .page-body .mobile-hide-table {
    display: none;
    min-width: 32px;
    padding: 0;
    justify-content: center;
  }
  .app-shell.sidebar-collapsed .sidebar-lock-label {
    display: none;
  }

  .page-body .ticket-card .form-grid {
    grid-template-columns: 1fr !important;
  }

  .page-body .ticket-card-info-grid {
    grid-template-columns: 1fr;
  }

  .page-body .page-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Light-mode palette correction layer: colors/shadows only, no layout changes. */
html.theme-light body {
  background: var(--bg);
  color: var(--text);
}

html.theme-light .sidebar {
  background: #ffffff;
  border-right-color: #E2E8F0;
}

html.theme-light .sidebar-user {
  background: linear-gradient(180deg, rgba(255,255,255,0), #ffffff 20%);
}

html.theme-light .nav-link {
  color: var(--muted);
}

html.theme-light .nav-link:hover {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: var(--text);
}

html.theme-light .nav-link.active {
  background: #E8FFF2;
  border-color: #BFEFD6;
  color: #0F172A;
  box-shadow: inset 0 0 0 1px rgba(0, 210, 106, 0.22);
}

html.theme-light .topbar {
  background: linear-gradient(180deg, rgba(245, 247, 250, 0.96), rgba(245, 247, 250, 0.82));
}

html.theme-light .profile-toggle {
  background: #FFFFFF;
  border-color: #DCE3EC;
  color: #1E293B;
}

html.theme-light .profile-avatar {
  border-color: #CBD5E1;
  color: #0F172A;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(59, 130, 246, 0.2));
}

html.theme-light .profile-dropdown {
  background: #FFFFFF;
  border-color: #DCE3EC;
  box-shadow: 0 12px 26px rgba(148, 163, 184, 0.24);
}

html.theme-light .profile-dropdown a {
  color: #1E293B;
}

html.theme-light .profile-dropdown a:hover {
  background: #F8FAFC;
}

html.theme-light .profile-dropdown-theme {
  border-color: #E2E8F0;
}

html.theme-light .profile-switch-track {
  border-color: #CBD5E1;
  background: #D7DEE8;
}

html.theme-light .profile-switch input:checked + .profile-switch-track {
  background: rgba(0, 210, 106, 0.7);
}

html.theme-light .profile-dropdown a[href="/logout"] {
  border-top-color: #E2E8F0;
}

html.theme-light .admin-tabs {
  background: #FFFFFF;
  border-color: #DCE3EC;
}

html.theme-light .admin-tab {
  background: #F8FAFC;
  border-color: #DCE3EC;
  color: var(--muted);
}

html.theme-light .admin-tab:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

html.theme-light .card,
html.theme-light .ticket-card,
html.theme-light .metric-card,
html.theme-light .dashboard-kpi-card,
html.theme-light .customers-kpi-card,
html.theme-light .devices-kpi-card,
html.theme-light .employee-card,
html.theme-light .commission-metric,
html.theme-light .bulk-assign-section,
html.theme-light .commission-filter-shell,
html.theme-light .commission-table-shell,
html.theme-light .commission-empty-shell,
html.theme-light .orders-section-shell,
html.theme-light .orders-debug-shell,
html.theme-light .orders-table-shell,
html.theme-light .orders-results-shell,
html.theme-light .dashboard-due-card,
html.theme-light .dashboard-activity-card,
html.theme-light .dashboard-assigned-card,
html.theme-light .settings-enterprise-card,
html.theme-light .audit-results-shell,
html.theme-light .audit-table-shell,
html.theme-light .users-results-shell,
html.theme-light .users-table-shell,
html.theme-light .customers-results-shell,
html.theme-light .customers-table-shell,
html.theme-light .orders-section-shell,
html.theme-light .orders-debug-shell,
html.theme-light .sales-enterprise .card,
html.theme-light .sales-enterprise .metric-card,
html.theme-light .sales-enterprise .bulk-assign-section,
html.theme-light .sales-enterprise .totals-section,
html.theme-light .sales-enterprise .item-with-qty,
html.theme-light .sales-enterprise .item-check {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16) !important;
}

html.theme-light .devices-filter-card,
html.theme-light .devices-table-shell,
html.theme-light .devices-enterprise .empty-state,
html.theme-light .devices-table,
html.theme-light .devices-table th,
html.theme-light .devices-table td,
html.theme-light .page-body [class*="-kpi-card"],
html.theme-light .page-body [class*="-filter-card"],
html.theme-light .page-body [class*="-filter-shell"],
html.theme-light .page-body [class*="-results-shell"],
html.theme-light .page-body [class*="-table-shell"],
html.theme-light .page-body [class*="-section-shell"],
html.theme-light .page-body [class*="-debug-shell"],
html.theme-light .page-body [class*="-activity-card"],
html.theme-light .page-body [class*="-assigned-card"],
html.theme-light .page-body [class*="-due-card"] {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16) !important;
}

html.theme-light .devices-table th,
html.theme-light .devices-table tbody tr:hover {
  background: #EEF2F7 !important;
}

html.theme-light .devices-table td {
  border-bottom-color: #E2E8F0 !important;
}

html.theme-light .devices-filter-grid label,
html.theme-light .customers-kpi-card h3,
html.theme-light .devices-kpi-card h3 {
  color: #64748B !important;
}

html.theme-light .devices-kpi-card p,
html.theme-light .customers-kpi-value {
  color: #1E293B !important;
}

html.theme-light .tickets-enterprise .kpi-card,
html.theme-light .tickets-enterprise .tickets-search-shell,
html.theme-light .tickets-enterprise .ticket-card-enterprise,
html.theme-light .tickets-enterprise .tickets-empty,
html.theme-light .tickets-enterprise .toast,
html.theme-light .tickets-enterprise .tickets-skeleton .s-card {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16) !important;
}

html.theme-light .tickets-enterprise .kpi-card:hover,
html.theme-light .tickets-enterprise .ticket-card-enterprise:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.2) !important;
}

html.theme-light .tickets-enterprise .kpi-top,
html.theme-light .tickets-enterprise .meta-grid,
html.theme-light .tickets-enterprise .page-foot-row,
html.theme-light .tickets-enterprise .tickets-empty {
  color: #64748B !important;
}

html.theme-light .tickets-enterprise .kpi-value,
html.theme-light .tickets-enterprise .issue-preview,
html.theme-light .tickets-enterprise .ticket-number-link,
html.theme-light .tickets-enterprise .toast {
  color: #1E293B !important;
}

html.theme-light .tickets-enterprise .chip {
  background: #F1F5F9 !important;
  border-color: #DCE3EC !important;
  color: #334155 !important;
}

html.theme-light .tickets-enterprise .tech-avatar {
  background: linear-gradient(135deg, rgba(0, 210, 106, 0.2), rgba(59, 130, 246, 0.2)) !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

html.theme-light .tickets-enterprise .tickets-skeleton .s-card {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.18), rgba(226, 232, 240, 0.45), rgba(203, 213, 225, 0.18)) !important;
}

html.theme-light .sales-enterprise .sales-tab-nav,
html.theme-light .sales-enterprise .metric-card,
html.theme-light .sales-enterprise .bulk-assign-section,
html.theme-light .sales-enterprise .card,
html.theme-light .sales-enterprise .data-table,
html.theme-light .sales-enterprise .items-list,
html.theme-light .sales-enterprise .totals-section,
html.theme-light .sales-enterprise .item-with-qty,
html.theme-light .sales-enterprise .item-check,
html.theme-light .sales-enterprise .customer-select-box select,
html.theme-light .sales-enterprise .qty-input-group input {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16) !important;
}

html.theme-light .sales-enterprise .sales-tab-btn {
  color: #64748B !important;
  border-color: transparent !important;
  background: transparent !important;
}

html.theme-light .sales-enterprise .sales-tab-btn:hover {
  color: #1E293B !important;
  background: #F8FAFC !important;
  border-color: #DCE3EC !important;
}

html.theme-light .sales-enterprise .sales-tab-btn.active {
  color: #0F172A !important;
  background: #E8FFF2 !important;
  border-color: #BFEFD6 !important;
}

html.theme-light .sales-enterprise .data-table thead,
html.theme-light .sales-enterprise .data-table tbody tr:hover {
  background: #EEF2F7 !important;
}

html.theme-light .sales-enterprise .data-table th {
  color: #64748B !important;
}

html.theme-light .sales-enterprise .data-table td,
html.theme-light .sales-enterprise .item-name,
html.theme-light .sales-enterprise .total-value,
html.theme-light .sales-enterprise .form-header h2,
html.theme-light .sales-enterprise .section-header h2 {
  color: #1E293B !important;
}

html.theme-light .sales-enterprise .item-price,
html.theme-light .sales-enterprise .total-label,
html.theme-light .sales-enterprise .metric-label,
html.theme-light .sales-enterprise .empty-state,
html.theme-light .sales-enterprise .no-customer-message {
  color: #64748B !important;
}

html.theme-light .sales-enterprise .btn-action,
html.theme-light .sales-enterprise .btn-reset,
html.theme-light .sales-enterprise .btn-sales-mode {
  background: #F1F5F9 !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: none !important;
}

html.theme-light .sales-enterprise .btn-action:hover,
html.theme-light .sales-enterprise .btn-reset:hover,
html.theme-light .sales-enterprise .btn-sales-mode:hover {
  background: #EAF0F6 !important;
  border-color: #CBD5E1 !important;
}

html.theme-light .sales-enterprise .badge-active {
  background: #E8FFF2 !important;
  color: #0F172A !important;
  border: 1px solid #BFEFD6 !important;
}

html.theme-light .commission-enterprise .page-header,
html.theme-light .commission-enterprise .commission-filter-shell,
html.theme-light .commission-enterprise .commission-table-shell,
html.theme-light .commission-enterprise .commission-empty-shell,
html.theme-light .commission-enterprise .employee-card,
html.theme-light .commission-enterprise .commission-metric,
html.theme-light .commission-enterprise .profile-item,
html.theme-light .commission-enterprise .sale-table,
html.theme-light .commission-enterprise .badge-pill,
html.theme-light .commission-enterprise .btn-nav-muted,
html.theme-light .commission-enterprise .notice,
html.theme-light .commission-enterprise .error {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16) !important;
}

html.theme-light .commission-enterprise .notice {
  background: #ECFDF3 !important;
  border-color: #B7E8CA !important;
  color: #166534 !important;
}

html.theme-light .commission-enterprise .error {
  background: #FEF2F2 !important;
  border-color: #FECACA !important;
  color: #991B1B !important;
}

html.theme-light .commission-enterprise .commission-metric .label,
html.theme-light .commission-enterprise .employee-meta,
html.theme-light .commission-enterprise .profile-item .k,
html.theme-light .commission-enterprise .commission-toolbar label {
  color: #64748B !important;
}

html.theme-light .commission-enterprise .commission-metric .value,
html.theme-light .commission-enterprise .profile-item .v,
html.theme-light .commission-enterprise .employee-head h3,
html.theme-light .commission-enterprise .sale-table td,
html.theme-light .commission-enterprise .sale-table th,
html.theme-light .commission-enterprise .badge-pill {
  color: #1E293B !important;
}

html.theme-light .commission-enterprise .sale-table th {
  background: #EEF2F7 !important;
}

html.theme-light .commission-enterprise .sale-table tbody tr:hover {
  background: #F8FAFC !important;
}

html.theme-light .commission-enterprise .inline-form input,
html.theme-light .commission-enterprise .inline-form select,
html.theme-light .commission-enterprise .commission-toolbar input,
html.theme-light .commission-enterprise .commission-toolbar select {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
}

html.theme-light .commission-enterprise .commission-actions .btn-secondary,
html.theme-light .commission-enterprise .inline-form .btn-secondary,
html.theme-light .commission-enterprise .btn-add.btn-nav-muted {
  background: #F1F5F9 !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: none !important;
}

html.theme-light .commission-enterprise .commission-actions .btn-secondary:hover,
html.theme-light .commission-enterprise .inline-form .btn-secondary:hover,
html.theme-light .commission-enterprise .btn-add.btn-nav-muted:hover {
  background: #EAF0F6 !important;
  border-color: #CBD5E1 !important;
}

html.theme-light .commission-enterprise .sale-table tbody tr,
html.theme-light .commission-enterprise .sale-table tbody tr td,
html.theme-light .commission-enterprise .sale-table tbody tr td .stack {
  background: #FFFFFF !important;
}

html.theme-light .commission-enterprise .sale-table td {
  border-bottom-color: #E2E8F0 !important;
}

html.theme-light .commission-enterprise .sale-table tbody tr:hover td,
html.theme-light .commission-enterprise .sale-table tbody tr:hover td .stack {
  background: #F8FAFC !important;
}

html.theme-light .dashboard-activity-list li a,
html.theme-light .dashboard-assigned-item,
html.theme-light .dashboard-due-item {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
}

html.theme-light .dashboard-activity-list li a:hover,
html.theme-light .dashboard-assigned-item:hover,
html.theme-light .dashboard-due-item:hover {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.18) !important;
}

html.theme-light .page-body [style*="linear-gradient(145deg, rgba(16,24,36"],
html.theme-light .page-body [style*="linear-gradient(145deg, rgba(16, 24, 36"],
html.theme-light .page-body [style*="linear-gradient(140deg, rgba(18,27,40"],
html.theme-light .page-body [style*="linear-gradient(140deg, rgba(18, 27, 40"],
html.theme-light .page-body [style*="rgba(13, 20, 32"],
html.theme-light .page-body [style*="rgba(10, 16, 26"] {
  background: #FFFFFF !important;
  border-color: #DCE3EC !important;
  color: #1E293B !important;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16) !important;
}

html.theme-light .page-actions {
  background: linear-gradient(180deg, rgba(245,247,250,0.98), rgba(245,247,250,0.86));
}

html.theme-light .admin-tabs + .page-body > .card,
html.theme-light .page-body > div[style*="display:flex"][style*="justify-content:space-between"] {
  background: #FFFFFF;
  border-color: #DCE3EC;
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.16);
}

html.theme-light .table-default,
html.theme-light .table,
html.theme-light .data-table,
html.theme-light .sale-table,
html.theme-light .email-logs-table,
html.theme-light .page-body .card table {
  background: #FFFFFF;
  border-color: #DCE3EC;
}

html.theme-light .table-default th,
html.theme-light .table th,
html.theme-light .data-table th,
html.theme-light .sale-table th,
html.theme-light .email-logs-table th,
html.theme-light .page-body .card table th {
  background: #EEF2F7 !important;
  color: #64748B !important;
}

html.theme-light .table-default td,
html.theme-light .table td,
html.theme-light .data-table td,
html.theme-light .sale-table td,
html.theme-light .email-logs-table td,
html.theme-light .page-body .card table td {
  border-bottom-color: #E2E8F0;
  color: #1E293B;
}

html.theme-light .table-default tbody tr:hover,
html.theme-light .table tbody tr:hover,
html.theme-light .data-table tbody tr:hover,
html.theme-light .sale-table tbody tr:hover,
html.theme-light .email-logs-table tbody tr:hover,
html.theme-light .page-body .card table tbody tr:hover {
  background: #F8FAFC !important;
}

html.theme-light input,
html.theme-light select,
html.theme-light textarea {
  background: #FFFFFF;
  border-color: #DCE3EC;
  color: #1E293B;
}

html.theme-light input::placeholder,
html.theme-light textarea::placeholder {
  color: #94A3B8;
}

html.theme-light .btn-secondary,
html.theme-light .btn-action,
html.theme-light .btn-reset,
html.theme-light .btn-nav-muted {
  background: #F1F5F9;
  border-color: #DCE3EC;
  color: #1E293B;
}

html.theme-light .btn-secondary:hover,
html.theme-light .btn-action:hover,
html.theme-light .btn-reset:hover,
html.theme-light .btn-nav-muted:hover {
  background: #EAF0F6;
  border-color: #CBD5E1;
  box-shadow: 0 3px 10px rgba(148, 163, 184, 0.2);
}

html.theme-light .toast-global {
  background: #FFFFFF;
  border-color: #DCE3EC;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.22);
}

html.theme-light .skeleton-line,
html.theme-light .skeleton-block {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.18), rgba(226, 232, 240, 0.45), rgba(203, 213, 225, 0.18));
}

html.theme-light .pwa-tech-dock {
  background: rgba(255,255,255,0.96);
  border-color: #DCE3EC;
}

html.theme-light .pwa-tech-dock a {
  background: #F8FAFC;
  color: var(--muted);
}

html.theme-light .pwa-tech-dock a.active {
  background: #E8FFF2;
  border-color: #BFEFD6;
  color: #0F172A;
}

/* Mobile UX optimization layer: scoped to <=820px to avoid desktop/tablet layouts. */
@media (max-width: 820px) {
  html,
  body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 1.1rem;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 340px);
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 60;
    padding: 20px 16px;
  }

  .app-shell.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 50;
  }

  .app-shell.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: all;
  }

  .main-content {
    padding: 10px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
    will-change: opacity, transform;
  }

  html.mobile-page-ready .main-content {
    opacity: 1;
    transform: none;
  }

  .card,
  .ticket-card,
  .table-wrapper {
    content-visibility: auto;
    contain-intrinsic-size: 260px;
  }

  .btn-primary,
  .btn-secondary,
  button,
  .nav-link,
  .admin-tab,
  .profile-toggle,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .form-grid,
  .ticket-form-grid,
  .customer-form-grid,
  .device-form-grid,
  .search-grid,
  .page-actions,
  .issue-grid {
    grid-template-columns: 1fr !important;
  }

  .table-wrapper,
  .customers-table-shell,
  .users-table-shell,
  .orders-table-shell,
  .audit-table-shell,
  .commission-table-shell {
    overflow-x: hidden;
  }

  table.mobile-cardized {
    width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  table.mobile-cardized thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0 0 0 0);
    overflow: hidden;
  }

  table.mobile-cardized tbody {
    display: grid;
    gap: 10px;
  }

  table.mobile-cardized tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface2);
    padding: 8px 10px;
  }

  table.mobile-cardized td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    border: 0;
    padding: 7px 2px;
    text-align: right;
    white-space: normal;
    word-break: break-word;
  }

  table.mobile-cardized td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 600;
    text-align: left;
    max-width: 48%;
  }

  table.mobile-cardized td[data-label=""]::before {
    display: none;
  }

  .issue-modal-backdrop,
  .modal,
  .ticket-photo-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .issue-modal,
  .modal-content,
  .ticket-photo-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px));
    height: calc(100dvh - env(safe-area-inset-top, 0px));
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    overflow-y: auto;
  }

  .ticket-photo-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .pwa-mobile-only {
    display: grid;
  }

  .pwa-tech-dock {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 7px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(16, 16, 16, 0.96);
    backdrop-filter: blur(6px);
    z-index: 70;
  }
}

@media (max-width: 1200px) {
  .payments-layout {
    grid-template-columns: 1fr;
  }

  .payments-side {
    position: static;
  }
}

@media (max-width: 980px) {
  .payments-header-search {
    grid-template-columns: 1fr;
  }

  .payments-filter-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .payments-filter-top,
  .payments-filter-grid {
    grid-template-columns: 1fr;
  }

  .payments-toolbar-actions,
  .payments-detail-actions {
    width: 100%;
  }

  .payments-toolbar-actions .btn-primary,
  .payments-toolbar-actions .btn-secondary,
  .payments-detail-actions .btn-primary,
  .payments-detail-actions .btn-secondary {
    flex: 1 1 auto;
  }
}

@media (max-width: 820px) {
  .topbar {
    top: env(safe-area-inset-top, 0px);
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .pwa-tech-dock a {
    font-size: 0.76rem;
  }
}

@media (max-width: 540px) {
  .main-content {
    padding: 8px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 82px);
  }

  .card {
    border-radius: 12px;
    padding: 10px;
  }

  .issue-modal,
  .modal-content,
  .ticket-photo-modal {
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
  }
}

html.theme-light .profile-dropdown-location-lite,
html.theme-light .profile-dropdown-header,
html.theme-light .profile-dropdown-theme {
  border-color: rgba(15, 23, 42, 0.11);
  background: rgba(255, 255, 255, 0.72);
}

html.theme-light .profile-location-trigger {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.88);
}

html.theme-light .profile-location-trigger:hover {
  border-color: rgba(0, 168, 90, 0.36);
  background: rgba(0, 210, 106, 0.08);
}

html.theme-light .profile-location-flyout {
  border-color: rgba(15, 23, 42, 0.12);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 249, 0.99));
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.2);
}

html.theme-light .profile-location-option:hover {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
}

html.theme-light .profile-toast {
  border-color: rgba(0, 168, 90, 0.36);
  background: rgba(232, 255, 243, 0.98);
  color: #065F46;
}

@media (max-width: 700px) {
  .profile-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100vw, 420px);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 18px 0 0 18px;
    border-right: 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  .topbar-profile.open .profile-dropdown {
    transform: translateX(0);
  }
  .topbar-profile:focus-within .profile-dropdown {
    transform: translateX(0);
  }

  .profile-location-flyout {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    width: auto;
    max-width: none;
    max-height: min(72vh, 520px);
    overflow-y: auto;
    border-radius: 14px;
    padding: 10px;
    transform: translateY(16px) scale(1);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .profile-location-flyout.open {
    transform: translateY(0);
    opacity: 1;
  }

  .profile-toast {
    right: 10px;
    left: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    text-align: center;
  }
}

.help-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.64));
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.help-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(0, 210, 106, 0.12), transparent 26%),
    linear-gradient(160deg, rgba(13, 20, 31, 0.99), rgba(9, 14, 23, 0.99));
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.42);
  transform: translateX(100%);
  transition: transform 190ms ease;
  z-index: 9001;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.help-drawer.is-open {
  transform: translateX(0);
}

#helpDrawerQuickStartSection,
#helpDrawerCommonActionsSection,
#helpDrawerHowToSection,
#helpDrawerTroubleshootingSection,
#helpDrawerRelatedSection {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Premium dashboard + help center refresh */
.dashboard-enterprise {
  display: grid;
  gap: 16px;
}

.dashboard-hero,
.dashboard-panel-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 16px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}

.dashboard-hero::before,
.dashboard-panel-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(34, 197, 94, 0.05));
}

.dashboard-hero-copy {
  display: grid;
  gap: 8px;
}

.dashboard-hero-eyebrow,
.dashboard-panel-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(34, 197, 94, 0.08);
  color: var(--accent-hover);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero h2 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.05;
}

.dashboard-hero p,
.dashboard-panel-head p {
  margin: 0;
  color: var(--muted);
}

.dashboard-hero-meta {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: end;
}

.dashboard-hero-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 0.78rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.dashboard-hero-filter {
  width: min(360px, 100%);
}

.dashboard-hero-filter label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.dashboard-hero-filter select {
  min-height: 42px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  padding: 0 12px;
}

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

.dashboard-kpi-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  min-height: 156px;
  padding: 16px;
  border-radius: 18px;
  text-decoration: none;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.03), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(34, 197, 94, 0.08);
}

.dashboard-kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.dashboard-kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  color: #0b0f14;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.16);
}

.dashboard-kpi-trend {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.dashboard-kpi-card h3 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dashboard-kpi-value {
  font-size: 1.95rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
}

.dashboard-kpi-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.dashboard-kpi-card-green {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.dashboard-kpi-card-orange {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12);
}

.dashboard-kpi-card-red {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.dashboard-kpi-card-blue {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.dashboard-kpi-card-violet {
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.12);
}

.dashboard-panels-grid,
.dashboard-bottom-grid {
  display: grid;
  gap: 16px;
}

.dashboard-panels-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
}

.dashboard-bottom-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
}

.dashboard-panel-card {
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.07), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}

.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-panel-head h2 {
  margin: 4px 0 0;
  font-size: 1.02rem;
}

.dashboard-mini-select,
.dashboard-panel-link {
  min-height: 34px;
  border-radius: 12px;
}

.dashboard-panel-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
}

.dashboard-chart-shell {
  display: grid;
  gap: 10px;
}

.dashboard-revenue-chart {
  width: 100%;
  height: 250px;
  display: block;
}

.dashboard-grid-lines line {
  stroke: rgba(255,255,255,0.06);
  stroke-width: 0.6;
}

.dashboard-revenue-area {
  fill: rgba(34, 197, 94, 0.12);
  stroke: none;
}

.dashboard-revenue-line {
  fill: none;
  stroke: url(#dashboardRevenueStroke);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-revenue-point {
  fill: var(--accent);
}

.dashboard-axis-labels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-axis-labels span {
  text-align: center;
}

.dashboard-donut-wrap {
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.dashboard-donut {
  position: relative;
  width: 220px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--donut-gradient));
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 14px 26px rgba(0,0,0,0.26);
}

.dashboard-donut::after {
  content: '';
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(17,22,28,0.99), rgba(17,22,28,0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.dashboard-donut-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}

.dashboard-donut-inner strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.dashboard-donut-inner span {
  color: var(--muted);
  font-size: 0.74rem;
}

.dashboard-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-donut-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.dashboard-donut-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--swatch-color);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.03);
}

.dashboard-donut-legend strong {
  display: block;
  font-size: 0.86rem;
}

.dashboard-donut-legend span {
  color: var(--muted);
  font-size: 0.76rem;
}

.dashboard-activity-list-premium {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-activity-row {
  display: grid;
  gap: 8px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-activity-row:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.18);
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}

.dashboard-activity-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text);
  text-decoration: none;
}

.dashboard-activity-ticket {
  min-width: 92px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.dashboard-activity-copy {
  display: grid;
  gap: 3px;
}

.dashboard-activity-copy strong {
  font-size: 0.92rem;
}

.dashboard-activity-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.dashboard-activity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-left: 104px;
  color: var(--muted);
  font-size: 0.74rem;
}

.dashboard-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-size: 0.72rem;
  font-weight: 700;
}

.dashboard-status-badge.is-waiting,
.dashboard-status-badge.is-waiting-on-customer,
.dashboard-status-badge.is-waiting-on-parts,
.dashboard-status-badge.is-awaiting-parts {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
}

.dashboard-status-badge.is-in-repair {
  color: #3B82F6;
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
}

.dashboard-status-badge.is-ready-for-pickup {
  color: #22C55E;
  border-color: rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.08);
}

.dashboard-status-badge.is-completed {
  color: #8B5CF6;
  border-color: rgba(139, 92, 246, 0.22);
  background: rgba(139, 92, 246, 0.08);
}

.dashboard-services-list {
  display: grid;
  gap: 10px;
}

.dashboard-service-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.dashboard-service-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent-hover);
}

.dashboard-service-row strong {
  display: block;
  font-size: 0.92rem;
}

.dashboard-service-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.help-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.44), rgba(2, 6, 23, 0.66));
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.help-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(450px, 100vw);
  z-index: 9001;
  transform: translateX(100%);
  transition: transform 220ms ease;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 26%),
    linear-gradient(160deg, rgba(13, 20, 31, 0.99), rgba(9, 14, 23, 0.99));
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.42);
}

.help-drawer.is-open {
  transform: translateX(0);
}

.help-drawer-header,
.help-drawer-footer {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.help-drawer-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  display: grid;
  gap: 10px;
}

.help-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.help-drawer-header-copy {
  display: grid;
  gap: 8px;
}

.help-drawer-header-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-drawer-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent-hover);
}

.help-drawer-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.help-drawer-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.help-drawer-page-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 800;
}

.help-drawer-close {
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
}

.help-drawer-body {
  overflow: auto;
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}

.help-drawer-search-shell {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.help-drawer-search-shell input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
}

.help-drawer-search-icon {
  color: var(--muted);
  font-size: 0.9rem;
}

.help-drawer-search-clear {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  cursor: pointer;
}

.help-chip-row-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.help-chip-row-scroll::-webkit-scrollbar {
  display: none;
}

.help-drawer-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px;
}

.help-drawer-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.help-drawer-section-head h3 {
  margin: 0;
  font-size: 0.92rem;
}

.help-drawer-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.help-section-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-hover);
}

.help-drawer-section ul,
.help-list-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.help-drawer-section ul li,
.help-list-block ul li,
.help-detail-item ol li {
  color: var(--text);
}

.help-drawer-section h3,
.help-list-block h4,
.help-module-card h3 {
  margin: 0 0 8px;
}

.help-detail-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  padding: 10px 12px;
}

.help-detail-item summary {
  cursor: pointer;
  font-weight: 700;
}

.help-search-hit,
.help-chip,
.help-drawer-support a {
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.help-search-hit:hover,
.help-chip:hover,
.help-drawer-support a:hover {
  transform: translateY(-1px);
}

.help-drawer-footer .btn-primary {
  justify-content: center;
  min-height: 46px;
  width: 100%;
}

.help-drawer-support {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.help-drawer-support a {
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 700;
}

.help-page {
  display: grid;
  gap: 16px;
}

.help-page-hero {
  display: grid;
  gap: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}

.help-page-hero-copy {
  display: grid;
  gap: 8px;
}

.help-page-eyebrow,
.help-module-pill {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.18);
  background: rgba(34, 197, 94, 0.08);
  color: var(--accent-hover);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-page-hero h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.help-page-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.help-page-search-wrap {
  display: grid;
  gap: 8px;
  min-width: min(460px, 100%);
  font-size: 0.76rem;
  color: var(--muted);
}

.help-module-list {
  display: grid;
  gap: 16px;
}

.help-module-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  position: relative;
  overflow: hidden;
}

.help-module-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(34, 197, 94, 0.05));
}

.help-module-head {
  display: grid;
  gap: 8px;
}

/* Final parity polish */
.topbar {
  padding: 8px 0;
  margin-bottom: 10px;
}

.topbar h1 {
  font-size: 1.05rem;
}

.enterprise-search {
  height: 48px;
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.7);
  border-color: rgba(46, 58, 76, 0.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 20px rgba(0,0,0,0.18);
  padding: 0 14px;
}

.enterprise-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar {
  padding: 18px 12px;
}

.sidebar-nav {
  gap: 12px;
}

.nav-section {
  gap: 8px;
}

.nav-section::before {
  color: rgba(160, 166, 178, 0.7);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  padding: 0 10px;
}

.nav-link {
  min-height: 48px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

.nav-link::before {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 0.66rem;
}

.dashboard-standard-head {
  padding: 10px 14px;
}

.dashboard-standard-head p {
  font-size: 0.82rem;
}

.dashboard-standard-kpi-grid .dashboard-kpi-card {
  min-height: 198px;
  padding: 24px;
  border-radius: 16px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.dashboard-standard-kpi-grid .dashboard-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 16px 34px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

.dashboard-kpi-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dashboard-standard-kpi-grid .dashboard-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.dashboard-standard-kpi-grid .dashboard-kpi-card h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dashboard-standard-kpi-grid .dashboard-kpi-value {
  margin-top: 14px;
  font-size: 2.35rem;
  font-weight: 800;
}

.dashboard-standard-kpi-grid .dashboard-kpi-trend {
  font-size: 0.8rem;
}

.dashboard-kpi-support {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.dashboard-kpi-support p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.dashboard-kpi-support span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.74);
  letter-spacing: 0.02em;
}

.dashboard-kpi-card-green {
  background: radial-gradient(circle at 10% 0%, rgba(34, 197, 94, 0.12), transparent 35%), linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}

.dashboard-kpi-card-orange {
  background: radial-gradient(circle at 10% 0%, rgba(249, 115, 22, 0.1), transparent 35%), linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}

.dashboard-kpi-card-blue {
  background: radial-gradient(circle at 10% 0%, rgba(59, 130, 246, 0.1), transparent 35%), linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}

.dashboard-kpi-card-violet {
  background: radial-gradient(circle at 10% 0%, rgba(139, 92, 246, 0.1), transparent 35%), linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}

.dashboard-kpi-card-red {
  background: radial-gradient(circle at 10% 0%, rgba(34, 197, 94, 0.09), transparent 35%), linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015));
}

.dashboard-standard-main-grid,
.dashboard-standard-activity-grid {
  gap: 12px;
}

.dashboard-standard-shell .dashboard-revenue-chart {
  height: 280px;
}

.dashboard-revenue-footer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.dashboard-revenue-footer-stats > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  padding: 9px 10px;
  display: grid;
  gap: 2px;
}

.dashboard-revenue-footer-stats strong {
  font-size: 0.95rem;
}

.dashboard-revenue-footer-stats span {
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-standard-shell .dashboard-donut-wrap {
  grid-template-columns: minmax(140px, 0.95fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
}

.dashboard-standard-shell .dashboard-donut {
  width: 164px;
}

.dashboard-standard-shell .dashboard-activity-main {
  align-items: center;
}

.dashboard-activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  flex-shrink: 0;
}

.dashboard-standard-shell .dashboard-activity-ticket {
  min-width: 95px;
}

.dashboard-standard-shell .dashboard-activity-copy strong {
  font-size: 0.9rem;
}

.dashboard-standard-shell .dashboard-activity-copy span {
  font-size: 0.78rem;
}

.dashboard-standard-shell .dashboard-activity-meta {
  padding-left: 130px;
}

.help-drawer {
  background: rgba(17,22,28,0.88);
  backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255,255,255,0.06);
}

.help-drawer-body {
  gap: 12px;
}

.help-drawer-panel,
.help-search-results,
.help-detail-item,
.help-search-hit {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 20px;
}

.help-drawer-search-shell {
  min-height: 48px;
  border-radius: 16px;
}

.help-chip {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  background: rgba(31,41,55,0.9);
  border: 1px solid rgba(255,255,255,0.06);
}

.help-chip.active {
  background: rgba(34,197,94,0.9);
  color: #05120a;
}

.help-drawer-section ul,
.help-list-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
}

.help-drawer-section ul li,
.help-list-block ul li {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.help-detail-item {
  padding: 0;
  overflow: hidden;
}

.help-detail-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.9rem;
}

.help-detail-item summary::-webkit-details-marker {
  display: none;
}

.help-detail-item summary::after {
  content: '▾';
  color: var(--muted);
  transition: transform 180ms ease;
}

.help-detail-item[open] summary::after {
  transform: rotate(180deg);
}

.help-detail-item ol {
  margin: 0;
  padding: 0 16px 14px 36px;
}

.help-drawer-footer .btn-primary {
  min-height: 56px;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #00d26a, #08b85d);
  border-radius: 16px;
}

@media (max-width: 1100px) {
  .dashboard-standard-shell .dashboard-donut-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-standard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-standard-shell .dashboard-kpi-card {
    min-height: 170px;
    padding: 18px;
  }

  .dashboard-standard-shell .dashboard-activity-meta {
    padding-left: 0;
  }

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

.help-module-head-copy {
  display: grid;
  gap: 8px;
}

.help-module-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.help-details-grid {
  display: grid;
  gap: 10px;
}

html.theme-light .dashboard-hero,
html.theme-light .dashboard-panel-card,
html.theme-light .help-page-hero,
html.theme-light .help-module-card {
  background: linear-gradient(180deg, #FFFFFF, #F7FAFC) !important;
}

html.theme-light .help-drawer {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent 26%),
    linear-gradient(170deg, #ffffff, #f6f9fc);
  box-shadow: -10px 0 28px rgba(148, 163, 184, 0.26);
}

html.theme-light .help-drawer-panel,
html.theme-light .help-detail-item,
html.theme-light .help-search-hit,
html.theme-light .help-chip,
html.theme-light .help-drawer-search-shell,
html.theme-light .dashboard-kpi-card,
html.theme-light .dashboard-panel-card,
html.theme-light .dashboard-activity-row,
html.theme-light .dashboard-service-row,
html.theme-light .dashboard-donut-legend li {
  background: rgba(255,255,255,0.88);
}

@media (max-width: 1100px) {
  .dashboard-hero,
  .dashboard-panels-grid,
  .dashboard-bottom-grid,
  .dashboard-donut-wrap {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .dashboard-kpi-grid-premium {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .dashboard-panel-card {
    padding: 16px;
  }

  .dashboard-revenue-chart {
    height: 220px;
  }

  .dashboard-activity-main {
    flex-direction: column;
  }

  .dashboard-activity-ticket,
  .dashboard-activity-meta {
    padding-left: 0;
  }

  .dashboard-activity-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .help-drawer {
    width: 100vw;
  }

  .help-page-search-wrap {
    min-width: 100%;
  }

  .help-page-hero h2 {
    font-size: 1.5rem;
  }
}

/* Dashboard command center */
.dashboard-command-center {
  display: grid;
  gap: 16px;
}

.dashboard-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.dashboard-hero-badges {
  display: grid;
  gap: 10px;
}

.dashboard-hero-badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.dashboard-hero-badge strong {
  display: block;
  font-size: 0.95rem;
}

.dashboard-hero-badge small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-hero-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.12);
}

.dashboard-hero-badge-is-red .dashboard-hero-badge-icon { background: rgba(239, 68, 68, 0.14); }
.dashboard-hero-badge-is-orange .dashboard-hero-badge-icon { background: rgba(249, 115, 22, 0.14); }
.dashboard-hero-badge-is-amber .dashboard-hero-badge-icon { background: rgba(245, 158, 11, 0.14); }
.dashboard-hero-badge-is-blue .dashboard-hero-badge-icon { background: rgba(59, 130, 246, 0.14); }
.dashboard-hero-badge-is-violet .dashboard-hero-badge-icon { background: rgba(139, 92, 246, 0.14); }

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

.dashboard-mission-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-mission-card:hover,
.dashboard-kpi-card:hover,
.dashboard-work-card-item:hover,
.dashboard-pipeline-card:hover,
.dashboard-location-card-item:hover,
.dashboard-event-row a:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
}

.dashboard-mission-card-top,
.dashboard-load-head,
.dashboard-attention-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-mission-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.12);
}

.dashboard-mission-count,
.dashboard-attention-count,
.dashboard-kpi-value {
  letter-spacing: -0.04em;
}

.dashboard-mission-card h3,
.dashboard-attention-card h2 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-mission-card p,
.dashboard-attention-detail,
.dashboard-revenue-breakdown span,
.dashboard-document-list span,
.dashboard-event-row span,
.dashboard-load-head span,
.dashboard-location-card-item span,
.dashboard-work-footer span {
  color: var(--muted);
}

.dashboard-mission-card-is-red .dashboard-mission-icon { background: rgba(239, 68, 68, 0.14); }
.dashboard-mission-card-is-orange .dashboard-mission-icon { background: rgba(249, 115, 22, 0.14); }
.dashboard-mission-card-is-amber .dashboard-mission-icon { background: rgba(245, 158, 11, 0.14); }
.dashboard-mission-card-is-blue .dashboard-mission-icon { background: rgba(59, 130, 246, 0.14); }
.dashboard-mission-card-is-violet .dashboard-mission-icon { background: rgba(139, 92, 246, 0.14); }

.dashboard-attention-grid,
.dashboard-tech-grid,
.dashboard-pipeline-grid,
.dashboard-location-grid,
.dashboard-document-grid,
.dashboard-revenue-metrics,
.dashboard-revenue-breakdown,
.dashboard-work-grid {
  display: grid;
  gap: 12px;
}

.dashboard-attention-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-attention-card,
.dashboard-load-card,
.dashboard-pipeline-card,
.dashboard-location-card-item,
.dashboard-work-card-item,
.dashboard-document-card,
.dashboard-event-row a {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.dashboard-attention-card {
  padding: 16px;
}

.dashboard-attention-card-is-red { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12); }
.dashboard-attention-card-is-orange { box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.12); }
.dashboard-attention-card-is-amber { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12); }
.dashboard-attention-card-is-blue { box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12); }
.dashboard-attention-card-is-green { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12); }

.dashboard-attention-count {
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 6px;
}

.dashboard-attention-list,
.dashboard-document-list,
.dashboard-event-stream {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dashboard-attention-list li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.dashboard-attention-list li strong,
.dashboard-document-list strong,
.dashboard-event-row strong,
.dashboard-load-head strong,
.dashboard-pipeline-card strong,
.dashboard-location-card-item strong {
  display: block;
}

.dashboard-attention-list li span,
.dashboard-pipeline-card p {
  color: var(--muted);
  font-size: 0.76rem;
}

.dashboard-work-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-work-card-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
}

.dashboard-work-card-item strong {
  font-size: 1.75rem;
  line-height: 1;
}

.dashboard-work-card-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.dashboard-work-card-item-is-green { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12); }
.dashboard-work-card-item-is-blue { box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12); }
.dashboard-work-card-item-is-amber { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12); }
.dashboard-work-card-item-is-orange { box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.12); }
.dashboard-work-card-item-is-violet { box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.12); }

.dashboard-work-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  font-size: 0.8rem;
}

.dashboard-work-footer a,
.dashboard-panel-link,
.dashboard-location-card-item,
.dashboard-pipeline-card,
.dashboard-event-row a {
  text-decoration: none;
  color: var(--text);
}

.dashboard-revenue-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-revenue-metrics > div,
.dashboard-document-grid > div {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  display: grid;
  gap: 4px;
}

.dashboard-revenue-metrics strong,
.dashboard-document-grid strong {
  font-size: 1.15rem;
}

.dashboard-revenue-metrics span,
.dashboard-document-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}

.dashboard-revenue-breakdown {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-revenue-breakdown > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.dashboard-tech-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-load-card {
  padding: 14px;
}

.dashboard-load-head span {
  font-size: 0.75rem;
}

.dashboard-load-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dashboard-load-metrics > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.dashboard-load-metrics strong {
  font-size: 1.2rem;
}

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

.dashboard-document-list li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}

.dashboard-pipeline-grid,
.dashboard-location-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-pipeline-card {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.dashboard-pipeline-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.dashboard-pipeline-card p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.dashboard-location-card-item {
  padding: 14px;
  display: grid;
  gap: 4px;
}

.dashboard-event-stream {
  gap: 12px;
}

.dashboard-event-row a {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.dashboard-event-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-event-ticket a { box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12); }
.dashboard-event-invoice a { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.12); }
.dashboard-event-document a { box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.12); }
.dashboard-event-appointment a { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.12); }

@media (max-width: 1280px) {
  .dashboard-command-hero,
  .dashboard-panels-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-mission-grid,
  .dashboard-attention-grid,
  .dashboard-work-grid,
  .dashboard-revenue-metrics,
  .dashboard-tech-grid,
  .dashboard-pipeline-grid,
  .dashboard-location-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-mission-grid,
  .dashboard-attention-grid,
  .dashboard-work-grid,
  .dashboard-revenue-metrics,
  .dashboard-tech-grid,
  .dashboard-pipeline-grid,
  .dashboard-location-grid,
  .dashboard-document-grid,
  .dashboard-revenue-breakdown {
    grid-template-columns: 1fr;
  }

  .dashboard-work-footer,
  .dashboard-hero-badges {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-command-hero,
  .dashboard-hero-filter {
    grid-template-columns: 1fr;
  }
}

html.theme-light .dashboard-hero-badge,
html.theme-light .dashboard-mission-card,
html.theme-light .dashboard-attention-card,
html.theme-light .dashboard-work-card-item,
html.theme-light .dashboard-revenue-metrics > div,
html.theme-light .dashboard-load-card,
html.theme-light .dashboard-document-grid > div,
html.theme-light .dashboard-pipeline-card,
html.theme-light .dashboard-location-card-item,
html.theme-light .dashboard-event-row a {
  background: rgba(255,255,255,0.94);
}

/* Strict reference-style dashboard */
.dashboard-standard-shell {
  display: grid;
  gap: 12px;
}

.dashboard-standard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
}

.dashboard-standard-head h2 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1;
}

.dashboard-standard-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-standard-head-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.dashboard-standard-range {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.74rem;
}

.dashboard-standard-location-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-standard-location-form select {
  min-width: 200px;
  min-height: 34px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text);
  padding: 0 10px;
}

.dashboard-standard-location-form .btn-secondary {
  min-height: 34px;
}

.dashboard-standard-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-standard-kpi-grid .dashboard-kpi-card {
  min-height: 132px;
  padding: 12px;
  border-radius: 12px;
}

.dashboard-standard-kpi-grid .dashboard-kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.dashboard-standard-kpi-grid .dashboard-kpi-card h3 {
  margin: 0;
  font-size: 0.77rem;
}

.dashboard-standard-kpi-grid .dashboard-kpi-value {
  font-size: 2rem;
  line-height: 1;
}

.dashboard-standard-kpi-grid .dashboard-kpi-card p,
.dashboard-standard-kpi-grid .dashboard-kpi-trend {
  font-size: 0.72rem;
}

.dashboard-standard-main-grid,
.dashboard-standard-activity-grid,
.dashboard-standard-secondary-grid {
  display: grid;
  gap: 10px;
}

.dashboard-standard-main-grid,
.dashboard-standard-activity-grid {
  grid-template-columns: minmax(0, 1.34fr) minmax(300px, 0.8fr);
}

.dashboard-standard-secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-standard-side-grid,
.dashboard-standard-queue-stack {
  display: grid;
  gap: 10px;
}

.dashboard-standard-shell .dashboard-panel-card {
  border-radius: 14px;
  padding: 12px;
}

.dashboard-standard-shell .dashboard-panel-head {
  margin-bottom: 10px;
}

.dashboard-standard-shell .dashboard-panel-head h2 {
  margin: 2px 0 0;
  font-size: 0.98rem;
}

.dashboard-standard-shell .dashboard-panel-eyebrow {
  font-size: 0.66rem;
  padding: 4px 8px;
}

.dashboard-standard-shell .dashboard-revenue-chart {
  height: 230px;
}

.dashboard-standard-shell .dashboard-donut-wrap {
  grid-template-columns: 1fr;
  gap: 12px;
}

.dashboard-standard-shell .dashboard-donut {
  width: 182px;
  padding: 12px;
}

.dashboard-standard-shell .dashboard-donut::after {
  inset: 24px;
}

.dashboard-standard-shell .dashboard-donut-legend {
  gap: 8px;
}

.dashboard-standard-shell .dashboard-donut-legend li {
  padding: 8px 10px;
  border-radius: 12px;
}

.dashboard-standard-services-list,
.dashboard-standard-mini-list,
.dashboard-standard-table-list,
.dashboard-standard-four-up {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dashboard-standard-services-list li,
.dashboard-standard-mini-list li a,
.dashboard-standard-table-list > div,
.dashboard-standard-table-list > a,
.dashboard-standard-four-up a {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-decoration: none;
}

.dashboard-standard-mini-list li a {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.dashboard-standard-mini-list li span {
  color: var(--text);
  font-weight: 700;
}

.dashboard-standard-services-list span,
.dashboard-standard-table-list span,
.dashboard-standard-four-up span,
.dashboard-standard-mini-list li strong {
  color: var(--muted);
  font-size: 0.75rem;
}

.dashboard-standard-table-list strong,
.dashboard-standard-services-list strong,
.dashboard-standard-four-up strong {
  font-size: 0.86rem;
}

.dashboard-standard-four-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-standard-shell .dashboard-activity-row {
  padding: 10px 11px;
  border-radius: 12px;
}

.dashboard-standard-shell .dashboard-activity-ticket {
  min-width: 90px;
  font-size: 0.8rem;
}

.dashboard-standard-shell .dashboard-activity-copy strong {
  font-size: 0.86rem;
}

.dashboard-standard-shell .dashboard-status-badge {
  font-size: 0.66rem;
  padding: 4px 8px;
}

.dashboard-standard-shell .dashboard-event-row a {
  padding: 10px 11px;
  border-radius: 10px;
}

.dashboard-standard-shell .dashboard-event-row strong {
  font-size: 0.84rem;
}

.dashboard-standard-shell .dashboard-event-row span,
.dashboard-standard-shell .dashboard-event-row small {
  font-size: 0.72rem;
}

@media (max-width: 1200px) {
  .dashboard-standard-main-grid,
  .dashboard-standard-activity-grid,
  .dashboard-standard-secondary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-standard-head {
    flex-direction: column;
  }

  .dashboard-standard-head-meta {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .dashboard-standard-kpi-grid,
  .dashboard-standard-secondary-grid,
  .dashboard-standard-four-up {
    grid-template-columns: 1fr;
  }

  .dashboard-standard-location-form {
    flex-wrap: wrap;
    width: 100%;
  }

  .dashboard-standard-location-form select,
  .dashboard-standard-location-form .btn-secondary {
    width: 100%;
  }

  .dashboard-standard-shell .dashboard-revenue-chart {
    height: 210px;
  }
}

/* Gold standard dashboard pass */
.dashboard-gold-pass {
  gap: 14px;
}

.dashboard-gold-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
}

.dashboard-gold-header h2 {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1;
}

.dashboard-gold-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.dashboard-gold-header-meta {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.dashboard-gold-range {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.76rem;
}

.dashboard-gold-location-filter {
  display: flex;
  gap: 8px;
  width: auto;
}

.dashboard-gold-location-filter select {
  min-height: 38px;
  border-radius: 10px;
}

.dashboard-gold-mission-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-gold-mission-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  color: var(--text);
}

.dashboard-gold-mission-pill strong {
  font-size: 1rem;
  font-weight: 800;
}

.dashboard-gold-mission-pill span:last-child {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.dashboard-gold-mission-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.12);
  flex-shrink: 0;
}

.dashboard-gold-main-grid,
.dashboard-gold-lower-grid,
.dashboard-gold-secondary-grid {
  display: grid;
  gap: 14px;
}

.dashboard-gold-main-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
}

.dashboard-gold-lower-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
}

.dashboard-gold-secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-gold-side-stack,
.dashboard-gold-ops-stack {
  display: grid;
  gap: 14px;
}

.dashboard-gold-service-list,
.dashboard-gold-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dashboard-gold-service-list li,
.dashboard-gold-mini-list li a,
.dashboard-gold-table-list > div,
.dashboard-gold-table-list > a,
.dashboard-gold-four-up a {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-decoration: none;
}

.dashboard-gold-service-list span,
.dashboard-gold-table-list span,
.dashboard-gold-four-up span,
.dashboard-gold-mini-list span {
  color: var(--muted);
  font-size: 0.76rem;
}

.dashboard-gold-mini-list li a {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.dashboard-gold-mini-list strong,
.dashboard-gold-table-list strong,
.dashboard-gold-four-up strong {
  font-size: 0.88rem;
}

.dashboard-gold-mini-list span {
  font-weight: 800;
  color: var(--text);
}

.dashboard-gold-table-list,
.dashboard-gold-four-up {
  display: grid;
  gap: 8px;
}

.dashboard-gold-four-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-gold-pass .dashboard-kpi-card {
  min-height: 134px;
  border-radius: 14px;
}

.dashboard-gold-pass .dashboard-kpi-value {
  font-size: 2rem;
}

.dashboard-gold-pass .dashboard-panel-head h2 {
  margin: 3px 0 0;
  font-size: 1.04rem;
}

.dashboard-gold-pass .dashboard-panel-card {
  border-radius: 14px;
  padding: 14px;
}

.dashboard-gold-pass .dashboard-donut-wrap {
  grid-template-columns: 1fr;
}

.dashboard-gold-pass .dashboard-donut {
  width: 190px;
}

.dashboard-gold-pass .dashboard-event-row a,
.dashboard-gold-pass .dashboard-activity-row {
  border-radius: 12px;
}

@media (max-width: 1180px) {
  .dashboard-gold-main-grid,
  .dashboard-gold-lower-grid,
  .dashboard-gold-secondary-grid,
  .dashboard-gold-mission-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-gold-header {
    flex-direction: column;
  }

  .dashboard-gold-header-meta {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .dashboard-gold-main-grid,
  .dashboard-gold-lower-grid,
  .dashboard-gold-secondary-grid,
  .dashboard-gold-mission-row,
  .dashboard-gold-four-up {
    grid-template-columns: 1fr;
  }

  .dashboard-gold-location-filter {
    width: 100%;
    flex-wrap: wrap;
  }

  .dashboard-gold-location-filter select,
  .dashboard-gold-location-filter .btn-secondary {
    width: 100%;
  }
}

.help-drawer-header,
.help-drawer-footer {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.help-drawer-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.help-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.help-drawer-header::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 210, 106, 0.56), rgba(255, 255, 255, 0));
  opacity: 0.55;
}

.help-drawer-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.help-drawer-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 26ch;
}

.help-drawer-close {
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 800;
  line-height: 1;
}

.help-drawer-body {
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.help-drawer-search {
  display: grid;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.help-drawer-search input,
.help-page-search-wrap input {
  min-height: 42px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--field-bg), rgba(255, 255, 255, 0.02));
  color: var(--text);
  padding: 0 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.help-chip-row,
.help-page-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.help-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: var(--muted);
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.74rem;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.help-chip:hover {
  border-color: rgba(0, 210, 106, 0.4);
  color: var(--text);
  transform: translateY(-1px);
}

.help-chip.active {
  border-color: transparent;
  color: #0b0f14;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 18px rgba(0, 210, 106, 0.16);
}

.help-drawer-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.help-drawer-section h3,
.help-list-block h4,
.help-module-card h3 {
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.help-drawer-section ul,
.help-list-block ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--text);
}

.help-detail-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  padding: 10px 12px;
}

.help-detail-item + .help-detail-item {
  margin-top: 8px;
}

.help-detail-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.help-detail-item ol {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--text);
}

.help-search-results ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.help-search-hit {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 5px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.help-search-hit span {
  color: var(--muted);
  font-size: 0.8rem;
}

.help-search-hit:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 210, 106, 0.36);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
}

.help-page {
  display: grid;
  gap: 16px;
}

.help-page-hero {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(0, 210, 106, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.help-page-hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(0, 210, 106, 0));
}

.help-page-hero-copy {
  display: grid;
  gap: 8px;
}

.help-page-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 210, 106, 0.24);
  background: rgba(0, 210, 106, 0.1);
  color: var(--accent-hover);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.help-page-hero h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.help-page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.help-page-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.help-page-search-wrap {
  display: grid;
  gap: 8px;
  min-width: min(460px, 100%);
  font-size: 0.76rem;
  color: var(--muted);
}

.help-module-list {
  display: grid;
  gap: 16px;
}

.help-module-card {
  display: grid;
  gap: 12px;
  scroll-margin-top: 80px;
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.help-module-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), rgba(0, 210, 106, 0.08));
}

.help-module-meta {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.help-module-head {
  display: grid;
  gap: 8px;
}

.help-module-head-copy {
  display: grid;
  gap: 8px;
}

.help-module-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 210, 106, 0.1);
  border: 1px solid rgba(0, 210, 106, 0.2);
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.help-module-card h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.help-list-block h4 {
  font-size: 0.88rem;
  color: var(--text);
}

.help-details-grid {
  display: grid;
  gap: 10px;
}

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

body.help-drawer-open .main-content {
  margin-right: 450px;
}

html.theme-light .help-drawer {
  background:
    radial-gradient(circle at top right, rgba(0, 210, 106, 0.08), transparent 26%),
    linear-gradient(170deg, #ffffff, #f6f9fc);
  box-shadow: -10px 0 28px rgba(148, 163, 184, 0.26);
}

html.theme-light .help-drawer-section,
html.theme-light .help-detail-item,
html.theme-light .help-search-hit,
html.theme-light .help-chip {
  background: rgba(255, 255, 255, 0.82);
}

html.theme-light .help-page-hero,
html.theme-light .help-module-card {
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}

html.theme-light .help-page-eyebrow,
html.theme-light .help-module-pill {
  background: rgba(0, 210, 106, 0.08);
}

@media (max-width: 820px) {
  .help-page-search-wrap {
    min-width: 100%;
  }
}

.help-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.help-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 450px;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 190ms ease;
}

.help-drawer.is-open {
  transform: translateX(0);
}

@media (max-width: 700px) {
  .help-page-hero,
  .help-module-card {
    padding: 16px;
  }

  .help-page-hero h2 {
    font-size: 1.5rem;
  }

  .help-drawer-header,
  .help-drawer-footer,
  .help-drawer-body {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Phase 3: help search + category chips */
.help-drawer-search-shell {
  min-height: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 10px 0 12px;
}

.help-drawer-search-icon {
  margin-right: 8px;
}

.help-drawer-search-shell input {
  height: 100%;
}

#helpDrawerChips {
  gap: 8px;
}

#helpDrawerChips .help-chip {
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #2a313a;
  color: #d8dee6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

#helpDrawerChips .help-chip:hover {
  background: #38414b;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f2f5f8;
  transform: translateY(-1px);
}

#helpDrawerChips .help-chip.active {
  background: #22c55e;
  border-color: #22c55e;
  color: #06130a;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.26);
}

/* Command center global design language */
body {
  background: #060b14;
  color: #e6eafa;
}

.app-shell {
  background: radial-gradient(circle at 100% 0, rgba(59, 130, 246, 0.1), transparent 36%), #060b14;
}

.sidebar {
  width: 240px;
  background: #090f17;
  padding: 8px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.app-shell.sidebar-collapsed .sidebar,
.app-shell.sidebar-mini .sidebar,
body.sidebar-collapsed .sidebar {
  width: 80px;
}

.brand {
  min-height: 56px;
}

.brand-logo {
  width: 40px;
  height: 40px;
}

.brand .brand-powered {
  display: none;
}

.sidebar-lock-panel {
  margin: 2px 0 6px;
}

.sidebar-nav {
  gap: 4px;
}

.nav-section {
  gap: 2px;
}

.nav-section::before {
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #a0a6b2;
  opacity: 0.9;
  padding: 0 4px;
}

.nav-link {
  min-height: 34px;
  height: 34px;
  padding: 3px 8px;
  font-size: 0.76rem;
  gap: 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all .22s ease;
}

.nav-link::before {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0.56rem;
}

.nav-link.active {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #22c55e;
}

.sidebar-footer {
  gap: 8px;
}

.sidebar-user {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 28, 0.92);
  padding: 10px;
  font-size: 0.82rem;
}

.topbar {
  min-height: 72px;
  padding: 12px 0;
  margin-bottom: 20px;
  align-items: center;
}

.topbar h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
}

.topbar-center {
  justify-content: center;
}

.enterprise-search {
  width: min(500px, 100%);
  min-height: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 28, 0.92);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.enterprise-search input {
  font-size: 14px;
}

.enterprise-search-shortcut {
  border-radius: 10px;
}

.topbar-utilities {
  gap: 12px;
}

.utility-pill,
.icon-utility-btn {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 28, 0.92);
}

.command-dashboard {
  display: grid;
  gap: 32px;
}

.command-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.command-hero h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
}

.command-hero p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #a0a6b2;
}

.command-location-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.command-location-filter select {
  min-height: 40px;
  border-radius: 12px;
}

.attention-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.attention-strip-item {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 28, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: all .22s ease;
}

.attention-strip-item:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.attention-strip-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.08);
}

.attention-strip-copy {
  display: grid;
  gap: 4px;
}

.attention-strip-copy strong {
  font-size: 14px;
  font-weight: 600;
}

.attention-strip-copy span {
  font-size: 13px;
  color: #a0a6b2;
}

.command-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.command-kpi-card {
  display: grid;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 28, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: all .22s ease;
  padding: 24px;
}

.command-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.command-kpi-card-green { background: radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }
.command-kpi-card-orange { background: radial-gradient(circle at 0 0, rgba(245, 158, 11, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }
.command-kpi-card-amber { background: radial-gradient(circle at 0 0, rgba(245, 158, 11, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }
.command-kpi-card-red { background: radial-gradient(circle at 0 0, rgba(239, 68, 68, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }
.command-kpi-card-blue { background: radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }
.command-kpi-card-violet { background: radial-gradient(circle at 0 0, rgba(139, 92, 246, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }
.command-kpi-card-teal { background: radial-gradient(circle at 0 0, rgba(16, 185, 129, 0.12), transparent 42%), rgba(17, 22, 28, 0.92); }

.command-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.command-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.08);
}

.command-kpi-trend {
  font-size: 13px;
  font-weight: 600;
  color: #a0a6b2;
}

.command-kpi-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.command-kpi-metric {
  font-size: 42px;
  line-height: 1;
  font-weight: 700;
}

.command-kpi-context {
  margin: 0;
  font-size: 13px;
  color: #a0a6b2;
}

.command-main-grid,
.command-lower-grid {
  display: grid;
  gap: 32px;
}

.command-main-grid {
  grid-template-columns: 1.1fr 1.9fr;
}

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

.command-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 28, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: all .22s ease;
  padding: 24px;
}

.command-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.command-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.command-card-head-inline {
  align-items: center;
}

.command-eyebrow {
  display: inline-block;
  font-size: 13px;
  color: #a0a6b2;
}

.command-card h3 {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 600;
}

.command-queue-list,
.command-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.command-queue-list li a,
.command-activity-list li a,
.command-schedule-row,
.command-location-list a,
.command-pipeline-list a {
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(20, 26, 33, 0.92);
  padding: 16px;
  display: grid;
  gap: 4px;
  transition: all .22s ease;
}

.command-queue-list li a {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.command-queue-list li a:hover,
.command-activity-list li a:hover,
.command-schedule-row:hover,
.command-location-list a:hover,
.command-pipeline-list a:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.25);
}

.command-queue-list strong,
.command-activity-list strong,
.command-location-list strong,
.command-pipeline-list strong,
.command-tech-grid strong,
.command-schedule-table strong {
  font-size: 16px;
  font-weight: 600;
}

.command-queue-list span,
.command-activity-list span,
.command-location-list span,
.command-pipeline-list span,
.command-tech-grid span,
.command-schedule-table span,
.command-empty-row {
  font-size: 13px;
  color: #a0a6b2;
}

.command-queue-count {
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  font-size: 14px;
  font-weight: 600;
}

.command-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.command-revenue-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.command-revenue-chart {
  height: 280px;
}

.command-revenue-line {
  stroke: url(#dashboardRevenueStrokeCommand);
}

.command-revenue-summary {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.command-revenue-summary div {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  display: grid;
  gap: 2px;
}

.command-revenue-summary strong {
  font-size: 16px;
  font-weight: 600;
}

.command-revenue-summary span {
  font-size: 13px;
  color: #a0a6b2;
}

.command-donut {
  width: 220px;
  margin: 0 auto;
}

.command-donut-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.command-donut-panel h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.command-activity-list li a {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.command-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
}

.command-activity-list small {
  font-size: 13px;
  color: #a0a6b2;
}

.command-schedule-table,
.command-location-list,
.command-pipeline-list,
.command-tech-grid,
.command-metric-grid {
  display: grid;
  gap: 12px;
}

.command-schedule-row {
  grid-template-columns: 90px 1.2fr 1fr 1fr 1fr;
  align-items: center;
}

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

.command-metric-grid a {
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(20, 26, 33, 0.92);
  padding: 16px;
  display: grid;
  gap: 4px;
}

.command-metric-grid strong {
  font-size: 24px;
  font-weight: 600;
}

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

.command-tech-grid article {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(20, 26, 33, 0.92);
  padding: 16px;
  display: grid;
  gap: 6px;
}

.command-empty-row {
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  padding: 16px;
}

.help-drawer {
  width: 460px;
  background: rgba(17, 22, 28, 0.92);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

body.help-drawer-open .main-content {
  margin-right: 460px;
}

@media (max-width: 1320px) {
  .attention-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-main-grid,
  .command-revenue-grid,
  .command-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .command-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-schedule-row {
    grid-template-columns: 1fr;
  }

  .command-tech-grid,
  .command-metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar h1,
  .command-hero h2 {
    font-size: 28px;
  }

  .help-drawer {
    width: 100vw;
  }

  body.help-drawer-open .main-content {
    margin-right: 0;
  }
}

/* Hard overrides for layered legacy styles */
.topbar {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  height: 72px !important;
  min-height: 72px !important;
  padding: 0 !important;
}

.topbar-center {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

.enterprise-search {
  width: 500px !important;
  max-width: 500px !important;
  height: 48px !important;
  min-height: 48px !important;
  border-radius: 16px !important;
}

.enterprise-search input {
  height: 48px !important;
  min-height: 48px !important;
}

.sidebar {
  width: 240px !important;
  min-width: 240px !important;
  flex: 0 0 240px !important;
  box-sizing: border-box !important;
}

.help-drawer,
#helpDrawer {
  width: 460px !important;
  background: rgba(17, 22, 28, 0.92) !important;
  backdrop-filter: blur(24px) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55) !important;
}

@media (max-width: 700px) {
  .enterprise-search {
    width: min(500px, 100%) !important;
    max-width: 100% !important;
  }

  .help-drawer,
  #helpDrawer {
    width: 100vw !important;
  }
}
/* Shared responsive and pagination primitives */
.main-content,
.page-body,
.page-body > *,
.card,
.ds-toolbar,
.ds-table-shell,
.form-grid,
.summary-grid,
.grid-2,
.grid-3 { min-width: 0; max-width: 100%; }

.table-wrapper,
.ds-table-shell { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.table-wrapper table,
.ds-table-shell table { width: 100%; }
.table-default th,
.table-default td { overflow-wrap: anywhere; word-break: normal; }
.table-default td:last-child { white-space: normal; }

.page-actions,
.ds-toolbar,
.ds-toolbar-actions,
.fd-detail-actions { flex-wrap: wrap; min-width: 0; }
.page-actions > *,
.ds-toolbar-actions > * { max-width: 100%; }

.fd-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.fd-pagination-summary { margin: 0; color: var(--muted); }
.fd-pagination-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fd-pagination-pages .btn-primary,
.fd-pagination-pages .btn-secondary { min-width: 42px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
.fd-pagination-pages .disabled { opacity: .5; pointer-events: none; }
.fd-pagination-ellipsis { padding: 0 4px; }
.fd-pagination-size { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.fd-pagination-size select { min-height: 42px; }

@media (max-width: 700px) {
  .fd-pagination { align-items: stretch; }
  .fd-pagination-summary,
  .fd-pagination-pages,
  .fd-pagination-size { width: 100%; }
  .fd-pagination-pages { justify-content: center; }
  .fd-pagination-size { justify-content: space-between; }
  .table-wrapper,
  .ds-table-shell { overflow-x: auto !important; }
  .page-actions > a,
  .page-actions > button,
  .ds-toolbar-actions > a,
  .ds-toolbar-actions > button { min-height: 44px; }
}

@media (max-width: 820px) {
  .app-shell { display: block !important; grid-template-columns: minmax(0, 1fr) !important; }
  .app-shell .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(86vw, 340px) !important;
    min-width: 0 !important;
    height: 100dvh !important;
    transform: translateX(-105%) !important;
    z-index: 60 !important;
  }
  .app-shell.mobile-nav-open .sidebar { transform: translateX(0) !important; }
  .main-content { width: 100% !important; max-width: 100% !important; margin: 0 !important; }
}

@media (max-width: 1400px) {
  .tickets-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tickets-enterprise .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Shared containment for narrow viewports and zoomed layouts. */
input, select, textarea, button, .form-control { max-width: 100%; min-width: 0; }
img, video, canvas, svg { max-width: 100%; }
.modal-content, .dialog-content, [role="dialog"] {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}
.page-body a, .page-body code, .page-body pre, .ticket-card-meta { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .fd-pagination-pages { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 4px; }
}

@media (max-width: 1200px) {
  .topbar .utility-pill { display: none !important; }
  .topbar-utilities { width: auto !important; max-width: 100% !important; overflow: hidden !important; }
}

@media (max-width: 700px) {
  .main-content,
  .page-body { width: auto !important; max-width: 100%; min-width: 0; box-sizing: border-box; overflow-x: clip; }
  body .page-body .ds-table-shell,
  body .page-body .table-wrapper {
    width: 100% !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    contain: inline-size;
  }
  .fd-upcoming-table-wrap { width: 100%; max-width: calc(100vw - 24px); min-width: 0; overflow-x: auto !important; }
}
