/* ==========================================================
   Rani Enterprises - GST ERP theme (black · gold · red accent)
   ========================================================== */
:root {
  --ink: #17161a;
  --ink-2: #232129;
  --ink-3: #2e2b35;
  --gold: #c9a24b;
  --gold-2: #e9cf87;
  --gold-3: #f7ecc9;
  --red: #c8102e;
  --ivory: #f7f4ee;
  --card: #ffffff;
  --text: #1d1b22;
  --muted: #6f6a78;
  --line: #e8e2d6;
  --ok: #1d7a4a;
  --bad: #b3261e;
  --radius: 14px;
  --side-w: 248px;
  --top-h: 58px;
  --shadow: 0 10px 30px rgba(23, 22, 26, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ivory); color: var(--text); font: 13.5px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
.ic { flex: none; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 40;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: linear-gradient(90deg, #0d0c0f, var(--ink-2));
  color: #fff; border-bottom: 1px solid rgba(201, 162, 75, .35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
}
.hamburger { width: 42px; height: 42px; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); cursor: pointer; display: grid; place-content: center; gap: 5px; }
.hamburger span { display: block; width: 22px; height: 2.2px; border-radius: 2px; background: var(--gold); transition: .25s; }
.hamburger:hover { background: rgba(201,162,75,.15); }
body.side-closed .hamburger span:nth-child(2) { width: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font: 700 1.25rem "Playfair Display", serif; color: var(--ink);
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); position: relative;
}
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); }
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; font-size: 1.7rem; }
.login-brand { gap: 14px; }
.login-brand .brand-text b { font-size: 1.6rem; }
.login-brand .brand-text small { font-size: .8rem; }
.sidebar-foot span { color: var(--gold); font-size: .7rem; }
.brand-logo { height: 42px; padding: 3px 6px; border-radius: 10px; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(201,162,75,.6); }
.brand-logo img { height: 36px; display: block; }
.login-logo { width: min(320px, 70%); background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.login-logo img { width: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font: 700 1.15rem "Playfair Display", serif; letter-spacing: .2px; color: #fff; }
.brand-text b em { font-style: normal; color: var(--gold-2); }
.brand-text small { color: #a9a3b3; font-size: .72rem; letter-spacing: 1.2px; text-transform: uppercase; }
.spacer { flex: 1; }
.place-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 5px 12px; border-radius: 20px; background: rgba(200,16,46,.18); border: 1px solid rgba(200,16,46,.45); color: #ffd9de; font-size: .78rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 960px) { .place-chip { display: none; } }
.fy-switch { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(201,162,75,.35); border-radius: 10px; padding: 4px 6px 4px 12px; }
.fy-switch label { font-size: .72rem; font-weight: 600; color: var(--gold-2); letter-spacing: 1px; }
.fy-switch select { background: transparent; color: #fff; border: 0; font: 600 .9rem Inter; padding: 4px; cursor: pointer; }
.fy-switch select option { color: var(--text); }
.user-chip { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 12px; cursor: pointer; outline: none; }
.user-chip:hover, .user-chip:focus-within { background: rgba(255,255,255,.06); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 700; }
.who { display: flex; flex-direction: column; line-height: 1.15; }
.who b { font-size: .88rem; font-weight: 600; }
.who small { color: var(--gold-2); font-size: .72rem; }
.user-menu { display: none; position: absolute; right: 0; top: 48px; min-width: 200px; background: #fff; color: var(--text); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 6px; border: 1px solid var(--line); }
.user-chip:focus-within .user-menu, .user-chip:hover .user-menu { display: block; }
.user-menu a, .user-menu button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 8px; text-decoration: none; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.user-menu a:hover, .user-menu button:hover { background: var(--gold-3); }
.user-menu form { margin: 0; }

/* ---------- side menu ---------- */
.sidebar {
  position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); z-index: 35;
  background: linear-gradient(180deg, var(--ink-2), #0d0c0f);
  color: #cfcad6; overflow-y: auto; transition: transform .28s ease;
  display: flex; flex-direction: column; border-right: 1px solid rgba(201,162,75,.18);
}
.sidebar nav { padding: 12px 12px 20px; flex: 1; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(201,162,75,.3); border-radius: 3px; }
.nav-title { margin: 14px 10px 4px; font-size: .66rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 11px; margin: 2px 0; border-radius: 10px; text-decoration: none; color: #d4cfdb; font-size: .9rem; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(201,162,75,.1); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, var(--gold), var(--gold-2)); color: var(--ink); font-weight: 600; box-shadow: 0 6px 16px rgba(201,162,75,.25); }
.nav-link .ic { opacity: .9; }
.sidebar-foot { padding: 12px 22px; font-size: .74rem; color: #8d8797; border-top: 1px solid rgba(255,255,255,.06); }
.backdrop { display: none; }

.content { margin-left: var(--side-w); padding: calc(var(--top-h) + 14px) 18px 24px; transition: margin .28s ease; min-height: 100vh; }
body.side-closed .sidebar { transform: translateX(-100%); }
body.side-closed .content { margin-left: 0; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .content { margin-left: 0; padding: calc(var(--top-h) + 16px) 14px 30px; }
  body.side-open .sidebar { transform: none; }
  body.side-open .backdrop { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.45); z-index: 30; }
  .who, .brand-text small { display: none; }
}

/* ---------- page heading ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h1 { font: 700 1.3rem "Playfair Display", serif; margin: 0; color: var(--ink); }
.page-head h1::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--red)); }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: .92rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h3 .ic { color: var(--gold); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { position: relative; overflow: hidden; border-radius: 12px; padding: 11px 13px; color: #fff; background: linear-gradient(140deg, var(--ink-3), var(--ink)); box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(201,162,75,.35), transparent 70%); }
.kpi span { font-size: .68rem; color: #b5afbf; letter-spacing: .4px; text-transform: uppercase; }
.kpi b { display: block; margin-top: 2px; font: 700 1.2rem "Playfair Display", serif; color: var(--gold-2); }
.kpi small { color: #9d97a8; font-size: .72rem; }
.kpi.light { background: #fff; color: var(--text); border: 1px solid var(--line); }
.kpi.light b { color: var(--ink); }
.kpi.light span { color: var(--muted); }
.kpi.accent { border-bottom: 3px solid var(--red); }

/* bar chart (dashboard) */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 6px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); min-height: 3px; }
.bar.today i { background: linear-gradient(180deg, #e2475f, var(--red)); }
.bar small { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.bar em { font-style: normal; font-size: .68rem; color: var(--text); font-weight: 600; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 9px 12px; align-items: end; }
.form-grid .wide { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label, label.lbl { font-size: .66rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; padding: 6px 9px; border-radius: 8px; min-height: 34px;
  border: 1px solid #ddd5c5; background: #fffdf8; transition: border .15s, box-shadow .15s;
}
textarea { min-height: 54px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,.2); }
input[readonly] { background: #f3efe6; }
.check { display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 6px 0; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 500; }
.check input { width: auto; accent-color: var(--gold); }
.hint { font-size: .78rem; color: var(--muted); }
.fy-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px; background: var(--gold-3); color: #7a5d14; font-weight: 600; font-size: .85rem; }
.validation-summary-errors, .alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.validation-summary-errors { background: #fdecea; color: var(--bad); border: 1px solid #f5c6c2; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.alert.ok { background: #e8f5ee; color: var(--ok); border: 1px solid #bfe3cf; }
.alert.err { background: #fdecea; color: var(--bad); border: 1px solid #f5c6c2; }
.field-validation-error { color: var(--bad); font-size: .78rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 9px;
  border: 0; cursor: pointer; text-decoration: none; font: 600 .9rem Inter; white-space: nowrap;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink);
  box-shadow: 0 6px 16px rgba(201,162,75,.3); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(201,162,75,.38); }
.btn.dark { background: var(--ink); color: var(--gold-2); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.btn.red { background: linear-gradient(135deg, #e2475f, var(--red)); color: #fff; box-shadow: 0 6px 16px rgba(200,16,46,.25); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--gold); }
.btn.sm { padding: 5px 10px; font-size: .78rem; border-radius: 8px; }
.btn.lg { padding: 11px 20px; font-size: .98rem; }
.link-btn { background: none; border: 0; color: var(--bad); cursor: pointer; font: inherit; padding: 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: #ece6d8; border-radius: 11px; margin-bottom: 10px; width: fit-content; max-width: 100%; }
.tabs a { padding: 6px 14px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--muted); }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--ink); color: var(--gold-2); box-shadow: 0 4px 12px rgba(0,0,0,.18); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fff; }
table.data th { position: sticky; top: 0; z-index: 1; background: var(--ink); color: var(--gold-2); font-weight: 600; text-align: left; padding: 8px 10px; white-space: nowrap; font-size: .78rem; letter-spacing: .3px; }
table.data td { padding: 6px 10px; border-bottom: 1px solid #f0ebe1; white-space: nowrap; vertical-align: middle; }
table.data tr:nth-child(even) td { background: #fdfbf6; }
table.data tr:hover td { background: #faf3df; }
table.data tfoot td { background: var(--gold-3) !important; font-weight: 700; border-top: 2px solid var(--gold); }
table.data .r, .r { text-align: right; }
table.data td.wrap { white-space: normal; min-width: 180px; }
.empty { text-align: center; color: var(--muted); padding: 26px !important; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .74rem; font-weight: 600; background: #efe9db; color: #6d5a2c; }
.pill.green { background: #e2f3e9; color: var(--ok); }
.pill.red { background: #fde7ea; color: var(--red); }
.pill.dark { background: var(--ink); color: var(--gold-2); }

/* ---------- line editor ---------- */
.scanbar { display: flex; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 10px; background: linear-gradient(90deg, #fbf5e4, #fff); border: 1px dashed var(--gold); margin-bottom: 14px; }
.scanbar .ic { color: var(--gold); }
.scanbar input { border-color: transparent; background: #fff; font-size: .95rem; }
table.lines td { padding: 4px 5px; }
table.lines input, table.lines select { padding: 5px 7px; border-radius: 7px; min-height: 32px; }
table.lines .num { width: 84px; text-align: right; }
table.lines .qty { width: 58px; text-align: right; }
table.lines select { min-width: 220px; }
table.lines textarea { min-height: 32px; height: 32px; min-width: 150px; font-size: .8rem; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.totals div { background: #faf6eb; border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.totals span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.totals b { font-size: 1.1rem; }
.totals .grand { background: var(--ink); border-color: var(--ink); }
.totals .grand span { color: #b5afbf; }
.totals .grand b { color: var(--gold-2); font: 700 1.45rem "Playfair Display", serif; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(0deg, var(--ivory) 70%, transparent); }
.fin-box { border: 1px solid #f0d9a0; background: #fffaf0; border-radius: 12px; padding: 14px; }

/* ==========================================================
   ONE-SCREEN LAYOUTS (no page scroll on desktop)
   ========================================================== */
.pos-page .content { height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 12px; }
.pos-page .content > * { flex: none; }
.pos-page .content > .pos, .pos-page .content > .split, .pos-page .content > .fill,
.pos-page .content > .report-scroll, .pos-page .content > .dash, .pos-page .content > .product-edit { flex: 1 1 auto; min-height: 0; }
.product-edit { overflow: auto; }
.product-edit > .card { max-width: 1180px; }
.pos-page .alert, .pos-page .validation-summary-errors { margin-bottom: 8px; padding: 8px 12px; }

/* billing / entry screens: items on the left, totals + payment on the right */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; }
.pos-main { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.pos .card { margin: 0; }
.pos-head { padding: 10px 14px; }
.pos-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pos-title h2 { margin: 0; display: flex; align-items: center; gap: 8px; font: 700 1.15rem "Playfair Display", serif; }
.pos-title h2 .ic { color: var(--gold); }
.tabs.mini { margin: 0; padding: 3px; }
.tabs.mini a { padding: 4px 12px; font-size: .8rem; }
.head-grid { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.head-grid > .field { flex: 0 1 165px; }
.head-grid > .field.grow { flex: 1 1 300px; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline select { flex: 1; min-width: 0; }
.w-search { max-width: 150px; }
.w-inv { width: 200px; }
.btn.sq { padding: 0; width: 34px; height: 34px; flex: none; }
.items-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px; }
.items-card .scanbar { margin-bottom: 8px; }
.items-card .table-wrap { flex: 1; min-height: 120px; overflow: auto; }
.pos-side { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding: 12px; }
.pos-side .totals { grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.pos-side .totals div { padding: 6px 10px; border-radius: 9px; }
.pos-side .totals span { font-size: .64rem; }
.pos-side .totals b { font-size: .95rem; }
.pos-side .totals .grand { grid-column: 1 / -1; padding: 9px 12px; }
.pos-side .totals .grand b { font-size: 1.45rem; }
.side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-grid .full { grid-column: 1 / -1; }
.side-grid.fin-box { padding: 8px; }
.side-actions { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 8px; padding-top: 6px; }

/* masters: form on the left, list on the right */
.split { display: grid; grid-template-columns: minmax(330px, 420px) minmax(0, 1fr); gap: 12px; }
.split > .card { margin: 0; min-height: 0; overflow: auto; }
.split > .card:last-child { display: flex; flex-direction: column; }
.split > .card:last-child .table-wrap { flex: 1; min-height: 0; overflow: auto; }
.split .form-grid { grid-template-columns: 1fr 1fr; }
.split .form-grid .wide, .split .form-grid .full { grid-column: 1 / -1; }
.split.wide-form { grid-template-columns: minmax(380px, 540px) minmax(0, 1fr); }
.unit-box { margin-top: 12px; padding: 10px; border: 1px dashed var(--gold); border-radius: 12px; background: #fffaf0; display: grid; gap: 8px; }
.unit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unit-head b { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.unit-loc { width: auto; max-width: 220px; }
#unitRows { display: grid; gap: 6px; }
.unit-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.unit-row input { padding: 6px 7px; font-size: .8rem; }
.unit-row input { min-width: 0; }
.fill { display: flex; flex-direction: column; margin: 0; }
.fill .table-wrap { flex: 1; min-height: 0; overflow: auto; }
.report-scroll { overflow: auto; }
.report-scroll .table-wrap { overflow: visible; margin-bottom: 10px !important; }
.report-scroll table.data th { top: 0; }

/* dashboard */
.dash { display: flex; flex-direction: column; min-height: 0; }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-top h1 { margin: 0; font: 700 1.3rem "Playfair Display", serif; }
.dash-top p { margin: 0; color: var(--muted); font-size: .82rem; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 86px; padding: 7px 4px; border-radius: 11px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: .7rem; font-weight: 600; text-align: center; line-height: 1.15; transition: .15s; }
.quick a .ic { color: var(--gold); }
.quick a:hover { background: var(--ink); color: var(--gold-2); border-color: var(--ink); transform: translateY(-1px); }
.dash-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; }
.dash-col { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.dash-col .table-wrap, .dash-col .scroll { flex: 1; min-height: 0; overflow: auto; }

/* POS machine dialog */
.pos-amount { font: 700 2rem "Playfair Display", serif; margin: 6px 0; }
.pos-spin { width: 46px; height: 46px; margin: 8px auto; border-radius: 50%; border: 4px solid #efe9db; border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* dashboard: today's sale per shop / franchise */
.loc-strip { display: flex; gap: 8px; align-items: stretch; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.loc-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .78rem; color: var(--muted); white-space: nowrap; padding-right: 4px; }
.loc { min-width: 128px; display: flex; flex-direction: column; padding: 7px 11px; border-radius: 11px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--gold); text-decoration: none; }
.loc.fr { border-top-color: var(--red); }
.loc small { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.loc b { font-size: .98rem; }
.loc:hover { box-shadow: var(--shadow); }

/* on / off switch buttons (owner panel) */
.switch { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #f3efe6; color: var(--muted); border-radius: 20px; padding: 3px 10px 3px 3px; font: 600 .75rem Inter; cursor: pointer; }
.switch i { width: 30px; height: 18px; border-radius: 10px; background: #cfc6b3; position: relative; transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: #e8f5ee; color: var(--ok); border-color: #bfe3cf; }
.switch.on i { background: #2f9a5f; }
.switch.on i::after { left: 14px; }

/* employee targets */
.tgt { padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; background: #fffdf8; }
.tgt.done { border-color: #bfe3cf; background: #f2fbf5; }
.tgt-head, .tgt-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .82rem; }
.tgt-head span, .tgt-foot span { color: var(--muted); }
.tgt-foot b { color: var(--ink); }
.tgt.done .tgt-foot b { color: var(--ok); }
.bar-track { height: 8px; border-radius: 5px; background: #efe9db; overflow: hidden; margin: 6px 0; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.tgt.done .bar-fill { background: linear-gradient(90deg, #2f9a5f, #5cc489); }

@media (max-width: 1100px) {
  .pos-page .content { height: auto; overflow: visible; }
  .pos, .split, .dash-grid { grid-template-columns: 1fr; }
  .items-card .table-wrap { max-height: 60vh; }
  .split > .card:last-child .table-wrap, .fill .table-wrap, .dash-col .table-wrap { max-height: 70vh; }
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: rgba(13,12,15,.55); padding: 16px; }
.modal.open { display: flex; }
.modal .card { width: min(640px, 100%); margin: 0; max-height: 90vh; overflow: auto; }

/* ---------- report summary ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.summary div { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 7px 11px; }
.summary span { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.summary b { display: block; font-size: 1rem; }
.report-title { font-weight: 700; margin: 10px 0 6px; display: flex; align-items: center; gap: 8px; }
.report-title::before { content: ""; width: 4px; height: 16px; background: var(--red); border-radius: 2px; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ivory); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 20% 15%, #3a2f1a, var(--ink) 55%), var(--ink); }
.login-hero::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 50px solid rgba(201,162,75,.12); }
.login-hero h1 { font: 700 2.8rem/1.1 "Playfair Display", serif; margin: 0; }
.login-hero h1 em { font-style: normal; color: var(--gold-2); }
.login-hero p { color: #c7c1cf; max-width: 420px; font-size: 1.02rem; }
.login-hero .brands { display: flex; gap: 10px; flex-wrap: wrap; }
.login-hero .brands span { padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(201,162,75,.45); color: var(--gold-2); font-size: .8rem; }
.login-box { display: grid; place-items: center; padding: 30px; }
.login-box .card { width: min(400px, 100%); padding: 32px; }
.login-box h2 { font: 700 1.6rem "Playfair Display", serif; margin: 0 0 4px; }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-hero { padding: 32px; min-height: 260px; } }

/* show / hide password */
.pw-wrap { position: relative; width: 100%; }
.pw-wrap input { padding-right: 40px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 28px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.pw-eye:hover { color: var(--ink); background: var(--gold-3); }
input::-ms-reveal { display: none; }

/* login page: never scroll sideways */
.login-body { overflow-x: hidden; }

/* login type tabs */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: #ece6d8; border-radius: 12px; margin-bottom: 18px; }
.seg { position: relative; }
.seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 600; font-size: .8rem; color: var(--muted); cursor: pointer; transition: .15s; }
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--ink); color: var(--gold-2); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.seg input:focus-visible + label { outline: 2px solid var(--gold); }
.dept-box { display: grid; gap: 8px; }
.dept-box label.check { align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; }
.dept-box small { display: block; color: var(--muted); font-weight: 400; }

/* ---------- labels (barcode) ---------- */
.label-qty { width: 80px !important; }

/* ---------- print ---------- */
@media print {
  .topbar, .sidebar, .backdrop, .no-print, .sticky-actions, .alert { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  table.data th { background: #222 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
