/* AHN ERP - teal "cashier" theme: white header, light grouped sidebar, teal table heads and buttons, flat white cards.
   Loaded after styles.css, so it only overrides the look. Printing (invoices, slips) keeps its own styles. */
:root {
  --teal: #13865a;
  --teal-dark: #0d6a46;
  --teal-soft: #e6f4ec;
  --accent: var(--teal);
  --accent-soft: var(--teal-soft);
  --bg: #ececec;
  --line: #e2e5e9;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .14);
  --head-h: 56px;
  --side-w: 230px;
  font-family: "Montserrat", "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 13px;
}
[data-dept] { --accent: var(--teal); --accent-soft: var(--teal-soft); }
body { background: var(--bg); background-image: none; }
a { color: var(--teal-dark); }
h1 { font-size: 18px; font-weight: 600; }
h2 { font-size: 14px; }

/* ---------- top header ---------- */
.apphead { position: fixed; inset: 0 0 auto 0; height: var(--head-h); z-index: 30; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: #fff; border-bottom: 1px solid #dfe3e7; box-shadow: 0 1px 4px rgba(0, 0, 0, .05); }
.hamb { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: none; background: var(--teal); color: #fff; justify-content: center; box-shadow: none; }
.hamb:hover { background: var(--teal-dark); border: none; }
.hamb svg { width: 20px; height: 20px; }
.apphead .brand { padding: 0; border: none; font-size: 20px; font-weight: 800; letter-spacing: .3px; color: #1d2a33; display: flex; align-items: center; }
.apphead .brand::before { background-color: var(--teal); }
.apphead .brand:hover { text-decoration: none; }
.head-co { font-size: 13px; font-weight: 600; color: #333; padding: 6px 12px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.head-grow { flex: 1; }
.umenu { position: relative; }
.ubtn { border: none; background: none; box-shadow: none; color: #333; font-weight: 500; padding: 6px 8px; }
.ubtn:hover { background: #f3f5f7; border: none; }
.ubtn svg { width: 22px; height: 22px; }
.ubtn svg:last-child { width: 14px; height: 14px; }
.udrop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-lg); padding: 6px 0; z-index: 40; }
.udrop a { display: block; padding: 9px 16px; color: #333; cursor: pointer; }
.udrop a:hover { background: var(--teal-soft); text-decoration: none; }
.urole { padding: 8px 16px 10px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.urole small { display: block; font-weight: 500; color: var(--muted); text-transform: capitalize; }

/* ---------- layout under the header ---------- */
.shell { display: block; padding-top: var(--head-h); }
.side { position: fixed; top: var(--head-h); left: 0; bottom: 0; width: var(--side-w); height: auto; z-index: 20; background: #f8f9fa; color: #333;
  border-right: 1px solid #dfe3e7; box-shadow: none; display: flex; flex-direction: column; transition: left .2s; }
.main { margin-left: var(--side-w); padding: 18px 22px 40px; transition: margin-left .2s; }
.shell.side-collapsed .side { left: calc(-1 * var(--side-w) - 2px); }
.shell.side-collapsed .main { margin-left: 0; }
.shell.home-mode .side { display: flex; }
.shell.home-mode .main { padding: 18px 22px 40px; }

/* + Add New */
.addnew { position: relative; padding: 14px 12px 6px; }
.addnew > button { width: 100%; justify-content: center; border-radius: 4px; padding: 9px 12px; }
.addnew .gchev svg { width: 14px; height: 14px; vertical-align: -2px; }
.addnew-menu { position: absolute; left: 12px; right: 12px; top: calc(100% - 2px); background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-lg); padding: 4px 0; z-index: 25; }
.addnew-menu { padding: 6px 0; border-radius: 6px; }
.addnew-menu a { display: block; padding: 9px 22px 9px 36px; color: #333; font-size: 13px; }
.addnew-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.addnew-menu a:hover { background: var(--teal-soft); text-decoration: none; }

/* grouped menu */
.nav { padding: 8px 8px 24px; }
.nav a, .nav .ghead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 4px; color: #333; font-weight: 500; margin: 0; }
.nav a::before { display: none; }
.nav a:hover, .nav .ghead:hover { background: #eceff1; color: #111; text-decoration: none; }
.nav .ghead { border: none; background: none; box-shadow: none; font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.nav .gicon { width: 18px; height: 18px; flex: none; color: #555; display: inline-flex; }
.nav .gicon svg { width: 18px; height: 18px; }
.nav .glabel { flex: 1; }
.nav .gchev { display: inline-flex; color: #777; transition: transform .15s; }
.nav .gchev svg { width: 15px; height: 15px; }
.nav .ngroup.open > .ghead { font-weight: 700; color: #111; }
.nav .ngroup.open > .ghead .gchev { transform: rotate(180deg); }
.nav .gitems { display: none; padding: 2px 0 8px; }
.nav .ngroup.open > .gitems { display: block; }
.nav .gitems a { padding: 7px 10px 7px 38px; font-size: 12.5px; color: #444; }
.nav .gitems a.active, .nav a.nav-home.active { background: #e4e7ea; color: #000; font-weight: 700; box-shadow: none; }
.nav .gsep { padding: 10px 10px 4px 38px; font-size: 10.5px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .6px; }
.nav a.nav-home { font-weight: 700; }
.nav a.nav-home .gicon { color: var(--teal-dark); }

/* ---------- page title bar ---------- */
.topbar { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.topbar h1::before { display: none; }
.topbar h1 { font-size: 16px; font-weight: 500; color: #222; }
.menu-btn { display: none !important; }

/* ---------- cards ---------- */
.card { border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
/* a card that starts with a heading gets a teal title strip */
.card > h2:first-child { margin: -16px -16px 14px; padding: 9px 14px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 600; border-radius: 4px 4px 0 0; }
.card > div:first-child > h2 { color: #222; }
.grid { gap: 14px; }

/* KPI tiles: teal icon square + label + value */
.kpis { gap: 12px; margin-bottom: 14px; }
.kpi { --k: var(--teal); border-radius: 4px; padding: 14px 14px 14px 82px; min-height: 76px; box-shadow: var(--shadow); text-align: right; }
.kpi:nth-child(n) { --k: var(--teal); }
.kpi::before { inset: 0 auto 0 0; width: 64px; background: var(--teal)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 3 3 5-6'/%3E%3C/svg%3E") center/30px no-repeat; }
.kpi::after { display: none; }
.kpi .label { text-transform: none; letter-spacing: 0; font-weight: 500; color: #444; font-size: 13px; }
.kpi .value { font-size: 17px; font-weight: 700; }

/* ---------- tables ---------- */
.tbl-wrap { border-radius: 0; }
th { background: var(--teal); color: #fff; font-weight: 600; font-size: 12px; text-transform: none; letter-spacing: 0; border-bottom: none; }
thead th:first-child, thead th:last-child { border-radius: 0; }
th, td { padding: 9px 10px; }
tbody tr:hover td { background: #f6fbfc; }
tfoot td, tr.total td { background: #f4f6f8; font-weight: 700; }

/* ---------- buttons & inputs ---------- */
button, .btn { border-radius: 4px; font-weight: 500; box-shadow: none; }
.primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: none; }
.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.small { border-radius: 4px; }
input, select, textarea { border-radius: 4px; border-color: #ced4da; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(19, 134, 90, .18); }
.tabs { border-radius: 4px; box-shadow: none; padding: 4px; }
.tabs a { border-radius: 4px; border: 1px solid transparent; }
.tabs a.on { background: var(--teal); box-shadow: none; }
.tabs a.on:hover { background: var(--teal-dark); }
.form-head { border-radius: 4px; }
.modal { border-radius: 6px; }

/* ---------- department home ---------- */
.home-top { display: none; }
.welcome { font-size: 24px; }
.dept { border-radius: 6px; box-shadow: var(--shadow); }
.approve-alert { border-radius: 4px; }

/* ---------- phone / tablet ---------- */
@media (max-width: 900px) {
  .side { left: calc(-1 * var(--side-w) - 2px); z-index: 35; transition: left .2s; }
  .side.open { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .shell.side-collapsed .side { left: calc(-1 * var(--side-w) - 2px); }
  .main, .shell.home-mode .main { margin-left: 0; padding: 14px 12px 32px; }
  .head-co, .head-sale, .ubtn span { display: none; }
  .apphead { gap: 10px; padding: 0 12px; }
}

/* ---------- printing: nothing of the app chrome ---------- */
@media print {
  .apphead, .side { display: none !important; }
  .shell { padding-top: 0 !important; }
  .main { margin-left: 0 !important; padding: 0 !important; }
}
.nav a[data-nav="home"] { color: #333; font-size: 13px; }
.nav a[data-nav="home"].active { color: #000; }
/* printed documents keep their own font and a white page */
.invoice, .slip, #print-host { font-family: "Segoe UI", "Inter", system-ui, Arial, sans-serif; font-size: 14px; }
@media print { html, body { background: #fff !important; } }

/* sample tag on the invoice */
.sample-tag { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 6px; font-weight: 800; letter-spacing: 1px; font-size: 12px; border: 2px solid #067647; color: #067647; }
.sample-tag.paid { border-color: #b54708; color: #b54708; }
@media print { .sample-tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
#samplerow[hidden] { display: none; }

/* company seal between the signatures (authorized invoices) */
.inv2-sign { position: relative; }
.inv2-seal { flex: 0 0 auto; align-self: flex-end; display: flex; justify-content: center; margin: 0 -10px -6px; }
.inv2-seal img { width: 118px; height: 118px; object-fit: contain; transform: rotate(-10deg); opacity: .92; }
.seal-prev img { max-height: 90px; }
@media print { .inv2-seal img { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* money receipt */
.mr-doc .mr-amount { display: flex; justify-content: space-between; align-items: center; border: 2px solid #0f7a55; border-radius: 10px; padding: 12px 18px; margin: 14px 0 10px; background: #f4faf6; }
.mr-doc .mr-amount span { font-weight: 700; color: #0b4d36; } .mr-doc .mr-amount b { font-size: 24px; color: #0b4d36; }
@media print { .mr-doc .mr-amount { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* login: remember me */
.auth .remember-me { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; margin: 2px 0 4px; }
.auth .remember-me input { width: 17px; height: 17px; margin: 0; accent-color: #0f7a55; }
.auth .remember-me small { font-weight: 400; }

/* customer form: products they sell */
.prod-pick { display: grid; gap: 6px; }
.prod-pick .pp-mode { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.prod-pick .pp-mode label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.prod-pick input[type=radio], .prod-pick input[type=checkbox] { width: auto; margin: 0; }
.prod-pick .pp-box[hidden] { display: none; }
.prod-pick .pp-tools { display: flex; gap: 6px; margin-bottom: 6px; } .prod-pick .pp-tools input { flex: 1; }
.prod-pick .pp-list { max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.prod-pick .pp-list label { display: flex; gap: 6px; align-items: center; font-size: 13px; }

/* invoice signature time */
.inv2-signer .inv2-when { font-size: 11px; color: #666; margin-top: 2px; }

/* invoice: previous due + total due */
.inv2-sum .prev-total { border-top: 1px solid #000; margin-top: 4px; padding-top: 6px; font-size: 15px; }
@media print { .inv2-sum .prev-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- POS: "Create New Sale" layout ---------- */
.cart .last-price { font-size: 11px; color: #0f7a55; margin-top: 3px; white-space: nowrap; }
.pos2 { padding: 18px 20px; }
.pos2-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding-bottom: 14px; }
.pos2-col > * + * { margin-top: 10px; }
.pos2-line { display: flex; align-items: center; gap: 14px; }
.pos2-line input { width: 190px; }
.pos2-k { width: 60px; color: #444; }
.pos2-cust { display: flex; gap: 0; max-width: 460px; }
.pos2-cust select { border-radius: 4px 0 0 4px; }
.pos2-cust button { border-radius: 0 4px 4px 0; flex: none; }
.pos2-cinfo { display: grid; gap: 5px; font-size: 13px; padding: 4px 0; }
.pos2-cinfo span:first-child { display: inline-block; width: 92px; color: #555; }
.pos2-cinfo .red { color: var(--danger); }
.pos2-right { max-width: 420px; margin-left: auto; width: 100%; }
.pos2-sec { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 8px; }
.pos2-sec h3 { margin: 0; font-size: 15px; font-weight: 500; color: #222; }
.pos2-search { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-bottom: none; }
.pos2-search::before { content: "Product"; }
.pos2-search::before { display: none; }
.pos2-n { width: 26px; height: 26px; border-radius: 4px; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.pos2-search input { font-size: 13px; padding: 8px 10px; }
.pos2-search .results { top: calc(100% + 2px); left: 44px; right: 10px; border-radius: 4px; }
.pos2 .cart { border: 1px solid var(--line); margin-bottom: 18px; }
.pos2 .cart .empty { margin: 0; border: none; border-radius: 0; }
.pos2-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.pos2-bottom:has(.pos2-opts) { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(0, 1fr); gap: 22px; }
.pos2-opts .yn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-weight: 600; color: #222; }
.pos2-opts .yn > span { flex: 1 1 100%; }
.pos2-opts .yn label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; cursor: pointer; border: 1px solid #cfd5db; border-radius: 6px; padding: 4px 12px; }
.pos2-opts .yn label:has(input:checked) { border-color: #0f7a55; background: #eef8f2; color: #0f7a55; }
.pos2-opts .yn input { width: auto; margin: 0; }
.pos2-opts #litbox { border-top: 1px dashed #cfd5db; padding-top: 10px; display: grid; gap: 8px; }
.pos2-opts #litbox[hidden] { display: none; }
.pos2-opts .lit-all { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.pos2-opts .lit-all input[type=checkbox] { width: auto; margin: 0; }
.pos2-opts input[type=number] { width: 70px; padding: 4px 6px; }
.pos2-opts .lit-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.pos2-opts .lit-row > span:last-child { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pos2-sum { max-width: 420px; }
.pos2-sum .row { padding: 6px 0; gap: 12px; }
.pos2-sum .row > span:first-child { color: #333; }
.pos2-sum input { width: 170px; }
.pos2-sum .paid-wrap { display: inline-flex; align-items: center; gap: 10px; }
.pos2-sum .full-tick { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 700; color: #0f7a55; cursor: pointer; border: 1px solid #bfe0cf; background: #eef8f2; border-radius: 6px; padding: 5px 9px; }
.pos2-sum .full-tick input { width: 16px !important; height: 16px; margin: 0; }
.pos2-sum { max-width: 520px; }
.pos2-sum .grand { font-size: 17px; color: var(--teal-dark); border-top: 1px dashed #cfd5db; }
.pos2-sum .due b { color: var(--danger); font-size: 15px; }
.pos2-boxes > * + * { margin-top: 14px; }
.pos2-fs { border: 1px solid #cfd5db; border-radius: 4px; padding: 10px 14px 14px; margin: 0; }
.pos2-fs legend { padding: 3px 10px; border: 1px solid #cfd5db; border-radius: 4px; color: var(--teal-dark); font-weight: 700; font-size: 13px; background: #fff; }
.pos2-fs > * + * { margin-top: 10px; }
.pos2-note { margin-top: 18px; }
.pos2-note textarea { min-height: 54px; }
.pos2-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pos2-actions button, .pos2-actions .btn { min-width: 110px; justify-content: center; }
.btn.danger-fill { background: #e74c3c; border-color: #e74c3c; color: #fff; }
.btn.danger-fill:hover { background: #c0392b; border-color: #c0392b; color: #fff; }
@media (max-width: 900px) {
  .pos2-top, .pos2-bottom { grid-template-columns: 1fr; gap: 14px; }
  .pos2-right { margin-left: 0; max-width: none; }
  .pos2-sum input { width: 140px; }
}

/* ---------- Sales list ---------- */
.slist { padding: 14px 16px; }
.slist-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.slist-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.slist-tabs button { border: 1px solid #2c3e50; color: #2c3e50; background: #fff; padding: 5px 14px; font-size: 12px; }
.slist-tabs button.on { background: #0f3d2e; border-color: #0f3d2e; color: #fff; }
.slist-totals { text-align: right; font-size: 16px; line-height: 1.5; }
.slist-totals .red { color: var(--danger); }
.slist-filters { display: grid; grid-template-columns: 150px repeat(4, minmax(0, 1fr)) minmax(250px, 1.4fr); gap: 10px; margin-bottom: 12px; }
.slist-filters #bulk { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 600; }
.slist-range { display: flex; align-items: center; gap: 6px; }
.slist-range span { color: var(--muted); }
.slist-table th.sortable { cursor: pointer; user-select: none; }
.slist-table tr.is-due td { color: #c0392b; }
.slist-table tr.is-due td a { color: #c0392b; }
.slist-table tr.is-void td { color: #98a2b3; text-decoration: line-through; }
.slist-table tr.is-void td .badge { text-decoration: none; }
.slist-act { position: relative; white-space: nowrap; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: none; background: none; box-shadow: none; color: #0f3d2e; border-radius: 4px; font-size: 18px; font-weight: 700; cursor: pointer; }
.iconbtn:hover { background: var(--teal-soft); border: none; text-decoration: none; }
.iconbtn svg { width: 18px; height: 18px; }
.slist-menu { position: absolute; right: 6px; top: 100%; z-index: 15; min-width: 170px; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow-lg); padding: 4px 0; text-align: left; }
.slist-menu a { display: block; padding: 8px 14px; color: #333; }
.slist-menu a:hover { background: var(--teal-soft); text-decoration: none; }
.slist-pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
@media (max-width: 1100px) { .slist-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .slist-range { grid-column: span 3; } }
@media (max-width: 600px) { .slist-filters { grid-template-columns: 1fr 1fr; } .slist-range { grid-column: span 2; } .slist-totals { text-align: left; } }
.slist-filters { display: flex; flex-wrap: wrap; }
.slist-filters > * { flex: 1 1 130px; min-width: 0; }
.slist-filters > #bulk { flex: 0 0 150px; }
.slist-filters > .slist-range { flex: 1 1 290px; }
.slist-range input { min-width: 0; }
.slist-table tr.is-due td .iconbtn { color: #0f3d2e; }
.slist-table td.muted { white-space: nowrap; }
@media (max-width: 1100px) { .slist-range { grid-column: auto; } }

/* ---------- colour polish (emerald) ---------- */
body { background: #eef1ef; }
.side { background: #f7faf8; }
.nav .gitems a.active, .nav a.nav-home.active { background: var(--teal-soft); color: var(--teal-dark); box-shadow: inset 3px 0 0 var(--teal); }
.nav .ngroup.open > .ghead .gicon { color: var(--teal); }
.apphead { border-bottom: 3px solid var(--teal); }
th { background: var(--teal); }
tbody tr:hover td { background: #f3faf6; }
.slist-menu a { cursor: pointer; }

/* quick search above lists */
.dt-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; }
.dt-tools input { max-width: 320px; }
.dt-n { color: var(--muted); font-size: 12px; white-space: nowrap; }
table.dt thead th { cursor: pointer; user-select: none; }
table.dt thead th[data-dir="asc"]::after { content: " ▲"; font-size: 9px; }
table.dt thead th[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }

/* ---------- dashboard tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tiles.small { grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); }
.tile { display: flex; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; color: var(--text); min-height: 78px; }
a.tile:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.tile-ic { width: 64px; flex: none; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; }
.tile-ic svg { width: 30px; height: 30px; }
.tile:nth-child(2) .tile-ic { background: #2f80ed; } .tile:nth-child(3) .tile-ic { background: #f2994a; }
.tile:nth-child(4) .tile-ic { background: #eb5757; } .tile:nth-child(5) .tile-ic { background: #9b51e0; } .tile:nth-child(6) .tile-ic { background: #00a3a3; }
.tile-tx { flex: 1; padding: 10px 12px; text-align: right; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.tile-l { font-size: 13px; color: #444; }
.tile-v { font-size: 16px; font-weight: 700; margin-top: 2px; }
.tile-v small { font-size: 11px; font-weight: 500; color: var(--muted); }
.tile-s { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- dashboard charts ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid > .card { margin-bottom: 14px; }
.card.ch h2 { display: flex; justify-content: space-between; align-items: center; }
.card.ch h2 .see { color: #fff; font-size: 11px; font-weight: 500; opacity: .9; }
.ch-sub { text-align: center; font-size: 12px; font-weight: 700; color: #333; margin-bottom: 4px; }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: #e3e7ea; stroke-width: 1; }
.chart .ax { font-size: 10px; fill: #667085; font-family: inherit; }
.chart .dn-k { font-size: 12px; fill: #667085; } .chart .dn-v { font-size: 15px; font-weight: 700; fill: #222; }
.chart-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.donut { display: grid; gap: 8px; }
.donut .chart { max-width: 230px; margin: 0 auto; }
.legend { display: grid; gap: 4px; font-size: 12px; }
.legend.row { display: flex; gap: 16px; justify-content: center; margin-bottom: 4px; }
.legend div { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.legend b { margin-left: auto; padding-left: 10px; }
.adv-t { color: #067647; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dash-grid, .dash-grid.two { grid-template-columns: 1fr; } }
.tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1400px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tiles { grid-template-columns: 1fr; } }
.tile-s { overflow-wrap: anywhere; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.filters label.check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* a page with its own search box does not need the extra list search */
.card:has(.filters input.search) .dt-tools, .card:has(.filters input[type="search"]) .dt-tools { display: none; }

/* ---------- accounts ---------- */
tr.sysrow td { background: #f7f9f8; color: #555; }
.card > h2:first-child .see { margin-left: auto; font-weight: 700; }
.card > h2:first-child { display: flex; align-items: center; gap: 8px; }
.stmt-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 12px; }
.stmt-bal { display: flex; gap: 10px; flex-wrap: wrap; }
.stmt-bal > div { border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; min-width: 120px; text-align: right; }
.stmt-bal span { display: block; font-size: 11px; color: var(--muted); }
.stmt-bal .big { background: var(--teal-soft); border-color: var(--teal); }
.stmt-bal .big b { color: var(--teal-dark); font-size: 15px; }
.vform .slist-tabs .btn.primary { color: #fff; }
.voucher-doc .inv2-sign { display: flex; justify-content: space-between; gap: 18px; }
.voucher-doc .inv2-signer { width: 30%; }
.voucher-doc .inv-table th { background: #eef5f1; color: #0b4d36; }
/* bulk sms preview */
.sms-prev .bubble { margin-top: 4px; background: #e9f7ef; border: 1px solid #bfe3cf; border-radius: 12px 12px 12px 2px; padding: 10px 12px; white-space: pre-wrap; max-width: 420px; }
/* import */
.imp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.imp-step { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: #fafcfb; }
.imp-step > b { width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.imp-step .muted { font-size: 12px; margin: 3px 0 8px; }
.imp-opts { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.imp-opts .f { min-width: 280px; }
.imp-table tr.imp-err td { background: #fff4f3; }
@media (max-width: 800px) { .imp-steps { grid-template-columns: 1fr; } }
/* ---------- All Reports ---------- */
.rpt-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rpt-group h2 .rg-ic svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.rpt-links { display: grid; }
.rpt-links a { display: flex; justify-content: space-between; padding: 8px 6px; border-bottom: 1px solid #eef1f0; color: #222; }
.rpt-links a:last-child { border-bottom: none; }
.rpt-links a:hover { background: var(--teal-soft); color: var(--teal-dark); text-decoration: none; }
.rpt-links a[hidden], .rpt-group[hidden] { display: none; }
.rpt-filters { align-items: flex-end; }
.rpt-filters select { min-width: 200px; }
.rpt-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 2px solid var(--teal); padding-bottom: 10px; margin-bottom: 12px; }
.rpt-co { font-weight: 800; color: var(--teal-dark); }
.rpt-title { margin: 2px 0; font-size: 18px; }
.rpt-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rpt-sum > div { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 4px; padding: 6px 12px; min-width: 130px; }
.rpt-sum span { display: block; font-size: 11px; color: var(--muted); }
.rpt-chart { max-width: 640px; margin: 0 auto 10px; }
.rpt-table tr.rpt-bold td { font-weight: 700; background: #f4f8f6; }
@media (max-width: 1100px) { .rpt-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .rpt-groups { grid-template-columns: 1fr; } }
@media print { .rpt-out { border: none; box-shadow: none; } .rpt-table th { background: #eef5f1 !important; color: #0b4d36 !important; } }
/* change price */
tr.chg-row td { background: #fff8e6 !important; }
.chg-bulk { display: flex; align-items: center; gap: 6px; flex: 1 1 320px; }
.chg-bulk span { color: var(--muted); white-space: nowrap; }

/* report sub-groups in the sidebar */
.nav .nsub .shead { display: flex; align-items: center; width: 100%; padding: 7px 10px 7px 38px; border: none; background: none; box-shadow: none; font: inherit; font-size: 12.5px; color: #444; cursor: pointer; border-radius: 4px; }
.nav .nsub .shead span:first-child { flex: 1; text-align: left; }
.nav .nsub .shead:hover { background: #eceff1; }
.nav .nsub .shead .gchev { transition: transform .15s; display: inline-flex; }
.nav .nsub .shead .gchev svg { width: 14px; height: 14px; }
.nav .nsub.open > .shead { font-weight: 700; color: #111; }
.nav .nsub.open > .shead .gchev { transform: rotate(180deg); }
.nav .nsub .sitems { display: none; padding-bottom: 4px; }
.nav .nsub.open > .sitems { display: block; }
.nav .nsub .sitems a { padding-left: 52px; font-size: 12px; }

.slist-menu[data-placed] { z-index: 60; }
.slist-table .slist-menu a, .slist-menu a { color: #333 !important; text-decoration: none !important; }
.slist-menu a:hover { color: var(--teal-dark) !important; }
/* POS: no walk-in name and no MPO choice (the customer's own MPO is used) */
.pos2 #wname, .pos2 label.f:has(> #mpo) { display: none !important; }

/* printed documents (PO, GRN, challan, slips, vouchers): table headings dark on light green, easy to read */
.invoice:not(.inv2) th, .slip th { background: #eef5f1 !important; color: #0b4d36 !important; font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .3px; }

/* purchase order not approved: big faint mark across the page (screen and print) */
.po-doc { position: relative; overflow: hidden; }
.po-watermark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-size: 78px; font-weight: 900; letter-spacing: 6px; color: rgba(217, 45, 32, .13); border: 8px solid rgba(217, 45, 32, .13); border-radius: 18px; padding: 6px 28px; white-space: nowrap; pointer-events: none; z-index: 5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.po-ok { color: #067647; font-weight: 700; font-size: 12px; }

/* lists where a whole row opens the record */
#list tbody tr:has(a[href^="#/po/"]) { cursor: pointer; }
/* invoice: previous due can be hidden for one print */
.invoice.hide-prev .prev-row { display: none !important; }
.topbar .prev-tick { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; font-weight: 600; white-space: nowrap; }
/* Make Sale invoice options: stack on narrow screens */
@media (max-width: 1100px) { .pos2-bottom:has(.pos2-opts) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pos2-bottom:has(.pos2-opts) .pos2-boxes { grid-column: 1 / -1; } }
@media (max-width: 900px) { .pos2-bottom:has(.pos2-opts) { grid-template-columns: 1fr; } }

/* Make Sale: the customer's eligible products with a qty box each */
#elig { border: 1px solid var(--line); border-bottom: none; background: #fff; }
#elig .el-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 10px; background: #f3f9f6; border-bottom: 1px solid var(--line); }
#elig .el-head .muted { font-size: 12px; }
#elig .el-count { color: var(--primary, #0b7a4b); font-weight: 600; font-size: 12px; }
#elig .el-head input { margin-left: auto; width: 200px; padding: 6px 8px; font-size: 13px; }
#elig .el-wrap { max-height: 300px; overflow: auto; }
#elig table { width: 100%; }
#elig th { position: sticky; top: 0; z-index: 1; }
#elig td, #elig th { padding: 5px 10px; font-size: 13px; }
#elig td input { width: 90px; text-align: right; padding: 5px 8px; }
#elig tr.on td { background: #eaf6ef; }
#elig .last-price { font-size: 11px; }
@media (max-width: 640px) { #elig .el-head input { width: 100%; margin-left: 0; } }

/* prepared -> verified -> authorized: red until the MD authorizes, green after */
.step-st { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.step-st.no { background: #fdecec; color: #c0261b; border: 1px solid #f5c2c0; }
.step-st.ok { background: #e6f6ec; color: #067647; border: 1px solid #b7e4c7; }
.step-sub { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
h1 .step-st { font-size: 12px; vertical-align: middle; }

#elig .el-none { background: #fdecec; color: #8f1d14; border-bottom: 0; }
#elig .el-none b { color: #c0261b; }

/* several expenses at once */
.em-wrap { margin-top: 12px; }
.em-tbl td { padding: 4px 6px; vertical-align: middle; }
.em-tbl td input, .em-tbl td select { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; }
.em-tbl td:nth-child(1) { min-width: 170px; } .em-tbl td:nth-child(3) { width: 120px; } .em-tbl td:nth-child(3) input { text-align: right; }
.em-tbl td:last-child { width: 36px; }

/* company seal, faded, under the "Authorized by" signature */
.inv2-signer.sealed .inv2-sigimg { position: relative; }
.inv2-signer.sealed .seal-under { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; object-fit: contain; transform: translate(-50%, -58%) rotate(-12deg);
  opacity: .38; z-index: 0; pointer-events: none; }
.inv2-signer.sealed .inv2-sigimg .sig-img { position: relative; z-index: 1; mix-blend-mode: multiply; }
.invoice.inv2.compact .inv2-signer.sealed .seal-under { width: 78px; height: 78px; }
@media print { .inv2-signer.sealed .seal-under { opacity: .42; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
