/* ============================================================
   ETRE-RAM — etre-theme.css  (v8 UI rebuild)
   Single consolidated theme, built on Bootstrap 5.3.8's own
   CSS variable system (--bs-*). Replaces bootstrap-theme.css,
   style.css, themes.css and components.css.
   Palette: deep-teal accent (electromechanical/power identity)
   over a slate sidebar + clean light/dark content area.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.11.0/dist/tabler-icons.min.css');

/* ───────────────────────────────────────────────────────────
   SECTION: Bootstrap variable bridge (from assets/css/bootstrap-theme.css)
   ─────────────────────────────────────────────────────────── */

:root,
[data-bs-theme="light"] {
  --bs-primary:        #008751;
  --bs-primary-rgb:    0, 135, 81;
  --bs-primary-text-emphasis: #006b3f;
  --bs-primary-bg-subtle:     rgba(0, 135, 81, .08);
  --bs-primary-border-subtle: rgba(0, 135, 81, .2);

  --bs-success:        #16a34a;
  --bs-success-rgb:    22, 163, 74;
  --bs-success-bg-subtle:     rgba(22, 163, 74, .1);
  --bs-success-border-subtle: rgba(22, 163, 74, .25);

  --bs-warning:        #d97706;
  --bs-warning-rgb:    217, 119, 6;
  --bs-warning-bg-subtle:     rgba(217, 119, 6, .1);
  --bs-warning-border-subtle: rgba(217, 119, 6, .25);

  --bs-danger:         #dc2626;
  --bs-danger-rgb:     220, 38, 38;
  --bs-danger-bg-subtle:      rgba(220, 38, 38, .08);
  --bs-danger-border-subtle:  rgba(220, 38, 38, .2);

  --bs-info:           #0284c7;
  --bs-info-rgb:       2, 132, 199;
  --bs-info-bg-subtle:        rgba(2, 132, 199, .08);

  --bs-body-bg:        #f8fafc;
  --bs-body-bg-rgb:    248, 250, 252;
  --bs-body-color:     #0f172a;
  --bs-body-color-rgb: 15, 23, 42;
  --bs-secondary-color: #64748b;
  --bs-tertiary-bg:    #ffffff;
  --bs-tertiary-color: #94a3b8;
  --bs-border-color:   rgba(0, 0, 0, .1);
  --bs-border-color-translucent: rgba(0, 0, 0, .12);

  --bs-link-color:     var(--bs-primary);
  --bs-link-hover-color: #006b3f;

  --bs-card-bg:        #ffffff;
  --bs-card-border-color: rgba(0, 0, 0, .07);
  --bs-modal-bg:       #ffffff;
  --bs-modal-header-border-color: rgba(0, 0, 0, .1);
  --bs-navbar-bg:      #ffffff;
  --bs-offcanvas-bg:   #ffffff;
}

[data-bs-theme="dark"] {
  --bs-primary:        #10b981;
  --bs-primary-rgb:    16, 185, 129;
  --bs-primary-text-emphasis: #34d399;
  --bs-primary-bg-subtle:     rgba(16, 185, 129, .18);
  --bs-primary-border-subtle: rgba(16, 185, 129, .3);

  --bs-success:        #22c55e;
  --bs-success-rgb:    34, 197, 94;
  --bs-success-bg-subtle:     rgba(34, 197, 94, .15);
  --bs-success-border-subtle: rgba(34, 197, 94, .3);

  --bs-warning:        #f59e0b;
  --bs-warning-rgb:    245, 158, 11;
  --bs-warning-bg-subtle:     rgba(245, 158, 11, .15);
  --bs-warning-border-subtle: rgba(245, 158, 11, .3);

  --bs-danger:         #ef4444;
  --bs-danger-rgb:     239, 68, 68;
  --bs-danger-bg-subtle:      rgba(239, 68, 68, .15);
  --bs-danger-border-subtle:  rgba(239, 68, 68, .3);

  --bs-info:           #38bdf8;
  --bs-info-rgb:       56, 189, 248;
  --bs-info-bg-subtle:        rgba(56, 189, 248, .15);

  --bs-body-bg:        #0b1320;
  --bs-body-bg-rgb:    11, 19, 32;
  --bs-body-color:     #e8f0f8;
  --bs-body-color-rgb: 232, 240, 248;
  --bs-secondary-color: #64788e;
  --bs-tertiary-bg:    #1a2535;
  --bs-tertiary-color: #344a5e;
  --bs-border-color:   rgba(255, 255, 255, .07);
  --bs-border-color-translucent: rgba(255, 255, 255, .12);

  --bs-link-color:     var(--bs-primary);
  --bs-link-hover-color: #34d399;

  --bs-card-bg:        #1a2535;
  --bs-card-border-color: rgba(255, 255, 255, .07);
  --bs-modal-bg:       #1a2535;
  --bs-modal-header-border-color: rgba(255, 255, 255, .1);
  --bs-navbar-bg:      #0f1923;
  --bs-offcanvas-bg:   #0f1923;
}

/* ── Global tokens shared by both modes ───────────────────── */
:root {
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, sans-serif;
  --bs-border-radius:    .5rem;
  --bs-border-radius-sm: .375rem;
  --bs-border-radius-lg: .75rem;
  --bs-body-font-family: var(--bs-font-sans-serif);
}


body { font-family: var(--bs-font-sans-serif); background: var(--bs-body-bg); color: var(--bs-body-color); }

/* Bootstrap doesn't theme .navbar/.offcanvas backgrounds automatically from
   --bs-body-bg, so we key them off the tokens above explicitly. */
.navbar,
.offcanvas { background-color: var(--bs-navbar-bg) !important; }

/* ───────────────────────────────────────────────────────────
   SECTION: Core design system (from assets/css/style.css)
   ─────────────────────────────────────────────────────────── */
/* ============================================================
   ETRE-EMMA v7.0 — style.css
   Clean enterprise design system
   Dark sidebar + light content, blue accent
   ============================================================ */


/* ── ROOT TOKENS (Dark theme default) ─────────────────────── */
:root {
  /* Backgrounds */
  --bg-app:     #0b1320;
  --bg-sidebar: #0f1923;
  --bg-primary: #1a2535;
  --bg-secondary:#101b2b;
  --bg-elevated: #1e2f45;

  /* Borders */
  --brd:        rgba(255,255,255,0.07);
  --brd-strong: rgba(255,255,255,0.12);

  /* Text */
  --txt:        #e8f0f8;
  --txt-muted:  #64788e;
  --txt-faint:  #344a5e;

  /* Accent */
  --ac:         #10b981;
  --ac-hover:   #059669;
  --ac-subtle:  rgba(16,185,129,0.15);
  --ac-ring:    rgba(16,185,129,0.25);

  /* Semantic */
  --green:      #16a34a;
  --green-bg:   rgba(22,163,74,0.12);
  --green-brd:  rgba(22,163,74,0.3);
  --amber:      #d97706;
  --amber-bg:   rgba(217,119,6,0.12);
  --amber-brd:  rgba(217,119,6,0.3);
  --red:        #dc2626;
  --red-bg:     rgba(220,38,38,0.12);
  --red-brd:    rgba(220,38,38,0.3);
  --purple:     #7c3aed;
  --purple-bg:  rgba(124,58,237,0.12);

  /* Layout */
  --sidebar-w:  220px;
  --topbar-h:   50px;
  --r:          6px;
  --r2:         10px;
  --r3:         14px;

  /* Typography */
  --font:       'Inter', system-ui, sans-serif;
  --mono:       'JetBrains Mono', 'Fira Mono', monospace;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg-app);
  color: var(--txt);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--ac); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
input, select, textarea, button { font-family: var(--font); }
input[type=number]::-webkit-inner-spin-button { opacity: 0.5; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brd-strong); border-radius: 2px; }

/* ── UTILS ─────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.mono    { font-family: var(--mono); }
.sm      { font-size: 12px !important; }
.xs      { font-size: 11px !important; }
.lg      { font-size: 16px !important; }
.mute    { color: var(--txt-muted); }
.ok      { color: var(--green); }
.warn    { color: var(--amber); }
.fail    { color: var(--red); }
.ac      { color: var(--ac); }
.bold    { font-weight: 600; }
.upper   { text-transform: uppercase; letter-spacing: 0.5px; }
.truncate{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.w100    { width: 100%; }
.flex    { display: flex; }
.flex-c  { display: flex; align-items: center; }
.flex-col{ display: flex; flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-end     { justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.gap4  { gap: 4px; }  .gap6  { gap: 6px; }  .gap8  { gap: 8px; }
.gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.gap20 { gap: 20px; }
.mt8   { margin-top: 8px; }   .mt12 { margin-top: 12px; }
.mt16  { margin-top: 16px; }  .mt20 { margin-top: 20px; }
.mt24  { margin-top: 24px; }
.mb8   { margin-bottom: 8px; }  .mb12 { margin-bottom: 12px; }
.mb16  { margin-bottom: 16px; } .mb20 { margin-bottom: 20px; }
.mb32  { margin-bottom: 32px; }

/* ── PAGE LOADER ───────────────────────────────────────────── */
#page-loader {
  position: fixed; inset: 0;
  background: var(--bg-sidebar, #0b1320);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  animation: force-hide-loader 0s 3.5s forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-bs-theme="light"] #page-loader {
  background: #f1f5f9;
}
#page-loader.fading {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
@keyframes force-hide-loader {
  to { opacity: 0; pointer-events: none; visibility: hidden; }
}

.loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 44px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 360px;
  width: 90%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

[data-bs-theme="light"] .loader-card {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.09);
}

.loader-logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.loader-logo {
  max-height: 54px;
  max-width: 72px;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
  animation: loader-pulse 2s ease-in-out infinite;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--ac, #008751);
  border-right-color: rgba(0, 135, 81, 0.35);
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loader-ring-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 135, 81, 0.3);
  animation: spin-reverse 3.5s linear infinite;
}

.loader-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--txt-main, #f8fafc);
  text-transform: uppercase;
  margin-bottom: 12px;
}

[data-bs-theme="light"] .loader-text {
  color: #0f172a;
}

.loader-bar {
  width: 150px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

[data-bs-theme="light"] .loader-bar {
  background: rgba(0, 0, 0, 0.08);
}

.loader-bar-fill {
  position: absolute;
  top: 0; left: -100%; height: 100%; width: 100%;
  background: linear-gradient(90deg, transparent, var(--ac, #008751), #10b981, transparent);
  animation: loader-slide 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-sub {
  font-size: 11px;
  color: var(--txt-muted, #94a3b8);
  letter-spacing: 0.5px;
  font-weight: 500;
}

@keyframes loader-slide {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.06); opacity: 1; filter: drop-shadow(0 6px 16px rgba(0,135,81,0.45)); }
}

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

#page-loader .spin { font-size: 36px; display: block; animation: spin 1s linear infinite; color: var(--ac); }
#page-loader p { font-size: 11px; color: var(--txt-muted); letter-spacing: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOGIN ─────────────────────────────────────────────────── */
#login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 16px;
  background: var(--bg-sidebar);
  position: relative; overflow: hidden;
}
.login-bg-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255,255,255,0.02) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,0.02) 61px);
  opacity: 0.6;
}
.login-bg-grid::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(0,135,81,0.2), transparent 70%);
}
.login-ambient-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: 0.35;
}
.login-ambient-orb.orb-1 {
  width: 320px; height: 320px; top: -100px; left: -80px;
  background: radial-gradient(circle, rgba(0,135,81,0.65), transparent);
}
.login-ambient-orb.orb-2 {
  width: 380px; height: 380px; bottom: -120px; right: -100px;
  background: radial-gradient(circle, rgba(217,119,6,0.45), transparent);
}
.login-card {
  position: relative; z-index: 2;
  background: rgba(26, 37, 53, 0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 44px 38px;
  width: 440px; max-width: 100%;
  box-shadow: 0 30px 60px -12px rgba(0,0,0,0.6), 0 0 1px 1px rgba(255,255,255,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.brand-icon-default { display: none; }
#login-logo-wrap { text-align: center; margin-bottom: 14px; }
.login-logo-img { max-height: 72px; margin: 0 auto; display: block; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.login-brand-header { text-align: center; margin-bottom: 24px; }
.brand-title {
  font-size: 24px; font-weight: 700;
  letter-spacing: 2px; color: var(--txt);
  text-transform: uppercase; text-align: center; line-height: 1.2;
}
.brand-sub {
  font-size: 11px; color: var(--txt-muted);
  text-align: center; margin-top: 6px; letter-spacing: 0.3px; line-height: 1.4;
}
.brand-badge-version {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(0,135,81,0.18); border: 0.5px solid rgba(0,135,81,0.35);
  color: #34d399; font-size: 10px; font-weight: 600;
  margin-top: 10px; letter-spacing: 0.5px;
}
.login-actions-row { display: flex; justify-content: center; margin-top: 16px; }
.btn-login-submit {
  height: 44px; font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #008751; border-color: #008751;
  box-shadow: 0 4px 18px rgba(0,135,81,0.35); transition: all 0.2s ease;
}
.btn-login-submit:hover {
  background: #006b3f; border-color: #006b3f;
  transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,135,81,0.45);
}
.btn-login-submit i { transition: transform 0.2s ease; }
.btn-login-submit:hover i { transform: translateX(4px); }
.login-register-footer {
  text-align: center; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--brd); font-size: 12px; color: var(--txt-muted);
}
.login-register-footer a { color: var(--ac); font-weight: 600; margin-left: 5px; cursor: pointer; text-decoration: none; }
.login-register-footer a:hover { text-decoration: underline; }
.icon-avatar-badge {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--ac-subtle); border: 1px solid var(--ac-ring);
  display: inline-flex; align-items: center; justify-content: center; margin: 0 auto;
}
.link-btn {
  background: none; border: none;
  color: var(--ac); cursor: pointer;
  font-size: 12px; padding: 4px 8px;
  font-family: var(--font); transition: opacity 0.15s; text-decoration: none;
}
.link-btn:hover { opacity: 0.85; text-decoration: underline; }
#login-selfregister-link { text-align: center; margin-top: 14px; font-size: 12px; }
#forgot-msg, #reset-msg {
  margin-bottom: 12px; padding: 10px 14px;
  border-radius: var(--r); font-size: 12px;
}

/* ── SHELL ─────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100vh; }
.sb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 150;
  backdrop-filter: blur(2px);
}
.sb-overlay.open { display: block; }

/* ── SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-sidebar);
}
.sidebar .offcanvas-md {
  background: var(--bg-sidebar);
}
@media (min-width: 768px) {
  .sidebar .offcanvas-md {
    display: flex;
    flex-direction: column;
  }
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px;
  border-bottom: 0.5px solid var(--brd);
  flex-shrink: 0;
}
.sb-logo-wrap {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid var(--brd, rgba(255,255,255,0.12));
  border-radius: var(--r, 8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: var(--ac);
  overflow: hidden; padding: 3px;
  transition: all 0.2s ease;
}
.sb-logo-wrap img,
.login-logo-img,
.tb-logo-img,
#page-loader img,
.logo-preview-box img {
  object-fit: contain;
  /* Preserve exact logo brand colors without distortion or hue shifts */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.22));
  transition: filter 0.2s ease, transform 0.2s ease;
}
.sb-logo-wrap img { width: 100%; height: 100%; border-radius: 0; background: transparent; }
.sb-title { font-size: 13px; font-weight: 600; color: var(--txt); letter-spacing: 0.5px; }
.sb-ver   { font-size: 9px; color: var(--txt-faint); margin-top: 1px; }

.sb-user {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--brd);
  cursor: pointer; transition: background 0.15s;
}
.sb-user:hover { background: rgba(255,255,255,0.03); }
.sb-uname { font-size: 12px; font-weight: 500; color: var(--txt); }
.sb-urole {
  font-size: 9px; color: var(--ac);
  background: rgba(14,124,134,0.15);
  padding: 1px 7px; border-radius: 10px;
  margin-top: 2px; display: inline-block;
  font-weight: 500; letter-spacing: 0.3px;
}
.notif-bell {
  margin-left: auto; font-size: 16px;
  position: relative; cursor: pointer;
  flex-shrink: 0; color: var(--txt-muted);
  padding: 2px;
}
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 8px; font-weight: 600;
  padding: 1px 4px; border-radius: 8px;
  min-width: 14px; text-align: center; line-height: 1.5;
}

.sb-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-sec {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; color: var(--txt-faint);
  text-transform: uppercase;
  padding: 12px 10px 4px; margin-top: 6px; opacity: 0.75;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--txt-muted); transition: all 0.15s ease-in-out;
  margin-bottom: 2px; border: none;
  background: none; width: 100%;
  text-align: left; white-space: nowrap;
  position: relative;
  text-decoration: none !important;
}
.nav-item .ni {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
  background: transparent !important;
  color: var(--txt-muted);
  border: none !important;
  box-shadow: none !important;
  transition: all 0.15s ease-in-out;
}
.nav-item:hover {
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
  border-color: transparent;
  transform: none;
}
.nav-item:hover .ni {
  color: #0d6efd;
  transform: scale(1.05);
}
.nav-item.active {
  background: #0d6efd !important;
  color: #ffffff !important;
  font-weight: 500;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.35);
}
.nav-item.active .ni,
.nav-item.active .ni i,
.nav-item.active .nav-label {
  background: transparent !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}
.nav-label { font-size: 14px; letter-spacing: 0.1px; }
.nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3);
}
.nav-badge.blue { background: #0d6efd; color: #fff; box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3); }
.online-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); display: inline-block;
  animation: live-pulse 2.5s infinite; flex-shrink: 0;
}
@keyframes live-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.live-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--green);
  animation: live-pulse 2.5s infinite; flex-shrink: 0;
}
.sb-footer { padding: 12px; border-top: 1px solid var(--brd); flex-shrink: 0; }
.sb-user-area {
  cursor: pointer;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--brd, rgba(255, 255, 255, 0.08));
  transition: all 0.2s ease;
  width: 100%;
}
.sb-user-area:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brd-strong, rgba(255, 255, 255, 0.2));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── AVATAR ─────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 600; flex-shrink: 0; overflow: hidden;
  background: #1e3a5f; color: #8FE0E6; font-size: 11px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-preview-lg {
  width: 72px; height: 72px; border-radius: 50%;
  border: 0.5px solid var(--brd-strong);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; flex-shrink: 0; overflow: hidden;
  color: #8FE0E6;
}
.avatar-preview-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.logo-preview-box {
  width: 88px; height: 88px; border-radius: var(--r2);
  border: 0.5px dashed var(--brd-strong);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden; flex-shrink: 0;
}
.logo-preview-box img { width: 100%; height: 100%; object-fit: contain; }

/* ── MAIN AREA ─────────────────────────────────────────────── */
#sidebar { --bs-offcanvas-width: 220px; }
@media (min-width: 768px) {
  .sidebar .offcanvas-md {
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    border-right: 0.5px solid var(--brd);
  }
}
.topbar {
  position: sticky; top: 0;
  min-height: 56px;
  height: auto;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--brd);
  padding: 8px 16px;
  z-index: 1000; flex-shrink: 0;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.hamburger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: transparent; border: 1px solid var(--brd-strong);
  color: var(--txt); border-radius: var(--r);
  transition: all 0.15s ease; cursor: pointer;
  flex-shrink: 0;
}
.hamburger:hover, .hamburger[aria-expanded="true"] {
  background: var(--ac-subtle); border-color: var(--ac); color: var(--ac);
}
#topbarNav {
  max-height: calc(85vh - 60px);
  overflow-y: auto;
}
.max-vh-60 {
  max-height: 55vh;
}
.tb-title-group {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex-shrink: 1;
}
.tb-title {
  font-size: 15px; font-weight: 600; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.2px;
  max-width: 100%; min-width: 0;
}
.live-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 12px;
  background: rgba(34,197,94,0.1); border: 0.5px solid rgba(34,197,94,0.25);
  color: var(--bs-success); font-size: 10px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
}
.tb-date { font-size: 11px; color: var(--txt-muted); white-space: nowrap; font-weight: 500; }
.tb-icon-btn {
  background: transparent;
  border: 0.5px solid var(--brd-strong);
  color: var(--txt-muted); font-size: 14px;
  cursor: pointer; padding: 6px 12px;
  border-radius: 8px; transition: all 0.15s ease;
  white-space: nowrap; display: flex; align-items: center; gap: 5px;
  flex-shrink: 0;
}
.tb-icon-btn:hover { border-color: var(--ac); color: var(--txt); background: rgba(255,255,255,0.03); }

/* Responsive Topbar Tweaks */
@media (max-width: 768px) {
  .topbar { padding: 6px 12px; min-height: 52px; }
  .tb-title { font-size: 13.5px; max-width: 160px; }
  .hamburger { width: 34px; height: 34px; }
  .tb-icon-btn { padding: 5px 8px; font-size: 13px; }
}
@media (max-width: 480px) {
  .topbar { padding: 6px 8px; }
  .tb-title { font-size: 12.5px; max-width: 120px; }
  .tb-brand-logo { height: 28px !important; padding: 2px 4px !important; }
  .tb-logo-img { height: 18px !important; }
}

.content { padding: 18px; overflow-x: hidden; min-width: 0; }
.panel { display: none; }
.panel.active { display: block; }

/* ── FORMS ─────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 10px; font-weight: 500;
  letter-spacing: 0.8px; color: var(--txt-muted);
  text-transform: uppercase; margin-bottom: 5px;
}
.inp {
  width: 100%; padding: 8px 11px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--brd-strong);
  border-radius: var(--r); color: var(--txt);
  font-size: 13px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.inp:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-ring); }
.inp::placeholder { color: var(--txt-faint); }
.inp option { background: var(--bg-elevated); color: var(--txt); }
textarea.inp { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.err-box {
  background: var(--red-bg); border: 0.5px solid var(--red-brd);
  color: var(--red); padding: 10px 14px;
  border-radius: var(--r); font-size: 12px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.info-box {
  background: var(--ac-subtle); border: 0.5px solid var(--ac-ring);
  color: #8FE0E6; padding: 10px 14px;
  border-radius: var(--r); font-size: 12px; margin-bottom: 14px;
}
#forgot-msg.info-box, #reset-msg.info-box {
  background: var(--green-bg); border-color: var(--green-brd); color: var(--txt);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r);
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: none; letter-spacing: 0.2px;
  transition: all 0.15s; white-space: nowrap;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--ac); color: #fff;
  border: none;
}
.btn-primary:hover { background: var(--ac-hover); box-shadow: 0 4px 14px rgba(14,124,134,0.3); }
.btn-success  { background: var(--green-bg); color: var(--green); border: 0.5px solid var(--green-brd); }
.btn-success:hover  { background: rgba(22,163,74,0.2); }
.btn-ghost    { background: transparent; border: 0.5px solid var(--brd-strong); color: var(--txt-muted); }
.btn-ghost:hover { border-color: var(--ac); color: var(--txt); }
.btn-danger   { background: var(--red-bg); border: 0.5px solid var(--red-brd); color: var(--red); }
.btn-danger:hover { background: rgba(220,38,38,0.22); }
.btn-warn     { background: var(--amber-bg); border: 0.5px solid var(--amber-brd); color: var(--amber); }
.btn-warn:hover { background: rgba(217,119,6,0.22); }
.btn-emergency {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff; border: none;
  animation: emrg-pulse 2s infinite;
}
@keyframes emrg-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
.btn-full  { width: 100%; justify-content: center; }
.btn-sm    { padding: 5px 11px; font-size: 11px; }
.btn-xs    { padding: 3px 8px; font-size: 10px; border-radius: 5px; }
.btn-icon  { padding: 6px 9px; font-size: 15px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; animation: none; }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-primary);
  border: 0.5px solid var(--brd);
  border-radius: var(--r2); overflow: hidden; margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }
.card-hd {
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--brd);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 500; color: var(--txt);
  flex-wrap: wrap; gap: 8px; min-height: 44px;
}
.card-body { padding: 16px; }
.sticky-hd { position: sticky; top: 0; background: var(--bg-primary); z-index: 5; }

/* ── CHIPS ─────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.2px; white-space: nowrap;
}
.chip-blue   { background: var(--ac-subtle);    color: #8FE0E6; }
.chip-green  { background: var(--green-bg);     color: #4ade80; }
.chip-amber  { background: var(--amber-bg);     color: #fbbf24; }
.chip-red    { background: var(--red-bg);       color: #f87171; }
.chip-grey   { background: rgba(100,120,142,0.15); color: var(--txt-muted); }
.chip-purple { background: var(--purple-bg);    color: #a78bfa; }

/* ── STAT ROW ──────────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
@media (max-width: 576px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
/* ── ENTRANCE ANIMATIONS FOR SUMMARY STAT CARDS ─────────────── */
@keyframes statCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes statPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.sc-pop {
  animation: statPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--brd);
  border-radius: var(--r2); padding: 14px 12px;
  text-align: center; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease; cursor: default;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  animation: statCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Stagger top bento stat cards */
.stat-row .stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-row .stat-card:nth-child(2) { animation-delay: 0.07s; }
.stat-row .stat-card:nth-child(3) { animation-delay: 0.11s; }
.stat-row .stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-row .stat-card:nth-child(5) { animation-delay: 0.19s; }
.stat-row .stat-card:nth-child(6) { animation-delay: 0.23s; }
.stat-row .stat-card:nth-child(7) { animation-delay: 0.27s; }
.stat-row .stat-card:nth-child(8) { animation-delay: 0.31s; }

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: transparent; transition: background 0.2s ease;
}
.stat-card:hover { border-color: var(--brd-strong); transform: translateY(-4px); box-shadow: 0 10px 24px -4px rgba(0,0,0,0.25); }
.stat-card:hover::before { background: var(--ac); }
.stat-card[onclick] { cursor: pointer; }
.stat-card[onclick]:hover { border-color: rgba(14,124,134,0.4); }
.sc-icon {
  font-size: 18px; opacity: 0.8; display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px; color: var(--txt-muted);
  width: auto !important; height: auto !important;
  border-radius: 0 !important; background: transparent !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.stat-card:hover .sc-icon { transform: scale(1.1); color: var(--ac); }
.sc-val { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--txt); font-family: var(--font); }
.sc-lbl { font-size: 11px; font-weight: 500; color: var(--txt-muted); letter-spacing: 0.2px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ── MAINTENANCE DASHBOARD RESPONSIVE CSS GRID ─────────────── */
.maint-grid-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.maint-grid-col-12 { grid-column: span 12; }
.maint-grid-col-8  { grid-column: span 8; }
.maint-grid-col-6  { grid-column: span 6; }
.maint-grid-col-4  { grid-column: span 4; }

.chart-container-responsive {
  position: relative;
  height: 300px;
  width: 100%;
}

@media (max-width: 576px) {
  .chart-container-responsive {
    height: 220px !important;
  }
}

@media (max-width: 992px) {
  .maint-grid-col-8, .maint-grid-col-6, .maint-grid-col-4 {
    grid-column: span 12;
  }
}

/* ── MAINTENANCE SUMMARY COMPONENT CARDS ─────────────────────── */
#maint-summary-card {
  animation: statCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.maint-card {
  background: var(--bg-primary);
  border: 1px solid var(--brd);
  border-radius: var(--r2);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  animation: statCardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  min-height: 76px;
}

#maint-stat-cards .col-6:nth-child(1) .maint-card { animation-delay: 0.20s; }
#maint-stat-cards .col-6:nth-child(2) .maint-card { animation-delay: 0.26s; }
#maint-stat-cards .col-6:nth-child(3) .maint-card { animation-delay: 0.32s; }
#maint-stat-cards .col-6:nth-child(4) .maint-card { animation-delay: 0.38s; }

.maint-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: transparent; transition: background 0.2s ease;
}
.maint-card-pending::before { background: var(--bs-warning, #f59e0b); }
.maint-card-inprogress::before { background: var(--bs-info, #0284c7); }
.maint-card-completed::before { background: var(--bs-success, #16a34a); }
.maint-card-total::before { background: var(--ac, #008751); }

.maint-card:hover {
  transform: translateY(-3px);
  border-color: var(--brd-strong);
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}
.maint-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.maint-card:hover .maint-card-icon { transform: scale(1.12); }
.maint-card-pending .maint-card-icon { background: rgba(245,158,11,0.12); }
.maint-card-inprogress .maint-card-icon { background: rgba(2,132,199,0.12); }
.maint-card-completed .maint-card-icon { background: rgba(34,197,94,0.12); }
.maint-card-total .maint-card-icon { background: var(--ac-subtle, rgba(0,135,81,0.12)); }

.maint-card-body { min-width: 0; flex: 1; }
.maint-val { font-size: 22px; font-weight: 700; line-height: 1.1; margin-bottom: 2px; }
.maint-label { font-size: 11.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maint-sub { font-size: 10px; color: var(--txt-muted); margin-top: 2px; }

/* ── TABLE & FIELD PERSONNEL MOBILE DATA ACCESSIBILITY ───────── */
.tbl-wrap, .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r2);
  position: relative;
  box-shadow: inset -12px 0 12px -10px rgba(0,0,0,0.18);
  scrollbar-width: thin;
  scrollbar-color: var(--ac, #008751) transparent;
}
.tbl-wrap::-webkit-scrollbar, .table-responsive::-webkit-scrollbar {
  height: 6px;
}
.tbl-wrap::-webkit-scrollbar-thumb, .table-responsive::-webkit-scrollbar-thumb {
  background: var(--ac, #008751);
  border-radius: 3px;
}
.tbl { width: 100%; border-collapse: collapse; min-width: 480px; }
.tbl th {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--txt-muted);
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--brd); white-space: nowrap;
  background: var(--bg-secondary);
  position: sticky; top: 0; z-index: 2;
}
.tbl td {
  padding: 10px 12px; font-size: 12px;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: rgba(255,255,255,0.03); }
.inactive-row td { opacity: 0.45; }

/* ── FILTER BAR ────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 6px; margin-bottom: 14px;
  flex-wrap: wrap; align-items: center;
}
.flt-btn {
  padding: 5px 12px;
  background: var(--bg-primary); border: 0.5px solid var(--brd-strong);
  border-radius: var(--r); color: var(--txt-muted);
  font-family: var(--font); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.flt-btn:hover { border-color: var(--ac); color: var(--txt); }
.flt-btn.active { background: var(--ac-subtle); border-color: var(--ac); color: #8FE0E6; }
.search-inp {
  padding: 6px 11px;
  background: var(--bg-primary); border: 0.5px solid var(--brd-strong);
  border-radius: var(--r); color: var(--txt);
  font-family: var(--font); font-size: 12px; outline: none;
  flex: 1; min-width: 120px; max-width: 220px;
}
.search-inp:focus { border-color: var(--ac); }
.search-inp::placeholder { color: var(--txt-faint); }

/* ── CHECKLIST ─────────────────────────────────────────────── */
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cat-tab {
  padding: 6px 12px;
  background: var(--bg-primary); border: 0.5px solid var(--brd-strong);
  border-radius: var(--r); color: var(--txt-muted);
  font-family: var(--font); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.cat-tab:hover { border-color: var(--ac); color: var(--txt); }
.cat-tab.active { background: var(--ac-subtle); border-color: var(--ac); color: #8FE0E6; }
.cat-prog { font-size: 10px; margin-left: 4px; opacity: 0.6; }

.cl-list { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.cl-item {
  background: var(--bg-elevated);
  border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 10px 12px;
  transition: border-color 0.15s;
}
.cl-item:hover { border-color: var(--brd-strong); }
.cl-item.st-OK   { border-left: 2px solid var(--green); }
.cl-item.st-WARN { border-left: 2px solid var(--amber); }
.cl-item.st-FAIL { border-left: 2px solid var(--red); }
.cl-item.st-NA   { border-left: 2px solid var(--txt-faint); }
.cl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.cl-info { display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 0; }
.cl-label { font-size: 12px; font-weight: 500; line-height: 1.4; }
.cl-id { color: var(--txt-muted); font-size: 10px; font-family: var(--mono); }
.status-btns { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.sbtn {
  padding: 4px 8px; border-radius: 4px;
  border: 0.5px solid var(--brd-strong);
  background: var(--bg-secondary); color: var(--txt-muted);
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.sbtn:hover { border-color: var(--ac); color: var(--txt); }
.sbtn.sel { border-color: transparent; transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.note-inp {
  margin-top: 6px; padding: 6px 10px;
  background: var(--bg-secondary); border: 0.5px solid var(--brd-strong);
  border-radius: 4px; color: var(--txt);
  font-family: var(--font); font-size: 12px; width: 100%; outline: none;
}
.note-inp:focus { border-color: var(--ac); }
.prog-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 12px; flex-wrap: wrap;
}
.prog-label { font-size: 11px; color: var(--txt-muted); white-space: nowrap; }
.prog-track { flex: 1; height: 4px; background: var(--brd); border-radius: 2px; overflow: hidden; min-width: 60px; }
.prog-fill  { height: 100%; border-radius: 2px; transition: width 0.4s, background 0.4s; }

/* ── EMERGENCY ─────────────────────────────────────────────── */
.emergency-toggle {
  background: var(--red-bg); border: 0.5px solid var(--red-brd);
  border-radius: var(--r); padding: 12px 14px;
}
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; font-weight: 500; }
.toggle-cb { display: none; }
.toggle-sw {
  width: 38px; height: 20px; background: var(--bg-elevated);
  border-radius: 10px; position: relative; transition: background 0.2s; flex-shrink: 0;
  border: 0.5px solid var(--brd-strong);
}
.toggle-sw::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; background: #fff;
  border-radius: 50%; transition: transform 0.2s;
}
.toggle-cb:checked + .toggle-sw { background: var(--red); border-color: var(--red); }
.toggle-cb:checked + .toggle-sw::after { transform: translateX(18px); }
.toggle-txt { color: var(--red); }
.emergency-banner {
  background: var(--red-bg); border: 0.5px solid var(--red-brd);
  border-radius: var(--r); padding: 11px 14px;
  color: var(--red); font-weight: 500; font-size: 12px;
}

/* ── MEDIA UPLOAD ──────────────────────────────────────────── */
.media-upload-area {
  border: 0.5px dashed var(--brd-strong);
  border-radius: var(--r); padding: 20px;
  text-align: center; transition: border-color 0.15s; cursor: pointer;
}
.media-upload-area:hover, .media-upload-area.drag-over { border-color: var(--ac); }
.media-drop-inner { font-size: 13px; color: var(--txt-muted); }
.media-hint { font-size: 11px; color: var(--txt-faint); margin-top: 5px; }
.file-pick-btn { color: var(--ac); cursor: pointer; font-weight: 500; }
.media-preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.media-thumb {
  position: relative; width: 80px; height: 80px;
  border-radius: var(--r); overflow: hidden; border: 0.5px solid var(--brd);
}
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb-remove {
  position: absolute; top: 3px; right: 3px;
  background: rgba(0,0,0,0.7); color: #fff; border: none;
  border-radius: 50%; width: 18px; height: 18px;
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.media-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.media-item { border-radius: var(--r); overflow: hidden; border: 0.5px solid var(--brd); cursor: pointer; }
.media-item img   { width: 100px; height: 80px; object-fit: cover; display: block; }
.media-item video { width: 160px; height: 90px; display: block; }
.file-input-label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: var(--bg-elevated); border: 0.5px dashed var(--brd-strong);
  border-radius: var(--r); cursor: pointer;
  font-size: 12px; color: var(--txt-muted); transition: all 0.15s;
}
.file-input-label:hover { border-color: var(--ac); color: var(--txt); }

/* ── MODAL ─────────────────────────────────────────────────── */
/* NOTE: the outer wrapper is now Bootstrap's own .modal (fixed, full-screen,
   display managed by bootstrap.js) — never put box/sizing styles on .modal
   itself here, or it breaks Bootstrap's positioning. Box styling belongs on
   .modal-content; width belongs on .modal-dialog. */
.modal-dialog { width: 620px; max-width: calc(100% - 32px); margin: 1.75rem auto; }
.modal-content {
  background: var(--bg-primary);
  border: 0.5px solid var(--brd-strong);
  border-radius: var(--r3);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
}
.modal-dialog.modal-sm { width: 420px; }
.modal-dialog.modal-lg { width: 780px; }
.modal-hd {
  padding: 14px 18px; border-bottom: 0.5px solid var(--brd);
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.modal-title { font-size: 14px; font-weight: 500; color: var(--txt); }
.modal-sub { font-size: 11px; color: var(--txt-muted); margin-top: 2px; }
.modal-body { padding: 18px; }
.modal-footer {
  padding: 12px 18px; border-top: 0.5px solid var(--brd);
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.x-btn {
  background: none; border: none; color: var(--txt-muted);
  font-size: 20px; cursor: pointer; line-height: 1;
  padding: 2px; flex-shrink: 0; margin-left: auto;
  transition: color 0.15s;
}
.x-btn:hover { color: var(--txt); }

/* ── REPORT DETAIL ─────────────────────────────────────────── */
.rep-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.meta-lbl { font-size: 9px; font-weight: 500; letter-spacing: 1px; color: var(--txt-muted); text-transform: uppercase; margin-bottom: 2px; }
.meta-val { font-size: 12px; font-weight: 500; color: var(--txt); }
.rep-pills { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pill { flex: 1; min-width: 55px; text-align: center; padding: 10px 6px; background: var(--bg-elevated); border-radius: var(--r); }
.pill-num { font-size: 20px; font-weight: 600; line-height: 1; color: var(--txt); }
.pill-lbl { font-size: 9px; color: var(--txt-muted); letter-spacing: 0.8px; text-transform: uppercase; margin-top: 3px; }
.hdiv { border: none; border-top: 0.5px solid var(--brd); margin: 14px 0; }
.rep-cat-hd { font-size: 10px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; padding-bottom: 5px; border-bottom: 0.5px solid var(--brd); color: var(--txt-muted); }
.rep-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--bg-elevated); border-radius: 5px; margin-bottom: 3px; font-size: 12px; flex-wrap: wrap; }
.rep-item-id { width: 24px; flex-shrink: 0; font-size: 10px; font-family: var(--mono); color: var(--txt-muted); }
.rep-item-label { flex: 1; font-weight: 500; min-width: 100px; }
.rep-item-note { font-size: 11px; color: var(--txt-muted); font-style: italic; }
.rep-item-status { font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 3px; flex-shrink: 0; }
.rep-notes-txt { font-size: 12px; line-height: 1.7; }

/* ── SPARE PARTS ───────────────────────────────────────────── */
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 12px; }
.part-card {
  background: var(--bg-primary); border: 0.5px solid var(--brd);
  border-radius: var(--r2); padding: 14px;
  transition: all 0.15s;
}
.part-card:hover { border-color: var(--brd-strong); transform: translateY(-1px); }
.part-card.low-stock     { border-color: var(--red-brd);   background: rgba(220,38,38,0.03); }
.part-card.warning-stock { border-color: var(--amber-brd); }
.part-name  { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.part-code  { font-family: var(--mono); font-size: 10px; color: var(--ac); margin-bottom: 7px; }
.part-qty   { font-size: 22px; font-weight: 600; color: var(--txt); }
.part-unit  { font-size: 11px; color: var(--txt-muted); }
.part-meta  { font-size: 11px; color: var(--txt-muted); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.stock-bar  { height: 3px; background: var(--bg-elevated); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.stock-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }

/* ── EMERGENCY CARDS ───────────────────────────────────────── */
.emrg-card {
  background: var(--bg-primary); border: 0.5px solid var(--brd);
  border-radius: var(--r2); padding: 14px; margin-bottom: 10px;
  transition: border-color 0.15s;
}
.emrg-card.critical { border-left: 3px solid var(--red); }
.emrg-card.high     { border-left: 3px solid #f97316; }
.emrg-card.medium   { border-left: 3px solid var(--amber); }
.emrg-card.low      { border-left: 3px solid var(--green); }
.emrg-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.emrg-title  { font-size: 13px; font-weight: 500; }
.emrg-meta   { font-size: 11px; color: var(--txt-muted); margin-top: 4px; }
.emrg-desc   { font-size: 12px; margin-top: 8px; color: var(--txt); opacity: 0.8; line-height: 1.6; }

/* ── ISSUE ROWS ────────────────────────────────────────────── */
.issue-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-bottom: 0.5px solid var(--brd);
  cursor: pointer; transition: background 0.12s;
}
.issue-row:last-child { border-bottom: none; }
.issue-row:hover { background: rgba(255,255,255,0.02); }
.issue-row.emergency-row { background: rgba(220,38,38,0.04); }
.issue-info  { flex: 1; min-width: 0; }
.issue-date  { font-size: 10px; color: var(--txt-muted); margin-bottom: 3px; }
.issue-tags  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.issue-tag   { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.issue-tag.r { background: var(--red-bg);   color: var(--red); }
.issue-tag.y { background: var(--amber-bg); color: var(--amber); }
.issue-tag.e { background: var(--red);      color: #fff; animation: emrg-pulse 2s infinite; }

/* ── SECURITY / SESSIONS ───────────────────────────────────── */
.online-card {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.device-card {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 11px 13px;
  display: flex; align-items: center; gap: 11px; margin-bottom: 7px;
}
.device-card.current { border-color: rgba(14,124,134,0.4); }
.device-icon   { font-size: 22px; width: 30px; text-align: center; flex-shrink: 0; }
.device-info   { flex: 1; min-width: 0; }
.device-name   { font-size: 12px; font-weight: 500; }
.device-meta   { font-size: 10px; color: var(--txt-muted); margin-top: 2px; font-family: var(--mono); }
.device-current{ font-size: 9px; color: var(--ac); font-weight: 500; letter-spacing: 0.5px; margin-top: 2px; }
.log-row       { display: flex; align-items: flex-start; gap: 9px; padding: 8px 13px; border-bottom: 0.5px solid rgba(255,255,255,0.04); font-size: 12px; }
.log-dot       { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.log-dot.success { background: var(--green); }
.log-dot.failed  { background: var(--red); }
.log-dot.warning { background: var(--amber); }
.log-body   { flex: 1; min-width: 0; }
.log-action { font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.log-detail { color: var(--txt-muted); margin-top: 1px; font-size: 10px; }
.log-time   { font-family: var(--mono); color: var(--txt-muted); font-size: 10px; flex-shrink: 0; white-space: nowrap; }

/* ── GENERATOR ─────────────────────────────────────────────── */
.gen-status-section {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 13px 14px; margin-bottom: 12px;
}
#gen-log-card { border-color: rgba(14,124,134,0.3); }

/* ── NOTIFICATIONS ─────────────────────────────────────────── */
.notif-item {
  display: flex; gap: 10px; padding: 11px 14px;
  border-bottom: 0.5px solid var(--brd);
  cursor: pointer; transition: background 0.12s;
}
.notif-item:hover   { background: rgba(255,255,255,0.02); }
.notif-item.unread  { background: rgba(14,124,134,0.05); }
.notif-dot          { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.notif-dot.info      { background: var(--ac); }
.notif-dot.warning   { background: var(--amber); }
.notif-dot.danger, .notif-dot.emergency { background: var(--red); }
.notif-dot.success   { background: var(--green); }
.notif-body  { flex: 1; min-width: 0; }
.notif-title { font-size: 12px; font-weight: 500; }
.notif-msg   { font-size: 11px; color: var(--txt-muted); margin-top: 2px; }
.notif-time  { font-size: 10px; color: var(--txt-muted); font-family: var(--mono); flex-shrink: 0; white-space: nowrap; }

/* ── THEMES SETTINGS ───────────────────────────────────────── */
.theme-toggle-wrap { display: flex; gap: 10px; }
.theme-toggle-btn {
  flex: 1; padding: 11px; border-radius: var(--r);
  border: 0.5px solid var(--brd-strong); background: var(--bg-elevated);
  color: var(--txt); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all 0.15s; font-family: var(--font);
}
.theme-toggle-btn.active { border-color: var(--ac); background: var(--ac-subtle); color: #8FE0E6; }
.theme-toggle-btn:hover  { border-color: var(--ac); }
.theme-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-swatch {
  width: 48px; height: 48px; border-radius: var(--r);
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; position: relative; overflow: hidden;
}
.theme-swatch:hover  { transform: scale(1.08); }
.theme-swatch.active { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.25); }
.theme-swatch-name   { font-size: 9px; text-align: center; margin-top: 3px; color: var(--txt-muted); }
.theme-item { display: flex; flex-direction: column; align-items: center; }

/* ── CHECKLIST MANAGER ─────────────────────────────────────── */
.cl-mgr-item {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 9px 12px;
  display: flex; align-items: center; gap: 9px; margin-bottom: 6px;
  transition: border-color 0.15s;
}
.cl-mgr-item:hover   { border-color: var(--brd-strong); }
.cl-mgr-item.disabled{ opacity: 0.4; }
.drag-handle { color: var(--txt-faint); cursor: grab; font-size: 14px; flex-shrink: 0; }
.cl-mgr-info { flex: 1; min-width: 0; }
.cl-mgr-label{ font-size: 12px; font-weight: 500; }
.cl-mgr-meta { font-size: 10px; color: var(--txt-muted); margin-top: 1px; font-family: var(--mono); }
.cl-mgr-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── ELPA MODAL ─────────────────────────────────────────────── */
.elpa-phone-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 9px 13px; margin-bottom: 7px;
}
.elpa-phone-num { font-size: 14px; font-weight: 600; color: var(--ac); font-family: var(--mono); }

/* ── FUEL CONFIRM ───────────────────────────────────────────── */
.fc-record { background: var(--bg-elevated); border: 0.5px solid var(--brd); border-radius: var(--r); padding: 11px; margin-bottom: 8px; }
.fc-grid { display: grid; grid-template-columns: 110px 1fr; gap: 3px 8px; font-size: 11px; margin-top: 5px; }

/* ── DEPT PERMISSIONS ───────────────────────────────────────── */
.dept-perm-section { background: var(--bg-elevated); border: 0.5px solid var(--brd); border-radius: var(--r); padding: 11px; margin-bottom: 8px; }
.dept-perm-header  { margin-bottom: 7px; }
.dept-perm-name    { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--ac); }
.dept-role-row     { display: flex; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 0.5px solid var(--brd); flex-wrap: wrap; }
.dept-role-row:last-child { border-bottom: none; }
.perm-cb { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--txt-muted); cursor: pointer; user-select: none; }
.perm-cb input { cursor: pointer; accent-color: var(--ac); }

/* ── INLINE SQL ─────────────────────────────────────────────── */
#inline-sql-wrap textarea { font-family: var(--mono); font-size: 12px; }
#inline-sql-result pre { background: var(--bg-elevated); border: 0.5px solid var(--brd); padding: 10px; border-radius: var(--r); font-size: 11px; overflow: auto; max-height: 200px; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state  { text-align: center; padding: 48px 20px; color: var(--txt-muted); }
.empty-state .ei { font-size: 40px; opacity: 0.3; display: block; margin-bottom: 10px; }
.empty-state p { font-size: 13px; }

/* ── TOAST ──────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--bg-primary); border: 0.5px solid var(--green);
  color: var(--txt); padding: 11px 16px;
  border-radius: var(--r); font-size: 12px; font-weight: 500;
  z-index: 9999; display: none; max-width: 300px;
  word-break: break-word; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
#toast.err       { border-color: var(--red); }
#toast.warn-toast{ border-color: var(--amber); }

/* ── PRINT ──────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .filter-bar, .modal-footer,
  #toast, .nav-badge, .sb-overlay, #page-loader { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .card { border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px; }
  .card-hd { background: #f5f5f5; border-bottom: 1px solid #ddd; }
  .tbl th, .tbl td { border: 1px solid #ddd; padding: 5px 8px; font-size: 11px; }
  .rep-item { border: 1px solid #eee; padding: 4px 8px; }
}

/* ══ RESPONSIVE & MOBILE FIELD ACCESSIBILITY ═════════════════ */
@media (max-width: 1100px) {
  .form-3 { grid-template-columns: 1fr 1fr; }
  .rep-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .tb-date { display: none; }
  .content { padding: 12px; }
  .form-2, .form-3 { grid-template-columns: 1fr; }
  .rep-meta { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-tabs { gap: 4px; }
  .cat-tab  { padding: 6px 10px; font-size: 11px; }
  .modal-dialog {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    max-height: 88vh; width: 100% !important; max-width: 100% !important; margin: 0;
  }
  .modal-content {
    border-radius: var(--r3) var(--r3) 0 0;
    max-height: 88vh;
  }
  .tbl { min-width: 460px; }
  .status-btns { gap: 4px; }
  .sbtn { padding: 6px 10px; font-size: 11px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
  .parts-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .issue-row { padding: 12px 10px; gap: 8px; }
  .issue-date { font-size: 11px; }
  .issue-tag { font-size: 10.5px; padding: 3px 6px; }
}
@media (max-width: 576px) {
  .tbl-card-mobile thead { display: none; }
  .tbl-card-mobile, .tbl-card-mobile tbody, .tbl-card-mobile tr, .tbl-card-mobile td { display: block; width: 100%; }
  .tbl-card-mobile tr {
    margin-bottom: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--brd);
    border-radius: var(--r2);
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  .tbl-card-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--brd);
    text-align: right;
  }
  .tbl-card-mobile td:last-child { border-bottom: none; justify-content: flex-end; padding-top: 10px; }
  .tbl-card-mobile td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--txt-muted);
    margin-right: 12px;
    text-align: left;
  }
}
@media (max-width: 480px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 10px 8px; min-height: 76px; }
  .sc-val { font-size: 20px; }
  .sc-lbl { font-size: 10px; }
  .sc-icon { width: 30px; height: 30px; font-size: 16px; margin-bottom: 4px; }
  .maint-card { padding: 10px 8px; gap: 8px; min-height: 68px; }
  .maint-card-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 8px; }
  .maint-val { font-size: 18px; }
  .maint-label { font-size: 10.5px; }
  .maint-sub { font-size: 9px; }
  .content { padding: 10px; }
  .rep-pills { gap: 5px; }
  .pill { min-width: 48px; }
  .login-card { padding: 24px 16px; }
}

/* ───────────────────────────────────────────────────────────
   SECTION: Light / dark theme overrides (from assets/css/themes.css)
   ─────────────────────────────────────────────────────────── */
/* ============================================================
   ETRE-EMMA v7.0 — themes.css
   Dark (default) + Light theme overrides
   ============================================================ */

/* ── LIGHT THEME ─────────────────────────────────────────────
   Everything flips to light — sidebar + content area.
   ─────────────────────────────────────────────────────────── */
[data-bs-theme="light"] {
  /* Backgrounds */
  --bg-app:      #f1f5f9;
  --bg-sidebar:  #ffffff;      /* light sidebar */
  --bg-primary:  #ffffff;
  --bg-secondary:#f8fafc;
  --bg-elevated: #f1f5f9;

  /* Borders */
  --brd:         rgba(0,0,0,0.07);
  --brd-strong:  rgba(0,0,0,0.12);

  /* Text */
  --txt:         #0f172a;
  --txt-muted:   #64748b;
  --txt-faint:   #94a3b8;

  /* Accent */
  --ac:          #008751;
  --ac-hover:    #006b3f;
  --ac-subtle:   rgba(0,135,81,0.08);
  --ac-ring:     rgba(0,135,81,0.2);

  /* Semantic */
  --green:       #16a34a;
  --green-bg:    rgba(22,163,74,0.1);
  --green-brd:   rgba(22,163,74,0.25);
  --amber:       #d97706;
  --amber-bg:    rgba(217,119,6,0.1);
  --amber-brd:   rgba(217,119,6,0.25);
  --red:         #dc2626;
  --red-bg:      rgba(220,38,38,0.08);
  --red-brd:     rgba(220,38,38,0.2);
  --purple:      #7c3aed;
  --purple-bg:   rgba(124,58,237,0.08);
}

/* ── LIGHT: Sidebar — full light match ──────────────────────── */
[data-bs-theme="light"] .sidebar {
  background: #ffffff;
  border-right: 0.5px solid rgba(0,0,0,0.08);
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}

/* Brand row */
[data-bs-theme="light"] .sb-brand {
  border-bottom-color: rgba(0,0,0,0.07);
}
[data-bs-theme="light"] .sb-title { color: #0f172a; }
[data-bs-theme="light"] .sb-ver   { color: #94a3b8; }

/* User row */
[data-bs-theme="light"] .sb-user {
  border-bottom-color: rgba(0,0,0,0.07);
}
[data-bs-theme="light"] .sb-user:hover { background: #f8fafc; }
[data-bs-theme="light"] .sb-uname { color: #0f172a; }
[data-bs-theme="light"] .sb-urole {
  background: rgba(14,124,134,0.08);
  color: #0E7C86;
}
[data-bs-theme="light"] .notif-bell { color: #64748b; }
[data-bs-theme="light"] .sb-user-area {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
}
[data-bs-theme="light"] .sb-user-area:hover {
  background: #e2e8f0;
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Nav section labels */
[data-bs-theme="light"] .nav-sec { color: #64748b; font-weight: 700; opacity: 1; }

/* Nav items */
[data-bs-theme="light"] .nav-item {
  color: #334155;
}
[data-bs-theme="light"] .nav-item .ni {
  background: transparent !important;
  border: none !important;
  color: #64748b;
}
[data-bs-theme="light"] .nav-item:hover {
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
}
[data-bs-theme="light"] .nav-item:hover .ni {
  color: #0d6efd;
  background: transparent !important;
}
[data-bs-theme="light"] .nav-item.active {
  background: #0d6efd !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.35);
}
[data-bs-theme="light"] .nav-item.active .ni {
  background: transparent !important;
  color: #ffffff !important;
}

/* Footer / sign out */
[data-bs-theme="light"] .sb-footer {
  border-top-color: rgba(0,0,0,0.07);
}
[data-bs-theme="light"] #logout-btn {
  color: #dc2626 !important;
}
[data-bs-theme="light"] #logout-btn:hover {
  background: rgba(220,38,38,0.06);
}

/* Avatar in sidebar */
[data-bs-theme="light"] .av,
[data-bs-theme="light"] .avatar {
  background: #e0e7ff;
  color: #3730a3;
}

/* Dept badge in sidebar */
[data-bs-theme="light"] #sb-dept-badge .chip-blue  { background: rgba(14,124,134,0.1);  color: #0A5C63; }
[data-bs-theme="light"] #sb-dept-badge .chip-green { background: rgba(22,163,74,0.1);  color: #15803d; }
[data-bs-theme="light"] #sb-dept-badge .chip-amber { background: rgba(217,119,6,0.1);  color: #b45309; }
[data-bs-theme="light"] #sb-dept-badge .chip-red   { background: rgba(220,38,38,0.1);  color: #b91c1c; }

/* Mobile overlay */
[data-bs-theme="light"] .sb-overlay { background: rgba(0,0,0,0.4); }

/* ── LIGHT: Topbar ──────────────────────────────────────────── */
[data-bs-theme="light"] .topbar {
  background: #ffffff;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
[data-bs-theme="light"] .tb-title    { color: #0f172a; }
[data-bs-theme="light"] .tb-date     { color: #64748b; }
[data-bs-theme="light"] .tb-icon-btn {
  border-color: rgba(0,0,0,0.12);
  color: #475569;
}
[data-bs-theme="light"] .tb-icon-btn:hover {
  border-color: var(--ac);
  color: #0f172a;
}
[data-bs-theme="light"] .hamburger   { color: #0f172a; }

/* ── LIGHT: Login ───────────────────────────────────────────── */
[data-bs-theme="light"] #login-page  { background: #e8eef7; }
[data-bs-theme="light"] .login-bg-grid {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 80px, rgba(14,124,134,0.04) 81px),
    repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(14,124,134,0.04) 81px);
}
[data-bs-theme="light"] .login-bg-grid::after {
  background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(14,124,134,0.06), transparent);
}
[data-bs-theme="light"] .login-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}
[data-bs-theme="light"] .brand-title { color: #0f172a; }

/* ── LIGHT: App background ──────────────────────────────────── */
[data-bs-theme="light"] body { background: #f1f5f9; }

/* ── LIGHT: Forms & inputs ──────────────────────────────────── */
[data-bs-theme="light"] .inp {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
[data-bs-theme="light"] .inp:focus {
  border-color: var(--ac);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14,124,134,0.12);
}
[data-bs-theme="light"] .inp::placeholder { color: #94a3b8; }
[data-bs-theme="light"] .inp option { background: #ffffff; color: #0f172a; }

/* ── LIGHT: Buttons ─────────────────────────────────────────── */
[data-bs-theme="light"] .btn-ghost {
  color: #475569;
  border-color: rgba(0,0,0,0.12);
  background: #ffffff;
}
[data-bs-theme="light"] .btn-ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: rgba(0,0,0,0.2);
}
[data-bs-theme="light"] .flt-btn {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
  color: #475569;
}
[data-bs-theme="light"] .flt-btn:hover {
  border-color: var(--ac);
  color: #0f172a;
}
[data-bs-theme="light"] .flt-btn.active {
  background: rgba(14,124,134,0.08);
  border-color: var(--ac);
  color: #0E7C86;
}
[data-bs-theme="light"] .search-inp {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
[data-bs-theme="light"] .search-inp::placeholder { color: #94a3b8; }
[data-bs-theme="light"] .search-inp:focus { border-color: var(--ac); }

/* ── LIGHT: Cards ───────────────────────────────────────────── */
[data-bs-theme="light"] .card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
[data-bs-theme="light"] .card-hd {
  border-bottom-color: rgba(0,0,0,0.07);
  color: #0f172a;
}
[data-bs-theme="light"] .stat-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
[data-bs-theme="light"] .stat-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
[data-bs-theme="light"] .sc-val { color: #0f172a; }
[data-bs-theme="light"] .sc-lbl { color: #64748b; }

/* ── LIGHT: Table ───────────────────────────────────────────── */
[data-bs-theme="light"] .tbl th { color: #64748b; border-bottom-color: rgba(0,0,0,0.08); }
[data-bs-theme="light"] .tbl td { color: #0f172a; border-bottom-color: rgba(0,0,0,0.05); }
[data-bs-theme="light"] .tbl tbody tr:hover td { background: rgba(14,124,134,0.03); }

/* ── LIGHT: Scrollbar ───────────────────────────────────────── */
[data-bs-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }

/* ── LIGHT: Chips ───────────────────────────────────────────── */
[data-bs-theme="light"] .chip-blue   { background: rgba(14,124,134,0.1);  color: #0A5C63; }
[data-bs-theme="light"] .chip-green  { background: rgba(22,163,74,0.1);  color: #15803d; }
[data-bs-theme="light"] .chip-amber  { background: rgba(217,119,6,0.1);  color: #b45309; }
[data-bs-theme="light"] .chip-red    { background: rgba(220,38,38,0.1);  color: #b91c1c; }
[data-bs-theme="light"] .chip-grey   { background: rgba(100,116,139,0.1);color: #475569; }
[data-bs-theme="light"] .chip-purple { background: rgba(124,58,237,0.1); color: #6d28d9; }

/* ── LIGHT: Checklist ───────────────────────────────────────── */
[data-bs-theme="light"] .cl-item { background: #ffffff; border-color: rgba(0,0,0,0.08); }
[data-bs-theme="light"] .cl-item:hover { border-color: rgba(0,0,0,0.16); }
[data-bs-theme="light"] .sbtn { background: #f1f5f9; border-color: rgba(0,0,0,0.12); color: #475569; }
[data-bs-theme="light"] .sbtn:hover { border-color: var(--ac); color: #0f172a; }
[data-bs-theme="light"] .cl-label { color: #0f172a; }
[data-bs-theme="light"] .cl-id { color: #64748b; }

/* ── LIGHT: Part / Emergency / Device cards ─────────────────── */
[data-bs-theme="light"] .part-card       { background: #ffffff; border-color: rgba(0,0,0,0.07); }
[data-bs-theme="light"] .emrg-card       { background: #ffffff; }
[data-bs-theme="light"] .emrg-card .emrg-title { color: #0f172a; }
[data-bs-theme="light"] .emrg-card .emrg-meta  { color: #64748b; }
[data-bs-theme="light"] .emrg-card .emrg-desc  { color: #334155; }
[data-bs-theme="light"] .online-card     { background: #f8fafc; border-color: rgba(0,0,0,0.07); }
[data-bs-theme="light"] .device-card     { background: #f8fafc; border-color: rgba(0,0,0,0.07); }
[data-bs-theme="light"] .cl-mgr-item     { background: #f8fafc; border-color: rgba(0,0,0,0.07); }
[data-bs-theme="light"] .gen-status-section { background: #f8fafc; border-color: rgba(0,0,0,0.07); }

/* ── LIGHT: Notification / issue / log rows ─────────────────── */
[data-bs-theme="light"] .notif-item       { border-bottom-color: rgba(0,0,0,0.06); }
[data-bs-theme="light"] .notif-item.unread { background: rgba(14,124,134,0.04); }
[data-bs-theme="light"] .notif-title      { color: #0f172a; }
[data-bs-theme="light"] .notif-msg        { color: #64748b; }
[data-bs-theme="light"] .issue-row        { border-bottom-color: rgba(0,0,0,0.06); }
[data-bs-theme="light"] .issue-row:hover  { background: #f8fafc; }
[data-bs-theme="light"] .log-row          { border-bottom-color: rgba(0,0,0,0.06); }
[data-bs-theme="light"] .log-action       { color: #0f172a; }
[data-bs-theme="light"] .log-detail       { color: #64748b; }

/* ── LIGHT: Modal ───────────────────────────────────────────── */
[data-bs-theme="light"] .modal-backdrop.show  { background: rgba(15,23,42,0.5); }
[data-bs-theme="light"] .modal-content { background: #ffffff; border-color: rgba(0,0,0,0.1); box-shadow: 0 24px 60px rgba(0,0,0,0.15); }
[data-bs-theme="light"] .modal-hd { border-bottom-color: rgba(0,0,0,0.08); }
[data-bs-theme="light"] .modal-footer { border-top-color: rgba(0,0,0,0.08); }
[data-bs-theme="light"] .modal-title  { color: #0f172a; }
[data-bs-theme="light"] .modal-sub    { color: #64748b; }
[data-bs-theme="light"] .x-btn        { color: #64748b; }
[data-bs-theme="light"] .x-btn:hover  { color: #0f172a; }

/* ── LIGHT: Toast ───────────────────────────────────────────── */
[data-bs-theme="light"] #toast {
  background: #ffffff;
  border-color: var(--green);
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── LIGHT: Page loader ─────────────────────────────────────── */
[data-bs-theme="light"] #page-loader { background: #f1f5f9; }
[data-bs-theme="light"] #page-loader p { color: #64748b; }

/* ── LIGHT: Theme buttons ───────────────────────────────────── */
[data-bs-theme="light"] .theme-toggle-btn {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
[data-bs-theme="light"] .theme-toggle-btn.active {
  border-color: var(--ac);
  background: rgba(14,124,134,0.08);
  color: var(--ac);
}

/* ── LIGHT: Rep items & pills ───────────────────────────────── */
[data-bs-theme="light"] .rep-item { background: #f8fafc; border-color: rgba(0,0,0,0.06); }
[data-bs-theme="light"] .pill     { background: #f1f5f9; }
[data-bs-theme="light"] .meta-lbl { color: #64748b; }
[data-bs-theme="light"] .meta-val { color: #0f172a; }
[data-bs-theme="light"] .hdiv     { border-top-color: rgba(0,0,0,0.07); }

/* ── LIGHT: Info / error boxes ──────────────────────────────── */
[data-bs-theme="light"] .info-box {
  background: rgba(14,124,134,0.06);
  border-color: rgba(14,124,134,0.2);
  color: #0A5C63;
}
[data-bs-theme="light"] .err-box {
  background: rgba(220,38,38,0.06);
  border-color: rgba(220,38,38,0.2);
  color: #b91c1c;
}

/* ── LIGHT: Section labels & text utils ─────────────────────── */
[data-bs-theme="light"] .mute  { color: #64748b; }
[data-bs-theme="light"] .txt   { color: #0f172a; }
[data-bs-theme="light"] .sec-lbl { color: #94a3b8; }
[data-bs-theme="light"] .nav-sec { color: #94a3b8; }

/* ── LIGHT: Components (from components.css) ────────────────── */
[data-bs-theme="light"] .stn-sbtn { background: #f8fafc; border-color: rgba(0,0,0,0.12); color: #475569; }
[data-bs-theme="light"] .stn-sbtn.sel-OK   { background: rgba(22,163,74,0.15) !important; color: #16a34a !important; border-color: rgba(22,163,74,0.4) !important; }
[data-bs-theme="light"] .stn-sbtn.sel-WARN { background: rgba(217,119,6,0.15) !important; color: #d97706 !important; border-color: rgba(217,119,6,0.4) !important; }
[data-bs-theme="light"] .stn-sbtn.sel-FAIL { background: rgba(220,38,38,0.15) !important; color: #dc2626 !important; border-color: rgba(220,38,38,0.4) !important; }
[data-bs-theme="light"] .stn-sbtn.sel-NA   { background: rgba(100,116,139,0.15) !important; color: #64748b !important; border-color: rgba(100,116,139,0.3) !important; }
[data-bs-theme="light"] .fuel-lvl-btn { background: #f8fafc; border-color: rgba(0,0,0,0.12); color: #0f172a; }
[data-bs-theme="light"] .cl-station-table th { background: #f1f5f9; border-color: rgba(0,0,0,0.08); color: #475569; }
[data-bs-theme="light"] .cl-station-table td { border-color: rgba(0,0,0,0.06); color: #0f172a; }
[data-bs-theme="light"] .cl-station-table tr:hover td { background: #f8fafc; }
[data-bs-theme="light"] .tlr-card,
[data-bs-theme="light"] .fc-record,
[data-bs-theme="light"] .dept-perm-section,
[data-bs-theme="light"] .dept-toggle-card,
[data-bs-theme="light"] .cdp-card,
[data-bs-theme="light"] .ho-obs-card,
[data-bs-theme="light"] .pm-plan-card,
[data-bs-theme="light"] .cl-perm-user,
[data-bs-theme="light"] .elpa-phone-item { background: #f8fafc; border-color: rgba(0,0,0,0.08); }
[data-bs-theme="light"] .perm-cb { color: #475569; }
[data-bs-theme="light"] .perm-row { background: #f8fafc; border-color: rgba(0,0,0,0.08); }
[data-bs-theme="light"] .drag-handle { color: #94a3b8; }
[data-bs-theme="light"] .part-name  { color: #0f172a; }
[data-bs-theme="light"] .part-code  { color: #0E7C86; }
[data-bs-theme="light"] .part-meta  { color: #64748b; }

/* ───────────────────────────────────────────────────────────
   SECTION: Component-specific styles (from assets/css/components.css)
   ─────────────────────────────────────────────────────────── */
/* ============================================================
   ETRE-EMMA v7.0 — components.css
   Module-specific component styles + UI sample panel styles
   Loaded after style.css and themes.css
   ============================================================ */

/* ── PERMISSION GRID ─────────────────────────────────────── */
.perm-grid { display: grid; gap: 8px; }
.perm-row {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.perm-module { font-size: 13px; font-weight: 500; min-width: 140px; }
.perm-toggles { display: flex; gap: 10px; flex-wrap: wrap; }
.perm-toggle-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--txt-muted); }
.perm-toggle-item input[type=checkbox] { accent-color: var(--ac); width: 14px; height: 14px; }
.perm-cb-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--txt-muted); cursor: pointer;
  padding: 5px 8px; border-radius: var(--r);
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  transition: border-color .15s;
}
.perm-cb-item:hover { border-color: var(--ac); color: var(--txt); }
.perm-cb-item input { accent-color: var(--ac); cursor: pointer; }

/* ── DEPT TOGGLES ────────────────────────────────────────── */
.dept-toggle-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; margin-top: 4px; }
.dept-toggle-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 14px 16px; transition: border-color .2s, opacity .2s;
}
.dept-toggle-card:not(.disabled) { border-color: var(--ac); }
.dept-toggle-card.disabled { opacity: .5; }
.dept-toggle-icon { font-size: 22px; flex-shrink: 0; }
.dept-toggle-info { flex: 1; min-width: 0; }
.dept-toggle-name { font-weight: 500; font-size: 13px; }
.dept-toggle-sub  { font-size: 11px; margin-top: 2px; color: var(--txt-muted); }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--brd-strong); border-radius: 24px; transition: .3s;
}
.toggle-slider::before {
  position: absolute; content: ""; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--ac); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── STATION TAGS ────────────────────────────────────────── */
.station-tags-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
.stn-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ac-subtle); border: 0.5px solid var(--ac);
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 500; color: #8FE0E6;
}
.stn-tag-remove { cursor: pointer; font-size: 14px; color: var(--txt-muted); line-height: 1; transition: color .15s; }
.stn-tag-remove:hover { color: var(--red); }

/* ── CHECKLIST STATION TABLE ─────────────────────────────── */
.cl-station-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }
.cl-station-table th {
  background: var(--bg-elevated); padding: 8px 10px; text-align: center;
  font-size: 10px; font-weight: 500; letter-spacing: .5px; white-space: nowrap;
  border: 0.5px solid var(--brd);
}
.cl-station-table td { padding: 6px 8px; border: 0.5px solid var(--brd); vertical-align: middle; }
.cl-station-table tr:hover td { background: var(--bg-elevated); }
.cl-item-label-cell { font-weight: 500; font-size: 12px; min-width: 160px; max-width: 200px; }
.cl-item-code-cell  { font-size: 10px; color: var(--txt-muted); font-family: var(--mono); }
.stn-status-cell    { text-align: center; min-width: 90px; }
.stn-status-btns    { display: flex; gap: 3px; justify-content: center; flex-wrap: nowrap; }
.stn-sbtn {
  padding: 3px 6px; font-size: 10px; font-weight: 500; border-radius: 4px;
  border: 0.5px solid var(--brd); background: var(--bg-elevated);
  color: var(--txt-muted); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.stn-sbtn.sel-OK   { background: var(--green-bg);  color: #4ade80; border-color: var(--green-brd); }
.stn-sbtn.sel-WARN { background: var(--amber-bg);  color: #fbbf24; border-color: var(--amber-brd); }
.stn-sbtn.sel-FAIL { background: var(--red-bg);    color: #f87171; border-color: var(--red-brd); }
.stn-sbtn.sel-NA   { background: rgba(100,120,142,.15); color: var(--txt-muted); border-color: var(--brd-strong); }
.stn-problem-row td { background: var(--bg-elevated) !important; padding: 8px 10px; }
.ps-pns-sel {
  padding: 4px 8px; font-size: 11px; border-radius: var(--r);
  border: 0.5px solid var(--brd); background: var(--bg-secondary); color: var(--txt);
}

/* ── CHECKLIST EDITOR PERMISSIONS ────────────────────────── */
.cl-perm-user {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 10px 14px; margin-bottom: 8px;
}

/* ── FUEL LEVEL BUTTONS ──────────────────────────────────── */
.fuel-level-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 6px; }
.fuel-lvl-btn {
  padding: 10px 6px; border: 0.5px solid var(--brd);
  border-radius: var(--r); background: var(--bg-elevated);
  color: var(--txt); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all .2s; display: flex; align-items: center; gap: 6px; justify-content: center;
  font-family: var(--font);
}
.fuel-lvl-btn:hover { border-color: var(--brd-strong); transform: translateY(-1px); }
.fuel-lvl-btn.active                   { border-color: var(--ac);    background: var(--ac-subtle);  color: #8FE0E6; }
.fuel-lvl-btn[data-level="Y"].active   { border-color: var(--amber); background: var(--amber-bg);   color: #fbbf24; }
.fuel-lvl-btn[data-level="R"].active   { border-color: var(--red);   background: var(--red-bg);     color: #f87171; }
.fl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.fl-dot.g { background: var(--green); } .fl-dot.y { background: var(--amber); } .fl-dot.r { background: var(--red); }

/* ── FUEL GAUGE ──────────────────────────────────────────── */
.fuel-gauge { display: flex; gap: 6px; align-items: flex-end; justify-content: center; padding: 12px 0; }
.fuel-bar   { width: 28px; border-radius: 4px 4px 0 0; transition: height .4s; }
.fuel-level-label { font-size: 28px; font-weight: 600; text-align: center; letter-spacing: 2px; }

/* ── CDP WORKFLOW ────────────────────────────────────────── */
.cdp-workflow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.cdp-step { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; opacity: .4; }
.cdp-step.active { opacity: 1; }

/* ── TL REPORTS ──────────────────────────────────────────── */
.tlr-card {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px;
}
.tlr-ack {
  background: var(--green-bg); border: 0.5px solid var(--green-brd);
  border-radius: var(--r); padding: 6px 10px;
  font-size: 11px; color: #4ade80; margin-top: 8px;
}

/* ── PM / HO / CDP CARDS ─────────────────────────────────── */
.pm-plan-card {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-left: 3px solid var(--ac); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 10px;
}
.pm-plan-card.overdue   { border-left-color: var(--red); }
.pm-plan-card.completed { border-left-color: var(--green); }
.ho-obs-card {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-left: 3px solid var(--ac); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 12px;
}
.cdp-card {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px;
}

/* ── USERS: online indicator in table ────────────────────── */
.tbl td .online-dot { margin-left: 5px; vertical-align: middle; }
.tbl .inactive-row td { opacity: .45; }

/* ── NOTIFICATIONS: dot types ────────────────────────────── */
.notif-dot.info      { background: var(--ac); }
.notif-dot.warning   { background: var(--amber); }
.notif-dot.danger,
.notif-dot.emergency { background: var(--red); animation: live-pulse 1.5s infinite; }
.notif-dot.success   { background: var(--green); }

/* ── PARTS: stock colors ─────────────────────────────────── */
.part-card.low-stock      { border-color: var(--red-brd);   background: rgba(220,38,38,.03); }
.part-card.warning-stock  { border-color: var(--amber-brd); }
.part-qty.ok   { color: #4ade80; }
.part-qty.warn { color: #fbbf24; }
.part-qty.fail { color: #f87171; }

/* ── EMERGENCY: severity left bands ─────────────────────── */
.emrg-card.critical { border-left: 3px solid var(--red); }
.emrg-card.high     { border-left: 3px solid #f97316; }
.emrg-card.medium   { border-left: 3px solid var(--amber); }
.emrg-card.low      { border-left: 3px solid var(--green); }

/* ── SECURITY: log dots ──────────────────────────────────── */
.log-dot.success { background: var(--green); }
.log-dot.failed  { background: var(--red); }
.log-dot.warning { background: var(--amber); }

/* ── FUEL CONFIRMATION ───────────────────────────────────── */
.fc-record {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 11px; margin-bottom: 8px;
}
.fc-grid { display: grid; grid-template-columns: 110px 1fr; gap: 3px 8px; font-size: 11px; margin-top: 5px; }

/* ── ELPA MODAL ──────────────────────────────────────────── */
.elpa-phone-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 9px 13px; margin-bottom: 7px;
}
.elpa-phone-num { font-size: 14px; font-weight: 600; color: #5FD4DE; font-family: var(--mono); }

/* ── DEPT PERMISSIONS GRID ───────────────────────────────── */
.dept-perm-section { background: var(--bg-elevated); border: 0.5px solid var(--brd); border-radius: var(--r); padding: 11px; margin-bottom: 8px; }
.dept-perm-header  { margin-bottom: 7px; }
.dept-perm-name    { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--ac); }
.dept-role-row     { display: flex; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 0.5px solid var(--brd); flex-wrap: wrap; }
.dept-role-row:last-child { border-bottom: none; }
.perm-cb { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--txt-muted); cursor: pointer; }
.perm-cb input { cursor: pointer; accent-color: var(--ac); }

/* ── MEDIA ───────────────────────────────────────────────── */
.media-item video { max-width: 100%; max-height: 280px; border-radius: var(--r); margin-bottom: 6px; }
.media-item img   { cursor: zoom-in; border-radius: var(--r); transition: opacity .15s; }
.media-item img:hover { opacity: .85; }

/* ── MISC ────────────────────────────────────────────────── */
#nr-dept-wrap { display: none; }
.er-form .form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ml16  { margin-left: 16px; }
.mb10  { margin-bottom: 10px; }
.mb20  { margin-bottom: 20px; }
.flt-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pages-wrap { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.gen-status-section {
  background: var(--bg-elevated); border: 0.5px solid var(--brd);
  border-radius: var(--r); padding: 13px 14px; margin-bottom: 12px;
}

/* ── LIGHT THEME OVERRIDES FOR COMPONENTS ────────────────── */
[data-bs-theme="light"] .stn-sbtn { background: #f8fafc; border-color: rgba(0,0,0,.14); color: #475569; }
[data-bs-theme="light"] .stn-sbtn.sel-OK   { background: rgba(22,163,74,0.15) !important; color: #16a34a !important; border-color: rgba(22,163,74,0.4) !important; }
[data-bs-theme="light"] .stn-sbtn.sel-WARN { background: rgba(217,119,6,0.15) !important; color: #d97706 !important; border-color: rgba(217,119,6,0.4) !important; }
[data-bs-theme="light"] .stn-sbtn.sel-FAIL { background: rgba(220,38,38,0.15) !important; color: #dc2626 !important; border-color: rgba(220,38,38,0.4) !important; }
[data-bs-theme="light"] .stn-sbtn.sel-NA   { background: rgba(100,116,139,0.15) !important; color: #64748b !important; border-color: rgba(100,116,139,0.3) !important; }
[data-bs-theme="light"] .fuel-lvl-btn { background: #f8fafc; border-color: rgba(0,0,0,.14); color: #0f172a; }
[data-bs-theme="light"] .cl-station-table th { background: #f1f5f9; border-color: rgba(0,0,0,.1); }
[data-bs-theme="light"] .cl-station-table td { border-color: rgba(0,0,0,.08); }
[data-bs-theme="light"] .cl-station-table tr:hover td { background: #f8fafc; }
[data-bs-theme="light"] .tlr-card,
[data-bs-theme="light"] .fc-record,
[data-bs-theme="light"] .dept-perm-section,
[data-bs-theme="light"] .dept-toggle-card,
[data-bs-theme="light"] .cdp-card,
[data-bs-theme="light"] .ho-obs-card,
[data-bs-theme="light"] .pm-plan-card,
[data-bs-theme="light"] .cl-perm-user,
[data-bs-theme="light"] .elpa-phone-item,
[data-bs-theme="light"] .gen-status-section { background: #f8fafc; border-color: rgba(0,0,0,.1); }
[data-bs-theme="light"] .perm-cb-item { background: #f8fafc; border-color: rgba(0,0,0,.1); color: #475569; }
[data-bs-theme="light"] .perm-cb-item:hover { border-color: var(--ac); color: #0f172a; }

/* ═══════════════════════════════════════════════════════════
   MODERN POLISH LAYER — v8 Bootstrap rebuild
   Sharper depth, consistent radius scale, and a status-rail
   motif (colored left border = operating status) carried
   through cards, stat tiles and list rows.
   ═══════════════════════════════════════════════════════════ */
:root{
  --r:8px; --r2:12px; --r3:16px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md:0 8px 24px -8px rgba(15,23,42,.16);
  --shadow-lg:0 16px 40px -12px rgba(15,23,42,.22);
}
body{ -webkit-font-smoothing:antialiased; }
.card{ box-shadow:var(--shadow-sm); transition:box-shadow .18s ease, transform .18s ease; }
.card:hover{ box-shadow:var(--shadow-md); }
.card-hd, .card-header{ font-weight:600; letter-spacing:.1px; }
.stat-card{ box-shadow:var(--shadow-sm); border-left:1px solid var(--brd); }
.stat-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.stat-card .sc-val.warn{ color:var(--amber); } .stat-card .sc-val.fail{ color:var(--red); } .stat-card .sc-val.ok{ color:var(--green); }
.btn{ border-radius:var(--r); font-weight:600; letter-spacing:.1px; transition:transform .12s ease, box-shadow .12s ease; }
.btn:active{ transform:translateY(1px); }
.btn-primary{ box-shadow:0 2px 10px rgba(14,124,134,.25); }
.emrg-card, .part-card{ box-shadow:var(--shadow-sm); border-radius:var(--r2); background:var(--bg-primary); border:1px solid var(--brd); padding:14px 16px; margin-bottom:12px; border-left-width:4px; border-left-style:solid; }
.sidebar{ box-shadow:var(--shadow-md); }
.chip, [class^="chip-"], [class*=" chip-"]{ font-weight:700; letter-spacing:.2px; }
.avatar, .av{ box-shadow:0 0 0 2px var(--bg-primary), 0 0 0 3px var(--brd); }
.topbar{ backdrop-filter:saturate(1.4) blur(6px); }
.mono{ font-family:'JetBrains Mono','Fira Mono',monospace; }
table.tbl thead th, table.table thead th{ font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--txt-muted); font-weight:700; }
.login-card{ box-shadow:var(--shadow-lg); border-radius:var(--r3); }
.empty-state{ opacity:.75; }
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; } }

/* ═══════════════════════════════════════════════════════════
   COLLAPSIBLE SIDEBAR (icon-only rail on desktop)
   Toggled via #sidebar-collapse-btn, persisted in localStorage,
   applied to <body class="sidebar-collapsed">.
   ═══════════════════════════════════════════════════════════ */
#sidebar-collapse-btn{ font-size:14px; line-height:1; }
body.sidebar-collapsed #sidebar-collapse-btn{ transform:scaleX(-1); }
@media (min-width:768px){
  .sidebar{ transition: flex-basis .2s ease, max-width .2s ease, width .2s ease; }
  .sidebar .offcanvas-header { display: none !important; }
  main.content{ transition: flex-basis .2s ease, max-width .2s ease, width .2s ease, margin .2s ease; margin-left: 0 !important; }
  body.sidebar-collapsed .sidebar{ flex: 0 0 72px !important; max-width: 72px !important; width: 72px !important; }
  body.sidebar-collapsed main.content{ flex: 0 0 calc(100% - 72px) !important; max-width: calc(100% - 72px) !important; width: calc(100% - 72px) !important; margin-left: 0 !important; }
  body.sidebar-collapsed .sb-nav{ padding: 10px 4px; }
  body.sidebar-collapsed .nav-item{
    justify-content: center;
    padding: 0;
    margin: 4px auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
  }
  body.sidebar-collapsed .nav-item .ni{
    width: 36px;
    height: 36px;
    font-size: 20px;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  body.sidebar-collapsed .nav-item:hover .ni{
    background: transparent;
  }
  body.sidebar-collapsed .nav-item.active {
    background: #0d6efd !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
  }
  body.sidebar-collapsed .nav-item.active .ni{
    background: transparent;
    color: #ffffff !important;
  }
  body.sidebar-collapsed .nav-item .nav-label,
  body.sidebar-collapsed .nav-badge,
  body.sidebar-collapsed .nav-sec,
  body.sidebar-collapsed #sb-user-info,
  body.sidebar-collapsed #sb-uname, body.sidebar-collapsed #sb-urole,
  body.sidebar-collapsed #sb-dept-badge,
  body.sidebar-collapsed #sb-app-name, body.sidebar-collapsed .sb-ver,
  body.sidebar-collapsed .sb-user-area::after,
  body.sidebar-collapsed #notif-bell{ display: none !important; }
  body.sidebar-collapsed .sb-user,
  body.sidebar-collapsed .sb-user-area{ justify-content: center; padding: 6px 0; }
  body.sidebar-collapsed .sb-user-area #sb-avatar{ margin-right: 0 !important; }
  body.sidebar-collapsed .offcanvas-header{ justify-content: center; padding: 12px 0; }
  body.sidebar-collapsed .offcanvas-header .btn-close{ display: none; }
  body.sidebar-collapsed .sb-logo-wrap{ margin: 0 auto; width: 34px; height: 34px; }
  body.sidebar-collapsed #logout-btn{ justify-content: center; width: 44px; height: 44px; margin: 4px auto; padding: 0; }
}

/* ═══════════════════════════════════════════════════════════
   MODERN DROPDOWN MOTION & POSITIONING SYSTEM (TOM SELECT & BOOTSTRAP)
   Matches tokens (--bg-primary, --brd, --txt, --ac) with glassmorphism,
   spring micro-animations, collision-aware positioning, and hover states.
   ═══════════════════════════════════════════════════════════ */

/* Native Select Modern Controls */
.form-select, select.inp {
  background-color: var(--bg-primary, #0f172a) !important;
  border: 1px solid var(--brd, rgba(255, 255, 255, 0.12)) !important;
  border-radius: 10px !important;
  color: var(--txt, #f8fafc) !important;
  padding: 8px 36px 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23008751' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 12px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

[data-bs-theme="light"] .form-select, [data-bs-theme="light"] select.inp {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.form-select:focus, select.inp:focus {
  border-color: var(--ac, #008751) !important;
  box-shadow: 0 0 0 3.5px rgba(0, 135, 81, 0.22) !important;
  outline: none !important;
}

select option {
  background-color: var(--bg-card, #131c2a) !important;
  color: var(--txt, #f8fafc) !important;
  padding: 10px;
}

[data-bs-theme="light"] select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Bootstrap Floating Dropdown Menu Positioning & Motion */
.dropdown-menu {
  background: rgba(15, 23, 42, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px !important;
  z-index: 10000 !important;
  animation: dropdown-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top left;
}

[data-bs-theme="light"] .dropdown-menu {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(0, 0, 0, 0.09) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

.dropdown-menu.dropdown-menu-end {
  transform-origin: top right;
}

.dropdown-item {
  color: var(--txt, #f8fafc) !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
}

[data-bs-theme="light"] .dropdown-item {
  color: #1e293b !important;
}

.dropdown-item:hover, .dropdown-item:focus {
  background: rgba(0, 135, 81, 0.14) !important;
  color: var(--ac, #008751) !important;
  transform: translateX(3px);
}

.dropdown-item.active, .dropdown-item:active {
  background: var(--ac, #008751) !important;
  color: #ffffff !important;
}

.dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
  margin: 6px 0 !important;
}

[data-bs-theme="light"] .dropdown-divider {
  border-top-color: rgba(0, 0, 0, 0.08) !important;
}

@keyframes dropdown-pop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* TomSelect Dropdown Enhancer Theme & Motion */
.ts-wrapper.form-select { padding: 0; }

.ts-wrapper .ts-control {
  background: var(--bg-primary, #0f172a) !important;
  border: 1px solid var(--brd, rgba(255,255,255,0.12)) !important;
  border-radius: 10px !important;
  color: var(--txt, #f8fafc) !important;
  min-height: 40px;
  padding: 6px 12px;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

[data-bs-theme="light"] .ts-wrapper .ts-control {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.ts-wrapper.focus .ts-control {
  border-color: var(--ac, #008751) !important;
  box-shadow: 0 0 0 3.5px rgba(0, 135, 81, 0.22) !important;
}

.ts-control input {
  color: var(--txt, #f8fafc) !important;
  font-size: 13.5px;
}

[data-bs-theme="light"] .ts-control input {
  color: #0f172a !important;
}

.ts-control input::placeholder { color: var(--txt-faint, #64748b); }

.ts-wrapper .ts-control > *:not(input) { color: var(--txt, #f8fafc); }

.ts-dropdown {
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-top: 6px;
  overflow: hidden;
  z-index: 99999 !important;
  animation: ts-dropdown-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-bs-theme="light"] .ts-dropdown {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(0, 0, 0, 0.09) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

.ts-dropdown.position-top {
  margin-top: 0;
  margin-bottom: 6px;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45) !important;
  animation: ts-dropdown-pop-top 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ts-dropdown .ts-dropdown-content {
  padding: 6px !important;
  max-height: 240px;
}

.ts-dropdown [data-selectable], .ts-dropdown .option {
  padding: 8px 12px !important;
  border-radius: 8px !important;
  color: var(--txt, #f8fafc) !important;
  cursor: pointer;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

[data-bs-theme="light"] .ts-dropdown [data-selectable], [data-bs-theme="light"] .ts-dropdown .option {
  color: #1e293b !important;
}

.ts-dropdown .option:hover, .ts-dropdown [data-selectable]:hover {
  background: rgba(0, 135, 81, 0.14) !important;
  color: var(--ac, #008751) !important;
}

.ts-dropdown .option.active, .ts-dropdown [data-selectable].active {
  background: linear-gradient(135deg, var(--ac, #008751), #059669) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.ts-dropdown .option.active .ts-opt-icon, .ts-dropdown [data-selectable].active .ts-opt-icon {
  color: #ffffff !important;
}

.ts-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-opt-icon {
  font-family: "tabler-icons" !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: var(--ac, #008751);
  line-height: 1;
  speak: none;
  transition: transform 0.15s ease;
}

.ts-dropdown .option:hover .ts-opt-icon {
  transform: scale(1.15);
}

.ts-no-results {
  padding: 12px;
  font-size: 12.5px;
  color: var(--txt-muted, #94a3b8);
  text-align: center;
}

.ts-wrapper .item {
  background: rgba(0, 135, 81, 0.14) !important;
  color: var(--txt, #f8fafc) !important;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12.5px;
  font-weight: 500;
}

.ts-wrapper.multi .ts-control > div.item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ts-wrapper .ts-control .item .ts-opt-icon { color: var(--ac, #008751); }
.ts-dropdown .create { color: var(--ac, #008751); font-weight: 600; }

@keyframes ts-dropdown-pop {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ts-dropdown-pop-top {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   UX/UI EBOOK DESIGN SYSTEM ENHANCEMENTS
   Implementation of design principles:
   1. Skeleton Loading over generic spinners
   2. Radio Buttons for Single Choice & Checklists for Multiple
   3. Display All Options for 2-3 Values (Segmented Radio Cards)
   4. Highlight Important Action (Primary gradient vs Soft secondary)
   5. Smooth Adjacent-Hue Gradients
   6. Split Long Forms Into Steps & Showcase Progress
   7. Vertical Stacked Label Alignment with Full Enclosed Box Inputs
   8. Soft Off-Black (#181825 / #111827) & Off-White (#f8fafc / #e7e9eb)
   9. Inline Real-time Error Validation Rules
  10. OTP Digit Input Boxes for Verification Codes
  11. Guided Search Placeholders & Touch-Friendly Hit Targets
  12. Action Color Psychology (Red Delete, Green/Primary Confirm)
   ═══════════════════════════════════════════════════════════ */

/* ── 1. SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 37%, rgba(255,255,255,0.06) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--r, 8px);
}
[data-bs-theme="light"] .skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
  background-size: 400% 100%;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; width: 100%; }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; border-radius: 6px; }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card {
  padding: 18px;
  background: var(--bg-primary, #1a2535);
  border: 1px solid var(--brd, rgba(255,255,255,0.08));
  border-radius: var(--r2, 12px);
  margin-bottom: 16px;
}

/* ── 2. SEGMENTED RADIO & CHECKBOX OPTION CARDS (2-3 Values Displayed Directly) ── */
.radio-option-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.radio-card {
  flex: 1;
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary, #101b2b);
  border: 1.5px solid var(--brd, rgba(255,255,255,0.12));
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
}
[data-bs-theme="light"] .radio-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.radio-card:hover {
  border-color: var(--ac);
  background: var(--bg-elevated, rgba(16,185,129,0.06));
}
.radio-card input[type="radio"],
.radio-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ac, #10b981);
  cursor: pointer;
  margin: 0;
}
.radio-card.active,
.radio-card:has(input:checked) {
  border-color: var(--ac, #10b981);
  background: var(--ac-subtle, rgba(16,185,129,0.15));
  box-shadow: 0 0 0 1px var(--ac);
}

/* ── 3. SMOOTH ADJACENT-HUE GRADIENTS ── */
.btn-smooth-gradient {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
  transition: all 0.2s ease;
}
.btn-smooth-gradient:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}
.btn-smooth-indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-smooth-indigo:hover {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
  transform: translateY(-1px);
}

/* ── 4. STEP PROGRESS WIZARD FOR MULTI-STEP FORMS ── */
.step-wizard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 24px;
  padding: 0 10px;
}
.step-wizard::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--brd, rgba(255,255,255,0.12));
  transform: translateY(-50%);
  z-index: 1;
}
.step-wizard-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-wizard-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary, #101b2b);
  border: 2px solid var(--brd, rgba(255,255,255,0.2));
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.25s ease;
}
[data-bs-theme="light"] .step-wizard-icon {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}
.step-wizard-item.active .step-wizard-icon {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}
.step-wizard-item.completed .step-wizard-icon {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}
.step-wizard-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-muted);
}
.step-wizard-item.active .step-wizard-label {
  color: var(--txt);
}

/* ── 5. VERTICAL LABEL STACK & ENCLOSED BOXED INPUTS ── */
.form-group-v {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}
.form-group-v label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 6px;
  text-align: left;
}
.form-control-boxed,
.inp {
  width: 100%;
  border-radius: 8px !important;
  border: 1px solid var(--brd, rgba(255,255,255,0.14)) !important;
  padding: 9px 12px !important;
  background: var(--bg-secondary, #101b2b) !important;
  color: var(--txt) !important;
  font-size: 13.5px !important;
  transition: all 0.2s ease;
}
.form-control-boxed:focus,
.inp:focus {
  border-color: var(--ac, #10b981) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18) !important;
  outline: none !important;
}

/* ── 6. REAL-TIME FIELD VALIDATION RULES ── */
.validation-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: 11.5px;
}
.rule-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--txt-muted);
}
.rule-item.valid { color: #10b981; font-weight: 500; }
.rule-item.invalid { color: #ef4444; font-weight: 500; }

/* ── 7. OTP / DIGIT INPUT BOXES ── */
.otp-digit-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
}
.otp-digit {
  width: 48px;
  height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 10px;
  border: 1.5px solid var(--brd, rgba(255,255,255,0.16));
  background: var(--bg-secondary, #101b2b);
  color: var(--txt);
  transition: all 0.2s ease;
}
.otp-digit:focus {
  border-color: var(--ac, #10b981);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.22);
  outline: none;
}

/* ── 8. ACTION COLOR PSYCHOLOGY ── */
.btn-danger-action {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.btn-danger-action:hover {
  background: #b91c1c !important;
}
.btn-human-cancel {
  background: var(--bg-secondary, rgba(255,255,255,0.06)) !important;
  color: var(--txt-muted) !important;
  border: 1px solid var(--brd) !important;
  font-weight: 500;
}
.btn-human-cancel:hover {
  background: rgba(255,255,255,0.1) !important;
  color: var(--txt) !important;
}

/* ═══════════════════════════════════════════════════════════
   STANDARDIZED FONT SIZES & TYPOGRAPHY SYSTEM
   ═══════════════════════════════════════════════════════════ */
body {
  font-size: 14px;
  line-height: 1.5;
}

/* Headings typography scale */
h1, .h1 { font-size: 1.5rem !important; line-height: 1.3; font-weight: 700; }
h2, .h2 { font-size: 1.25rem !important; line-height: 1.35; font-weight: 600; }
h3, .h3 { font-size: 1.125rem !important; line-height: 1.4; font-weight: 600; }
h4, .h4 { font-size: 1rem !important; line-height: 1.4; font-weight: 600; }
h5, .h5 { font-size: 0.875rem !important; line-height: 1.4; font-weight: 600; }
h6, .h6 { font-size: 0.8125rem !important; line-height: 1.4; font-weight: 600; }

/* Standard text helper classes */
.small, small, .text-small { font-size: 12.5px !important; }
.extra-small, .text-xs { font-size: 11.5px !important; }
.tb-title { font-size: 15px !important; font-weight: 700 !important; }

/* Navigation Typography */
.nav-label { font-size: 13.5px !important; font-weight: 500; }
.nav-sec { font-size: 11px !important; font-weight: 700 !important; letter-spacing: 0.6px; text-transform: uppercase; }

/* Tables Typography */
table.tbl thead th, table.table thead th {
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  padding: 10px 12px !important;
}
table.tbl tbody td, table.table tbody td {
  font-size: 13.5px !important;
  padding: 10px 12px !important;
}

/* Form controls & Buttons */
.form-control, .form-select, .form-label, .btn {
  font-size: 14px;
}
.btn-sm, .form-control-sm, .form-select-sm {
  font-size: 13px !important;
}
.btn-lg, .form-control-lg {
  font-size: 15px !important;
}

/* Metadata & Small Badges */
.meta-lbl, .pill-lbl, .sc-lbl, .rep-cat-hd {
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase;
}
.meta-val, .pill-num, .sc-val {
  font-size: 14px !important;
}
.badge, .chip, .tag {
  font-size: 11.5px !important;
}

/* Collapsed sidebar adjustments for footer sign-out button */
body.sidebar-collapsed #logout-btn span {
  display: none !important;
}
body.sidebar-collapsed #logout-btn {
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  margin: 0 auto;
}


