:root {
  --indigo: #2F2A86;
  --indigo-d: #1E1A5E;
  --indigo-50: #EEEDFB;
  --indigo-100: #DCDAF6;
  --yellow: #FFE53B;
  --yellow-d: #F2C500;
  --bg: #F4F4FA;
  --card: #FFFFFF;
  --text: #17153B;
  --muted: #6B6A86;
  --line: #E4E3EF;
  --green: #12A150;
  --green-50: #E6F7EE;
  --red: #E0364A;
  --red-50: #FDECEE;
  --orange: #E98A15;
  --orange-50: #FFF4E5;
  --blue: #2370E6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 21, 59, .06), 0 4px 16px rgba(23, 21, 59, .06);
  --side-w: 240px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* surfaces & roles (light = original look) */
  --card: #FFFFFF;
  --field: #FFFFFF;
  --soft: #F7F7FB;
  --soft2: #FAFAFD;
  --hover: #FAFAFF;
  --topbar: rgba(244, 244, 250, .92);
  --on-accent: #FFFFFF;
  --on-yellow: #1E1A5E;
  --side-bg: var(--indigo);
  --side-fg: #FFFFFF;
  --side-active-bg: var(--yellow);
  --side-active-fg: var(--indigo-d);
  --bar2: #5049C2;
  --flash: #FFF6B0;
  --badge-yellow-bg: #FFF8C4; --badge-yellow-fg: #7A6400;
  --badge-gray-bg: #EEEEEE; --badge-gray-fg: #555555;
  --tooltip-bg: #17153B; --tooltip-fg: #FFFFFF;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Cairo', Tahoma, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--indigo); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); }
.bold { font-weight: 800; }
.right { text-align: right; } .center { text-align: center; } .left { text-align: left; }
.nowrap { white-space: nowrap; }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-content: center; gap: 18px; justify-items: center; background: var(--yellow); z-index: 100; }
.boot img { width: 110px; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(47, 42, 134, .2); border-top-color: var(--indigo); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: var(--yellow) url('/assets/brand/mark.svg') no-repeat -120px 110% / 420px; }
.login-card { width: min(400px, 100%); background: var(--card); border-radius: 22px; padding: 28px; box-shadow: 0 20px 60px rgba(30, 26, 94, .25); display: grid; gap: 14px; }
.login-logo { width: 230px; margin: 0 auto 4px; display: block; }
.login-card h1 { margin: 0; font-size: 20px; text-align: center; }

/* ---------- forms ---------- */
label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
input, select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--field); border-radius: 10px; padding: 9px 12px; font-size: 15px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--indigo-100); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--indigo); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); cursor: pointer; font-size: 14px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700;
  cursor: pointer; background: var(--indigo-50); color: var(--indigo); min-height: 42px; white-space: nowrap; transition: filter .15s, transform .05s; text-decoration: none; }
.btn:hover { filter: brightness(.96); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--indigo); color: var(--on-accent); }
.btn-yellow { background: var(--yellow); color: var(--on-yellow); }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-soft-red { background: var(--red-50); color: var(--red); }
.btn-ghost { background: transparent; color: var(--indigo); }
.btn-ghost-light { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-outline { background: var(--card); border: 1.5px solid var(--line); color: var(--text); }
.btn-sm { padding: 5px 10px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; min-height: 52px; font-size: 17px; }
.btn-xl { padding: 14px 22px; min-height: 64px; font-size: 22px; border-radius: 14px; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 20px; width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; color: inherit; }
.icon-btn:hover { background: var(--indigo-50); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100%; }
.sidebar { width: var(--side-w); background: var(--side-bg); color: var(--side-fg); position: fixed; inset: 0 0 0 auto; display: flex; flex-direction: column; z-index: 30; }
.brand { padding: 18px 18px 10px; } .brand img { width: 170px; display: block; }
#nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .82); text-decoration: none; font-weight: 700; margin-bottom: 2px; }
#nav a .ic { width: 22px; text-align: center; font-size: 17px; }
#nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
#nav a.active { background: var(--side-active-bg); color: var(--side-active-fg); }
#nav .sep { font-size: 11px; color: rgba(255, 255, 255, .45); padding: 12px 12px 4px; font-weight: 700; }
.side-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid rgba(255, 255, 255, .1); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-chip { display: grid; line-height: 1.3; } .user-chip small { color: var(--yellow); font-size: 12px; }
.main { flex: 1; margin-right: var(--side-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 0; font-size: 19px; flex: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.clock { font-weight: 700; color: var(--muted); font-size: 13px; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.net i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.net.online { background: var(--green-50); color: var(--green); }
.net.offline { background: var(--red-50); color: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.sync-badge { border: 0; background: var(--orange); color: #fff; font-weight: 800; border-radius: 99px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.view { padding: 20px; flex: 1; min-width: 0; }
.scrim { display: none; }
.bottom-nav { display: none; }

/* ---------- cards / kpis ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi .v { font-size: 24px; font-weight: 800; direction: ltr; text-align: right; line-height: 1.3; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.accent { background: var(--indigo); color: var(--on-accent); } .kpi.accent .l, .kpi.accent .s { color: inherit; opacity: .72; }
.kpi.yellow { background: var(--yellow); color: var(--on-yellow); } .kpi.yellow .l, .kpi.yellow .s { color: inherit; opacity: .8; }
.kpi.good .v { color: var(--green); } .kpi.bad .v { color: var(--red); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols > .card + .card { margin-top: 0; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar > * { min-width: 0; }
.toolbar input[type=search], .toolbar .search { flex: 1; min-width: 200px; }
.toolbar label { min-width: 140px; }
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--indigo); color: var(--on-accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 13px; cursor: pointer; user-select: none; }
.chip.on { background: var(--indigo); border-color: var(--indigo); color: var(--on-accent); }
.chip .x { opacity: .6; } .chip .x:hover { opacity: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 9px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: var(--soft2); position: sticky; top: 0; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--hover); }
tfoot td { font-weight: 800; background: var(--soft2); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--indigo-50); color: var(--indigo); white-space: nowrap; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.orange { background: var(--orange-50); color: var(--orange); }
.badge.yellow { background: var(--badge-yellow-bg); color: var(--badge-yellow-fg); }
.badge.gray { background: var(--badge-gray-bg); color: var(--badge-gray-fg); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; margin-inline-end: 4px; }
.bar { height: 8px; background: var(--indigo-50); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--indigo); border-radius: 99px; }

/* ---------- chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .col i { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--indigo), var(--bar2)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.chart .col i.neg { background: var(--red); }
.chart .col i:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--tooltip-bg); color: var(--tooltip-fg); font-size: 11px; padding: 2px 6px; border-radius: 6px; white-space: nowrap; margin-bottom: 4px; }
.chart .col span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(23, 21, 59, .45); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--card); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0, 0, 0, .3); animation: pop .18s; }
.modal.lg { width: min(900px, 100%); } .modal.xl { width: min(1180px, 100%); } .modal.sm { width: min(400px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 18px; overflow-y: auto; flex: 1; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: calc(16px + var(--safe-b)); left: 16px; z-index: 90; display: grid; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--tooltip-bg); color: var(--tooltip-fg); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); animation: pop .2s; max-width: 420px; }
.toast.ok { background: var(--green); color: #fff; } .toast.err { background: var(--red); color: #fff; } .toast.warn { background: var(--orange); color: #fff; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; height: calc(100vh - 100px); }
.pos-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.scan-box { display: flex; gap: 8px; background: var(--card); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); position: relative; }
.scan-box input { font-size: 18px; font-weight: 700; min-height: 50px; border-width: 2px; }
.scan-box .scan-ic { font-size: 22px; display: grid; place-items: center; width: 44px; }
.search-results { position: absolute; top: 100%; right: 0; left: 0; background: var(--card); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); z-index: 15; max-height: 380px; overflow-y: auto; margin-top: 4px; }
.search-results .it { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.search-results .it:hover, .search-results .it.sel { background: var(--indigo-50); }
.cart { flex: 1; overflow-y: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 0; }
.cart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 30px; gap: 8px; }
.cart-empty img { width: 90px; opacity: .25; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cart-line.flash { animation: flash .6s; }
@keyframes flash { from { background: var(--flash); } }
.cart-line .nm { font-weight: 800; }
.cart-line .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { border: 0; background: var(--soft); color: var(--text); width: 34px; height: 36px; font-size: 18px; cursor: pointer; font-weight: 800; }
.qty input { width: 46px; border: 0; background: var(--field); text-align: center; min-height: 36px; padding: 0; border-radius: 0; font-weight: 800; }
.qty input:focus { box-shadow: none; }
.line-total { font-weight: 800; min-width: 90px; text-align: left; direction: ltr; }
.line-total s { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.pos-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.totals { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 8px; }
.totals .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.totals .r b { direction: ltr; }
.totals .grand { font-size: 30px; font-weight: 900; color: var(--indigo); border-top: 2px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.totals .grand small { font-size: 14px; color: var(--muted); }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-methods button { border: 2px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 10px 4px; font-weight: 800; cursor: pointer; display: grid; gap: 2px; justify-items: center; font-size: 13px; }
.pay-methods button span { font-size: 22px; }
.pay-methods button.on { border-color: var(--indigo); background: var(--indigo-50); color: var(--indigo); }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.big-change { font-size: 34px; font-weight: 900; text-align: center; padding: 10px; border-radius: 14px; background: var(--green-50); color: var(--green); direction: ltr; }
.big-change.neg { background: var(--red-50); color: var(--red); }
.offline-banner { background: var(--red-50); color: var(--red); border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 13px; }

/* ---------- variants matrix ---------- */
.matrix input { min-height: 36px; padding: 5px 8px; font-size: 14px; }
.matrix td, .matrix th { padding: 5px 6px; }
.barcode-txt { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; direction: ltr; }

/* ---------- labels preview ---------- */
.label-preview { display: flex; gap: 10px; flex-wrap: wrap; background: var(--soft); border-radius: 12px; padding: 14px; justify-content: center; }
.label-preview .lbl { background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }

/* ---------- sync modal ---------- */
.sync-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.sync-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--soft); font-size: 14px; gap: 8px; }
.sync-item.ok { background: var(--green-50); } .sync-item.err { background: var(--red-50); }
.progress { height: 10px; background: var(--indigo-50); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); transition: width .3s; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 330px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(100%); transition: transform .25s; box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, .3); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .main { margin-right: 0; padding-bottom: calc(64px + var(--safe-b)); }
  .menu-btn { display: inline-grid; }
  .view { padding: 14px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + var(--safe-b)); justify-content: space-around; box-shadow: 0 -4px 20px rgba(0, 0, 0, .06); }
  .bottom-nav a { display: grid; justify-items: center; gap: 0; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 10px; flex: 1; }
  .bottom-nav a .ic { font-size: 20px; }
  .bottom-nav a.active { color: var(--indigo); background: var(--indigo-50); }
  .pos { grid-template-columns: 1fr; height: auto; }
  .cart { min-height: 220px; max-height: none; }
  .pos-right { position: sticky; bottom: calc(64px + var(--safe-b)); z-index: 5; }
  .clock { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar h2 { font-size: 17px; }
  .net b { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; } .kpi .v { font-size: 19px; }
  .cols { grid-template-columns: 1fr; }
  .card { padding: 12px; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.lg, .modal.xl, .modal.sm { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-f { padding-bottom: calc(12px + var(--safe-b)); }
  .modal-f .btn { flex: 1; }
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .cart-line .line-total { grid-column: 2; grid-row: 1; }
  .cart-line .qty { grid-column: 1; }
  .cart-line .acts { grid-column: 2; justify-self: end; }
  .totals .grand { font-size: 24px; }
  .pay-methods { grid-template-columns: repeat(2, 1fr); }
  .toolbar label { min-width: 0; flex: 1 1 45%; }
  .hide-sm { display: none !important; }
  table { font-size: 13px; }
  th, td { padding: 7px 6px; }
}
@media (min-width: 961px) { .show-sm { display: none !important; } }
@media print { body * { visibility: hidden; } }

/* show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-left: 46px; }
.pw-eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 34px; border: 0; background: transparent;
  cursor: pointer; font-size: 17px; border-radius: 8px; opacity: .55; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye.on { opacity: 1; background: var(--indigo-50); }

/* ================= DARK MODE: black & silver ================= */
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --indigo: #C9CDD3;        /* silver replaces the brand blue */
  --indigo-d: #E9EBEE;
  --indigo-50: #26272B;
  --indigo-100: #3A3C42;
  --yellow: #C9CDD3;        /* silver replaces the brand yellow */
  --yellow-d: #A7ABB2;
  --bg: #0E0E10;
  --card: #18181B;
  --field: #111113;
  --soft: #222226;
  --soft2: #1D1D21;
  --hover: #232327;
  --topbar: rgba(14, 14, 16, .9);
  --text: #ECEDEF;
  --muted: #9A9DA4;
  --line: #2E2F34;
  --green-50: rgba(18, 161, 80, .16);
  --red-50: rgba(224, 54, 74, .16);
  --orange-50: rgba(233, 138, 21, .16);
  --green: #2BC46B;
  --red: #FF5A6E;
  --on-accent: #0B0B0D;
  --on-yellow: #0B0B0D;
  --side-bg: #050506;       /* black sidebar */
  --side-fg: #E9EBEE;
  --side-active-bg: linear-gradient(135deg, #E4E6EA, #A9ADB4);
  --side-active-fg: #0B0B0D;
  --bar2: #8D9199;
  --flash: rgba(201, 205, 211, .18);
  --badge-yellow-bg: rgba(201, 205, 211, .16); --badge-yellow-fg: #E9EBEE;
  --badge-gray-bg: #2A2B30; --badge-gray-fg: #C2C5CB;
  --tooltip-bg: #ECEDEF; --tooltip-fg: #0B0B0D;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
  }
:root:not([data-theme="light"]) .logo-light { display: none !important; }
:root:not([data-theme="light"]) .logo-dark { display: block !important; }
:root:not([data-theme="light"]) .login { background: #050506 url('/assets/brand/mark-silver.svg') no-repeat -120px 110% / 420px; }
:root:not([data-theme="light"]) .boot { background: #050506; }
:root:not([data-theme="light"]) .sidebar { border-left: 1px solid #1E1F23; }
:root:not([data-theme="light"]) #nav .sep { color: rgba(233, 235, 238, .4); }
:root:not([data-theme="light"]) .user-chip small { color: #C9CDD3; }
:root:not([data-theme="light"]) .cart-empty img { opacity: .35; }
:root:not([data-theme="light"]) .modal-bg { background: rgba(0, 0, 0, .65); }
}
:root[data-theme="dark"] {
  --indigo: #C9CDD3;        /* silver replaces the brand blue */
  --indigo-d: #E9EBEE;
  --indigo-50: #26272B;
  --indigo-100: #3A3C42;
  --yellow: #C9CDD3;        /* silver replaces the brand yellow */
  --yellow-d: #A7ABB2;
  --bg: #0E0E10;
  --card: #18181B;
  --field: #111113;
  --soft: #222226;
  --soft2: #1D1D21;
  --hover: #232327;
  --topbar: rgba(14, 14, 16, .9);
  --text: #ECEDEF;
  --muted: #9A9DA4;
  --line: #2E2F34;
  --green-50: rgba(18, 161, 80, .16);
  --red-50: rgba(224, 54, 74, .16);
  --orange-50: rgba(233, 138, 21, .16);
  --green: #2BC46B;
  --red: #FF5A6E;
  --on-accent: #0B0B0D;
  --on-yellow: #0B0B0D;
  --side-bg: #050506;       /* black sidebar */
  --side-fg: #E9EBEE;
  --side-active-bg: linear-gradient(135deg, #E4E6EA, #A9ADB4);
  --side-active-fg: #0B0B0D;
  --bar2: #8D9199;
  --flash: rgba(201, 205, 211, .18);
  --badge-yellow-bg: rgba(201, 205, 211, .16); --badge-yellow-fg: #E9EBEE;
  --badge-gray-bg: #2A2B30; --badge-gray-fg: #C2C5CB;
  --tooltip-bg: #ECEDEF; --tooltip-fg: #0B0B0D;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
:root[data-theme="dark"] .login { background: #050506 url('/assets/brand/mark-silver.svg') no-repeat -120px 110% / 420px; }
:root[data-theme="dark"] .boot { background: #050506; }
:root[data-theme="dark"] .sidebar { border-left: 1px solid #1E1F23; }
:root[data-theme="dark"] #nav .sep { color: rgba(233, 235, 238, .4); }
:root[data-theme="dark"] .user-chip small { color: #C9CDD3; }
:root[data-theme="dark"] .cart-empty img { opacity: .35; }
:root[data-theme="dark"] .modal-bg { background: rgba(0, 0, 0, .65); }
.theme-btn { font-size: 18px; }

/* ================= icons (lucide line icons) ================= */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; display: inline-block; }
.btn .ic { width: 1.1em; height: 1.1em; }
.icon-btn .ic { width: 21px; height: 21px; }
#nav a .ic { font-size: 18px; }
#nav a .ic .ic, #nav a > .ic { width: 20px; height: 20px; }
.bottom-nav a .ic .ic { width: 22px; height: 22px; }
.empty-ic, .empty > div[style*="font-size:42px"] { color: var(--muted); }
.empty-ic .ic, .empty > div[style*="font-size:42px"] .ic { width: 46px; height: 46px; stroke-width: 1.6; }
.toast { display: flex; align-items: center; gap: 8px; }
.toast .ic { width: 20px; height: 20px; }
.pay-methods button span .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.kpi .l .ic, .card-h h3 .ic, .modal-h h3 .ic { color: var(--indigo); margin-inline-end: 2px; }
.modal-h h3 .ic { width: 20px; height: 20px; }
.scan-box .scan-ic .ic { width: 24px; height: 24px; color: var(--muted); }

/* ================= interactive guide ================= */
.tour-spot { position: fixed; z-index: 200; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8, 8, 18, .58), 0 0 0 3px var(--yellow), 0 0 24px 6px rgba(255, 229, 59, .35);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; animation: tourPulse 1.8s ease-in-out infinite; }
@keyframes tourPulse { 50% { box-shadow: 0 0 0 9999px rgba(8, 8, 18, .58), 0 0 0 5px var(--yellow), 0 0 34px 10px rgba(255, 229, 59, .25); } }
.tour-pop { position: fixed; z-index: 201; width: min(370px, calc(100vw - 24px)); background: var(--card); color: var(--text); border-radius: 16px;
  padding: 14px 16px 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); border: 1px solid var(--line); transition: top .25s ease, left .25s ease; }
.tour-pop h4 { margin: 6px 0 4px; font-size: 17px; }
.tour-text { font-size: 14.5px; line-height: 1.7; color: var(--text); }
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--indigo); background: var(--indigo-50); border-radius: 99px; padding: 3px 10px; }
.tour-x { width: 32px; height: 32px; }
.tour-progress { height: 4px; background: var(--indigo-50); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.tour-progress i { display: block; height: 100%; background: var(--indigo); border-radius: 99px; transition: width .3s; }
.tour-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.tour-hint { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; font-weight: 800; color: var(--indigo); background: var(--indigo-50); padding: 7px 10px; border-radius: 10px; }
.tour-warn { display: flex; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--orange); }
.tour-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.tour-done { color: var(--green); } .tour-done .ic { width: 44px; height: 44px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tour-spot { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .7), 0 0 0 3px #E4E6EA, 0 0 24px 6px rgba(228, 230, 234, .25); } }
:root[data-theme="dark"] .tour-spot { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .7), 0 0 0 3px #E4E6EA, 0 0 24px 6px rgba(228, 230, 234, .25); }

/* ================= help center ================= */
.help-hero { display: flex; gap: 16px; align-items: center; background: var(--indigo); color: var(--on-accent); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.help-hero h2 { margin: 0 0 4px; font-size: 21px; } .help-hero p { margin: 0; opacity: .85; }
.help-hero-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--yellow); color: var(--on-yellow); display: grid; place-items: center; flex-shrink: 0; }
.help-hero-ic .ic { width: 28px; height: 28px; }
.help-cat { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 18px 0 10px; color: var(--text); }
.help-cat .ic { color: var(--indigo); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.help-card { display: flex; align-items: center; gap: 12px; text-align: right; background: var(--card); color: var(--text); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .1s; font: inherit; }
.help-card:hover { border-color: var(--indigo); transform: translateY(-1px); }
.help-card b { display: block; font-size: 15px; } .help-card small { color: var(--muted); font-size: 12.5px; }
.help-card-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--indigo-50); color: var(--indigo); display: grid; place-items: center; flex-shrink: 0; }
.help-card-ic .ic { width: 21px; height: 21px; }
.help-go { display: grid; justify-items: center; color: var(--indigo); gap: 2px; }
.help-go small { white-space: nowrap; font-size: 11px; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 2px; } .faq:last-child { border: 0; }
.faq summary { font-weight: 800; cursor: pointer; } .faq p { margin: 8px 0 0; color: var(--muted); line-height: 1.7; }
.welcome-card { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; border: 1.5px solid var(--indigo-100); }
.welcome-card .help-hero-ic { width: 46px; height: 46px; }
#helpBtn { color: inherit; }

/* ================= shifts ================= */
.shift-bar { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 8px 12px; font-size: 14px; font-weight: 700; }
.shift-bar.on { background: var(--card); box-shadow: var(--shadow); color: var(--text); }
.shift-bar.on .ic { color: var(--green); }
.shift-bar.off { background: var(--orange-50); color: var(--orange); border: 1.5px solid var(--orange); }
.pos-actions .span-all { grid-column: 1 / -1; }
.shift-row-diff.neg { color: var(--red); } .shift-row-diff.pos { color: var(--green); }
.qr-preview { width: 150px; height: 150px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.qr-preview svg { width: 100%; height: 100%; display: block; }

/* ================= branches ================= */
.loc-switch { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 99px; padding: 2px 4px 2px 12px; font-size: 13px; font-weight: 800; color: var(--text); min-height: 36px; }
.loc-switch .ic { color: var(--indigo); width: 17px; height: 17px; }
.loc-switch select { border: 0; background: transparent; min-height: 30px; padding: 2px 6px; font-weight: 800; font-size: 13px; box-shadow: none; width: auto; max-width: 170px; }
.loc-switch b { padding-left: 8px; }
.loc-stocks { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.loc-stocks .badge { font-size: 11px; }
.loc-gate { text-align: center; padding: 30px 16px; }
.loc-gate .chips { justify-content: center; margin-top: 12px; }
.loc-gate .chip { font-size: 15px; padding: 10px 18px; }
@media (max-width: 640px) { .loc-switch select { max-width: 110px; } .loc-switch { padding-left: 4px; } }
