/* ══════════════════════════════════════════════════════════════
   OnePortal Main Stylesheet — v2.0
   Dark/Light theme with CSS custom properties
   ══════════════════════════════════════════════════════════════ */

/* ── BRAND COLORS (constant across themes) ── */
:root {
  --one-gun-metal:      #15323A;
  --one-lime:           #9BBF2E;
  --one-turquoise:      #3BC4C4;
  --one-mango:          #FF7C24;
  --one-electric:       #BBE84B;
  --one-citron:         #86A025;
  --one-lemon:          #FFEA2C;
  --one-dk-marine:      #14323A;
  --one-bright-marine:  #094C5B;
}

/* ── DARK THEME (default) ── */
:root {
  --logo-text-color:    #FFFFFF;
  --accent-blue:        #3498db;
  --accent-blue-dim:    rgba(52, 152, 219, 0.12);
  --surface-base:       #0f2830;
  --surface-raised:     #1a3d47;
  --surface-high:       #1f4a55;
  --header-bg:          rgba(9, 76, 91, 0.55);
  --sidebar-bg:         transparent;
  --border:             rgba(52, 152, 219, 0.15);
  --border-bright:      rgba(52, 152, 219, 0.35);
  --text-primary:       #e8f4f8;
  --text-secondary:     rgba(232, 244, 248, 0.55);
  --text-muted:         rgba(232, 244, 248, 0.30);
  --body-bg:            #15323A;
  --body-grad-1:        rgba(9,76,91,0.6);
  --body-grad-2:        rgba(52,152,219,0.08);
  --green:              #2ecc8a;
  --green-dim:          rgba(46, 204, 138, 0.12);
  --yellow:             #d4a017;
  --yellow-dim:         rgba(212, 160, 23, 0.12);
  --red:                #e74c5e;
  --red-dim:            rgba(231, 76, 94, 0.12);
  --orange:             #FF7C24;
  --orange-dim:         rgba(255, 124, 36, 0.12);
  --shadow:             rgba(0,0,0,0.3);
  --row-hover:          rgba(52, 152, 219, 0.06);
  --input-bg:           rgba(15, 40, 48, 0.8);
  --radius:             10px;
}

/* ── LIGHT THEME ── */
body.light {
  --logo-text-color:    #15323A;
  --accent-blue:        #1a6fa8;
  --accent-blue-dim:    rgba(26, 111, 168, 0.08);
  --surface-base:       #f0f6f9;
  --surface-raised:     #ffffff;
  --surface-high:       #e8f2f7;
  --header-bg:          rgba(255,255,255,0.92);
  --sidebar-bg:         #f7fbfd;
  --border:             rgba(21, 50, 58, 0.10);
  --border-bright:      rgba(21, 50, 58, 0.22);
  --text-primary:       #0d2830;
  --text-secondary:     rgba(13, 40, 48, 0.65);
  --text-muted:         rgba(13, 40, 48, 0.38);
  --body-bg:            #e4eff4;
  --body-grad-1:        rgba(9,76,91,0.06);
  --body-grad-2:        rgba(52,152,219,0.04);
  --green:              #1a9e64;
  --green-dim:          rgba(26, 158, 100, 0.10);
  --yellow:             #a87200;
  --yellow-dim:         rgba(168, 114, 0, 0.10);
  --red:                #c0283a;
  --red-dim:            rgba(192, 40, 58, 0.08);
  --orange:             #d06000;
  --orange-dim:         rgba(208, 96, 0, 0.10);
  --shadow:             rgba(9,76,91,0.10);
  --row-hover:          rgba(26, 111, 168, 0.05);
  --input-bg:           #ffffff;
}


/* ══════════════════════════════════════════
   GLOBAL
   ══════════════════════════════════════════ */
* { box-sizing: border-box; }

body {
  background: var(--body-bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, var(--body-grad-1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, var(--body-grad-2) 0%, transparent 50%);
  font-family: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-blue);
  filter: brightness(1.15);
}


/* ══════════════════════════════════════════
   APP BAR (top header)
   ══════════════════════════════════════════ */
.app-bar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  flex-shrink: 0;
  transition: background 0.3s ease;
  z-index: 100;
}

.app-bar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-logo {
  display: flex;
  align-items: center;
}

.app-logo svg {
  height: 32px;
  width: auto;
  display: block;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.app-nav-item {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 7px 15px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.app-nav-item:hover {
  color: var(--text-secondary);
  background: var(--accent-blue-dim);
}

.app-nav-item.active {
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
}

.app-nav-item.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.app-user-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.app-user-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-app-logout {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--red-dim);
  border: 1px solid rgba(231, 76, 94, 0.25);
  color: var(--red);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-app-logout:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.btn-app-login {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--green-dim);
  border: 1px solid rgba(46, 204, 138, 0.25);
  color: var(--green);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-app-login:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
}


/* ══════════════════════════════════════════
   THEME TOGGLE
   ══════════════════════════════════════════ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-blue-dim);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.toggle-track {
  width: 28px;
  height: 16px;
  border-radius: 8px;
  background: var(--border-bright);
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

body.light .toggle-track {
  background: var(--accent-blue);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.25s ease;
}

body.light .toggle-thumb {
  transform: translateX(12px);
}


/* ══════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════ */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}


/* ══════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════ */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  overflow-y: auto;
  background: var(--sidebar-bg);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.sb-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}

.sb-group-label:first-child {
  padding-top: 0;
}

.sb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.sb-item:hover {
  background: var(--accent-blue-dim);
  color: var(--text-primary);
}

.sb-item.active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
  font-weight: 500;
}

.sb-badge {
  font-family: 'DM Mono', 'Consolas', monospace;
  font-size: 11px;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.sb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sb-dot.green   { background: var(--green); }
.sb-dot.yellow  { background: var(--yellow); }
.sb-dot.red     { background: var(--red); }
.sb-dot.neutral { background: var(--text-muted); }

.sb-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 20px;
}


/* ══════════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════════ */
.content {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
  overflow-y: auto;
}

.content-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}


/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.app-footer {
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.footer-brand span {
  color: var(--accent-blue);
}

.footer-divider {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--border-bright);
  vertical-align: middle;
}

.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-link {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}

.footer-link:hover { color: var(--accent-blue); }

.footer-version {
  font-family: 'DM Mono', 'Consolas', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — BUTTONS
   ══════════════════════════════════════════ */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent-blue) !important;
  border-color: var(--accent-blue) !important;
  color: white !important;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
  background: var(--surface-raised) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}
.btn-secondary:hover {
  background: var(--surface-high) !important;
  color: var(--text-primary) !important;
}

.btn-success {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: white !important;
}
.btn-success:hover { filter: brightness(1.1); }

.btn-warning {
  background: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: white !important;
}

.btn-danger {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: white !important;
}

.btn-info {
  background: var(--accent-blue-dim) !important;
  border-color: var(--border) !important;
  color: var(--accent-blue) !important;
}

.btn-outline-primary {
  color: var(--accent-blue) !important;
  border-color: var(--accent-blue) !important;
  background: transparent !important;
}
.btn-outline-primary:hover {
  background: var(--accent-blue) !important;
  color: white !important;
}

.btn-outline-secondary {
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
  background: transparent !important;
}
.btn-outline-secondary:hover {
  background: var(--surface-high) !important;
  color: var(--text-primary) !important;
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — CARDS
   ══════════════════════════════════════════ */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
  color: var(--text-primary);
}

.card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 16px var(--shadow);
}

.card-header {
  background: var(--surface-raised) !important;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.card-body {
  color: var(--text-primary);
}

.card-title {
  color: var(--text-primary) !important;
}

.card-text {
  color: var(--text-secondary) !important;
}

/* App Cards (Dashboard) */
.app-card {
  cursor: default;
  border-left: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-bright);
  transition: background 0.2s ease;
}

.app-card:hover {
  transform: translateY(-1px);
  border-left-color: var(--accent-blue);
}

.app-card .app-icon {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-card .app-icon svg {
  width: 22px;
  height: 22px;
}

/* Report Cards */
.report-card {
  border-left: 2px solid transparent;
}

.report-card:hover {
  border-left-color: var(--accent-blue);
}

.report-card .report-icon {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-card .report-icon svg {
  width: 22px;
  height: 22px;
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — TABLES
   ══════════════════════════════════════════ */
.table {
  color: var(--text-primary);
  margin-bottom: 0;
}

.table th {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  background: transparent;
}

.table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: var(--row-hover) !important;
  color: var(--text-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(52, 152, 219, 0.03);
  color: var(--text-primary);
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — FORMS
   ══════════════════════════════════════════ */
.form-control,
.form-select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  transition: border-color 0.15s, background 0.2s;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-blue);
  background: var(--surface-raised);
  box-shadow: 0 0 0 2px var(--accent-blue-dim);
  color: var(--text-primary);
}

.form-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}

.form-check-input:checked {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — BADGES
   ══════════════════════════════════════════ */
.badge {
  font-weight: 500;
  padding: 0.35em 0.7em;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.badge.bg-primary  { background-color: var(--accent-blue) !important; color: white; }
.badge.bg-success  { background-color: var(--green) !important; color: white; }
.badge.bg-info     { background-color: var(--accent-blue-dim) !important; color: var(--accent-blue); }
.badge.bg-warning  { background-color: var(--yellow) !important; color: white; }
.badge.bg-danger   { background-color: var(--red) !important; color: white; }
.badge.bg-secondary { background-color: var(--surface-high) !important; color: var(--text-secondary); }


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — ALERTS
   ══════════════════════════════════════════ */
.alert {
  border-radius: 8px;
  font-size: 13px;
  border-width: 1px;
}

.alert-primary {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.alert-success {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

.alert-warning {
  background: var(--yellow-dim);
  border-color: var(--yellow);
  color: var(--yellow);
}

.alert-danger {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

.alert-info {
  background: var(--accent-blue-dim);
  border-color: var(--border-bright);
  color: var(--accent-blue);
}

.alert .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

body.light .alert .btn-close {
  filter: none;
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — BREADCRUMB
   ══════════════════════════════════════════ */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0.5rem;
}

.breadcrumb-item a {
  color: var(--accent-blue);
}

.breadcrumb-item a:hover {
  color: var(--accent-blue);
  filter: brightness(1.2);
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — MODALS
   ══════════════════════════════════════════ */
.modal-content {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.modal-header {
  border-bottom-color: var(--border);
}

.modal-footer {
  border-top-color: var(--border);
}

.modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

body.light .modal-header .btn-close {
  filter: none;
}


/* ══════════════════════════════════════════
   BOOTSTRAP OVERRIDES — MISC
   ══════════════════════════════════════════ */
.spinner-border {
  color: var(--accent-blue);
}

.text-primary { color: var(--accent-blue) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--green) !important; }
.text-warning { color: var(--yellow) !important; }
.text-danger  { color: var(--red) !important; }

.progress {
  background-color: var(--surface-high);
}

.progress-bar {
  background-color: var(--accent-blue);
}

.dropdown-menu {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
}

.dropdown-item {
  color: var(--text-secondary);
}

.dropdown-item:hover {
  background-color: var(--accent-blue-dim);
  color: var(--text-primary);
}


/* ══════════════════════════════════════════
   TILE CARDS (new dashboard tiles)
   ══════════════════════════════════════════ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tile {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-bright);
  transition: background 0.2s ease;
}

.tile:hover {
  background: var(--surface-high);
  border-color: var(--border-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--shadow);
  color: var(--text-primary);
}

.tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tile-title {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.tile-icon svg,
.tile-icon i {
  width: 20px;
  height: 20px;
}

.tile-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.tile-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

.tile-action {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: var(--accent-blue);
  font-weight: 500;
  letter-spacing: 0.03em;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.tile:hover .tile-action { opacity: 1; }

.tile-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--accent-blue);
  opacity: 0.65;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}
.tile:hover .tile-link { opacity: 1; }


/* ══════════════════════════════════════════
   STATS ROW (dashboard summary)
   ══════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}


/* ══════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════ */
.stat-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-bright);
}

.stat-card.s-green::before  { background: var(--green); }
.stat-card.s-yellow::before { background: var(--yellow); }
.stat-card.s-red::before    { background: var(--red); }
.stat-card.s-blue::before   { background: var(--accent-blue); }

.stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'DM Mono', 'Consolas', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.green  { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.red    { color: var(--red); }

.stat-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}


/* ══════════════════════════════════════════
   HEALTH / STATUS BADGES
   ══════════════════════════════════════════ */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
}

.health-badge.healthy {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(46,204,138,0.25);
}

.health-badge.watch {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(212,160,23,0.25);
}

.health-badge.default {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(231,76,94,0.25);
}

.hb-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.healthy .hb-dot { background: var(--green); }
.watch   .hb-dot { background: var(--yellow); }
.default .hb-dot { background: var(--red); }


/* ══════════════════════════════════════════
   CHART HELPERS
   ══════════════════════════════════════════ */
.chart-container {
  position: relative;
  width: 100%;
}


/* ══════════════════════════════════════════
   REPORT MODULE — SHARED COMPONENTS
   ══════════════════════════════════════════ */

/* ── Report Page Header ── */
.rpt-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.rpt-header .rpt-accent {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  margin-right: 14px;
  flex-shrink: 0;
}

.rpt-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.rpt-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 2px 0 0;
}


/* ── Report Filter Bar ── */
.rpt-filter-bar {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  transition: background 0.2s, border-color 0.2s;
}

.rpt-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rpt-filter-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  margin: 0;
}

.rpt-filter-group select,
.rpt-filter-group input,
.rpt-filter-stacked select,
.rpt-filter-stacked input {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.02em;
  background: var(--surface-raised);
  color: var(--text-primary);
  min-width: 130px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rpt-filter-group select:hover,
.rpt-filter-group input:hover,
.rpt-filter-stacked select:hover,
.rpt-filter-stacked input:hover {
  background: var(--surface-high);
  border-color: var(--border-bright);
}

.rpt-filter-group select:focus,
.rpt-filter-group input:focus,
.rpt-filter-stacked select:focus,
.rpt-filter-stacked input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-dim);
}

.rpt-filter-stacked {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rpt-filter-stacked label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rpt-filter-actions {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}


/* ── Report Action Buttons ── */
.rpt-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.rpt-btn-primary {
  background: var(--accent-blue);
  color: white;
}
.rpt-btn-primary:hover {
  filter: brightness(1.12);
}
.rpt-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.rpt-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.rpt-btn-outline:hover {
  background: var(--surface-high);
  color: var(--text-primary);
  border-color: var(--border-bright);
}

.rpt-btn-brand {
  background: var(--one-bright-marine);
  color: white;
}
.rpt-btn-brand:hover {
  background: var(--one-gun-metal);
}

.rpt-btn-lime {
  background: linear-gradient(135deg, var(--one-lime), var(--one-citron));
  color: white;
}
.rpt-btn-lime:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}


/* ── Report Summary Cards ── */
.rpt-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.rpt-summary-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}

.rpt-summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border-bright);
}

.rpt-summary-card.s-lime::before     { background: var(--one-lime); }
.rpt-summary-card.s-turquoise::before { background: var(--one-turquoise); }
.rpt-summary-card.s-mango::before    { background: var(--one-mango); }
.rpt-summary-card.s-citron::before   { background: var(--one-citron); }
.rpt-summary-card.s-marine::before   { background: var(--one-bright-marine); }
.rpt-summary-card.s-lemon::before    { background: var(--one-lemon); }
.rpt-summary-card.s-blue::before     { background: var(--accent-blue); }
.rpt-summary-card.s-green::before    { background: var(--green); }

.rpt-summary-card .label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.rpt-summary-card .value {
  font-family: 'DM Mono', 'Consolas', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.1;
}

.rpt-summary-card .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-family: 'DM Mono', 'Consolas', monospace;
}


/* ── Report Tables ── */
.rpt-table-container {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  transition: background 0.2s, border-color 0.2s;
}

.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rpt-table th {
  background: var(--surface-high);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.rpt-table th:hover {
  background: var(--row-hover);
  color: var(--text-secondary);
}

.rpt-table th.sorted-asc::after {
  content: ' ▲';
  font-size: 0.6rem;
  color: var(--accent-blue);
}

.rpt-table th.sorted-desc::after {
  content: ' ▼';
  font-size: 0.6rem;
  color: var(--accent-blue);
}

.rpt-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: background 0.12s;
}

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

.rpt-table .file-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.rpt-table .file-link:hover {
  text-decoration: underline;
  filter: brightness(1.15);
}

.rpt-table .money {
  font-family: 'DM Mono', 'Consolas', monospace;
  text-align: right;
}

.rpt-table .text-truncate-custom {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpt-table .clickable {
  cursor: pointer;
  color: var(--accent-blue);
  font-weight: 500;
  transition: color 0.15s;
}

.rpt-table .clickable:hover {
  color: var(--one-lime);
  text-decoration: underline;
}

.rpt-table .zero {
  color: var(--text-muted);
}

.rpt-table .totals-row {
  background: var(--surface-high) !important;
  font-weight: 600;
}

.rpt-table .totals-row td {
  border-top: 2px solid var(--border-bright);
  color: var(--text-primary);
}

/* Dark header variant for activity/detail tables */
.rpt-table-dark th {
  background: var(--one-bright-marine);
  color: rgba(255,255,255,0.9);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.rpt-table-dark th:hover {
  background: var(--one-bright-marine);
  color: white;
}


/* ── Report Status Badges ── */
.rpt-status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.rpt-status-badge.in-process {
  background: rgba(9, 76, 91, 0.15);
  border-color: rgba(9, 76, 91, 0.3);
  color: var(--accent-blue);
}

.rpt-status-badge.rated {
  background: rgba(59, 196, 196, 0.12);
  border-color: rgba(59, 196, 196, 0.3);
  color: var(--one-turquoise);
}

.rpt-status-badge.approved {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.rpt-status-badge.quoted {
  background: rgba(155, 191, 46, 0.12);
  border-color: rgba(155, 191, 46, 0.3);
  color: var(--one-lime);
}

.rpt-status-badge.accepted {
  background: rgba(46, 204, 138, 0.12);
  border-color: rgba(46, 204, 138, 0.3);
  color: var(--green);
}

body.light .rpt-status-badge.in-process {
  background: rgba(9, 76, 91, 0.08);
  border-color: rgba(9, 76, 91, 0.2);
  color: var(--one-bright-marine);
}

body.light .rpt-status-badge.rated {
  color: #2a9e9e;
}

body.light .rpt-status-badge.approved {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #d97706;
}

body.light .rpt-status-badge.quoted {
  color: #6d8f14;
}

body.light .rpt-status-badge.accepted {
  color: var(--green);
}


/* ── Report Days Badges ── */
.rpt-days-badge {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

.rpt-days-badge.critical {
  background: var(--red-dim);
  color: var(--red);
}

.rpt-days-badge.warning {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.rpt-days-badge.normal {
  background: var(--green-dim);
  color: var(--green);
}

.rpt-days-badge.neutral {
  background: var(--surface-high);
  color: var(--text-secondary);
}


/* ── Report Modals ── */
.rpt-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 40, 48, 0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.rpt-modal-overlay.active {
  display: flex;
}

.rpt-modal {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 950px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.rpt-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-high);
}

.rpt-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.rpt-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.rpt-modal-close:hover {
  color: var(--text-primary);
}

.rpt-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.rpt-modal-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface-high);
  border-radius: 8px;
}

.rpt-modal-summary .stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rpt-modal-summary .stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.rpt-modal-summary .stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'DM Mono', 'Consolas', monospace;
}


/* ── Report Loading & Empty States ── */
.rpt-loading {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.rpt-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: rptSpin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes rptSpin {
  to { transform: rotate(360deg); }
}

.rpt-loading h4 {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.rpt-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.rpt-empty h3 {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.85rem;
}

.rpt-empty p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0.5rem auto 0;
}


/* ── Report Level Select ── */
.rpt-level-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.2rem 1.4rem 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-width: 44px;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%236c757d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
}

.rpt-level-select:hover {
  border-color: var(--accent-blue);
  background-color: var(--accent-blue-dim);
}

.rpt-level-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue-dim);
}

.rpt-level-select.saving {
  opacity: 0.5;
  pointer-events: none;
}

.rpt-level-select.save-success {
  border-color: var(--green);
  background-color: var(--green-dim);
}

.rpt-level-select.save-error {
  border-color: var(--red);
  background-color: var(--red-dim);
}


/* ── Report Card Wrapper ── */
.rpt-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}

.rpt-card-header {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rpt-card-header h5 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}


/* ══════════════════════════════════════════
   LIGHT THEME ADJUSTMENTS
   ══════════════════════════════════════════ */
body.light .hb-dot { box-shadow: none; }
body.light .card  { box-shadow: 0 1px 4px var(--shadow); }
body.light .tile  { box-shadow: 0 1px 4px var(--shadow); }
body.light .stat-card { box-shadow: 0 1px 4px var(--shadow); }
body.light .rpt-summary-card { box-shadow: 0 1px 4px var(--shadow); }
body.light .rpt-table-container { box-shadow: 0 1px 4px var(--shadow); }
body.light .rpt-card { box-shadow: 0 1px 4px var(--shadow); }
body.light .rpt-filter-bar { box-shadow: 0 1px 4px var(--shadow); }

body.light .tile:hover {
  box-shadow: 0 6px 20px var(--shadow);
}


/* ══════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════ */
.text-one-lime      { color: var(--one-lime) !important; }
.text-one-turquoise { color: var(--one-turquoise) !important; }
.text-one-mango     { color: var(--one-mango) !important; }
.bg-one-gun-metal   { background-color: var(--one-gun-metal) !important; }
.bg-one-lime        { background-color: var(--one-lime) !important; }
.border-one-lime    { border-color: var(--one-lime) !important; }

.font-mono {
  font-family: 'DM Mono', 'Consolas', monospace;
}

.font-serif {
  font-family: 'DM Serif Display', serif;
}


/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Hamburger button (hidden on desktop, shown on mobile) ── */
.hamburger-btn {
  display: none;          /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.hamburger-btn:hover {
  border-color: var(--border-bright);
}
.hamburger-line {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
/* Animate into X when open */
.hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 768px) {
  .app-bar {
    padding: 0 16px;
  }

  /* Hide inline nav, theme toggle, user info, logout on mobile */
  .app-nav {
    display: none;
    /* Dropdown positioning */
    position: absolute;
    top: 52px;              /* below app-bar */
    right: 16px;
    flex-direction: column;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 8px 24px var(--shadow);
    z-index: 200;
  }
  .app-nav.mobile-open {
    display: flex;
  }
  .app-nav-item {
    padding: 10px 20px;
    border-radius: 0;
    font-size: 13px;
  }
  .app-nav-item:first-child {
    border-radius: 8px 8px 0 0;
  }
  .app-nav-item:last-child {
    border-radius: 0 0 8px 8px;
  }

  .hamburger-btn {
    display: flex;          /* show on mobile */
  }

  .theme-toggle,
  .app-user-info,
  .btn-app-logout {
    display: none;          /* hide to save space */
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 20px 16px;
  }

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

  .app-footer {
    padding: 0 16px;
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
    gap: 8px;
  }

  .footer-right {
    flex-wrap: wrap;
    gap: 12px;
  }
}


/* ══════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════ */
@media print {
  .app-bar, .sidebar, .app-footer, .theme-toggle {
    display: none !important;
  }

  .main-layout {
    display: block;
  }

  .content {
    padding: 0;
    overflow: visible;
  }

  body {
    height: auto;
    overflow: visible;
    background: white;
    color: black;
  }
}

/* ═══════════════════════════════════════
   DOCUMENT TYPE CARDS (shared)
   ═══════════════════════════════════════ */

.doc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.doc-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.doc-type-card:hover {
    background: var(--surface-high);
    border-color: var(--border-bright);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.doc-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.doc-type-info {
    flex: 1;
    min-width: 0;
}

.doc-type-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.doc-type-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}

.doc-version-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
    flex-shrink: 0;
}

.doc-version-badge {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    padding: 2px 6px;
    border-radius: 4px;
}

.doc-version-arrow {
    font-size: 10px;
    color: var(--text-muted);
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.12s;
}

.doc-version-arrow:hover {
    background: var(--surface-high);
    color: var(--text-primary);
}

.doc-revision-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--shadow);
    min-width: 200px;
    z-index: 100;
    padding: 4px 0;
    max-height: 200px;
    overflow-y: auto;
}

.doc-revision-dropdown.open {
    display: block;
}

.doc-revision-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
}

.doc-revision-item:hover {
    background: var(--accent-blue-dim);
    color: var(--text-primary);
}

.doc-revision-item .rev-label {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    color: var(--accent-blue);
}

.doc-revision-item .rev-date {
    color: var(--text-muted);
    font-size: 10px;
}

/* Light mode */
body.light .doc-type-card { box-shadow: 0 1px 3px var(--shadow); }
body.light .doc-type-card:hover { box-shadow: 0 4px 12px var(--shadow); }
body.light .doc-revision-dropdown { box-shadow: 0 4px 16px var(--shadow); }


/* ============================================
   Toast notifications (global)
   See Heuristics.md — "Button Feedback & Async UI Pattern"
   ============================================ */
.op-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 48px));
}
.op-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    background: #1f2937;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-left: 4px solid transparent;
    transform: translateX(20px);
    opacity: 0;
    transition: transform 180ms ease-out, opacity 180ms ease-out;
}
.op-toast.op-toast-visible {
    transform: translateX(0);
    opacity: 1;
}
.op-toast-success { border-left-color: #10b981; }
.op-toast-error   { border-left-color: #ef4444; }
.op-toast-warning { border-left-color: #f59e0b; }
.op-toast-info    { border-left-color: #3b82f6; }
.op-toast-icon {
    font-size: 16px;
    line-height: 1;
    margin-top: 1px;
    flex-shrink: 0;
}
.op-toast-success .op-toast-icon { color: #34d399; }
.op-toast-error   .op-toast-icon { color: #f87171; }
.op-toast-warning .op-toast-icon { color: #fbbf24; }
.op-toast-info    .op-toast-icon { color: #60a5fa; }
.op-toast-body { flex: 1; word-break: break-word; }
.op-toast-close {
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: rgba(255,255,255,0.6);
    padding: 0 2px;
    flex-shrink: 0;
    user-select: none;
}
.op-toast-close:hover { color: #fff; }

body.light .op-toast {
    background: #fff;
    color: #111827;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
body.light .op-toast-close { color: rgba(17,24,39,0.5); }
body.light .op-toast-close:hover { color: #111827; }


/* ============================================
   Async button loading state
   Used with withButtonLoading(btn, label, asyncFn)
   ============================================ */
.op-btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: op-spin 0.7s linear infinite;
}
@keyframes op-spin {
    to { transform: rotate(360deg); }
}
button.is-loading {
    cursor: wait;
    opacity: 0.85;
}
