/* ============================================================
   OnyTCG Gestionale POS — Design tokens & component styles
   Token-driven (CSS custom properties). Tweaks override vars
   on .app so the whole UI re-themes live. Dark-ready: neutral
   ramp is referenced through semantic vars only.
   ============================================================ */

:root {
  /* Brand */
  --brand-blue: #2866B1;
  --brand-blue-mid: #1e4f8c;
  --brand-dark: #1a1a2e;
  --gold: #F1C40F;
  --gold-deep: #c79a07;

  /* Semantic status */
  --success: #16a34a;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --info: #2866B1;

  /* Neutral ramp (slate, cool) */
  --n-0: #ffffff;
  --n-25: #fbfcfe;
  --n-50: #f8fafc;
  --n-100: #f1f5f9;
  --n-150: #eaeef3;
  --n-200: #e2e8f0;
  --n-300: #cbd5e1;
  --n-400: #94a3b8;
  --n-500: #64748b;
  --n-600: #475569;
  --n-700: #334155;
  --n-800: #1e293b;
  --n-900: #0f172a;

  /* Semantic surfaces & text (light) */
  --bg: var(--n-50);
  --surface: var(--n-0);
  --surface-2: var(--n-50);
  --surface-sunken: var(--n-100);
  --divider: var(--n-150);
  --line: var(--n-200);
  --line-strong: var(--n-300);

  --ink: var(--brand-dark);
  --body: var(--n-600);
  --meta: var(--n-500);
  --label: var(--n-400);
  --on-accent: #ffffff;

  /* Accent (tweakable) */
  --accent: var(--brand-blue);
  --accent-deep: var(--brand-blue-mid);
  --accent-soft: #e8f0fa;
  --accent-tint: #f3f8fd;

  /* Geometry (tweakable scales) */
  --radius-scale: 1;
  --r-xs: calc(6px * var(--radius-scale));
  --r-sm: calc(10px * var(--radius-scale));
  --r-md: calc(14px * var(--radius-scale));
  --r-lg: calc(20px * var(--radius-scale));
  --r-pill: 999px;

  /* Shadows (tweakable depth via --shadow-k) */
  --shadow-k: 1;
  --sh-xs: 0 1px 2px rgba(15,52,96,calc(0.06 * var(--shadow-k)));
  --sh-sm: 0 2px 8px rgba(15,52,96,calc(0.06 * var(--shadow-k))), 0 1px 2px rgba(15,52,96,calc(0.04 * var(--shadow-k)));
  --sh-md: 0 8px 24px rgba(15,52,96,calc(0.08 * var(--shadow-k))), 0 2px 6px rgba(15,52,96,calc(0.05 * var(--shadow-k)));
  --sh-lg: 0 18px 48px rgba(15,52,96,calc(0.14 * var(--shadow-k))), 0 6px 16px rgba(15,52,96,calc(0.07 * var(--shadow-k)));
  --sh-pop: 0 24px 64px rgba(15,52,96,calc(0.22 * var(--shadow-k)));

  /* Density (tweakable) */
  --d: 1;            /* spacing multiplier */
  --row-h: calc(64px * var(--d));
  --touch: 48px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --fs: 16px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.3, .5, 1);
}

* { box-sizing: border-box; }

/* Injected Font Awesome SVGs (svg+js mode): keep them square and from
   overflowing their <i> box so they never jam against adjacent text. */
.svg-inline--fa { width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
i.fa-fw { display: inline-flex; align-items: center; justify-content: center; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--body);
  background: var(--brand-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

button { font-family: inherit; }

.tabnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--bg);
  color: var(--body);
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 256px;
  background: var(--brand-dark);
  color: #cdd3e0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: width .2s var(--ease);
}
.sidebar.collapsed { width: 76px; }

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  min-height: 72px;
}
.sb-logo {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-mid));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -.04em;
  box-shadow: 0 4px 14px rgba(40,102,177,.45), inset 0 1px 0 rgba(255,255,255,.25);
  position: relative;
}
.sb-logo::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 14px; height: 14px; border-radius: 5px;
  background: var(--gold);
  box-shadow: 0 0 0 2.5px var(--brand-dark);
}
.sb-name { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.sb-name b { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.sb-name span { font-size: 11px; color: #7b86a3; font-weight: 600; letter-spacing: .04em; }

.sb-nav {
  flex: 1; overflow-y: auto; padding: 6px 12px 16px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent;
}
.sb-nav::-webkit-scrollbar { width: 7px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 4px; }

.sb-sect {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #58607a;
  padding: 16px 12px 6px;
}
.sidebar.collapsed .sb-sect { text-align: center; padding-left: 0; padding-right: 0; font-size: 0; }
.sidebar.collapsed .sb-sect::before { content: "•"; font-size: 14px; color: #39415c; }

.sb-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  margin: 2px 0;
  border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-sm);
  color: #aeb6c9; font-size: 14px; font-weight: 600; text-align: left;
  position: relative;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.sb-item i.fa-fw { width: 20px; font-size: 15px; text-align: center; flex-shrink: 0; }
.sb-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-item.active { background: linear-gradient(100deg, rgba(40,102,177,.92), rgba(30,79,140,.92)); color: #fff; box-shadow: 0 6px 18px rgba(40,102,177,.35); }
.sb-item.active i { color: #fff; }
.sb-item.child { padding-left: 40px; font-size: 13px; font-weight: 500; }
.sb-item .sb-badge {
  margin-left: auto; font-size: 11px; font-weight: 800;
  background: var(--danger); color: #fff; border-radius: var(--r-pill);
  min-width: 20px; height: 19px; padding: 0 6px; display: grid; place-items: center;
}
.sb-item.active .sb-badge { background: rgba(255,255,255,.25); }
.sidebar.collapsed .sb-label, .sidebar.collapsed .sb-badge { display: none; }
.sidebar.collapsed .sb-item { justify-content: center; padding-left: 12px; padding-right: 12px; }
.sidebar.collapsed .sb-item.child { padding-left: 12px; }

.sb-foot {
  padding: 12px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.sb-foot .av { flex-shrink: 0; }
.sb-foot-info { min-width: 0; line-height: 1.2; }
.sb-foot-info b { display: block; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-info span { font-size: 11px; color: #7b86a3; }
.sidebar.collapsed .sb-foot-info { display: none; }

/* ---------- Main column ---------- */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  height: 64px; flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
}
.tb-toggle {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--meta); cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px;
  transition: background .14s, color .14s;
}
.tb-toggle:hover { background: var(--surface-sunken); color: var(--ink); }
.tb-title { display: flex; flex-direction: column; line-height: 1.15; }
.tb-title b { color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.tb-title span { font-size: 12px; color: var(--meta); font-weight: 500; }
.tb-spacer { flex: 1; }

.tb-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--body);
}
.tb-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.tb-chip.ok { background: var(--success-bg); border-color: #bbf7d0; color: #15803d; }
.tb-chip.ok .dot { background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.tb-chip.bad { background: var(--danger-bg); border-color: #fecaca; color: #b91c1c; }
.tb-chip.bad .dot { background: var(--danger); }

.tb-btn {
  height: 40px; padding: 0 18px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--body);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .14s, border-color .14s, transform .1s;
}
.tb-btn:hover { background: var(--surface-sunken); }
.tb-btn:active { transform: scale(.97); }
.tb-btn.danger { color: var(--danger); border-color: #fecaca; background: var(--danger-bg); }
.tb-btn.danger:hover { background: #fee2e2; }

.screen {
  flex: 1; overflow-y: auto; min-height: 0;
  scrollbar-width: thin; scrollbar-color: var(--n-300) transparent;
}
.screen::-webkit-scrollbar { width: 10px; height: 10px; }
.screen::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 6px; border: 2px solid var(--bg); }
.screen-pad { padding: 26px; max-width: 1400px; }
.screen-pad.wide { max-width: none; }

/* ============================================================
   Generic primitives
   ============================================================ */
.av {
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; color: #fff; flex-shrink: 0;
  width: 40px; height: 40px; font-size: 14px; letter-spacing: -.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.av.lg { width: 56px; height: 56px; font-size: 19px; }
.av.xl { width: 76px; height: 76px; font-size: 26px; border-radius: 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.card.pad { padding: calc(20px * var(--d)); }

.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.section-head .sub { font-size: 13px; color: var(--meta); }
.section-head .grow { flex: 1; }

.label-up {
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--label);
}

/* Buttons */
.btn {
  height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; background: var(--surface-sunken); color: var(--body);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: background .15s var(--ease), box-shadow .15s, transform .08s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn i { font-size: 14px; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--body); }
.btn.ghost:hover { background: var(--surface-sunken); border-color: var(--line-strong); }
.btn.subtle { background: var(--surface-sunken); color: var(--body); }
.btn.subtle:hover { background: var(--n-150); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn.primary:hover { background: var(--accent-deep); }
.btn.gold { background: var(--gold); color: #4a3a00; box-shadow: 0 6px 16px -4px rgba(241,196,15,.6); }
.btn.gold:hover { background: #e6b80c; }
.btn.success { background: var(--success); color: #fff; box-shadow: 0 6px 16px -4px rgba(22,163,74,.5); }
.btn.success:hover { background: #15803d; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.danger-soft { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn.lg { height: 54px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--meta);
  cursor: pointer; display: grid; place-items: center; font-size: 14px;
  transition: background .14s, color .14s, border-color .14s;
}
.icon-btn:hover { background: var(--surface-sunken); color: var(--ink); border-color: var(--line-strong); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.badge i { font-size: 10px; }
.badge.green { background: var(--success-bg); color: #15803d; }
.badge.red { background: var(--danger-bg); color: #b91c1c; }
.badge.amber { background: var(--warning-bg); color: #b45309; }
.badge.blue { background: var(--accent-soft); color: var(--accent-deep); }
.badge.gray { background: var(--surface-sunken); color: var(--n-500); }
.badge.gold { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92700a; box-shadow: inset 0 0 0 1px rgba(241,196,15,.4); }
.badge.dark { background: var(--brand-dark); color: #fff; }
.badge.store { background: #f3e8ff; color: #7c3aed; }

/* Pills/tabs */
.pills { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-sunken); border-radius: var(--r-pill); }
.pills.block { display: flex; }
.pill {
  border: 0; background: transparent; cursor: pointer;
  height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; color: var(--meta);
  display: inline-flex; align-items: center; gap: 7px; flex: 1; justify-content: center;
  transition: background .15s, color .15s, box-shadow .15s;
}
.pill:hover { color: var(--ink); }
.pill.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }

/* Inputs */
.field {
  height: 44px; width: 100%; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--label); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.field { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--n-600); margin-bottom: 7px; }
.search-wrap { position: relative; }
.search-wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--label); font-size: 14px; pointer-events: none; }
.search-wrap .field { padding-left: 40px; }

/* Stat cards */
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px; box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
}
.stat .stat-ic {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 16px; margin-bottom: 14px;
}
.stat .stat-val { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.stat .stat-lbl { font-size: 12.5px; color: var(--meta); font-weight: 600; margin-top: 7px; }
.stat .stat-delta { font-size: 12px; font-weight: 700; margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; }
.stat .stat-delta.up { color: var(--success); }
.stat .stat-delta.down { color: var(--danger); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--label);
  padding: 0 14px 12px; border-bottom: 1px solid var(--line);
}
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--divider); font-size: 14px; color: var(--body); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .t-strong { font-weight: 700; color: var(--ink); }
.tbl .t-meta { font-size: 12px; color: var(--meta); }

/* Product thumb (placeholder tile per game) */
.thumb {
  border-radius: var(--r-sm); flex-shrink: 0; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff;
  width: 48px; height: 48px;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0 7px, rgba(255,255,255,0) 7px 14px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.thumb i { font-size: 16px; opacity: .95; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.thumb.lg { width: 64px; height: 64px; }
.thumb.xl { width: 84px; height: 84px; border-radius: var(--r-md); }
.thumb .thumb-tag { position: absolute; bottom: 0; left: 0; right: 0; font-family: var(--mono); font-size: 7.5px; text-align: center; padding: 2px; background: rgba(0,0,0,.32); letter-spacing: .02em; }

/* Empty state */
.empty { text-align: center; padding: 56px 24px; color: var(--meta); }
.empty .empty-ic {
  width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 20px;
  display: grid; place-items: center; font-size: 30px;
  background: var(--surface-sunken); color: var(--n-400);
}
.empty h3 { margin: 0 0 6px; font-size: 17px; color: var(--ink); font-weight: 800; }
.empty p { margin: 0 auto; max-width: 340px; font-size: 14px; line-height: 1.55; }

/* Drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 60; opacity: 0; animation: fadeIn .2s var(--ease) forwards; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 92%);
  background: var(--surface); z-index: 61; box-shadow: var(--sh-pop);
  display: flex; flex-direction: column;
  transform: translateX(100%); animation: slideIn .26s var(--ease) forwards;
  border-left: 1px solid var(--line);
}
@keyframes slideIn { to { transform: translateX(0); } }
@keyframes fadeIn { to { opacity: 1; } }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }

/* Modal */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  z-index: 70; display: grid; place-items: center; padding: 24px;
  opacity: 0; animation: fadeIn .18s var(--ease) forwards;
}
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-pop); width: 100%; max-width: 460px;
  max-height: 92%; overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(14px) scale(.98); opacity: 0;
  animation: popIn .26s var(--ease-spring) forwards;
}
@keyframes popIn { to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 24px 14px; display: flex; align-items: flex-start; gap: 14px; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--meta); }
.modal-body { padding: 0 24px 8px; overflow-y: auto; }
.modal-foot { padding: 16px 24px 20px; display: flex; gap: 10px; }

/* Toasts */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 9000; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; min-width: 280px; max-width: 420px;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  background: var(--brand-dark); color: #fff;
  border-radius: var(--r-md); padding: 13px 16px;
  display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--sh-lg);
  transform: translateY(20px); opacity: 0; animation: toastIn .3s var(--ease-spring) forwards;
}
@keyframes toastIn { to { transform: none; opacity: 1; } }
.toast .t-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; color: #fff; }
.toast .t-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.toast .t-title { font-size: 13.5px; font-weight: 800; line-height: 1.3; }
.toast .t-msg { font-size: 13px; font-weight: 500; opacity: .92; line-height: 1.4; }
.toast .t-act { flex-shrink: 0; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: var(--r-sm); cursor: pointer; }
.toast .t-act:hover { background: rgba(255,255,255,.26); }
.toast .t-x { flex-shrink: 0; width: 26px; height: 26px; border: 0; background: transparent; color: rgba(255,255,255,.7); cursor: pointer; border-radius: 6px; font-size: 13px; }
.toast .t-x:hover { background: rgba(255,255,255,.14); color: #fff; }
.toast.success .t-ic { background: var(--success); }
.toast.error .t-ic { background: var(--danger); }
.toast.warning .t-ic { background: var(--warning); }
.toast.info .t-ic { background: var(--accent); }
.toast.loading .t-ic { background: var(--n-500); }
.toast.brand .t-ic { background: var(--accent); }
.toast.fidelity .t-ic { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); }

/* Keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button {
  height: 58px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-md); font-size: 22px; font-weight: 700; color: var(--ink);
  cursor: pointer; transition: background .12s, transform .06s, box-shadow .12s;
  font-variant-numeric: tabular-nums;
}
.keypad button:hover { background: var(--surface-sunken); }
.keypad button:active { transform: scale(.95); background: var(--accent-soft); }
.keypad button.util { font-size: 16px; color: var(--meta); }
.keypad button.accent { color: var(--accent); }

/* Helpers */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.muted { color: var(--meta); }
.scrollable { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--n-300) transparent; }
.scrollable::-webkit-scrollbar { width: 8px; }
.scrollable::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 5px; }
.divider-h { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Combobox autocomplete */
.combo { position: relative; }
.combo-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 6px; max-height: 340px; display: flex; flex-direction: column; gap: 2px;
}
.combo-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.combo-item.hi, .combo-item:hover { background: var(--accent-soft); }

/* Stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; height: 40px; background: var(--surface); }
.stepper button { width: 36px; height: 100%; border: 0; background: var(--surface-2); color: var(--body); cursor: pointer; font-size: 12px; transition: background .12s, color .12s; }
.stepper button:hover { background: var(--surface-sunken); color: var(--accent); }
.stepper input { flex: 1; min-width: 0; width: 100%; border: 0; outline: none; text-align: center; font-weight: 800; font-size: 15px; color: var(--ink); background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Standalone toggle */
.oy-toggle { position: relative; width: 46px; height: 26px; border: 0; border-radius: 999px; background: var(--n-300); cursor: pointer; padding: 0; flex-shrink: 0; transition: background .15s; }
.oy-toggle[data-on="1"] { background: var(--success); }
.oy-toggle i { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s var(--ease-spring); }
.oy-toggle[data-on="1"] i { transform: translateX(20px); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
