/* IchthusCAS — "Liquid Glass" theme on the IchthusCAS palette (blue #1a7fd4 / #135e9e on white).
   Frosted translucent layers over a soft blue backdrop, specular top highlights, pill controls.
   body.theme-frost is the "Frosted Cards" theme (blue ribbon backdrop, navy text on milky frosted cards);
   body.theme-classic switches to flat solid surfaces (also the fallback without backdrop-filter). */
:root {
  --blue: #1a7fd4; --blue-d: #135e9e; --blue-dd: #0d4677; --blue-l: #e8f2fc; --blue-ll: #f3f8fe;
  --ink: #16253a; --muted: #5d6b7c; --line: rgba(19, 94, 158, .14); --line-solid: #d9dee4;
  --ok: #2e7d32; --warn: #d98200; --err: #c62828;
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .78); --glass-soft: rgba(255, 255, 255, .38);
  --glass-edge: rgba(255, 255, 255, .75); --glass-blur: blur(22px) saturate(170%);
  --shadow: 0 10px 34px rgba(13, 70, 119, .13), 0 2px 6px rgba(13, 70, 119, .06);
  --shine: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .25);
  --r-lg: 18px; --r: 12px; --r-sm: 9px;
  --s0: #1a7fd4; --s1: #f28c28;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, Roboto, Arial, sans-serif; font-size: 13px; color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(26, 127, 212, .30), transparent 60%),
    radial-gradient(800px 650px at 105% 10%, rgba(64, 160, 240, .26), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(19, 94, 158, .22), transparent 60%),
    linear-gradient(180deg, #eef5fd 0%, #f7fafe 45%, #eaf2fb 100%);
  background-attachment: fixed;
}
a { color: var(--blue-d); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  border: 1px solid rgba(19, 94, 158, .18); border-radius: var(--r-sm); padding: 6px 9px; min-width: 0;
  background: rgba(255, 255, 255, .72); box-shadow: inset 0 1px 2px rgba(13, 70, 119, .06); transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(26, 127, 212, .38); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(26, 127, 212, .18); }
input[readonly] { background: rgba(232, 242, 252, .55); color: #44546a; }
input.n { text-align: right; }
input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.pad { padding: 8px; }
.okc { color: var(--ok); font-weight: 600; }
.errc { color: var(--err); font-weight: 600; }
.note-err { background: rgba(253, 236, 234, .85); color: var(--err); border: 1px solid rgba(198, 40, 40, .25); padding: 9px 12px; border-radius: var(--r-sm); margin: 6px 0; white-space: pre-wrap; }
.note-ok { background: rgba(232, 245, 233, .85); color: var(--ok); border: 1px solid rgba(46, 125, 50, .25); padding: 9px 12px; border-radius: var(--r-sm); margin: 6px 0; }

/* ---------------------------------------------------------------- glass surfaces */
.glass, header.top, .card, .dialog, .dropdown, .mdrop, .searchres, .tile, .kpi, .box, .login-card, main#content, .cccol, .gridwrap {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow), var(--shine);
}
/* liquid specular highlight on the large panes */
.card, .dialog, .tile, .kpi, .login-card, header.top { position: relative; }
.card::before, .dialog::before, .tile::before, .kpi::before, .login-card::before, header.top::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .08) 38%, rgba(255, 255, 255, 0) 60%);
}
.card > *, .dialog > *, .tile > *, .kpi > *, .login-card > *, header.top > * { position: relative; }

/* ---------------------------------------------------------------- buttons */
.btn {
  border: 1px solid rgba(19, 94, 158, .16); background: rgba(255, 255, 255, .66); border-radius: 999px; padding: 6px 14px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 2px 8px rgba(13, 70, 119, .08), var(--shine);
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
}
.btn:hover { border-color: rgba(26, 127, 212, .45); background: rgba(255, 255, 255, .9); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(13, 70, 119, .14), var(--shine); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, #3d97e6 0%, var(--blue) 55%, var(--blue-d) 100%); border-color: rgba(13, 70, 119, .35); color: #fff; box-shadow: 0 6px 18px rgba(26, 127, 212, .35), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn.primary:hover { background: linear-gradient(180deg, #4aa1ec 0%, #1f88dc 55%, var(--blue-d) 100%); }
.btn.ok { background: linear-gradient(180deg, #4caf50, var(--ok)); border-color: rgba(46, 125, 50, .5); color: #fff; box-shadow: 0 6px 16px rgba(46, 125, 50, .28), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.danger { color: var(--err); border-color: rgba(198, 40, 40, .28); }
.btn.danger:hover { background: rgba(253, 236, 234, .9); }
select.btn { padding-right: 10px; }
.x { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 4px; border-radius: 50%; }
.x:hover { color: var(--err); }

/* ---------------------------------------------------------------- login & installer */
.login-body { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 9vh 16px 24px; }
.login-card { width: 360px; max-width: 100%; border-radius: 22px; padding: 28px 26px; display: flex; flex-direction: column; gap: 12px; background: var(--glass-strong); }
.login-card h2 { margin: 0 0 4px; text-align: center; font-weight: 600; color: var(--blue-dd); }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12px; color: #33465e; }
.login-card label.check { flex-direction: row; font-weight: 400; align-items: center; }
.sso { display: flex; flex-direction: column; gap: 8px; }
.sso:empty { display: none; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--r-sm); background: #fff; border: 1px solid #8c8c8c;
  color: #3c3c3c; font-weight: 600; font-size: 14px; text-decoration: none; transition: background-color .15s, border-color .15s; }
.sso-btn:hover, .sso-btn:focus { background: #f3f3f3; border-color: #5e5e5e; color: #222; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 6px 0 2px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-solid); }
.login-card input { padding: 10px 12px; font-size: 14px; }
.login-card .btn { justify-content: center; padding: 10px 14px; font-size: 14px; }
.login-ver { text-align: center; font-size: 11px; margin-top: 4px; }
.note-warn { background: rgba(255, 244, 214, .9); color: #6b4e00; border: 1px solid rgba(180, 130, 0, .3); padding: 9px 12px; border-radius: var(--r-sm); margin: 6px 0; }
.login-logo { height: 72px; width: auto; max-width: 100%; align-self: center; margin-bottom: 4px; filter: drop-shadow(0 4px 10px rgba(13, 70, 119, .18)); }

/* ---------------------------------------------------------------- header & menu */
header.top { display: flex; align-items: center; gap: 16px; padding: 9px 18px; margin: 10px 12px 0; border-radius: var(--r-lg); z-index: 60; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 650; letter-spacing: .2px; color: var(--blue-dd); }
.brand img { height: 34px; width: auto; filter: drop-shadow(0 2px 5px rgba(13, 70, 119, .18)); }
.top-mid { flex: 1; position: relative; max-width: 460px; }
.top-mid .search { width: 100%; border-radius: 999px; padding-left: 14px; }
.searchres { position: absolute; top: 38px; left: 0; right: 0; border-radius: var(--r); z-index: 80; max-height: 380px; overflow: auto; background: var(--glass-strong); }
.searchres:empty { display: none; }
.searchres a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.searchres a:hover { background: rgba(26, 127, 212, .1); }
.notif { text-decoration: none; font-weight: 600; color: var(--blue-d); white-space: nowrap; }
.notif sup { color: #fff; background: var(--err); font-weight: 700; margin-left: 3px; padding: 0 5px; border-radius: 999px; font-size: 10px; }
.notif sup:empty { display: none; }
.branchlbl { white-space: nowrap; color: #33465e; }
.branch { min-width: 190px; border-radius: 999px; }
.usermenu { position: relative; }
.userbtn { border: 1px solid rgba(19, 94, 158, .18); background: rgba(255, 255, 255, .7); border-radius: 999px; padding: 6px 12px; cursor: pointer; box-shadow: var(--shine); }
.dropdown { display: none; position: absolute; right: 0; top: 38px; border-radius: var(--r); z-index: 90; min-width: 190px; padding: 6px; background: var(--glass-strong); }
.dropdown.open { display: block; }
.dropdown a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); border-radius: var(--r-sm); }
.dropdown a:hover { background: rgba(26, 127, 212, .1); }
nav.menubar {
  display: flex; flex-wrap: wrap; align-items: stretch; padding: 4px 8px; margin: 8px 12px 0; position: relative; z-index: 50; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(61, 151, 230, .86) 0%, rgba(26, 127, 212, .84) 50%, rgba(19, 94, 158, .86) 100%);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 10px 30px rgba(19, 94, 158, .32), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .08);
}
nav.menubar > a, .mgroup > a { color: #fff; text-decoration: none; font-weight: 600; padding: 8px 14px; display: block; white-space: nowrap; border-radius: 999px; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); }
nav.menubar > a:hover, .mgroup:hover > a { background: rgba(255, 255, 255, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
nav.menubar .home { font-size: 17px; padding: 6px 12px; }
.mgroup { position: relative; }
.mdrop { display: none; position: absolute; top: calc(100% + 6px); left: 0; border-radius: var(--r-lg); padding: 12px; width: calc(var(--n, 1) * 250px + 24px); max-width: calc(100vw - 16px);
  max-height: 75vh; overflow: hidden auto; background: rgba(255, 255, 255, .94); }
.mcols { columns: var(--n, 1); column-gap: 14px; }
.mgroup:hover .mdrop { display: block; }
.mgroup::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; } /* hover bridge */
.msub { break-inside: avoid; margin-bottom: 10px; }
.msubtitle { font-weight: 700; color: var(--blue-d); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--line); padding: 3px 6px; margin-bottom: 3px; }
.msub a { display: block; padding: 5px 8px; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); }
.msub a:hover { background: rgba(26, 127, 212, .12); color: var(--blue-dd); }

/* ---------------------------------------------------------------- tabs & workspace */
.tabstrip { display: flex; gap: 6px; padding: 12px 14px 0; overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: 6px; padding: 7px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 13.5px;
  background: var(--glass-soft); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 2px 8px rgba(13, 70, 119, .07), var(--shine);
}
.tab:hover { background: rgba(255, 255, 255, .7); }
.tab.on { background: linear-gradient(180deg, #3d97e6, var(--blue) 60%, var(--blue-d)); color: #fff; border-color: rgba(13, 70, 119, .3); box-shadow: 0 6px 16px rgba(26, 127, 212, .32), inset 0 1px 0 rgba(255, 255, 255, .45); }
.tab.on .x { color: #dbeafe; }
main#content { margin: 10px 12px 0; min-height: calc(100vh - 190px); border-radius: var(--r-lg); background: rgba(255, 255, 255, .42); }
.pane { display: none; padding: 16px 18px 30px; }
.pane.show { display: block; animation: paneIn .18s ease-out; }
@keyframes paneIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
footer { display: flex; justify-content: space-between; padding: 10px 18px; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- command center */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding: 6px 0 18px; }
.tile { border-radius: 20px; padding: 22px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 146px; transition: transform .16s, box-shadow .16s, background .16s; }
.tile:hover, .tile.on { transform: translateY(-3px); background: rgba(255, 255, 255, .78); box-shadow: 0 16px 36px rgba(13, 70, 119, .18), var(--shine); }
.tile.on { border-color: rgba(26, 127, 212, .55); box-shadow: 0 0 0 2px rgba(26, 127, 212, .35), 0 16px 36px rgba(13, 70, 119, .18), var(--shine); }
.ticon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 32px;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .95), rgba(214, 236, 252, .85) 55%, rgba(170, 212, 245, .75));
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 8px 18px rgba(26, 127, 212, .22), inset 0 -4px 10px rgba(26, 127, 212, .15); }
.tlabel { font-weight: 700; color: var(--blue-dd); text-align: center; font-size: 13.5px; letter-spacing: .3px; }
.tsub { font-size: 11px; color: var(--muted); text-align: center; margin-top: -6px; }
.ccdetail h3 { color: var(--blue-d); margin: 4px 0 10px; }
.ccgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cccol { border-radius: var(--r); padding: 10px 12px; }
.cccol h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.cccol a { display: block; padding: 4px 6px; text-decoration: none; border-radius: var(--r-sm); }
.cccol a:hover { background: rgba(26, 127, 212, .1); }

/* ---------------------------------------------------------------- dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; border-left: 0; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #3d97e6, var(--blue-d)); }
.kpi.warn::after { background: linear-gradient(180deg, #ffb74d, var(--warn)); }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi b { font-size: 20px; color: var(--blue-dd); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.chartwrap { overflow-x: auto; }
.chart { width: 100%; min-width: 480px; height: 260px; display: block; }
.chart .gridline { stroke: rgba(19, 94, 158, .12); }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .bar.s0, .sw.s0 { fill: var(--s0); background: var(--s0); }
.chart .bar.s1, .sw.s1 { fill: var(--s1); background: var(--s1); }
.chart .bar { rx: 3; }
.legend { display: flex; gap: 14px; font-size: 12px; margin-bottom: 4px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }

/* ---------------------------------------------------------------- cards, forms, toolbars */
.card { border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 14px; color: var(--blue-d); letter-spacing: .2px; }
details.card summary { cursor: pointer; font-weight: 600; color: var(--blue-d); }
.modhead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.modhead h2 { margin: 0; font-size: 19px; font-weight: 650; color: var(--blue-dd); }
.crumbs { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 8px 0; }
.toolbar input:not([type]), .toolbar input[type=text] { min-width: 240px; border-radius: 999px; padding-left: 13px; }
.toolbar.sticky { position: sticky; top: 0; z-index: 6; padding: 8px 10px; margin: 0 0 12px; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); box-shadow: var(--shadow), var(--shine); }
.spacer { flex: 1; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.fld > span:first-child { color: #4b5b70; font-weight: 600; }
.fld.req > span:first-child::after { content: " *"; color: var(--err); }
.fld.wide { grid-column: 1 / -1; }
.fld input, .fld select, .fld textarea, .lk input { width: 100%; }
.lk { display: block; position: relative; }
/* the picked record's name, shown in the lookup box after the code (app.js namedLookup) */
.lkname { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.lkname-ro { color: var(--muted); margin-left: 6px; }
.check { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.form1 { display: flex; flex-direction: column; gap: 10px; }
.form1 label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 12px; }
.row { display: flex; gap: 6px; } .row input { flex: 1; }

/* ---------------------------------------------------------------- status boxes & pills */
.boxes { display: flex; flex-wrap: wrap; gap: 9px; margin: 6px 0 6px; }
.box { border-radius: var(--r); padding: 7px 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; min-width: 100px; transition: transform .12s, box-shadow .12s; }
.box:hover { transform: translateY(-1px); }
.box b { font-size: 19px; }
.box span { font-size: 12px; color: var(--muted); }
.box.on { border-color: rgba(26, 127, 212, .6); background: rgba(232, 242, 252, .85); box-shadow: 0 0 0 2px rgba(26, 127, 212, .25), var(--shadow), var(--shine); }
.box.draft b { color: #546e7a; } .box.forapproval b { color: var(--warn); } .box.approved b, .box.posted b { color: var(--ok); } .box.rejected b, .box.cancelled b { color: var(--err); } .box.all b { color: var(--blue-d); }
.box.pending b, .box.sent b { color: var(--warn); } .box.accepted b { color: var(--ok); } .box.overdue b { color: var(--err); } .box.void b { color: #546e7a; }
pre.json { max-height: 60vh; overflow: auto; font-size: 12px; background: rgba(240, 244, 250, .9); color: #1b2a3a; padding: 10px; border-radius: var(--r-sm); white-space: pre; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 650; background: rgba(236, 239, 241, .9); color: #455a64; border: 1px solid rgba(69, 90, 100, .12); }
.pill.forapproval { background: rgba(255, 243, 224, .95); color: #a85f00; border-color: rgba(217, 130, 0, .2); }
.pill.approved, .pill.posted { background: rgba(232, 245, 233, .95); color: var(--ok); border-color: rgba(46, 125, 50, .2); }
.pill.rejected, .pill.cancelled { background: rgba(253, 236, 234, .95); color: var(--err); border-color: rgba(198, 40, 40, .2); }

/* ---------------------------------------------------------------- grids */
.gridwrap { overflow: auto; max-height: 64vh; border-radius: var(--r); background: rgba(255, 255, 255, .62); }
.gridwrap.lines { max-height: none; }
.gridwrap.tall { max-height: 60vh; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
table.grid th { position: sticky; top: 0; text-align: left; font-weight: 650; color: #2d4058; padding: 8px 9px; white-space: nowrap; z-index: 1;
  background: rgba(238, 245, 252, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
table.grid td { padding: 6px 9px; border-bottom: 1px solid rgba(19, 94, 158, .07); vertical-align: top; }
table.grid tbody tr:nth-child(even) td { background: rgba(243, 248, 254, .45); }
table.grid th.n, table.grid td.n, .n { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.c { text-align: center; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: rgba(26, 127, 212, .1); }
table.grid tfoot td { font-weight: 700; background: rgba(232, 242, 252, .9); border-top: 2px solid rgba(26, 127, 212, .25); position: sticky; bottom: 0; }
table.grid tr.grp td { background: rgba(26, 127, 212, .09); font-weight: 700; color: var(--blue-dd); }
table.grid tr.sub td { font-weight: 600; border-top: 1px solid var(--line); }
table.grid tr.tot td { font-weight: 700; background: rgba(232, 242, 252, .85); border-top: 2px solid rgba(26, 127, 212, .3); }
table.grid.edit td { padding: 3px 4px; }
table.grid.edit input, table.grid.edit select { width: 100%; min-width: 90px; padding: 5px 6px; border-radius: 7px; }
table.grid.edit input[type=checkbox] { min-width: 0; width: auto; }
.linehead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.linehead h3 { margin: 0 8px 0 0; }
.totals { display: flex; flex-wrap: wrap; gap: 18px; justify-content: flex-end; padding: 10px 4px 0; }
.totals b { color: var(--blue-dd); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 8px 0; }
.thread { max-height: 220px; overflow: auto; margin-bottom: 8px; }
.thread .msg { border-bottom: 1px solid var(--line); padding: 6px 0; }
.subtabs { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.subtabs button { border: 1px solid rgba(19, 94, 158, .16); background: rgba(255, 255, 255, .6); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.subtabs button.on { background: var(--blue); color: #fff; border-color: var(--blue-d); }

/* ---------------------------------------------------------------- kanban boards (CRM, funnel, schedules) */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { border-radius: var(--r-lg); padding: 10px; min-height: 220px; background: rgba(255, 255, 255, .38); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shine); transition: background .12s; }
.kcol.over { background: rgba(26, 127, 212, .14); border-color: rgba(26, 127, 212, .5); }
.khead { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; color: var(--blue-dd); font-size: 12px; letter-spacing: .4px; }
.kcard { background: rgba(255, 255, 255, .82); border: 1px solid var(--glass-edge); border-radius: var(--r); padding: 9px 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 3px 10px rgba(13, 70, 119, .08), var(--shine); display: flex; flex-direction: column; gap: 3px; transition: transform .1s, box-shadow .1s; }
.kcard:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(13, 70, 119, .14), var(--shine); }
.kcard:active { cursor: grabbing; }
.krow { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
.ktitle { font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stagepick { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--blue-d); }
.stagepick select { border-radius: 999px; }

/* ---------------------------------------------------------------- transport & scheduling, QC results */
.sched { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .sched { grid-template-columns: 1fr; } }
.schedleft { max-height: 75vh; overflow: auto; }
.schedorder { background: rgba(255, 255, 255, .72); border: 1px solid var(--glass-edge); border-radius: var(--r); padding: 9px 11px; margin-bottom: 8px; display: grid; gap: 3px; box-shadow: var(--shine); }
.schedorder.overdue { border-color: rgba(198, 40, 40, .35); }
.schedorder select { margin-top: 4px; justify-self: start; max-width: 100%; }
.schedorder .pill { margin-left: 6px; }
.truckcard { margin-bottom: 12px; }
.truckhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.meter { height: 9px; border-radius: 999px; background: rgba(19, 94, 158, .1); overflow: hidden; margin: 4px 0; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3d9be9, var(--blue)); }
.meter i.hi { background: linear-gradient(90deg, #ffb74d, var(--warn)); }
select.opt { min-width: 70px; }
.opt-pass, .opt-passed, .opt-delivered { color: var(--ok); font-weight: 600; }
.opt-fail, .opt-failed { color: var(--err); font-weight: 600; }
.opt-partial, .opt-incomplete, .opt-pending { color: var(--warn); font-weight: 600; }
.opt-na { color: var(--muted); }

/* ---------------------------------------------------------------- point of sale */
.pos { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } }
.possearch { width: 100%; font-size: 15px; padding: 11px 14px !important; border-radius: 999px !important; margin-bottom: 12px; }
.posgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 62vh; overflow: auto; padding: 2px; }
.positem { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px; border-radius: var(--r); cursor: pointer; min-height: 92px;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--glass-edge); box-shadow: 0 3px 10px rgba(13, 70, 119, .08), var(--shine); transition: transform .1s, box-shadow .1s; }
.positem:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(13, 70, 119, .16), var(--shine); border-color: rgba(26, 127, 212, .45); }
.positem span { margin-top: auto; font-weight: 700; color: var(--blue-d); }
.poscart { max-height: 40vh; overflow: auto; margin: 10px 0; }
.poscart input.n { width: 70px; min-width: 0; padding: 4px 6px; }
.qtybox { display: inline-flex; align-items: center; gap: 2px; }
.qtybox input { width: 46px !important; text-align: center; }
.postot { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r); background: rgba(232, 242, 252, .65); border: 1px solid var(--glass-edge); }
.postot > div { display: flex; justify-content: space-between; }
.postot .grand { font-size: 20px; color: var(--blue-dd); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.paybtn { font-size: 15px; padding: 10px 22px; }
.tender { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: 6px; margin: 6px 0; }
.paysum { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: rgba(232, 242, 252, .7); margin-bottom: 8px; font-size: 14px; }
.receipt { font: 12px/1.45 ui-monospace, Consolas, monospace; width: 300px; margin: 0 auto; padding: 14px; background: #fff; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td.n { text-align: right; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #777; }
.receipt tr.big td { font-weight: 700; font-size: 14px; }
.fld.chk { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 6px; }
.fld.chk input { width: auto; order: -1; }
.posdev { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px 10px; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.posdev legend { font-weight: 600; color: #4b5b70; padding: 0 4px; }
.posdev .toolbar { align-items: center; }
.posdev .toolbar input.n { width: 76px; min-width: 0; }

/* ---------------------------------------------------------------- maps (GIS, trip tracking) */
.btn.sm { padding: 3px 9px; font-size: 12px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(26, 127, 212, .12); color: var(--blue-d); }
.chip.warn { background: rgba(217, 130, 0, .15); color: var(--warn); }
.chip.st { --c: #6b7a8c; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, .15); }
.gis { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; align-items: stretch; }
@media (max-width: 900px) { .gis { grid-template-columns: 1fr; } .gis-side { max-height: 46vh; } }
.gis-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; max-height: calc(100vh - 190px); padding: 10px; }
.gis-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.gis-pane { display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; }
.gis-pane .toolbar input[type="search"], .gis-side .toolbar input[type="search"] { min-width: 0; flex: 1; }
.gis-pane > .toolbar:first-child select { flex: 1 1 100%; max-width: 100%; }
.gis-pane > .toolbar:first-child input[type="search"] { flex: 1 1 160px; }
.gis-list { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.gis-item { padding: 8px 10px; border-radius: var(--r); background: rgba(255, 255, 255, .7); border: 1px solid var(--glass-edge); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.gis-item:hover, .gis-item.on { border-color: rgba(26, 127, 212, .45); background: rgba(255, 255, 255, .92); }
.gis-item.none { opacity: .72; }
.gis-item.inactive b { text-decoration: line-through; }
.gis-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.gis-tag { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; }
.gis-tag:hover { background: rgba(255, 255, 255, .7); }
.gis-tag img, .gis-ico { width: 20px; height: 20px; object-fit: contain; }
.gis-map { position: relative; height: calc(100vh - 190px); min-height: 420px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.gis-map.trip { height: 58vh; margin: 12px 0; }
.gis-map.picking .mmap { cursor: copy; }
.gis-pop { display: flex; flex-direction: column; gap: 3px; max-width: 280px; font-size: 12px; }
.gis-photos { display: flex; gap: 4px; flex-wrap: wrap; }
.gis-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; }
.gis-photolist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.gis-photolist figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.gis-photolist img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--r-sm); background: #eef3f8; }
.gis-photolist figcaption { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; color: var(--muted); word-break: break-all; }
.gis-maint { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 14px; }
.gis-maint .gis-list { max-height: 60vh; }
.gis-maint table input { width: 100%; }
.gis-iconprev { display: flex; align-items: center; gap: 8px; }
.gis-iconprev img { width: 32px; height: 32px; object-fit: contain; }
.trip-stops { overflow-x: auto; max-width: 100%; }
.trip-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.trip-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r); background: rgba(232, 242, 252, .65); border: 1px solid var(--glass-edge); }
.trip-stats span { font-size: 11px; color: var(--muted); }
.trip-stats b { font-size: 15px; color: var(--blue-dd); }
.mmap { position: absolute; inset: 0; overflow: hidden; background: #e8eef3; touch-action: none; user-select: none; outline: none; cursor: grab; }
.mmap.panning { cursor: grabbing; }
.mmap.drawing { cursor: crosshair; }
.mmap:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.mmap-tiles, .mmap-marks { position: absolute; inset: 0; }
.mmap-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.mmap-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.mmap-svg .hit { pointer-events: visiblePainted; cursor: pointer; }
.mmap-marks { pointer-events: none; }
.mmap-mark { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; }
.mmap-mark.drag { cursor: move; }
.mmap-pin { --c: #1a7fd4; position: absolute; left: -13px; top: -34px; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; }
.mmap-pin span { transform: rotate(45deg); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.mmap-pin.small { left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; transform: none; }
.mmap-icon { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.mmap-label { position: absolute; left: 14px; top: -30px; white-space: nowrap; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.mmap-pop > :not(.mmap-popx) { max-height: 260px; overflow: auto; }
.mmap-pop { --tip: 50%; position: absolute; left: 0; top: 0; z-index: 5; min-width: 160px; max-width: min(300px, calc(100% - 12px)); padding: 10px 26px 10px 12px; border-radius: var(--r); background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); cursor: auto; user-select: text; }
.mmap-pop::after { content: ""; position: absolute; left: var(--tip); bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff; }
.mmap-pop.below::after { bottom: auto; top: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: #fff; }
.mmap-popx { position: absolute; right: 4px; top: 4px; }
.mmap-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; border-radius: var(--r-sm); overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); z-index: 4; }
.mmap-zoom button { width: 32px; height: 32px; border: 0; background: #fff; font-size: 18px; cursor: pointer; }
.mmap-zoom button + button { border-top: 1px solid #e3e8ee; }
.mmap-zoom button:hover { background: var(--blue-l); }
.mmap-bar { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); font-size: 12px; max-width: calc(100% - 80px); flex-wrap: wrap; }
.mmap-attr { position: absolute; right: 0; bottom: 0; z-index: 4; font-size: 10px; padding: 1px 6px; background: rgba(255, 255, 255, .8); color: #333; }

/* customer display (index.php#customer-display on a second screen) */
.cd-body { margin: 0; }
.cd { min-height: 100vh; display: flex; flex-direction: column; padding: 3vh 4vw; gap: 2vh; font-size: clamp(16px, 2.3vw, 30px); }
.cd-head { font-weight: 700; color: var(--blue-dd); font-size: .9em; }
.cd-lines { flex: 1; overflow: auto; border-radius: var(--r-lg); padding: 1vh 2vw; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow), var(--shine); }
.cd-lines table { width: 100%; border-collapse: collapse; }
.cd-lines td { padding: .45em .3em; border-bottom: 1px solid var(--line); }
.cd-lines td.n { text-align: right; white-space: nowrap; }
.cd-total { display: flex; justify-content: space-between; align-items: baseline; padding: 1.5vh 2vw; border-radius: var(--r-lg); color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dd)); box-shadow: var(--shadow); }
.cd-total b { font-size: 2em; }
.cd-idle { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 1.2vh; align-items: center; min-width: min(640px, 90vw); }
.cd-idle img { height: 18vh; width: auto; max-width: 70vw; }
.cd-idle h1 { margin: 0; color: var(--blue-dd); font-size: 2.2em; }
.cd-row { display: flex; justify-content: space-between; width: 100%; padding: .5em 1em; border-radius: var(--r); background: var(--glass-strong); }
.cd-row.cd-big { font-size: 1.5em; color: var(--blue-dd); }

/* ---------------------------------------------------------------- dialogs & toasts */
.overlay { position: fixed; inset: 0; background: rgba(13, 38, 66, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 12px; overflow: auto; }
.dialog { border-radius: 22px; width: 540px; max-width: 100%; display: flex; flex-direction: column; max-height: 88vh; background: rgba(255, 255, 255, .84); animation: dlgIn .16s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: scale(.98) translateY(6px); } to { opacity: 1; transform: none; } }
.dialog.wide { width: 1120px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--blue-dd); }
.dialog-body { padding: 14px 18px; overflow: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { color: #fff; padding: 11px 16px; border-radius: 14px; max-width: 420px; transition: opacity .5s; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  background: rgba(38, 50, 56, .82); border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 10px 28px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .25); }
.toast.ok { background: rgba(46, 125, 50, .86); } .toast.err { background: rgba(198, 40, 40, .88); }
.toast.hide { opacity: 0; }
.notiflist { display: flex; flex-direction: column; gap: 6px; }
.notifrow { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; cursor: pointer; background: rgba(255, 255, 255, .6); }
.notifrow.unread { border-left: 4px solid var(--blue); background: rgba(232, 242, 252, .8); }
.themepick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.themepick button { border-radius: var(--r); padding: 14px; cursor: pointer; border: 2px solid transparent; text-align: left; background: rgba(255, 255, 255, .7); }
.themepick button.on { border-color: var(--blue); }
.themepick .sample { height: 54px; border-radius: 10px; margin-bottom: 8px; position: relative; overflow: hidden; }
.themepick .sample.glass { background: linear-gradient(135deg, rgba(61, 151, 230, .55), rgba(255, 255, 255, .6)), radial-gradient(circle at 20% 20%, #fff, #cfe5f8); box-shadow: inset 0 1px 0 #fff; }
.themepick .sample.classic { background: linear-gradient(180deg, #1a7fd4 0 40%, #fff 40%); border: 1px solid #d9dee4; }
.themepick .sample.frost { background: linear-gradient(165deg, transparent 38%, #1b55dc 46%, #8cc0ff 56%, #2f78f7 64%, #0a3cc0 74%, transparent 84%), linear-gradient(135deg, #8fb3e6, #4d7dd6); }
.themepick .sample.frost::after { content: ""; position: absolute; left: 22%; right: 22%; top: 12px; bottom: 10px; border-radius: 9px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.avatar { display: none; }

/* ---------------------------------------------------------------- classic (flat) theme + no-blur fallback */
body.theme-classic { background: #f2f3f4; }
body.theme-classic header.top, body.theme-classic .card, body.theme-classic .dialog, body.theme-classic .dropdown, body.theme-classic .mdrop, body.theme-classic .searchres,
body.theme-classic .tile, body.theme-classic .kpi, body.theme-classic .box, body.theme-classic .login-card, body.theme-classic main#content, body.theme-classic .cccol,
body.theme-classic .gridwrap, body.theme-classic .toolbar.sticky, body.theme-classic .tab, body.theme-classic .btn {
  background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); border-color: var(--line-solid);
}
body.theme-classic .card::before, body.theme-classic .dialog::before, body.theme-classic .tile::before, body.theme-classic .kpi::before, body.theme-classic .login-card::before, body.theme-classic header.top::before { display: none; }
body.theme-classic header.top { margin: 0; border-radius: 0; }
body.theme-classic nav.menubar { background: var(--blue); margin: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.theme-classic .tab { border-radius: 6px 6px 0 0; background: #e6e9ec; }
body.theme-classic .tab.on { background: var(--blue); }
body.theme-classic .btn.primary { background: var(--blue); }
body.theme-classic main#content { border-radius: 0 6px 6px 6px; }
body.theme-classic table.grid th { background: #f3f6f9; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------------------------------------------------------------- "Frosted Cards" theme (body.theme-frost)
   Glassmorphism cards in the blues of a periwinkle sky with folded cobalt / azure ribbons: milky white frosted glass with
   deep navy text, liquid rims, story-ring icons and avatar, azure-to-cobalt primary buttons. Built on the light base styles;
   the panes keep enough white that navy text stays readable over the dark ribbons. */
body.theme-frost {
  --blue: #1f63e8; --blue-d: #1450c8; --blue-dd: #0b3aa0; --blue-l: #e6efff; --blue-ll: #f2f7ff;
  --ink: #0b2350; --muted: #2b4270; --line: rgba(20, 80, 200, .15); --line-solid: #cfdcf2;
  --f-main: rgba(255, 255, 255, .56); --f-bar: rgba(255, 255, 255, .62); --f-hl: rgba(31, 99, 232, .1);
  --glass: rgba(255, 255, 255, .55); --glass-strong: rgba(255, 255, 255, .9); --glass-soft: rgba(255, 255, 255, .45);
  --glass-edge: rgba(255, 255, 255, .88); --glass-blur: blur(24px) saturate(160%);
  --shadow: 0 14px 40px rgba(16, 60, 160, .18), 0 2px 8px rgba(16, 60, 160, .08);
  --shine: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .3);
  --r-lg: 24px; --r: 16px; --r-sm: 11px;
  --s0: #1f63e8; --s1: #7ab8ff;
  --accent: linear-gradient(135deg, #5aa2ff 0%, #2368f0 50%, #0b3fc6 100%);
  --accent-hi: linear-gradient(135deg, #6fb0ff 0%, #3478f4 50%, #1449d0 100%);
  --accent-glow: rgba(35, 104, 240, .35);
  --ring: conic-gradient(from 200deg, #ffffff, #b9dbff, #4b92ff, #0d43c9, #7ab8ff, #ffffff);
  --ring-in: radial-gradient(circle at 35% 30%, #ffffff, #dbe9fd 72%); --ring-gap: #ffffff;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* periwinkle sky with folded cobalt / azure ribbons (drawn once, behind everything) */
  --ribbons: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' y1='0' x2='.4' y2='1'%3E%3Cstop offset='0' stop-color='%23a3c1eb'/%3E%3Cstop offset='1' stop-color='%237ea4df'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%230b3fc6'/%3E%3Cstop offset='.15' stop-color='%232f7bff'/%3E%3Cstop offset='.3' stop-color='%239cc9ff'/%3E%3Cstop offset='.42' stop-color='%233a84ff'/%3E%3Cstop offset='.55' stop-color='%230d47d4'/%3E%3Cstop offset='.7' stop-color='%235ea4ff'/%3E%3Cstop offset='.85' stop-color='%231b5ff0'/%3E%3Cstop offset='1' stop-color='%230a3cc0'/%3E%3C/linearGradient%3E%3ClinearGradient id='d' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%232a6cf5'/%3E%3Cstop offset='.5' stop-color='%230b3cbc'/%3E%3Cstop offset='1' stop-color='%231d5fe8'/%3E%3C/linearGradient%3E%3ClinearGradient id='l' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%236aa8ff'/%3E%3Cstop offset='.3' stop-color='%231e5fe9'/%3E%3Cstop offset='.55' stop-color='%23a9d0ff'/%3E%3Cstop offset='.75' stop-color='%232c72f6'/%3E%3Cstop offset='1' stop-color='%230b40c4'/%3E%3C/linearGradient%3E%3Cfilter id='s' x='-10%25' y='-20%25' width='120%25' height='160%25'%3E%3CfeDropShadow dx='0' dy='24' stdDeviation='28' flood-color='%230a3299' flood-opacity='.4'/%3E%3C/filter%3E%3C/defs%3E%3Crect width='1600' height='1000' fill='url(%23b)'/%3E%3Cg filter='url(%23s)'%3E%3Cpath d='M-100 470C200 360 430 600 760 470S1250 120 1700 190L1700 300C1300 250 1050 610 790 600S240 470-100 580Z' fill='url(%23d)'/%3E%3Cpath d='M-100 600C230 470 470 760 800 620S1280 300 1700 360L1700 520C1290 450 1040 800 800 790S260 680-100 760Z' fill='url(%23r)'/%3E%3Cpath d='M-100 760C260 690 500 900 820 820S1300 560 1700 600L1700 700C1320 680 1080 960 820 980S260 870-100 930Z' fill='url(%23l)'/%3E%3Cpath d='M1050 1000C1150 820 1350 700 1700 760L1700 1000Z' fill='url(%23d)'/%3E%3C/g%3E%3Cpath d='M-100 600C230 470 470 760 800 620S1280 300 1700 360' fill='none' stroke='%23fff' stroke-opacity='.55' stroke-width='4'/%3E%3Cpath d='M-100 760C260 690 500 900 820 820S1300 560 1700 600' fill='none' stroke='%23fff' stroke-opacity='.45' stroke-width='3'/%3E%3Cpath d='M-100 470C200 360 430 600 760 470S1250 120 1700 190' fill='none' stroke='%23cfe3ff' stroke-opacity='.5' stroke-width='3'/%3E%3C/svg%3E");
  color: var(--ink);
  background: var(--grain) 0 0 / 160px 160px repeat, var(--ribbons) center / cover no-repeat, #9dbdea;
  background-attachment: fixed;
}
body.theme-frost ::selection { background: rgba(31, 99, 232, .25); }
/* frosted surfaces: milky sheen + grain, and a liquid rim (white on top, a breath of blue below) */
body.theme-frost :is(.card, .dialog, .tile, .kpi, .login-card, header.top)::before {
  background: linear-gradient(155deg, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, .15) 38%, rgba(255, 255, 255, 0) 60%), var(--grain);
}
body.theme-frost :is(.card, .dialog, .tile, .login-card, header.top)::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, #fff, rgba(255, 255, 255, .5) 30%, rgba(120, 165, 240, .18) 60%, rgba(255, 255, 255, .7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
body.theme-frost :is(input, select, textarea) { background: rgba(255, 255, 255, .78); border-color: rgba(20, 80, 200, .2); }
body.theme-frost :is(input, select, textarea):hover { border-color: rgba(31, 99, 232, .45); }
body.theme-frost :is(input, select, textarea):focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 99, 232, .2); }
body.theme-frost input[readonly] { background: rgba(230, 239, 255, .6); color: #34507f; }
/* buttons: milky pills; primary = azure-to-cobalt gradient */
body.theme-frost .btn { background: rgba(255, 255, 255, .7); border-color: rgba(20, 80, 200, .18); }
body.theme-frost .btn:hover { background: #fff; border-color: rgba(31, 99, 232, .45); box-shadow: 0 6px 16px rgba(16, 60, 160, .16), var(--shine); }
body.theme-frost .btn.primary { background: var(--accent); border-color: rgba(11, 58, 160, .35); color: #fff; box-shadow: 0 8px 22px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .5); }
body.theme-frost .btn.primary:hover { background: var(--accent-hi); box-shadow: 0 10px 26px rgba(35, 104, 240, .45), inset 0 1px 0 rgba(255, 255, 255, .55); }
/* login: the card is a profile card, the logo an avatar in a story ring */
body.theme-frost .login-card { background: var(--f-bar); }
body.theme-frost .login-card h2 { color: var(--blue-dd); }
body.theme-frost .login-card label { color: var(--ink); }
body.theme-frost :is(.login-logo, .brand img) { filter: drop-shadow(0 4px 10px rgba(16, 60, 160, .2)); }
/* header, menu, tabs */
body.theme-frost header.top { background: var(--f-bar); }
body.theme-frost :is(.searchres a, .dropdown a, .msub a, .cccol a):hover { background: var(--f-hl); color: var(--blue-dd); }
body.theme-frost .branchlbl { color: var(--muted); }
body.theme-frost .userbtn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 13px 3px 3px; background: rgba(255, 255, 255, .72); }
body.theme-frost .uico { display: none; }
body.theme-frost .avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; font-size: 11px; font-weight: 700; letter-spacing: .3px; color: #fff;
  background: var(--accent) padding-box, var(--ring) border-box; box-shadow: inset 0 0 0 2px var(--ring-gap); }
body.theme-frost nav.menubar { background: var(--f-bar); border-color: var(--glass-edge); box-shadow: var(--shadow), var(--shine); }
body.theme-frost :is(nav.menubar > a, .mgroup > a) { color: var(--ink); text-shadow: none; }
body.theme-frost :is(nav.menubar > a:hover, .mgroup:hover > a) { background: var(--f-hl); color: var(--blue-dd); box-shadow: none; }
body.theme-frost .tab { background: rgba(255, 255, 255, .6); border-color: var(--glass-edge); }
body.theme-frost .tab:hover { background: rgba(255, 255, 255, .85); }
body.theme-frost .tab.on { background: var(--accent); color: #fff; border-color: rgba(11, 58, 160, .3); box-shadow: 0 8px 20px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .5); }
body.theme-frost main#content { background: var(--f-main); }
body.theme-frost footer { margin: 10px 12px 12px; border-radius: 999px; color: var(--muted); background: var(--f-bar); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shine); }
/* command center: tiles are profile cards with story-ring icons */
body.theme-frost :is(.tile:hover, .tile.on) { background: rgba(255, 255, 255, .82); }
body.theme-frost .tile.on { border-color: rgba(31, 99, 232, .5); box-shadow: 0 0 0 2px rgba(31, 99, 232, .3), 0 16px 36px rgba(16, 60, 160, .2), var(--shine); }
body.theme-frost .ticon { border: 3px solid transparent; background: var(--ring-in) padding-box, var(--ring) border-box; box-shadow: inset 0 0 0 3px var(--ring-gap), 0 10px 24px var(--accent-glow); }
body.theme-frost .tsub { margin-top: -4px; padding: 2px 10px; border-radius: 999px; background: rgba(31, 99, 232, .1); color: var(--blue-dd); }
/* dashboard: stat cards with a blue glow */
body.theme-frost .kpi { padding: 16px 18px; transition: transform .16s, box-shadow .16s; }
body.theme-frost .kpi:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(16, 60, 160, .22), var(--shine); }
body.theme-frost .kpi > * { z-index: 1; }
body.theme-frost .kpi::after { left: auto; bottom: auto; top: -48px; right: -42px; width: 136px; height: 136px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 116, 245, .38), transparent 68%); }
body.theme-frost .kpi:nth-child(6n+2)::after { background: radial-gradient(circle, rgba(90, 170, 255, .45), transparent 68%); }
body.theme-frost .kpi:nth-child(6n+3)::after { background: radial-gradient(circle, rgba(11, 63, 198, .34), transparent 68%); }
body.theme-frost .kpi:nth-child(6n+4)::after { background: radial-gradient(circle, rgba(34, 211, 238, .38), transparent 68%); }
body.theme-frost .kpi:nth-child(6n+5)::after { background: radial-gradient(circle, rgba(122, 184, 255, .5), transparent 68%); }
body.theme-frost .kpi:nth-child(6n)::after { background: radial-gradient(circle, rgba(29, 78, 216, .34), transparent 68%); }
body.theme-frost .kpi.warn::after { background: radial-gradient(circle, rgba(245, 158, 11, .4), transparent 68%); }
body.theme-frost .kpi small { font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; }
body.theme-frost .kpi b { font-size: 22px; }
/* cards, grids, boards */
body.theme-frost .card { padding: 16px 18px; }
body.theme-frost .card > h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 1px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(35, 104, 240, .6); }
body.theme-frost table.grid th { background: rgba(228, 238, 253, .95); color: #1a3466; }
body.theme-frost table.grid tr.click:hover td { background: var(--f-hl); }
body.theme-frost .meter i { background: var(--accent); }
body.theme-frost .chip { background: rgba(31, 99, 232, .12); color: var(--blue-dd); }
body.theme-frost .gis-map { box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .7); }
body.theme-frost .cd-total { background: var(--accent); }
/* dialogs */
body.theme-frost .overlay { background: rgba(20, 50, 120, .25); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); }
body.theme-frost .dialog { background: rgba(255, 255, 255, .86); }
body.theme-frost .themepick button.on { border-color: var(--blue); }
@media (prefers-reduced-transparency: reduce) {
  body.theme-frost { --f-main: rgba(255, 255, 255, .9); --glass: rgba(255, 255, 255, .94); --glass-soft: rgba(255, 255, 255, .9); --f-bar: rgba(255, 255, 255, .94); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, .92); --glass-strong: #fff; --glass-soft: rgba(255, 255, 255, .85); }
}

@media (max-width: 760px) {
  header.top { flex-wrap: wrap; margin: 6px 6px 0; }
  nav.menubar { margin: 6px 6px 0; }
  .top-mid { order: 5; max-width: none; flex-basis: 100%; }
  .mdrop { position: fixed; left: 8px !important; right: 8px !important; top: 130px; width: auto; max-height: calc(100vh - 140px); }
  .mcols { columns: 1; }
  main#content { margin: 6px 6px 0; }
  .pane { padding: 12px 10px 24px; }
  .tabstrip { padding: 10px 8px 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  header, nav, .tabstrip, footer, .toolbar { display: none !important; }
  body { background: #fff; }
  body.theme-frost { background: #fff; color-scheme: light; }
  body.theme-frost, body.theme-frost * { color: #111 !important; text-shadow: none !important; }
  main#content, .card, .gridwrap { background: #fff !important; box-shadow: none !important; border: 0 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
