/* ---------- frame ---------- */
.app { display: flex; height: 100%; }
body.admin { overflow: hidden; }
.side { width: 236px; flex: none; background: var(--side); color: var(--side-ink); position: relative; z-index: 45; display: flex; flex-direction: column; padding: 16px 12px 14px; gap: 2px; overflow: hidden auto; scrollbar-width: none; transition: width .38s var(--ease-out); box-shadow: 8px 0 30px -12px rgba(0, 0, 0, .35); }
.side::-webkit-scrollbar { display: none; }
[data-side="closed"] .side { width: 68px; }
.brand { display: flex; align-items: center; gap: 12px; height: 44px; margin-bottom: 8px; flex: none; text-decoration: none; }
.brand-name { font-weight: 700; color: #f4efe9; font-size: 15px; white-space: nowrap; line-height: 1.300; }
.brand-name small { display: block; font-weight: 400; color: var(--side-ink); font-size: 11.500px; }
.s-toggle { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; margin: 0 9px 10px; color: var(--side-ink); background: var(--side-2); border: 1px solid rgba(255, 255, 255, .06); flex: none; transition: transform .38s var(--ease-out), color .2s; }
.s-toggle:hover { color: #fff; }
[data-side="closed"] .s-toggle { transform: rotate(180deg); }
.s-item { height: 38px; border-radius: 12px; display: flex; align-items: center; gap: 13px; padding: 0 12px; color: var(--side-ink); text-decoration: none; position: relative; transition: background .2s, color .2s; flex: none; width: 100%; font-size: 13.500px; }
.s-item:hover { background: rgba(255, 255, 255, .05); color: #ece6df; }
.s-item.on { background: rgba(255, 255, 255, .08); color: var(--accent-2); }
.s-item.on .lbl { color: #f6f1ec; }
.s-item.on::before { content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.s-item:focus-visible, .side-foot button:focus-visible { outline-color: #fff; outline-offset: -2px; }
.lbl, .me-name, .brand-name { white-space: nowrap; }
[data-side="closed"] .lbl, [data-side="closed"] .me-name, [data-side="closed"] .brand-name, [data-side="closed"] .s-search kbd, [data-side="closed"] .side-foot form { display: none; }
.badge { margin-inline-start: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.500px; font-weight: 700; display: grid; place-items: center; }
[data-side="closed"] .badge { position: absolute; top: 6px; inset-inline-start: 26px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 9.500px; border: 2px solid var(--side); }
.s-search { background: var(--side-2); border: 1px solid rgba(255, 255, 255, .06); margin-bottom: 6px; }
.s-search kbd { margin-inline-start: auto; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: var(--side-ink); }
.grp { font-size: 11px; color: #6f6865; padding: 10px 12px 4px; flex: none; white-space: nowrap; }
[data-side="closed"] .grp { height: 1px; padding: 0; margin: 8px 6px; background: rgba(255, 255, 255, .06); overflow: hidden; color: transparent; }
.side .grow { flex: 1; min-height: 10px; }
.side-foot { display: flex; align-items: center; gap: 11px; padding: 6px 4px; flex: none; position: sticky; bottom: -14px; background: var(--side); }
.side-foot .av { width: 38px; height: 38px; border: 2px solid var(--teal); box-shadow: 0 0 0 3px rgba(15, 147, 117, .2); background: var(--side-2); color: #7fd9c3; }
.me-name { font-size: 13px; color: #efe9e2; font-weight: 600; flex: 1; min-width: 0; line-height: 1.350; overflow: hidden; }
.me-name small { display: block; color: var(--side-ink); font-weight: 400; font-size: 11.500px; overflow: hidden; text-overflow: ellipsis; }
.side-foot button { color: var(--side-ink); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; flex: none; }
.side-foot button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
[data-side="closed"] .s-item[data-tip]:hover::after { content: attr(data-tip); position: fixed; inset-inline-start: 76px; background: #1d1a1b; color: #f4efe9; font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); z-index: 80; animation: tipIn .16s var(--ease-out); }
@keyframes tipIn { from { opacity: 0; transform: translateX(4px); } }

.main { flex: 1; min-width: 0; overflow: auto; position: relative; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100; background: var(--accent); transform: scaleX(0); transform-origin: right; opacity: 0; }
.progress.run { opacity: 1; transform: scaleX(.75); transition: transform .9s var(--ease-out); }
.progress.done { opacity: 0; transform: scaleX(1); transition: transform .15s, opacity .25s .1s; }
.shell { padding: 22px 34px 48px; max-width: 1680px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.crumb { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumb b { color: var(--ink); font-weight: 600; font-size: 14px; }
.crumb .sep { opacity: .6; transform: scaleX(-1); }
.synced { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--green); background: var(--green-soft); padding: 4px 11px; border-radius: 99px; }
.synced i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(53, 196, 140, .18); }
.tools { display: flex; align-items: center; gap: 8px; }
.nav-btn { display: none; }

.view.enter { animation: viewIn .45s var(--ease-out) both; }
.view.enter .reveal { animation: rise .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.sub { color: var(--ink-2); margin-top: 4px; }
.hero-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view h2 { margin: 22px 0 10px; }
.view .panel h2 { margin: 0; }

/* ---------- KPI + panels ---------- */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mb { margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; cursor: pointer; transition: transform .25s var(--ease); }
a.kpi:hover { transform: translateY(-2px); }
.k-body { padding: 16px 18px 14px; position: relative; flex: 1; }
.k-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; min-height: 36px; }
.tile-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--glass-2); border: 1px solid var(--line); color: var(--accent-2); flex: none; }
.tile-ic.g { color: var(--green); } .tile-ic.a { color: var(--amber); } .tile-ic.b { color: var(--blue); } .tile-ic.v { color: var(--violet); }
.go { color: var(--muted); transition: color .2s, transform .2s var(--ease); transform: scaleX(-1); }
.kpi:hover .go { color: var(--ink); }
.spark { position: absolute; top: 16px; inset-inline-end: 50px; color: var(--green); }
.spark path.draw { stroke-dasharray: 400; stroke-dashoffset: 400; animation: dash 1.200s var(--ease-out) .2s forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }
.k-lbl { color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.k-val { font-size: 25px; font-weight: 700; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; letter-spacing: -.02em; }
.k-val small { font-size: 12.500px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.k-foot { padding: 10px 18px; background: var(--glass-foot); border-top: 1px solid var(--line); font-size: 12.500px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 40px; }
.k-foot b { color: var(--ink); font-weight: 600; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.500px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.delta.bad { background: var(--red-soft); color: var(--red); }

.panel { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; gap: 10px; }
.p-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.500px; }
.p-title .ic { color: var(--ink-2); }
.p-title small { font-weight: 400; color: var(--muted); font-size: 12.500px; }
.cnt { font-size: 11.500px; color: var(--ink-2); background: var(--glass-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 7px; font-weight: 500; }
.p-link { color: var(--accent-ink); font-size: 13px; font-weight: 500; text-decoration: none; }
.p-link:hover { text-decoration: underline; }
.big-num { font-size: 22px; font-weight: 700; padding: 0 18px; letter-spacing: -.02em; }
.big-num small { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.big-sub { color: var(--muted); font-size: 12.500px; padding: 2px 18px 12px; }
.p-body { padding: 4px 10px 12px; flex: 1; }
.rw { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 13px; min-width: 0; text-decoration: none; color: inherit; transition: background .15s; }
a.rw { cursor: pointer; }
a.rw:hover { background: var(--glass-2); }
.rw .grow { flex: 1; min-width: 0; }
.rw .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rw .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-top: 1px; }
.rw .amt { font-weight: 600; white-space: nowrap; }
.rw .time { width: 62px; font-size: 12.500px; color: var(--ink-2); flex: none; }
.hbar { display: flex; align-items: center; gap: 10px; padding: 10px 8px; }
.hbar .nm { width: 108px; font-size: 13px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 9px; border-radius: 6px; background: var(--track); overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .7s var(--ease-out); }
.hbar .v { font-weight: 600; font-size: 13px; min-width: 74px; text-align: end; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- charts ---------- */
.caps { display: flex; gap: 8px; padding: 0 18px 14px; direction: ltr; }
.cap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.cap-track { height: 130px; border-radius: 10px; background: var(--track); display: flex; align-items: flex-end; overflow: hidden; }
.cap-track i { display: block; width: 100%; border-radius: 10px; background: var(--bar-mid); transform-origin: bottom; animation: growY .7s var(--ease-out) both; animation-delay: calc(var(--i) * 25ms); }
.cap.best .cap-track i { background: var(--bar); }
.cap.now .cap-track i { background: var(--accent-2); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.cap span { text-align: center; font-size: 11.500px; color: var(--muted); }
@keyframes growY { from { transform: scaleY(0); } }

.gauge { display: grid; place-items: center; position: relative; padding: 6px 0 4px; }
.gauge .g-c { position: absolute; text-align: center; top: 44%; transform: translateY(-50%); }
.gauge .g-c b { font-size: 28px; font-weight: 700; display: block; line-height: 1.200; }
.gauge .g-c span { font-size: 12px; color: var(--muted); }
.gauge .g-arc { stroke: var(--accent); }
.gauge .g-bg { stroke: var(--track); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 18px; }
.mini { background: var(--glass-foot); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; }
.mini span { font-size: 11.500px; color: var(--muted); display: block; }
.mini b { font-size: 15px; font-weight: 700; }
.pace { display: flex; justify-content: center; gap: 7px; align-items: center; font-size: 12.500px; color: var(--ink-2); padding: 12px 18px 16px; }

.chart { padding: 0 12px 12px; position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: Inter, sans-serif; }
.chart .line { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .prev { fill: none; stroke: var(--violet); stroke-width: 1.500; stroke-dasharray: 4 4; }
.chart .area { fill: url(#areaFill); }
.chart .dot { fill: var(--accent-2); stroke: var(--bg); stroke-width: 2; opacity: 0; }
.chart .cross { stroke: var(--line-2); stroke-width: 1; opacity: 0; }
.chart .hit { fill: transparent; cursor: crosshair; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; vertical-align: -1px; }
.legend i.dash { width: 14px; height: 0; border-top: 2px dashed var(--violet); border-radius: 0; vertical-align: 3px; }
.chart-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--glass-2); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--shadow); border-radius: 12px; padding: 8px 11px; font-size: 12px; min-width: 120px; }
.chart-tip b { display: block; font-size: 14px; }
.chart-tip span { color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 22px; padding: 6px 18px 16px; }
.donut { position: relative; flex: none; display: grid; place-items: center; }
.donut svg { display: block; transform: rotate(-90deg); }
.donut .d-c { position: absolute; text-align: center; font-size: 11.500px; color: var(--muted); line-height: 1.300; }
.donut .d-c b { display: block; font-size: 17px; color: var(--ink); font-weight: 700; }
.mix { flex: 1; min-width: 0; }
.mix-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.mix-row i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mix-row .grow { flex: 1; min-width: 0; }
.mix-row small { color: var(--muted); margin-inline-start: 4px; }
.mix-row b { font-weight: 600; }

/* ---------- toolbars, tables, cards ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.filters .grow { flex: 1 1 220px; }
.filters .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.filters .field input, .filters .field select { height: 38px; border-radius: 12px; border-color: var(--glass-line); box-shadow: var(--shadow-sm); }
.filters .field:has(input[type=date]) { width: 148px; }
.filters .field:has(select) { width: 150px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; gap: 2px; background: var(--glass-2); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); }
.seg a { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.500px; color: var(--ink-2); font-weight: 500; display: inline-flex; align-items: center; text-decoration: none; transition: background .2s, color .2s; }
.seg a.on { background: var(--ink); color: var(--bg); }
.tabs { display: inline-flex; padding: 3px; border-radius: 12px; gap: 2px; background: var(--glass-2); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.tabs a { height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.500px; font-weight: 500; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; }
.tabs a.on { background: var(--ink); color: var(--bg); }
.stats-row { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.stat { display: flex; align-items: center; gap: 11px; }
.stat .tile-ic { color: var(--ink-2); }
.stat b { font-size: 18px; font-weight: 700; display: block; line-height: 1.250; }
.stat span { font-size: 12.500px; color: var(--muted); }

.scroll, .split .tbl { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow); }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 500; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--glass-2); }
.tbl td small { display: block; color: var(--muted); font-size: 12px; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; }
.tbl tr.dim { opacity: .5; }
.tbl a { color: var(--accent-ink); font-weight: 500; text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who small { display: block; }
.neg { color: var(--red); font-weight: 600; }
.low { color: var(--amber); font-weight: 600; }
.good { color: var(--green); font-weight: 600; }
.muted { color: var(--muted); text-align: center; padding: 28px 12px; }
.start { text-align: right; }
.mini-in, .mini.in, input.mini, .inline select, .inline input { height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--glass-2); outline: 0; }
input.mini { width: 88px; display: inline-block; text-align: start; }
input.mini:focus, .inline select:focus, .inline input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.actions { white-space: nowrap; }
.actions form { display: flex; gap: 6px; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.500px; font-weight: 500; padding: 3px 9px; border-radius: 8px; white-space: nowrap; background: var(--blue-soft); color: var(--blue); }
.tag.offline { background: var(--amber-soft); color: var(--amber); }
.tag.received { background: var(--green-soft); color: var(--green); }
.tag.cancelled { background: var(--track); color: var(--ink-2); }

.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ccard { padding: 16px; }
.ccard .top { display: flex; gap: 12px; align-items: center; }
.ccard .top .av { width: 44px; height: 44px; font-size: 14px; }
.ccard .nm { font-weight: 600; font-size: 14.500px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard .en { font-size: 12px; color: var(--muted); }
.ccard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; min-height: 24px; }
.ccard .st { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 11.500px; color: var(--muted); }
.ccard .st b { display: block; font-size: 13.500px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.ccard form { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.ccard form input, .ccard form select { height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--glass-2); padding: 0 8px; outline: 0; min-width: 0; flex: 1 1 70px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(272px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 12px; }
.column { border-radius: 20px; padding: 12px 10px 10px; min-height: 240px; background: rgba(255, 255, 255, .025); border: 1px solid var(--glass-line); }
[data-theme="light"] .column { background: rgba(255, 255, 255, .28); }
.col-h { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.col-t { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.col-t i { width: 9px; height: 9px; border-radius: 50%; }
.col-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11.500px; font-weight: 600; background: var(--glass-2); border: 1px solid var(--line); }
.col-line { height: 3px; border-radius: 3px; margin: 10px 6px 12px; background: var(--track); overflow: hidden; }
.col-line i { display: block; height: 100%; width: 34%; border-radius: 3px; }
.col-body { display: flex; flex-direction: column; gap: 10px; }
.pcard { background: var(--glass-2); border: 1px solid var(--glass-line); border-radius: 16px; padding: 13px; box-shadow: var(--shadow-sm); }
.pc-top { display: flex; gap: 10px; align-items: center; }
.pc-top > div { min-width: 0; flex: 1; }
.pc-name { font-weight: 600; font-size: 13.500px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-id { font-size: 11.500px; color: var(--muted); }
.pc-body { font-size: 12.500px; color: var(--ink-2); margin: 10px 0 0; line-height: 1.700; }
.pcard form { display: flex; gap: 6px; margin-top: 11px; }

.lede { max-width: 72ch; color: var(--ink-2); margin-bottom: 14px; }
.flash { padding: 11px 15px; margin-bottom: 14px; border-radius: 12px; font-weight: 500; background: var(--green-soft); color: var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; padding: 20px; max-width: 920px; background: var(--glass); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow); }
.form .wide, .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.item-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-row .grow { flex: 1 1 260px; }
.item-row .num { flex: 0 0 120px; }
.item-row .full { flex: 1 0 100%; }
[data-add-row] { margin-top: 10px; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; padding: 16px 20px; margin: 0 0 16px; background: var(--glass); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow); }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split > section { min-width: 0; }

/* ---------- drawer / modal / palette ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(10, 8, 8, .42); backdrop-filter: blur(3px); animation: fade .25s both; }
.scrim.out { animation: fadeOut .2s both; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 10px; bottom: 10px; inset-inline-end: 10px; width: min(780px, calc(100vw - 20px)); z-index: 61; border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; background: var(--modal); backdrop-filter: blur(30px) saturate(170%); border: 1px solid var(--glass-line); box-shadow: var(--shadow-lg); animation: dIn .45s var(--ease-out) both; }
.drawer.out { animation: dOut .26s var(--ease) both; }
@keyframes dIn { from { transform: translateX(-106%); } }
@keyframes dOut { to { transform: translateX(-106%); } }
.d-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.d-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.d-body { flex: 1; overflow: auto; padding: 18px 22px 30px; }
.drawer [data-back] { display: none; }
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal-wrap > .scrim { position: absolute; }
.modal { width: min(440px, 100%); position: relative; z-index: 1; border-radius: 24px; overflow: hidden; padding: 22px; background: var(--modal); backdrop-filter: blur(30px) saturate(170%); border: 1px solid var(--glass-line); box-shadow: var(--shadow-lg); animation: mIn .35s var(--ease-out) both; }
@keyframes mIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.palette { width: min(640px, 100%); padding: 0; align-self: start; margin-top: 12vh; }
.pal-in { display: flex; gap: 10px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-in input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.pal-group { font-size: 11.500px; color: var(--muted); padding: 8px 12px 3px; }
.pal-item { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; cursor: pointer; text-decoration: none; color: inherit; }
.pal-item.on { background: var(--accent-soft); }
.pal-item .grow { flex: 1; min-width: 0; }
.pal-item .s { font-size: 12px; color: var(--muted); }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; min-height: 100%; padding: 16px; }
.login-box { position: relative; display: flex; flex-direction: column; gap: 14px; width: min(360px, 100%); padding: 28px 26px 20px; border-radius: 22px; text-align: center; }
.login-box .logo-tile { width: 66px; height: 66px; border-radius: 19px; margin: 0 auto 2px; }
.login-box .logo-tile img { width: 42px; height: 42px; }
.login-box h1 { font-size: 20px; line-height: 1.300; }
.login-box .sub { margin: -10px 0 2px; font-size: 13px; font-weight: 500; }
.login-box .field { text-align: start; }
.login-box .ibtn { position: absolute; top: 14px; inset-inline-end: 14px; width: 32px; height: 32px; border-radius: 10px; }
.input-ic { position: relative; display: block; }
.input-ic button { position: absolute; top: 11px; inset-inline-start: 11px; color: var(--muted); }
.input-ic input { padding-inline-start: 38px; }
.login-box .btn { height: 42px; margin-top: 4px; }
.login-box footer { color: var(--muted); font-size: 11.500px; direction: ltr; }
.login-box footer b { color: var(--accent-ink); font-weight: 600; }

@media (max-width: 1360px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-wide, .split, .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  [data-side] .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 248px; transform: translateX(100%); transition: transform .3s var(--ease-out); }
  .nav-open .side { transform: none; }
  [data-side="closed"] .lbl, [data-side="closed"] .me-name, [data-side="closed"] .brand-name { display: block; }
  .s-toggle { display: none; }
  .nav-btn { display: grid; }
  .shell { padding: 12px 16px 36px; }
  .g4, .g-half { grid-template-columns: minmax(0, 1fr); }
  .tbl { white-space: nowrap; }
  .split .tbl { display: block; overflow-x: auto; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { align-self: center; }
}
