/* =====================================================================
   SHOP POS — modern UI. Light + dark, Inter, soft cards, 12px radii.
   ===================================================================== */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8fafc; --border: #e5e8ef; --border-2: #d7dce6;
  --text: #0f172a; --muted: #64748b; --muted-2: #94a3b8;
  --primary: #4f46e5; --primary-600: #4338ca; --primary-50: #eef2ff; --primary-100: #e0e7ff;
  --green: #16a34a; --green-50: #ecfdf5; --red: #dc2626; --red-50: #fef2f2; --amber: #d97706; --amber-50: #fffbeb; --blue: #2563eb; --blue-50: #eff6ff;
  --sidebar: #0f172a; --sidebar-text: #cbd5e1; --sidebar-active: rgba(99,102,241,.18);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05); --shadow-lg: 0 20px 50px rgba(15,23,42,.18);
  --r: 12px; --r-sm: 8px; --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sb-w: 264px; --tb-h: 60px;
}
[data-theme="dark"] {
  --bg: #0b1020; --surface: #121a2e; --surface-2: #0f1628; --border: #1f2a44; --border-2: #2b3756;
  --text: #e5e9f2; --muted: #93a0b8; --muted-2: #66728c;
  --primary: #6366f1; --primary-600: #818cf8; --primary-50: #1b1f45; --primary-100: #23296a;
  --green-50: #0f2a1d; --red-50: #2d1416; --amber-50: #2b2110; --blue-50: #0f1f3a;
  --sidebar: #090d1a; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 15px; } h3 { font-size: 14px; }
p { margin: 0 0 10px; } small, .muted { color: var(--muted); } .muted-2 { color: var(--muted-2); }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; } .money.neg { color: var(--red); }
.text-right { text-align: right; } .text-center { text-align: center; } .nowrap { white-space: nowrap; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-primary { color: var(--primary); }
.flex { display: flex; gap: 10px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; } .gap-sm { gap: 6px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-sm { margin-top: 8px; } .mb-sm { margin-bottom: 8px; } .ml-auto { margin-left: auto; }
.hide-sm { display: inline; } [hidden] { display: none !important; }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sb-w); background: var(--sidebar); color: var(--sidebar-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: #fff; font-weight: 600; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand:hover { text-decoration: none; } .brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: grid; place-items: center; font-weight: 700; flex: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; padding: 10px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; color: var(--sidebar-text); background: none; border: 0; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .8; } .nav-item span { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; } .nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-toggle .chev { width: 14px; height: 14px; opacity: .5; transition: transform .15s; } .nav-group.open .nav-toggle .chev { transform: rotate(90deg); }
.nav-group.open .nav-toggle { color: #fff; }
.nav-sub { display: none; padding: 2px 0 6px 20px; } .nav-group.open .nav-sub { display: block; }
.nav-sub a { display: block; padding: 6px 10px 6px 18px; border-left: 1px solid rgba(255,255,255,.12); color: #94a3b8; font-size: 13px; border-radius: 0 8px 8px 0; }
.nav-sub a:hover { color: #fff; text-decoration: none; } .nav-sub a.active { color: #fff; border-left-color: #818cf8; background: rgba(129,140,248,.1); }
.nav-badge { background: var(--red); color: #fff; font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.sidebar-foot { padding: 12px 18px; font-size: 11px; color: #475569; border-top: 1px solid rgba(255,255,255,.06); }
.main { flex: 1; margin-left: var(--sb-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--tb-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.topbar-title { font-weight: 600; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: none; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); place-items: center; cursor: pointer; } .icon-btn svg { width: 18px; height: 18px; }
.tb-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; position: relative; }
.tb-btn svg { width: 17px; height: 17px; } .tb-btn:hover { background: var(--surface-2); text-decoration: none; }
.tb-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; } .tb-btn.primary:hover { background: var(--primary-600); }
.dot-live { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--surface); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-100); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.content { padding: 22px 24px 60px; max-width: 1600px; width: 100%; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title p { color: var(--muted); margin: 4px 0 0; } .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* dropdowns */
.dropdown { position: relative; } .dropdown-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.dropdown-menu.right { left: auto; right: 0; } .dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--text); font: inherit; font-size: 13px; background: none; border: 0; text-align: left; cursor: pointer; white-space: nowrap; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; } .dropdown-menu hr { margin: 5px 0; } .dropdown-menu .ico { width: 15px; height: 15px; color: var(--muted); }
.dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 5px; display: flex; flex-direction: column; } .dd-head small { color: var(--muted); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; } .card-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; } .card-body.p0 { padding: 0; } .card.flat { box-shadow: none; }
.grid { display: grid; gap: 14px; } .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-6 { grid-template-columns: repeat(6, 1fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; } .stat-ico svg { width: 20px; height: 20px; }
.stat-ico.indigo { background: var(--primary-50); color: var(--primary); } .stat-ico.green { background: var(--green-50); color: var(--green); } .stat-ico.red { background: var(--red-50); color: var(--red); } .stat-ico.amber { background: var(--amber-50); color: var(--amber); } .stat-ico.blue { background: var(--blue-50); color: var(--blue); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; } .stat-value { font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; } .btn-success:hover { filter: brightness(.95); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; } .btn-danger-ghost { color: var(--red); border-color: transparent; background: transparent; } .btn-danger-ghost:hover { background: var(--red-50); }
.btn-warning { background: var(--amber); border-color: var(--amber); color: #fff; } .btn-info { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; } .btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; } .btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; } .btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; } .btn-icon { width: 32px; padding: 0; } .btn-icon.btn-sm { width: 30px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; } .field label { font-size: 12.5px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 4px; }
.req { color: var(--red); font-weight: 600; } .help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 10px; cursor: help; }
.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; outline: 0; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); } .input:disabled, .input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; } select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px; }
select.input[multiple] { height: auto; min-height: 100px; background-image: none; padding: 6px; }
.input-xs { height: 28px; font-size: 12px; padding: 0 8px; border-radius: 6px; } .input-sm { height: 32px; font-size: 13px; } .input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input-group { display: flex; } .input-group .input { border-radius: 0; } .input-group .input:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); } .input-group .input:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ig-addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); font-size: 13px; white-space: nowrap; }
.ig-addon:first-child { border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); } .ig-addon:last-child { border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; } .ig-addon .btn { height: 100%; border: 0; border-radius: 0; margin: 0 -10px; }
.note { color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 6px 0; } .check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; padding: 4px 0; } .switch input { display: none; } .switch i { width: 36px; height: 20px; border-radius: 20px; background: var(--border-2); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); } .switch input:checked + i { background: var(--primary); } .switch input:checked + i::after { transform: translateX(16px); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; } .form-grid-2 { grid-template-columns: repeat(2, 1fr); } .form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--border); }
.field-btn { justify-content: flex-end; flex-direction: row; align-items: flex-end; }
fieldset { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px 16px; margin: 0 0 14px; } legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.search-wrap { position: relative; } .search-wrap .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); } .search-wrap .input { padding-left: 32px; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; z-index: 60; margin-top: 4px; }
.ac-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; } .ac-item:hover, .ac-item.sel { background: var(--primary-50); } .ac-item small { color: var(--muted); }
.ac-item .ac-stock { font-family: var(--mono); font-size: 11.5px; color: var(--muted); } .ac-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tbl th a { color: inherit; } .tbl th.sorted a { color: var(--primary); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; } .tbl tbody tr:hover { background: var(--surface-2); } .tbl tr:last-child td { border-bottom: 0; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); } .tbl .num, .tbl .money { text-align: right; } .tbl td.actions { text-align: right; white-space: nowrap; }
.tbl .row-link { font-weight: 500; } .tbl .sub { color: var(--muted); font-size: 12px; display: block; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; } .tbl.lines td .input { height: 32px; font-size: 13px; }
.thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .tt-search { flex: 1; max-width: 360px; } .tt-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; } .tfoot-l { display: flex; align-items: center; gap: 10px; } .per-select { width: auto; }
.pager { display: flex; gap: 4px; } .pager a, .pager span, .pager strong { min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 7px; border: 1px solid var(--border); font-size: 12.5px; } .pager strong { background: var(--primary); color: #fff; border-color: var(--primary); } .pager a:hover { background: var(--surface-2); text-decoration: none; } .pager span { color: var(--muted-2); border-color: transparent; }
.kv { width: 100%; font-size: 13px; } .kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 5px 10px 5px 0; width: 42%; vertical-align: top; } .kv td { padding: 5px 0; }
.totals { margin-left: auto; width: 100%; max-width: 360px; font-size: 13.5px; } .totals tr td { padding: 6px 0; } .totals tr td:last-child { text-align: right; font-variant-numeric: tabular-nums; } .totals tr.grand td { font-weight: 700; font-size: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.filters .filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; padding: 14px 18px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; } .tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit; cursor: pointer; }
.tabs a.active, .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); } .tabs a:hover { text-decoration: none; color: var(--text); }
.tab-pane { display: none; } .tab-pane.active { display: block; }

/* badges, alerts, empty */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.badge-gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); } .badge-green { background: var(--green-50); color: var(--green); } .badge-red { background: var(--red-50); color: var(--red); } .badge-amber { background: var(--amber-50); color: var(--amber); } .badge-blue { background: var(--blue-50); color: var(--blue); } .badge-indigo { background: var(--primary-50); color: var(--primary); }
.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; border: 1px solid; }
.alert-success { background: var(--green-50); color: var(--green); border-color: rgba(22,163,74,.25); } .alert-error, .alert-danger { background: var(--red-50); color: var(--red); border-color: rgba(220,38,38,.25); } .alert-warning { background: var(--amber-50); color: var(--amber); border-color: rgba(217,119,6,.25); } .alert-info { background: var(--blue-50); color: var(--blue); border-color: rgba(37,99,235,.25); }
.alert-x { background: none; border: 0; font-size: 18px; color: inherit; cursor: pointer; opacity: .7; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); } .empty-ico { font-size: 34px; margin-bottom: 8px; } .empty h3 { color: var(--text); margin-bottom: 4px; } .empty .btn { margin-top: 10px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; backdrop-filter: blur(2px); }
.modal-card { background: var(--surface); border-radius: 14px; width: 100%; max-width: 760px; position: relative; box-shadow: var(--shadow-lg); animation: pop .15s ease-out; } .modal-card.narrow { max-width: 480px; } .modal-card.wide { max-width: 1100px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; z-index: 2; } .modal-x:hover { background: var(--surface-2); }
.modal-body { padding: 0; } .modal-body > .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; padding-right: 50px; } .modal-body > .modal-content { padding: 20px; } .modal-body > .modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 200; box-shadow: var(--shadow-lg); } .toast.err { background: var(--red); color: #fff; }

/* calculator */
.calc { position: fixed; right: 20px; top: 70px; width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 90; padding: 12px; }
.calc-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 8px; } .calc-head .modal-x { position: static; width: 26px; height: 26px; font-size: 18px; }
.calc-screen { width: 100%; height: 44px; text-align: right; font-family: var(--mono); font-size: 20px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--surface-2); color: var(--text); margin-bottom: 8px; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .calc-keys button { height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; } .calc-keys button.op { background: var(--primary-50); color: var(--primary); } .calc-keys button.eq { background: var(--primary); color: #fff; grid-column: span 2; }

/* auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; } .auth-side { background: radial-gradient(1200px 600px at 10% 10%, #4338ca 0%, #0f172a 55%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; } .auth-side p.lead { font-size: 17px; color: #c7d2fe; max-width: 420px; }
.auth-feats { display: grid; gap: 10px; } .auth-feats div { display: flex; gap: 10px; align-items: center; color: #e0e7ff; font-size: 14px; } .auth-feats i { width: 8px; height: 8px; border-radius: 50%; background: #a5b4fc; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg); } .auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 28px; } .auth-card h2 { font-size: 22px; margin-bottom: 4px; } .auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
.auth-wide .auth-card { max-width: 860px; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; } .steps div { flex: 1; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 500; } .steps div.on { background: var(--primary); color: #fff; border-color: var(--primary); } .steps div.done { color: var(--green); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; } .plan { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; }
.plan.popular { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100), var(--shadow); } .plan .ribbon { position: absolute; top: -11px; left: 20px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.plan h3 { font-size: 18px; } .plan .price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 2px; } .plan .price small { font-size: 13px; color: var(--muted); font-weight: 500; } .plan ul { list-style: none; padding: 0; margin: 14px 0 20px; display: grid; gap: 8px; font-size: 13.5px; } .plan ul li::before { content: '✓'; color: var(--green); margin-right: 8px; font-weight: 700; } .plan .btn { margin-top: auto; }

/* POS screen */
body.pos-page .sidebar { display: none; } body.pos-page .main { margin-left: 0; } body.pos-page .content { max-width: none; padding: 12px 14px 14px; }
.pos { display: grid; grid-template-columns: 1fr 440px; gap: 12px; height: calc(100vh - var(--tb-h) - 26px); min-height: 560px; }
.pos-left, .pos-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pos-head { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.pos-cart { flex: 1; overflow: auto; } .pos-cart table { width: 100%; border-collapse: collapse; font-size: 13px; } .pos-cart th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.pos-cart .input { height: 32px; font-size: 13px; padding: 0 8px; } .pos-cart td { padding: 7px 8px; } .pos-cart .qty { width: 110px; } .pos-cart .price { width: 110px; } .pos-cart .line-name { font-weight: 500; } .pos-cart .line-sub { color: var(--muted); font-size: 11.5px; }
.pos-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 12.5px; } .pos-totals div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; } .pos-totals b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; } .pos-totals button { background: none; border: 0; color: var(--primary); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.pos-grand { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; padding: 4px 2px; } .pos-grand b { font-size: 24px; font-variant-numeric: tabular-nums; }
.pos-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .pos-actions .btn { height: 46px; flex-direction: column; gap: 2px; font-size: 12.5px; } .pos-actions .btn small { font-size: 10.5px; opacity: .8; font-weight: 400; }
.pos-products { display: flex; flex-direction: column; min-height: 0; } .pos-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); }
.pos-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; padding: 10px; align-content: start; }
.pos-tile { border: 1px solid var(--border); border-radius: 10px; padding: 8px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; display: flex; flex-direction: column; gap: 4px; transition: transform .08s, border-color .12s; }
.pos-tile:hover { border-color: var(--primary); transform: translateY(-1px); } .pos-tile img, .pos-tile .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted-2); font-size: 22px; }
.pos-tile .t-name { font-size: 12.5px; font-weight: 500; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .pos-tile .t-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.pos-tile .t-price { font-weight: 600; color: var(--text); font-family: var(--font); }
.pos-recent { display: flex; gap: 8px; }
.pay-rows { display: grid; gap: 10px; } .pay-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .pay-summary div { background: var(--surface-2); border-radius: 8px; padding: 10px; text-align: center; } .pay-summary b { display: block; font-size: 18px; }
.kbd { font-family: var(--mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; }

/* charts */
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; } .bar-chart .bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; } .bar-chart .bar:hover { opacity: 1; } .bar-chart .bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; display: none; } .bar-chart .bar:hover span { display: block; }
.bar-labels { display: flex; gap: 4px; font-size: 10px; color: var(--muted); } .bar-labels span { flex: 1; text-align: center; overflow: hidden; }
.line-chart { width: 100%; height: 220px; } .line-chart path.l { fill: none; stroke: var(--primary); stroke-width: 2; } .line-chart path.a { fill: var(--primary); opacity: .08; } .line-chart text { font-size: 10px; fill: var(--muted); } .line-chart line { stroke: var(--border); }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--primary); }

/* print */
@media print { .sidebar, .topbar, .page-actions, .table-toolbar, .tfoot, .filters, .no-print, #calc, #modal, .btn { display: none !important; } .main { margin: 0; } .content { padding: 0; } .card { box-shadow: none; border: 0; } body { background: #fff; } }

/* responsive */
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr 380px; } .form-grid { grid-template-columns: repeat(2, 1fr); } .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); } body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); } .main { margin-left: 0; } .icon-btn { display: grid; } .hide-sm { display: none; }
  .content { padding: 16px 14px 60px; } .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .form-grid, .form-grid-4, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; height: auto; } .pos-products { height: 50vh; } .pay-row { grid-template-columns: 1fr 1fr; } .stats { grid-template-columns: repeat(2, 1fr); }
}
