@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS — exact match to revamp-cms
═══════════════════════════════════════════ */
:root {
  --bg:           #FAF7F6;
  --surface:      #FFFFFF;
  --surface-2:    #F3EEED;
  --surface-3:    #E9E2E0;
  --border:       #E0D7D5;
  --text:         #241B1A;
  --text-muted:   #756865;
  --text-faint:   #A0908C;

  --accent:          #ED1C24;
  --accent-strong:   #B3151B;
  --accent-soft:     #FBDBDC;
  --accent-contrast: #FFFFFF;

  --ok:        #2F8F5B;
  --ok-soft:   #DFEEE1;
  --warn:      #9C6B14;
  --warn-soft: #F3E7C8;
  --info:      #2F6FB0;
  --info-soft: #DCE9F5;
  --review:    #8A5A9E;
  --review-soft: #EBE0F0;

  --shadow-sm: 0 1px 2px rgba(30,26,10,0.08);
  --shadow-md: 0 12px 28px -10px rgba(30,26,10,0.28);

  
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --topbar-h: 60px;
  --side-w:   92px;
}

/* ═══════════════════════════════════════════
   BASE RESET
═══════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent-strong); text-decoration: none; }

/* ═══════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 16px; width: 100%;
  flex-shrink: 0;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 13px 7px 10px;
  font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text);
  white-space: nowrap; transition: background .14s, border-color .14s; text-decoration: none;
}
.back-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.ev-title { min-width: 0; flex: 1; }
.ev-title h1 { font-size: 16.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.ev-title .meta {
  font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; display: block;
}
.topbar-acts { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px; padding: 8px 15px; font-size: 13px; font-weight: 700;
  cursor: pointer; border: 1.5px solid transparent; white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary   { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.btn-ghost  { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--accent); color: var(--accent-contrast); }

.btn-sm   { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-icon {
  padding: 7px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .14s, color .14s, border-color .14s;
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); border-color: var(--text-faint); }
.btn-link {
  background: none; border: none; color: var(--accent); font-size: 13px;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
  gap: 4px; padding: 4px 0;
}
.btn-link:hover { text-decoration: underline; color: var(--accent-strong); }

/* ═══════════════════════════════════════════
   SHELL & RAIL
═══════════════════════════════════════════ */
.shell { display: flex; align-items: flex-start; flex: 1; overflow: hidden; width: 100%; }
.main  { flex: 1; min-width: 0; padding: 22px 26px 60px; overflow-y: auto; height: calc(100vh - var(--topbar-h)); }

.rail {
  width: var(--side-w); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); padding: 12px 8px 30px;
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; gap: 3px; position: sticky;
  top: var(--topbar-h); z-index: 900;
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%;
  padding: 11px 4px; border-radius: 13px; border: 0; background: transparent; cursor: pointer;
  color: var(--text-muted); transition: background .14s, color .14s; text-decoration: none;
  position: relative;
}
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.rail-item .ri { display: grid; place-items: center; }
.rail-item .rl { font-size: 10.5px; font-weight: 800; letter-spacing: .005em; line-height: 1.2; text-align: center; }
.rail-item .rdot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: -3px; }

/* Payment sub-menu hover */
.rail-sub {
  position: absolute; left: calc(100% + 4px); top: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 4px; min-width: 160px;
  opacity: 0; pointer-events: none; transform: translateX(-8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); z-index: 901;
}
.rail-sub::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; }
.rail-item.has-sub:hover .rail-sub { opacity: 1; pointer-events: auto; transform: translateX(0); }
.rail-sub-item {
  text-align: left; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); text-decoration: none; cursor: pointer; border: none; background: transparent;
  display: flex; align-items: center; gap: 8px;
}
.rail-sub-item i { font-size: 16px; }
.rail-sub-item:hover { background: var(--surface-2); color: var(--text); }
.rail-sub-item.active { background: var(--accent-soft); color: var(--accent-strong); }

/* ═══════════════════════════════════════════
   VIEW HEADER
═══════════════════════════════════════════ */
.vhead { margin-bottom: 18px; }
.crumb {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); margin-bottom: 5px;
}
.vhead h2 { font-size: 24px; }
.vhead .sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.vhead-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.vhead-row .grow { flex: 1; min-width: 200px; }

/* ═══════════════════════════════════════════
   PANELS & TABLES
═══════════════════════════════════════════ */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; overflow: hidden; margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
  background: var(--surface);
}
.panel-head h3 { font-size: 15px; }
.panel-head .sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
th {
  background: var(--surface-2); font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.055em;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.td-strong { font-weight: 700; }

/* ═══════════════════════════════════════════
   STAT TILES
═══════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 14px; display: flex; flex-direction: column; gap: 3px;
  transition: border-color .14s, transform .14s;
}
.stat .st-top { display: flex; align-items: center; gap: 8px; }
.stat .st-ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); flex-shrink: 0;
}
.stat .eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.stat .val { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; font-family: var(--font-display); color: var(--text); }
.stat .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════
   SUBTABS
═══════════════════════════════════════════ */
.subtabs {
  display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.subtabs button {
  border: 0; background: transparent; padding: 9px 14px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .13s, border-color .13s; display: flex; align-items: center; gap: 6px;
}
.subtabs button:hover { color: var(--text); }
.subtabs button.active, .subtabs button[aria-pressed="true"] {
  color: var(--accent-strong); border-bottom-color: var(--accent);
}
.subtabs .cnt {
  font-size: 10.5px; font-family: var(--font-mono); opacity: .7;
  background: var(--surface-2); padding: 2px 6px; border-radius: 99px;
}
.subtabs button.active .cnt { background: var(--accent-soft); color: var(--accent-strong); }
.detail-tab { border: 0; background: transparent; padding: 9px 14px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .13s, border-color .13s; display: flex; align-items: center; gap: 6px; }
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

/* ═══════════════════════════════════════════
   BADGES — revamp-cms system
═══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.b-ok     { background: var(--ok-soft);      color: var(--ok); }
.b-warn   { background: var(--warn-soft);    color: var(--warn); }
.b-info   { background: var(--info-soft);    color: var(--info); }
.b-accent { background: var(--accent-soft);  color: var(--accent-strong); }
.b-mute   { background: var(--surface-3);    color: var(--text-muted); }
.b-review { background: var(--review-soft);  color: var(--review); }

/* Legacy pills — kept for compatibility */
.spill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 99px; font-size: 10.5px; font-weight: 800;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pill-success { background: var(--ok-soft);   color: var(--ok); }
.pill-success .pill-dot { background: var(--ok); }
.pill-danger  { background: var(--accent-soft); color: var(--accent-strong); }
.pill-danger .pill-dot  { background: var(--accent); }
.pill-warning { background: var(--warn-soft); color: var(--warn); }
.pill-warning .pill-dot { background: var(--warn); }
.pill-neutral { background: var(--surface-2); color: var(--text-muted); }
.pill-neutral .pill-dot { background: var(--text-faint); }

/* ═══════════════════════════════════════════
   TOGGLE SWITCH — revamp-cms .tgl style
═══════════════════════════════════════════ */
.tgl {
  display: inline-flex; align-items: center; gap: 8px; background: transparent;
  border: 0; cursor: pointer; padding: 0; font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
}
.tgl .track {
  width: 34px; height: 19px; border-radius: 999px; background: var(--surface-3);
  position: relative; transition: background .16s; flex-shrink: 0;
}
.tgl .track i {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .16s; font-style: normal;
}
.tgl[aria-pressed="true"] .track { background: var(--ok); }
.tgl[aria-pressed="true"] .track i { transform: translateX(15px); }
.tgl[aria-pressed="true"] { color: var(--ok); }

/* Legacy toggle (preserved for other pages) */
.toggle-switch { position: relative; display: inline-block; width: 34px; height: 19px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--surface-3);
  border-radius: 999px; transition: 0.2s ease;
}
.toggle-slider::before {
  content: ""; position: absolute; left: 2px; bottom: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; transition: 0.2s ease; box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--ok); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(15px); }

/* ═══════════════════════════════════════════
   TOOLBAR / SEARCH / CHIPS
═══════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface);
}
.search-wrap {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 9px; padding: 0 11px;
  flex: 1; min-width: 180px; max-width: 380px;
}
.search-input { border: none !important; outline: none !important; padding: 8px 0; width: 100%; font-size: 13px; background: transparent; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--border); padding: 5px 12px;
  border-radius: 99px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; color: var(--text-muted);
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ═══════════════════════════════════════════
   EMPTY STATE — revamp-cms .empty pattern
═══════════════════════════════════════════ */
.empty {
  text-align: center; padding: 48px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.empty .ico {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-faint); margin-bottom: 2px; font-size: 24px;
}
.empty h4 { font-size: 16px; font-family: var(--font-display); color: var(--text); }
.empty p { font-size: 13px; color: var(--text-muted); margin: 0; max-width: 380px; line-height: 1.6; }

/* ═══════════════════════════════════════════
   TOAST — revamp-cms .toast system
═══════════════════════════════════════════ */
.toast-host {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 9px; pointer-events: none;
}
.toast {
  background: var(--text); color: var(--bg); padding: 11px 15px;
  border-radius: 10px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); max-width: 340px;
  animation: toast-in .22s ease; display: flex; align-items: center; gap: 9px;
  pointer-events: auto;
}
.toast.ok   { background: var(--ok); }
.toast.warn { background: var(--warn); }
.toast.err  { background: var(--accent-strong); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px); } }

/* ═══════════════════════════════════════════
   INLINE CONFIRM ROW
═══════════════════════════════════════════ */
.inline-confirm {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--accent-soft); border-radius: 8px; border: 1px solid rgba(237,28,36,.18);
  font-size: 12px; font-weight: 600; color: var(--accent-strong); white-space: nowrap;
}

/* ═══════════════════════════════════════════
   PAGE CARD — for payment page listings
═══════════════════════════════════════════ */
.page-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .14s, box-shadow .14s;
}
.page-card:hover { border-color: var(--accent-soft); box-shadow: var(--shadow-sm); }
.page-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.page-card-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.page-card-price { font-size: 20px; font-weight: 800; font-family: var(--font-display); color: var(--text); }
.page-card-gst { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.page-card-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   DRAWERS & MODALS
═══════════════════════════════════════════ */
.drawer-backdrop, .modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20,14,13,.55); backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: center; z-index: 1000;
  animation: toast-in .15s ease;
}
.drawer-backdrop { justify-content: flex-end; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  z-index: 1001; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-shrink: 0;
}
.drawer-title { font-size: 18px; font-family: var(--font-display); font-weight: 600; }
.drawer-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

.modal {
  background: var(--surface); width: 90%; max-width: 560px; border-radius: 15px;
  overflow: hidden; box-shadow: var(--shadow-lg); max-height: 86vh;
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-shrink: 0;
}
.modal-title { font-size: 17px; font-family: var(--font-display); font-weight: 600; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-col { display: flex; flex-direction: column; gap: 22px; }
.form-section { display: flex; flex-direction: column; gap: 14px; }
.form-section-header {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.fsec-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.field-hint { font-size: 11.5px; color: var(--text-muted); }
.req { color: var(--accent); }

input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  font-family: inherit; width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }

.form-error {
  color: var(--accent-strong); font-size: 12.5px;
  display: flex; align-items: center; gap: 6px; font-weight: 600;
  padding: 10px 13px; background: var(--accent-soft); border-radius: 8px;
}

/* Segmented control */
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 10px; border: 1px solid var(--border); }
.seg-btn {
  flex: 1; background: transparent; border: none; padding: 7px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.15s;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 700; }

/* Coupon code display */
.code-display-row { display: flex; gap: 8px; align-items: center; }
.code-display {
  flex: 1; padding: 9px 12px; background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 8px; font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: 1px;
}
.btn-regen {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 16px; transition: 0.15s; flex-shrink: 0;
}
.btn-regen:hover { color: var(--text); background: var(--surface-2); border-color: var(--text-faint); }

/* Checkbox line */
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; font-weight: 500; }
.checkline input { width: auto; margin: 0; }

/* Stat chip */
.stat-chip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px;
  height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3);
  font-size: 11px; font-weight: 700; color: var(--text); font-family: var(--font-mono);
}

/* Coupon chip */
.coupon-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 99px; font-size: 10px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid rgba(237,28,36,.15); font-family: var(--font-mono);
}
.coupon-chip.expired { opacity: .5; text-decoration: line-through; }

/* Warning / callout */
.callout {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent-strong); align-items: flex-start;
  font-size: 13px;
}
.callout.warn-box { background: var(--warn-soft); color: var(--warn); }
.callout.info-box { background: var(--info-soft); color: var(--info); }

/* Embed code */
.embed-code-block { background: #1E293B; border-radius: 10px; padding: 16px; overflow-x: auto; }
.embed-pre { color: #E2E8F0; font-family: var(--font-mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; margin: 0; line-height: 1.6; }

/* ═══════════════════════════════════════════
   MAIN WRAPPER (for non-index.html pages)
═══════════════════════════════════════════ */
.main-wrapper { flex: 1; overflow-y: auto; }
.main-content { padding: 24px 28px 60px; max-width: 1280px; }
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ═══════════════════════════════════════════
   CREATE PAGE LAYOUT
═══════════════════════════════════════════ */
.create-page-grid {
  display: grid; grid-template-columns: minmax(380px, 1fr) 360px;
  gap: 32px; max-width: 1040px; margin: 0 auto; align-items: start;
}
@media (max-width: 900px) { .create-page-grid { grid-template-columns: 1fr; } }
.create-page-form { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.create-page-preview {
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; align-self: start;
}
.preview-header {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); padding-left: 2px;
}
.preview-card-wrap {
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 14px; padding: 20px; display: flex; justify-content: center;
  align-items: flex-start;
}
.preview-mockup {
  background: #1C1A19; width: 100%; max-width: 300px; border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22); overflow: hidden;
}
.mockup-header {
  background: #272422; padding: 18px 16px 14px; text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.mockup-logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.12); margin: 0 auto 10px;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.6); font-family: var(--font-display);
}
.mockup-event { font-size: 11.5px; color: rgba(255,255,255,0.45); font-weight: 600; }
.mockup-body { padding: 24px 18px; }
.mockup-title { font-size: 17px; font-weight: 700; color: #F0EAE8; margin-bottom: 4px; text-align: center; font-family: var(--font-display); }
.mockup-price { font-size: 28px; font-weight: 800; color: #FFFFFF; font-family: var(--font-display); text-align: center; margin-bottom: 4px; letter-spacing: -0.02em; }
.mockup-price-sub { font-size: 11px; color: rgba(255,255,255,0.4); text-align: center; margin-bottom: 16px; }
.mockup-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 14px 0; }
.mockup-row { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.mockup-row span:last-child { font-weight: 600; color: rgba(255,255,255,0.75); }
.mockup-btn-wrap {
  margin-top: 22px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}
.mockup-btn-wrap.has-coupon {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
}
.mockup-coupon-box {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  padding: 14px 16px 12px;
  line-height: 1.3;
}
.mockup-btn {
  display: block; width: 100%; background: #C8A97A; color: #1C1A19; border: none;
  border-radius: 20px; padding: 12px; font-weight: 800; font-size: 14px;
  cursor: not-allowed; opacity: 0.9; letter-spacing: .01em;
  font-family: var(--font-body);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ═══════════════════════════════════════════
   HUD BAR — compact metrics strip
═══════════════════════════════════════════ */
.hud-bar {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; overflow: hidden; flex-wrap: wrap;
}
.hud-seg {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 120px;
  padding: 11px 16px; background: transparent; border: none; cursor: pointer;
  text-align: left; transition: background .14s; color: var(--text);
}
.hud-seg:hover { background: var(--surface-2); }
.hud-div { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }
.hud-icon {
  font-size: 17px; color: var(--text-faint); flex-shrink: 0;
  transition: color .14s;
}
.hud-icon--ok  { color: var(--ok); }
.hud-icon--warn{ color: var(--warn); }
.hud-icon--err { color: var(--accent-strong); }
.hud-inner { min-width: 0; }
.hud-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); margin-bottom: 1px;
}
.hud-val {
  font-size: 15px; font-weight: 800; font-family: var(--font-display);
  color: var(--text); letter-spacing: -0.01em; white-space: nowrap;
}
.hud-val--ok   { color: var(--ok); }
.hud-val--warn { color: var(--warn); }
.hud-val--err  { color: var(--accent-strong); }
.hud-sub {
  font-size: 10.5px; font-weight: 600; color: var(--text-faint);
  font-family: var(--font-body); margin-left: 4px;
}

/* ═══════════════════════════════════════════
   PAGE ROW PROGRESS BAR
═══════════════════════════════════════════ */
.pg-progress-track {
  height: 5px; background: var(--surface-3); border-radius: 99px;
  overflow: hidden; margin: 4px 0; width: 80px; max-width: 100%;
}
.pg-progress-fill {
  height: 100%; background: var(--ok); border-radius: 99px;
  transition: width .3s ease;
}
.pg-progress-fill.pg-progress--warn { background: var(--warn); }

/* ═══════════════════════════════════════════
   TRANSACTION ROW ACTION MENU
═══════════════════════════════════════════ */
.tx-action-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-md); min-width: 170px;
  overflow: hidden; animation: toast-in .15s ease;
}
.tx-action-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; background: transparent; border: none;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; text-align: left; transition: background .12s, color .12s;
}
.tx-action-menu button:hover { background: var(--surface-2); color: var(--text); }
.tx-action-menu button i { font-size: 15px; }

/* ═══════════════════════════════════════════
   TEMPLATE OPTION PICKER
═══════════════════════════════════════════ */
.tpl-opt {
  border: 1.5px solid var(--border); border-radius: 9px; padding: 10px 16px;
  cursor: pointer; transition: border-color .14s, background .14s;
  background: var(--surface); color: var(--text-muted); min-width: 90px;
  text-align: center;
}
.tpl-opt:hover { border-color: var(--accent); color: var(--text); }
.tpl-opt.active {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-strong);
}

