/* ═══════════════════════════════════════════════════════
   GLASSMORPHISM THEME — theme2.css
   All rules scoped to body.theme-two — does not touch
   index.html or app.js.
   ═══════════════════════════════════════════════════════ */

/* ─── Base font ─────────────────────────────────────── */
body.theme-two {
  font-family: "Inter", "IBM Plex Sans", Arial, sans-serif;
}

/* ─── CSS variables  (dark mode default) ────────────── */
body.theme-two {
  --bg:              #07071a;
  --panel:           rgba(255, 255, 255, 0.06);
  --panel-2:         rgba(255, 255, 255, 0.10);
  --line:            rgba(255, 255, 255, 0.11);
  --line-soft:       rgba(255, 255, 255, 0.06);
  --text:            #eef1ff;
  --muted:           rgba(180, 195, 255, 0.60);
  --amber:           #fbbf24;
  --red:             #f87171;
  --green:           #34d399;
  --blue:            #818cf8;
  --cyan:            #22d3ee;
  --white:           #ffffff;
  --body-bg-start:   #07071a;
  --body-bg-end:     #0d0d28;
  --card-bg:         rgba(255, 255, 255, 0.05);
  --glass-blur:      22px;
  --table-head-bg:   rgba(99, 102, 241, 0.13);
  --table-head-text: #c7d2fe;
  --backdrop:        rgba(4, 4, 20, 0.72);
  --selection-bg:    rgba(99, 102, 241, 0.20);
  --hover-bg:        rgba(99, 102, 241, 0.10);
  --accent:          #6366f1;
  --accent-glow:     rgba(99, 102, 241, 0.35);

  /* ─── Orb background ─── */
  background:
    radial-gradient(ellipse 55% 45% at 14%  8%,  rgba(99,  102, 241, 0.30) 0%, transparent 65%),
    radial-gradient(ellipse 45% 38% at 86%  18%, rgba(6,   182, 212, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 40% 32% at 55%  82%, rgba(168, 85,  247, 0.20) 0%, transparent 60%),
    radial-gradient(ellipse 30% 28% at 30%  60%, rgba(236, 72,  153, 0.10) 0%, transparent 55%),
    linear-gradient(160deg, #07071a 0%, #0d0d28 100%);
}

/* ─── Light mode variables ──────────────────────────── */
body.theme-two[data-theme="light"] {
  --bg:              #d9e4f8;
  --panel:           rgba(255, 255, 255, 0.60);
  --panel-2:         rgba(255, 255, 255, 0.80);
  --line:            rgba(90, 105, 200, 0.20);
  --line-soft:       rgba(90, 105, 200, 0.11);
  --text:            #0d0e2a;
  --muted:           rgba(40, 50, 140, 0.60);
  --white:           #0d0e2a;
  --body-bg-start:   #d9e4f8;
  --body-bg-end:     #c4d5f2;
  --card-bg:         rgba(255, 255, 255, 0.52);
  --table-head-bg:   rgba(99, 102, 241, 0.09);
  --table-head-text: #312e81;
  --backdrop:        rgba(70, 80, 160, 0.28);
  --selection-bg:    rgba(99, 102, 241, 0.15);
  --hover-bg:        rgba(99, 102, 241, 0.08);
  --blue:            #4338ca;
  --accent:          #4338ca;
  --accent-glow:     rgba(67, 56, 202, 0.22);
  --cyan:            #0891b2;

  background:
    radial-gradient(ellipse 55% 45% at 14%  8%,  rgba(139, 140, 255, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 45% 38% at 86%  18%, rgba(6,   182, 212, 0.16) 0%, transparent 58%),
    radial-gradient(ellipse 38% 30% at 55%  82%, rgba(168, 85,  247, 0.12) 0%, transparent 60%),
    linear-gradient(160deg, #d9e4f8 0%, #c4d5f2 100%);
}

/* ─── Wrap ──────────────────────────────────────────── */
body.theme-two .wrap {
  max-width: none;
  padding: 0;
}

/* ─── Shell grid ────────────────────────────────────── */
body.theme-two .theme-two-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════ */
body.theme-two .theme-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
  padding: 28px 14px 24px;
  background: rgba(8, 8, 32, 0.55);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
}

body.theme-two[data-theme="light"] .theme-sidebar {
  background: rgba(230, 238, 255, 0.60);
}

body.theme-two .theme-sidebar-brand {
  padding: 0 6px 22px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

body.theme-two .theme-sidebar-brand h1 {
  margin: 0 0 7px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
}

body.theme-two .theme-sidebar-brand p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

body.theme-two .theme-sidebar-label {
  margin: 0 0 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--muted);
}

body.theme-two .theme-sidebar-nav {
  display: grid;
  gap: 5px;
}

body.theme-two .theme-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(180, 195, 255, 0.70);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.20s ease, border-color 0.20s ease, color 0.20s ease, box-shadow 0.20s ease;
}

body.theme-two .theme-nav-item:hover,
body.theme-two .theme-nav-item:focus-visible {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.28);
  color: var(--text);
  outline: none;
}

body.theme-two .theme-nav-item.is-active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.48);
  color: #c7d2fe;
  box-shadow:
    0 0 18px rgba(99, 102, 241, 0.18),
    inset 0 0 10px rgba(99, 102, 241, 0.07);
}

body.theme-two .theme-nav-icon {
  width: 18px;
  font-size: 13px;
  color: var(--blue);
  text-align: center;
  flex-shrink: 0;
}

body.theme-two[data-theme="light"] .theme-nav-item {
  color: rgba(35, 45, 130, 0.70);
}

body.theme-two[data-theme="light"] .theme-nav-item.is-active {
  color: #3730a3;
}

body.theme-two[data-theme="light"] .theme-nav-item:hover {
  color: #1e1b4b;
}

/* ═══════════════════════════════════════════════════════
   MAIN AREA
   ═══════════════════════════════════════════════════════ */
body.theme-two .theme-main {
  min-width: 0;
  padding: 18px 22px 32px;
}

/* ─── Topbar — sticky glass bar ─────────────────────── */
body.theme-two .topbar {
  position: sticky;
  top: 12px;
  z-index: 100;
  margin-bottom: 20px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 32, 0.48);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-two[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 8px 32px rgba(70, 80, 160, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.theme-two .topbar .title h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 4px;
  background: linear-gradient(100deg, #eef1ff 30%, rgba(139, 140, 255, 0.80));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-two[data-theme="light"] .topbar .title h1 {
  background: linear-gradient(100deg, #0d0e2a 30%, #3730a3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-two .topbar .title p {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  max-width: 560px;
}

body.theme-two .actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

/* ─── Glass buttons ─────────────────────────────────── */
body.theme-two button,
body.theme-two .view-switch-link {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body.theme-two button:hover,
body.theme-two .view-switch-link:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.48);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}

body.theme-two .view-switch-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

body.theme-two[data-theme="light"] button,
body.theme-two[data-theme="light"] .view-switch-link {
  border-color: rgba(70, 80, 180, 0.20);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
}

body.theme-two[data-theme="light"] button:hover,
body.theme-two[data-theme="light"] .view-switch-link:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(67, 56, 202, 0.40);
  color: #312e81;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.14);
}

/* ─── Input fields ──────────────────────────────────── */
body.theme-two input[type="text"],
body.theme-two input[type="password"],
body.theme-two select {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 11px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}

body.theme-two input[type="text"]:focus,
body.theme-two input[type="password"]:focus,
body.theme-two select:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

body.theme-two select option {
  background: #15153a;
  color: var(--text);
}

body.theme-two[data-theme="light"] input[type="text"],
body.theme-two[data-theme="light"] input[type="password"],
body.theme-two[data-theme="light"] select {
  border-color: rgba(70, 80, 180, 0.20);
  background: rgba(255, 255, 255, 0.60);
  color: var(--text);
}

body.theme-two[data-theme="light"] select option {
  background: #ffffff;
  color: #0d0e2a;
}

/* ─── KPI grid ──────────────────────────────────────── */
body.theme-two #kpiGrid {
  margin-bottom: 20px;
}

body.theme-two #kpiGrid.theme-kpis-hidden {
  display: none;
}

/* ─── Metric / KPI cards ────────────────────────────── */
body.theme-two .metric {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ─── Section cards ─────────────────────────────────── */
body.theme-two section,
body.theme-two .card {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-two #theme-price-list,
body.theme-two #theme-contracts,
body.theme-two #theme-spare-parts-ordering,
body.theme-two #theme-equipment-status {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

body.theme-two .theme-section-card {
  scroll-margin-top: 20px;
}

/* ─── Modals ────────────────────────────────────────── */
body.theme-two .modal-card {
  background: rgba(10, 10, 36, 0.80);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-two[data-theme="light"] .modal-card {
  background: rgba(235, 242, 255, 0.82);
  box-shadow:
    0 24px 80px rgba(70, 80, 160, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

/* ─── Login card ────────────────────────────────────── */
body.theme-two .login-card {
  background: rgba(10, 10, 36, 0.70);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-two[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.58);
  box-shadow:
    0 24px 80px rgba(70, 80, 160, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

/* ─── Contract modal — glass override ──────────────── */
body.theme-two .contract-modal-card {
  background: rgba(8, 8, 30, 0.82);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.theme-two[data-theme="light"] .contract-modal-card {
  background: rgba(240, 245, 255, 0.82);
  color: var(--text);
  box-shadow:
    0 24px 80px rgba(70, 80, 160, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

/* ─── Contract modal header — button visibility ─────── */
/* Dark modal (rgba 8,8,30) needs higher-contrast buttons  */
body.theme-two .contract-modal-header .modal-actions button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
body.theme-two .contract-modal-header .modal-actions button:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}
body.theme-two[data-theme="light"] .contract-modal-header .modal-actions button {
  border-color: rgba(70, 80, 180, 0.30);
  background: rgba(255, 255, 255, 0.70);
  color: #1a1a1a;
}
/* Export PDF button — indigo accent on top of base above */
body.theme-two #exportContractPdfBtn {
  border-color: rgba(99, 102, 241, 0.65) !important;
  background: rgba(99, 102, 241, 0.30) !important;
  color: #c7d2fe !important;
  font-weight: 600;
}
body.theme-two #exportContractPdfBtn:hover {
  background: rgba(99, 102, 241, 0.48) !important;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35) !important;
}
body.theme-two[data-theme="light"] #exportContractPdfBtn {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(67, 56, 202, 0.45) !important;
  color: #3730a3 !important;
}

/* ─── Login overlay ─────────────────────────────────── */
body.theme-two .login-overlay {
  background:
    radial-gradient(ellipse 55% 45% at 14%  8%,  rgba(99,  102, 241, 0.30) 0%, transparent 65%),
    radial-gradient(ellipse 45% 38% at 86%  18%, rgba(6,   182, 212, 0.22) 0%, transparent 58%),
    radial-gradient(ellipse 40% 32% at 55%  82%, rgba(168, 85,  247, 0.20) 0%, transparent 60%),
    linear-gradient(160deg, #07071a 0%, #0d0d28 100%);
}

body.theme-two[data-theme="light"] .login-overlay {
  background:
    radial-gradient(ellipse 55% 45% at 14%  8%,  rgba(139, 140, 255, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 45% 38% at 86%  18%, rgba(6,   182, 212, 0.16) 0%, transparent 58%),
    linear-gradient(160deg, #d9e4f8 0%, #c4d5f2 100%);
}

/* ─── Tables ────────────────────────────────────────── */
body.theme-two table thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

body.theme-two tr.selected,
body.theme-two tr:hover {
  background: var(--hover-bg);
}

/* ─── Headings ──────────────────────────────────────── */
body.theme-two h1,
body.theme-two h2,
body.theme-two h3 {
  letter-spacing: -0.03em;
  font-family: "Inter", "IBM Plex Sans", sans-serif;
}

/* ─── Page sections visibility ──────────────────────── */
body.theme-two .theme-page {
  display: none;
}

body.theme-two .theme-page.is-active {
  display: block;
}

/* ─── Price list tweaks ─────────────────────────────── */
body.theme-two #theme-price-list .price-list-wrap,
body.theme-two #theme-price-list .price-list-wrap.is-collapsed {
  display: block;
  max-height: calc(100vh - 250px);
  min-height: 420px;
}

body.theme-two #theme-price-list #priceListToggleBtn {
  display: none;
}

body.theme-two #theme-price-list .price-list-title,
body.theme-two #theme-contracts .contracts-title {
  margin-top: 0;
}

body.theme-two .theme-spares-filters {
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════
   COLORED TABLE ROWS — theme2 overrides
   Blue/yellow/green rows: solid WCAG colors from styles.css
   apply unchanged (dark enough for glass dark bg).
   Only white rows and DGS section containers need overrides.
   ═══════════════════════════════════════════════════════ */

/* ─── Spares table header — beat general thead specificity ─ */
body.theme-two .spares-table th {
  background: #212121;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}

/* ─── BLUE rows — mandatory consumables ─────────────── */
body.theme-two .spares-row-blue td {
  background: #1a237e;
  color: #ffffff;
  border-left: 3px solid #3949ab;
}
body.theme-two .spares-row-blue .input-cell,
body.theme-two .spares-row-blue input,
body.theme-two .spares-row-blue select {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(144, 179, 255, 0.60) !important;
}
body.theme-two .spares-row-blue .input-cell::placeholder,
body.theme-two .spares-row-blue input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* ─── GREEN rows — standard consumables ─────────────── */
body.theme-two .spares-row-green td {
  background: #1b5e20;
  color: #ffffff;
  border-left: 3px solid #388e3c;
}
body.theme-two .spares-row-green .input-cell,
body.theme-two .spares-row-green input,
body.theme-two .spares-row-green select {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(165, 214, 167, 0.60) !important;
}
body.theme-two .spares-row-green .input-cell::placeholder,
body.theme-two .spares-row-green input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* ─── YELLOW rows — attention / low stock ───────────── */
body.theme-two .spares-row-yellow td {
  background: #7c5a00;
  color: #ffffff;
  border-left: 3px solid #b8860b;
}
body.theme-two .spares-row-yellow .input-cell,
body.theme-two .spares-row-yellow input,
body.theme-two .spares-row-yellow select {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 224, 130, 0.60) !important;
}
body.theme-two .spares-row-yellow .input-cell::placeholder,
body.theme-two .spares-row-yellow input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* ─── qty-zero badge inside colored rows ────────────── */
body.theme-two .qty-zero {
  background: #b71c1c !important;
  color: #ffffff !important;
  border-color: #e53935 !important;
  font-weight: 700;
}

/* ─── Light mode: restore blue/green/yellow row colors ─ */
body.theme-two[data-theme="light"] .spares-row-blue td {
  background: #1565c0;
  color: #ffffff;
  border-left: 3px solid #1976d2;
}
body.theme-two[data-theme="light"] .spares-row-blue .input-cell,
body.theme-two[data-theme="light"] .spares-row-blue input {
  background-color: #1a237e !important;
  color: #ffffff !important;
  border: 1.5px solid #90caf9 !important;
}
body.theme-two[data-theme="light"] .spares-row-green td {
  background: #2e7d32;
  color: #ffffff;
  border-left: 3px solid #388e3c;
}
body.theme-two[data-theme="light"] .spares-row-green .input-cell,
body.theme-two[data-theme="light"] .spares-row-green input {
  background-color: #1b5e20 !important;
  color: #ffffff !important;
  border: 1.5px solid #a5d6a7 !important;
}
body.theme-two[data-theme="light"] .spares-row-yellow td {
  background: #b8860b;
  color: #ffffff;
  border-left: 3px solid #c9a227;
}
body.theme-two[data-theme="light"] .spares-row-yellow .input-cell,
body.theme-two[data-theme="light"] .spares-row-yellow input {
  background-color: #e65100 !important;
  color: #ffffff !important;
  border: 1.5px solid #ffe082 !important;
}

/* ─── DGS On Board table inputs — dark glass ────────── */
body.theme-two .dgs-section-onboard .dgs-inventory-table .input-cell,
body.theme-two .dgs-section-onboard .dgs-inventory-table .table-input {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(165, 214, 167, 0.60) !important;
}
body.theme-two .dgs-section-onboard .dgs-inventory-table .input-cell::placeholder,
body.theme-two .dgs-section-onboard .dgs-inventory-table .table-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* Light mode: DGS On Board inputs → restore white */
body.theme-two[data-theme="light"] .dgs-section-onboard .dgs-inventory-table .input-cell,
body.theme-two[data-theme="light"] .dgs-section-onboard .dgs-inventory-table .table-input {
  background-color: rgba(255, 255, 255, 0.82) !important;
  color: #1e293b !important;
  border: 1px solid rgba(100, 116, 139, 0.35) !important;
}

/* ─── White rows: #f5f5f5 looks jarring on dark glass ── */
body.theme-two .spares-row-white td {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-left: 3px solid rgba(255, 255, 255, 0.16);
}
/* Dark mode: white row inputs get glass style instead of #ffffff */
body.theme-two .spares-row-white .input-cell,
body.theme-two .spares-row-white input {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.28) !important;
}
body.theme-two .spares-row-white .input-cell::placeholder,
body.theme-two .spares-row-white input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* ─── DGS section containers — dark glass bg ────────── */
body.theme-two .dgs-section-refurbished {
  background: rgba(99, 140, 255, 0.07);
  border-color: rgba(99, 140, 255, 0.20);
}
body.theme-two .dgs-section-warehouse {
  background: rgba(255, 185, 40, 0.07);
  border-color: rgba(255, 185, 40, 0.20);
}
body.theme-two .dgs-section-onboard {
  background: rgba(46, 125, 50, 0.12);
  border-color: rgba(46, 125, 50, 0.25);
}
body.theme-two .dgs-section-borrowed {
  background: rgba(168, 85, 247, 0.07);
  border-color: rgba(168, 85, 247, 0.20);
}

/* ─── DGS section header text (hardcoded dark in base) ─ */
body.theme-two .dgs-section-header h3 { color: var(--text); }
body.theme-two .dgs-section-kicker    { color: var(--muted); }
body.theme-two .dgs-section-header    { border-bottom-color: var(--line-soft); }

/* ─── Refurbished (blue) — sticky first cells ───────── */
body.theme-two .dgs-section-refurbished .dgs-inventory-table th:first-child,
body.theme-two .dgs-section-refurbished .dgs-inventory-table th:nth-child(2) {
  background: rgba(99, 140, 255, 0.28);
  color: var(--text);
}
body.theme-two .dgs-section-refurbished .dgs-inventory-table td:first-child,
body.theme-two .dgs-section-refurbished .dgs-inventory-table td:nth-child(2) {
  background: rgba(99, 140, 255, 0.15);
  color: #a5b4fc;
}

/* ─── Warehouse (amber) — sticky first cells ────────── */
body.theme-two .dgs-section-warehouse .dgs-inventory-table th:first-child,
body.theme-two .dgs-section-warehouse .dgs-inventory-table th:nth-child(2) {
  background: rgba(255, 185, 40, 0.28);
  color: var(--text);
}
body.theme-two .dgs-section-warehouse .dgs-inventory-table td:first-child,
body.theme-two .dgs-section-warehouse .dgs-inventory-table td:nth-child(2) {
  background: rgba(255, 185, 40, 0.15);
  color: #fcd34d;
}

/* ─── Borrowed (purple) — table header ──────────────── */
body.theme-two .dgs-section-borrowed .dgs-inventory-table th {
  background: rgba(168, 85, 247, 0.22);
  color: var(--text);
}
body.theme-two .dgs-section-borrowed .dgs-inventory-table tr.vg-a td {
  background: rgba(168, 85, 247, 0.12);
  color: var(--text);
}
body.theme-two .dgs-section-borrowed .dgs-inventory-table tr.vg-b td {
  background: rgba(168, 85, 247, 0.06);
  color: var(--text);
}

/* ─── Light mode — restore DGS section containers ───── */
body.theme-two[data-theme="light"] .dgs-section-refurbished {
  background: linear-gradient(180deg, #eef7ff 0%, #f8fbff 100%);
}
body.theme-two[data-theme="light"] .dgs-section-warehouse {
  background: linear-gradient(180deg, #fff8eb 0%, #fffdf7 100%);
}
body.theme-two[data-theme="light"] .dgs-section-onboard {
  background: linear-gradient(180deg, #edfbf3 0%, #f6fdf9 100%);
}
body.theme-two[data-theme="light"] .dgs-section-borrowed {
  background: linear-gradient(180deg, #fdf4ff 0%, #fdfaff 100%);
}
body.theme-two[data-theme="light"] .dgs-section-header h3 { color: #0f172a; }
body.theme-two[data-theme="light"] .dgs-section-kicker    { color: #5b728b; }

/* ─── DGS Warehouse/Refurbished inputs — dark glass ─── */
/* These sections keep the base 82% white input in light mode (ok)
   but need glass style in dark mode to avoid white boxes on dark */
body.theme-two .dgs-section-warehouse .dgs-inventory-table .input-cell,
body.theme-two .dgs-section-warehouse .dgs-inventory-table .table-input {
  background-color: rgba(180, 120, 10, 0.35) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 200, 80, 0.50) !important;
}
body.theme-two .dgs-section-refurbished .dgs-inventory-table .input-cell,
body.theme-two .dgs-section-refurbished .dgs-inventory-table .table-input {
  background-color: rgba(50, 80, 200, 0.35) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(144, 202, 249, 0.50) !important;
}
body.theme-two .dgs-section-warehouse .dgs-inventory-table .input-cell::placeholder,
body.theme-two .dgs-section-warehouse .dgs-inventory-table .table-input::placeholder,
body.theme-two .dgs-section-refurbished .dgs-inventory-table .input-cell::placeholder,
body.theme-two .dgs-section-refurbished .dgs-inventory-table .table-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* Light mode: white spares row → restored to spec */
body.theme-two[data-theme="light"] .spares-row-white td {
  background: #f5f5f5;
  color: #1a1a1a;
  border-left: 3px solid #9e9e9e;
}
body.theme-two[data-theme="light"] .spares-row-white input {
  background: #ffffff;
  border: 1px solid #bdbdbd;
  color: #1a1a1a;
}

/* Light mode: spares table header */
body.theme-two[data-theme="light"] .spares-table th {
  background: #212121;
  color: #ffffff;
}

/* Light mode: warehouse/refurbished inputs → restore white */
body.theme-two[data-theme="light"] .dgs-section-warehouse .dgs-inventory-table .input-cell,
body.theme-two[data-theme="light"] .dgs-section-warehouse .dgs-inventory-table .table-input,
body.theme-two[data-theme="light"] .dgs-section-refurbished .dgs-inventory-table .input-cell,
body.theme-two[data-theme="light"] .dgs-section-refurbished .dgs-inventory-table .table-input {
  background-color: rgba(255, 255, 255, 0.82) !important;
  color: #1e293b !important;
  border: 1px solid rgba(100, 116, 139, 0.35) !important;
}
/* Light mode: white spares row → restore solid white */
body.theme-two[data-theme="light"] .spares-row-white .input-cell,
body.theme-two[data-theme="light"] .spares-row-white input {
  background-color: #ffffff !important;
  color: #212121 !important;
  border: 1.5px solid #757575 !important;
}

/* Light mode: refurbished/warehouse sticky cells */
body.theme-two[data-theme="light"] .dgs-section-refurbished .dgs-inventory-table th:first-child,
body.theme-two[data-theme="light"] .dgs-section-refurbished .dgs-inventory-table th:nth-child(2) { background: #cfe4fb; color: #0f172a; }
body.theme-two[data-theme="light"] .dgs-section-refurbished .dgs-inventory-table td:first-child,
body.theme-two[data-theme="light"] .dgs-section-refurbished .dgs-inventory-table td:nth-child(2) { background: #eef7ff; color: #1e3a5f; }
body.theme-two[data-theme="light"] .dgs-section-warehouse .dgs-inventory-table th:first-child,
body.theme-two[data-theme="light"] .dgs-section-warehouse .dgs-inventory-table th:nth-child(2) { background: #fde7b0; color: #0f172a; }
body.theme-two[data-theme="light"] .dgs-section-warehouse .dgs-inventory-table td:first-child,
body.theme-two[data-theme="light"] .dgs-section-warehouse .dgs-inventory-table td:nth-child(2) { background: #fff8eb; color: #7c4a00; }
body.theme-two[data-theme="light"] .dgs-section-borrowed .dgs-inventory-table th { background: #e9d5ff; color: #0f172a; }
body.theme-two[data-theme="light"] .dgs-section-borrowed .dgs-inventory-table tr.vg-a td { background: rgba(233, 213, 255, 0.35); color: #1a1a1a; }
body.theme-two[data-theme="light"] .dgs-section-borrowed .dgs-inventory-table tr.vg-b td { background: rgba(250, 245, 255, 0.70); color: #1a1a1a; }

/* ══ ALWAYS-LIGHT TABLES — never change with theme ══════
   These rules are placed AFTER the DGS glass-tint rules
   above so that equal-specificity !important overrides win
   via source order.
   ═══════════════════════════════════════════════════════ */

/* ─── DGS inventory table — always white ────────────── */
body.theme-two .dgs-inventory-table,
body.theme-two .dgs-inventory-table tbody,
body.theme-two .dgs-inventory-table tbody tr {
  background-color: #ffffff !important;
}
body.theme-two .dgs-inventory-table td {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
  border-color: #e0e0e0 !important;
}
body.theme-two .dgs-inventory-table tr:nth-child(even) td {
  background-color: #f9fafb !important;
}
body.theme-two .dgs-inventory-table tr:hover td {
  background-color: #e8f5e9 !important;
}
body.theme-two .dgs-inventory-table th {
  background: #1b5e20 !important;
  color: #ffffff !important;
  border-color: #388e3c !important;
}

/* Explicit section overrides to beat section-specific tints */
body.theme-two .dgs-section-refurbished .dgs-inventory-table td,
body.theme-two .dgs-section-warehouse .dgs-inventory-table td,
body.theme-two .dgs-section-onboard .dgs-inventory-table td,
body.theme-two .dgs-section-borrowed .dgs-inventory-table td,
body.theme-two .dgs-section-borrowed .dgs-inventory-table tr.vg-a td,
body.theme-two .dgs-section-borrowed .dgs-inventory-table tr.vg-b td {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
}

/* DGS section headers visible on light bg */
body.theme-two .dgs-section-header h3 { color: #1a1a1a !important; }
body.theme-two .dgs-section-kicker    { color: #555555 !important; }

/* ─── DGS inputs — always white ──────────────────────── */
/* Placed after the glass-tint input rules above; same
   specificity + !important + later source order = wins  */
body.theme-two .dgs-inventory-table input,
body.theme-two .dgs-inventory-table .input-cell,
body.theme-two .dgs-inventory-table .table-input {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
  border: 1px solid #9e9e9e !important;
}
body.theme-two .dgs-inventory-table input:focus,
body.theme-two .dgs-inventory-table .table-input:focus {
  border-color: #388e3c !important;
  box-shadow: 0 0 0 2px rgba(56, 142, 60, 0.20) !important;
  outline: none;
}

/* Explicit section overrides to beat section !important rules */
body.theme-two .dgs-section-onboard .dgs-inventory-table .input-cell,
body.theme-two .dgs-section-onboard .dgs-inventory-table .table-input,
body.theme-two .dgs-section-warehouse .dgs-inventory-table .input-cell,
body.theme-two .dgs-section-warehouse .dgs-inventory-table .table-input,
body.theme-two .dgs-section-refurbished .dgs-inventory-table .input-cell,
body.theme-two .dgs-section-refurbished .dgs-inventory-table .table-input {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
  border: 1px solid #9e9e9e !important;
}

/* QTY=0 stays red on white background */
body.theme-two .dgs-inventory-table input.qty-zero,
body.theme-two .dgs-inventory-table .qty-zero {
  background-color: #ffebee !important;
  color: #b71c1c !important;
  border-color: #ef9a9a !important;
  font-weight: 700 !important;
}

/* ─── Spares modal table — always light ──────────────── */
/* No !important here — colored-row !important rules win  */
body.theme-two #sparesModal .spares-table td,
body.theme-two .modal-table-wrap .spares-table td {
  background-color: #ffffff;
  color: #1a1a1a;
  border-color: #e0e0e0;
}
body.theme-two #sparesModal .spares-table tr:nth-child(even) td,
body.theme-two .modal-table-wrap .spares-table tr:nth-child(even) td {
  background-color: #f9fafb;
}
body.theme-two #sparesModal .spares-table tr:hover td,
body.theme-two .modal-table-wrap .spares-table tr:hover td {
  background-color: #e8eaf6;
}

/* ─── Asset Status table — dark glass ───────────────── */
body.theme-two .asset-status-table {
  background: rgba(255, 255, 255, 0.02);
}
body.theme-two .asset-status-table td {
  background-color: transparent;
  color: #c9cfe8;
  border-color: rgba(255, 255, 255, 0.07);
}
body.theme-two .asset-status-table tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.025);
}
body.theme-two .asset-status-table tr:hover td {
  background-color: rgba(99, 102, 241, 0.10);
}
body.theme-two .asset-status-table th {
  background: #1a1a2e;
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.20);
}
body.theme-two[data-theme="light"] .asset-status-table td {
  background-color: #ffffff;
  color: #1a1a1a;
  border-color: #e0e0e0;
}
body.theme-two[data-theme="light"] .asset-status-table tr:nth-child(even) td {
  background-color: #f5f5f5;
}
body.theme-two[data-theme="light"] .asset-status-table tr:hover td {
  background-color: #e3f2fd;
}
body.theme-two[data-theme="light"] .asset-status-table th {
  background: #212121;
  color: #ffffff;
}

/* ─── Price List table — dark glass ─────────────────── */
body.theme-two #theme-price-list table {
  background: rgba(255, 255, 255, 0.02);
}
body.theme-two #theme-price-list table td {
  background-color: transparent;
  color: #c9cfe8;
  border-color: rgba(255, 255, 255, 0.07);
}
body.theme-two #theme-price-list table tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.025);
}
body.theme-two #theme-price-list table tr:hover td {
  background-color: rgba(99, 102, 241, 0.10);
}
body.theme-two #theme-price-list table th {
  background: #1a1a2e;
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.20);
}
body.theme-two[data-theme="light"] #theme-price-list table td {
  background-color: #ffffff;
  color: #1a1a1a;
  border-color: #e0e0e0;
}
body.theme-two[data-theme="light"] #theme-price-list table tr:nth-child(even) td {
  background-color: #f5f5f5;
}
body.theme-two[data-theme="light"] #theme-price-list table th {
  background: #212121;
  color: #ffffff;
}

/* ─── Colored spares rows — stay solid ──────────────── */
body.theme-two .spares-row-blue td   { background: #1a237e !important; color: #ffffff !important; }
body.theme-two .spares-row-green td  { background: #1b5e20 !important; color: #ffffff !important; }
body.theme-two .spares-row-yellow td { background: #7c5a00 !important; color: #ffffff !important; }
body.theme-two .spares-row-white td  { background: #f5f5f5 !important; color: #1a1a1a !important; }


/* ═══════════════════════════════════════════════════════
   CONTRACTS DASHBOARD GRID
   ═══════════════════════════════════════════════════════ */

body.theme-two .contracts-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 0;
}

body.theme-two .contract-dash-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}
body.theme-two .contract-dash-card:hover {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.35);
  box-shadow: 0 0 20px rgba(99,102,241,0.15);
}

body.theme-two .cdc-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.theme-two .cdc-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
}
body.theme-two .cdc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
body.theme-two .cdc-status-dot.active  { background: #34d399; box-shadow: 0 0 6px #34d399; }
body.theme-two .cdc-status-dot.expired { background: #f87171; box-shadow: 0 0 6px #f87171; }
body.theme-two .cdc-status-dot.draft   { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }

body.theme-two .cdc-status-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
body.theme-two .contract-dash-card.status-active  .cdc-status-label { color: #34d399; }
body.theme-two .contract-dash-card.status-expired .cdc-status-label { color: #f87171; }
body.theme-two .contract-dash-card.status-draft   .cdc-status-label { color: #fbbf24; }

body.theme-two .cdc-number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: #c7d2fe;
  letter-spacing: 0.02em;
}
body.theme-two .cdc-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
body.theme-two .cdc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
body.theme-two .cdc-meta strong { color: var(--text); }
body.theme-two .expired-text { color: #f87171 !important; }

/* Light mode contracts grid */
body.theme-two[data-theme="light"] .contract-dash-card {
  background: rgba(255,255,255,0.70);
  border-color: rgba(70,80,180,0.15);
  box-shadow: 0 2px 12px rgba(70,80,160,0.08);
}
body.theme-two[data-theme="light"] .contract-dash-card:hover {
  background: rgba(99,102,241,0.08);
  border-color: rgba(67,56,202,0.30);
}
body.theme-two[data-theme="light"] .cdc-number { color: #3730a3; }
body.theme-two[data-theme="light"] .cdc-meta { border-top-color: rgba(70,80,180,0.12); }

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 980px) {
  body.theme-two .theme-two-shell {
    grid-template-columns: 1fr;
  }

  body.theme-two .theme-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  body.theme-two .theme-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.theme-two .topbar {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  body.theme-two .contracts-dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebar brand: compact on tablet */
  body.theme-two .theme-sidebar-brand h1 {
    font-size: 16px;
  }

  body.theme-two .theme-sidebar-brand p {
    font-size: 11px;
  }

  /* Topbar actions: horizontal scroll */
  body.theme-two .topbar .actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  body.theme-two .topbar .actions::-webkit-scrollbar { display: none; }

  body.theme-two .topbar .actions > * {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  /* KPI grid */
  body.theme-two #kpiGrid {
    grid-template-columns: 1fr;
  }

  body.theme-two .kpi {
    grid-column: span 1 !important;
  }
}

@media (max-width: 620px) {
  body.theme-two .theme-main {
    padding: 10px;
  }

  body.theme-two .theme-sidebar-nav {
    grid-template-columns: 1fr;
  }

  /* Sidebar: collapse to compact top bar on phones */
  body.theme-two .theme-sidebar {
    padding: 10px 12px;
  }

  body.theme-two .theme-sidebar-brand {
    margin-bottom: 8px;
  }

  body.theme-two .theme-sidebar-brand h1 {
    font-size: 14px;
  }

  body.theme-two .theme-sidebar-brand p {
    display: none;
  }

  body.theme-two .theme-nav-item {
    padding: 8px 10px;
    font-size: 13px;
    min-height: 40px;
  }

  /* Title block */
  body.theme-two .theme-main .title h1 {
    font-size: 17px;
  }

  body.theme-two .theme-main .title p {
    font-size: 11px;
  }
}

/* Equipment Status badges: keep Ready green and Not Ready red in both themes. */
body.theme-two .asset-status-table .status-select {
  font-weight: 800;
  border-radius: 9px;
  border-width: 1px;
}

body.theme-two .asset-status-table .status-select-ok {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, 0.42) !important;
}

body.theme-two .asset-status-table .status-select-danger {
  background: rgba(239, 68, 68, 0.24) !important;
  color: #fecaca !important;
  border-color: rgba(239, 68, 68, 0.50) !important;
}

body.theme-two .asset-status-table .status-select-info {
  background: rgba(14, 165, 233, 0.20) !important;
  color: #bae6fd !important;
  border-color: rgba(14, 165, 233, 0.42) !important;
}

body.theme-two[data-theme="light"] .asset-status-table .status-select-ok {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}

body.theme-two[data-theme="light"] .asset-status-table .status-select-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

body.theme-two[data-theme="light"] .asset-status-table .status-select-info {
  background: #e0f2fe !important;
  color: #075985 !important;
  border-color: #7dd3fc !important;
}
