/* ลากเลือกข้อความในหลังบ้าน: ยอดเงินเขียว / ตัวอักษรยังอ่านได้ */
html body .admin-main-panel ::selection,
html body .admin-main-panel *::selection,
html body .admin-page ::selection,
html body .admin-page *::selection {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}
html body .admin-main-panel ::-moz-selection,
html body .admin-main-panel *::-moz-selection,
html body .admin-page ::-moz-selection,
html body .admin-page *::-moz-selection {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  text-shadow: none !important;
}

.ops-dash {
  --ops-bg: #0b0b10;
  --ops-soft: #14141c;
  --ops-card: #17171f;
  --ops-ink: #ffffff;
  --ops-muted: rgba(255,255,255,.7);
  --ops-dim: #a1a1aa;
  --ops-line: rgba(255, 255, 255, 0.1);
  --ops-violet: #7c3aed;
  --ops-pink: #db2777;
  --ops-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 52%, #ed2052 100%);
  --ops-gold: var(--primary, #ed2052);
  --ops-gold-soft: rgba(var(--primary-rgb, 237, 32, 82), 0.16);
  --ops-gold-border: rgba(var(--primary-rgb, 237, 32, 82), 0.45);
  --ops-rose: #fb7185;
  --ops-emerald: #4ade80;
  --ops-display: "Outfit", "IBM Plex Sans Thai", "Prompt", sans-serif;
  --ops-sans: "IBM Plex Sans Thai", "Prompt", sans-serif;
  --ops-mono: "SF Mono", ui-monospace, monospace;
  color: var(--ops-ink);
  font-family: var(--ops-sans);
  padding: 22px 22px 28px;
}
body.theme-light .ops-dash {
  --ops-bg: #ffffff;
  --ops-soft: #f8fafc;
  --ops-ink: #0f172a;
  --ops-muted: #475569;
  --ops-dim: #64748b;
  --ops-line: rgba(15, 23, 42, 0.12);
}

.ops-dash * { box-sizing: border-box; }
.ops-dash h1, .ops-dash h2, .ops-dash h3, .ops-dash p, .ops-dash dl, .ops-dash dd { margin: 0; }
.ops-dash .sheet-code {
  color: var(--ops-gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ops-dash .sheet-code b { color: var(--ops-rose); }

.ops-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ops-line);
  flex-wrap: wrap;
}
.ops-heading h1 {
  margin-top: 6px;
  font-family: var(--ops-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--ops-ink);
}
.ops-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ops-heading-actions .ops-stamp {
  color: var(--ops-dim);
  font-family: var(--ops-mono);
  font-size: 11px;
}

.ops-status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ops-emerald);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.runtime-band {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  margin-top: 16px;
  background: var(--ops-bg);
  border: 1px solid var(--ops-line);
  border-radius: 16px;
  overflow: hidden;
}
.dash-hero {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--ops-gradient, linear-gradient(135deg, #7c3aed 0%, #db2777 52%, #ed2052 100%));
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.28);
}
.dash-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.dash-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.dash-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.18);
  font-size: 22px;
}
.dash-hero-main p {
  font-size: 13px;
  font-weight: 700;
  opacity: .9;
}
.dash-hero-main strong {
  display: block;
  font-family: var(--ops-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.dash-hero-main span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: .78;
}
.dash-range {
  position: relative;
  z-index: 2;
  min-width: min(100%, 340px);
  display: grid;
  gap: 8px;
  justify-items: end;
}
.dash-range-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
}
.dash-range-box i { opacity: .9; }
.dash-range-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.dash-range-box input::placeholder { color: rgba(255,255,255,.55); font-weight: 600; }
.dash-range-box button {
  flex-shrink: 0;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: #9f1239;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.dash-range-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.dash-range-chips a {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}
.dash-range-chips a.is-on,
.dash-range-chips a:hover {
  background: #fff;
  color: #9f1239;
  border-color: #fff;
}
.dash-range-err {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fecaca;
}
.dash-range summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.dash-range summary::-webkit-details-marker { display: none; }
.dash-range-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  background: #12141a;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
}
.dash-range-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.dash-range-menu a.is-on,
.dash-range-menu a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.dash-range-menu a.is-on::before {
  content: "✓";
  color: var(--ops-emerald);
  font-weight: 900;
}
.dash-kpis {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.dash-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: var(--ops-bg);
  border: 1px solid var(--ops-line);
}
.dash-kpi-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.dash-kpi.is-gold .dash-kpi-ico { background: rgba(245, 158, 11, .16); color: #fbbf24; }
.dash-kpi.is-violet .dash-kpi-ico { background: rgba(139, 92, 246, .16); color: #c4b5fd; }
.dash-kpi.is-green .dash-kpi-ico { background: rgba(16, 185, 129, .16); color: #34d399; }
.dash-kpi span {
  display: block;
  color: var(--ops-dim);
  font-size: 12px;
  font-weight: 700;
}
.dash-kpi b {
  display: block;
  margin-top: 2px;
  font-family: var(--ops-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.dash-topup {
  margin-top: 14px;
  padding: 18px 20px 10px;
  border-radius: 18px;
  background: var(--ops-bg);
  border: 1px solid var(--ops-line);
}
.dash-topup header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.dash-topup h2 {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-topup header p {
  margin-top: 4px;
  color: var(--ops-dim);
  font-size: 12px;
}
.dash-topup-total {
  text-align: right;
}
.dash-topup-total strong {
  display: block;
  color: var(--ops-emerald);
  font-family: var(--ops-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.dash-topup-total span {
  color: var(--ops-dim);
  font-size: 11px;
  font-weight: 700;
}
.dash-topup ol {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 460px;
  overflow: auto;
}
.dash-topup li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 108px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--ops-line);
}
.dash-topup-day b {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.dash-topup-day span {
  color: var(--ops-dim);
  font-size: 12px;
}
.dash-topup li.is-today .dash-topup-day b { color: var(--ops-rose); }
.dash-topup-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.dash-topup-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary, #ed2052), #c4b5fd);
}
.dash-topup-amt {
  text-align: right;
}
.dash-topup-amt strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}
.dash-topup-amt span {
  color: var(--ops-dim);
  font-size: 11px;
}
@media (max-width: 767px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: stretch; }
  .dash-range { justify-items: stretch; min-width: 0; }
  .dash-topup li { grid-template-columns: 78px minmax(0, 1fr) 88px; gap: 8px; }
}
.runtime-band-label {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--ops-gold);
  border-right: 1px solid var(--ops-line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.runtime-band dl {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}
.runtime-band dl > div {
  min-width: 0;
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  padding: 12px 16px;
  border-right: 1px solid var(--ops-line);
}
.runtime-band dl > div:last-child { border-right: 0; }
.runtime-band dt {
  margin-top: 4px;
  color: var(--ops-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.runtime-band dd {
  overflow: hidden;
  font-family: var(--ops-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ops-ink);
}

.ops-workspace {
  margin-top: 16px;
  background: var(--ops-bg);
  border: 1px solid var(--ops-line);
  border-radius: 18px;
  overflow: hidden;
}
.control-rail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  border-bottom: 1px solid var(--ops-line);
}
.rail-module {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--ops-line);
}
.rail-module:last-child { border-right: 0; }
.module-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.module-heading > div > span {
  color: var(--ops-gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.module-heading h2 {
  margin-top: 3px;
  font-family: var(--ops-display);
  font-size: 17px;
  font-weight: 650;
  color: var(--ops-ink);
}
.runtime-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  margin-top: 12px;
}
.runtime-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ops-line);
}
.runtime-list dt {
  color: var(--ops-dim);
  font-size: 11px;
  font-weight: 600;
}
.runtime-list dd {
  min-width: 0;
  overflow: hidden;
  font-family: var(--ops-mono);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ops-ink);
}

.ops-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}
.ops-presets a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #d4d4d8;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
body.theme-light .ops-presets a { background: #fff; }
.ops-presets a:hover {
  color: #fff;
  border-color: rgba(167, 139, 250, .45);
  background: rgba(124, 58, 237, .14);
}
.ops-presets a.is-on {
  color: #111 !important;
  background: #fff !important;
  border-color: #fff !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

.ops-filter-hint {
  margin: 8px 0 0;
  color: #a1a1aa;
  font-size: 12px;
}
.ops-time-advanced {
  margin-top: 10px;
}
.ops-time-advanced summary {
  cursor: pointer;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 650;
  user-select: none;
}
.ops-time-advanced summary:hover {
  color: #fff;
}
.ops-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ops-filter-grid label {
  display: grid;
  gap: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ops-filter-grid .span-2 { grid-column: 1 / -1; }
.ops-dash input,
.ops-dash select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: #ffffff;
  background: #0b0b10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  color-scheme: dark;
}
body.theme-light .ops-dash input,
body.theme-light .ops-dash select {
  background: #fff;
}
.ops-dash input:focus,
.ops-dash select:focus {
  outline: none;
  border-color: var(--ops-gold-border);
  box-shadow: 0 0 0 3px var(--ops-gold-soft);
}
.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ops-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.ops-btn-primary {
  color: #0a0a0a;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 8px 24px rgba(255,255,255,.18);
  font-weight: 800;
}
.ops-btn-primary:hover { background: #f4f4f5; color: #0a0a0a; }
.ops-btn-ghost {
  color: var(--ops-ink);
  background: transparent;
  border-color: var(--ops-line);
}
.ops-btn-ghost:hover { border-color: var(--ops-gold-border); color: var(--ops-gold); }

.ops-body {
  display: block;
  min-width: 0;
}
.job-inspector {
  padding: 20px;
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid var(--ops-line);
}
body.theme-light .job-inspector { background: rgba(15, 23, 42, 0.04); }
.inspector-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--ops-dim);
  text-align: center;
}
.empty-marker {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}
.inspector-empty h3 { color: var(--ops-ink); font-size: 14px; }
.inspector-empty p { font-size: 12px; }
.selected-job-head {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
.selected-job-head strong { font-size: 14px; }
.selected-job-head code {
  color: var(--ops-dim);
  font-family: var(--ops-mono);
  font-size: 11px;
}
.ops-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(52, 211, 153, 0.12);
  color: var(--ops-emerald);
  border: 1px solid rgba(52, 211, 153, 0.28);
}
.ops-badge.is-warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.28);
}
.selected-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--ops-line);
  border-radius: 12px;
  overflow: hidden;
}
.selected-metrics > div {
  padding: 10px;
  border-right: 1px solid var(--ops-line);
  border-bottom: 1px solid var(--ops-line);
  background: #0a0a0a;
}
body.theme-light .selected-metrics > div { background: #fff; }
.selected-metrics > div:nth-child(2n) { border-right: 0; }
.selected-metrics dt {
  color: var(--ops-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.selected-metrics dd {
  margin-top: 4px;
  font-family: var(--ops-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
}
.inspector-note {
  margin-top: 12px;
  padding-top: 12px;
  color: var(--ops-muted);
  border-top: 1px solid var(--ops-line);
  font-size: 12px;
}

.jobs-ledger { min-width: 0; padding: 20px 22px 24px; }
.ledger-count {
  padding: 4px 10px;
  color: var(--ops-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ops-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}
.jobs-toolbar {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.filter-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-segments button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ops-muted);
  background: #0a0a0a;
  border: 1px solid var(--ops-line);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
body.theme-light .filter-segments button { background: #fff; }
.filter-segments button[aria-pressed="true"] {
  color: #000;
  background: var(--ops-gold);
  border-color: var(--ops-gold);
}
.search-field { position: relative; }
.search-field i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--ops-dim);
  font-size: 12px;
  pointer-events: none;
}
.search-field input { padding-left: 34px; }

.ops-sale-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  max-height: min(72vh, 820px);
  overflow: auto;
}
.ops-sale-card {
  display: grid;
  grid-template-columns: 64px minmax(110px, 0.9fr) minmax(140px, 1.6fr) 128px 40px minmax(120px, 0.8fr) minmax(110px, 0.7fr);
  align-items: center;
  gap: 8px 12px;
  padding: 9px 14px;
  background: #0a0a0a;
  border: 1px solid var(--ops-line);
  border-radius: 12px;
  cursor: pointer;
}
body.theme-light .ops-sale-card { background: #fff; }
.ops-sale-card:hover { border-color: rgba(255,255,255,0.18); }
.ops-sale-card.is-on {
  background: var(--ops-gold-soft);
  border-color: rgba(251, 191, 36, 0.4);
}
.ops-sale-card > .mono {
  color: var(--ops-muted);
  font-size: 12px;
}
.ops-sale-card > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.ops-sale-product {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}
.ops-sale-when,
.ops-sale-qty {
  color: var(--ops-muted);
  font-size: 12px;
  white-space: nowrap;
}
.ops-sale-paid {
  color: var(--ops-muted);
  font-size: 12px;
  white-space: nowrap;
  text-align: right;
}
.ops-sale-paid b { color: #fff; font-size: 14px; }
.ops-sale-card .ops-profit {
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}
.ops-sale-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ops-sale-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ops-muted);
  font-size: 11px;
}
.ops-sale-money {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.ops-sale-money span { color: var(--ops-muted); }
.ops-sale-money b { color: #fff; font-size: 15px; }
.ops-table-wrap {
  margin-top: 14px;
  border: 1px solid var(--ops-line);
  border-radius: 14px;
  overflow: auto;
  max-height: 560px;
}
.ops-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  color: #ffffff;
  font-size: 13.5px;
}
.ops-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 12px;
  color: #ffffff !important;
  background: #1c1c28 !important;
  border-bottom: 1px solid var(--ops-line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.ops-table tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--ops-line);
  white-space: nowrap;
  color: #f4f4f5 !important;
  background: transparent !important;
}
.ops-table tbody tr { cursor: pointer; }
.ops-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.ops-table tbody tr.is-on { background: var(--ops-gold-soft); }
.ops-table .mono { font-family: var(--ops-mono); font-size: 11px; color: var(--ops-muted); }
.ops-profit { color: var(--ops-emerald); font-weight: 700; }
.ops-loss { color: var(--ops-rose); font-weight: 700; }
.ops-empty {
  padding: 36px 16px;
  color: var(--ops-dim);
  text-align: center;
}
.top-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.top-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #0a0a0a;
  border: 1px solid var(--ops-line);
  border-radius: 10px;
  font-size: 12px;
}
body.theme-light .top-list div { background: #fff; }
.top-list span { color: var(--ops-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list b { font-family: var(--ops-mono); font-size: 11px; }

@media (max-width: 1100px) {
  .control-rail, .runtime-band { grid-template-columns: 1fr; }
  .runtime-band-label, .rail-module { border-right: 0; border-bottom: 1px solid var(--ops-line); }
  .runtime-band dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jobs-toolbar { grid-template-columns: 1fr; }
  .ops-sale-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
      "id user paid"
      "id product profit"
      "id meta qty";
  }
  .ops-sale-card > .mono { grid-area: id; }
  .ops-sale-card > strong { grid-area: user; }
  .ops-sale-product { grid-area: product; }
  .ops-sale-when { grid-area: meta; }
  .ops-sale-qty { grid-area: qty; justify-self: end; }
  .ops-sale-paid { grid-area: paid; }
  .ops-sale-card .ops-profit { grid-area: profit; }
}

/* High-contrast admin shell — modern dark console */
.admin-main-panel {
  background: #0b0b10 !important;
  color: #ffffff;
  min-height: calc(100vh - 65px);
}
.admin-main-panel .form-label {
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}
.admin-main-panel .form-control,
.admin-main-panel .form-select,
.admin-main-panel input:not([type="checkbox"]):not([type="radio"]),
.admin-main-panel select,
.admin-main-panel textarea {
  background: #1a1a24 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #ffffff !important;
  min-height: 46px;
  font-size: 14px !important;
  color-scheme: dark;
}
.admin-main-panel .form-control::placeholder,
.admin-main-panel input::placeholder {
  color: #a1a1aa !important;
  opacity: 1;
}
.admin-main-panel .table thead th {
  color: #ffffff !important;
  background: #1c1c28 !important;
  font-size: 12px !important;
}
.admin-main-panel .table td {
  color: #f4f4f5 !important;
  font-size: 13.5px;
}
.admin-sidebar {
  background: #101018 !important;
}
.admin-sidebar .list-group-item {
  color: #e4e4e7 !important;
  font-size: 15px !important;
}
.admin-sidebar .list-group-item.active {
  color: #ffffff !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.35);
}

.tk-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}
.tk-kpi {
  padding: 16px 18px;
  background: #17171f;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
}
.tk-kpi span {
  display: block;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tk-kpi b {
  display: block;
  color: #fff;
  font-family: "Outfit", "Prompt", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}
.tk-kpi b.ops-metric {
  color: #4ade80;
}
.ops-filter-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
@media (max-width: 1100px) {
  .tk-kpis, .ops-filter-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ops-badge.is-paid { background: rgba(74,222,128,.14); color: #4ade80; border-color: rgba(74,222,128,.32); }
.ops-badge.is-pending { background: rgba(251,191,36,.14); color: #fbbf24; border-color: rgba(251,191,36,.32); }
.ops-badge.is-failed { background: rgba(251,113,133,.14); color: #fb7185; border-color: rgba(251,113,133,.32); }
.ops-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: 0;
    text-transform: none;
}
.ops-pill-role.is-admin {
    color: #fff;
    background: linear-gradient(90deg, #e11d48, #fb7185);
    border: 1px solid rgba(251, 113, 133, .55);
    box-shadow: 0 0 12px rgba(225, 29, 72, .35);
}
.ops-pill-role.is-reseller {
    color: #082f49;
    background: linear-gradient(90deg, #22d3ee, #67e8f9);
    border: 1px solid rgba(34, 211, 238, .5);
    box-shadow: 0 0 12px rgba(34, 211, 238, .28);
}
.ops-pill-role.is-member {
    color: #e2e8f0;
    background: #334155;
    border: 1px solid rgba(148, 163, 184, .35);
}
.ops-pill-rank {
    color: var(--pill, #94a3b8);
    background: color-mix(in srgb, var(--pill, #94a3b8) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--pill, #94a3b8) 42%, transparent);
}
.ops-pill-rank.is-none {
    color: #64748b;
    background: rgba(100, 116, 139, .12);
    border: 1px solid rgba(100, 116, 139, .22);
}

.admin-main-panel .text-dark,
.admin-main-panel .text-black,
.admin-main-panel h1,
.admin-main-panel h2,
.admin-main-panel h3,
.admin-main-panel h4,
.admin-main-panel h5,
.admin-main-panel h6 {
  color: #ffffff !important;
}
.admin-main-panel .text-muted {
  color: #d4d4d8 !important;
}
.admin-main-panel .d-flex.justify-content-between {
  gap: 16px;
  flex-wrap: wrap;
}
.admin-main-panel .d-flex.justify-content-between > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}
.admin-main-panel .d-flex.justify-content-between > .btn,
.admin-main-panel #open_insert {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ปุ่มหลัก: ไล่สีชมพูตามหน้าร้าน */
.admin-main-panel #open_insert,
.admin-main-panel .btn.xez-btn-cyan,
.admin-main-panel .btn.xdvz-btn-cyan,
.admin-main-panel .btn-primary,
.admin-main-panel .ops-btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #ed2052 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .32);
  font-weight: 800 !important;
}
.admin-main-panel #open_insert *,
.admin-main-panel .btn.xez-btn-cyan *,
.admin-main-panel .btn.xdvz-btn-cyan *,
.admin-main-panel .btn-primary * {
  color: #ffffff !important;
}
.admin-main-panel .btn-dark {
  background: #27272a !important;
  color: #ffffff !important;
}
.admin-main-panel .btn-warning {
  color: #111111 !important;
}
.admin-main-panel .btn-outline-dark,
.admin-main-panel .btn-outline-light {
  color: #ffffff !important;
  border-color: rgba(255,255,255,.28) !important;
  background: transparent !important;
}
.admin-main-panel .badge.bg-light,
.admin-main-panel .bg-light {
  background: #27272a !important;
  color: #ffffff !important;
}
.admin-main-panel thead.bg-light,
.admin-main-panel .table thead,
.admin-main-panel .table thead th,
.admin-main-panel table.dataTable thead th {
  background: #1c1c28 !important;
  color: #ffffff !important;
}
.admin-main-panel .dataTables_wrapper,
.admin-main-panel .dataTables_filter,
.admin-main-panel .dataTables_filter label,
.admin-main-panel .dataTables_length,
.admin-main-panel .dataTables_length label,
.admin-main-panel .dataTables_info,
.admin-main-panel .dataTables_paginate,
.admin-main-panel .dataTables_empty,
.admin-main-panel .paginate_button {
  color: #ffffff !important;
}
.admin-main-panel .dataTables_filter input,
.admin-main-panel .dataTables_length select {
  background: #1a1a24 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,.2) !important;
}
.admin-main-panel .paginate_button.current,
.admin-main-panel .page-item.active .page-link {
  background: #ffffff !important;
  color: #111111 !important;
}
.admin-main-panel .form-check-label,
.admin-main-panel .form-check,
.modal .form-check-label,
.modal .form-check {
  color: #ffffff !important;
}
html body .admin-main-panel input[type="checkbox"],
html body .admin-main-panel input[type="radio"],
html body .admin-main-panel .form-check-input,
html body .modal input[type="checkbox"],
html body .modal input[type="radio"],
html body .modal .form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px !important;
  margin-top: 0.15rem;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.45) !important;
  border-radius: 6px;
  background-color: #0c0c14 !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 14px 14px !important;
  box-shadow: none;
  cursor: pointer;
  accent-color: #22c55e;
  color-scheme: light;
  flex: 0 0 auto;
}
html body .admin-main-panel input[type="checkbox"]:hover,
html body .modal .form-check-input:hover {
  border-color: #86efac !important;
}
html body .admin-main-panel input[type="checkbox"]:checked,
html body .admin-main-panel .form-check-input:checked,
html body .modal input[type="checkbox"]:checked,
html body .modal .form-check-input:checked {
  background-color: #22c55e !important;
  border-color: #4ade80 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.6' d='M3.2 8.4l3 3 6.6-7'/%3E%3C/svg%3E") !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.28);
}
html body .admin-main-panel .form-check:has(input:checked) .form-check-label,
html body .modal .form-check:has(input:checked) .form-check-label {
  color: #86efac !important;
  font-weight: 800 !important;
}

html body .admin-main-panel button#open_insert,
html body .admin-main-panel #open_insert.btn,
html body .admin-main-panel .btn.xez-btn-cyan,
html body .admin-main-panel .btn.xdvz-btn-cyan,
html body .admin-main-panel .btn-primary,
html body .admin-main-panel .ops-btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #ed2052 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: none !important;
  font-weight: 800 !important;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .32);
}
html body .admin-main-panel button#open_insert i,
html body .admin-main-panel #open_insert i,
html body .admin-main-panel .btn.xez-btn-cyan i,
html body .admin-main-panel .btn.xdvz-btn-cyan i,
html body .admin-main-panel .btn-primary i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.admin-main-panel table thead th,
.admin-main-panel table thead th.text-muted,
.admin-main-panel table.dataTable thead th,
.admin-main-panel table.dataTable thead th.sorting,
.admin-main-panel table.dataTable thead th.sorting_asc,
.admin-main-panel table.dataTable thead th.sorting_desc {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #1c1c28 !important;
  opacity: 1 !important;
}
.admin-main-panel table.dataTable thead .sorting:before,
.admin-main-panel table.dataTable thead .sorting:after,
.admin-main-panel table.dataTable thead .sorting_asc:before,
.admin-main-panel table.dataTable thead .sorting_asc:after,
.admin-main-panel table.dataTable thead .sorting_desc:before,
.admin-main-panel table.dataTable thead .sorting_desc:after {
  color: #ffffff !important;
  opacity: 0.85 !important;
}
.admin-main-panel .bg-white,
.admin-main-panel .card.bg-white,
.admin-main-panel .p-3.bg-white {
  background: #1a1a24 !important;
  color: #ffffff !important;
}
.admin-main-panel .modal-content {
  background: #16161e !important;
  color: #ffffff !important;
}
.admin-main-panel .btn-close {
  filter: invert(1) grayscale(1);
  opacity: 0.85;
}
.admin-main-panel .form-text,
.admin-main-panel .form-text.text-muted {
  color: #e4e4e7 !important;
}
.admin-main-panel .badge.bg-light,
.admin-main-panel .badge.bg-light.text-muted,
.admin-main-panel .badge.bg-light.text-dark {
  background: #3f3f46 !important;
  color: #ffffff !important;
}
.admin-main-panel .btn-dark {
  background: #3f3f46 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,.18) !important;
}
.admin-main-panel .btn-secondary {
  background: #3f3f46 !important;
  color: #ffffff !important;
}
.admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #ffffff !important;
}
.admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #ffffff !important;
  color: #111111 !important;
  border: none !important;
}

/* ปุ่มบันทึกหลังบ้าน: เขียวชัด กดรู้สึกได้ทุกหน้า */
html body .admin-main-panel .admin-save-btn,
html body .admin-main-panel button.admin-save-btn,
html body .modal .admin-save-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: none !important;
  box-shadow: 0 8px 22px rgba(34, 197, 94, 0.38) !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  position: relative;
  z-index: 2;
  pointer-events: auto !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
html body .admin-main-panel .admin-save-btn i,
html body .admin-main-panel .admin-save-btn *,
html body .modal .admin-save-btn i,
html body .modal .admin-save-btn * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html body .admin-main-panel .admin-save-btn.w-100,
html body .admin-main-panel .admin-save-btn.w-50,
html body .modal .admin-save-btn.w-100,
html body .modal .admin-save-btn.w-50 {
  min-height: 52px;
}
html body .admin-main-panel .admin-save-btn:hover,
html body .modal .admin-save-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.48) !important;
  color: #ffffff !important;
}
html body .admin-main-panel .admin-save-btn:active,
html body .modal .admin-save-btn:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.96);
}
html body .admin-main-panel .admin-save-btn:disabled,
html body .modal .admin-save-btn:disabled {
  opacity: 0.72;
  transform: none;
  cursor: wait;
}

/* กล่องสิทธิ์หัวใจ: ตัวอักษรเข้มบนพื้นครีม อ่านได้ */
.admin-heart-perk-box {
  background: #fff8e6 !important;
  border: 1px solid #f5d78a !important;
  color: #3f2a00 !important;
}
html body .admin-main-panel .admin-heart-perk-box,
html body .admin-main-panel .admin-heart-perk-box .form-label,
html body .admin-main-panel .admin-heart-perk-box .form-check,
html body .admin-main-panel .admin-heart-perk-box .form-check-label,
html body .admin-main-panel .admin-heart-perk-box p,
html body .modal .admin-heart-perk-box,
html body .modal .admin-heart-perk-box .form-label,
html body .modal .admin-heart-perk-box .form-check,
html body .modal .admin-heart-perk-box .form-check-label,
html body .modal .admin-heart-perk-box p {
  color: #3f2a00 !important;
}
html body .admin-main-panel .admin-heart-perk-box .text-muted,
html body .modal .admin-heart-perk-box .text-muted {
  color: #6b5420 !important;
}

/* Compact admin lists — smaller type, inline tools, tighter tables */
.admin-main-panel > .p-4,
.admin-main-panel > .p-lg-5,
.admin-main-panel .p-4.p-lg-5 {
  padding: 20px 22px !important;
}
.admin-main-panel h3.fw-bold,
.admin-main-panel h3 {
  font-size: 1.15rem !important;
  line-height: 1.25;
}
.admin-main-panel .d-flex.justify-content-between.mb-5 {
  margin-bottom: 1.15rem !important;
}
html body .admin-main-panel button#open_insert,
html body .admin-main-panel #open_insert.btn {
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 18px rgba(237, 32, 82, .28);
}
.admin-main-panel .table td,
.admin-main-panel .table th,
.admin-main-panel table.dataTable td,
.admin-main-panel table.dataTable th {
  padding: 7px 10px !important;
  font-size: 13px !important;
  vertical-align: middle;
}
.admin-main-panel .table td.py-3,
.admin-main-panel .table th.py-3 {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}
.admin-main-panel .table td img,
.admin-main-panel table.dataTable td img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain;
  background: #0b0b0d;
}
.admin-main-panel .table .text-main,
.admin-main-panel table.dataTable .text-main {
  font-size: 13px !important;
  font-weight: 700 !important;
}
.admin-main-panel .table .badge,
.admin-main-panel table.dataTable .badge,
.admin-main-panel .table .shop-os-badge,
.admin-main-panel table.dataTable .shop-os-badge {
  font-size: 10px !important;
  padding: 2px 7px !important;
  font-weight: 650 !important;
}
.admin-main-panel .table .btn,
.admin-main-panel table.dataTable .btn {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
  white-space: nowrap !important;
  min-height: 26px !important;
  padding: 3px 9px !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
}
.admin-main-panel .table .btn i,
.admin-main-panel table.dataTable .btn i {
  font-size: 10.5px !important;
  margin: 0 !important;
}
.admin-main-panel .table td .d-flex,
.admin-main-panel table.dataTable td .d-flex {
  flex-wrap: nowrap !important;
  gap: 5px !important;
  align-items: center;
}
.admin-main-panel .dataTables_length select,
.admin-main-panel .dataTables_filter input {
  min-height: 32px !important;
  height: 32px !important;
  width: auto !important;
  padding: 2px 10px !important;
  font-size: 13px !important;
}
.admin-main-panel .dataTables_filter input {
  width: 180px !important;
}
.admin-main-panel .dataTables_length label,
.admin-main-panel .dataTables_filter label {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.admin-main-panel .dataTables_info,
.admin-main-panel .dataTables_paginate {
  font-size: 12.5px !important;
}

.admin-size-hint {
  margin-top: 0.45rem;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(237, 32, 82, 0.08);
  border: 1px solid rgba(237, 32, 82, 0.22);
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.5;
}
.admin-size-hint i {
  color: #ed2052;
  margin-right: 4px;
}
.admin-size-hint strong {
  color: #ed2052;
  font-weight: 700;
}
body.theme-dark .admin-size-hint {
  color: rgba(255,255,255,.72);
  background: rgba(237, 32, 82, 0.12);
}
.admin-media-pick {
  display: flex;
  gap: 8px;
}
.admin-media-opt {
  flex: 1;
  cursor: pointer;
  margin: 0;
  position: relative;
}
.admin-media-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.admin-media-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  font-weight: 700;
  font-size: 0.85rem;
  background: #fff;
  color: #0f172a;
}
body.theme-dark .admin-media-opt span {
  background: #141416;
  color: #fff;
  border-color: rgba(255,255,255,.12);
}
.admin-media-opt input:checked + span {
  border-color: #ed2052;
  background: rgba(237, 32, 82, .1);
  color: #ed2052;
}

.cat-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-sort-grip {
  color: rgba(255,255,255,.45);
  cursor: grab;
  padding: 4px 2px;
  font-size: 14px;
}
.cat-sort-grip:active { cursor: grabbing; }
.cat-sort-num {
  min-width: 18px;
  font-weight: 800;
  font-size: 13px;
  color: var(--primary, #ed2052);
}
.cat-sort-btns {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.cat-sort-btn {
  min-width: 22px !important;
  min-height: 18px !important;
  padding: 0 5px !important;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: #fff !important;
  border-radius: 6px !important;
}
.cat-sort-btn:disabled {
  opacity: .28 !important;
}
.cat-sort-row.is-dragging {
  opacity: .45;
}
body.theme-light .cat-sort-grip { color: #94a3b8; }
body.theme-light .cat-sort-btn {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.fam-pick {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #101013;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 14px;
  height: 100%;
}
.fam-pick img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 12px;
  background: #050506;
  flex-shrink: 0;
}
.fam-pick-body h4 {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 4px;
}
.fam-pick-body p {
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  margin: 0 0 10px;
}
.fam-panel {
  background: #101013;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 18px 18px 20px;
}
.fam-panel-head {
  color: #fff;
  font-weight: 800;
  margin-bottom: 14px;
}
.fam-preview {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  background: #050506;
  border-radius: 12px;
}
.fam-gallery-preview {
  display: block;
  max-width: 160px;
  max-height: 90px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #050506;
}
.fam-gallery-preview[hidden] { display: none !important; }
.fam-pack {
  background: #0b0b0d;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px 14px 16px;
  margin-bottom: 12px;
}
.fam-pack-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.fam-pack-name {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}
.fam-stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.4);
  color: #fecaca;
  font-size: 12px;
  font-weight: 700;
}
.fam-stock-chip.is-on {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.4);
  color: #bbf7d0;
}
.fam-stock-chip i { color: inherit; }
.fam-pick.is-oos {
  outline: 1px solid rgba(239,68,68,.45);
  box-shadow: 0 0 0 1px rgba(239,68,68,.15);
}
.admin-oos-alert,
.admin-ops-alerts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-ops-alert,
.admin-oos-alert {
  background: linear-gradient(180deg, rgba(127,29,29,.35), rgba(15,23,42,.92));
  border: 1px solid rgba(239,68,68,.45);
  border-radius: 16px;
  padding: 16px 18px;
  color: #fee2e2;
}
.admin-ops-alert.is-warn {
  background: linear-gradient(180deg, rgba(120,53,15,.4), rgba(15,23,42,.92));
  border-color: rgba(245,158,11,.5);
  color: #ffedd5;
}
.admin-ops-alert.is-amber {
  background: linear-gradient(180deg, rgba(113,63,18,.35), rgba(15,23,42,.92));
  border-color: rgba(251,191,36,.4);
  color: #fef3c7;
}
.admin-ops-alert.is-danger,
.admin-oos-alert {
  background: linear-gradient(180deg, rgba(127,29,29,.35), rgba(15,23,42,.92));
  border-color: rgba(239,68,68,.45);
  color: #fee2e2;
}
.admin-ops-alert__head,
.admin-oos-alert__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.admin-ops-alert__head p,
.admin-oos-alert__head p {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: .92;
}
.admin-ops-alert.is-warn .admin-ops-alert__head p { color: #fde68a; }
.admin-ops-alert.is-amber .admin-ops-alert__head p { color: #fde68a; }
.admin-ops-alert.is-danger .admin-ops-alert__head p,
.admin-oos-alert__head p { color: #fecaca; }
.admin-ops-alert__head strong,
.admin-oos-alert__head strong {
  color: #fff;
  font-size: 1rem;
}
.admin-ops-alert__list,
.admin-oos-alert__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-ops-alert__list li,
.admin-oos-alert__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
}
.admin-ops-alert.is-warn .admin-ops-alert__list li { border-color: rgba(245,158,11,.25); }
.admin-ops-alert.is-danger .admin-ops-alert__list li,
.admin-oos-alert__list li { border-color: rgba(239,68,68,.25); }
.admin-ops-alert__list li > div,
.admin-oos-alert__list li > div {
  flex: 1 1 auto;
  min-width: 0;
}
.admin-ops-alert__list b,
.admin-oos-alert__list b {
  display: block;
  color: #fff;
  font-size: 14px;
}
.admin-ops-alert__list small,
.admin-oos-alert__list small {
  display: block;
  font-size: 12px;
  margin-top: 2px;
  opacity: .9;
}
.admin-ops-alert.is-warn .admin-ops-alert__list small { color: #fcd34d; }
.admin-ops-alert.is-amber .admin-ops-alert__list small { color: #fde047; }
.admin-ops-alert.is-danger .admin-ops-alert__list small,
.admin-oos-alert__list small { color: #fca5a5; }
.admin-ops-dot,
.admin-oos-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.2);
  flex: 0 0 auto;
}
.admin-ops-dot.is-warn {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245,158,11,.22);
}
.admin-ops-dot.is-amber {
  background: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251,191,36,.2);
}
.admin-ops-dot.is-danger { background: #ef4444; }
.admin-ops-more {
  justify-content: center !important;
  color: rgba(255,255,255,.65);
  font-size: 12px;
  font-weight: 700;
}
.admin-inline-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(245,158,11,.14);
  border: 1px solid rgba(245,158,11,.4);
  color: #fcd34d;
  font-size: 12px;
  font-weight: 700;
}
.form-control.is-warn-field {
  border-color: rgba(245,158,11,.7) !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.fam-keys-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}
.fam-keys-count b {
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}
.fam-keys-count.is-ready {
  color: #bbf7d0;
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.4);
}
.fam-keys-count.is-ready b { color: #86efac; }
.fam-key-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: rgba(255,255,255,.7);
}
.fam-key-list li {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
.fam-pack-new {
  border-style: dashed;
  border-color: rgba(255,255,255,.18);
}
.hs-slot {
  background: #0b0b0d;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px;
  height: 100%;
}
.hs-slot-n {
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}
.hs-warn {
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .35);
  color: #fcd34d;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.home-stats-admin .hx-stats.is-preview {
  margin: 0;
}
.home-stats-admin #hs_enabled {
  width: 3rem;
  height: 1.5rem;
  cursor: pointer;
}
.hs-step {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.hs-step .hs-manual {
  text-align: center;
  font-weight: 800;
}
.hs-step-btn {
  width: 44px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0b0b0d;
  color: #fff;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
}

.admin-main-panel .cm-admin-list,
.admin-main-panel .list-group.cm-admin-list {
  background: #141418 !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  overflow: hidden;
}
.admin-main-panel .cm-admin-row,
.admin-main-panel .list-group-item.cm-admin-row {
  background: #1a1a1f !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.08) !important;
}
.admin-main-panel .cm-admin-row + .cm-admin-row {
  border-top: 1px solid rgba(255,255,255,.08) !important;
}
.admin-main-panel .cm-admin-row .text-dark,
.admin-main-panel .cm-admin-row .fw-bold {
  color: #fff !important;
}
.admin-main-panel .cm-admin-row .text-muted {
  color: #a1a1aa !important;
}
.admin-main-panel .cm-admin-row .btn-outline-secondary {
  color: #a1a1aa !important;
}
.admin-main-panel .cm-admin-row .btn-outline-secondary:hover {
  color: #fff !important;
}

/* ═══════════════════════════════════════════
   Admin Modern Theme v2 — full backend cascade
   ═══════════════════════════════════════════ */
.admin-frame {
  --admin-bg: #0b0b10;
  --admin-card: #17171f;
  --admin-soft: #1a1a24;
  --admin-line: rgba(255, 255, 255, 0.1);
  --admin-muted: #a1a1aa;
  --admin-emerald: #4ade80;
  --admin-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #ed2052 100%);
  background: var(--admin-bg);
  color: #fff;
}

.admin-frame .d-lg-none .form-select {
  background: #17171f !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #fff !important;
  border-radius: 12px !important;
  min-height: 44px;
  color-scheme: dark;
}

.ops-workspace {
  padding: 18px 20px;
}
.ops-card {
  background: var(--admin-card, #17171f);
  border: 1px solid var(--admin-line, rgba(255,255,255,.1));
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.ops-workspace.ops-card {
  padding: 18px 20px;
}
.ops-metric {
  display: block;
  color: var(--admin-emerald, #4ade80);
  font-family: "Outfit", "Prompt", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}
.ops-workspace.ops-card,
.ops-dash .ops-workspace {
  background: #17171f;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
}

html body .admin-main-panel .card,
html body .admin-main-panel .card.border-0,
html body .admin-main-panel .card.bg-light,
html body .admin-main-panel .card.bg-white,
html body .admin-main-panel .xez-card,
html body .admin-main-panel .xdvz-card {
  background: #17171f !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 16px !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.25) !important;
}
html body .admin-main-panel .card.bg-white,
html body .admin-main-panel .bg-white,
html body .admin-main-panel .table.bg-white,
html body .admin-main-panel table.bg-white {
  background: #17171f !important;
  color: #fff !important;
}
html body .admin-main-panel .border-light {
  border-color: rgba(255,255,255,.12) !important;
}
html body .admin-main-panel .shadow-sm {
  box-shadow: 0 8px 24px rgba(0,0,0,.28) !important;
}

html body .admin-main-panel .table,
html body .admin-main-panel table.dataTable {
  --bs-table-bg: transparent;
  --bs-table-color: #f4f4f5;
  --bs-table-striped-bg: rgba(255,255,255,.03);
  --bs-table-hover-bg: rgba(124, 58, 237, .08);
  --bs-table-border-color: rgba(255,255,255,.08);
  color: #f4f4f5 !important;
  border-color: rgba(255,255,255,.08) !important;
}
html body .admin-main-panel .table > :not(caption) > * > * {
  background-color: transparent !important;
  border-bottom-color: rgba(255,255,255,.08) !important;
  color: #f4f4f5 !important;
}
html body .admin-main-panel .table thead th,
html body .admin-main-panel table.dataTable thead th {
  background: #1c1c28 !important;
  color: #fff !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
}
html body .admin-main-panel .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,.025) !important;
  color: #f4f4f5 !important;
}
html body .admin-main-panel .table-hover > tbody > tr:hover > * {
  background-color: rgba(124, 58, 237, .1) !important;
  color: #fff !important;
}

html body .admin-main-panel .modal-content {
  background: #17171f !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #fff !important;
  border-radius: 16px !important;
}
html body .admin-main-panel .modal-header,
html body .admin-main-panel .modal-footer {
  border-color: rgba(255,255,255,.1) !important;
}
html body .admin-main-panel .modal-title {
  color: #fff !important;
}
html body .admin-main-panel .btn-close {
  filter: invert(1) grayscale(1);
  opacity: .7;
}

html body .admin-main-panel .list-group-item {
  background: #1a1a24 !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.08) !important;
}
html body .admin-main-panel .alert-light,
html body .admin-main-panel .alert-secondary {
  background: rgba(255,255,255,.06) !important;
  color: #e4e4e7 !important;
  border-color: rgba(255,255,255,.12) !important;
}
html body .admin-main-panel .alert-success {
  background: rgba(74, 222, 128, .12) !important;
  color: #86efac !important;
  border-color: rgba(74, 222, 128, .28) !important;
}
html body .admin-main-panel .alert-danger,
html body .admin-main-panel .alert-warning {
  border-radius: 12px;
}

html body .admin-main-panel .nav-tabs {
  border-bottom-color: rgba(255,255,255,.1) !important;
}
html body .admin-main-panel .nav-tabs .nav-link {
  color: #a1a1aa !important;
  border: none !important;
}
html body .admin-main-panel .nav-tabs .nav-link.active {
  color: #fff !important;
  background: transparent !important;
  border-bottom: 2px solid #db2777 !important;
}

html body .admin-main-panel .btn-outline-primary {
  color: #e879f9 !important;
  border-color: rgba(219, 39, 119, .45) !important;
  background: rgba(219, 39, 119, .08) !important;
}
html body .admin-main-panel .btn-outline-primary:hover,
html body .admin-main-panel .btn-outline-primary.active {
  color: #fff !important;
  background: linear-gradient(135deg, #7c3aed, #db2777) !important;
  border-color: transparent !important;
}
html body .admin-main-panel .btn-outline-secondary,
html body .admin-main-panel .btn-outline-dark {
  color: #d4d4d8 !important;
  border-color: rgba(255,255,255,.2) !important;
  background: transparent !important;
}
html body .admin-main-panel .btn-success:not(.admin-save-btn) {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border: none !important;
  color: #fff !important;
}
html body .admin-main-panel .btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  border: none !important;
  color: #fff !important;
}

html body .admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #d4d4d8 !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
}
html body .admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html body .admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
html body .admin-main-panel .page-item.active .page-link {
  background: #fff !important;
  color: #111 !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 800 !important;
}
html body .admin-main-panel .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}
html body .admin-main-panel .page-link {
  background: #1a1a24 !important;
  color: #d4d4d8 !important;
  border-color: rgba(255,255,255,.12) !important;
}

.ops-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ops-presets a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: #d4d4d8 !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ops-presets a:hover {
  color: #fff !important;
  border-color: rgba(167, 139, 250, .45);
  background: rgba(124, 58, 237, .14);
}
.ops-presets a.is-on {
  background: #fff !important;
  color: #111 !important;
  border-color: #fff !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

.ops-btn-primary {
  background: var(--admin-gradient, linear-gradient(135deg, #7c3aed, #db2777, #ed2052)) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .28);
}
.ops-dash .ops-profit,
.admin-main-panel .ops-profit {
  color: #4ade80 !important;
  font-weight: 700;
}
.ops-dash .ops-loss,
.admin-main-panel .ops-loss {
  color: #fb7185 !important;
  font-weight: 700;
}

.dash-topup-total strong,
.dash-kpi b {
  letter-spacing: -0.02em;
}
.dash-topup-total strong {
  color: #4ade80 !important;
}

html body .admin-main-panel .accordion-item {
  background: #17171f !important;
  border-color: rgba(255,255,255,.1) !important;
  color: #fff !important;
}
html body .admin-main-panel .accordion-button {
  background: #1a1a24 !important;
  color: #fff !important;
  box-shadow: none !important;
}
html body .admin-main-panel .accordion-button:not(.collapsed) {
  background: rgba(124, 58, 237, .16) !important;
  color: #fff !important;
}
html body .admin-main-panel .accordion-body {
  background: #14141c !important;
  color: #e4e4e7 !important;
}

html body .admin-main-panel .dropdown-menu {
  background: #17171f !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}
html body .admin-main-panel .dropdown-item {
  color: #e4e4e7 !important;
}
html body .admin-main-panel .dropdown-item:hover {
  background: rgba(124, 58, 237, .16) !important;
  color: #fff !important;
}

html body .admin-main-panel input[type="date"],
html body .admin-main-panel input[type="time"],
html body .admin-main-panel input[type="datetime-local"] {
  color-scheme: dark;
}

.stock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 1.25rem;
}
.stock-search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}
.stock-search-wrap--sm {
  flex: 1 1 200px;
  max-width: 280px;
}
.stock-search-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.45);
  font-size: 13px;
  pointer-events: none;
}
.stock-search {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: #17171f;
  color: #fff;
  padding: 0 16px 0 40px;
}
.stock-search::placeholder { color: rgba(255,255,255,.42); }
.stock-search:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .16);
}
.stock-toolbar .shop-os-filter { margin-bottom: 0; }
.fam-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fam-pack.is-pack-hit {
  outline: 1px solid rgba(var(--primary-rgb), .45);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), .16);
}

@media (max-width: 991px) {
  .admin-main-panel {
    padding-bottom: 40px;
  }
  .ops-dash {
    padding: 14px 12px 28px;
  }
}
