@import url("../vendor/fontawesome/css/all.min.css?v=20260911e");
@import url("../../mobile/css/smm-fonts.css?v=20260911e");
@import url("icon-buttons.css?v=20260913v");
@import url("credit-coin.css?v=20260916a");

:root {
  --primary: #af101a;
  --grad-end: #B71C1C;
  --surface: #fbf9f8;
  --ink: #1b1c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; font-family: "Prompt", sans-serif; background: #f0eded; color: var(--ink); overflow-x: hidden; max-width: 100%; min-width: 0; }
.top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 1rem 1.25rem; background: linear-gradient(135deg, #D32F2F, #B71C1C); color: #fff; min-width: 0; }
.top h1 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.top p { margin: 0; opacity: .9; font-size: .875rem; overflow-wrap: anywhere; }
.top > div { min-width: 0; flex: 1 1 12rem; }
.logo { border-radius: 8px; background: #fff; width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.pill { margin-left: auto; padding: .5rem 1rem; border-radius: 999px; font-weight: 700; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; max-width: 100%; }
.pill.ok { background: #2E7D32; }
.pill.bad { background: #93000a; }
.pill.wait { background: #FFA000; color: #1b1c1c; }
.top, .grid, .foot { max-width: 1680px; margin-left: auto; margin-right: auto; width: 100%; }
.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 1rem; }
.wide { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}
@media (min-width: 1280px) {
  .grid { gap: 1.25rem; padding: 1.5rem; }
}
.card { background: var(--surface); border-radius: 12px; padding: 1rem; box-shadow: 0 4px 16px rgba(0,0,0,.06); min-width: 0; }
@media (min-width: 640px) {
  .card:not(.wide) { max-width: 42rem; }
  .grid > .card:not(.wide):only-child { margin: 0 auto; }
}
@media (min-width: 1280px) {
  .card { padding: 1.25rem 1.5rem; }
}
.card h2 { margin: 0 0 .75rem; font-size: 1.05rem; color: var(--primary); display: flex; gap: .5rem; align-items: center; }
.card label { display: block; margin: .5rem 0; font-size: .875rem; }
.card label input:not([type="checkbox"]):not([type="radio"]) {
  display: block; width: 100%; max-width: 28rem; margin-top: .25rem; padding: .5rem .65rem; border: 1px solid #e4beba; border-radius: 8px;
}
.card pre.mono { background: #fff; border: 1px dashed #e4beba; padding: .75rem; border-radius: 8px; overflow-x: auto; font-size: .8rem; }
.card button { margin-top: .5rem; margin-right: .5rem; padding: .55rem 1rem; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; min-height: 44px; }
.card button:hover { filter: brightness(1.05); }
.muted { color: #5d5f5f; font-size: .875rem; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (min-width: 480px) {
  .kpis { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
}
.kpis span { display: block; font-size: 1.5rem; font-weight: 800; }
.kpis label { font-size: .8rem; color: #5d5f5f; }

/* ===== /admin/integrations.html — stacked adapter rows ===== */
.integ-rows {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.integ-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .65rem 1rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid #e4beba;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  min-width: 0;
}
.integ-row-head {
  flex: 0 0 11rem;
  min-width: 9rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  align-self: center;
}
.integ-title {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.integ-mode.pill {
  margin: 0;
  align-self: flex-start;
  min-height: 28px;
  padding: .2rem .65rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: lowercase;
}
.integ-row-fields {
  flex: 1 1 14rem;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem .75rem;
}
@media (min-width: 640px) {
  .integ-row-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.integ-row-fields label {
  margin: .25rem 0;
  font-size: .8rem;
  color: #5d5f5f;
}
.integ-row-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  margin-left: auto;
  align-self: center;
}
.integ-enable.switch {
  margin: 0;
  white-space: nowrap;
}
.integ-row-actions .integ-ping {
  margin: 0;
}
.integ-save-bar {
  margin-top: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
@media (max-width: 639px) {
  .integ-row-head,
  .integ-row-actions {
    flex: 1 1 100%;
    margin-left: 0;
    align-self: stretch;
  }
  .integ-row-actions { justify-content: flex-start; }
}

/* ===== /admin/credit-exchange.html — rate row + note row ===== */
.credit-settings-form { margin-top: .25rem; }
.credit-form-row {
  display: flex;
  align-items: center;
  gap: .75rem 1.25rem;
}
.credit-form-row--note { margin-top: .75rem; }
.credit-field {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  margin: 0;
}
.credit-field--rate { flex: 0 0 auto; }
.credit-form-row--note .credit-field--note {
  flex: 1 1 100%;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: .25rem;
}
.credit-rate-label {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.credit-unit {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.credit-field-label {
  display: block;
  margin: 0;
  font-size: .8rem;
  color: #5d5f5f;
}
.credit-field--rate input {
  width: 5.5rem;
  max-width: 5.5rem;
  flex: 0 0 auto;
}
.credit-form-row--note input {
  width: 100%;
  min-width: 0;
}
.credit-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
}
.credit-form-actions button {
  margin: 0;
}
.credit-valuation-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.credit-valuation-options label.switch {
  margin: 0;
}
.credit-valuation-options label.switch span {
  display: inline;
  font-size: .9rem;
  font-weight: 400;
  color: var(--ink);
}

/* ===== /admin/settings.html — datetime row + promo cashless ===== */
.settings-dt-form { margin-top: .25rem; }
.settings-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .75rem 1.25rem;
}
.settings-form-row--server { margin-bottom: .75rem; }
.settings-form-row--fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  width: 100%;
}
@media (min-width: 640px) {
  .settings-form-row--fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.settings-dt-server { margin: 0; align-items: center; }
.settings-dt-label,
.settings-dt-form label.switch span {
  display: inline;
  font-size: .9rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.45;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin: 0;
  font-size: .8rem;
  color: #5d5f5f;
  min-width: 0;
}
.settings-field select {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.promo-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  align-items: end;
}
@media (min-width: 480px) {
  .promo-form-grid { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
}
.promo-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin: 0;
  font-size: .8rem;
  color: #5d5f5f;
  min-width: 0;
}
.promo-field input { margin-top: 0; max-width: none; }
.promo-field--switch {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}
.promo-field--switch span {
  display: inline;
  font-size: .9rem;
  font-weight: 400;
  color: var(--ink);
}
.promo-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  margin-bottom: .5rem;
}
.promo-table-toolbar button { margin: 0; }
table.promo-table th.promo-col-action,
table.promo-table td.promo-col-action {
  width: 3.25rem;
  text-align: center;
  white-space: nowrap;
}
table.promo-table td:nth-child(5) { text-align: center; }
table.promo-table .switch {
  margin: 0;
  min-height: auto;
  justify-content: center;
}
table.promo-table .smm-ib-group { justify-content: center; }

/* ===== /admin/veg.html — full-width 2-col entry form ===== */
.veg-form-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}
@media (min-width: 768px) {
  .veg-form-layout {
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 18rem);
  }
}
.veg-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  align-items: end;
  width: 100%;
  min-width: 0;
}
@media (min-width: 640px) {
  .veg-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.veg-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin: 0;
  font-size: .8rem;
  color: #5d5f5f;
  min-width: 0;
}
.veg-field input,
.veg-field select {
  width: 100%;
  max-width: none;
  margin-top: 0;
}
.veg-field--switch {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}
.veg-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: .25rem;
  grid-column: 1 / -1;
}
.veg-form-actions button { margin: 0; }
.veg-form-status {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
}
.veg-form-status .lamp { margin-bottom: 0; }
.veg-form-status #result {
  margin: 0;
  font-size: .875rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

/* ===== /admin/gate-sim.html — full-width 2-col gate simulator ===== */
@media (min-width: 768px) {
  .gate-sim-layout.veg-form-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 1.1fr);
  }
}
@media (min-width: 1024px) {
  .gate-sim-layout.veg-form-layout {
    grid-template-columns: minmax(18rem, 32rem) minmax(0, 1fr);
  }
}
.gate-sim-controls { min-width: 0; }
.gate-sim-links {
  margin: .75rem 0 0;
  font-size: .85rem;
  line-height: 1.65;
}
.gate-sim-links a { white-space: nowrap; }
.gate-sim-log.veg-form-status { min-height: 0; }
.gate-event-log {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 0;
  flex: 1 1 auto;
}
.gate-event-log h3 {
  margin: 0;
  font-size: .85rem;
  font-weight: 700;
  color: #5d5f5f;
}
#gate-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8rem;
  line-height: 1.5;
  max-height: min(60vh, 28rem);
  overflow-y: auto;
  overflow-x: hidden;
}
#gate-list li {
  padding: .35rem 0;
  border-bottom: 1px solid #e4beba;
  overflow-wrap: anywhere;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid #e4beba; }
button, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; font-size: 1rem; font-family: "Prompt", sans-serif; }
button { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: .65rem 1rem; cursor: pointer; margin-right: .4rem; margin-top: .4rem; white-space: normal; line-height: 1.3; }
code { word-break: break-all; font-size: .75rem; }
.warn { color: var(--grad-end); font-size: .9rem; }
.muted { color: #5d5f5f; font-size: .85rem; }
.switch { display: flex; gap: .75rem; align-items: center; min-height: 44px; min-width: 0; }
label.switch span {
  display: inline;
  flex: 1 1 auto;
  min-width: 0;
  font-size: .9rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}
.advanced { border: 1px dashed #8f6f6c; }
.foot { padding: 1rem; font-size: .8rem; color: #5d5f5f; overflow-wrap: anywhere; }
.foot a { color: var(--primary); }
.token-box { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; margin-left: auto; min-width: 0; max-width: 100%; flex: 1 1 12rem; }
.token-box input { min-height: 44px; min-width: 0; width: 100%; border: 0; border-radius: 8px; padding: 0 .75rem; }
img { max-width: 100%; height: auto; }
.lamp { min-height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: .75rem; padding: 0 .75rem; text-align: center; }
.lamp.wait { background: #eceff1; }
.lamp.green { background: #2E7D32; color: #fff; }
.lamp.red { background: #93000a; color: #fff; }
button.ghost { background: #fff; color: var(--primary); border: 1px solid #e4beba; }
button.smm-ib { margin: 0; white-space: nowrap; }
/* Selected/nav active: always white text on brand red (beats .ghost color) */
button.ghost.active,
button.active[aria-current],
a.active[aria-current] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
label { display: block; margin: .5rem 0; min-width: 0; overflow-wrap: anywhere; }
label.switch { display: flex; }
select, input:not([type="checkbox"]):not([type="radio"]) { width: 100%; max-width: 100%; min-width: 0; }
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  max-width: 1.25rem;
  max-height: 1.25rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin: 0.2rem 0 0;
  accent-color: var(--primary);
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Admin sidebar (js/admin-sidebar.js) — categories + collapse/expand ===== */
body.has-admin-sidebar { display: flex; align-items: flex-stretch; min-height: 100vh; }
.admin-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-hamburger {
  display: none; position: fixed; top: .6rem; left: .6rem; z-index: 60;
  width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0;
  border-radius: 8px; background: var(--primary); color: #fff; border: 0;
  font-size: 1.3rem; line-height: 1; align-items: center; justify-content: center;
}
.admin-sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55;
}
.admin-sidebar {
  flex: 0 0 260px; width: 260px; background: #1b1c1c; color: #f0eded;
  display: flex; flex-direction: column; height: 100vh; max-height: 100vh;
  position: sticky; top: 0; align-self: flex-start; overflow: hidden;
  transition: width .18s ease, flex-basis .18s ease;
}
.admin-sidebar-head { padding: 1rem 1rem .5rem; display: flex; align-items: center; gap: .6rem; border-bottom: 1px solid #3a3a3a; }
.admin-sidebar-head img { width: 32px; height: 32px; border-radius: 6px; background: #fff; flex-shrink: 0; }
.admin-sidebar-head strong { display: block; font-size: .95rem; }
.admin-sidebar-head span { display: block; font-size: .75rem; opacity: .75; }
.admin-sidebar-toggle {
  margin-left: auto; flex-shrink: 0; width: 32px; height: 32px; min-height: 32px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #f0eded;
  display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem;
  padding: 0; margin-top: 0;
}
.admin-sidebar-toggle:hover, .admin-sidebar-toggle:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.admin-sidebar-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; padding: .5rem .5rem 1rem;
}
.admin-sidebar-rail {
  display: none; flex-direction: column; align-items: center; gap: .4rem;
  padding: .5rem 0 1rem; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; flex: 1 1 auto; min-height: 0;
}
.admin-sidebar-rail .rail-btn {
  width: 40px; height: 40px; min-height: 40px; border-radius: 10px; background: rgba(255,255,255,.08);
  color: #f0eded; border: 0; font-weight: 700; font-size: .95rem; padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-sidebar-rail .rail-btn:hover, .admin-sidebar-rail .rail-btn:focus-visible { background: var(--primary); outline: none; }
.admin-sidebar-rail .rail-btn.active,
.admin-sidebar-rail .rail-btn.active:hover,
.admin-sidebar-rail .rail-btn.active:focus-visible {
  background: var(--primary); color: #fff;
}
.admin-sidebar-rail .rail-icon { width: 20px; height: 20px; display: block; pointer-events: none; }

/* Shared collapsed-rail hover/focus tooltip (js/admin-sidebar.js). Uses fixed
   positioning computed from getBoundingClientRect so it renders above everything
   and is never clipped by the rail's own overflow:auto scroll container. */
.side-tip {
  position: fixed; top: 0; left: 0; z-index: 300; transform: translateY(-50%);
  background: #1b1c1c; color: #fff; padding: .4rem .7rem; border-radius: 6px;
  font-family: "Prompt", sans-serif; font-size: .8rem; font-weight: 600; line-height: 1.3;
  white-space: nowrap; max-width: min(70vw, 22rem); overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.35);
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.side-tip.visible { opacity: 1; visibility: visible; }
.side-tip::before {
  content: ""; position: absolute; top: 50%; left: -5px; transform: translateY(-50%);
  border: 5px solid transparent; border-right-color: #1b1c1c;
}
.side-cat { margin-bottom: .35rem; }
.side-cat-btn {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; background: transparent; color: #f0eded; border: 0; border-radius: 8px;
  padding: 0 .6rem; font-family: "Prompt", sans-serif; font-size: .88rem; font-weight: 700;
  cursor: pointer; text-align: left; margin: 0;
}
.side-cat-btn:hover, .side-cat-btn:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.side-cat-btn .chev { transition: transform .15s ease; font-size: .8rem; opacity: .8; }
.side-cat-btn[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.side-cat-list { list-style: none; margin: .1rem 0 .4rem; padding: 0; overflow: hidden; }
.side-cat-list.collapsed { display: none; }
.side-cat-list li { margin: 0; }
.side-cat-list a {
  display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .6rem .0rem 1.4rem;
  color: #d8d5d5; text-decoration: none; border-radius: 8px; font-size: .85rem;
}
.side-cat-list a i,
.side-cat-list a svg {
  flex: 0 0 1.1rem;
  width: 1.1rem;
  line-height: 1;
}
.side-cat-list a:hover, .side-cat-list a:focus-visible { background: rgba(255,255,255,.08); color: #fff; outline: none; }
.side-cat-list a.active,
.side-cat-list a[aria-current="page"],
.side-cat-list a.active:hover,
.side-cat-list a.active:focus-visible,
.side-cat-list a[aria-current="page"]:hover,
.side-cat-list a[aria-current="page"]:focus-visible {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
/* Nested "รายงานจอด" report tree (26 reports / 6 sub-categories) inside the sidebar */
.side-report-tree { padding-left: .3rem; }
.side-subcat { margin-bottom: .2rem; }
.side-subcat-btn {
  width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; background: transparent; color: #c9c6c6; border: 0; border-radius: 6px;
  padding: 0 .5rem 0 1rem; font-family: "Prompt", sans-serif; font-size: .76rem; font-weight: 700;
  cursor: pointer; text-align: left; margin: 0;
}
.side-subcat-btn:hover, .side-subcat-btn:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.side-subcat-btn .chev { transition: transform .15s ease; font-size: .7rem; opacity: .8; }
.side-subcat-btn[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.side-subcat-list { list-style: none; margin: .05rem 0 .3rem; padding: 0; overflow: hidden; }
.side-subcat-list.collapsed { display: none; }
.side-subcat-list li { margin: 0; }
.side-subcat-list a {
  display: flex; align-items: center; min-height: 38px; padding: .3rem .6rem .3rem 1.9rem;
  color: #b8b5b5; text-decoration: none; border-radius: 6px; font-size: .74rem; line-height: 1.3;
}
.side-subcat-list a:hover, .side-subcat-list a:focus-visible { background: rgba(255,255,255,.08); color: #fff; outline: none; }
.side-subcat-list a.active,
.side-subcat-list a.active:hover,
.side-subcat-list a.active:focus-visible {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.admin-sidebar-foot { padding: .75rem 1rem; border-top: 1px solid #3a3a3a; font-size: .78rem; }
.admin-sidebar-foot .who { opacity: .85; margin-bottom: .4rem; overflow-wrap: anywhere; }
.admin-sidebar-foot button {
  width: 100%; min-height: 44px; background: transparent; border: 1px solid #6b4a4a; color: #f0eded;
}
.admin-sidebar-foot button:hover { background: rgba(255,255,255,.08); }
@media (min-width: 1024px) {
  .admin-sidebar.collapsed { flex: 0 0 64px; width: 64px; }
  .admin-sidebar.collapsed .admin-sidebar-head { padding: .75rem .5rem; justify-content: center; }
  .admin-sidebar.collapsed .admin-sidebar-head > div { display: none; }
  .admin-sidebar.collapsed .admin-sidebar-toggle { margin-left: 0; }
  .admin-sidebar.collapsed .admin-sidebar-body,
  .admin-sidebar.collapsed .admin-sidebar-foot { display: none; }
  .admin-sidebar.collapsed .admin-sidebar-rail { display: flex; }
}
@media (max-width: 1023px) {
  .admin-hamburger { display: flex; }
  .admin-sidebar-toggle { display: none; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; z-index: 56; width: 82vw; max-width: 300px;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  body.sidebar-open .admin-sidebar { transform: translateX(0); }
  body.sidebar-open .admin-sidebar-backdrop { display: block; }
  body.sidebar-open { overflow: hidden; }
  .admin-content { padding-top: 3.2rem; }
}

/* ===== /admin/login.html + /admin/users.html ===== */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background:
    radial-gradient(circle at 12% 8%, rgba(211,47,47,.16), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(183,28,28,.14), transparent 48%),
    linear-gradient(165deg, #fbf4f2 0%, #f4eeec 55%, #ede6e4 100%);
}
.login-card {
  position: relative; background: #fff; border-radius: 18px; padding: 2.25rem 1.75rem 2rem;
  width: 100%; max-width: 24rem; box-shadow: 0 24px 56px rgba(93,20,20,.16), 0 2px 10px rgba(0,0,0,.05);
  animation: login-card-in .35s ease-out;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 64px; height: 4px; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--primary), var(--grad-end));
}
@keyframes login-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .login-card { animation: none; } }
.login-brand { display: flex; justify-content: center; margin-bottom: .85rem; }
.login-card img { width: 58px; height: 58px; border-radius: 14px; display: block; background: #fff; padding: 6px; box-shadow: 0 8px 18px rgba(175,16,26,.28); }
.login-card h1 { text-align: center; color: var(--ink); font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .3rem; }
.login-card p.sub { text-align: center; color: #7a7c7c; font-size: .88rem; margin: 0 0 1.5rem; }
.login-card label { font-size: .85rem; font-weight: 600; color: #4a4c4c; }
.login-card input { border: 1.5px solid #e6dedd; border-radius: 10px; padding: 0 .9rem; transition: border-color .15s ease, box-shadow .15s ease; }
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(175,16,26,.12); }
.pw-field { position: relative; display: block; }
.pw-toggle {
  position: absolute; top: 0; right: 0; height: 44px; width: 44px; min-height: 44px;
  background: transparent; color: #8a8c8c; border: 0; border-radius: 10px; margin: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  z-index: 2; pointer-events: auto;
}
.pw-field input { position: relative; z-index: 1; width: 100%; padding-right: 2.75rem; }
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--primary); background: rgba(175,16,26,.06); outline: none; }
.login-card button[type="submit"] {
  width: 100%; margin-top: 1rem; padding: .8rem 1rem; font-weight: 700; font-size: 1.02rem;
  letter-spacing: .01em; box-shadow: 0 8px 18px rgba(175,16,26,.28); transition: transform .1s ease, box-shadow .15s ease;
}
.login-card button[type="submit"]:hover { box-shadow: 0 10px 22px rgba(175,16,26,.34); }
.login-card button[type="submit"]:active { transform: translateY(1px); }
.login-card button[type="submit"]:disabled { opacity: .7; cursor: default; transform: none; }
.login-error {
  display: flex; align-items: flex-start; gap: .5rem; background: #FDECEA; color: #93000a;
  border: 1px solid #f6c8c4; border-radius: 10px; padding: .65rem .8rem; font-size: .85rem;
  font-weight: 600; line-height: 1.4; margin: 0 0 1rem;
}
.login-error[hidden] { display: none; }
.login-error::before { content: "⚠"; flex-shrink: 0; line-height: 1.4; }
.role-badge { display: inline-block; border-radius: 999px; padding: .15rem .65rem; font-size: .72rem; font-weight: 700; color: #fff; background: var(--primary); }
.role-badge.super_admin { background: #B71C1C; }
.role-badge.admin { background: #6A1B9A; }
.role-badge.operation { background: #1565C0; }
.role-badge.viewer { background: #546E7A; }
.win-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .5rem .75rem;
  margin: .35rem 0 .75rem;
}
.win-check-grid .win-check-item,
.win-check-grid label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: .5rem;
  min-height: 44px;
  margin: 0;
  font-size: .82rem;
  min-width: 0;
}
.win-check-grid .win-check-item input[type="checkbox"],
.win-check-grid label input[type="checkbox"] {
  display: inline-block;
  width: 1.25rem;
  max-width: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  margin: .15rem 0 0;
  padding: 0;
  border: 0;
  flex-shrink: 0;
}
.win-check-grid .win-check-label,
.win-check-grid label span {
  display: inline;
  flex: 1 1 auto;
  min-width: 0;
  font-size: .82rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

/* ===== Data table chrome (js/data-table.js) — order-by, fulltext search, =====
   ===== multi-select filter. Shared by every admin <table>. Skill:        =====
   ===== data-table-sort-search-filter. Inherits --primary + Prompt.       ===== */
:root {
  --dt-primary: var(--primary, #2563eb);
  --dt-primary-contrast: #fff;
  --dt-border: #e4beba;
  --dt-bg: #fff;
  --dt-muted: #5d5f5f;
  --dt-radius: 8px;
}
.dt-toolbar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-start; margin: 0 0 .6rem; }
.dt-search { flex: 1 1 14rem; min-width: 0; }
.dt-search-input {
  width: 100%; min-height: 44px; border: 1px solid var(--dt-border); border-radius: var(--dt-radius);
  padding: 0 .75rem; font: inherit; box-sizing: border-box;
}
.dt-search-input:focus-visible { outline: 2px solid var(--dt-primary); outline-offset: 1px; }
.dt-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.dt-filter { position: relative; }
.dt-filter > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  min-height: 44px; padding: 0 .75rem; border: 1px solid var(--dt-border); border-radius: 999px;
  font-size: .85rem; background: var(--dt-bg); user-select: none;
}
.dt-filter > summary::-webkit-details-marker { display: none; }
.dt-filter > summary::after { content: "▾"; opacity: .6; font-size: .7rem; margin-left: .15rem; }
.dt-filter[open] > summary::after { content: "▴"; }
.dt-filter.dt-filter-active > summary { border-color: var(--dt-primary); color: var(--dt-primary); font-weight: 700; }
.dt-filter-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; height: 1.2rem;
  padding: 0 .3rem; border-radius: 999px; background: var(--dt-primary); color: var(--dt-primary-contrast);
  font-size: .7rem; font-weight: 700;
}
.dt-filter-panel {
  position: absolute; top: calc(100% + .3rem); left: 0; z-index: 40;
  background: var(--dt-bg); border: 1px solid var(--dt-border); border-radius: var(--dt-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15); padding: .6rem; width: max(14rem, 100%); max-width: min(90vw, 20rem);
}
.dt-filter-opt-search {
  width: 100%; min-height: 40px; border: 1px solid var(--dt-border); border-radius: 6px;
  padding: 0 .6rem; font: inherit; box-sizing: border-box; margin-bottom: .4rem;
}
.dt-filter-actions { display: flex; gap: .5rem; margin-bottom: .4rem; }
.dt-filter-actions button {
  flex: 1 1 auto; min-height: 36px; border-radius: 6px; border: 1px solid var(--dt-border);
  background: var(--dt-bg); color: var(--primary); font-size: .78rem; cursor: pointer; padding: 0 .5rem; margin: 0;
}
.dt-filter-actions button:hover { border-color: var(--dt-primary); color: var(--dt-primary); background: var(--dt-bg); }
.dt-filter-options { max-height: 14rem; overflow-y: auto; display: flex; flex-direction: column; gap: .1rem; }
.dt-filter-opt {
  display: flex; align-items: center; gap: .5rem; min-height: 36px; padding: 0 .25rem;
  font-size: .85rem; border-radius: 6px; cursor: pointer; margin: 0; font-weight: 400;
}
.dt-filter-opt:hover { background: rgba(175, 16, 26, .06); }
.dt-filter-opt input { flex-shrink: 0; }
.dt-filter-empty { font-size: .82rem; color: var(--dt-muted); margin: .25rem 0; }
.dt-th-sortable { padding: 0 !important; }
.dt-th-btn {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem; width: 100%;
  min-height: 44px; padding: .5rem; border: 0; background: transparent; font: inherit; font-weight: inherit;
  color: inherit; text-align: left; cursor: pointer; margin: 0;
}
.dt-th-btn:hover, .dt-th-btn:focus-visible { background: rgba(0, 0, 0, .05); outline: none; }
.dt-sort-ic { font-size: .7rem; opacity: .5; flex-shrink: 0; }
th.dt-th-active { color: var(--dt-primary); }
th.dt-th-active .dt-sort-ic { opacity: 1; color: var(--dt-primary); }
tr.dt-empty-row td { text-align: center; padding: 1.25rem .5rem; color: var(--dt-muted); font-style: italic; }
.dt-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) {
  .dt-toolbar { flex-direction: column; align-items: stretch; }
  .dt-filters { gap: .35rem; }
  .dt-filter-panel { left: auto; right: 0; }
}

/* Beat `body * { Prompt !important }` so FA glyphs are not tofu */
html body i.fa-solid[class*="fa-"],
html body i.fas[class*="fa-"],
html body i.far[class*="fa-"],
html body i.fab[class*="fa-"],
html body i.fa-regular[class*="fa-"],
html body i.fa-brands[class*="fa-"],
html body i.fa[class*="fa-"],
html body .smm-ib i[class*="fa-"] {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
}
html body i.fa-brands[class*="fa-"],
html body i.fab[class*="fa-"] {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400 !important;
}
