/* =====================================================================
   Adpro POS — modern light theme
   ===================================================================== */
:root{
  --bg:#f1f3f7; --surface:#ffffff; --surface-2:#f7f8fb;
  --text:#0f172a; --muted:#7b8494; --line:#e8ebf1;
  --accent:#4f46e5; --accent-2:#7c3aed; --accent-soft:#eef0fe;
  --success:#10b981; --warning:#f59e0b; --danger:#ef4444;
  --info:#3b82f6; --pink:#ec4899; --teal:#14b8a6;
  --r-lg:18px; --r-md:14px; --r-sm:10px; --cart-w:380px;
  --tap:48px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
  --shadow:0 12px 26px rgba(15,23,42,.10);
  --shadow-lg:0 24px 60px rgba(15,23,42,.22);
  --safe-top:env(safe-area-inset-top, 0px);
  --safe-bot:env(safe-area-inset-bottom, 0px);
  --ease:cubic-bezier(.4,0,.2,1);
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body{
  margin:0; min-height:100dvh;
  background:var(--bg); color:var(--text);
  font-family:'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing:antialiased; overscroll-behavior:none;
  user-select:none;
}
button{ font-family:inherit; border:0; background:none; cursor:pointer; color:inherit; }
input, select{ font-family:inherit; }
.hidden{ display:none !important; }
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-thumb{ background:#d3d9e6; border-radius:99px; border:3px solid transparent; background-clip:content-box; }

/* ===================== Preloader ===================== */
.preloader{
  position:fixed; inset:0; z-index:9999;
  display:grid; place-items:center;
  background:linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  transition:opacity .45s ease, visibility .45s ease;
}
.preloader.hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.preloader-inner{ display:flex; flex-direction:column; align-items:center; gap:18px; text-align:center; }
.preloader-mark{
  position:relative;
  width:104px; height:104px;
  border-radius:28px;
  background:#fff;
  display:grid; place-items:center;
  box-shadow:0 24px 60px rgba(0,0,0,.35);
  animation:preloaderSpin 2.4s cubic-bezier(.6,.05,.4,.95) infinite;
}
.preloader-mark img{ display:none; }
.preloader-mark.has-logo img{ display:block; width:70%; height:70%; object-fit:contain; }
.preloader-mark.has-logo .preloader-mark-letters{ display:none; }
.preloader-mark-letters{ font-size:34px; font-weight:800; letter-spacing:-.04em; color:#4f46e5; }
@keyframes preloaderSpin{
  0%   { transform:rotateY(0deg)   scale(1);    box-shadow:0 24px 60px rgba(0,0,0,.35); }
  50%  { transform:rotateY(180deg) scale(1.08); box-shadow:0 30px 80px rgba(0,0,0,.45); }
  100% { transform:rotateY(360deg) scale(1);    box-shadow:0 24px 60px rgba(0,0,0,.35); }
}
.preloader-name{ font-size:19px; font-weight:800; letter-spacing:-.02em; color:#fff; }
.preloader-version{ font-size:12px; font-weight:600; letter-spacing:.16em; color:rgba(255,255,255,.7); text-transform:uppercase; }

/* ===================== Brand ===================== */
.brand-mark{
  width:40px; height:40px; border-radius:12px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  display:grid; place-items:center;
  color:#fff; font-weight:800; font-size:14px; letter-spacing:-.02em;
  box-shadow:0 6px 16px rgba(79,70,229,.35); flex-shrink:0;
  overflow:hidden;
}
.brand-mark--lg{ width:60px; height:60px; border-radius:16px; font-size:22px; margin:0 auto 18px; }
.brand-mark img{ display:none; }
.brand-mark.has-logo{ background:#fff; box-shadow:0 4px 12px rgba(15,23,42,.08); }
.brand-mark.has-logo img{ display:block; width:100%; height:100%; object-fit:contain; border-radius:inherit; }
.brand-mark.has-logo .brand-mark-letters{ display:none; }

/* ===================== Login ===================== */
.login-screen{
  min-height:100dvh; display:flex; align-items:center; justify-content:center;
  padding:24px 16px calc(24px + var(--safe-bot));
}
.login-card{
  width:100%; max-width:400px;
  background:var(--surface); border-radius:var(--r-lg);
  padding:32px 26px; box-shadow:var(--shadow); text-align:center;
}
.login-title{ margin:0; font-size:22px; font-weight:800; letter-spacing:-.02em; }
.login-sub{ margin:4px 0 24px; color:var(--muted); font-size:13px; }
.login-form{ display:flex; flex-direction:column; gap:14px; text-align:left; }
.login-hint{ margin:20px 0 0; font-size:12px; color:var(--muted); text-align:center; }
.login-hint b{ color:var(--text); font-weight:700; }
.login-footer{ margin:12px 0 0; font-size:11px; color:var(--muted); letter-spacing:.04em; }

/* ===================== Fields ===================== */
.field{ display:flex; flex-direction:column; gap:6px; }
.field > span{
  font-size:12px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:600;
}
.field input, .field-select{
  height:var(--tap); padding:0 14px;
  border-radius:var(--r-md);
  border:1.5px solid var(--line);
  background:var(--surface); color:var(--text);
  font-size:16px; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.field input:focus, .field-select:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.field-row{ display:flex; gap:10px; }
.field-row .field{ flex:1; min-width:0; }
.field--check{ flex-direction:row !important; align-items:center; gap:8px; cursor:pointer; }
.field--check input[type="checkbox"]{ width:22px; height:22px; accent-color:var(--accent); }
.field--check span{ text-transform:none; letter-spacing:0; font-size:13px; color:var(--text); }

/* ===================== Buttons ===================== */
.btn{
  min-height:var(--tap); padding:0 18px;
  border-radius:var(--r-md);
  background:var(--surface-2); color:var(--text);
  font-size:15px; font-weight:700;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  touch-action:manipulation;
  transition:transform .12s, background .15s, color .15s, box-shadow .15s;
}
.btn:active{ transform:scale(.97); }
.btn--primary{
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff; box-shadow:0 8px 20px rgba(79,70,229,.28);
}
.btn--primary:disabled{ opacity:.42; cursor:not-allowed; box-shadow:none; }
.btn--ghost{ background:transparent; color:var(--text); border:1.5px solid var(--line); }
.btn--ghost:hover{ background:var(--surface-2); }
.btn--danger{ background:var(--danger); color:#fff; }
.btn--compact{ min-height:44px; padding:0 18px; font-size:14px; }
.btn--charge{ width:100%; height:56px; justify-content:space-between; padding:0 20px; font-size:15px; }
.icon-btn{
  width:38px; height:38px; border-radius:10px;
  display:grid; place-items:center; color:var(--muted);
  transition:background .15s, color .15s; flex-shrink:0;
}
.icon-btn:hover{ background:var(--surface-2); color:var(--text); }

/* ===================== HOME ===================== */
.home-view{
  min-height:100dvh;
  padding:calc(20px + var(--safe-top)) 20px calc(24px + var(--safe-bot));
  max-width:1100px; margin:0 auto;
  display:flex; flex-direction:column;
}
.home-header{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:32px;
}
.home-brand{ display:flex; align-items:center; gap:10px; min-width:0; flex:1; }
.home-brand-text{ min-width:0; flex:1; }
.home-brand-name{
  font-size:14px; font-weight:800; letter-spacing:-.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.home-brand-store{
  font-size:11px; color:var(--muted); margin-top:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.home-header-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; }

.sync-pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 11px; border-radius:999px;
  background:var(--surface); border:1px solid var(--line);
  font-family:inherit; font-size:11px; font-weight:700;
  color:var(--muted); cursor:pointer; flex-shrink:0;
  transition:background .15s, border-color .15s, color .15s, transform .1s;
}
.sync-pill:hover{ background:var(--surface-2); }
.sync-pill:active{ transform:scale(.96); }
.sync-pill-dot{
  width:8px; height:8px; border-radius:50%;
  background:var(--muted); flex-shrink:0;
}
.sync-pill.status--ok{ color:#047857; border-color:rgba(16,185,129,.35); }
.sync-pill.status--ok .sync-pill-dot{ background:#10b981; box-shadow:0 0 0 3px rgba(16,185,129,.22); }
.sync-pill.status--warn{ color:#b45309; border-color:rgba(245,158,11,.4); }
.sync-pill.status--warn .sync-pill-dot{ background:#f59e0b; box-shadow:0 0 0 3px rgba(245,158,11,.22); }
.sync-pill.status--fail{ color:#b91c1c; border-color:rgba(239,68,68,.4); }
.sync-pill.status--fail .sync-pill-dot{ background:#ef4444; box-shadow:0 0 0 3px rgba(239,68,68,.22); }
.sync-pill.status--unknown{ color:#4f46e5; border-color:rgba(79,70,229,.35); }
.sync-pill.status--unknown .sync-pill-dot{ background:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,.22); animation:syncPulse 1.5s ease-in-out infinite; }
@keyframes syncPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }

@media (max-width: 440px){
  .sync-pill-text{ display:none; }
  .sync-pill{ padding:7px; }
}

/* ===================== Queue badge ===================== */
.queue-badge{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px;
  border-radius:10px;
  background:var(--surface-2);
  border:1px solid var(--line);
  color:var(--muted);
  cursor:pointer;
  flex-shrink:0;
  transition:background .18s, color .18s, border-color .18s, transform .1s;
}
.queue-badge:active{ transform:scale(.94); }
.queue-badge svg{ width:18px; height:18px; }

.queue-badge[data-state="synced"]{ background:rgba(16,185,129,.10); border-color:rgba(16,185,129,.30); color:#047857; }
.queue-badge[data-state="synced"]:hover{ background:rgba(16,185,129,.18); }
.queue-badge[data-state="pending"]{ background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.42); color:#b45309; }
.queue-badge[data-state="pending"]:hover{ background:rgba(245,158,11,.22); }
.queue-badge[data-state="syncing"]{ background:rgba(79,70,229,.12); border-color:rgba(79,70,229,.38); color:#4f46e5; }
.queue-badge[data-state="syncing"] svg{ animation:queueSpin 1.6s linear infinite; }
@keyframes queueSpin{ from{ transform:rotate(0); } to{ transform:rotate(360deg); } }
.queue-badge[data-state="offline"]{ background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.38); color:#b91c1c; }

.queue-badge-count{
  position:absolute; top:-4px; right:-4px;
  min-width:18px; height:18px; padding:0 5px;
  border-radius:999px;
  background:var(--muted); color:#fff;
  font-size:10px; font-weight:800;
  line-height:18px; text-align:center;
  box-shadow:0 2px 6px rgba(15,23,42,.20);
  animation:queuePop .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events:none;
  transition:background .18s, box-shadow .18s;
}
.queue-badge[data-state="synced"]  .queue-badge-count{ background:#10b981; box-shadow:0 2px 6px rgba(16,185,129,.4); }
.queue-badge[data-state="pending"] .queue-badge-count{ background:#f59e0b; box-shadow:0 2px 6px rgba(245,158,11,.4); }
.queue-badge[data-state="syncing"] .queue-badge-count{ background:#4f46e5; box-shadow:0 2px 6px rgba(79,70,229,.4); }
.queue-badge[data-state="offline"] .queue-badge-count{ background:#ef4444; box-shadow:0 2px 6px rgba(239,68,68,.4); }
.queue-badge.is-large .queue-badge-count{ background:#ef4444 !important; box-shadow:0 2px 8px rgba(239,68,68,.55) !important; }
@keyframes queuePop{ 0%{ transform:scale(0); } 60%{ transform:scale(1.15); } 100%{ transform:scale(1); } }

/* ===================== Home content ===================== */
.home-greeting{ text-align:center; margin-bottom:28px; }
.home-greeting h1{ margin:0; font-size:clamp(22px, 4vw, 34px); font-weight:800; letter-spacing:-.03em; }
.home-greeting p{ margin:6px 0 0; font-size:13px; color:var(--muted); }
.home-shift-line{ font-size:12px; color:var(--muted); margin-top:8px; font-weight:600; }
.home-shift-line b{ color:var(--success); font-weight:800; }

.tile-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:12px; flex:1; align-content:start; }
@media (min-width:640px){ .tile-grid{ grid-template-columns:repeat(3, 1fr); gap:14px; } }
@media (min-width:900px){ .tile-grid{ grid-template-columns:repeat(4, 1fr); gap:16px; } }

.tile{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:24px 16px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; min-height:150px; cursor:pointer; color:inherit;
  transition:transform .12s, border-color .15s, box-shadow .15s;
  box-shadow:var(--shadow-sm);
}
.tile:hover{ border-color:#d5dbe8; box-shadow:var(--shadow); }
.tile:active{ transform:scale(.97); }
.tile-icon{ width:60px; height:60px; border-radius:18px; display:grid; place-items:center; flex-shrink:0; }
.tile-icon svg{ width:32px; height:32px; }
.tile-icon--accent{ background:var(--accent-soft); color:var(--accent); }
.tile-icon--orange{ background:#fef3e2; color:#f97316; }
.tile-icon--red{    background:#fee2e2; color:#ef4444; }
.tile-icon--purple{ background:#f3e8ff; color:#9333ea; }
.tile-icon--green{  background:#e3f7ed; color:#10b981; }
.tile-icon--blue{   background:#e0eefe; color:#3b82f6; }
.tile-icon--teal{   background:#ccfbf1; color:#14b8a6; }
.tile-icon--pink{   background:#fce7f3; color:#ec4899; }
.tile-icon--gray{   background:#f1f5f9; color:#64748b; }
.tile-label{ font-size:13.5px; font-weight:700; letter-spacing:-.01em; text-align:center; }
.tile-sub{ font-size:11.5px; color:var(--muted); margin-top:-6px; text-align:center; }

.home-footer{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-top:28px;
  padding-top:20px; border-top:1px solid var(--line);
  flex-wrap:wrap;
}
.home-footer-user{
  display:flex; align-items:center; gap:12px;
  padding:8px 12px; border-radius:var(--r-md);
  text-align:left; color:inherit;
  transition:background .15s;
}
.home-footer-user:hover{ background:var(--surface-2); }
.avatar{
  width:42px; height:42px; border-radius:50%;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff; display:grid; place-items:center;
  font-weight:800; font-size:16px; flex-shrink:0;
}
.home-footer-text{ display:flex; flex-direction:column; min-width:0; }
.home-footer-text b{ font-size:13.5px; font-weight:700; letter-spacing:-.01em; }
.home-footer-text span{
  font-size:11px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em;
}
.home-footer-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.home-footer-btn{
  display:flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:var(--r-md);
  font-size:13px; font-weight:700; color:var(--muted);
  border:1.5px solid var(--line);
  transition:background .15s, color .15s, border-color .15s;
}
.home-footer-btn:hover{ color:var(--danger); border-color:rgba(239,68,68,.3); background:rgba(239,68,68,.04); }
.home-footer-btn--shift{ border-color:rgba(16,185,129,.4); color:#047857; background:rgba(16,185,129,.06); }
.home-footer-btn--shift:hover{ background:rgba(16,185,129,.12); color:#065f46; border-color:rgba(16,185,129,.55); }

/* ===================== Page header ===================== */
.page-bar{
  display:flex; align-items:center; gap:12px;
  padding:calc(10px + var(--safe-top)) 14px 10px;
  background:var(--surface); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:20;
}
.page-back{ color:var(--text); }
.page-title{ margin:0; font-size:17px; font-weight:800; letter-spacing:-.01em; flex:1; }
.page-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.page-actions .icon-btn{ background:var(--surface-2); border:1px solid var(--line); }
.page-actions .icon-btn:hover{ background:var(--accent-soft); color:var(--accent); border-color:rgba(79,70,229,.25); }
.page-actions .icon-btn:disabled{ opacity:.4; cursor:not-allowed; }
.sell-charge-quick{ display:inline-flex; align-items:center; gap:6px; }
.sell-charge-quick:disabled{ opacity:.45; cursor:not-allowed; }
@media (max-width: 640px){ .sell-charge-quick{ display:none; } }
.page-body{ padding:16px 16px calc(24px + var(--safe-bot)); max-width:1000px; margin:0 auto; }

/* ===================== SELL ===================== */
.pos-layout{ display:grid; grid-template-columns:1fr; min-height:calc(100dvh - 62px); }
.products-pane{ display:flex; flex-direction:column; padding:14px 16px 96px; min-width:0; }
.search-bar{ position:relative; margin-bottom:12px; }
.search-bar .search-icon{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.search-bar input{
  width:100%; height:50px; padding:0 44px;
  border-radius:var(--r-md); border:1.5px solid var(--line);
  background:var(--surface); font-size:15px; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.search-bar input:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.search-clear{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  width:30px; height:30px; border-radius:8px;
  display:grid; place-items:center; color:var(--muted);
}
.search-clear:hover{ background:var(--surface-2); color:var(--text); }
.chips{ display:flex; gap:8px; overflow-x:auto; padding-bottom:12px; margin:0 -4px; scrollbar-width:none; }
.chips::-webkit-scrollbar{ display:none; }
.chip{
  padding:8px 14px; border-radius:999px;
  border:1.5px solid var(--line); background:var(--surface);
  font-size:13px; font-weight:600; color:var(--muted);
  white-space:nowrap; transition:all .15s;
}
.chip.active{ background:var(--text); border-color:var(--text); color:#fff; }
.product-list{ display:grid; grid-template-columns:repeat(2, 1fr); gap:10px; }
@media (min-width: 640px){ .product-list{ grid-template-columns:repeat(3, 1fr); } }
.product{
  position:relative;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:12px;
  display:flex; flex-direction:column; gap:8px;
  text-align:left; color:inherit; cursor:pointer;
  min-height:96px;
  transition:transform .06s, border-color .15s, box-shadow .15s;
}
.product:active{ transform:scale(.97); }
.product:hover{ border-color:#d5dbe8; box-shadow:var(--shadow-sm); }
.product-name{
  font-size:13.5px; font-weight:700; line-height:1.25; letter-spacing:-.01em;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.product-meta{ display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:auto; }
.product-price{ font-size:15px; font-weight:800; color:var(--accent); font-variant-numeric:tabular-nums; }
.product-stock{ font-size:11.5px; font-weight:700; color:var(--muted); }
.product-stock.low{ color:var(--warning); }
.product-stock.out{ color:var(--danger); }
.product-badge{
  position:absolute; top:8px; right:8px;
  font-size:10px; font-weight:800;
  padding:3px 7px; border-radius:6px;
  background:rgba(245,158,11,.15); color:var(--warning);
  letter-spacing:.04em;
}
.empty{ padding:60px 20px; text-align:center; color:var(--muted); font-size:13.5px; }
.empty-icon{ font-size:42px; margin-bottom:8px; opacity:.5; }
.cart-empty .empty-icon svg{ color:currentColor; opacity:.45; }

/* Cart */
.cart-pane{
  position:fixed; left:0; right:0; bottom:0;
  background:var(--surface);
  border-top-left-radius:22px; border-top-right-radius:22px;
  box-shadow:0 -20px 40px rgba(15,23,42,.18);
  display:flex; flex-direction:column;
  max-height:85dvh; z-index:25;
  transform:translateY(100%);
  transition:transform .28s var(--ease);
}
.cart-pane.open{ transform:translateY(0); }
.cart-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:16px 18px 12px;
  border-bottom:1px solid var(--line);
}
.cart-head h2{ margin:0; font-size:15px; font-weight:800; letter-spacing:-.01em; }
.cart-head p{ margin:3px 0 0; font-size:12px; color:var(--muted); font-weight:500; }
.cart-head b{ color:var(--text); font-weight:800; }
.cart-items{ flex:1; overflow-y:auto; padding:6px 10px; display:flex; flex-direction:column; }
.cart-empty{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; padding:40px 20px; text-align:center; color:var(--muted);
}
.cart-empty .empty-icon{ font-size:42px; opacity:.4; margin-bottom:4px; }
.cart-empty p{ margin:0; font-size:14.5px; font-weight:700; color:var(--text); }
.cart-empty span{ font-size:12.5px; }
.cart-line{ padding:12px; border-bottom:1px solid var(--line); border-radius:10px; transition:background .15s; }
.cart-line:last-child{ border-bottom:0; }
.cart-line:hover{ background:var(--surface-2); }
.cart-line-top{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.cart-line-name{
  font-size:13.5px; font-weight:700; letter-spacing:-.01em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cart-line-total{ font-size:13.5px; font-weight:800; font-variant-numeric:tabular-nums; flex-shrink:0; }
.cart-line-sub{ display:flex; gap:6px; margin-top:3px; font-size:11.5px; color:var(--muted); font-variant-numeric:tabular-nums; }
.cart-line-sub .dot{ opacity:.5; }
.cart-line-bottom{ display:flex; align-items:center; justify-content:space-between; margin-top:10px; }
.qty-controls{ display:flex; align-items:center; gap:2px; background:var(--surface-2); border-radius:10px; padding:3px; }
.qty-btn{
  width:28px; height:28px; border-radius:8px;
  display:grid; place-items:center; color:var(--muted);
  font-weight:800; font-size:15px; line-height:1;
}
.qty-btn:hover{ background:var(--surface-2); color:var(--text); }
.qty-num{
  min-width:42px; padding:0 6px;
  font-size:13px; font-weight:800;
  font-variant-numeric:tabular-nums; color:var(--text);
  border-radius:8px;
}
.qty-num:hover{ background:#fff; color:var(--accent); }
.cart-line-remove{
  width:28px; height:28px; border-radius:9px;
  display:grid; place-items:center; color:#b6bdcc;
}
.cart-line-remove:hover{ background:#fee2e2; color:var(--danger); }
.cart-foot{
  border-top:1px solid var(--line);
  padding:12px 18px calc(14px + var(--safe-bot));
  background:linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
}
.totals{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.row{ display:flex; justify-content:space-between; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums; }
.row span:last-child{ color:var(--text); font-weight:700; }
.row--big{ padding:10px 0 0; font-size:14px; }
.row--big strong{ font-size:18px; font-weight:800; color:var(--success); }
.row.total{ margin-top:8px; padding-top:12px; border-top:1px dashed var(--line); font-size:18px; font-weight:800; }
.row.total span:last-child{ font-size:20px; font-weight:800; }
.cart-fab{
  position:fixed; bottom:calc(12px + var(--safe-bot)); left:12px; right:12px;
  height:56px; border-radius:999px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff; font-size:15px; font-weight:800;
  display:grid; grid-template-columns:auto 1fr auto;
  align-items:center; gap:12px; padding:0 20px;
  box-shadow:0 12px 26px rgba(79,70,229,.32);
  z-index:22;
}
.cart-fab-count{
  background:rgba(255,255,255,.22);
  min-width:24px; height:24px; padding:0 8px;
  border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
  font-size:12px;
}
.cart-fab-label{ text-align:left; }
.cart-fab-total{ font-variant-numeric:tabular-nums; }

@media (min-width:900px){
  .pos-layout{ grid-template-columns:minmax(0, 1fr) var(--cart-w); min-height:calc(100dvh - 62px); }
  .products-pane{ padding:20px 22px 22px; }
  .cart-pane{
    position:sticky; top:62px; left:auto; right:auto; bottom:auto;
    transform:none; max-height:calc(100dvh - 62px); height:calc(100dvh - 62px);
    border-radius:0; border-left:1px solid var(--line); border-top:0; box-shadow:none;
  }
  .cart-fab{ display:none !important; }
}

/* ===================== Sales ===================== */
.sales-chips{ padding-bottom:12px; }

.custom-range{
  display:flex; gap:8px; align-items:flex-end;
  margin-bottom:14px; flex-wrap:wrap;
}
.field--compact{ flex:1; min-width:130px; gap:4px; }
.field--compact > span{ font-size:10.5px; }
.field--compact input{
  height:44px; padding:0 12px; font-size:14px;
  border-radius:var(--r-md);
  border:1.5px solid var(--line);
  background:var(--surface); color:var(--text);
  outline:none; width:100%;
}
.field--compact input:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.custom-range .btn{ height:44px; white-space:nowrap; }

.sales-summary{
  display:grid; grid-template-columns:repeat(2, 1fr); gap:8px;
  margin-bottom:14px;
}
.sales-summary-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:12px 14px;
}
.sales-summary-card--highlight{
  grid-column:1 / -1;
  background:linear-gradient(135deg, var(--accent-soft), rgba(124,58,237,.06));
  border-color:rgba(79,70,229,.3);
}
.sales-summary-label{
  font-size:10.5px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:700;
}
.sales-summary-value{
  font-size:18px; font-weight:800; margin-top:3px;
  color:var(--text); font-variant-numeric:tabular-nums;
}
.sales-summary-card--highlight .sales-summary-value{ font-size:26px; color:var(--accent); }
.sales-summary-sub{ font-size:11.5px; color:var(--muted); margin-top:2px; }
@media (min-width: 640px){ .sales-summary{ grid-template-columns:repeat(4, 1fr); } }

.sales-list{ display:flex; flex-direction:column; gap:8px; }
.sale-row{
  display:grid; grid-template-columns:minmax(0,1fr) auto;
  gap:4px 12px; padding:14px 16px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); text-align:left; color:inherit;
  transition:transform .06s, border-color .15s;
}
.sale-row:hover{ border-color:#cfd6e4; }
.sale-row:active{ transform:scale(.995); }
.sale-row--refunded{ opacity:.6; }
.sale-row--refund{ background:rgba(239,68,68,.05); border-color:rgba(239,68,68,.3); }
.sale-receipt{ font-weight:800; font-size:13.5px; }
.sale-meta{ font-size:11.5px; color:var(--muted); margin-top:3px; }
.sale-total{ font-weight:800; font-size:15px; text-align:right; color:var(--accent); font-variant-numeric:tabular-nums; }
.sale-total--refund{ color:var(--danger); }
.sale-badge{
  display:inline-block; font-size:9.5px; font-weight:800;
  padding:2px 6px; border-radius:4px;
  text-transform:uppercase; letter-spacing:.06em;
  margin-left:6px;
}
.sale-badge--refunded{ background:var(--surface-2); color:var(--muted); }
.sale-badge--refund{ background:rgba(239,68,68,.15); color:var(--danger); }

/* ===================== Admin ===================== */
.subtabs{
  display:flex; gap:6px; background:var(--surface);
  border:1px solid var(--line); border-radius:999px;
  padding:3px; margin-bottom:16px;
  overflow-x:auto; scrollbar-width:none;
  width:fit-content; max-width:100%;
}
.subtabs::-webkit-scrollbar{ display:none; }
.subtab{
  padding:8px 16px; border-radius:999px;
  font-size:12.5px; font-weight:700; color:var(--muted); white-space:nowrap;
}
.subtab.active{ background:var(--text); color:#fff; }
.panel-toolbar{ display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.panel-toolbar--mt{ margin-top:16px; }
.panel-input{
  flex:1; height:46px; padding:0 14px;
  border-radius:var(--r-md); border:1.5px solid var(--line);
  background:var(--surface); font-size:14px; outline:none;
}
.panel-input:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.panel-hint{
  font-size:12.5px; color:var(--muted);
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:10px 14px; margin-bottom:12px; line-height:1.5;
}
.panel-hint b{ color:var(--text); }
.panel-section-title{
  margin:22px 0 10px; font-size:12px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:800;
}
.admin-product-list{ display:flex; flex-direction:column; gap:6px; }
.admin-product-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:12px 14px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); text-align:left; color:inherit; width:100%; cursor:pointer;
  transition:transform .06s, border-color .15s, background .15s;
}
.admin-product-row:hover{ border-color:#cfd6e4; }
.admin-product-row:active{ transform:scale(.995); }
.admin-product-row--inactive{ opacity:.55; }
.admin-product-row-main{ min-width:0; flex:1; }
.admin-product-name{ font-size:13.5px; font-weight:700; }
.admin-product-meta{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.admin-product-right{ text-align:right; flex-shrink:0; }
.admin-product-price{ font-size:13.5px; font-weight:800; color:var(--accent); }
.admin-product-stock{ font-size:11.5px; color:var(--muted); margin-top:2px; font-weight:700; }
.admin-product-stock.low{ color:var(--warning); }
.admin-product-stock.out{ color:var(--danger); }
.stock-pill{
  padding:4px 10px; border-radius:8px;
  font-size:11.5px; font-weight:800;
  background:var(--accent-soft); color:var(--accent);
}
.user-role-pill{
  display:inline-block; padding:3px 9px; border-radius:6px;
  font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em;
}
.user-role-pill--admin{ background:rgba(79,70,229,.15); color:var(--accent); }
.user-role-pill--accountant{ background:rgba(20,184,166,.15); color:#0d9488; }
.user-role-pill--cashier{ background:var(--surface-2); color:var(--muted); }
.shift-open-pill{
  display:inline-block; padding:3px 9px; border-radius:6px;
  font-size:10.5px; font-weight:800; letter-spacing:.05em;
  background:rgba(16,185,129,.15); color:#047857;
  text-transform:uppercase;
}
.shift-closed-pill{
  display:inline-block; padding:3px 9px; border-radius:6px;
  font-size:10.5px; font-weight:800; letter-spacing:.05em;
  background:var(--surface-2); color:var(--muted);
  text-transform:uppercase;
}
.stock-history{ display:flex; flex-direction:column; gap:6px; }
.stock-history-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:10px 14px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); font-size:13px;
}
.stock-history-name{ font-weight:700; }
.stock-history-meta{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.stock-history-delta{ font-weight:800; font-variant-numeric:tabular-nums; }
.stock-history-delta.plus{ color:var(--success); }
.stock-history-delta.minus{ color:var(--danger); }

/* ===================== Reports ===================== */
.report-cards{ display:grid; grid-template-columns:repeat(2, 1fr); gap:10px; }
@media (min-width:640px){ .report-cards{ grid-template-columns:repeat(3, 1fr); } }
.report-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:14px;
}
.report-card--highlight{
  grid-column:1 / -1;
  background:linear-gradient(135deg, var(--accent-soft), rgba(124,58,237,.06));
  border-color:rgba(79,70,229,.3);
}
.report-card-label{
  font-size:10.5px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:700;
}
.report-card-value{
  font-size:20px; font-weight:800; color:var(--text); margin-top:4px;
  font-variant-numeric:tabular-nums;
}
.report-card--highlight .report-card-value{ font-size:28px; color:var(--accent); }
.report-card-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.report-table{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; }
.report-tbl{ width:100%; border-collapse:collapse; font-size:13px; }
.report-tbl th, .report-tbl td{ padding:10px 12px; text-align:left; border-bottom:1px solid var(--line); }
.report-tbl tr:last-child td{ border-bottom:0; }
.report-tbl th{
  background:var(--surface-2); font-size:10.5px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:700;
}
.report-tbl .num{ text-align:right; font-variant-numeric:tabular-nums; }
.report-tbl .muted{ color:var(--muted); }
.report-tbl .small{ font-size:11px; }

/* ===================== Settings ===================== */
.settings-form{
  display:flex; flex-direction:column; gap:14px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
}
.settings-section{
  margin:8px 0 0; font-size:12px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:800;
}
.settings-section:first-child{ margin-top:0; }
.backup-grid{ display:grid; grid-template-columns:1fr; gap:10px; }
@media (min-width:640px){ .backup-grid{ grid-template-columns:repeat(3, 1fr); } }
.backup-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:18px;
  display:flex; flex-direction:column; gap:8px;
}
.backup-card h3{ margin:0; font-size:14.5px; font-weight:800; }
.backup-card p{ margin:0 0 6px; font-size:12.5px; color:var(--muted); line-height:1.5; }
.backup-card button{ align-self:flex-start; }

/* ===================== Modals ===================== */
.modal{ border:0; background:transparent; padding:0; max-width:100vw; max-height:100dvh; }
.modal::backdrop{ background:rgba(15,23,42,.45); backdrop-filter:blur(4px); }
.modal-card{
  width:min(430px, calc(100vw - 24px));
  background:var(--surface); border-radius:20px;
  padding:22px; color:var(--text);
  display:flex; flex-direction:column; gap:14px;
  margin:auto; max-height:calc(100dvh - 40px); overflow-y:auto;
}
.modal-card--wide{ width:min(520px, calc(100vw - 24px)); }
.modal-title{ margin:0; font-size:17px; font-weight:800; letter-spacing:-.01em; }
.modal-sub{ margin:3px 0 0; font-size:12.5px; color:var(--muted); }
.modal-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.amount-due{ background:var(--surface-2); border-radius:var(--r-lg); padding:16px 20px; text-align:center; }
.amount-due span{ display:block; font-size:12px; color:var(--muted); font-weight:600; }
.amount-due strong{ font-size:30px; font-weight:800; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.pay-methods{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.pm{
  min-height:52px; padding:0 8px;
  border-radius:var(--r-md); border:1.5px solid var(--line);
  background:var(--surface); font-size:12.5px; font-weight:700; color:var(--muted);
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  transition:all .15s;
}
.pm svg{ width:16px; height:16px; flex-shrink:0; }
.pm.active{
  border-color:var(--accent); background:var(--accent-soft); color:var(--accent);
  box-shadow:0 0 0 3px rgba(79,70,229,.10);
}
.quick-cash{ display:flex; gap:6px; flex-wrap:wrap; }
.qty-display{
  display:flex; align-items:center; gap:12px;
  background:var(--surface-2); border-radius:var(--r-md);
  padding:8px 16px; border:1.5px solid transparent;
}
.qty-display:focus-within{ border-color:var(--accent); background:#fff; box-shadow:0 0 0 4px var(--accent-soft); }
.qty-display > span{ font-size:11.5px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.07em; }
.qty-input{
  flex:1; min-width:0; border:0; background:transparent; outline:none;
  text-align:right; padding:0;
  font-size:26px; font-weight:800; letter-spacing:-.03em;
  font-variant-numeric:tabular-nums; color:var(--text);
}
.kp-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:7px; }
.kp-key{
  height:46px; border-radius:12px;
  background:var(--surface-2);
  font-size:19px; font-weight:700;
  display:grid; place-items:center;
  font-variant-numeric:tabular-nums;
}
.kp-key:hover{ background:#eceff6; }
.kp-key:active{ transform:scale(.94); }
.kp-key.util{ font-size:15px; color:var(--muted); }
.kp-key[data-k="C"]:hover{ background:#fee2e2; color:var(--danger); }
.modal-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:4px; flex-wrap:wrap; }
.modal-actions--split{ justify-content:space-between; align-items:center; width:100%; }
.modal-actions--split .modal-actions{ margin-top:0; }

/* ===================== Checkout: split payments ===================== */
.checkout-summary{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.checkout-summary-item{
  background:var(--surface-2); border-radius:var(--r-md); padding:12px 14px;
  display:flex; flex-direction:column; gap:4px;
}
.checkout-summary-item span{
  font-size:11px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.06em; font-weight:700;
}
.checkout-summary-item strong{
  font-size:22px; font-weight:800; letter-spacing:-.02em;
  font-variant-numeric:tabular-nums; color:var(--text);
}
.checkout-summary-item--remaining.is-paid strong{ color:var(--success); }
.checkout-summary-item--remaining.is-paid{ background:rgba(16,185,129,.08); }
.payment-list{ display:flex; flex-direction:column; gap:12px; }
.payment-row{
  border:1.5px solid var(--line); border-radius:var(--r-md);
  padding:12px 14px; background:var(--surface);
  display:flex; flex-direction:column; gap:10px;
}
.payment-row-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.payment-row-label{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; font-weight:800; }
.payment-remove{
  width:28px; height:28px; border-radius:8px;
  display:grid; place-items:center; color:var(--muted);
}
.payment-remove:hover{ background:#fee2e2; color:var(--danger); }
.payment-row-methods{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
.payment-row-methods .pm{ min-height:44px; font-size:12px; padding:0 6px; }
.payment-row-amount{ display:flex; gap:8px; align-items:stretch; }
.payment-row-amount .pm-amount{
  flex:1; height:48px; padding:0 14px;
  border-radius:var(--r-md);
  border:1.5px solid var(--line);
  background:var(--surface);
  font-size:18px; font-weight:700;
  font-variant-numeric:tabular-nums;
  outline:none;
}
.payment-row-amount .pm-amount:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.payment-row-amount .pm-fill-remaining{ min-height:48px; padding:0 14px; font-size:13px; white-space:nowrap; }
.pm-ref{
  width:100%; height:42px; padding:0 12px;
  border-radius:var(--r-md);
  border:1.5px solid var(--line);
  background:var(--surface);
  font-size:14px; outline:none;
}
.pm-ref:focus{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }

/* ===================== Receipt ===================== */
.receipt-card{ width:min(380px, calc(100vw - 24px)); }
.receipt-body{
  background:#f8fafc; color:#0f172a;
  border-radius:var(--r-md); padding:18px 16px;
  font-family:ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size:12px; line-height:1.5; user-select:text;
}
.receipt-body h3{ margin:0 0 4px; font-size:15px; text-align:center; letter-spacing:.04em; }
.receipt-body h3.refund-header{ color:#b91c1c; }
.receipt-body .muted{ color:#64748b; }
.receipt-body .center{ text-align:center; }
.receipt-body .rule{ border-top:1px dashed #94a3b8; margin:8px 0; }
.receipt-body .r-row{ display:flex; justify-content:space-between; gap:8px; }
.receipt-body .r-total{ font-weight:700; font-size:14px; }
.receipt-body .r-total.negative{ color:#b91c1c; }

/* ===================== Time clock modal ===================== */
.tc-status-block{
  background:var(--surface-2); border-radius:var(--r-md);
  padding:14px 16px; font-size:13.5px; color:var(--muted); line-height:1.5;
}
.tc-status-block b{ color:var(--text); font-weight:800; }
.tc-status-block .tc-on{ color:var(--success); font-weight:800; }
.tc-status-block .tc-off{ color:var(--muted); font-weight:800; }
.tc-row{
  display:grid; grid-template-columns:1fr auto; gap:4px 12px;
  padding:12px 14px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md);
}
.tc-name{ font-weight:700; font-size:13.5px; }
.tc-meta{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.tc-hours{ font-weight:800; font-size:14px; text-align:right; font-variant-numeric:tabular-nums; color:var(--accent); }
.tc-status{
  display:inline-block; padding:2px 8px; border-radius:6px;
  font-size:10.5px; font-weight:800; letter-spacing:.04em;
  text-transform:uppercase;
}
.tc-status--open{ background:rgba(16,185,129,.15); color:var(--success); }
.tc-status--closed{ background:var(--surface-2); color:var(--muted); }
.tc-modal-body{ display:flex; flex-direction:column; gap:12px; }

/* ===================== Lock screen ===================== */
.lock-screen{
  min-height:100dvh;
  display:flex; align-items:center; justify-content:center;
  padding:24px 16px calc(24px + var(--safe-bot));
  background:linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.lock-card{
  width:100%; max-width:400px;
  background:var(--surface); border-radius:var(--r-lg);
  padding:32px 26px; box-shadow:0 24px 60px rgba(0,0,0,.3);
  text-align:center;
  display:flex; flex-direction:column; gap:16px;
}
.lock-icon{
  width:72px; height:72px; border-radius:22px;
  background:rgba(79,70,229,.1); color:var(--accent);
  display:grid; place-items:center; margin:0 auto;
}
.lock-icon svg{ width:36px; height:36px; }
.lock-title{ margin:0; font-size:22px; font-weight:800; letter-spacing:-.02em; }
.lock-sub{ margin:-8px 0 8px; color:var(--muted); font-size:13.5px; }
.lock-user{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; background:var(--surface-2);
  border-radius:var(--r-md); text-align:left;
}
.lock-user-info{ min-width:0; flex:1; }
.lock-user-name{ font-size:14px; font-weight:800; letter-spacing:-.01em; }
.lock-user-role{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-top:2px; }
.lock-card .link-btn{ background:transparent; border:0; color:var(--muted); font-size:13px; cursor:pointer; padding:6px; }
.lock-card .link-btn:hover{ color:var(--danger); }
.lock-form{ display:flex; flex-direction:column; gap:12px; text-align:left; }

/* ===================== Shortcuts modal ===================== */
.shortcuts-group + .shortcuts-group{ margin-top:14px; }
.shortcuts-group h3{
  margin:0 0 6px;
  font-size:11px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--muted); font-weight:800;
}
.shortcuts-tbl{ width:100%; border-collapse:collapse; font-size:13px; }
.shortcuts-tbl td{ padding:6px 4px; border-bottom:1px solid var(--line); vertical-align:middle; }
.shortcuts-tbl tr:last-child td{ border-bottom:0; }
.shortcuts-tbl td:first-child{ width:170px; white-space:nowrap; }
kbd{
  display:inline-block; padding:2px 6px; border-radius:5px;
  background:var(--surface-2); border:1px solid var(--line); border-bottom-width:2px;
  font-family:ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size:11px; font-weight:700; color:var(--text); margin:0 1px;
}

/* ===================== Printer ===================== */
.mode-switch{ display:flex; gap:8px; margin-top:6px; }
.printer-list{ max-height:250px; overflow-y:auto; display:flex; flex-direction:column; gap:6px; margin:8px 0; }
.printer-item{
  display:flex; flex-direction:column; align-items:flex-start;
  padding:10px 12px; background:var(--surface-2);
  border:1.5px solid transparent; border-radius:10px;
  text-align:left; color:var(--text);
}
.printer-item.selected{ border-color:var(--accent); background:var(--accent-soft); }
.printer-name{ font-weight:700; font-size:13.5px; }
.printer-addr{ font-size:11px; color:var(--muted); margin-top:2px; }
.printer-status{ font-size:12.5px; color:var(--muted); padding:8px; text-align:center; }
.loading, .empty, .error{ padding:18px; text-align:center; color:var(--muted); font-size:13px; }
.error{ color:var(--danger); }

/* ===================== Alerts ===================== */
.login-error{
  background:rgba(239,68,68,.08); color:var(--danger);
  border:1px solid rgba(239,68,68,.3);
  padding:10px 12px; border-radius:10px; font-size:12.5px;
}
.lock-badge{
  font-size:10px; background:rgba(245,158,11,.15); color:var(--warning);
  padding:2px 6px; border-radius:4px; text-transform:none; letter-spacing:0; margin-left:4px;
}
/* ===================== Danger zone ===================== */
.danger-zone{
  margin-top:20px;
  padding:18px 20px;
  border:1.5px solid rgba(239,68,68,.35);
  border-radius:var(--r-lg);
  background:rgba(239,68,68,.04);
}
.settings-section--danger{
  color:#b91c1c;
  margin:0 0 8px;
}
.panel-hint--danger{
  border-color:rgba(239,68,68,.25);
  background:#fff;
  margin-bottom:12px;
}
.panel-hint--danger b{ color:#b91c1c; }
/* =====================================================================
   Keyboard shortcuts — drawer docked to the right side
   ===================================================================== */
dialog#shortcuts-modal {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  bottom: auto;
  margin: 0;
  padding: 0;
  border: 0;
  width: min(420px, 100vw);
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  background: var(--surface);
  overflow: hidden;
  box-shadow: -20px 0 48px rgba(15, 23, 42, .18);
  z-index: 1000;
}

dialog#shortcuts-modal:not([open]) {
  display: none;
}

dialog#shortcuts-modal::backdrop {
  background: rgba(15, 23, 42, .40);
  backdrop-filter: blur(2px);
}

dialog#shortcuts-modal .modal-card {
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  animation: shortcutsSlide .28s cubic-bezier(.4, 0, .2, 1);
  box-shadow: none;
}

@keyframes shortcutsSlide {
  from { transform: translateX(64px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* On narrow phones, the drawer fills the entire screen */
@media (max-width: 480px) {
  dialog#shortcuts-modal {
    width: 100vw;
    box-shadow: none;
  }
}

/* =====================================================================
   Home footer — sticky at the bottom
   ===================================================================== */
.home-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--bg);
  margin-top: auto;

  /* Break out of the parent's horizontal padding so the footer is full-width */
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: calc(-24px - var(--safe-bot));

  padding: 16px 20px calc(16px + var(--safe-bot));
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 20px -12px rgba(15, 23, 42, .12);
}

@media (min-width: 720px) {
  .home-footer {
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
}