/* HexaEcom Inventory Portal: styles. Day and night themes, brand navy from the HexaEcom logo. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/poppins-600.woff2') format('woff2'); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/poppins-700.woff2') format('woff2'); }

:root {
    --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f7f9fd; --text: #0f1b33; --muted: #566480;
    --line: #e2e7f1; --line-strong: #cfd7e6;
    --brand: #12213e; --brand-hover: #1d3566; --brand-contrast: #ffffff; --link: #1d4f9f;
    --btn-bg: #12213e; --btn-text: #ffffff; --btn-hover: #1d3566; --focus: #3b82f6;
    --shadow: 0 1px 2px rgba(15,27,51,.05), 0 6px 18px rgba(15,27,51,.06);
    --done-bg: #dcf3e5; --done-fg: #12532d; --part-bg: #fff0c9; --part-fg: #6b4700;
    --act-bg: #fde2e1; --act-fg: #8a1c1c; --warn-bg: #fff0c9; --warn-fg: #6b4700;
    --c1: #2f6fb0; --c2: #0f9d8a; --c3: #8a62b8; --c4: #e8833a; --c5: #c2418f; --c6: #6b7a8a;
    --cdone: #2e9e5b; --cpart: #e0a030; --cact: #d0453f;
    --hero-from: #12213e; --hero-to: #26457f;
    --logo-full: url('../img/hexaecom-logo-navy.png'); --logo-icon: url('../img/hexaecom-icon-navy.png');
    --radius: 16px;
    --font-head: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
    --bg: #0a1120; --surface: #111b30; --surface-2: #16233f; --text: #e9eef8; --muted: #9db0cf;
    --line: #223250; --line-strong: #2e4268;
    --brand: #8fb4ff; --brand-hover: #b4cdff; --brand-contrast: #0a1120; --link: #8fb4ff;
    --btn-bg: #e9eef8; --btn-text: #0a1120; --btn-hover: #ffffff; --focus: #7aa7ff;
    --shadow: 0 0 0 1px rgba(255,255,255,.02);
    --done-bg: #123524; --done-fg: #9be0ae; --part-bg: #3d3010; --part-fg: #f3d27a;
    --act-bg: #411d1d; --act-fg: #f5a3a3; --warn-bg: #3d3010; --warn-fg: #f3d27a;
    --c1: #6fa8dc; --c2: #3cc7b3; --c3: #b79ae0; --c4: #f2a066; --c5: #e27ab8; --c6: #9aa8b6;
    --cdone: #4cc383; --cpart: #f0bd55; --cact: #ef6b66;
    --logo-full: url('../img/hexaecom-logo-white.png'); --logo-icon: url('../img/hexaecom-icon-white.png');
    color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0a1120; --surface: #111b30; --surface-2: #16233f; --text: #e9eef8; --muted: #9db0cf;
    --line: #223250; --line-strong: #2e4268;
    --brand: #8fb4ff; --brand-hover: #b4cdff; --brand-contrast: #0a1120; --link: #8fb4ff;
    --btn-bg: #e9eef8; --btn-text: #0a1120; --btn-hover: #ffffff; --focus: #7aa7ff;
    --shadow: 0 0 0 1px rgba(255,255,255,.02);
    --done-bg: #123524; --done-fg: #9be0ae; --part-bg: #3d3010; --part-fg: #f3d27a;
    --act-bg: #411d1d; --act-fg: #f5a3a3; --warn-bg: #3d3010; --warn-fg: #f3d27a;
    --c1: #6fa8dc; --c2: #3cc7b3; --c3: #b79ae0; --c4: #f2a066; --c5: #e27ab8; --c6: #9aa8b6;
    --cdone: #4cc383; --cpart: #f0bd55; --cact: #ef6b66;
    --logo-full: url('../img/hexaecom-logo-white.png'); --logo-icon: url('../img/hexaecom-icon-white.png');
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; margin: 0 0 .35rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 1.6rem 0 .6rem; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand-full { display: block; width: 176px; height: 40px; background: var(--logo-full) no-repeat left center / contain; }
.brand-icon { display: none; width: 34px; height: 38px; background: var(--logo-icon) no-repeat center / contain; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .92rem; text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active { color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, transparent); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.client-brand { display: flex; align-items: center; gap: 10px; padding-right: 14px; border-right: 1px solid var(--line); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.client-logo { height: 42px; width: auto; display: block; }
.client-logo-dark { display: none; }
:root[data-theme="dark"] .client-logo-light { display: none; }
:root[data-theme="dark"] .client-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .client-logo-light { display: none; }
    :root:not([data-theme="light"]) .client-logo-dark { display: block; }
}
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 700; font-family: var(--font-head); background: var(--brand); color: var(--brand-contrast); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-panel { position: absolute; right: 0; top: 46px; min-width: 250px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(8,15,30,.22); }
.user-panel .who-email { display: block; font-weight: 600; overflow-wrap: anywhere; margin-bottom: 6px; }
.user-panel form { margin: 12px 0 0; }
.user-panel .btn { width: 100%; }
.role { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.role-owner { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

.container { max-width: 1320px; margin: 0 auto; padding: 26px 24px 56px; }
.footer { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px 16px 30px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer .brand-icon { display: block; width: 22px; height: 24px; opacity: .85; }

/* ---------- Buttons, notices, cards ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
    padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-quiet { padding: 6px 12px; font-size: .85rem; }
.btn-danger { color: var(--act-fg); border-color: var(--act-fg); }
.btn-google { width: 100%; padding: 13px 18px; background: #ffffff; color: #1f1f1f; border-color: #dadce0; font-size: 1rem; }
.btn-google:hover { background: #f8f9fa; border-color: #c6c9cd; }
.btn-google svg { width: 20px; height: 20px; flex: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.notice { padding: 11px 14px; border-radius: 12px; margin: 12px 0; font-size: .92rem; }
.notice-warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice-ok { background: var(--done-bg); color: var(--done-fg); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.section-title { font-size: 1.02rem; font-weight: 600; margin: 26px 0 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--done-bg); color: var(--done-fg); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }

/* ---------- Sign-in ---------- */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: calc(100vh - 69px); }
.auth-hero { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 64px clamp(28px, 6vw, 88px); color: #fff; background: radial-gradient(1200px 600px at 10% 0%, rgba(255,255,255,.07), transparent 60%), linear-gradient(145deg, var(--hero-from), var(--hero-to)); }
.auth-hero .mark { width: 78px; height: 90px; background: url('../img/hexaecom-icon-white.png') no-repeat left center / contain; }
.auth-hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.12; margin: 0; max-width: 18ch; }
.auth-hero p { margin: 0; max-width: 46ch; color: rgba(255,255,255,.82); font-size: 1.05rem; }
.auth-points { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.9); }
.auth-points svg { width: 22px; height: 22px; flex: none; margin-top: 1px; stroke: #8fe3b5; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card h2 { margin: 0 0 6px; font-size: 1.35rem; }
.auth-card .btn { margin-top: 18px; }

.eyebrow { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.mt { margin-top: 18px; }

/* ---------- Page head and KPI tiles ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 18px; }
.page-head p { margin: 0; color: var(--muted); }
.page-head strong { color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.kpi .value { font-family: var(--font-head); font-size: 2.05rem; font-weight: 700; line-height: 1.1; margin: 8px 0 4px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: .86rem; }
.kpi.is-good .value { color: var(--cdone); }
.kpi.is-warn .value { color: var(--cpart); }
.kpi.is-danger .value { color: var(--cact); }
progress { width: 100%; height: 8px; margin-top: 10px; appearance: none; -webkit-appearance: none; border: 0; background: var(--line); border-radius: 99px; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--cdone); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--cdone); border-radius: 99px; }

/* ---------- Channel cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 0 0 8px; }
.stat h3 { margin: 0 0 4px; font-size: .95rem; font-weight: 600; }
.stat .big { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.stat .row { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); margin-top: 5px; }

/* ---------- Toolbar, filters ---------- */
.toolbar { margin: 26px 0 12px; padding: 14px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 0; }
.filters + .filters { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.filters label { display: flex; flex-direction: column; font-size: .74rem; font-weight: 600; letter-spacing: .03em; color: var(--muted); gap: 4px; }
.filters input, .filters select, .person-form input[type=email], .person-form input[type=text], .person-form select {
    font: inherit; font-size: .92rem; font-weight: 400; letter-spacing: 0; padding: 9px 12px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--text); min-width: 150px;
}
.filters .grow { flex: 1; min-width: 220px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .74rem; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-btn {
    font: inherit; font-size: .92rem; font-weight: 500; min-height: 44px; padding: 8px 16px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer;
}
.choice-btn:hover { background: var(--surface-2); }
.choice-btn.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); font-weight: 600; }
.choice-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nowrap { white-space: nowrap; }
.card > h2:first-child { margin-top: 0; }
.filters .grow input { width: 100%; }
.count { margin-left: auto; color: var(--muted); font-size: .85rem; align-self: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { position: sticky; top: 0; background: var(--surface-2); white-space: nowrap; z-index: 1; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.table th button { all: unset; cursor: pointer; font-weight: 700; }
.table th button::after { content: " \2195"; color: var(--muted); font-weight: 400; }
.table th[aria-sort="ascending"] button::after { content: " \2191"; color: var(--brand); }
.table th[aria-sort="descending"] button::after { content: " \2193"; color: var(--brand); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.name { min-width: 260px; max-width: 420px; font-weight: 500; }
.table img { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: block; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.badge-done { background: var(--done-bg); color: var(--done-fg); }
.badge-partial { background: var(--part-bg); color: var(--part-fg); }
.badge-action { background: var(--act-bg); color: var(--act-fg); }
.more { text-align: center; margin: 16px 0; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; stroke: var(--muted); fill: none; stroke-width: 1.6; margin-bottom: 10px; }
.empty-state strong { display: block; color: var(--text); font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 4px; }

/* ---------- Loading ---------- */
.skel { border-radius: var(--radius); height: 112px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.skel-wide { height: 280px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- Pages: privacy, people, admin ---------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 1.4rem; }
.person-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.person-form label { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; color: var(--muted); gap: 4px; }
.person-form.compact { align-items: center; }
.person-form.compact select { min-width: 130px; }
.checks { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.checks legend { font-size: .8rem; color: var(--muted); padding: 0; margin-bottom: 3px; }
.checks label { flex-direction: row; align-items: center; gap: 5px; color: var(--text); font-size: .85rem; font-weight: 400; }
.people tr.is-off td { opacity: .6; }
.people form { margin: 0; }

/* ---------- Charts ---------- */
.charts-block { margin: 22px 0 8px; }
.charts-block > summary { cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; padding: 4px 0; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 10px; }
.chart-card h3 { margin: 0 0 2px; font-size: .98rem; font-weight: 600; }
.chart-card .sub { color: var(--muted); font-size: .8rem; margin: 0 0 8px; }
.chart-card .empty { color: var(--muted); font-size: .85rem; padding: 24px 0; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart text.val { fill: var(--text); font-size: 10.5px; font-weight: 600; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart rect.bar { stroke: var(--surface); stroke-width: 1; }
.chart path.line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart circle.dot { stroke: var(--surface); stroke-width: 1.5; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
svg .c1, svg rect.c1, svg circle.c1 { fill: var(--c1); }
svg path.line.c1 { stroke: var(--c1); fill: none; }
.swatch.c1 { background: var(--c1); }
svg .c2, svg rect.c2, svg circle.c2 { fill: var(--c2); }
svg path.line.c2 { stroke: var(--c2); fill: none; }
.swatch.c2 { background: var(--c2); }
svg .c3, svg rect.c3, svg circle.c3 { fill: var(--c3); }
svg path.line.c3 { stroke: var(--c3); fill: none; }
.swatch.c3 { background: var(--c3); }
svg .c4, svg rect.c4, svg circle.c4 { fill: var(--c4); }
svg path.line.c4 { stroke: var(--c4); fill: none; }
.swatch.c4 { background: var(--c4); }
svg .c5, svg rect.c5, svg circle.c5 { fill: var(--c5); }
svg path.line.c5 { stroke: var(--c5); fill: none; }
.swatch.c5 { background: var(--c5); }
svg .c6, svg rect.c6, svg circle.c6 { fill: var(--c6); }
svg path.line.c6 { stroke: var(--c6); fill: none; }
.swatch.c6 { background: var(--c6); }
svg .cdone, svg rect.cdone, svg circle.cdone { fill: var(--cdone); }
svg path.line.cdone { stroke: var(--cdone); fill: none; }
.swatch.cdone { background: var(--cdone); }
svg .cpart, svg rect.cpart, svg circle.cpart { fill: var(--cpart); }
svg path.line.cpart { stroke: var(--cpart); fill: none; }
.swatch.cpart { background: var(--cpart); }
svg .cact, svg rect.cact, svg circle.cact { fill: var(--cact); }
svg path.line.cact { stroke: var(--cact); fill: none; }
.swatch.cact { background: var(--cact); }

/* ---------- Day / night toggle ---------- */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:not([data-mode]) svg { visibility: hidden; }
.icon-btn[data-mode="dark"] .icon-moon, .icon-btn[data-mode="light"] .icon-sun { display: none; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; min-height: 0; }
    .auth-hero { padding: 36px 24px; }
    .auth-hero h1 { max-width: none; }
    .client-brand .for { display: none; }
}
@media (max-width: 720px) {
    /* Phones: logos and buttons on the first row, the page tabs on their own full-width row below. */
    .topbar { flex-wrap: wrap; height: auto; padding: 8px 14px 0; gap: 6px 8px; }
    .brand-full { display: none; }
    .brand-icon { display: block; }
    .nav { order: 3; flex: 1 1 100%; margin: 0 -14px; padding: 2px 14px 8px; overflow-x: auto; scrollbar-width: none; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 7px 12px; font-size: .88rem; white-space: nowrap; flex: none; }
    .client-brand { padding-right: 8px; }
    .client-logo { height: 32px; }
    .container { padding: 18px 14px 44px; }
    h1 { font-size: 1.4rem; }
    .kpi .value { font-size: 1.7rem; }
    .filters label, .filters input, .filters select, .filters .field { width: 100%; }
    .filters input[type=search] { height: 46px; font-size: 1rem; }
    .choice-btn { flex: 1 1 auto; min-height: 46px; font-size: 1rem; }
    .filters.export > .btn { width: 100%; min-height: 48px; font-size: 1rem; }
    .filters .grow { min-width: 0; flex: 1 1 100%; }
    .count { margin-left: 0; width: 100%; }
    .charts { grid-template-columns: 1fr; }
    /* Product table turns into one card per product */
    .table.responsive thead { display: none; }
    .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
    .table.responsive tr { border-bottom: 8px solid var(--bg); padding: 6px 0; }
    .table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 0; padding: 6px 16px; text-align: right; }
    .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: left; flex: none; }
    .table.responsive td.name { display: block; text-align: left; min-width: 0; max-width: none; font-size: 1rem; padding-top: 12px; }
    .table.responsive td.name::before { display: block; margin-bottom: 2px; }
    .table.responsive td:first-child { display: none; }
}
.person-form .check-one { flex-direction: row; align-items: center; gap: 5px; color: var(--text); font-size: .85rem; font-weight: 400; }
.person-form.compact .checks { flex: 1 1 100%; }

/* ---------- People ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; max-width: 640px; }
.page-stats { display: flex; gap: 10px; }
.page-stats span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .85rem; color: var(--muted); }
.page-stats strong { color: var(--text); font-family: var(--font-head); font-size: 1rem; margin-right: 3px; }
.flash-zone { position: sticky; top: 72px; z-index: 5; }
.flash-zone .notice { box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); transition: opacity .6s ease; }
.flash-zone .notice.fade { opacity: 0; pointer-events: none; }
.add-person { margin: 16px 0 6px; padding: 0; }
.add-person > summary { list-style: none; cursor: pointer; padding: 16px 20px; font-family: var(--font-head); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.add-person > summary::-webkit-details-marker { display: none; }
.add-person .plus { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-contrast); align-items: center; justify-content: center; font-weight: 700; line-height: 1; }
.add-person[open] > summary { border-bottom: 1px solid var(--line); }
.add-person[open] .plus { transform: rotate(45deg); }
.person-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; padding: 18px 20px 20px; }
.person-grid .chip-group, .person-grid .form-actions { grid-column: 1 / -1; }
.field-block { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.field-block input, .field-block select {
    font: inherit; font-size: .92rem; font-weight: 400; letter-spacing: 0; padding: 9px 12px; min-height: 42px; border-radius: 10px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); width: 100%;
}
.chip-group { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.chip-group legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; font-size: .78rem; font-weight: 600; letter-spacing: .03em; color: var(--muted); }
.chip-group legend .fine { font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
    display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 15px; border-radius: 999px; font-size: .88rem; font-weight: 500;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); transition: background .15s, color .15s, border-color .15s;
}
.chip:hover span { background: var(--surface-2); }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); font-weight: 600; }
.chip input:checked + span::before { content: "\2713"; font-size: .8rem; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.people-list { display: grid; gap: 14px; margin-top: 10px; }
.person { padding: 0; scroll-margin-top: 140px; transition: box-shadow .3s, border-color .3s; }
.person.is-off { opacity: .72; }
.person.just-saved { border-color: var(--done-fg); animation: saved-pulse 2.4s ease-out 1; }
@keyframes saved-pulse { from { box-shadow: 0 0 0 5px color-mix(in srgb, var(--done-fg) 30%, transparent); } to { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .person.just-saved { animation: none; } }
.person-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; flex-wrap: wrap; }
.avatar { display: inline-flex; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--brand); align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; }
.person-id { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.person-id strong { font-family: var(--font-head); font-weight: 600; overflow-wrap: anywhere; }
.person-id .fine { overflow-wrap: anywhere; }
.person-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.person-seen { opacity: .85; }
.role-revoked { background: var(--act-bg); color: var(--act-fg); border-color: transparent; }
.role-reviewer { background: var(--part-bg); color: var(--part-fg); border-color: transparent; }
.saved-badge { background: var(--done-bg); color: var(--done-fg); font-size: .78rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; }
.own-note { padding: 0 20px 16px 76px; margin: 0; }
.person-edit { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px 20px; padding: 6px 20px 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.person-edit .chip-group, .person-edit .form-actions { grid-column: 2; }
.person-edit .role-pick { grid-row: span 3; }
.person-edit.is-dirty { background: color-mix(in srgb, var(--warn-bg) 38%, transparent); }
.person-edit .btn[disabled] { opacity: .5; cursor: default; }
.dirty-hint { color: var(--warn-fg); font-weight: 600; }
.person-foot { padding: 12px 20px 16px; border-top: 1px dashed var(--line); display: flex; justify-content: flex-end; }
.person-foot form { margin: 0; }
@media (max-width: 720px) {
    .flash-zone { top: 108px; }
    .person-grid { grid-template-columns: 1fr; padding: 16px; }
    .person-edit { grid-template-columns: 1fr; padding: 16px; }
    .person-edit .chip-group, .person-edit .form-actions { grid-column: 1; }
    .person-edit .role-pick { grid-row: auto; }
    .person-head { padding: 14px 16px; }
    .own-note { padding: 0 16px 14px; }
    .person-foot { padding: 12px 16px 14px; }
    .person-foot .btn { width: 100%; min-height: 44px; }
    .chip span { min-height: 42px; }
}

/* ---------- Shipment reports ---------- */
.tabs { display: flex; gap: 6px; margin: 18px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--act-fg); color: #fff; font-size: .72rem; font-weight: 700; }
.badge-pending { background: var(--part-bg); color: var(--part-fg); }
.badge-approved { background: var(--done-bg); color: var(--done-fg); }
.badge-rejected { background: var(--act-bg); color: var(--act-fg); }
.badge-cancelled { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.report { padding: 0; scroll-margin-top: 140px; }
.report.just-saved { border-color: var(--done-fg); animation: saved-pulse 2.4s ease-out 1; }
.report-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px 6px; flex-wrap: wrap; }
.report-main { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.report-main strong { font-family: var(--font-head); font-weight: 600; overflow-wrap: anywhere; }
.report-qty strong { font-family: var(--font-head); font-size: 1.35rem; }
.report-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 8px 20px 14px; }
.report-meta div { display: flex; flex-direction: column; min-width: 110px; }
.report-meta div.wide { flex: 1 1 100%; }
.report-meta dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.report-meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.report-warning { margin: 0 20px 12px; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 20px 16px; border-top: 1px dashed var(--line); }
.report-actions form { margin: 0; display: flex; gap: 8px; align-items: center; }
.reject-form { margin-left: auto; }
.reject-form input { font: inherit; font-size: .88rem; padding: 7px 11px; min-height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); min-width: 220px; }
.report-form { padding: 0; }
.report-form .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.person-grid .wide, .person-grid .field-block.wide { grid-column: 1 / -1; }
.product-line { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.product-line > div { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.product-line img, .pick img { object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); flex: none; }
.search-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.search-row .grow { flex: 1; min-width: 220px; }
.pick { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; padding: 12px 16px; }
.pick > div { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.pick:hover { border-color: var(--brand); }
.pager { margin: 16px 0; display: flex; gap: 14px; align-items: center; justify-content: center; }
@media (max-width: 720px) {
    .report-head { padding: 14px 16px 4px; }
    .report-meta { padding: 8px 16px 12px; gap: 8px 20px; }
    .report-warning { margin: 0 16px 12px; }
    .report-actions { padding: 12px 16px 14px; }
    .reject-form { margin-left: 0; width: 100%; }
    .reject-form input { flex: 1; min-width: 0; min-height: 44px; font-size: 1rem; }
    .report-actions .btn { min-height: 44px; }
    .report-form .person-grid { grid-template-columns: 1fr; }
    .product-line { padding: 14px 16px; }
}
.waiting { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: var(--part-bg); color: var(--part-fg); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.table td.report-cell { white-space: nowrap; }

/* ---------- Access panel ---------- */
.access-details { grid-column: 2; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.access-details > summary { cursor: pointer; list-style: none; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.access-details > summary::-webkit-details-marker { display: none; }
.access-details > summary::before { content: "\25B8"; color: var(--muted); }
.access-details[open] > summary::before { content: "\25BE"; }
.access-details[open] > summary { border-bottom: 1px solid var(--line); }
.access-details .access-panel { padding: 4px 16px 14px; }
.access-details .owner-note { display: none; padding: 12px 16px 0; margin: 0; }
.person-edit[data-role=owner] .access-panel, .person-grid[data-role=owner] .access-panel { display: none; }
.person-edit[data-role=owner] .owner-note { display: block; }
.access-section { padding: 14px 0 6px; border-bottom: 1px dashed var(--line); }
.access-section:last-child { border-bottom: 0; }
.access-section h4 { margin: 0 0 2px; font-family: var(--font-head); font-size: .95rem; }
.access-section > .fine { margin: 0 0 8px; }
.access-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 14px; align-items: center; padding: 6px 0; }
.access-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.chip-group.tight { gap: 6px; }
.chip-group.tight .chip span { min-height: 34px; padding: 4px 13px; font-size: .84rem; }
.chip.is-locked span { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: default; }
.chip.is-locked span::before { content: "\1F512"; font-size: .7rem; }
.person-grid .wide { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .access-details { grid-column: 1; }
    .access-row { grid-template-columns: 1fr; }
    .access-details .access-panel { padding: 4px 12px 12px; }
}

/* ---------- Bulk report ---------- */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bulk textarea {
    font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; font-weight: 400; letter-spacing: 0;
    padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); width: 100%; resize: vertical; min-height: 180px;
}
.bulk[data-source] .bulk-panel { display: none; }
.bulk[data-source=paste] .bulk-panel[data-panel~=paste],
.bulk[data-source=screenshot] .bulk-panel[data-panel~=screenshot],
.bulk[data-source=file] .bulk-panel[data-panel~=file] { display: flex; }
.bulk-panel { flex-direction: column; gap: 10px; }
.bulk-panel[data-panel=file] .field-block { max-width: 420px; }
.bulk-panel p { margin: 0; }
.drop-zone {
    position: relative; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center;
    padding: 26px 18px; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); color: var(--text);
}
.drop-zone input { margin-top: 6px; max-width: 100%; }
.drop-zone.is-over { border-color: var(--brand); }
.drop-zone .shot-thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.drop-zone .shot-thumbs { gap: 12px; }
.shot { position: relative; margin: 0; }
.shot img { display: block; height: 72px; width: auto; max-width: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.shot figcaption { position: absolute; left: 4px; bottom: 4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--brand-contrast); font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.shot-remove {
    position: absolute; top: -9px; right: -9px; width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 2px solid var(--surface); background: var(--act-fg); color: #fff; font-size: 1.05rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.shot-remove:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shot.is-reading img { opacity: .55; }
.shot.is-empty img { outline: 2px solid var(--act-fg); }
.bulk-list { margin: 14px 0; gap: 10px; }
.bulk-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.bulk-row img, .bulk-noimg { width: 52px; height: 52px; flex: none; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.bulk-main { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.bulk-main strong { font-family: var(--font-head); font-weight: 600; overflow-wrap: anywhere; }
.bulk-amazon { overflow-wrap: anywhere; }
.bulk-flag { display: inline-block; align-self: flex-start; margin-top: 4px; padding: 3px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-fg); font-size: .8rem; font-weight: 600; }
.bulk-tick { display: inline-flex; align-items: center; justify-content: center; width: 28px; flex: none; }
.bulk-tick input { width: 22px; height: 22px; accent-color: var(--brand); cursor: pointer; }
.bulk-qty { width: 120px; flex: none; }
.bulk-qty input.is-empty { border-color: var(--act-fg); }
.bulk-row.has-warning { border-color: color-mix(in srgb, var(--warn-fg) 45%, var(--line)); }
.bulk-row.is-off { opacity: .55; }
.bulk-row.is-missing { background: var(--act-bg); border-color: transparent; color: var(--act-fg); }
.bulk-row.is-missing .fine { color: var(--act-fg); }
.bulk-row.is-missing .bulk-tick { font-size: 1.4rem; font-weight: 700; }
.bulk-row.is-missing .bulk-qty { text-align: right; }
.bulk-send { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; }
.bulk-send > div { display: flex; flex-direction: column; }
.batch-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; scroll-margin-top: 140px;
    margin-top: 6px; padding: 12px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line-strong);
}
.batch-head > div { display: flex; flex-direction: column; min-width: 0; }
.batch-head strong { font-family: var(--font-head); font-weight: 600; }
.batch-head form { margin: 0; }
.batch-head.just-saved { border-color: var(--done-fg); animation: saved-pulse 2.4s ease-out 1; }
.report.in-batch { margin-left: 18px; }
@media (max-width: 720px) {
    .bulk-row { flex-wrap: wrap; padding: 12px 14px; }
    .bulk-main { flex: 1 1 calc(100% - 110px); }
    .bulk-qty { width: 100%; margin-left: 42px; width: calc(100% - 42px); }
    .bulk-qty input { min-height: 44px; font-size: 1rem; }
    .bulk-send { padding: 10px 14px; gap: 8px; bottom: 8px; }
    .bulk-send .fine { display: none; }
    .bulk-send .btn, .batch-head .btn, .batch-head form { width: 100%; min-height: 44px; }
    .report.in-batch { margin-left: 8px; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1; text-align: center; }
}
.shot-actions { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 6px 0 2px; width: 100%; }
.paste-target {
    min-width: 260px; min-height: 42px; padding: 10px 14px; border-radius: 10px; border: 1px dashed var(--line-strong); background: var(--surface);
    color: var(--muted); font-size: .88rem; cursor: text; caret-color: transparent; overflow: hidden; max-height: 42px;
}
.paste-target:empty::before { content: attr(data-placeholder); }
.paste-target:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.link-like { color: var(--link); text-decoration: underline; cursor: pointer; }
.shot-actions [hidden], #shot-clear[hidden] { display: none; }
@media (max-width: 720px) { .shot-actions > * { width: 100%; } .paste-target { min-width: 0; } }

/* ---------- Clickable dashboard ---------- */
a.kpi.is-link, a.card.stat.is-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi.is-link:hover, a.card.stat.is-link:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
a.kpi.is-link:focus-visible, a.card.stat.is-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
a.kpi.is-link .label::after, a.card.stat.is-link h3::after { content: " \203A"; color: var(--muted); }
.chart .bar-link { cursor: pointer; }
.chart .bar-link:hover .bar, .chart .bar-link:focus-visible .bar { opacity: .78; }
.chart .bar-link:focus-visible { outline: none; }
.chart .bar-link:focus-visible .bar { stroke: var(--focus); stroke-width: 2; }
@media (prefers-reduced-motion: reduce) { a.kpi.is-link, a.card.stat.is-link { transition: none; } }
.bulk .chip[hidden], .bulk-help[hidden] { display: none; }
.bulk-help p { margin: 0 0 6px; }
.bulk-shipment { font-weight: 600; color: var(--text); }
