/* ═══════════════════════════════════════════════════════════════════════
   mui-overrides.css — Material-UI styled overrides for legacy CSS classes.

   Applies MUI Material-Design aesthetics to all pages that still use the
   legacy .fi / .fbtn / .panel / .tbl / .chip classes, WITHOUT touching
   any page JSX. Covers ~5,000 inline-styled elements across 31 page files.

   Loaded AFTER index.html's inline <style>, so rules here win via specificity.
   ═══════════════════════════════════════════════════════════════════════ */

/* ═════════════════════════════════════════════════════════════════════════
   Alias undefined CSS vars (many legacy pages reference --br / --ac22 etc.)
   that were never defined → they would fall back to transparent/black.
   ═════════════════════════════════════════════════════════════════════════ */
:root {
  --br: #2a2e36;
  --bg1: #14171c;
  --bg2: #1a1d24;
  --bg3: #22262e;
  --bg4: #2a2e36;
  --bg5: #343842;
  --ac22: rgba(255, 209, 0, 0.13);
  --ac44: rgba(255, 209, 0, 0.27);
  --tx: rgba(255, 255, 255, 0.92);
  --tx2: rgba(255, 255, 255, 0.75);
  --tx3: rgba(255, 255, 255, 0.55);
  --tx4: rgba(255, 255, 255, 0.4);
}

/* Match MUI's font stack */
body, input, button, select, textarea, table, th, td {
  font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═════════════════════════════════════════════════════════════════════════
   Generic input/textarea baseline — force dark bg when no explicit class.
   Uses generous line-height + min-height so descenders (g, p, y) aren't cut.
   ═════════════════════════════════════════════════════════════════════════ */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not(.MuiInputBase-input),
textarea:not(.MuiInputBase-input),
select:not(.MuiNativeSelect-select):not(.MuiSelect-select) {
  background-color: #1a1d24 !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 4px !important;
  caret-color: #ffd100;
  line-height: 1.6 !important;
  padding: 8px 12px !important;
  font-size: 0.82rem !important;
  box-sizing: border-box !important;
}
input:not([type=checkbox]):not([type=radio]):not(.MuiInputBase-input) {
  min-height: 36px !important;
}
select:not(.MuiNativeSelect-select):not(.MuiSelect-select) {
  min-height: 36px !important;
  padding-right: 32px !important;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffd100' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px !important;
}
textarea:not(.MuiInputBase-input) {
  min-height: 80px !important;
  line-height: 1.5 !important;
}
input:not([type=checkbox]):not([type=radio]):not(.MuiInputBase-input):focus,
textarea:not(.MuiInputBase-input):focus,
select:not(.MuiNativeSelect-select):not(.MuiSelect-select):focus {
  border-color: #ffd100 !important;
  outline: none !important;
  box-shadow: 0 0 0 1px #ffd100 inset !important;
}
input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
  opacity: 1 !important;
}

/* MUI Select displayed value — ensure descenders render */
.MuiSelect-select,
.MuiNativeSelect-select,
.MuiInputBase-input {
  line-height: 1.5 !important;
  min-height: unset !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
.MuiOutlinedInput-input {
  padding: 10px 14px !important;
  line-height: 1.5 !important;
}

/* Buttons — avoid descender clipping */
button, .fbtn, .MuiButton-root {
  line-height: 1.5 !important;
}

/* Native <option> elements (browser default = white bg) — force dark */
option {
  background-color: #1a1d24 !important;
  color: rgba(255, 255, 255, 0.92) !important;
  padding: 8px 12px !important;
}
option:hover,
option:checked,
option:focus {
  background-color: rgba(255, 209, 0, 0.14) !important;
  color: #ffd100 !important;
}
optgroup {
  background-color: #14171c !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-weight: 600 !important;
}

/* Firefox-specific: dropdown popup inherits these when we force color-scheme */
select {
  color-scheme: dark;
}

/* Force dark theme palette — override any data-theme="light" remnants */
html, html[data-theme="light"], html[data-theme="dark"] {
  color-scheme: dark;
  background-color: #0b0d10;
}
html[data-theme="light"] body {
  background-color: #0b0d10 !important;
  color: rgba(255, 255, 255, 0.87) !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   Universal "anything white" catch-all — page-level whites turned dark.
   Targets inline styles that set white backgrounds (common legacy pattern).
   ═════════════════════════════════════════════════════════════════════════ */
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background:#ffffff"],
[style*="background: #ffffff"],
[style*="background:white"],
[style*="background: white"],
[style*="background-color:#fff"],
[style*="background-color: #fff"],
[style*="background-color:#ffffff"],
[style*="background-color:white"] {
  background-color: #1a1d24 !important;
  color: rgba(255, 255, 255, 0.87) !important;
}

/* Any element with white or near-white text on unknown bg — ensure readable */
.MuiTypography-root,
.MuiListItemText-primary,
.MuiListItemText-secondary,
.MuiDialogTitle-root {
  color: inherit !important;
}

/* Improve text contrast for all common text color vars */
body { color: rgba(255, 255, 255, 0.92) !important; }

/* Labels across forms should always be readable on dark */
label, .fl, legend {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Empty-state / "No data" messages — make readable */
[class*="empty"], [class*="no-data"] {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   MATERIAL PAPER AESTHETICS FOR INLINE-STYLED DIVS
   Many legacy pages use <div style="background:var(--bg1/bg2);border:1px
   solid var(--br/border);borderRadius:..."> as pseudo-cards. Catch these
   attribute patterns and style them as MUI Paper cards.
   ═════════════════════════════════════════════════════════════════════════ */
[style*="background:var(--bg1)"],
[style*="background: var(--bg1)"],
[style*="background:var(--bg2)"],
[style*="background: var(--bg2)"],
[style*="background:var(--bg3)"],
[style*="background: var(--bg3)"] {
  background-color: #1a1d24 !important;
  color: rgba(255, 255, 255, 0.87) !important;
  transition: border-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}
[style*="border:1px solid var(--br)"],
[style*="border: 1px solid var(--br)"],
[style*="border:1px solid var(--border)"],
[style*="border: 1px solid var(--border)"],
[style*="border:1px solid var(--b2)"],
[style*="border: 1px solid var(--b2)"] {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
}
/* Elevated pseudo-cards get subtle MUI shadow on hover */
[style*="background:var(--bg1)"]:hover,
[style*="background: var(--bg1)"]:hover,
[style*="background:var(--bg2)"]:hover,
[style*="background: var(--bg2)"]:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

/* Pill/badge spans with gradient or tinted bg — MUI Chip look */
span[style*="background:"][style*="color:"][style*="borderRadius"],
span[style*="padding:"][style*="borderRadius"][style*="fontSize"] {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.4 !important;
  letter-spacing: 0.01em !important;
}

/* Buttons with inline var(--ac) primary color → MUI Button aesthetic */
button[style*="background:var(--ac)"],
button[style*="background: var(--ac)"] {
  background-color: #ffd100 !important;
  color: #000 !important;
  border: none !important;
  border-radius: 6px !important;
  box-shadow:
    0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14),
    0px 1px 5px 0px rgba(0, 0, 0, 0.12) !important;
  transition: background-color 250ms, box-shadow 250ms !important;
  font-weight: 500 !important;
  line-height: 1.75 !important;
  letter-spacing: 0.02857em !important;
}
button[style*="background:var(--ac)"]:hover,
button[style*="background: var(--ac)"]:hover {
  background-color: #e6bc00 !important;
  box-shadow:
    0px 2px 4px -1px rgba(0, 0, 0, 0.2),
    0px 4px 5px 0px rgba(0, 0, 0, 0.14),
    0px 1px 10px 0px rgba(0, 0, 0, 0.12) !important;
}

/* Buttons with inline var(--ac22) accent tinted bg */
button[style*="background:var(--ac22)"],
button[style*="background: var(--ac22)"] {
  background-color: rgba(255, 209, 0, 0.14) !important;
  color: #ffd100 !important;
  border: 1px solid rgba(255, 209, 0, 0.4) !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
}
button[style*="background:var(--ac22)"]:hover {
  background-color: rgba(255, 209, 0, 0.2) !important;
  border-color: #ffd100 !important;
}

/* Generic <button> without class — default to Material outline look */
button:not(.fbtn):not([class*="MuiButton"]):not(.sb-collapse):not(.tb-btn):not(.pg-btn):not(.sb-logout):not([class*="search-"]) {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.87);
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 200ms, border-color 200ms;
  line-height: 1.6;
}
button:not(.fbtn):not([class*="MuiButton"]):not(.sb-collapse):not(.tb-btn):not(.pg-btn):not(.sb-logout):not([class*="search-"]):hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.42);
}

/* Section headers with emoji + text — just ensure readable */
div[style*="fontSize:'1.15rem'"],
div[style*="fontSize: '1.15rem'"],
div[style*="fontSize:'1.2rem'"],
div[style*="fontSize: '1.2rem'"],
div[style*="fontSize:'1.3rem'"],
div[style*="fontSize: '1.3rem'"] {
  color: rgba(255, 255, 255, 0.92) !important;
  letter-spacing: 0 !important;
}

/* Card grids (grid-template-columns with repeat) — add gap if missing */
div[style*="gridTemplateColumns"] {
  align-items: stretch !important;
}

/* Links inside content */
a:not([class*="Mui"]):not([class*="sb-"]):not([class*="tb-"]) {
  color: #ffd100;
  text-decoration: none;
  transition: color 150ms;
}
a:not([class*="Mui"]):not([class*="sb-"]):not([class*="tb-"]):hover {
  text-decoration: underline;
  color: #ffdf3a;
}

/* Ensure any <hr> is subtle Material divider */
hr {
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin: 16px 0 !important;
}

/* Code blocks / pre — Material monospace look */
pre, code {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  font-family: 'IBM Plex Mono', 'Roboto Mono', 'Menlo', monospace !important;
  font-size: 0.8rem !important;
  color: #a8e6ff !important;
}
pre {
  padding: 12px 14px !important;
  overflow-x: auto !important;
}
pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* Checkbox/radio inline — ensure sized properly */
input[type="checkbox"], input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  accent-color: #ffd100 !important;
  cursor: pointer;
}

/* Ranges/sliders */
input[type="range"] {
  accent-color: #ffd100 !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   MUI NATIVE COMPONENTS — force dark palette (emotion injectFirst means
   theme styles get overridden by plain CSS; re-establish dark colors).
   ═════════════════════════════════════════════════════════════════════════ */
.MuiPaper-root {
  background-color: #1a1d24 !important;
  background-image: none !important;
  color: rgba(255, 255, 255, 0.87) !important;
}
.MuiPaper-root.MuiPaper-elevation0 {
  background-color: transparent !important;
}
.MuiPaper-outlined {
  background-color: #14171c !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}
.MuiCard-root {
  background-color: #1a1d24 !important;
  background-image: none !important;
  color: rgba(255, 255, 255, 0.87) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.MuiAppBar-root,
.MuiAppBar-colorPrimary,
.MuiAppBar-colorDefault {
  background-color: #14171c !important;
  color: rgba(255, 255, 255, 0.87) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}
.MuiDrawer-paper {
  background-color: #14171c !important;
  background-image: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.87) !important;
}
.MuiDialog-paper {
  background-color: #1a1d24 !important;
  background-image: none !important;
  color: rgba(255, 255, 255, 0.87) !important;
}
.MuiDialogTitle-root,
.MuiDialogContent-root,
.MuiDialogActions-root { color: rgba(255, 255, 255, 0.87) !important; }
.MuiDialogContentText-root { color: rgba(255, 255, 255, 0.7) !important; }

.MuiMenu-paper,
.MuiPopover-paper,
.MuiAutocomplete-paper {
  background-color: #1a1d24 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.87) !important;
}

.MuiMenuItem-root,
.MuiAutocomplete-option {
  color: rgba(255, 255, 255, 0.87) !important;
}
.MuiMenuItem-root:hover,
.MuiAutocomplete-option:hover,
.MuiAutocomplete-option.Mui-focused {
  background-color: rgba(255, 255, 255, 0.06) !important;
}
.MuiMenuItem-root.Mui-selected {
  background-color: rgba(255, 209, 0, 0.14) !important;
}

.MuiTooltip-tooltip {
  background-color: #2a2e36 !important;
  color: #fff !important;
  font-size: 0.72rem !important;
}

/* Typography — ensure readable on dark */
.MuiTypography-root { color: inherit; }
.MuiTypography-colorTextPrimary   { color: rgba(255, 255, 255, 0.87) !important; }
.MuiTypography-colorTextSecondary { color: rgba(255, 255, 255, 0.6) !important; }
.MuiTypography-colorTextDisabled  { color: rgba(255, 255, 255, 0.38) !important; }

/* List items (Drawer navigation) */
.MuiListItemButton-root {
  color: rgba(255, 255, 255, 0.87) !important;
  border-radius: 4px !important;
}
.MuiListItemButton-root:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}
.MuiListItemButton-root.Mui-selected {
  background-color: rgba(255, 209, 0, 0.16) !important;
  color: #ffd100 !important;
}
.MuiListItemIcon-root { color: inherit !important; }
.MuiListSubheader-root {
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.7rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

/* Divider */
.MuiDivider-root { border-color: rgba(255, 255, 255, 0.08) !important; }

/* Table */
.MuiTable-root       { background-color: transparent !important; }
.MuiTableCell-root   { border-color: rgba(255, 255, 255, 0.08) !important; color: rgba(255, 255, 255, 0.87) !important; }
.MuiTableCell-head   { color: rgba(255, 255, 255, 0.75) !important; font-weight: 600 !important; background-color: transparent !important; }
.MuiTableRow-root:hover .MuiTableCell-root { background-color: rgba(255, 255, 255, 0.03) !important; }

/* TextField outlined — dark fields */
.MuiOutlinedInput-root {
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.87) !important;
}
.MuiOutlinedInput-notchedOutline { border-color: rgba(255, 255, 255, 0.23) !important; }
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline { border-color: rgba(255, 255, 255, 0.42) !important; }
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline { border-color: #ffd100 !important; border-width: 2px !important; }
.MuiInputLabel-root   { color: rgba(255, 255, 255, 0.6) !important; }
.MuiInputLabel-root.Mui-focused { color: #ffd100 !important; }
.MuiFormHelperText-root { color: rgba(255, 255, 255, 0.55) !important; }

/* Button — keep yellow primary with black text */
.MuiButton-containedPrimary {
  background-color: #ffd100 !important;
  color: #000 !important;
}
.MuiButton-containedPrimary:hover { background-color: #e6bc00 !important; }
.MuiButton-outlinedPrimary { color: #ffd100 !important; border-color: rgba(255, 209, 0, 0.5) !important; }
.MuiButton-outlinedPrimary:hover { background-color: rgba(255, 209, 0, 0.08) !important; border-color: #ffd100 !important; }
.MuiButton-textPrimary    { color: #ffd100 !important; }

/* Chip (MUI) — ensure readable */
.MuiChip-root { color: rgba(255, 255, 255, 0.87) !important; }
.MuiChip-filled { background-color: rgba(255, 255, 255, 0.1) !important; }
.MuiChip-outlined { background-color: transparent !important; border: 1px solid rgba(255, 255, 255, 0.23) !important; }

/* Alert — match MUI severity palette */
.MuiAlert-standardInfo     { background-color: rgba(2, 136, 209, 0.12) !important; color: #90caf9 !important; }
.MuiAlert-standardSuccess  { background-color: rgba(46, 125, 50, 0.14) !important; color: #66bb6a !important; }
.MuiAlert-standardWarning  { background-color: rgba(237, 108, 2, 0.14) !important; color: #ffa726 !important; }
.MuiAlert-standardError    { background-color: rgba(211, 47, 47, 0.14) !important; color: #ff6b6b !important; }

/* Tabs */
.MuiTabs-indicator { background-color: #ffd100 !important; }
.MuiTab-root       { color: rgba(255, 255, 255, 0.6) !important; }
.MuiTab-root.Mui-selected { color: #ffd100 !important; }

/* Accordion */
.MuiAccordion-root {
  background-color: #1a1d24 !important;
  background-image: none !important;
  color: rgba(255, 255, 255, 0.87) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Checkbox / Radio / Switch — tinted colors */
.MuiCheckbox-root,
.MuiRadio-root      { color: rgba(255, 255, 255, 0.54) !important; }
.MuiCheckbox-root.Mui-checked,
.MuiRadio-root.Mui-checked { color: #ffd100 !important; }
.MuiSwitch-track    { background-color: rgba(255, 255, 255, 0.3) !important; }
.MuiSwitch-thumb    { background-color: #fafafa !important; }
.MuiSwitch-colorPrimary.Mui-checked .MuiSwitch-thumb { background-color: #ffd100 !important; }
.MuiSwitch-colorPrimary.Mui-checked + .MuiSwitch-track { background-color: rgba(255, 209, 0, 0.5) !important; }

/* LinearProgress / CircularProgress — yellow accent */
.MuiLinearProgress-barColorPrimary,
.MuiCircularProgress-colorPrimary { color: #ffd100 !important; }
.MuiLinearProgress-barColorPrimary { background-color: #ffd100 !important; }

/* IconButton */
.MuiIconButton-root { color: rgba(255, 255, 255, 0.87) !important; }
.MuiIconButton-root:hover { background-color: rgba(255, 255, 255, 0.08) !important; }

/* Backdrop behind dialogs */
.MuiBackdrop-root { background-color: rgba(0, 0, 0, 0.7) !important; }

/* ─────────────────────────────────────────────────────────────────────
   PANELS → MUI Paper (elevation 1)
   ───────────────────────────────────────────────────────────────────── */
.panel {
  background: #1a1d24 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  box-shadow:
    0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14),
    0px 1px 3px 0px rgba(0, 0, 0, 0.12) !important;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.panel:hover {
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    0px 3px 3px -2px rgba(0, 0, 0, 0.2),
    0px 3px 4px 0px rgba(0, 0, 0, 0.14),
    0px 1px 8px 0px rgba(0, 0, 0, 0.12) !important;
}
.panel-accent  { border-color: rgba(255, 209, 0, 0.32) !important; }
.panel-danger  { border-color: rgba(255, 83, 112, 0.36) !important; }
.panel-success { border-color: rgba(46, 204, 113, 0.36) !important; }

.ph {
  padding: 14px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}
.ph-t {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  color: rgba(255, 255, 255, 0.85) !important;
  text-transform: uppercase !important;
}
.pb { padding: 20px !important; }

/* ─────────────────────────────────────────────────────────────────────
   INPUTS → MUI TextField (outlined, small)
   ───────────────────────────────────────────────────────────────────── */
.fi, .finput, input.fi, textarea.fi, select.fi, .fsel {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.23) !important;
  color: #e6edf3 !important;
  padding: 8.5px 14px !important;
  border-radius: 4px !important;
  font-size: 0.875rem !important;
  font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
  outline: none !important;
  transition:
    border-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
  line-height: 1.4375em !important;
}
.fi:hover, .finput:hover, .fsel:hover {
  border-color: rgba(255, 255, 255, 0.42) !important;
}
.fi:focus, .finput:focus, .fsel:focus,
.fi:focus-visible, .finput:focus-visible, .fsel:focus-visible {
  border-color: #ffd100 !important;
  box-shadow: 0 0 0 1px #ffd100 inset !important;
  outline: none !important;
}
.fi::placeholder, .finput::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  opacity: 1 !important;
}
.fl {
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
  margin-bottom: 2px !important;
}

/* ─────────────────────────────────────────────────────────────────────
   BUTTONS → MUI Button (contained primary)
   ───────────────────────────────────────────────────────────────────── */
.fbtn {
  background: #ffd100 !important;
  color: rgba(0, 0, 0, 0.87) !important;
  border: none !important;
  padding: 6px 16px !important;
  border-radius: 4px !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  letter-spacing: 0.02857em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-width: 64px !important;
  line-height: 1.75 !important;
  box-shadow:
    0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14),
    0px 1px 5px 0px rgba(0, 0, 0, 0.12) !important;
  transition:
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  user-select: none !important;
}
.fbtn:hover {
  background: #e6bc00 !important;
  box-shadow:
    0px 2px 4px -1px rgba(0, 0, 0, 0.2),
    0px 4px 5px 0px rgba(0, 0, 0, 0.14),
    0px 1px 10px 0px rgba(0, 0, 0, 0.12) !important;
  opacity: 1 !important;
}
.fbtn:active {
  box-shadow:
    0px 5px 5px -3px rgba(0, 0, 0, 0.2),
    0px 8px 10px 1px rgba(0, 0, 0, 0.14),
    0px 3px 14px 2px rgba(0, 0, 0, 0.12) !important;
  transform: none !important;
}
.fbtn:disabled {
  background: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}
/* Secondary button → MUI outlined */
.fbtn.sec {
  background: transparent !important;
  color: #ffd100 !important;
  border: 1px solid rgba(255, 209, 0, 0.5) !important;
  box-shadow: none !important;
}
.fbtn.sec:hover {
  background: rgba(255, 209, 0, 0.08) !important;
  border-color: #ffd100 !important;
  box-shadow: none !important;
}
/* Danger → MUI error */
.fbtn.danger {
  background: #d32f2f !important;
  color: #fff !important;
  border: none !important;
}
.fbtn.danger:hover { background: #b72828 !important; }

/* ─────────────────────────────────────────────────────────────────────
   TABLES → MUI Table look
   ───────────────────────────────────────────────────────────────────── */
.tbl {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.875rem !important;
}
.tbl th {
  text-align: left !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: rgba(255, 255, 255, 0.75) !important;
  padding: 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: transparent !important;
  line-height: 1.5rem !important;
}
.tbl td {
  padding: 14px 16px !important;
  font-size: 0.875rem !important;
  color: rgba(255, 255, 255, 0.87) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  line-height: 1.43 !important;
}
.tbl tr:last-child td { border-bottom: none !important; }
.tbl tbody tr {
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.tbl tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}
.tbl tbody tr.sel td {
  background: rgba(255, 209, 0, 0.08) !important;
}

/* ─────────────────────────────────────────────────────────────────────
   CHIPS → MUI Chip (small)
   ───────────────────────────────────────────────────────────────────── */
.chip, .tc {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 0 10px !important;
  height: 24px !important;
  border-radius: 16px !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
.tc { height: 20px !important; padding: 0 8px !important; font-size: 0.7rem !important; }

/* ─────────────────────────────────────────────────────────────────────
   FORM ROWS & LAYOUT — Material spacing
   ───────────────────────────────────────────────────────────────────── */
.frow { gap: 16px !important; }
.fg   { gap: 6px !important; }

/* Alert-like boxes → MUI Alert */
.ferr {
  background: rgba(211, 47, 47, 0.12) !important;
  color: #ff6b6b !important;
  border: 1px solid rgba(211, 47, 47, 0.3) !important;
  border-radius: 4px !important;
  padding: 12px 16px !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
}
.fok {
  background: rgba(46, 204, 113, 0.12) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(46, 204, 113, 0.3) !important;
  border-radius: 4px !important;
  padding: 12px 16px !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
}

/* ─────────────────────────────────────────────────────────────────────
   Key-value display (kv/kk/kv-val) → MUI List with dividers
   ───────────────────────────────────────────────────────────────────── */
.kv {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 4px !important;
  gap: 0 !important;
}
.kk {
  background: rgba(255, 255, 255, 0.02) !important;
  padding: 10px 16px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.kv-val {
  background: transparent !important;
  padding: 10px 16px !important;
  font-size: 0.875rem !important;
  color: rgba(255, 255, 255, 0.87) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.kv > *:last-child { border-bottom: none !important; }

/* Tags → MUI Chip (outlined variant) */
.tag {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.23) !important;
  border-radius: 16px !important;
  padding: 0 10px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 0.75rem !important;
  font-family: inherit !important;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.87) !important;
  line-height: 1 !important;
}

/* Section titles */
.rst {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: rgba(255, 255, 255, 0.87) !important;
  margin-bottom: 16px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.rst::after { display: none !important; }

/* ─────────────────────────────────────────────────────────────────────
   Indicator blocks → MUI Alert-like
   ───────────────────────────────────────────────────────────────────── */
.ind {
  border-radius: 4px !important;
  padding: 12px 16px !important;
  margin-bottom: 8px !important;
  border-left-width: 4px !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
}
.ic { background: rgba(211, 47, 47, 0.12) !important; border-left-color: #d32f2f !important; }
.ih { background: rgba(237, 108, 2, 0.12) !important; border-left-color: #ed6c02 !important; }
.im { background: rgba(2, 136, 209, 0.12) !important; border-left-color: #0288d1 !important; }
.il { background: rgba(46, 125, 50, 0.12) !important; border-left-color: #2e7d32 !important; }

/* ─────────────────────────────────────────────────────────────────────
   Sidebar item ripple effect (approximate MUI ListItemButton)
   ───────────────────────────────────────────────────────────────────── */
.sb-item {
  position: relative !important;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 4px !important;
  margin: 2px 6px !important;
}
.sb-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
.sb-item.act {
  background: rgba(255, 209, 0, 0.15) !important;
  color: #ffd100 !important;
}
.sb-item.act:hover {
  background: rgba(255, 209, 0, 0.2) !important;
}

/* ─────────────────────────────────────────────────────────────────────
   Scrollbar — Material style
   ───────────────────────────────────────────────────────────────────── */
*::-webkit-scrollbar { width: 8px !important; height: 8px !important; }
*::-webkit-scrollbar-track { background: transparent !important; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14) !important;
  border-radius: 4px !important;
  transition: background 150ms !important;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25) !important; }

/* (Headings intentionally left alone — legacy pages use h1-h6 with custom
   inline styles; MUI Typography handles its own variant sizing.) */
