/* Kitchen Costing – Lightning-style theme
   Tokens follow Salesforce Lightning Design System values. */
:root {
  --brand: #0176d3;
  --brand-dark: #014486;
  --brand-light: #eef4ff;
  --navy: #032d60;
  --navy-2: #0b3d73;
  --text: #181818;
  --text-weak: #444444;
  --text-label: #3e3e3c;
  --muted: #747474;
  --border: #e5e5e5;
  --border-input: #c9c9c9;
  --bg: #f3f3f3;
  --bg-alt: #fafaf9;
  --success: #2e844a;
  --success-bg: #cdefc4;
  --warning: #a96404;
  --warning-bg: #fef1d4;
  --error: #ba0517;
  --error-bg: #fddde3;
  --info-bg: #eef4ff;
  --radius: .25rem;
  --shadow: 0 2px 2px 0 rgba(0, 0, 0, .10);
  --shadow-drop: 0 2px 3px 0 rgba(0, 0, 0, .16);
  --font: "Salesforce Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-ar: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: .8125rem; line-height: 1.5;
  color: var(--text); background: var(--bg);
}
html[dir="rtl"] body { font-family: var(--font-ar); font-size: .84rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
svg.ic { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
         stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.num, td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; }
.hidden { display: none !important; }

/* ------------------------------------------------ global header */
.gh {
  height: 3.125rem; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 1rem; gap: 1rem; position: relative; z-index: 30;
}
.gh-brand { display: flex; align-items: center; gap: .625rem; color: var(--text); min-width: 15rem; }
.gh-brand:hover { text-decoration: none; color: var(--text); }
.gh-logo {
  width: 2rem; height: 2rem; border-radius: var(--radius); background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.gh-title { font-size: 1rem; font-weight: 700; line-height: 1.1; }
.gh-sub { font-size: .7rem; color: var(--muted); }
.gh-search { flex: 1; max-width: 36rem; margin: 0 auto; position: relative; }
.gh-search input {
  width: 100%; height: 2rem; border: 1px solid var(--border-input); border-radius: var(--radius);
  padding-inline: 2rem .75rem; font: inherit; background: #fff;
}
.gh-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 3px #0176d3; }
.gh-search .ic { position: absolute; inset-inline-start: .6rem; top: .5rem; color: var(--muted); }
.gh-tools { display: flex; align-items: center; gap: .375rem; margin-inline-start: auto; }
.gh-btn {
  height: 2rem; padding: 0 .625rem; border-radius: var(--radius); border: 1px solid transparent;
  background: transparent; color: var(--text-weak); display: inline-flex; align-items: center; gap: .375rem;
  font: inherit; cursor: pointer;
}
.gh-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.avatar {
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .75rem; text-transform: uppercase;
}
.user-menu { position: relative; }
.user-menu .dd { inset-inline-end: 0; inset-inline-start: auto; min-width: 14rem; top: 2.5rem; }
.user-menu:focus-within .dd, .user-menu:hover .dd { display: block; }
.user-card { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }

/* ------------------------------------------------ top menu (NetSuite style) */
.topnav {
  background: var(--navy); height: 2.5rem; display: flex; align-items: stretch; padding: 0 .5rem;
  position: sticky; top: 0; z-index: 25; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.topnav > .mi { position: relative; display: flex; }
.topnav > .mi > a, .topnav > .mi > button {
  display: flex; align-items: center; gap: .375rem; padding: 0 .875rem; color: #fff; font: inherit;
  font-weight: 600; background: none; border: 0; cursor: pointer; border-bottom: 3px solid transparent;
  border-top: 3px solid transparent; white-space: nowrap;
}
.topnav > .mi > a:hover, .topnav > .mi:hover > a, .topnav > .mi:hover > button,
.topnav > .mi:focus-within > button { background: var(--navy-2); text-decoration: none; }
.topnav > .mi.on > a, .topnav > .mi.on > button { border-bottom-color: #1b96ff; }
.topnav .caret { width: .7rem; height: .7rem; opacity: .75; }
.dd {
  display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 17rem; background: #fff;
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-drop);
  padding: .25rem 0 .5rem;
}
.topnav > .mi:hover > .dd, .topnav > .mi:focus-within > .dd { display: block; }
.dd-group { padding: .5rem 1rem .25rem; font-size: .6875rem; font-weight: 700; color: var(--muted);
            text-transform: uppercase; letter-spacing: .04em; }
html[dir="rtl"] .dd-group { text-transform: none; letter-spacing: 0; }
.dd-row { display: flex; align-items: center; }
.dd-row > a:first-child {
  flex: 1; padding: .375rem 1rem; color: var(--text); display: flex; align-items: center; gap: .5rem;
}
.dd-row:hover { background: var(--bg); }
.dd-row > a:first-child:hover { text-decoration: none; color: var(--brand); }
.dd-row .dd-new { padding: .2rem .5rem; margin-inline-end: .75rem; font-size: .7rem; border-radius: var(--radius);
                  color: var(--brand); border: 1px solid transparent; }
.dd-row .dd-new:hover { border-color: var(--border-input); background: #fff; text-decoration: none; }
.dd hr { border: 0; border-top: 1px solid var(--border); margin: .375rem 0; }

/* ------------------------------------------------ page */
.page { padding: .75rem; max-width: 100rem; margin: 0 auto; }
.grid { display: grid; gap: .75rem; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g-main, .g-3, .g-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .g-main, .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .gh-brand { min-width: 0; } .gh-sub, .gh-title { display: none; } .topnav { overflow-x: auto; } }

/* page header (record / object home) */
.ph { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
      padding: 1rem; margin-bottom: .75rem; }
.ph-top { display: flex; align-items: flex-start; gap: .75rem; }
.ph-icon { width: 2.25rem; height: 2.25rem; border-radius: var(--radius); display: grid; place-items: center;
           color: #fff; flex: none; }
.ph-icon .ic { width: 1.25rem; height: 1.25rem; }
.ph-obj { font-size: .75rem; color: var(--text-weak); line-height: 1.25; }
.ph-title { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.ph-actions { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.hl { display: flex; flex-wrap: wrap; gap: 0 2.5rem; margin-top: .875rem; padding-top: .75rem;
      border-top: 1px solid var(--border); }
.hl > div { min-width: 7rem; }
.hl dt { font-size: .75rem; color: var(--text-weak); }
.hl dd { margin: 0; font-size: .875rem; }
.i-order { background: #ff9a3c; } .i-mat { background: #3ba755; } .i-prod { background: #b781d3; }
.i-lab { background: #7f8de1; } .i-cust { background: #5867e8; } .i-set { background: #747474; }
.i-rpt { background: #2ecbbe; } .i-home { background: var(--brand); } .i-user { background: #3c97dd; }

/* path (status chevrons) */
.path { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow); padding: .625rem .75rem; margin-bottom: .75rem; }
.path-steps { display: flex; flex: 1; min-width: 0; }
.path-step {
  flex: 1; position: relative; height: 2rem; display: flex; align-items: center; justify-content: center;
  background: #ecebea; color: var(--text); font-weight: 400; border: 0; font: inherit; cursor: pointer;
  margin-inline-end: .375rem; padding: 0 1rem;
  clip-path: polygon(0 0, calc(100% - .75rem) 0, 100% 50%, calc(100% - .75rem) 100%, 0 100%, .75rem 50%);
}
.path-step:first-child { border-radius: 1rem 0 0 1rem;
  clip-path: polygon(0 0, calc(100% - .75rem) 0, 100% 50%, calc(100% - .75rem) 100%, 0 100%); }
.path-step:last-child { border-radius: 0 1rem 1rem 0; margin-inline-end: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, .75rem 50%); }
html[dir="rtl"] .path-step { transform: scaleX(-1); }
html[dir="rtl"] .path-step span { transform: scaleX(-1); display: inline-block; }
.path-step:hover { background: #dddbda; }
.path-step.done { background: #3ba755; color: #fff; }
.path-step.done:hover { background: #2e844a; }
.path-step.cur { background: var(--navy); color: #fff; font-weight: 700; }
.path-step.cancel.cur { background: var(--error); }
.path-step:disabled { cursor: default; }

/* cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: .75rem; }
.card-h { display: flex; align-items: center; gap: .625rem; padding: .75rem 1rem; }
.card-h h2 { font-size: .875rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.card-h .ci { width: 1.5rem; height: 1.5rem; border-radius: var(--radius); display: grid; place-items: center; color: #fff; }
.card-h .ci .ic { width: .875rem; height: .875rem; }
.card-h .tools { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }
.card-b { padding: 0 1rem 1rem; }
.card-b.flush { padding: 0; }
.card-f { border-top: 1px solid var(--border); padding: .625rem 1rem; text-align: center; }
.section-title { background: var(--bg); border-radius: var(--radius); padding: .375rem .75rem; font-size: .875rem;
                 font-weight: 400; margin: .5rem 0 .75rem; }

/* tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 1rem; gap: .25rem; overflow-x: auto; }
.tabs a { padding: .75rem .75rem; color: var(--text); border-bottom: 3px solid transparent; margin-bottom: -1px;
          white-space: nowrap; display: flex; gap: .375rem; align-items: center; }
.tabs a:hover { text-decoration: none; border-bottom-color: #c9c9c9; }
.tabs a.on { border-bottom-color: var(--brand); font-weight: 700; }
.tabs .cnt { background: var(--bg); border-radius: 1rem; padding: 0 .4rem; font-size: .7rem; font-weight: 400; }
.tab-b { padding: 1rem; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem; height: 2rem;
  padding: 0 1rem; border-radius: var(--radius); border: 1px solid var(--border-input); background: #fff;
  color: var(--brand); font: inherit; font-weight: 400; cursor: pointer; white-space: nowrap; line-height: 1;
}
.btn:hover { background: var(--bg); text-decoration: none; color: var(--brand-dark); }
.btn:focus-visible { outline: none; box-shadow: 0 0 3px #0176d3; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: var(--error); }
.btn-danger:hover { color: #8e030f; background: #fef1f1; }
.btn-sm { height: 1.5rem; padding: 0 .5rem; font-size: .75rem; }
.btn-icon { width: 2rem; padding: 0; }
.btn-sm.btn-icon { width: 1.5rem; }
.btn-group { display: inline-flex; }
.btn-group > .btn, .btn-group > form > .btn { border-radius: 0; margin-inline-start: -1px; }
.btn-group > :first-child, .btn-group > form:first-child > .btn { border-start-start-radius: var(--radius);
  border-end-start-radius: var(--radius); margin-inline-start: 0; }
.btn-group > :last-child, .btn-group > form:last-child > .btn { border-start-end-radius: var(--radius);
  border-end-end-radius: var(--radius); }
form.inline { display: inline; }

/* list view header */
.lv-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem 1rem .75rem; flex-wrap: wrap; }
.lv-meta { font-size: .75rem; color: var(--text-weak); }
.lv-bar .grow { flex: 1; }
.lv-search { position: relative; }
.lv-search input { height: 2rem; padding-inline-start: 1.875rem; width: 15rem; }
.lv-search .ic { position: absolute; inset-inline-start: .55rem; top: .5rem; color: var(--muted); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th {
  background: var(--bg-alt); color: var(--text-weak); font-weight: 700; font-size: .75rem; text-align: start;
  padding: .5rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover td { background: #f3f3f3; }
.tbl th:first-child, .tbl td:first-child { padding-inline-start: 1rem; }
.tbl th:last-child, .tbl td:last-child { padding-inline-end: 1rem; }
.tbl tfoot td { font-weight: 700; background: var(--bg-alt); border-bottom: 0; }
.tbl tr.total td { font-weight: 700; background: var(--brand-light); }
.tbl tr.sub td { background: var(--bg-alt); font-weight: 700; color: var(--text-weak); }
.tbl .rn { color: var(--muted); width: 2.5rem; }
.tbl-compact td, .tbl-compact th { padding-top: .3rem; padding-bottom: .3rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty .ic { width: 2rem; height: 2rem; display: block; margin: 0 auto .5rem; color: #c9c9c9; }

/* grid entry table */
.entry td { padding: .25rem .35rem; }
.entry input, .entry select { height: 1.875rem; }
.entry input.n { width: 5.25rem; text-align: end; }
.entry select { min-width: 15rem; }
.entry .calc { color: var(--text-weak); }

/* forms */
.fg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.5rem; }
.fg.g1 { grid-template-columns: 1fr; }
.fg.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .fg, .fg.g3 { grid-template-columns: 1fr; } }
.fe label, .lbl { display: block; font-size: .75rem; color: var(--text-label); margin-bottom: .125rem; }
.fe .req { color: var(--error); margin-inline-end: .125rem; }
.fe .help { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.fe.span2 { grid-column: 1 / -1; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=email], input[type=search],
select, textarea {
  width: 100%; height: 2rem; border: 1px solid var(--border-input); border-radius: var(--radius); padding: 0 .75rem;
  font: inherit; color: var(--text); background: #fff;
}
textarea { height: auto; min-height: 4.5rem; padding: .5rem .75rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 3px #0176d3; }
input[readonly] { background: var(--bg); }
input.mono, textarea.mono, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .78rem; }
input.mono { direction: ltr; }
.chk { display: flex; align-items: center; gap: .5rem; height: 2rem; }
.chk input { width: 1rem; height: 1rem; accent-color: var(--brand); }
.form-foot { display: flex; justify-content: center; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border);
             background: var(--bg-alt); position: sticky; bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.ro dt { font-size: .75rem; color: var(--text-weak); }
.ro dd { margin: 0 0 .1rem; padding: .25rem 0 .375rem; border-bottom: 1px solid var(--border); min-height: 1.9rem; }

/* badges */
.badge { display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: 1rem; font-size: .72rem;
         font-weight: 700; background: #ecebea; color: var(--text); white-space: nowrap; }
.b-draft { background: #ecebea; color: #3e3e3c; }
.b-approved { background: #d8e6fe; color: #014486; }
.b-in_production { background: var(--warning-bg); color: var(--warning); }
.b-completed { background: var(--success-bg); color: #194e31; }
.b-cancelled { background: var(--error-bg); color: #8e030f; }
.b-on { background: var(--success-bg); color: #194e31; }
.b-off { background: #ecebea; color: var(--muted); }

/* alerts / toasts */
.toasts { position: fixed; top: 6rem; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: .5rem;
          width: min(36rem, 92vw); }
.toast { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: var(--radius);
         color: #fff; box-shadow: var(--shadow-drop); background: #444; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast button { margin-inline-start: auto; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1rem; }
.alert { display: flex; gap: .625rem; align-items: center; padding: .5rem 1rem; border-radius: var(--radius);
         margin-bottom: .75rem; font-size: .8rem; }
.alert.info { background: var(--info-bg); color: var(--brand-dark); border: 1px solid #d8e6fe; }
.alert.warn { background: var(--warning-bg); color: #6b4002; border: 1px solid #fcdca5; }

/* KPI tiles */
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
       padding: .875rem 1rem; }
.kpi .k-lbl { font-size: .75rem; color: var(--text-weak); }
.kpi .k-val { font-size: 1.5rem; font-weight: 300; margin-top: .125rem; line-height: 1.2; }
.kpi .k-sub { font-size: .72rem; color: var(--muted); margin-top: .25rem; }

/* summary rows */
.sum { width: 100%; border-collapse: collapse; }
.sum td { padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.sum td:last-child { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sum tr.major td { font-weight: 700; border-bottom: 1px solid var(--text); font-size: .875rem; }
.sum tr.hero td { font-weight: 700; font-size: 1rem; color: var(--brand-dark); border-bottom: 0; padding-top: .7rem; }
.sum .hint { display: block; font-size: .7rem; color: var(--muted); }

/* bars */
.bar { height: .5rem; background: #ecebea; border-radius: 1rem; overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }
.c-mat { background: #0176d3; } .c-lab { background: #ff9a3c; } .c-oh { background: #7f8de1; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; font-size: .75rem; color: var(--text-weak); }
.legend i { display: inline-block; width: .625rem; height: .625rem; border-radius: 2px; margin-inline-end: .3rem; }
.hbar { display: grid; grid-template-columns: 8rem 1fr 6rem; gap: .5rem; align-items: center; padding: .3rem 0; }
.hbar .track { height: .75rem; background: #f3f3f3; border-radius: 2px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 1rem; }
.login-box { width: 100%; max-width: 23rem; }
.login-logo { text-align: center; margin-bottom: 1.25rem; }
.login-logo .gh-logo { width: 3rem; height: 3rem; margin: 0 auto .75rem; font-size: 1.1rem; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.login-card .fe { margin-bottom: 1rem; }
.login-card .btn { width: 100%; height: 2.5rem; }
.login-foot { text-align: center; margin-top: 1rem; font-size: .75rem; color: var(--muted); }

/* formula help */
.fn-help { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem;
           font-size: .75rem; }
.fn-help code { background: #fff; border: 1px solid var(--border); border-radius: 3px; padding: 0 .25rem; direction: ltr;
                unicode-bidi: isolate; }
.fn-help ul { margin: .25rem 0 0; padding-inline-start: 1.1rem; }
.code-chip { font-family: Consolas, Menlo, monospace; font-size: .72rem; color: var(--text-weak); background: var(--bg);
             padding: .05rem .35rem; border-radius: 3px; direction: ltr; unicode-bidi: isolate; }

/* print */
@media print {
  .gh, .topnav, .no-print, .toasts { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
}

/* specificity fixes */
.gh-search input[type=search] { padding-inline: 2rem .75rem; }
.lv-search input[type=search] { padding-inline-start: 1.875rem; }
.tbl th.num { text-align: end; }
.sum .legend { display: inline-flex; vertical-align: middle; }

/* ---------- v2 additions ---------- */
.pager { display: flex; align-items: center; gap: .75rem; padding: .625rem 1rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .grow { flex: 1; }
.pager select { width: auto; height: 1.5rem; padding: 0 .4rem; margin-inline-start: .25rem; }
.pager .btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .btn.disabled { pointer-events: none; color: #c9c9c9; }
.b-closed { background: #e0e5ee; color: var(--navy); }
.b-posted { background: #d8e6fe; color: #014486; }
.b-paid, .b-received { background: var(--success-bg); color: #194e31; }
.b-partial { background: var(--warning-bg); color: var(--warning); }
a.path-step { text-decoration: none; color: inherit; }
a.path-step:hover { text-decoration: none; }
.kpi-link { display: block; color: inherit; transition: box-shadow .12s, border-color .12s; }
.kpi-link:hover { text-decoration: none; color: inherit; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.kpi .k-val.neg { color: var(--error); }
.chips { display: flex; gap: .375rem; flex-wrap: wrap; }
.chip { padding: .25rem .75rem; border: 1px solid var(--border-input); border-radius: 1rem; background: #fff; color: var(--text); font-size: .75rem; }
.chip:hover { text-decoration: none; background: var(--bg); color: var(--text); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chart svg { width: 100%; height: auto; display: block; }
.chart a rect:hover { opacity: .8; }
.chart text { font-size: 10px; fill: var(--text-weak); font-family: inherit; }
.todo { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.todo:hover { text-decoration: none; color: var(--brand); }
.todo .n { margin-inline-start: auto; min-width: 2rem; text-align: center; font-weight: 700; background: var(--bg); border-radius: 1rem; padding: 0 .5rem; }
.todo .n.hot { background: var(--warning-bg); color: var(--warning); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .75rem; }
.perm-box { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; }
.perm-box h4 { font-size: .8rem; margin: 0 0 .25rem; }
.perm-box .chk { height: 1.6rem; font-size: .78rem; }
.inv-watermark { position: fixed; top: 40%; left: 0; right: 0; text-align: center; font-size: 6rem; font-weight: 700;
                 color: rgba(186, 5, 23, .08); transform: rotate(-20deg); pointer-events: none; z-index: 0; }
.att-drop { display: flex; align-items: center; justify-content: center; gap: .5rem; border: 1px dashed var(--border-input);
            border-radius: var(--radius); padding: .75rem; color: var(--brand); cursor: pointer; background: var(--bg-alt); }
.att-drop:hover { border-color: var(--brand); background: var(--brand-light); }
.att-drop input { display: none; }
.att-names { margin-top: .35rem; word-break: break-all; }
/* two-column mega dropdown (accounting) */
.topnav > .mi:hover > .dd[style*="grid-template-columns"], .topnav > .mi:focus-within > .dd[style*="grid-template-columns"] { display: grid !important; }
.print-only { display: none; }
@media print { .print-only { display: block; } .card { box-shadow: none; border: 0; } .ph { box-shadow: none; } }
.acc-tree td.indent-1 { padding-inline-start: 2rem !important; } .acc-tree td.indent-2 { padding-inline-start: 3rem !important; }
.acc-tree td.indent-3 { padding-inline-start: 4rem !important; }
.acc-tree tr.grp td { font-weight: 700; background: var(--bg-alt); }
.dr-cr-diff { font-weight: 700; } .dr-cr-diff.bad { color: var(--error); } .dr-cr-diff.ok { color: var(--success); }
/* chart of accounts tree / arrange */
.acc-tree .tw { border: 0; background: none; padding: 0; width: 1.25rem; height: 1.25rem; cursor: pointer; color: var(--text-weak);
                vertical-align: middle; border-radius: 3px; }
.acc-tree .tw:hover { background: var(--bg); }
.acc-tree .tw[disabled] { visibility: hidden; }
.acc-tree .tw .ic { width: .8rem; height: .8rem; transition: transform .12s; }
.acc-tree tr.closed .tw .ic { transform: rotate(-90deg); }
html[dir="rtl"] .acc-tree tr.closed .tw .ic { transform: rotate(90deg); }
.acc-tree .tw-sp { display: inline-block; width: 1.25rem; }
.acc-tree.arranging tbody tr { cursor: grab; }
.acc-tree .drag-handle { color: var(--muted); letter-spacing: -2px; text-align: center; cursor: grab; user-select: none; }
.acc-tree tr.dragging td { opacity: .4; }
.acc-tree tr.drop-before td { box-shadow: inset 0 2px 0 var(--brand); }
.acc-tree tr.drop-after td { box-shadow: inset 0 -2px 0 var(--brand); }
.acc-tree tr.drop-into td { background: var(--brand-light) !important; box-shadow: inset 0 0 0 1px var(--brand); }
/* item photo & specification */
.item-thumb { display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt);
              overflow: hidden; vertical-align: middle; color: #c9c9c9; flex: none; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.item-thumb .ic { width: 55%; height: 55%; }
.item-spec.is-sticky { position: sticky; top: 3.25rem; }
.spec-photo { position: relative; margin: 0 1rem; aspect-ratio: 4 / 3; border: 1px solid var(--border); border-radius: var(--radius);
              background: repeating-conic-gradient(#f6f6f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; overflow: hidden; }
.spec-photo img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.spec-photo .zoom-hint { position: absolute; bottom: .4rem; inset-inline-end: .4rem; background: rgba(3, 45, 96, .75); color: #fff;
                         font-size: .68rem; padding: .1rem .45rem; border-radius: 1rem; pointer-events: none; }
.spec-photo .no-photo { display: grid; place-items: center; gap: .25rem; color: var(--muted); font-size: .75rem; }
.spec-photo .no-photo .ic { width: 2.5rem; height: 2.5rem; color: #c9c9c9; }
.photo-form { padding-top: .75rem; }
.photo-actions { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
.photo-actions .small { flex: 1; word-break: break-all; }
.spec-list { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; margin: 0; font-size: .8rem; }
.spec-list dt { color: var(--text-weak); }
.spec-list dd { margin: 0; text-align: end; }
.spec-notes { margin-top: .75rem; padding: .5rem .75rem; background: var(--bg-alt); border-radius: var(--radius); font-size: .78rem; white-space: pre-line; }
.lightbox { position: fixed; inset: 0; background: rgba(8, 16, 30, .86); z-index: 100; display: grid; place-items: center; padding: 2rem; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); background: #fff; }
.lightbox .cap { color: #fff; margin-top: .75rem; font-size: .85rem; text-align: center; }
.lightbox .x { position: absolute; top: 1rem; inset-inline-end: 1.25rem; color: #fff; font-size: 1.75rem; background: none; border: 0; cursor: pointer; }

/* ---------- v4 ---------- */
.print-head { display: none; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; border-bottom: 2px solid var(--navy);
              padding-bottom: .5rem; margin-bottom: .75rem; }
@media print { .print-head { display: grid; } }
.ph-logo img, .doc-logo { max-height: 64px; max-width: 200px; object-fit: contain; display: block; margin: 0 auto; }
/* workspace tabs */
.wtabs { display: flex; align-items: stretch; gap: 2px; background: #eef1f6; border-bottom: 1px solid var(--border); padding: .25rem .5rem 0;
         overflow-x: auto; scrollbar-width: thin; }
.wtabs .wt-back { border: 0; background: none; padding: 0 .6rem; color: var(--text-weak); cursor: pointer; border-radius: var(--radius) var(--radius) 0 0;
                  display: flex; align-items: center; gap: .25rem; font: inherit; }
.wtabs .wt-back:hover { background: #fff; color: var(--brand); }
html[dir="rtl"] .wtabs .wt-back .ic { transform: scaleX(-1); }
.wtab { display: flex; align-items: center; gap: .35rem; max-width: 14rem; padding: .35rem .5rem .35rem .75rem; background: #dfe4ec;
        border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; color: var(--text-weak); font-size: .75rem;
        white-space: nowrap; }
.wtab a { color: inherit; overflow: hidden; text-overflow: ellipsis; }
.wtab a:hover { text-decoration: none; color: var(--brand); }
.wtab.on { background: #fff; color: var(--text); font-weight: 700; box-shadow: inset 0 2px 0 var(--brand); }
.wtab .wt-x { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 .15rem; line-height: 1; font-size: .95rem; border-radius: 3px; }
.wtab .wt-x:hover { background: var(--bg); color: var(--error); }
/* header bell */
.gh-badge { position: absolute; top: -.2rem; inset-inline-end: -.2rem; background: var(--error); color: #fff; border-radius: 1rem; font-size: .6rem;
            min-width: 1rem; height: 1rem; display: grid; place-items: center; padding: 0 .2rem; font-weight: 700; }
.gh-iconbtn { position: relative; }
.notif-dd { position: absolute; top: 2.6rem; inset-inline-end: 0; width: 22rem; display: none; background: #fff; border: 1px solid var(--border);
            border-radius: var(--radius); box-shadow: var(--shadow-drop); z-index: 40; }
.notif-wrap:focus-within .notif-dd, .notif-wrap:hover .notif-dd { display: block; }
.notif-dd a.n { display: block; padding: .5rem .75rem; border-bottom: 1px solid var(--border); color: var(--text); font-size: .78rem; }
.notif-dd a.n.unread { background: var(--brand-light); }
.notif-dd a.n:hover { text-decoration: none; background: var(--bg); }
/* chatter */
.chatter .chat-form textarea { width: 100%; padding: .5rem; }
.chat-tools { display: flex; justify-content: space-between; align-items: center; margin-top: .35rem; }
.chat-list { max-height: 26rem; overflow-y: auto; display: grid; gap: .75rem; }
.msg { display: flex; gap: .6rem; }
.avatar.sm { width: 1.75rem; height: 1.75rem; font-size: .62rem; flex: none; }
.msg-b { white-space: pre-wrap; font-size: .8rem; margin-top: .1rem; }
.msg-note .msg-b { background: #fff8e6; border-radius: var(--radius); padding: .3rem .5rem; }
.msg-log .msg-b { color: var(--text-weak); font-style: italic; }
/* approval banner */
.wf-banner { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: .75rem 1rem; margin-bottom: .75rem; box-shadow: var(--shadow); }
.wf-banner.wf-pending { border-inline-start: 4px solid var(--warning); }
.wf-banner.wf-approved { border-inline-start: 4px solid var(--success); }
.wf-banner.wf-rejected { border-inline-start: 4px solid var(--error); }
.wf-head { display: flex; gap: .5rem; align-items: center; }
.wf-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: .5rem 0; flex-wrap: wrap; }
.wf-steps li { border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem .6rem; font-size: .75rem; display: grid; }
.wf-steps li.cur { border-color: var(--warning); background: var(--warning-bg); }
.wf-steps li.st-approved { border-color: #91db8b; background: var(--success-bg); }
.wf-steps li.st-rejected { border-color: #f9b9c3; background: var(--error-bg); }
.wf-steps em { font-style: normal; color: var(--text-weak); }
.wf-act { display: flex; gap: .5rem; align-items: center; }
.wf-act input { max-width: 24rem; }
/* items grid (icon view) */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .75rem; padding: 0 1rem 1rem; }
.item-tile { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); display: flex; flex-direction: column;
             overflow: hidden; transition: box-shadow .12s, border-color .12s; }
.item-tile:hover { text-decoration: none; color: var(--text); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.item-tile .pic { aspect-ratio: 4 / 3; background: var(--bg-alt); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.item-tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.item-tile .pic .ic { width: 2.5rem; height: 2.5rem; color: #c9c9c9; }
.item-tile .body { padding: .5rem .6rem; display: grid; gap: .15rem; font-size: .78rem; }
.item-tile .nm { font-weight: 700; font-size: .82rem; line-height: 1.25; }
.item-tile .row { display: flex; justify-content: space-between; color: var(--text-weak); }
.stock-flag { font-size: .65rem; font-weight: 700; border-radius: 1rem; padding: 0 .4rem; }
.stock-flag.low { background: var(--error-bg); color: #8e030f; } .stock-flag.over { background: var(--warning-bg); color: var(--warning); }
.stock-flag.ok { background: var(--success-bg); color: #194e31; }
.view-toggle .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.online-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #c9c9c9; margin-inline-end: .35rem; }
.online-dot.on { background: #2e844a; box-shadow: 0 0 0 3px #cdefc4; }
.line-type { width: 6.5rem; }

/* ---------------- v5: quotation steps ---------------- */
.q-steps { display: flex; list-style: none; margin: 0 0 1rem; padding: 0; gap: 0; }
.q-steps li { flex: 1; text-align: center; padding: .45rem .5rem; background: #fff; border: 1px solid var(--border); font-size: .75rem;
              color: var(--muted); position: relative; }
.q-steps li + li { border-inline-start: 0; }
.q-steps li.done { background: var(--brand-light); color: var(--brand-dark); }
.q-steps li.cur { background: var(--brand); color: #fff; font-weight: 700; border-color: var(--brand); }

/* ---------------- v5: point of sale (same theme: navy bar, brand blue, Salesforce cards) ---------------- */
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1rem; }
.pos-card .card-b { display: grid; gap: .5rem; }
.pos-card .st { display: flex; align-items: center; gap: .4rem; font-weight: 700; }
body.pos { height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.pos-top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; height: 3.25rem; flex: none; }
.pos-top .brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.pos-top .brand small { font-weight: 400; opacity: .75; }
.pos-top .pbtn { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: var(--radius); height: 2.1rem;
                 padding: 0 .75rem; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.pos-top .pbtn:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.pos-top .ic { width: 1rem; height: 1rem; }
.pos-otabs { display: flex; gap: .25rem; overflow-x: auto; flex: 1; padding: 0 .5rem; }
.pos-otabs button { background: rgba(255,255,255,.1); border: 0; color: #fff; border-radius: var(--radius); height: 2.1rem; min-width: 2.6rem;
                    padding: 0 .6rem; cursor: pointer; font: inherit; white-space: nowrap; }
.pos-otabs button.on { background: #fff; color: var(--navy); font-weight: 700; }
.pos-main { flex: 1; display: grid; grid-template-columns: minmax(22rem, 34%) 1fr; min-height: 0; }
.pos-left { background: #fff; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.pos-cust { padding: .5rem .75rem; border-bottom: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; }
.pos-cust .btn { flex: 1; justify-content: flex-start; }
.pos-lines { flex: 1; overflow-y: auto; }
.pos-line { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; padding: .55rem .75rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.pos-line:hover { background: var(--bg-alt); }
.pos-line.sel { background: var(--brand-light); box-shadow: inset 3px 0 0 var(--brand); }
html[dir="rtl"] .pos-line.sel { box-shadow: inset -3px 0 0 var(--brand); }
.pos-line .nm { font-weight: 700; }
.pos-line .amt { font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.pos-line .meta { color: var(--muted); font-size: .75rem; grid-column: 1 / -1; }
.pos-empty { color: var(--muted); text-align: center; padding: 3rem 1rem; }
.pos-empty .ic { width: 3rem; height: 3rem; color: #c9c9c9; display: block; margin: 0 auto .5rem; }
.pos-total { padding: .6rem .75rem; border-top: 1px solid var(--border); background: var(--bg-alt); }
.pos-total .row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.pos-total .row.big { font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.pos-pad { display: grid; grid-template-columns: 1.15fr 3fr; gap: .35rem; padding: .5rem .75rem .75rem; border-top: 1px solid var(--border); }
.pos-pad .keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.pos-pad button { height: 2.9rem; border: 1px solid var(--border-input); background: #fff; border-radius: var(--radius); font: inherit;
                  font-size: 1rem; cursor: pointer; color: var(--text); }
.pos-pad button:hover { background: var(--bg); }
.pos-pad button.mode.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pos-pad .pay { height: 100%; min-height: 6rem; background: var(--brand); color: #fff; border-color: var(--brand); font-size: 1.1rem; font-weight: 700;
                display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; }
.pos-pad .pay:hover { background: var(--brand-dark); }
.pos-pad .pay .ic { width: 1.6rem; height: 1.6rem; }
.pos-pad .side { display: grid; gap: .35rem; grid-template-rows: 1fr auto; }
.pos-right { display: flex; flex-direction: column; min-height: 0; }
.pos-search { display: flex; gap: .5rem; padding: .6rem .75rem; background: #fff; border-bottom: 1px solid var(--border); align-items: center; }
.pos-search .lv-search { flex: 1; max-width: none; }
.pos-search .lv-search input { height: 2.4rem; font-size: .95rem; }
.pos-cats { display: flex; gap: .35rem; overflow-x: auto; padding: .5rem .75rem; background: #fff; border-bottom: 1px solid var(--border); }
.pos-cats button { border: 1px solid var(--border-input); background: #fff; border-radius: 1rem; padding: .3rem .9rem; cursor: pointer;
                   font: inherit; white-space: nowrap; color: var(--text); }
.pos-cats button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem;
            padding: .75rem; align-content: start; grid-auto-rows: max-content; }
.pos-prod { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); cursor: pointer; overflow: hidden;
            display: flex; flex-direction: column; text-align: start; padding: 0; font: inherit; color: var(--text); position: relative;
            transition: box-shadow .1s, border-color .1s; }
.pos-prod:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.pos-prod:active { transform: scale(.98); }
.pos-prod > * { flex: none; }
.pos-prod .pic { aspect-ratio: 4 / 3; background: var(--bg-alt); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.pos-prod .pic img { width: 100%; height: 100%; object-fit: cover; }
.pos-prod .pic .ic { width: 2.2rem; height: 2.2rem; color: #c9c9c9; }
.pos-prod .b { padding: .4rem .5rem; display: grid; gap: .1rem; }
.pos-prod .n { font-weight: 700; font-size: .78rem; line-height: 1.25; min-height: 2em; }
.pos-prod .p { color: var(--brand-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-prod .q { position: absolute; top: .35rem; inset-inline-end: .35rem; background: rgba(3,45,96,.85); color: #fff; border-radius: 1rem;
               font-size: .68rem; padding: 0 .45rem; font-weight: 700; }
.pos-prod .q.neg { background: var(--error); }
.pos-modal { position: fixed; inset: 0; background: rgba(8, 7, 7, .55); display: none; align-items: center; justify-content: center; z-index: 50; }
.pos-modal.on { display: flex; }
.pos-modal .box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-drop); width: min(56rem, 96vw); max-height: 94vh;
                  display: flex; flex-direction: column; overflow: hidden; }
.pos-modal .box.sm { width: min(28rem, 96vw); }
.pos-modal .bh { background: var(--navy); color: #fff; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; }
.pos-modal .bh h2 { margin: 0; font-size: 1rem; }
.pos-modal .bh button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.pos-modal .bb { padding: 1rem; overflow-y: auto; }
.pos-modal .bf { padding: .75rem 1rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; background: var(--bg-alt); }
.pos-pay { display: grid; grid-template-columns: 13rem 1fr 15rem; gap: 1rem; }
.pos-pay .methods { display: grid; gap: .4rem; align-content: start; }
.pos-pay .methods button { height: 3rem; border: 1px solid var(--border-input); background: #fff; border-radius: var(--radius); font: inherit;
                           font-weight: 700; cursor: pointer; color: var(--navy); text-align: start; padding: 0 .9rem; }
.pos-pay .methods button:hover { border-color: var(--brand); background: var(--brand-light); }
.pos-pay .due { font-size: 2rem; font-weight: 700; color: var(--navy); text-align: center; font-variant-numeric: tabular-nums; }
.pos-pay .plines .pl { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: var(--radius);
                        margin-bottom: .35rem; cursor: pointer; }
.pos-pay .plines .pl.sel { border-color: var(--brand); background: var(--brand-light); }
.pos-pay .plines .pl .a { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-pay .sum { display: grid; gap: .35rem; margin-top: .75rem; }
.pos-pay .sum .row { display: flex; justify-content: space-between; font-size: 1rem; }
.pos-pay .sum .row.chg { color: var(--success); font-weight: 700; font-size: 1.2rem; }
.pos-pay .sum .row.rem { color: var(--error); font-weight: 700; font-size: 1.2rem; }
.pos-pay .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.pos-pay .keys button { height: 3rem; border: 1px solid var(--border-input); background: #fff; border-radius: var(--radius); font: inherit; font-size: 1.05rem; cursor: pointer; }
.pos-pay .keys button.q { color: var(--brand); font-size: .9rem; }
.pos-clients { max-height: 22rem; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-top: .5rem; }
.pos-clients div { padding: .5rem .75rem; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; }
.pos-clients div:hover, .pos-clients div.sel { background: var(--brand-light); }
.pos-receipt-frame { width: 100%; height: 70vh; border: 1px solid var(--border); background: #fff; }
.pos-toast { position: fixed; bottom: 1rem; inset-inline-start: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .6rem 1rem;
             border-radius: var(--radius); box-shadow: var(--shadow-drop); z-index: 60; display: none; }
.pos-toast.err { background: var(--error); }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; }
.denoms label { display: flex; align-items: center; gap: .4rem; }
.denoms input { width: 4.5rem; }
@media (max-width: 900px) { .pos-main { grid-template-columns: 1fr; } .pos-left { max-height: 55vh; } .pos-pay { grid-template-columns: 1fr; } }

/* ---------------- v6: HR ---------------- */
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--brand); color: inherit; text-decoration: none; }

/* ---------------- v7: pinned menu (second navigation line) ---------------- */
.dd-pin { position: absolute; top: .3rem; inset-inline-end: .4rem; border: 1px solid transparent; background: none; cursor: pointer;
          border-radius: var(--radius); padding: .15rem .35rem; color: var(--muted); font: inherit; font-size: .7rem; display: flex; gap: .25rem;
          align-items: center; z-index: 2; }
.dd-pin:hover { border-color: var(--border-input); color: var(--brand); background: #fff; }
.dd-pin .ic { width: .85rem; height: .85rem; }
.dd { position: absolute; }
.pinbar { background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .15rem; padding: 0 .75rem;
          min-height: 2.4rem; overflow-x: auto; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.pinbar[hidden] { display: none; }
.pinbar .pb-title { font-weight: 700; color: var(--navy); padding-inline-end: .75rem; margin-inline-end: .25rem;
                    border-inline-end: 1px solid var(--border); display: flex; align-items: center; gap: .35rem; }
.pinbar .pb-sep { width: 1px; height: 1.3rem; background: var(--border); margin: 0 .35rem; }
.pinbar a { color: var(--text); padding: .45rem .6rem; border-radius: var(--radius); display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; }
.pinbar a .ic { width: .9rem; height: .9rem; color: var(--muted); }
.pinbar a:hover { background: var(--bg); text-decoration: none; color: var(--brand); }
.pinbar a.on { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); font-weight: 700; }
.pinbar .pb-x { margin-inline-start: auto; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1.1rem; padding: 0 .4rem; }
.pinbar .pb-x:hover { color: var(--error); }

/* v7 — monthly attendance sheet */
.am-wrap { max-height: calc(100vh - 16rem); overflow: auto; }
.am-tbl { font-size: .75rem; border-collapse: separate; border-spacing: 0; }
.am-tbl th, .am-tbl td { padding: 0; }
.am-tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-alt); }
.am-tbl .am-emp { position: sticky; inset-inline-start: 0; z-index: 1; background: #fff; min-width: 11rem; max-width: 14rem;
  padding: .3rem .6rem; border-inline-end: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-tbl thead .am-emp { z-index: 3; background: var(--bg-alt); }
.am-tbl .am-emp small { display: block; color: var(--muted); font-size: .68rem; }
.am-tbl th.am-d { min-width: 1.85rem; text-align: center; font-weight: 600; }
.am-tbl th.am-d a { display: block; color: var(--text); padding: .25rem 0; line-height: 1.1; }
.am-tbl th.am-d small { display: block; font-weight: 400; font-size: .62rem; color: var(--muted); }
.am-tbl th.am-d.W { background: #ececec; } .am-tbl th.am-d.H { background: #efe6fb; }
.am-tbl th.am-d.today a { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.am-tbl td.am-c { text-align: center; border-bottom: 1px solid var(--border); padding: 2px 1px; }
.am-tbl td.am-c.W { background: #f6f6f6; } .am-tbl td.am-c.H { background: #f7f2fd; } .am-tbl td.am-c.X { background: repeating-linear-gradient(45deg,#fafafa,#fafafa 4px,#f0f0f0 4px,#f0f0f0 8px); }
.am-tbl .am-s { padding: .3rem .5rem; background: var(--bg-alt); border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.am-tbl .am-s.neg { color: var(--error); font-weight: 600; }
.am-b, .am { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.5rem; border-radius: 3px;
  border: 1px solid transparent; font: 600 .66rem/1 var(--font); cursor: pointer; background: transparent; color: var(--muted); padding: 0; }
.am-b:hover { border-color: var(--brand); }
.am-b.P, .am.P { background: var(--success-bg); color: var(--success); }
.am-b.A, .am.A { background: var(--error-bg); color: var(--error); }
.am-b.L, .am.L { background: var(--warning-bg); color: var(--warning); }
.am-b.H, .am.H { color: #5a2ca0; } .am-b.W, .am.W { color: #8a8a8a; }
.am-b.ghost.L { background: transparent; border: 1px dashed var(--warning); }
.am-b.late, .am.late { box-shadow: inset 0 -3px 0 var(--warning); }
.am-b.chg { outline: 2px solid var(--brand); outline-offset: -1px; }
.am-legend { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--text-weak); flex-wrap: wrap; }
.am-legend .am { cursor: default; margin-inline-start: .5rem; }
.am-legend .am.H { background: #efe6fb; } .am-legend .am.W { background: #ececec; }

/* v7 — holiday calendar */
.hc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
.hc-grid .card { margin: 0; }
.hc { width: 100%; border-collapse: collapse; font-size: .75rem; text-align: center; margin: .25rem 0 .5rem; }
.hc th { font-weight: 600; color: var(--text-weak); font-size: .66rem; padding: .2rem 0; }
.hc td { padding: .22rem 0; border-radius: 3px; }
.hc td.o { color: #c9c9c9; } .hc td.W:not(.o) { background: #f3f3f3; color: var(--text-weak); }
.hc td.H { background: #efe6fb; color: #5a2ca0; font-weight: 700; }
.hc td.H.T { background: #fff; box-shadow: inset 0 0 0 1px #5a2ca0; }
.hc td.today { box-shadow: inset 0 0 0 2px var(--brand); }

/* v7 — two-column dropdown (HR) */
.dd.dd-2col { min-width: 36rem; grid-template-columns: 1fr 1fr; column-gap: .5rem; }
.topnav > .mi:hover > .dd.dd-2col, .topnav > .mi:focus-within > .dd.dd-2col { display: grid; }
.dd.dd-2col > div + div { border-inline-start: 1px solid var(--border); }
.dd.dd-2col > .dd-pin { inset-inline-end: .5rem; top: .25rem; }

/* v7 — POS: action pad, pricelist / loyalty chips, cashier lock, offline queue, product info */
.pos-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; padding: .45rem .75rem 0; border-top: 1px solid var(--border); }
.pos-acts button { height: 2.35rem; border: 1px solid var(--border-input); background: #fff; border-radius: var(--radius); font: inherit;
  font-size: .72rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .3rem; padding: 0 .3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pos-acts button .ic { width: .95rem; height: .95rem; flex: none; color: var(--brand); }
.pos-acts button:hover { background: var(--bg); border-color: var(--brand); }
.pos-acts button.on { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); font-weight: 700; }
.pos-acts button[hidden] { display: none; }
.pos-chip { margin-inline-start: auto; background: var(--warning-bg); color: var(--warning); border-radius: 1rem; padding: 0 .5rem; font-size: .7rem; font-weight: 700; }
#b-pl { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-dark); }
.pos-total .adj { display: flex; justify-content: space-between; font-size: .78rem; color: var(--success); font-variant-numeric: tabular-nums; }
.pos-total .adj button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 .25rem; font-size: .9rem; line-height: 1; }
.pos-line.adj { cursor: default; color: var(--success); }
.pos-paybar { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.pos-paybar .btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pos-prod { position: relative; }
.pos-prod .inf { position: absolute; top: .35rem; inset-inline-start: .35rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); color: var(--brand); display: grid; place-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.2); cursor: pointer; }
.pos-prod .inf .ic { width: .85rem; height: .85rem; }
.pos-prod .old { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: .72rem; margin-inline-start: .3rem; }
.pos-top .pos-sync { border-color: var(--warning-bg); background: var(--warning); }
.pos-top .pos-cashier { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-info-kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin-bottom: .75rem; }
.pos-info-kv dt { color: var(--text-weak); } .pos-info-kv dd { margin: 0; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.pos-lock { position: fixed; inset: 0; z-index: 60; background: var(--navy); display: grid; place-items: center; }
.pos-lock[hidden] { display: none; }
.pos-lock-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-drop); width: min(20rem, 92vw); padding: 1.25rem; }
.pos-lock-h { text-align: center; } .pos-lock-h .ic { width: 2rem; height: 2rem; color: var(--navy); }
.pos-lock-h h2 { margin: .25rem 0 0; font-size: 1.1rem; } .pos-lock-h p { margin: .25rem 0 .75rem; }
.pos-pin-dots { display: flex; justify-content: center; gap: .5rem; height: 1.25rem; margin-bottom: .75rem; }
.pos-pin-dots i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--navy); }
.pos-pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.pos-pin-keys button { height: 3.1rem; border: 1px solid var(--border-input); background: #fff; border-radius: var(--radius); font: inherit; font-size: 1.15rem; cursor: pointer; }
.pos-pin-keys button:hover { background: var(--bg); }
.pos-lock.shake .pos-lock-box { animation: posshake .3s; }
@keyframes posshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (max-width: 1200px) { .pos-hide-sm { display: none; } }
.pos-otabs button.held { background: rgba(254,241,212,.25); font-style: italic; }
.pos-acts { grid-template-columns: repeat(5, 1fr); }
.pos-top [hidden], .pos-acts [hidden], .pos-paybar [hidden] { display: none !important; }

/* v8 — HR: disciplinary tiles, government forms */
.disc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.disc-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; background: #fff; }
.disc-tile .n { font-size: 1.4rem; font-weight: 700; color: var(--muted); line-height: 1.1; }
.disc-tile .l { font-size: .74rem; color: var(--text-weak); }
.disc-tile.on .n { color: var(--error); } .disc-tile.on { border-color: var(--error-bg); background: #fffafa; }
.disc-tile.pos.on .n { color: var(--success); } .disc-tile.pos.on { border-color: var(--success-bg); background: #f9fffb; }

/* v8 — recruitment pipeline */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(10rem, 1fr)); gap: .6rem; margin-bottom: 1rem; overflow-x: auto; }
.kb-col { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; min-height: 8rem; }
.kb-h { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; color: var(--text-weak); margin-bottom: .45rem; display: flex; justify-content: space-between; }
.kb-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .6rem; margin-bottom: .4rem;
  color: var(--text); text-decoration: none; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.kb-card:hover { border-color: var(--brand); }
.rec-steps { display: flex; gap: 0; margin: 0 0 1rem; }
.rec-steps span { flex: 1; text-align: center; padding: .45rem .25rem; background: var(--bg-alt); border: 1px solid var(--border); font-size: .78rem; color: var(--text-weak); }
.rec-steps span + span { border-inline-start: 0; }
.rec-steps span.done { background: var(--brand-light); color: var(--brand-dark); }
.rec-steps span.cur { background: var(--brand); color: #fff; font-weight: 700; }

/* v8 — HR dashboard bars */
.hb-list { display: grid; gap: .4rem; }
.hb-row { display: grid; grid-template-columns: minmax(6rem, 38%) 1fr 3rem; gap: .5rem; align-items: center; font-size: .78rem; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-weak); }
.hb-b { height: .55rem; background: var(--bg-alt); border-radius: 3px; overflow: hidden; } .hb-b i { display: block; height: 100%; border-radius: 3px; }
.hb-v { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-cols { display: flex; gap: .5rem; align-items: flex-end; height: 8.5rem; } .hb-cols.tall { height: 10rem; }
.hb-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.hb-col .c { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--bg-alt); border-radius: 3px 3px 0 0; }
.hb-col .c i { display: block; width: 100%; border-radius: 3px 3px 0 0; }
.hb-col .v { font-size: .7rem; font-weight: 700; margin-bottom: .2rem; } .hb-col .l { font-size: .68rem; color: var(--muted); margin-top: .2rem; white-space: nowrap; }
.dd.dd-3col { min-width: 50rem; grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1000px) { .dd.dd-3col { min-width: 34rem; grid-template-columns: 1fr 1fr; } }
.vz-row { display: grid; grid-template-columns: 1fr auto 3.2rem auto; gap: .35rem; align-items: center; padding: .4rem .9rem; font-size: .82rem; }
.vz-v { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.hd-grid { margin: 1rem 0; align-items: stretch; } .hd-grid > .card { margin: 0; }
