/* IPOS School Store. Layout: top bar with branch picker, left navigation by job, working area on the right.
   Theme "Navy and gold": navy sidebar, blue for primary/active, gold for headline actions and section headings. */
:root {
  --bg: #f5f7fb; --surface: #ffffff; --surface-2: #eaeef6; --ink: #0f1e4a; --muted: #56627a; --line: #d8deea;
  --accent: #1e3a8a; --accent-soft: #e4eaf7; --accent-ink: #ffffff; --mark: #f59e0b; --mark-soft: #fef3c7; --mark-ink: #1f1300;
  --side: #0f1e4a; --side-ink: #ffffff; --side-hover: #1a2b5e; --side-on: #1e3a8a; --side-head: #f59e0b; --side-line: #22336a;
  --good: #1d7a4c; --good-soft: #e1f2e8; --warn: #9a6200; --warn-soft: #fbefd9; --bad: #b0281f; --bad-soft: #f9e3e1;
  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141b; --surface: #151d27; --surface-2: #1c2632; --ink: #e5ebf2; --muted: #98a5b5; --line: #2a3643;
    --accent: #8fb0f5; --accent-soft: #1b2a4d; --accent-ink: #0b1430; --mark: #f5a623; --mark-soft: #3a2e14; --mark-ink: #1f1300;
    --side: #0b1638; --side-ink: #ffffff; --side-hover: #16244f; --side-on: #1e3a8a; --side-head: #f5a623; --side-line: #1c2a58;
    --good: #5cc08b; --good-soft: #163326; --warn: #e3a640; --warn-soft: #3a2c12; --bad: #ef7d74; --bad-soft: #3d1c1a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 16px; font-weight: 600; } h3 { font-size: 14px; font-weight: 600; }
a { color: var(--accent); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 100%; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border-bottom: 3px solid var(--mark); padding: 10px 16px; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: inherit; }
.logo { width: 34px; height: 34px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 12px; }
.brand b { font-family: var(--f-display); font-size: 16px; display: block; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.field-inline { display: flex; align-items: center; gap: 6px; }
.field-inline label { font-size: 12px; color: var(--muted); }
.who { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
select, input[type=text], input[type=number], input[type=date], input[type=search], input[type=password], input[type=email], input[type=tel], textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-width: 0; }
.side { background: var(--side); color: var(--side-ink); padding: 14px 10px 24px; overflow-y: auto; }
.navgroup { margin-bottom: 16px; }
.navgroup + .navgroup { border-top: 1px solid var(--side-line); padding-top: 12px; }
/* Section headings are labels, not links: gold small caps, no hover, default cursor. */
.navgroup .gl { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-head); padding: 2px 10px 6px; font-weight: 700; cursor: default; user-select: none; }
.navgroup .gl::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .35; }
.nav { display: block; border-radius: 6px; padding: 7px 10px; color: var(--side-ink); text-decoration: none; }
.nav:hover { background: var(--side-hover); color: #fff; }
.nav.on { background: var(--side-on); color: #fff; font-weight: 600; }
.side :focus-visible { outline-color: var(--side-head); }
.nav.soon { opacity: .6; }
.nav.soon::after { content: "soon"; font-size: 10.5px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--side-hover); }
main { padding: 20px 24px 48px; min-width: 0; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); max-width: 72ch; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.card > h2, .card > h3 { margin-bottom: 10px; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { color: var(--accent); font-family: var(--f-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 12px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--surface-2); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pri:hover { filter: brightness(1.12); }
.btn.gold { background: var(--mark); border-color: var(--mark); color: var(--mark-ink); font-weight: 600; }
.btn.gold:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: none; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 600; background: var(--surface-2); }
td a { text-decoration: none; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.p-good { background: var(--good-soft); color: var(--good); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-bad { background: var(--bad-soft); color: var(--bad); }
.p-info { background: var(--accent-soft); color: var(--accent); }
.p-mute { background: var(--surface-2); color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.form .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form .f > label { font-size: 12px; color: var(--muted); }
.form .f.wide { grid-column: 1 / -1; }
.form .f.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 20px; }
.field-validation-error, .validation-summary-errors { color: var(--bad); font-size: 12px; }
.validation-summary-errors ul { margin: 0 0 10px; padding-left: 18px; }
.input-validation-error { border-color: var(--bad) !important; }
.flash { border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; background: var(--good-soft); color: var(--good); font-weight: 500; }
.flash.err { background: var(--bad-soft); color: var(--bad); }
.note { background: var(--mark-soft); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; }
.pager { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 24px; }
.inline { display: inline; }
@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { padding: 8px; display: flex; gap: 4px; overflow-x: auto; }
  .navgroup, .navgroup + .navgroup { margin: 0; display: flex; gap: 2px; border-top: 0; padding-top: 0; }
  .navgroup .gl { display: none; }
  .nav { white-space: nowrap; }
  main { padding: 16px; }
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .brand span { display: none; }
}
@media print { .top, .side { display: none; } .app { display: block; } }

/* Point of sale */
kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); color: var(--ink); }
.keys { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.pos-side { display: grid; gap: 14px; }
.pos-scan { position: relative; margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.pos-scan input { font-size: 18px; padding: 10px 12px; }
.pos-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 3; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgb(0 0 0 / .12); max-height: 320px; overflow-y: auto; }
.pos-results.static { position: static; box-shadow: none; margin-top: 6px; max-height: 260px; }
.pos-results:empty { display: none; }
.pos-results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; }
.pos-results button:hover, .pos-results button:focus-visible { background: var(--accent-soft); }
.pos-results .tag { font-size: 11px; color: var(--muted); }
.pos-results .msg { padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
#cart input { width: 70px; text-align: right; padding: 4px 6px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 4px; cursor: pointer; font-size: 12.5px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
#cust-q { width: 100%; }
.chosen { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; }
.totals { display: grid; gap: 6px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.totals input { width: 110px; text-align: right; }
.totals .grand { font-size: 20px; font-family: var(--f-display); border-top: 1px solid var(--line); padding-top: 6px; }
.pays { display: grid; gap: 6px; margin: 6px 0 10px; }
.pay { display: grid; grid-template-columns: 1fr 100px; gap: 4px 8px; align-items: center; }
.pay .ref { grid-column: 1 / -1; }
.pay .amt { text-align: right; }
.btn.big { padding: 10px 16px; font-size: 15px; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr); } }

/* Reports */
.replink { text-decoration: none; color: inherit; display: block; }
.replink:hover { border-color: var(--accent); }
.replink p { margin: 4px 0 0; }
@media print { .noprint, .flash { display: none !important; } main { padding: 0; } .tablewrap { overflow: visible; border: 0; } th, td { padding: 4px 6px; } }

/* Logo and counts */
.logo-img { height: 34px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.logo-preview { max-height: 80px; max-width: 240px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.nav .count { float: right; min-width: 20px; text-align: center; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 0 6px; background: var(--mark); color: var(--mark-ink); }

/* Parent shop */
.shop-top { display: flex; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.shop-main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }
.shop-msg { max-width: 640px; margin: 0 auto; display: grid; gap: 10px; }
.shop-msg h1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shop-branches { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.shop-branch { text-decoration: none; color: inherit; display: grid; gap: 4px; }
.shop-branch span { color: var(--accent); font-size: 13px; }
.shop-branch:hover { border-color: var(--accent); }
.shop-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.shop-side { position: sticky; top: 12px; }
.shop-filter { display: flex; gap: 8px; margin-bottom: 12px; }
.shop-filter input { flex: 1; min-width: 0; }
.shop-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.shop-product { display: grid; gap: 6px; align-content: start; }
.shop-product .price { font-family: var(--f-display); font-weight: 600; }
.shop-product select { flex: 1; min-width: 0; }
.shop-cart { display: grid; gap: 8px; margin-bottom: 10px; }
.shop-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.shop-qty { display: flex; align-items: center; gap: 6px; }
.shop-qty span { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.shop-pay { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.shop-pay label.row { gap: 6px; flex-wrap: nowrap; }
@media (max-width: 860px) { .shop-grid { grid-template-columns: minmax(0, 1fr); } .shop-side { position: static; } }

/* Barcode labels */
.labels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 14px; align-items: start; }
.labels-main { display: grid; gap: 14px; min-width: 0; }
.labels-side { position: sticky; top: 70px; }
.labels-side iframe { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 6px; background: #e3e7ed; display: block; }
.labels .copies { width: 80px; text-align: right; padding: 4px 6px; }
.lset { display: grid; gap: 12px; }
.lset fieldset { border: 0; border-top: 1px solid var(--line); padding: 10px 0 0; margin: 0; min-width: 0; }
.lset fieldset:first-child { border-top: 0; padding-top: 0; }
.lset legend { font-weight: 600; font-size: 13px; padding: 0 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: flex; gap: 6px; align-items: center; }
@media (max-width: 1100px) { .labels { grid-template-columns: minmax(0, 1fr); } .labels-side { position: static; } }

/* Dashboard */
.hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, var(--side) 0%, var(--side-on) 100%); color: #fff; border-radius: 12px; padding: 22px 24px; margin-bottom: 16px; box-shadow: 0 8px 24px rgb(15 30 74 / .18); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid var(--mark); opacity: .12; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mark); margin-bottom: 6px; }
.hero h1 { font-size: 26px; color: #fff; }
.hero p { margin: 4px 0 0; color: #c9d4ef; }
.btn.btn-onnavy { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .35); color: #fff; }
.btn.btn-onnavy:hover { background: rgb(255 255 255 / .16); }
.kpi-x { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; border-top: 3px solid var(--accent); box-shadow: 0 1px 2px rgb(15 30 74 / .05); transition: box-shadow .15s, transform .15s; }
a.kpi-x:hover { box-shadow: 0 6px 18px rgb(15 30 74 / .12); transform: translateY(-1px); }
.kpi-x .ico { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-x .ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kpi-x.gold-ico { border-top-color: var(--mark); }
.kpi-x.gold-ico .ico { background: var(--mark-soft); color: #b45309; }
.kpi-x .l { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.kpi-x .v { font-size: 26px; line-height: 1.15; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.quick a { display: grid; gap: 2px; padding: 12px 14px 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--mark); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.quick a:hover { border-color: var(--accent); border-left-color: var(--mark); background: var(--accent-soft); }
.quick b { font-family: var(--f-display); font-weight: 600; }
.quick span { font-size: 12px; color: var(--muted); }
.panel { padding: 0; overflow: hidden; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(var(--surface), var(--surface-2)); }
.panel-h h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-h h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--mark); }
.panel > .tablewrap { border: 0; border-radius: 0; }
.panel .empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); }
@media (prefers-color-scheme: dark) { .kpi-x.gold-ico .ico { color: var(--mark); } }
