/* ZZ Inventory — hand-written, monday.com-inspired: light boards, colour pills, big numbers. */
/* Inter (variable, self-hosted, SIL OFL 1.1, see fonts/OFL-LICENSE) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-var.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #f6f7fb; --surface: #fff; --text: #323338; --muted: #676879; --faint: #9699a6;
  --line: #e6e9ef; --line-2: #d0d4e4; --hover: #f5f6f8; --primary: #0073ea; --primary-d: #0060b9; --primary-l: #cce5ff;
  --green: #00c875; --green-l: #d6f5e8; --red: #e2445c; --red-l: #fbdde2; --orange: #fdab3d; --orange-l: #fff0d9;
  --purple: #a25ddc; --purple-l: #eedff8; --blue: #579bfc; --blue-l: #e0ecfe; --yellow: #ffcb00; --yellow-l: #fff6cc;
  --teal: #00a9b5; --teal-l: #d4f2f4; --pink: #ff5ac4; --pink-l: #ffe0f4; --navy: #225091; --navy-l: #dde5f2;
  --r: 10px; --r-sm: 6px; --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .08); --side: 248px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); font-feature-settings: "cv11", "ss01"; font-optical-sizing: auto; text-rendering: optimizeLegibility; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.num, .kpi-num, .loc-num, .cell-num, .qty, .pill-num, .total-chip, .feed-qty, .count, td.num, th.num { font-variant-numeric: tabular-nums lining-nums; }
table, input, select, button { font-feature-settings: "tnum" 1, "cv11" 1; }
p { margin: 0 0 12px; }
small { font-size: 12px; }
.ic { width: 18px; height: 18px; flex: none; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: var(--side); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #0073ea, #6161ff); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; letter-spacing: .02em; box-shadow: 0 4px 10px rgba(0, 115, 234, .25); }
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 16px; line-height: 1.15; }
.brand-text small { font-weight: 500; color: var(--faint); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.on { background: var(--primary-l); color: var(--primary-d); }
.nav-sep { margin: 16px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.side-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 8px; }
.me:hover { background: var(--hover); }
.me-text { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--faint); font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: none; vertical-align: middle; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; margin-right: 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 22px 32px 6px; }
.top h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; flex: 1; }
.top .menu-btn { display: none; }
.page { padding: 14px 32px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; width: 100%; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--hover); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; height: 38px; padding: 0 12px; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover { border-color: #b8bdd0; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 115, 234, .15); outline: none; }
input[readonly] { background: var(--hover); color: var(--muted); }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23676879' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.qty { width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.qty-lg { font-size: 17px; font-weight: 600; height: 42px; }
.up { text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; font-weight: 400; color: var(--faint); margin-left: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 4px 0 16px; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 16px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 4px 0 16px; }
.form-row input:not([type=checkbox]) { flex: 1 1 160px; }
.w-code { flex: 0 1 130px !important; }
.grow { flex: 1; }
.inline { display: inline; }

/* Boards (cards) */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.board-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; }
.board-head h2 { font-size: 17px; flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-head h2 .muted { font-weight: 500; font-size: 14px; }
.h3 { font-size: 14px; color: var(--muted); margin: 8px 0 10px; text-transform: uppercase; letter-spacing: .05em; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--hover); color: var(--muted); font-size: 12px; font-weight: 600; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.narrow { max-width: 760px; display: flex; flex-direction: column; gap: 20px; }
.lead { font-size: 15px; margin: 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.kpi-link:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-num { font-size: 36px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--faint); }
.kpis-sm .kpi { padding: 14px 18px; }
.kpis-sm .kpi-num { font-size: 26px; }

/* Location cards */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.loc-card { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, transform .15s, border-color .15s; }
.loc-card:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); transform: translateY(-1px); }
.loc-top { display: flex; justify-content: space-between; align-items: center; }
.loc-name { font-weight: 600; font-size: 15px; }
.loc-num { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.loc-num small { font-size: 14px; font-weight: 500; color: var(--faint); margin-left: 6px; letter-spacing: 0; }
.loc-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 3px; }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-form td { padding: 8px 10px; }
.tbl-form td:first-child > .muted.small { display: block; margin-top: 1px; }
.tbl-form select { width: 100%; min-width: 240px; }
.w-item { width: 40%; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tbl-board td { padding: 9px 12px; }
.sub-head td { background: #fafbfd; font-weight: 600; font-size: 13px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tbl tbody + tbody .sub-head td { border-top: 1px solid var(--line); }
.cell-loc { line-height: 1.2; }
.cell-num { display: block; font-size: 18px; font-weight: 700; }
.cell-sub { display: block; font-size: 11px; color: var(--faint); }
.cell-zero { color: #c3c6d4; }
.cell-open { display: block; font-size: 11px; color: #b27100; }

/* Groups (monday-style colour bar per brand) */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 8px; box-shadow: var(--shadow); --g: var(--primary); }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.group-head h2 { font-size: 17px; color: var(--g); }
.group-bar { width: 6px; height: 22px; border-radius: 3px; background: var(--g); }
.group .tbl th:first-child, .group .tbl td:first-child { border-left: 4px solid var(--g); }
.group .tbl thead th:first-child { border-left-color: transparent; }
.g-c1 { --g: #0073ea; } .g-c2 { --g: #00a359; } .g-c3 { --g: #a25ddc; } .g-c4 { --g: #e2445c; }
.g-c5 { --g: #d97f00; } .g-c6 { --g: #00a9b5; } .g-c7 { --g: #ff5ac4; } .g-c8 { --g: #225091; }

/* Pills */
.pill { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--hover); color: var(--muted); }
.pill-num { min-width: 52px; font-size: 14px; height: 28px; border-radius: 14px; }
.pill-ok, .pill-receive, .pill-received { background: var(--green-l); color: #007a48; }
.pill-transfer_in, .pill-sent { background: var(--blue-l); color: #1f5fc4; }
.pill-transfer_out { background: var(--navy-l); color: var(--navy); }
.pill-count_adjust { background: var(--purple-l); color: #7b36b3; }
.pill-adjust { background: var(--orange-l); color: #a65f00; }
.pill-release, .pill-pending { background: var(--yellow-l); color: #8a6a00; }
.pill-release_cancel, .pill-cancelled, .pill-muted { background: #eceef3; color: var(--muted); }
.pill-c1 { background: var(--blue-l); color: #1f5fc4; } .pill-c2 { background: var(--green-l); color: #007a48; } .pill-c3 { background: var(--purple-l); color: #7b36b3; }
.pill-c4 { background: var(--red-l); color: #b0263b; } .pill-c5 { background: var(--orange-l); color: #a65f00; } .pill-c6 { background: var(--teal-l); color: #00727a; }
.pill-c7 { background: var(--pink-l); color: #b0237e; } .pill-c8 { background: var(--navy-l); color: var(--navy); }
.c1 { background: #0073ea; } .c2 { background: #00c875; } .c3 { background: #a25ddc; } .c4 { background: #e2445c; }
.c5 { background: #fdab3d; } .c6 { background: #00a9b5; } .c7 { background: #ff5ac4; } .c8 { background: #225091; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "pill main qty" "pill meta qty"; column-gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.feed li:last-child { border-bottom: 0; }
.feed .pill { grid-area: pill; }
.feed-main { grid-area: main; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { grid-area: meta; }
.feed-qty { grid-area: qty; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select { min-width: 150px; }
.search { position: relative; flex: 1 1 260px; display: flex; }
.search .ic { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.search input { width: 100%; padding-left: 38px; }

/* Catalog (column browser) */
.miller { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(0, 2.2fr); gap: 20px; align-items: start; }
.inline-add { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-add input { flex: 1; }
.list { list-style: none; margin: 0 -8px; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 2px 8px; border-radius: 8px; }
.list li:hover { background: var(--hover); }
.list li.on { background: var(--primary-l); }
.list li.on .list-main { color: var(--primary-d); font-weight: 600; }
.list-main { flex: 1; padding: 8px 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { font-size: 12px; color: var(--faint); white-space: nowrap; }
.edit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; width: 100%; }
.edit-row input[name=name] { flex: 1 1 140px; }

/* Flash, callouts, empty */
.flash { margin: 6px 32px 0; padding: 12px 16px; border-radius: 8px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.flash-ok { background: var(--green-l); color: #00613a; border: 1px solid #a8e8cc; }
.flash-err { background: var(--red-l); color: #9b1c30; border: 1px solid #f4b5c0; }
.board .flash, .login-card .flash { margin: 0 0 14px; }
.flash-x { margin-left: auto; border: 0; background: transparent; font-size: 18px; color: inherit; cursor: pointer; opacity: .6; }
.callout { margin-top: 18px; padding: 14px 16px; border-radius: 8px; background: #f5f6f8; color: var(--muted); font-size: 13px; border-left: 4px solid var(--purple); }
.callout-info { margin: 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--yellow); box-shadow: var(--shadow); font-size: 14px; }
.total-chip { padding: 8px 14px; border-radius: 20px; background: var(--primary-l); color: var(--primary-d); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty.small { padding: 18px 8px; }
.empty p { margin: 0; }
.empty-code { font-size: 56px; font-weight: 800; color: var(--line-2); line-height: 1; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { background: var(--hover); }
.tab.on { background: var(--primary-l); color: var(--primary-d); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 14px; }

/* Text utils */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.center { text-align: center; }
.link { color: var(--primary); font-weight: 500; }
.link:hover { text-decoration: underline; }
.t-pos { color: #00854d; }
.t-neg { color: #c4283f; }
.t-warn { color: #d97f00; }

/* Login */
.login-body { background: radial-gradient(1200px 600px at 10% -10%, #dbeaff 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #efe3fb 0, transparent 55%), var(--bg); }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 24px; margin-top: 8px; }
.login-card .muted { margin-bottom: 20px; }
.brand-lg { padding: 0 0 12px; }
.login-foot { color: var(--faint); font-size: 12px; margin: 0; }

/* Bar widths (no inline styles under CSP) */
.w0 { width: 0; } .w5 { width: 5%; } .w10 { width: 10%; } .w15 { width: 15%; } .w20 { width: 20%; } .w25 { width: 25%; } .w30 { width: 30%; }
.w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; } .w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w65 { width: 65%; }
.w70 { width: 70%; } .w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; } .w100 { width: 100%; }


/* Reports */
.section-title { font-size: 15px; color: var(--muted); font-weight: 600; margin: 6px 0 -6px; }
.rep-featured { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rep-card { --g: var(--primary); position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 18px 24px; box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s; }
.rep-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--g); }
.rep-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); border-color: var(--line-2); }
.rep-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--g); background: color-mix(in srgb, var(--g) 12%, #fff); margin-bottom: 4px; }
.rep-title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; display: flex; gap: 8px; align-items: center; }
.rep-desc { color: var(--muted); font-size: 13px; line-height: 1.5; }
.rep-card-lg { padding: 24px 26px 22px 30px; gap: 8px; }
.rep-card-lg .rep-ic { width: 44px; height: 44px; }
.rep-card-lg .rep-ic .ic { width: 22px; height: 22px; }
.rep-card-lg .rep-title { font-size: 20px; }
.rep-card-lg .rep-desc { font-size: 14px; }
.rep-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--hover); color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--line); }
.chip:hover { background: var(--primary-l); color: var(--primary-d); border-color: transparent; }
.rep-go { margin-top: auto; padding-top: 8px; color: var(--g); font-weight: 600; font-size: 13px; }
.rep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rep-head p { margin: 4px 0 0; }
.rep-actions { display: flex; gap: 8px; }
.rep-filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.rep-filters select { min-width: 140px; }
.search-sm { flex: 0 1 220px; }
.w-vendor { width: 160px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field-inline input[type=date] { height: 36px; }
.seg { display: inline-flex; background: var(--hover); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-item { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-item:hover { color: var(--text); }
.seg-item.on { background: var(--surface); color: var(--primary-d); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.rep-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rep-kpi { flex: 1 1 160px; background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; }
.rep-kpi-num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tbl-report th a.sort { color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.tbl-report th a.sort:hover, .tbl-report th a.sort.on { color: var(--primary-d); }
.tbl-report .arrow { font-size: 9px; }
.tbl-report td { white-space: nowrap; }
.tbl-report tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); background: #fafbfd; padding: 12px; }
.rep-note { margin: 12px 0 0; }
.print-only { display: none; }
@media (max-width: 900px) { .rep-featured { grid-template-columns: 1fr; } }
@media print {
  body { background: #fff; font-size: 11px; }
  .rep-filters, .rep-actions, .rep-head a, .flash { display: none !important; }
  .print-only { display: block; margin-bottom: 8px; }
  .main, .page { padding: 0 !important; }
  .top { padding: 0 0 6px !important; }
  .board, .rep-board { border: 0; padding: 0; }
  .tbl-wrap { overflow: visible; }
  .tbl th, .tbl td { padding: 4px 6px; }
  .tbl-report td { white-space: normal; }
  .pill { background: none !important; color: #000 !important; padding: 0; height: auto; }
  thead { display: table-header-group; } tfoot { display: table-row-group; } tr { page-break-inside: avoid; }
  @page { size: landscape; margin: 12mm; }
}

/* Responsive */
@media (max-width: 1200px) {
  .miller { grid-template-columns: 1fr 1fr; }
  .miller .col-wide { grid-column: 1 / -1; }
  .cols-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2 { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .nav-open .side { transform: none; }
  .top .menu-btn { display: inline-grid; }
  .top { padding: 16px 16px 4px; }
  .top h1 { font-size: 21px; }
  .page { padding: 12px 16px 40px; }
  .flash { margin: 6px 16px 0; }
}
@media (max-width: 600px) {
  .miller { grid-template-columns: 1fr; }
  .kpi-num { font-size: 28px; }
  .board { padding: 16px; }
  .tbl-form select { min-width: 190px; }
}
@media print {
  .side, .top-actions, .menu-btn, .filters, .form-actions { display: none !important; }
  .board, .group, .kpi { box-shadow: none; }
}

/* ===== Macaron pastel theme (restrained accents; neutral surfaces) ===== */
:root {
  --p1-bg: #e3f0fb; --p1-fg: #2d6a9f; --p1-ac: #8cbde6;   /* sky */
  --p2-bg: #dcf3e8; --p2-fg: #2b7a57; --p2-ac: #86cfab;   /* mint */
  --p3-bg: #ebe5fb; --p3-fg: #5f4bb0; --p3-ac: #b3a3ec;   /* lavender */
  --p4-bg: #fbe3ec; --p4-fg: #a8456f; --p4-ac: #eda8c3;   /* pink */
  --p5-bg: #fde8da; --p5-fg: #a8572a; --p5-ac: #f4b48c;   /* peach */
  --p6-bg: #fbf3cf; --p6-fg: #866a12; --p6-ac: #ead27a;   /* lemon */
  --p7-bg: #dbf1f2; --p7-fg: #23727a; --p7-ac: #8fd0d4;   /* aqua */
  --p8-bg: #f3e3f6; --p8-fg: #8a4596; --p8-ac: #d7a8df;   /* lilac */
  --primary: #3b6fd8; --primary-d: #2c58b5; --primary-l: #e6eefc;
  --bg: #f7f7fa; --text: #2a2b33; --line: #ececf2; --line-2: #dadbe5;
  --shadow: 0 1px 2px rgba(20, 20, 43, .04), 0 2px 8px rgba(20, 20, 43, .04);
  --shadow-lg: 0 10px 30px rgba(20, 20, 43, .08);
}
.p-1 { --pb: var(--p1-bg); --pf: var(--p1-fg); --pa: var(--p1-ac); } .p-2 { --pb: var(--p2-bg); --pf: var(--p2-fg); --pa: var(--p2-ac); }
.p-3 { --pb: var(--p3-bg); --pf: var(--p3-fg); --pa: var(--p3-ac); } .p-4 { --pb: var(--p4-bg); --pf: var(--p4-fg); --pa: var(--p4-ac); }
.p-5 { --pb: var(--p5-bg); --pf: var(--p5-fg); --pa: var(--p5-ac); } .p-6 { --pb: var(--p6-bg); --pf: var(--p6-fg); --pa: var(--p6-ac); }
.p-7 { --pb: var(--p7-bg); --pf: var(--p7-fg); --pa: var(--p7-ac); } .p-8 { --pb: var(--p8-bg); --pf: var(--p8-fg); --pa: var(--p8-ac); }

/* Pastel pills (brand / warehouse badges) */
.pill-p1, .pill-c1 { background: var(--p1-bg); color: var(--p1-fg); } .pill-p2, .pill-c2 { background: var(--p2-bg); color: var(--p2-fg); }
.pill-p3, .pill-c3 { background: var(--p3-bg); color: var(--p3-fg); } .pill-p4, .pill-c4 { background: var(--p4-bg); color: var(--p4-fg); }
.pill-p5, .pill-c5 { background: var(--p5-bg); color: var(--p5-fg); } .pill-p6, .pill-c6 { background: var(--p6-bg); color: var(--p6-fg); }
.pill-p7, .pill-c7 { background: var(--p7-bg); color: var(--p7-fg); } .pill-p8, .pill-c8 { background: var(--p8-bg); color: var(--p8-fg); }
.pill { font-weight: 550; letter-spacing: .005em; }
a.pill:hover { filter: brightness(.97); }
/* Status pills softened to the same family */
.pill-ok, .pill-receive, .pill-received { background: var(--p2-bg); color: var(--p2-fg); }
.pill-transfer_in, .pill-sent { background: var(--p1-bg); color: var(--p1-fg); }
.pill-transfer_out { background: var(--p7-bg); color: var(--p7-fg); }
.pill-count_adjust { background: var(--p3-bg); color: var(--p3-fg); }
.pill-adjust { background: var(--p5-bg); color: var(--p5-fg); }
.pill-release, .pill-pending { background: var(--p6-bg); color: var(--p6-fg); }
.pill-release_cancel, .pill-cancelled, .pill-muted { background: #f0f0f4; color: #6b6c7b; }
/* Avatars, dots, bars, group colours use the deeper pastel tones */
.c1 { background: var(--p1-ac); } .c2 { background: var(--p2-ac); } .c3 { background: var(--p3-ac); } .c4 { background: var(--p4-ac); }
.c5 { background: var(--p5-ac); } .c6 { background: var(--p6-ac); } .c7 { background: var(--p7-ac); } .c8 { background: var(--p8-ac); }
.avatar { color: #2a2b33; }
.g-c1 { --g: var(--p1-fg); } .g-c2 { --g: var(--p2-fg); } .g-c3 { --g: var(--p3-fg); } .g-c4 { --g: var(--p4-fg); }
.g-c5 { --g: var(--p5-fg); } .g-c6 { --g: var(--p6-fg); } .g-c7 { --g: var(--p7-fg); } .g-c8 { --g: var(--p8-fg); }
.group .tbl th:first-child, .group .tbl td:first-child { border-left-width: 3px; }
.group-bar { background: color-mix(in srgb, var(--g) 55%, #fff); }
.brand-mark { background: linear-gradient(135deg, #8cbde6, #b3a3ec); box-shadow: 0 4px 12px rgba(140, 150, 230, .35); color: #fff; }
.nav-item.on { background: var(--p3-bg); color: var(--p3-fg); }
.tab.on, .seg-item.on { color: var(--p3-fg); }
.total-chip { background: var(--p3-bg); color: var(--p3-fg); }

/* Chart colour slots (donut segments, swatches, bars) */
.ch-1 { stroke: var(--p1-ac); background: var(--p1-ac); } .ch-2 { stroke: var(--p2-ac); background: var(--p2-ac); }
.ch-3 { stroke: var(--p3-ac); background: var(--p3-ac); } .ch-4 { stroke: var(--p4-ac); background: var(--p4-ac); }
.ch-5 { stroke: var(--p5-ac); background: var(--p5-ac); } .ch-6 { stroke: var(--p6-ac); background: var(--p6-ac); }
.ch-7 { stroke: var(--p7-ac); background: var(--p7-ac); } .ch-8 { stroke: var(--p8-ac); background: var(--p8-ac); }

/* Dashboard KPI tiles: white card, pastel number bubble accent */
.kpi-p { position: relative; overflow: hidden; }
.kpi-p::after { content: ""; position: absolute; right: -26px; top: -26px; width: 92px; height: 92px; border-radius: 50%; background: var(--pb); opacity: .9; }
.kpi-p > * { position: relative; z-index: 1; }
.kpi-p .kpi-num { color: var(--text); }
.kpi-p .kpi-label { color: var(--pf); font-weight: 600; }
.dash-chart { display: flex; justify-content: center; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

/* Report cards: neutral white, own pastel icon tile + accent */
.rep-card { border-radius: 14px; padding: 20px 22px; }
.rep-card::before { display: none; }
.rep-card:hover { border-color: color-mix(in srgb, var(--pa, var(--p1-ac)) 60%, #fff); }
.rep-ic { background: var(--pb, var(--p1-bg)); color: var(--pf, var(--p1-fg)); border-radius: 12px; }
.rep-card-lg { padding: 26px 28px 24px; background: linear-gradient(160deg, color-mix(in srgb, var(--pb) 55%, #fff) 0%, #fff 55%); }
.rep-card-lg .rep-ic { width: 48px; height: 48px; border-radius: 14px; }
.rep-go { color: var(--pf); }
.chip { background: #fff; border-color: var(--line-2); }
.chip:hover { background: var(--pb); color: var(--pf); border-color: transparent; }

/* Report summary: pastel stat bubbles + donut */
.rep-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin: 4px 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.rep-summary.no-chart { grid-template-columns: 1fr; }
.bubbles { display: flex; flex-wrap: wrap; gap: 12px; }
.bubble { display: flex; flex-direction: column; justify-content: center; min-width: 132px; padding: 14px 20px; border-radius: 22px; background: var(--pb); }
.bubble-num { font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.bubble-num .t-pos, .bubble-num .t-neg, .bubble-num .muted { color: inherit; }
.bubble-lbl { font-size: 12px; font-weight: 600; color: var(--pf); margin-top: 2px; }
.bubble-ghost { background: #f4f4f8; } .bubble-ghost .bubble-lbl { color: var(--muted); }
.rep-chart { padding-left: 8px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; margin: 0; }
.donut { width: 168px; height: 168px; flex: none; transform: rotate(0deg); }
.donut-ring { stroke: #f0f0f5; }
.donut-seg { stroke-linecap: butt; transition: stroke-width .15s; }
.donut-seg:hover { stroke-width: 6.2; }
.donut-num { font-size: 6.2px; font-weight: 700; fill: var(--text); font-family: var(--font); letter-spacing: -.02em; }
.donut-lbl { font-size: 2.6px; font-weight: 600; fill: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: .06em; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; min-width: 200px; max-width: 280px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 38px; gap: 10px; align-items: center; font-size: 13px; }
.sw { width: 12px; height: 12px; border-radius: 4px; }
.lg-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lg-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-p { color: var(--faint); text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.rep-filters { border-radius: 14px; }
.tbl-report th { background: #fafafc; }
.tbl-report thead th:first-child { border-top-left-radius: 8px; } .tbl-report thead th:last-child { border-top-right-radius: 8px; }
.tbl-report td { padding: 12px; }
.tbl-report tfoot td { background: #fafafc; }
@media (max-width: 1100px) { .rep-summary { grid-template-columns: 1fr; } .rep-chart { padding-left: 0; } }
@media print {
  .rep-chart, .dash-chart, .kpi-p::after { display: none !important; }
  .bubble { background: none !important; border: 1px solid #ccc; border-radius: 6px; padding: 6px 10px; min-width: 0; }
  .bubble-lbl { color: #000 !important; }
  .rep-summary { border: 0; padding: 0; margin: 0 0 8px; }
}

.ch-0 { stroke: #cfd5e1; background: #cfd5e1; }
