/* Mainframe — wireframe stylesheet.
 *
 * Intentionally undecorated. Black on white, rounded white boxes
 * with thin gray borders, generous whitespace, Inter typeface.
 * No colors beyond grayscale + one accent for interactive
 * affordances. The intent is a clickable wireframe — design
 * sensibility shows up in proportions and typography, not in
 * visual styling.
 */

@import url("https://rsms.me/inter/inter.css");

:root {
    /* Grayscale */
    --bg:           #ffffff;
    --fg:           #111111;
    --fg-muted:     #5a5a5a;
    --fg-faint:     #909090;
    --line:         #e2e2e2;
    --line-strong:  #c8c8c8;
    --tint:         #f7f7f7;

    /* Single accent for interactive affordances. */
    --accent:       #1a1a1a;
    --accent-fg:    #ffffff;

    /* Typography scale. */
    --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Layout. */
    --radius:       12px;
    --radius-sm:    8px;
    --shell-max:    1100px;
    --shell-pad:    24px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--fg); }

/* ---------- Page shell ---------- */

.shell {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 32px var(--shell-pad) 96px;
}

.topbar {
    display: flex;
    align-items: center;
    /* Three slots: left (brand), center (nav), right (cart). The
     * two side slots get equal flex weight so the nav sits truly
     * centered between them — not just floating in the leftover
     * space. */
    padding: 20px var(--shell-pad);
    border-bottom: 1px solid var(--line);
    max-width: var(--shell-max);
    margin: 0 auto;
}
.topbar .topbar-side {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0; /* permit shrinking if nav grows wider than expected */
}
.topbar .topbar-left  { justify-content: flex-start; }
.topbar .topbar-right { justify-content: flex-end; }
.topbar .brand {
    font-weight: 600;
    letter-spacing: -0.01em;
    font-size: 18px;
    text-decoration: none;
}
.topbar nav {
    display: flex;
    gap: 28px;
    font-size: 14px;
    justify-content: center;
    align-items: center;
    /* Natural width — the side slots use flex:1 to balance around
     * this. Adding a horizontal padding so nav text never butts
     * directly into the brand or cart at narrow widths. */
    padding: 0 16px;
}
.topbar nav a { text-decoration: none; color: var(--fg-muted); }
.topbar nav a:hover { color: var(--fg); }
/* Active top-level item: subtle underline using text-decoration
 * with a generous offset so it reads as a "you are here" indicator
 * rather than a link decoration. Sub-item active state mirrors
 * this in the subbar below. */
.topbar nav a.active {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--fg);
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}
.topbar .cart-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg-muted);
    /* The right side slot uses justify-content: flex-end, so the
     * chip naturally lands at the right edge of its slot. No
     * margin-left:auto needed. */
}
.topbar .cart-link:hover,
.topbar .cart-link.active { color: var(--fg); }
/* Sign out — sits just to the right of the cart chip in the right slot. */
.topbar .signout-link {
    margin-left: 18px;
    text-decoration: none;
    color: var(--fg-muted);
    font-size: 14px;
    white-space: nowrap;
}
.topbar .signout-link:hover { color: var(--fg); }
.topbar .cart-icon {
    display: block;
    flex: 0 0 auto;
}
.topbar .cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: 12px;
    font-weight: 600;
}
.topbar .cart-count.empty { background: var(--line); color: var(--fg-muted); }

/* ---------- Subbar (per-section submenu) ---------- */

/* Injected by layout.js as a sibling of .topbar when the active
 * section has children. 34px tall, centered links, with a thin
 * horizontal rule beneath. The topbar's own border-bottom sits
 * above (one rule under the brand bar, another under the subbar)
 * so the two bars read as a stacked pair. */
.subbar {
    max-width: var(--shell-max);
    margin: 0 auto;
    padding: 0 var(--shell-pad);
    border-bottom: 1px solid var(--line);
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.subbar nav {
    display: flex;
    gap: 22px;
    font-size: 13px;
    align-items: center;
}
.subbar nav a {
    text-decoration: none;
    color: var(--fg-muted);
    line-height: 1;
}
.subbar nav a:hover { color: var(--fg); }
.subbar nav a.active {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--fg);
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

/* ---------- Compliance report list ---------- */

.report-summary {
    display: flex;
    gap: 48px;
    margin: 16px 0 32px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.report-summary .stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.report-summary .stat .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-faint);
}
.report-summary .stat .value {
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.report-summary .stat .sub {
    font-size: 12px;
    color: var(--fg-muted);
}

.report-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.report-list-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg);
}
.report-list-header .title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.report-list-header h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: -0.01em;
}
.report-list-header .count {
    font-size: 12px;
    color: var(--fg-faint);
    font-variant-numeric: tabular-nums;
}
.report-list-header input[type="search"] {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    min-width: 280px;
    background: var(--bg);
}
.report-list-header input[type="search"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: transparent;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}
.report-table th, .report-table td {
    text-align: left;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    vertical-align: middle;
}
.report-table thead th {
    font-weight: 500;
    color: var(--fg-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--tint);
    border-bottom: 1px solid var(--line);
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover { background: var(--tint); }
.report-table td.id {
    font-family: var(--font-mono);
    color: var(--fg-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    width: 110px;
}
.report-table td.level {
    color: var(--fg-faint);
    width: 50px;
}
.report-table td.status { width: 160px; }
.report-table td.title { color: var(--fg); }
.report-table .empty-row td {
    padding: 32px 20px;
    text-align: center;
    color: var(--fg-faint);
    font-size: 13px;
}

/* Status pills — grayscale-only with one filled variant for the
 * strongest "needs attention" signal. The wireframe stays pure;
 * the operator gets a clear visual hierarchy. */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status-pill.compliant {
    border-color: var(--line-strong);
    color: var(--fg);
    background: var(--bg);
}
.status-pill.non-compliant {
    border-color: var(--accent);
    color: var(--accent-fg);
    background: var(--accent);
}
.status-pill.na {
    border-color: var(--line);
    color: var(--fg-muted);
    background: var(--tint);
}
.status-pill.unknown {
    border-color: var(--line-strong);
    border-style: dashed;
    color: var(--fg-faint);
    background: var(--bg);
}

/* ---------- Typography ---------- */

h1 {
    font-size: 32px;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    font-weight: 600;
}
h2 {
    font-size: 22px;
    letter-spacing: -0.01em;
    margin: 32px 0 16px;
    font-weight: 600;
}
.muted { color: var(--fg-muted); font-size: 14px; }
.crumbs {
    color: var(--fg-faint);
    font-size: 13px;
    margin-bottom: 16px;
}
.crumbs a { color: var(--fg-muted); }

/* ---------- The box ---------- */

.box {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    background: var(--bg);
}
.box + .box { margin-top: 16px; }
/* …unless they're laid out in a grid (catalog, "what you can do",
 * etc.) — there the parent's `gap` already handles spacing and the
 * margin-top makes the first cell read as taller than the rest
 * (cell 1 fills from top; cells 2-4 have a 16px offset before
 * content starts, visually shrinking them within their grid track). */
.grid > .box + .box { margin-top: 0; }

.box-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* ---------- Product grid ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--fg);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
    transition: border-color 80ms ease, transform 80ms ease;
}
.card:hover {
    border-color: var(--line-strong);
    text-decoration: none;
}
.card:active { transform: translateY(1px); }
.card .placeholder {
    height: 120px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.card .name { font-weight: 600; font-size: 15px; }
.card .kind { font-size: 12px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.card .price { font-weight: 600; margin-top: auto; }

/* ---------- Product detail ---------- */

.detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 760px) {
    .detail { grid-template-columns: 1fr; }
}
.detail .image {
    height: 320px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.detail h1 { margin-top: 0; }
.detail .desc {
    margin: 16px 0 24px;
    color: var(--fg-muted);
}
.detail .price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}
.detail .price-row .label { color: var(--fg-muted); font-size: 13px; }
.detail .price-row .amount { font-size: 22px; font-weight: 600; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-fg);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 60ms ease;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost {
    background: var(--bg);
    color: var(--fg);
    border-color: var(--line-strong);
}
.btn.ghost:hover { border-color: var(--fg); opacity: 1; }

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.qty-stepper button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: var(--fg-muted);
}
.qty-stepper button:hover { color: var(--fg); }
.qty-stepper .value {
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---------- Cart table ---------- */

.cart-table {
    width: 100%;
    border-collapse: collapse;
}
.cart-table th, .cart-table td {
    text-align: left;
    padding: 16px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.cart-table th {
    font-weight: 500;
    color: var(--fg-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cart-table td.right, .cart-table th.right { text-align: right; }
.cart-table .name { font-weight: 500; }
.cart-table .kind { color: var(--fg-faint); font-size: 12px; }
.cart-table .remove {
    background: none;
    border: none;
    color: var(--fg-faint);
    cursor: pointer;
    padding: 4px;
    font: inherit;
}
.cart-table .remove:hover { color: var(--fg); }

.totals {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
.totals .row {
    display: flex;
    justify-content: space-between;
    min-width: 240px;
    color: var(--fg-muted);
}
.totals .row.total { color: var(--fg); font-size: 18px; font-weight: 600; padding-top: 12px; border-top: 1px solid var(--line); }
.totals .row.total .v { font-variant-numeric: tabular-nums; }

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

/* ---------- Forms ---------- */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
}
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field label {
    font-size: 12px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.field input {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font: inherit;
    background: var(--bg);
}
.field input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: transparent;
}

/* ---------- Status + empty ---------- */

.status {
    color: var(--fg-faint);
    font-size: 14px;
    text-align: center;
    padding: 48px 0;
}
.status.error { color: #a02020; }
.empty {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    color: var(--fg-muted);
}
.empty p { margin: 0 0 16px; }

/* ---------- Order confirmation ---------- */

.confirm {
    text-align: center;
    padding: 32px 0;
}
.confirm .seal {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}
.confirm h1 { margin-bottom: 8px; }
.confirm .order-no {
    font-family: var(--font-mono);
    color: var(--fg-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

/* ---------- Footer ---------- */

.footer {
    border-top: 1px solid var(--line);
    padding: 24px var(--shell-pad);
    text-align: center;
    color: var(--fg-faint);
    font-size: 12px;
    margin-top: 64px;
    max-width: var(--shell-max);
    margin-left: auto;
    margin-right: auto;
}
