:root {
  --bg: #f4f6f8; --card: #fff; --text: #1d2630; --muted: #5f6b77; --line: #dde3e9;
  --brand: #1a56db; --brand-dark: #1443b5; --navy: #1f354c; --navy-2: #26466f; --sky: #05a8ed; --tint: #e6eefd;
  /* Mizan logo colours: navy stroke, blue-to-sky ring */ --ok: #1e7b45; --ok-bg: #e5f4eb;
  --err: #b3261e; --err-bg: #fbe9e7; --warn: #8a5a00; --warn-bg: #fff3d6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.2rem 0 .6rem; }

/* layout: top bar + side menu + content */
.top { background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; display: flex; align-items: center; gap: .6rem;
  padding: 0 1rem; height: 52px; position: sticky; top: 0; z-index: 20; }
.top .shop { font-weight: 700; color: #fff; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .spacer { flex: 1; }
.top .shop { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.top .shop span { overflow: hidden; text-overflow: ellipsis; }
.toplogo { height: 34px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.branchpick select { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 7px;
  padding: .25rem .5rem; font-size: .88rem; max-width: 200px; width: auto; }
.branchpick select option { color: var(--text); background: #fff; }
.branchname { font-size: .88rem; opacity: .95; white-space: nowrap; }
.headlogo { max-height: 70px; max-width: 220px; object-fit: contain; display: block; margin: 0 auto .4rem; }
.logo-preview { display: block; max-height: 60px; max-width: 200px; margin: .3rem 0; border: 1px solid var(--line); border-radius: 6px; padding: 3px; background: #fff; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
label.inline { display: inline-flex; align-items: center; gap: .35rem; font-weight: 400; }
.top .user { white-space: nowrap; font-size: .9rem; }
.top .user a { color: #fff; opacity: .9; margin-left: .5rem; }
.adminlink { color: #fff; padding: .3rem .6rem; border: 1px solid rgba(255,255,255,.6); border-radius: 7px; white-space: nowrap; }
.adminlink:hover, .adminlink.on { background: rgba(255,255,255,.18); text-decoration: none; }
.helpbtn { background: #fff; color: var(--brand); border-color: #fff; padding: .3rem .7rem; }
.helpbtn:hover { background: var(--tint); }
.burger { display: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 0 .3rem; }
body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: 52px 1fr; min-height: 100vh; }
body.app .top { grid-column: 1 / -1; }
.side { background: #fff; border-right: 1px solid var(--line); padding: .6rem .5rem 2rem; position: sticky; top: 52px;
  height: calc(100vh - 52px); overflow-y: auto; }
.side .group { margin-bottom: .3rem; --gc: var(--brand); --gbg: var(--tint); }
/* one colour per menu group, so each area is easy to recognise */
.side .g-selling { --gc: #13795b; --gbg: #e3f4ec; } .side .g-buying { --gc: #c2410c; --gbg: #fdebe0; }
.side .g-stock { --gc: #1d63b8; --gbg: #e1ecf7; } .side .g-money { --gc: #6d3fc8; --gbg: #eee7fb; }
.side .g-projects { --gc: #0e7490; --gbg: #e0f2f5; }
.side .g-admin { --gc: #475569; --gbg: #e9edf2; } .side .g-main, .side .g-help { --gc: var(--brand); --gbg: var(--tint); }
.side .gtitle { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gc);
  padding: .35rem .6rem .15rem; cursor: pointer; list-style: none; display: flex; align-items: center; gap: .45rem;
  border-radius: 6px; user-select: none; }
.side .gtitle::-webkit-details-marker { display: none; }
.side summary.gtitle::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--gc); flex: none; }
.side summary.gtitle::after { content: '▾'; margin-left: auto; font-size: .8rem; color: var(--muted); transition: transform .15s; }
.side details:not([open]) > .gtitle::after { transform: rotate(-90deg); }
.side .gtitle:hover { background: var(--gbg); }
.side a { display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem; border-radius: 7px; color: var(--text);
  font-size: .94rem; border-left: 3px solid transparent; }
.side details a { border-left-color: var(--gbg); margin-left: .4rem; }
.side a .ic { width: 1.3rem; text-align: center; flex: none; font-size: .95rem; }
.side a .lb { min-width: 0; line-height: 1.25; }
.side a:hover { background: var(--gbg); text-decoration: none; }
.side a.on { background: var(--gbg); color: var(--gc); font-weight: 600; border-left-color: var(--gc); }
.side a.sell { background: linear-gradient(90deg, #1249e4, #0b84d8); color: #fff; font-weight: 700; justify-content: center; padding: .55rem; margin-bottom: .2rem; }
.side a.sell:hover, .side a.sell.on { background: linear-gradient(90deg, var(--brand-dark), #0a6fb6); color: #fff; }
/* the « button sits to the right of the blue Sell (POS) button and makes the menu narrow / wide */
.sellrow { display: flex; gap: .3rem; align-items: stretch; margin-bottom: .2rem; }
.sellrow a.sell { flex: 1; margin-bottom: 0; }
.sellrow.alone { justify-content: flex-end; }
.minibtn { display: flex; align-items: center; justify-content: center; flex: none; width: 2.2rem; padding: 0; font-size: 1.15rem;
  line-height: 1; background: #fff; color: var(--brand); border: 1px solid var(--line); border-radius: 7px; cursor: pointer; min-height: 2.2rem; }
.minibtn:hover { background: var(--tint); color: var(--brand-dark); }
.toplogo.initials { display: inline-flex; align-items: center; justify-content: center; width: 34px; color: var(--brand);
  font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
/* narrow menu: icons only (hover shows the name) */
body.app.mini { grid-template-columns: 64px minmax(0, 1fr); }
.mini .side { padding: .5rem .35rem 2rem; overflow-x: hidden; }
.mini .side .lb, .mini .side .gtitle { display: none; }
.mini .sellrow { flex-direction: column; } .mini .side .minibtn { width: 100%; } .mini .minibtn { transform: rotate(180deg); }
.mini .side a { justify-content: center; padding: .45rem 0; margin-left: 0; border-left: none; }
.mini .side a.sell { padding: .55rem 0; }
.mini .side details.group { border-top: 3px solid var(--gc); padding-top: .25rem; border-radius: 2px; }
.mini .side a .ic { font-size: 1.15rem; width: auto; }
.scrim { display: none; }
.side .mobile-user { display: none; border-top: 1px solid var(--line); padding-top: .4rem; }
.content { min-width: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 1rem; }

/* help pop-up */
dialog#help { width: min(960px, 96vw); height: min(720px, 90vh); padding: 0; border: none; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog#help::backdrop { background: rgba(20,30,40,.45); }
dialog#help[open] { display: flex; flex-direction: column; }
.helphead { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 1rem;
  border-bottom: 1px solid var(--line); background: #f8fafb; }
.helpbody { display: flex; flex: 1; min-height: 0; }
.helpnav { width: 220px; border-right: 1px solid var(--line); overflow-y: auto; padding: .5rem; flex-shrink: 0; }
.helpnav button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text);
  font-weight: 500; padding: .4rem .6rem; border-radius: 6px; white-space: normal; }
.helpnav button:hover { background: #f0f4fb; }
.helpnav button.on { background: var(--tint); color: var(--brand); font-weight: 700; }
.helptext { flex: 1; overflow-y: auto; padding: .5rem 1.4rem 1.5rem; line-height: 1.6; }
.helptext h2, .manual h2 { color: var(--brand); }
.helptext li, .manual li { margin-bottom: .35rem; }
.helpfind { border-collapse: collapse; margin: 0 0 .8rem; }
.helpfind td { padding: .2rem .6rem .2rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.helpfind td:first-child { font-weight: 600; white-space: nowrap; }
.manual section { padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
code { background: #eef1f4; padding: 0 .3rem; border-radius: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem;
  margin-bottom: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.row > * { flex: 1 1 280px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; justify-content: space-between;
  margin-bottom: .8rem; }
.head h1 { margin: 0; }

/* alerts */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .8rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.flash.warn, .lowbar { background: var(--warn-bg); color: var(--warn); }
.lowbar { padding: .45rem 1rem; text-align: center; font-size: .92rem; }
.lowbar a { color: var(--warn); font-weight: 700; text-decoration: underline; }

/* forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input, select, textarea { width: 100%; padding: .55rem .6rem; border: 1px solid #c3ccd5; border-radius: 7px;
  font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9dbcf5; border-color: var(--brand); }
input[type=checkbox] { width: auto; margin-right: .35rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.grid .wide { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .8rem; }
.filters > div { flex: 0 1 180px; }
.filters > div.grow { flex: 1 1 220px; }
.btn, button { display: inline-block; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: .55rem 1rem; border-radius: 7px; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.btn:hover, button:hover { background: var(--brand-dark); text-decoration: none; }
.btn.light, button.light { background: #fff; color: var(--brand); }
.btn.danger, button.danger { background: var(--err); border-color: var(--err); }
.btn.small, button.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.big, button.big { padding: .9rem 1.4rem; font-size: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
form.inline { display: inline; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .45rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); background: #f8fafb; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--text); }
tr.low td { background: #fff8e6; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600;
  background: #e8edf2; color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.tile .k { color: var(--muted); font-size: .82rem; }
.tile .v { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile.good .v { color: var(--ok); } .tile.bad .v { color: var(--err); }
/* dashboard: one compact filter row, and summary cards in the menu's brand colours */
.dashbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .8rem; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: .55rem .8rem; margin-bottom: .8rem; }
.dashbar > div { flex: 0 1 170px; }
.dashbar > div:has(button) { flex: 0 0 auto; }
.dashbar label { font-size: .78rem; margin-bottom: .15rem; }
.dashbar .when { flex: 1 1 160px; text-align: right; align-self: center; font-size: .88rem; }
.tiles.dash.four { grid-template-columns: repeat(4, 1fr); }
.tiles.dash .tile { border-left: 5px solid var(--tc, var(--line)); background: var(--tb, #fff); }
.tiles.dash .tile .k { color: var(--tc, var(--muted)); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: .74rem; }
.tile.t-sell { --tc: #13795b; --tb: #ecf7f2; }
.tile.t-buy { --tc: #c2410c; --tb: #fdf1ea; }
.tile.t-money { --tc: #6d3fc8; --tb: #f4effc; }
.tile.t-stock { --tc: #1d63b8; --tb: #edf3fb; }
.tile.t-low { --tc: #b45309; --tb: #fdf6e7; }
@media (max-width: 900px) { .tiles.dash.four { grid-template-columns: repeat(2, 1fr); } .dashbar > div { flex: 1 1 130px; } .dashbar .when { text-align: left; flex-basis: 100%; } }

/* dashboard charts: plain SVG/HTML, colours in fixed order (blue, orange, aqua, yellow; grey = other) */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --other: #9aa5b1; }
.chart { margin-bottom: 1rem; } .chart h2 { margin-top: 0; } .chart h2 small { font-weight: 400; font-size: .85rem; }
.chart .hint { font-size: .8rem; margin: .3rem 0 0; }
.trend { width: 100%; height: auto; display: block; }
.trend .grid { stroke: #e6eaee; } .trend .base { stroke: #b9c2cb; }
.trend .ax { font-size: 12px; fill: var(--muted); }
.trend .hit { fill: transparent; } .trend .bar:hover .hit { fill: #f0f4f8; }
.s1 { stroke: var(--s1); background: var(--s1); } .s2 { stroke: var(--s2); background: var(--s2); }
.s3 { stroke: var(--s3); background: var(--s3); } .s4 { stroke: var(--s4); background: var(--s4); }
.other { stroke: var(--other); background: var(--other); }
.trend path.s1 { fill: var(--s1); stroke: none; }
.trendwrap { overflow-x: auto; } .trendwrap .trend { min-width: 560px; }
.hbars { display: grid; gap: .45rem; }
.hb { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: .6rem; font-size: .9rem; }
.hb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb b { font-variant-numeric: tabular-nums; text-align: right; min-width: 5.5rem; }
.track { background: #eef1f4; border-radius: 4px; height: 14px; overflow: hidden; }
.fill { height: 100%; border-radius: 0 4px 4px 0; }
.fill.good { background: var(--ok); } .fill.bad { background: var(--err); } .fill.warn { background: #e0a100; }
.ring { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ring svg { width: 150px; height: 150px; flex: none; }
.ring circle { transition: stroke-width .15s; } .ring circle:hover { stroke-width: 8.5; }
.ring .rt { font-size: 6px; font-weight: 700; fill: var(--text); } .ring .rs { font-size: 3px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; flex: 1; min-width: 160px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; column-gap: .5rem; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 3px; } .legend small { grid-column: 2 / 4; margin-top: -.2rem; }
@media print { .chart { break-inside: avoid; } .trend .hit { display: none; } }

/* several new products at once */
.bulk td { padding: .25rem .2rem; vertical-align: middle; } .bulk .num { width: 78px; text-align: right; }
.bulk input, .bulk select { padding: .35rem .4rem; } .bulk select { max-width: 120px; }
.bulk .no { text-align: right; width: 2rem; }
.bulk tbody.err input, .bulk tbody.err select { border-color: var(--err); background: var(--err-bg); }
.bulk .rowerr td { color: var(--err); font-size: .88rem; padding-top: 0; border-top: none; }

/* POS */
.pos { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; align-items: start; }
.pos #search { font-size: 1.2rem; padding: .8rem; }
.results { border: 1px solid var(--line); border-radius: 8px; margin-top: .4rem; max-height: 320px; overflow-y: auto; }
.results div { padding: .55rem .7rem; border-bottom: 1px solid var(--line); cursor: pointer; display: flex;
  justify-content: space-between; gap: .5rem; }
.results div:hover, .results div.sel { background: var(--tint); }
.cart input { width: 90px; text-align: right; padding: .35rem; }
.paybox .line { display: flex; justify-content: space-between; padding: .3rem 0; }
.paybox .grand { font-size: 1.6rem; font-weight: 800; }
.paybox .chg { font-size: 1.3rem; font-weight: 700; color: var(--ok); }
.x { background: none; border: none; color: var(--err); font-size: 1.2rem; padding: 0 .3rem; cursor: pointer; }

/* login */
.login { max-width: 380px; margin: 8vh auto; }
/* login: Mizan logo colours (navy, blue, sky), light gradient with soft moving glows and a glass card */
body.loginpage { min-height: 100vh; overflow-x: hidden; background:
  radial-gradient(1200px 700px at 10% 0%, #dfe8fd 0%, transparent 60%),
  radial-gradient(900px 600px at 100% 30%, #dcf2fd 0%, transparent 60%),
  radial-gradient(900px 600px at 40% 110%, #e3e8f0 0%, transparent 60%), #f6f8fc; }
body.loginpage main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.loginpage .glow { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none; z-index: 0;
  animation: drift 18s ease-in-out infinite alternate; }
.loginpage .g1 { width: 380px; height: 380px; background: #1249e4; top: -90px; left: -80px; }
.loginpage .g2 { width: 320px; height: 320px; background: #05a8ed; top: 35%; right: -90px; animation-delay: -6s; }
.loginpage .g3 { width: 300px; height: 300px; background: #1f354c; bottom: -110px; left: 30%; animation-delay: -12s; opacity: .2; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .loginpage .glow { animation: none; } }
.logincard { position: relative; z-index: 1; width: 100%; max-width: 390px; padding: 2rem 2rem 1.4rem; text-align: center;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 22px;
  box-shadow: 0 20px 50px rgba(31, 53, 76, .18), 0 0 0 1px rgba(31, 53, 76, .06), 0 0 40px rgba(18, 73, 228, .12); }
.logincard form { text-align: left; margin-top: 1.2rem; }
.loginlogo { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(18, 73, 228, .25)); }
.logincard h1 { margin: .4rem 0 0; font-size: 1.9rem; letter-spacing: .01em; color: var(--navy); }
.logincard h1 span { background: linear-gradient(90deg, #1f354c, #1249e4 55%, #05a8ed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logincard h1 small { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); }
.logincard .tagline { margin: .2rem 0 0; color: #5b6b80; font-size: .95rem; }
.logincard input { background: rgba(255, 255, 255, .9); border-color: #d3dcea; }
.logincard input:focus { outline: none; border-color: #1249e4; box-shadow: 0 0 0 3px rgba(18, 73, 228, .18); }
.glowbtn { background: linear-gradient(90deg, #1249e4, #0b84d8); border: none; box-shadow: 0 8px 22px rgba(18, 73, 228, .3); }
.glowbtn:hover { background: linear-gradient(90deg, #1443b5, #0a6fb6); }
.loginfoot { margin: 1.1rem 0 0; font-size: .8rem; color: #6b7a8c; }
.loginfoot b { color: var(--navy); }
.loginpage .flash { position: relative; z-index: 1; width: 100%; max-width: 390px; margin: 0 0 .8rem; }
/* "Powered by" at the bottom of the side menu */
.poweredby { display: flex; align-items: center; gap: .45rem; margin: 1rem .4rem 0; padding-top: .7rem; border-top: 1px solid var(--line);
  font-size: .75rem; color: var(--muted); }
.poweredby img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.mini .poweredby { justify-content: center; margin: 1rem 0 0; }

/* receipt + print */
.receipt { max-width: 760px; margin: 0 auto; background: #fff; padding: 1.5rem; border: 1px solid var(--line); }
.receipt .shophead { text-align: center; margin-bottom: 1rem; }
.receipt .shophead h2 { margin: 0; }
.print-only { display: none; }
@media print {
  .top, .side, .scrim, dialog, .lowbar, .noprint, .flash, .filters, .actions, button, .btn { display: none !important; }
  .print-only { display: block; }
  body, body.app { background: #fff; font-size: 12px; display: block; }
  main { max-width: none; padding: 0; }
  .card, .receipt { border: none; padding: 0; }
  @page { size: A4; margin: 14mm; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}

/* phones and tablets */
@media (max-width: 900px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .burger { display: block; }
  .top .user { display: none; }
  .side { position: fixed; left: 0; top: 52px; bottom: 0; width: 260px; z-index: 30; transform: translateX(-100%);
    transition: transform .2s; box-shadow: 2px 0 12px rgba(0,0,0,.15); }
  #navtoggle:checked ~ .side { transform: none; }
  #navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 52px 0 0 0; background: rgba(0,0,0,.3); z-index: 25; }
  .pos { grid-template-columns: 1fr; }
  main { padding: .7rem; }
  th, td { padding: .4rem; }
  .helpnav { width: 140px; }
  .helptext { padding: .3rem .8rem 1rem; }
}
@media (max-width: 900px) {
  .side .mobile-user { display: block; }
  .minibtn { display: none; }
  body.app.mini { grid-template-columns: minmax(0, 1fr); }
  .mini .side .lb, .mini .side .gtitle { display: revert; } .mini .side .gtitle { display: flex; }
  .mini .side a { justify-content: flex-start; padding: .3rem .6rem; }
}

/* Positive / negative values (requirements update 9.2): colour plus a + / − sign, never colour alone */
.vpos { color: var(--ok); font-weight: 600; } .vneg { color: var(--err); font-weight: 600; } .vzero { color: var(--muted); }
.badge.manual { background: #eee7fb; color: #6d3fc8; }
.serials { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.cart .ser { display: block; margin-top: .25rem; width: 100%; font-size: .85rem; }
.cart input.price { width: 95px; text-align: right; }
.sumgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.sumgrid .card { margin: 0; } .sumgrid table td { padding: .2rem .3rem; }

/* Reports page: one card per category */
.rsearch { flex: 0 1 320px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; align-items: start; }
.rcard h2 { margin: 0 0 .2rem; font-size: 1.05rem; }
.rcard > p { margin: 0 0 .5rem; }
.rmine { margin-bottom: .8rem; border-left: 5px solid var(--brand); }
.rmine .rlist { columns: 2 260px; }
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { display: flex; align-items: center; gap: .4rem; padding: .3rem 0; border-top: 1px solid var(--line); break-inside: avoid; }
.rlist li:first-child { border-top: 0; }
.rlist li a { flex: 1; }
.pinf { margin: 0; }
button.pin, button.pin:hover { background: none; border: 0; padding: 0 .2rem; color: #9aa5b1; font-size: 1.1rem; cursor: pointer; line-height: 1; }
button.pin.on, button.pin:hover { color: #eda100; }
.small { font-size: .82rem; }
.rmine .rlist li { border-top: 0; }
/* field checks before saving (static/forms.js): a wrong field gets a red outline and a short message under it */
input.invalid, select.invalid, textarea.invalid { border-color: var(--err); outline: 2px solid var(--err); outline-offset: 0;
  background: var(--err-bg); }
input.invalid:focus, select.invalid:focus, textarea.invalid:focus { outline: 2px solid var(--err); border-color: var(--err); }
.ferr { color: var(--err); font-size: .78rem; font-weight: 600; margin-top: .2rem; line-height: 1.2; text-align: left; white-space: normal; }
.unitlist { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 .5rem; }
.unitchip a { color: inherit; font-weight: 700; } .unitchip a:hover { text-decoration: none; color: var(--err); }
.unitadd { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; } .unitadd input { max-width: 220px; }
/* Mizan Platform (AG Software's subscription pages) and the subscription bar of a business */
.subbar { margin: 0; border-radius: 0; text-align: center; } .subbar a { font-weight: 700; text-decoration: underline; color: inherit; }
.platformtop { flex-wrap: wrap; }
.pnav { display: flex; gap: .2rem; flex-wrap: wrap; } .pnav a { color: #fff; opacity: .85; padding: .3rem .6rem; border-radius: 6px; }
.pnav a.on, .pnav a:hover { background: rgba(255,255,255,.18); opacity: 1; text-decoration: none; }
a.tile.pstate { color: inherit; } a.tile.pstate:hover { text-decoration: none; border-color: var(--brand); }
td.over { color: var(--err); font-weight: 700; }
.pcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .pcols { grid-template-columns: minmax(0, 1fr); } }
/* Mizan logo ring as a thin line under the top bar */
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #1249e4, #05a8ed); }

/* Language list (top bar, login page) and the eye on password boxes */
.langpick { width: auto; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 7px;
  padding: .25rem .4rem; font-size: .85rem; }
.langpick option { color: var(--text); background: #fff; }
.loginlang { position: absolute; top: .8rem; right: .8rem; }
.loginlang .langpick { background: #fff; color: var(--navy); border-color: #c3ccd5; }
.pwwrap { position: relative; display: block; }
.pwwrap input { padding-right: 2.4rem; }
.pweye { position: absolute; right: .3rem; top: .3rem; width: 2rem; height: 1.9rem; padding: 0; background: transparent;
  border: 0; color: var(--muted, #64748b); font-size: 1.05rem; line-height: 1; cursor: pointer; box-shadow: none; z-index: 1; }
.pweye:hover { background: var(--tint, #eef4ff); }
html[lang=am] body { font-family: system-ui, "Segoe UI", "Nyala", "Ebrima", "Abyssinica SIL", "Noto Sans Ethiopic", sans-serif; }
@media (max-width: 760px) { .top .langpick { max-width: 4.5rem; } }
