/* Dew Drop Production — same brand as Dew Drop Distributors (royal blue, lime, aqua, orange; DM Sans),
   laid out for daily operations: left sidebar, compact tables, status chips, printable documents. */
:root {
  --blue: #23308A; --blue-d: #18226B; --blue-l: #EAEEFB; --blue-m: #C9D2F2;
  --lime: #6CB12B; --lime-d: #579320; --lime-l: #EEF7E4;
  --aqua: #1FA3DC; --aqua-l: #E3F4FB; --orange: #F28C28; --orange-l: #FFF1E0;
  --red: #C8362B; --red-l: #FBEAE8; --amber: #B7791F; --amber-l: #FFF6DD; --purple: #7B3FC4; --purple-l: #F1E9FB;
  --ink: #141A3A; --ink-2: #3A4166; --muted: #6B7193; --bg: #F4F7FC; --card: #fff; --line: #E0E5F2; --line-2: #EEF1F8;
  --radius: 12px; --shadow: 0 1px 3px rgba(20,26,58,.06), 0 2px 10px rgba(20,26,58,.04); --shadow-lg: 0 14px 44px rgba(20,26,58,.2);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--blue-l); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 12px; } .hide { display: none !important; } .grow { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; } .b { font-weight: 700; }

/* ── header ─────────────────────────────────────────── */
.hdr { position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 40; background: #fff; box-shadow: 0 1px 0 var(--line); display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.hdr::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, var(--blue) 0 40%, var(--aqua) 40% 70%, var(--lime) 70% 100%); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex-shrink: 0; width: calc(var(--side) - 30px); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-txt b { display: block; font-size: 15px; font-weight: 800; color: var(--blue); letter-spacing: 1.4px; line-height: 1; text-transform: uppercase; }
.brand-txt span { display: block; font-size: 10.5px; font-weight: 700; color: var(--lime-d); letter-spacing: .3px; text-transform: uppercase; margin-top: 3px; }
.hdr-mid { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hdr-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.branch-pick { border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; font-weight: 600; max-width: 220px; }
.gsearch { position: relative; flex: 1; max-width: 420px; }
.gsearch input { width: 100%; padding: 9px 12px 9px 36px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); outline: none; }
.gsearch input:focus { border-color: var(--blue); background: #fff; }
.gsearch svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.gs-res { position: absolute; top: 44px; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto; z-index: 50; padding: 6px; }
.gs-res a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); align-items: center; }
.gs-res a:hover, .gs-res a.on { background: var(--bg); text-decoration: none; }
.gs-res small { color: var(--muted); margin-left: auto; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 7px; border-radius: 8px; color: var(--ink-2); display: inline-grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--bg); color: var(--blue); } .icon-btn svg { width: 20px; height: 20px; }
.icon-btn.danger:hover { color: var(--red); }
.dot { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-l); color: var(--blue); font-weight: 800; display: grid; place-items: center; border: 2px solid var(--blue); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.menu-btn { display: none; }
.pop { position: fixed; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; padding: 6px; min-width: 240px; animation: pop .15s; }
.pop .who { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; } .pop .who b { display: block; } .pop .who small { color: var(--muted); }
.pop a, .pop button.mi { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; color: var(--ink); border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.pop a:hover, .pop button.mi:hover { background: var(--bg); text-decoration: none; } .pop svg { width: 17px; height: 17px; color: var(--ink-2); flex-shrink: 0; }
.notif-pop { width: min(400px, 94vw); max-height: 70vh; overflow-y: auto; }
.notif { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); border-left: 3px solid transparent; }
.notif.unread { background: var(--blue-l); border-left-color: var(--blue); } .notif:hover { background: var(--bg); text-decoration: none; }
.notif b { display: block; font-size: 13.5px; } .notif span { display: block; font-size: 12.5px; color: var(--ink-2); white-space: pre-line; } .notif small { color: var(--muted); font-size: 11.5px; }

/* ── sidebar ────────────────────────────────────────── */
.side { position: fixed; top: 67px; left: 0; bottom: 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); overflow-y: auto; z-index: 30; padding: 10px 10px 40px; }
.side .grp { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 14px 10px 6px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; position: relative; }
.side a:hover { background: var(--bg); color: var(--blue); text-decoration: none; }
.side a.on { background: var(--blue-l); color: var(--blue); }
.side a.on::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lime); }
.side a svg { width: 18px; height: 18px; flex-shrink: 0; }
.side a .cnt { margin-left: auto; background: var(--orange); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.main { margin-left: var(--side); padding: 88px 26px 90px; max-width: calc(1500px + var(--side)); }
.side-bg { display: none; }

/* ── page ───────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.title { font-size: 25px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; display: inline-block; padding-bottom: 5px; border-bottom: 4px solid var(--lime); }
.subtitle { color: var(--muted); margin-top: 6px; font-size: 14px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; } .crumb a { font-weight: 600; }
.section { margin-top: 22px; }
.section-title { font-size: 15px; font-weight: 800; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; letter-spacing: .3px; }
.section-title::after { content: ''; width: 30px; height: 3px; background: var(--lime); border-radius: 2px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); } .g-1-2 { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; border: 1px solid rgba(224,229,242,.7); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.card-h small { color: var(--muted); }
.card.flush { padding: 0; } .card.flush > .card-h { padding: 16px 18px 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; } .dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 600; min-width: 0; word-break: break-word; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kv > div { background: var(--bg); border-radius: 10px; padding: 10px 12px; } .kv small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .3px; }
.kv b { font-size: 15px; }
.note { background: var(--blue-l); color: var(--blue-d); padding: 11px 14px; border-radius: 8px; font-size: 13.5px; }
.warn { background: var(--amber-l); color: #7A5200; padding: 11px 14px; border-radius: 8px; font-size: 13.5px; }
.err { background: var(--red-l); color: var(--red); padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.ok-box { background: var(--lime-l); color: #3C6A12; padding: 11px 14px; border-radius: 8px; font-size: 13.5px; }
pre.pre { white-space: pre-wrap; font-family: inherit; margin: 0; font-size: 13.5px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.kpi { border-radius: 12px; color: #fff; padding: 16px 16px 14px; position: relative; overflow: hidden; box-shadow: var(--shadow); min-height: 112px; }
.kpi::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.1); }
.kpi .ic { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.kpi .ic svg { width: 21px; height: 21px; }
.kpi .lbl { font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .4px; opacity: .88; }
.kpi .val { font-size: 25px; font-weight: 800; margin-top: 4px; letter-spacing: -.3px; }
.kpi .sub { font-size: 12.5px; opacity: .92; margin-top: 2px; position: relative; z-index: 1; }
.kpi.c1 { background: linear-gradient(135deg,#23308A,#3346B5); } .kpi.c2 { background: linear-gradient(135deg,#1590C8,#33B9EA); }
.kpi.c3 { background: linear-gradient(135deg,#4E9620,#79C23A); } .kpi.c4 { background: linear-gradient(135deg,#E67A17,#F7A447); }
.kpi.c5 { background: linear-gradient(135deg,#6A33B0,#9361D6); } .kpi.c6 { background: linear-gradient(135deg,#B42D23,#DD5A4E); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border .15s, transform .15s; color: var(--ink); display: block; }
.tile:hover { border-color: var(--blue); transform: translateY(-2px); text-decoration: none; }
.tile small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; } .tile b { font-size: 22px; }
.tile.alert { border-color: #F3C3BD; background: #FFF8F7; } .tile.alert b { color: var(--red); }
.tile.good b { color: var(--lime-d); }
.trend-up { font-weight: 700; } .trend-down { font-weight: 700; color: #FFE0DC; }
.clickable { cursor: pointer; transition: transform .18s, box-shadow .18s; } .clickable:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20,26,58,.12); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 8px; padding: 9px 15px; font-weight: 700; cursor: pointer; background: var(--blue); color: #fff; white-space: nowrap; transition: background .15s, transform .05s; font-size: 14px; }
.btn:hover { background: var(--blue-d); text-decoration: none; } .btn:active { transform: translateY(1px); } .btn svg { width: 17px; height: 17px; }
.btn.lime { background: var(--lime); } .btn.lime:hover { background: var(--lime-d); }
.btn.orange { background: var(--orange); } .btn.orange:hover { background: #D9741A; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); } .btn.ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn.danger { background: var(--red); } .btn.danger:hover { background: #A72A20; }
.btn.link { background: none; color: var(--blue); padding: 5px 7px; } .btn.link:hover { background: var(--blue-l); }
.btn.sm { padding: 6px 11px; font-size: 13px; } .btn.lg { padding: 13px 24px; font-size: 15.5px; } .btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* forms */
label.f { display: block; min-width: 0; } label.f > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--ink-2); }
label.f > span i { font-style: normal; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; min-width: 0; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35,48,138,.12); }
.input.sm { padding: 6px 8px; font-size: 13.5px; }
textarea.input { min-height: 86px; resize: vertical; }
.input.bad { border-color: var(--red); background: #FFF8F7; } .input.good { border-color: var(--lime); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; } .fgrid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .fgrid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.fgrid .full { grid-column: 1 / -1; } .fgrid .fsec { grid-column: 1 / -1; font-weight: 800; font-size: 12.5px; text-transform: uppercase; color: var(--blue); letter-spacing: .4px; border-bottom: 1px solid var(--line-2); padding: 8px 0 4px; }
.check { display: flex; gap: 9px; align-items: center; cursor: pointer; } .check input { width: 17px; height: 17px; accent-color: var(--blue); }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--ink-2); font-size: 13.5px; }
.seg button.on { background: var(--blue); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; font-size: 14px; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--lime); } .tabs button .cnt { background: var(--line-2); color: var(--ink-2); border-radius: 10px; padding: 0 7px; font-size: 11.5px; margin-left: 4px; }

/* tables */
.tbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tbar .tsearch { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
.tbar .tsearch input { padding-left: 32px; } .tbar .tsearch svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.tbar select.input { width: auto; max-width: 200px; }
.tbl-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; padding: 9px 9px; border-bottom: 2px solid var(--line-2); white-space: nowrap; position: sticky; top: 0; background: #fff; }
.tbl th.sortable { cursor: pointer; user-select: none; } .tbl th.sortable:hover { color: var(--blue); } .tbl th .arr { font-size: 10px; margin-left: 3px; }
.tbl td { padding: 9px 9px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #F8FAFE; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--ink-2); border-bottom: 0; background: #FAFBFE; }
.tbl tr.bad td { background: #FFF8F7; } .tbl tr.warn td { background: #FFFBEF; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); }
.tmore { text-align: center; padding: 12px; }
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--line); display: block; margin: 0 auto 10px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; text-transform: capitalize; }
.b-green { background: var(--lime-l); color: #3C6A12; } .b-orange { background: var(--orange-l); color: #A85A00; } .b-red { background: var(--red-l); color: var(--red); }
.b-grey { background: var(--line-2); color: var(--ink-2); } .b-blue { background: var(--blue-l); color: var(--blue); } .b-aqua { background: var(--aqua-l); color: #0F6F99; } .b-purple { background: var(--purple-l); color: var(--purple); }
.b-amber { background: var(--amber-l); color: #7A5200; }
.bar { height: 8px; background: var(--line-2); border-radius: 5px; overflow: hidden; min-width: 60px; } .bar > i { display: block; height: 100%; background: var(--lime); border-radius: 5px; }
.bar.low > i { background: var(--red); } .bar.mid > i { background: var(--orange); }

/* line editor */
.lines-ed table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lines-ed th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 5px; border-bottom: 2px solid var(--line-2); white-space: nowrap; }
.lines-ed td { padding: 5px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.lines-ed td .input { padding: 7px 8px; font-size: 13.5px; }
.lines-ed .hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lines-ed .hint.bad { color: var(--red); font-weight: 700; }
.lines-wrap { overflow-x: auto; }

/* workflow stepper */
.flow { display: flex; gap: 0; margin: 4px 0 18px; overflow-x: auto; padding-bottom: 4px; }
.flow div { flex: 1; min-width: 110px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; position: relative; padding-top: 34px; }
.flow div::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted); z-index: 1; font-size: 12px; }
.flow div::after { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.flow div:first-child::after { display: none; }
.flow div.done { color: var(--lime-d); } .flow div.done::before { background: var(--lime); border-color: var(--lime); color: #fff; content: '✓'; } .flow div.done::after { background: var(--lime); }
.flow div.on { color: var(--blue); } .flow div.on::before { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 5px var(--blue-l); } .flow div.on::after { background: var(--lime); }
.flow div.stop { color: var(--red); } .flow div.stop::before { background: var(--red); border-color: var(--red); color: #fff; content: '✕'; }
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: linear-gradient(135deg, #F4F7FF, #EEF7E4); border: 1px solid var(--blue-m); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.action-bar .what { flex: 1; min-width: 200px; } .action-bar .what b { display: block; font-size: 15px; } .action-bar .what span { color: var(--ink-2); font-size: 13.5px; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); }
.timeline li::after { content: ''; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line); } .timeline li:last-child::after { display: none; }
.timeline small { color: var(--muted); display: block; }
.qc-pass { color: var(--lime-d); font-weight: 800; } .qc-fail { color: var(--red); font-weight: 800; }
.status-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.mcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; border-left: 4px solid var(--lime); cursor: pointer; color: var(--ink); display: block; }
.mcard:hover { box-shadow: var(--shadow); text-decoration: none; }
.mcard.breakdown { border-left-color: var(--red); background: #FFF8F7; } .mcard.maintenance { border-left-color: var(--orange); } .mcard.idle { border-left-color: var(--muted); } .mcard.retired { opacity: .5; }
.mcard b { display: block; font-size: 13.5px; } .mcard small { color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; }
.cal .day { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 120px; padding: 8px; }
.cal .day.today { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-l); } .cal .day.past { background: #FAFBFD; }
.cal .day h5 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; }
.cal .bt { display: block; font-size: 12px; padding: 5px 7px; border-radius: 6px; margin-bottom: 5px; color: var(--ink); border-left: 3px solid var(--blue); background: var(--blue-l); line-height: 1.3; }
.cal .bt:hover { text-decoration: none; filter: brightness(.97); }
.cal .bt.requested { border-left-color: var(--orange); background: var(--orange-l); } .cal .bt.received { border-left-color: var(--lime); background: var(--lime-l); }
.cal .bt.in_progress { border-left-color: var(--aqua); background: var(--aqua-l); } .cal .bt.sent { border-left-color: var(--purple); background: var(--purple-l); }

/* charts */
.chart-box { position: relative; height: 280px; } .chart-box.sm { height: 220px; } .chart-box.xs { height: 170px; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { background: linear-gradient(165deg, #18226B 0%, #23308A 45%, #1A7FC0 100%); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { font-size: 38px; font-weight: 800; line-height: 1.12; margin-top: 36px; max-width: 540px; } .auth-hero h1 em { font-style: normal; color: #9BDB5A; }
.auth-hero p { font-size: 16.5px; opacity: .92; max-width: 520px; }
.hero-points { display: grid; gap: 12px; margin-top: 26px; max-width: 500px; position: relative; z-index: 1; }
.hero-points div { display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.1); padding: 12px 15px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); }
.hero-points svg { width: 23px; height: 23px; flex-shrink: 0; color: #9BDB5A; }
.auth-hero .brand { width: auto; } .auth-hero .brand-logo { background: #fff; border-radius: 14px; padding: 6px 10px; height: 64px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.auth-hero .brand-txt b { color: #fff; font-size: 18px; } .auth-hero .brand-txt span { color: #BFE88F; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: radial-gradient(circle at 80% 10%, #E6ECFA, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 25px; font-weight: 800; text-transform: uppercase; display: inline-block; border-bottom: 4px solid var(--lime); padding-bottom: 6px; margin-bottom: 8px; }
.bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bubbles i { position: absolute; bottom: -40px; width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); animation: rise 12s linear infinite; }
.bubbles i:nth-child(1) { left: 8%; } .bubbles i:nth-child(2) { left: 22%; width: 8px; height: 8px; animation-delay: 3s; animation-duration: 9s; }
.bubbles i:nth-child(3) { left: 38%; width: 20px; height: 20px; animation-delay: 6s; } .bubbles i:nth-child(4) { left: 55%; animation-delay: 1.5s; animation-duration: 14s; }
.bubbles i:nth-child(5) { left: 68%; width: 10px; height: 10px; animation-delay: 4.5s; } .bubbles i:nth-child(6) { left: 80%; width: 24px; height: 24px; animation-delay: 7s; animation-duration: 15s; }
@keyframes rise { to { transform: translateY(-110vh) translateX(20px); opacity: 0; } }
.pw-wrap { position: relative; display: block; } .pw-wrap .input { padding-right: 44px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.pw-eye svg { width: 19px; height: 19px; }

/* modal, toast, drawer */
.modal-bg { position: fixed; inset: 0; background: rgba(15,20,45,.5); z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 34px 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 580px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { max-width: 980px; } .modal.xwide { max-width: 1200px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.modal-h h3 { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.modal-b { padding: 18px 20px; } .modal-f { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line-2); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(8px); opacity: 0; } }
#toast-root { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: 90vw; }
.toast.ok { background: var(--lime-d); } .toast.bad { background: var(--red); }
.help-fab { position: fixed; right: 20px; bottom: 20px; width: 54px; height: 54px; border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, #23308A, #1FA3DC); color: #fff; border: 0; cursor: pointer; z-index: 50; box-shadow: 0 6px 20px rgba(35,48,138,.4); display: grid; place-items: center; }
.help-fab svg { width: 27px; height: 27px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(15,20,45,.4); z-index: 75; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: #fff; z-index: 76; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-h { background: linear-gradient(135deg, #18226B, #23308A 60%, #1A7FC0); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.drawer-h h3 { font-size: 17px; text-transform: uppercase; font-weight: 800; }
.drawer-h button { background: rgba(255,255,255,.15); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 20px; }
.drawer-tabs { display: flex; border-bottom: 1px solid var(--line); }
.drawer-tabs button { flex: 1; background: none; border: 0; padding: 12px 6px; font-weight: 700; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; }
.drawer-tabs button.on { color: var(--blue); border-bottom-color: var(--lime); }
.drawer-b { overflow-y: auto; padding: 18px 20px 40px; flex: 1; }
.guide-list button { display: flex; width: 100%; text-align: left; gap: 12px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; margin-bottom: 8px; }
.guide-list button:hover { border-color: var(--blue); }
.guide-list .n { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-l); color: var(--blue); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; }
.guide h4 { font-size: 19px; font-weight: 800; margin-bottom: 6px; } .guide img { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 12px 0; display: block; }
.guide ol { padding-left: 20px; } .guide li { margin-bottom: 7px; } .guide .where { background: var(--amber-l); color: #7A5200; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.support-opt { display: flex; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; color: var(--ink); }
.support-opt:hover { border-color: var(--blue); text-decoration: none; }
.support-opt .si { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; } .support-opt .si svg { width: 21px; height: 21px; }
.support-opt b { display: block; } .support-opt small { color: var(--muted); }
.status-ic { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; } .status-ic svg { width: 40px; height: 40px; }
.bottombar { display: none; }

/* documents (print / PDF) */
.doc-sheet { background: #fff; max-width: 900px; margin: 0 auto; padding: 40px 44px; color: #111; font-size: 13px; }
.doc-sheet .dh { display: flex; justify-content: space-between; gap: 20px; border-bottom: 4px solid var(--blue); padding-bottom: 14px; margin-bottom: 16px; align-items: flex-start; }
.doc-sheet .dh img { height: 64px; } .doc-sheet .co { font-size: 12px; color: #444; margin-top: 4px; }
.doc-sheet h1 { font-size: 23px; color: var(--blue); text-transform: uppercase; font-weight: 800; text-align: right; } .doc-sheet .dno { text-align: right; font-size: 14px; font-weight: 700; }
.doc-sheet .meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px 18px; margin-bottom: 14px; }
.doc-sheet .meta div small { display: block; color: #666; font-size: 10.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .3px; } .doc-sheet .meta div b { font-size: 13px; }
.doc-sheet .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.doc-sheet .parties > div { border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; } .doc-sheet .parties small { display: block; color: #666; font-size: 10.5px; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.doc-sheet table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.doc-sheet th { background: var(--blue); color: #fff; text-align: left; padding: 7px 8px; font-size: 11px; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-sheet td { padding: 7px 8px; border-bottom: 1px solid #e4e4e4; vertical-align: top; } .doc-sheet .num { text-align: right; white-space: nowrap; }
.doc-sheet tfoot td { font-weight: 800; border-top: 2px solid #111; border-bottom: 0; }
.doc-sheet h3 { font-size: 13px; text-transform: uppercase; color: var(--blue); margin: 18px 0 4px; }
.doc-sheet .sigs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 46px; } .doc-sheet .sigs div { border-top: 1px solid #333; padding-top: 6px; font-size: 11.5px; color: #333; }
.doc-sheet .foot { margin-top: 26px; font-size: 10.5px; color: #777; border-top: 1px solid #eee; padding-top: 8px; display: flex; justify-content: space-between; }
.doc-sheet .notes { background: #f7f8fb; border-radius: 6px; padding: 8px 10px; margin-top: 12px; white-space: pre-wrap; }
#print-root { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  body.printing #app, body.printing .help-fab, body.printing #toast-root, body.printing #modal-root, body.printing .drawer, body.printing .drawer-bg, body.printing .pop { display: none !important; }
  body.printing #print-root { display: block; }
  .doc-sheet { padding: 0; max-width: none; box-shadow: none; }
  .doc-sheet tr { page-break-inside: avoid; }
  body:not(.printing) .hdr, body:not(.printing) .side, body:not(.printing) .help-fab, body:not(.printing) .no-print, body:not(.printing) .bottombar { display: none !important; }
  body:not(.printing) .main { margin: 0; padding: 0; }
}

/* responsive */
@media (max-width: 1180px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); z-index: 65; top: 0; padding-top: 16px; }
  .side.open { transform: none; } .side-bg.open { display: block; position: fixed; inset: 0; background: rgba(15,20,45,.4); z-index: 64; }
  .main { margin-left: 0; } .menu-btn { display: inline-grid; } .brand { width: auto; }
  .kpis, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-2-1, .g-1-2, .g3 { grid-template-columns: 1fr; }
  .gsearch { max-width: 300px; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .hdr { height: 58px; padding: 0 10px; gap: 8px; } .side { top: 0; } .main { padding: 76px 12px 96px; }
  .brand-logo { height: 38px; } .brand-txt { display: none; } .gsearch { display: none; } .branch-pick { max-width: 130px; font-size: 13px; padding: 6px 8px; }
  .title { font-size: 21px; } .g2, .fgrid, .fgrid.c3, .fgrid.c4 { grid-template-columns: 1fr; } .kpis { gap: 10px; } .kpi .val { font-size: 20px; } .kpi { min-height: 98px; padding: 13px; }
  .card { padding: 14px; } .tbl-wrap { margin: 0 -14px; padding: 0 14px; } .card.flush > .card-h { padding: 14px 14px 0; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-hero { padding: 24px 20px; } .auth-hero h1 { font-size: 26px; margin-top: 18px; } .hero-points { display: none; }
  .modal-bg { padding: 0; align-items: flex-end; } .modal { border-radius: 16px 16px 0 0; max-height: 94vh; overflow-y: auto; }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; box-shadow: 0 -3px 12px rgba(0,0,0,.08); z-index: 45; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 4px; }
  .bottombar a:hover { text-decoration: none; } .bottombar a svg { width: 22px; height: 22px; } .bottombar a.on { color: var(--blue); }
  .help-fab { bottom: 78px; right: 12px; width: 48px; height: 48px; } #toast-root { bottom: 140px; }
  .doc-sheet { padding: 18px; } .doc-sheet .meta { grid-template-columns: 1fr 1fr; } .doc-sheet .parties { grid-template-columns: 1fr; }
  .cal { grid-template-columns: 1fr; } .cal .day { min-height: 0; }
  .action-bar { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .bubbles { display: none; } * { animation: none !important; transition: none !important; } }

/* Powered & licensed by OpenIT Tally Limited */
.side .side-credit { display: block; margin-top: 18px; padding: 12px 10px 0; border-top: 1px solid var(--line-2); border-radius: 0; font-size: 11.5px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.side .side-credit b { color: var(--blue); } .side .side-credit:hover { background: none; } .side .side-credit:hover b { text-decoration: underline; }
.credit-link { color: var(--muted); font-size: 12.5px; } .credit-link b { color: var(--blue); } .credit-link:hover { text-decoration: none; } .credit-link:hover b { text-decoration: underline; }
.app-credit { margin-left: var(--side); text-align: center; font-size: 12.5px; color: var(--muted); padding: 0 16px 26px; margin-top: -62px; max-width: calc(1500px + var(--side)); }
.app-credit a { color: var(--blue); font-weight: 700; }
@media (max-width: 1180px) { .app-credit { margin-left: 0; } }
@media (max-width: 760px) { .app-credit { margin-top: -84px; padding: 0 64px 88px; } }
@media print { .app-credit { display: none !important; } }
