/* =====================================================================
   MerchX design system
   One stylesheet, custom properties, no framework.
   ===================================================================== */

/* IBM Plex Sans, self-hosted. No CDN at runtime, works offline. */
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

/*
 * Palette.
 *
 * Ink is the brand. Green appears only where something is confirmed:
 * the primary call to action, a saving, an OK status. A saturated green
 * used as the brand colour reads as a giveaway catalogue, and these
 * customers are placing 100-10 000 unit orders with an agency budget.
 *
 * The page sits on warm paper, not white, so that the white packshots
 * read as objects on a surface instead of dissolving into the page.
 */
:root {
    --ink:          #12181f;
    --ink-2:        #3a4654;
    --ink-3:        #6a7786;
    --line:         #ddd8d1;
    --line-2:       #ebe7e1;
    --bg:           #f7f5f2;
    --bg-2:         #efede9;
    --bg-3:         #e8e2d8;
    --paper:        #ffffff;

    --brand:        #12181f;   /* header, footer, secondary buttons */
    --brand-dark:   #000000;
    --brand-light:  #e4f0e8;

    --action:       #1a5c3b;   /* primary CTA and savings, nothing else */
    --action-dark:  #134a2f;
    --action-bg:    #e4f0e8;

    --ok:      #1a5c3b;
    --ok-bg:   #e4f0e8;
    --warn:    #9a5b10;
    --warn-bg: #fbf0dd;
    --danger:  #b42318;
    --danger-bg:#fbe3e1;
    --info:    #1d4e79;
    --info-bg: #e6edf4;

    --radius:    4px;
    --radius-sm: 4px;
    --radius-lg: 6px;
    --shadow:    0 1px 2px rgba(18,24,31,.05);
    --shadow-lg: 0 4px 20px rgba(18,24,31,.12);

    --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --wrap: 1120px;
    --gap:  20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* Links are ink with an underline, not a coloured word in a sentence. */
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.22; font-weight: 650; letter-spacing: -.02em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: .98rem; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

small, .small { font-size: .84rem; }
.muted { color: var(--ink-3); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .88em; }
.right { text-align: right; }
.center { text-align: center; }
.uppercase { text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; }

/* ---- layout ------------------------------------------------------ */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: flex-start; }
.row-center { align-items: center; }
.row-between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

section.pad { padding: 44px 0; }
section.pad-sm { padding: 26px 0; }
.bg-2 { background: var(--bg-2); }
.bg-3 { background: var(--bg-3); }

.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.hide { display: none !important; }

/* ---- header ------------------------------------------------------ */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo .mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--brand); color: #fff;
    display: grid; place-items: center; font-size: .95rem; font-weight: 800;
}
.logo img { max-height: 34px; width: auto; }

.nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav a, .nav button.linkish {
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--ink-2); font-weight: 550; font-size: .93rem;
    background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button.linkish:hover { background: var(--bg-3); text-decoration: none; color: var(--ink); }
.nav a.active { color: var(--brand-dark); background: var(--brand-light); }

.cart-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--brand); color: #fff !important; font-weight: 600;
}
.cart-pill:hover { background: var(--brand-dark); text-decoration: none; }
.cart-pill .count {
    background: rgba(255,255,255,.28); border-radius: 999px;
    padding: 0 7px; font-size: .8rem; min-width: 20px; text-align: center;
}

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; }

/* ---- buttons ----------------------------------------------------- */
/* Primary buttons carry the action colour; that is the only place green
   belongs. Ghost buttons and secondary actions stay in ink. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: .92rem;
    border: 1px solid transparent; cursor: pointer;
    background: var(--action); color: #fff;
    transition: background .12s ease, border-color .12s ease, opacity .12s;
    text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--action-dark); text-decoration: none; color: #fff; }
.btn-ink { background: var(--ink); }
.btn-ink:hover { background: #000; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); border-color: var(--ink-3); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1c13; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-link { background: none; color: var(--brand-dark); border: 0; padding: 4px 6px; }
.btn-link:hover { background: var(--brand-light); color: var(--brand-dark); }

/* ---- cards, panels ----------------------------------------------- */
.card {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-head {
    padding: 16px 22px; border-bottom: 1px solid var(--line-2);
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--bg-2); border-radius: 0 0 var(--radius) var(--radius); }

.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* ---- product cards -------------------------------------------------
   The packshot is treated as an object on a surface: square white plate,
   contained not cropped, no rounding on the image itself. Hover draws a
   line rather than lifting the card - movement reads as a toy.
   ------------------------------------------------------------------ */
.product-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: border-color .15s ease;
}
.product-card:hover { border-color: var(--ink); text-decoration: none; }
.product-card .thumb {
    aspect-ratio: 1 / 1; background: var(--paper);
    display: grid; place-items: center; overflow: hidden;
    border-bottom: 1px solid var(--line-2);
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 24px; border-radius: 0; }
.product-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-card .name { font-weight: 600; color: var(--ink); font-size: .95rem; line-height: 1.35; }
.product-card .desc { color: var(--ink-3); font-size: .84rem; flex: 1; }
.product-card .price { margin-top: 8px; font-weight: 600; color: var(--ink); font-size: .95rem; font-variant-numeric: tabular-nums; }
.product-card .price small { color: var(--ink-3); font-weight: 400; }
.product-card .moq { color: var(--ink-3); font-size: .72rem; }

/* ---- forms ------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.field .hint { font-size: .82rem; color: var(--ink-3); margin-top: 5px; }
.field .err { font-size: .84rem; color: var(--danger); margin-top: 5px; font-weight: 550; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], input[type=url],
input[type=color], select, textarea {
    width: 100%; padding: 9px 12px; font: inherit; font-size: .94rem;
    color: var(--ink); background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47,141,70,.16);
}
input[type=color] { padding: 3px; height: 40px; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-3); color: var(--ink-3); }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7a8c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; margin-bottom: 10px; }
.check input { width: auto; margin-top: 3px; flex: none; }
.check label { margin: 0; font-weight: 500; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 20px; }
legend { font-weight: 650; padding: 0 8px; font-size: .92rem; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }

/* radio cards for transport choice */
.choice-list { display: grid; gap: 10px; }
.choice {
    display: flex; gap: 11px; align-items: flex-start;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; cursor: pointer; background: #fff;
    transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--ink-3); }
.choice input { margin-top: 3px; flex: none; width: auto; }
.choice.selected { border-color: var(--brand); background: var(--brand-light); }
.choice .t { font-weight: 620; font-size: .93rem; }
.choice .d { font-size: .83rem; color: var(--ink-3); }

/* ---- tables ------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data th {
    font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--ink-3); font-weight: 650; background: var(--bg-2);
    position: sticky; top: 0; white-space: nowrap;
}
table.data tbody tr:hover { background: var(--bg-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 650; border-top: 2px solid var(--line); background: var(--bg-2); }
table.data.compact th, table.data.compact td { padding: 6px 10px; font-size: .87rem; }

/* ---- badges ------------------------------------------------------ */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 650; white-space: nowrap;
    background: var(--bg-3); color: var(--ink-2);
}
.badge-ok      { background: var(--ok-bg);     color: var(--ok); }
.badge-warn    { background: var(--warn-bg);   color: var(--warn); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: var(--info-bg);   color: var(--info); }
.badge-active  { background: var(--brand-light); color: var(--brand-dark); }
.badge-pending { background: #fff5d6; color: #8a6100; }
.badge-muted   { background: var(--bg-3); color: var(--ink-3); }

/* ---- alerts ------------------------------------------------------ */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm);
    border: 1px solid; margin-bottom: 16px; font-size: .93rem;
}
.alert-success { background: var(--ok-bg);     border-color: #bfe3ce; color: #12603a; }
.alert-error   { background: var(--danger-bg); border-color: #f3b7b2; color: #8f1c13; }
.alert-warning { background: var(--warn-bg);   border-color: #f5d9ac; color: #8a4708; }
.alert-info    { background: var(--info-bg);   border-color: #b8d7f0; color: #16558c; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ---- hero -------------------------------------------------------- */
/* A still hero, not a slider. B2B lands here to find a category or an
   article number, so this must not eat the fold: 280px, one sentence,
   one button. */
.hero {
    background: var(--ink);
    color: #fff; padding: 0;
    min-height: 280px; display: flex; align-items: center;
}
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); color: #fff; max-width: 20ch; }
.hero p { font-size: 1.06rem; color: rgba(255,255,255,.85); max-width: 56ch; }
.hero .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ---- timeline (order tracking) ----------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 26px 34px; }
.timeline li::before {
    content: ''; position: absolute; left: 7px; top: 20px; bottom: -6px;
    width: 2px; background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li .dot {
    position: absolute; left: 0; top: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; border: 2px solid var(--line); z-index: 1;
}
.timeline li.done .dot { background: var(--ok); border-color: var(--ok); }
.timeline li.done::before { background: var(--ok); }
.timeline li.current .dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-light); }
.timeline li.problem .dot { background: var(--warn); border-color: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.timeline li .t { font-weight: 620; }
.timeline li .when { font-size: .83rem; color: var(--ink-3); }
.timeline li .note { font-size: .89rem; color: var(--ink-2); margin-top: 3px; }

/* ---- messages ---------------------------------------------------- */
.msg { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 10px; max-width: 78%; }
.msg .who { font-size: .78rem; font-weight: 650; color: var(--ink-3); margin-bottom: 3px; }
.msg .body { white-space: pre-wrap; }
.msg-admin { background: var(--bg-3); }
.msg-customer { background: var(--brand-light); margin-left: auto; }
.msg-system { background: var(--info-bg); font-size: .89rem; }

/* ---- price ladder --------------------------------------------------
   Not a chart: clickable steps that fill in the quantity. An agency
   budgets in kroner per unit AND line total, so both are shown.
   ------------------------------------------------------------------ */
.ladder { display: flex; gap: 8px; flex-wrap: wrap; }
.ladder button {
    border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-sm);
    padding: 9px 12px; cursor: pointer; font: inherit; text-align: left; min-width: 96px;
    transition: border-color .12s, background .12s;
}
.ladder button:hover { border-color: var(--ink); }
.ladder button.active { border-color: var(--ink); background: var(--bg-2); }
.ladder button.common { border-color: var(--action); }
.ladder .q { font-size: .76rem; color: var(--ink-3); display: block; }
.ladder .p { font-weight: 650; color: var(--ink); display: block; font-variant-numeric: tabular-nums; font-size: .95rem; }
.ladder .t { font-size: .76rem; color: var(--ink-2); display: block; font-variant-numeric: tabular-nums; }
.ladder .s { font-size: .72rem; color: var(--action); font-weight: 650; }

/* ---- price block ---------------------------------------------------
   Sits at the TOP of the configurator and keeps its height when empty,
   so the panel never jumps as the customer types.
   ------------------------------------------------------------------ */
.price-block {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg-2); padding: 16px 18px; min-height: 96px;
    display: flex; flex-direction: column; justify-content: center;
}
.price-block .total { font-size: 2rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.price-block .unit { font-size: .86rem; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.price-block .empty { color: var(--ink-3); font-size: .95rem; }
.price-block table { width: 100%; font-size: .84rem; margin-top: 10px; border-collapse: collapse; }
.price-block td { padding: 2px 0; }
.price-block td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- quantity matrix -----------------------------------------------
   44px touch targets, not 8px boxes. Label above, figure right-aligned.
   ------------------------------------------------------------------ */
.qty-matrix { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.qty-cell { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--paper); }
.qty-cell .lbl { font-size: .8rem; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.qty-cell input { text-align: right; font-variant-numeric: tabular-nums; height: 44px; font-size: 1rem; }

/* Single-variant products get a stepper instead of a lone box. */
.qty-stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); }
.qty-stepper button {
    width: 48px; border: 0; background: var(--bg-2); cursor: pointer;
    font: inherit; font-size: 1.2rem; color: var(--ink); line-height: 1;
}
.qty-stepper button:hover { background: var(--bg-3); }
.qty-stepper input {
    flex: 1; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    height: 44px; text-align: center; font-size: 1.05rem; font-variant-numeric: tabular-nums;
    border-radius: 0;
}
.qty-stepper input:focus { box-shadow: none; }

/* ---- stat tiles -------------------------------------------------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 650; }
.stat .v { font-size: 1.75rem; font-weight: 700; margin-top: 3px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .s { font-size: .83rem; color: var(--ink-3); margin-top: 2px; }
.stat.warn .v { color: var(--warn); }
.stat.danger .v { color: var(--danger); }
.stat.ok .v { color: var(--ok); }

/* ---- admin shell ------------------------------------------------- */
.admin-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--ink); color: #c9d4df; padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { padding: 0 20px 18px; font-weight: 750; color: #fff; font-size: 1.06rem; display: flex; align-items: center; gap: 9px; }
.admin-side .brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; font-size: .82rem; }
.admin-side .group { padding: 14px 20px 5px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7d8b99; font-weight: 700; }
.admin-side a {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 20px; color: #c9d4df; font-size: .9rem; font-weight: 520;
}
.admin-side a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.admin-side a.active { background: var(--brand); color: #fff; }
.admin-side a .pill { margin-left: auto; background: rgba(255,255,255,.18); border-radius: 999px; padding: 0 7px; font-size: .74rem; }
.admin-side a.active .pill { background: rgba(0,0,0,.22); }

.admin-main { background: var(--bg-2); min-width: 0; }
.admin-top {
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 14px 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 20;
}
.admin-top h1 { margin: 0; font-size: 1.24rem; }
.admin-top .spacer { margin-left: auto; }
.admin-content { padding: 24px 26px 60px; }

.breadcrumb { font-size: .85rem; color: var(--ink-3); margin-bottom: 14px; }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb span { margin: 0 6px; }

/* ---- tabs -------------------------------------------------------- */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a {
    padding: 9px 15px; color: var(--ink-3); font-weight: 600; font-size: .91rem;
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---- pagination -------------------------------------------------- */
.pager { display: flex; gap: 5px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: .87rem; background: #fff; color: var(--ink-2);
}
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 650; }

/* ---- footer ------------------------------------------------------ */
.site-footer { background: var(--ink); color: #9fb0be; padding: 44px 0 30px; margin-top: 60px; font-size: .9rem; }
.site-footer h4 { color: #fff; font-size: .92rem; margin-bottom: 12px; }
.site-footer a { color: #9fb0be; }
.site-footer a:hover { color: #fff; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 18px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: .84rem; }

/* ---- misc -------------------------------------------------------- */
.empty-state { text-align: center; padding: 52px 20px; color: var(--ink-3); }
.empty-state h3 { color: var(--ink-2); }
.spinner {
    display: inline-block; width: 15px; height: 15px; vertical-align: -2px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-busy { opacity: .55; pointer-events: none; }

.swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; vertical-align: middle; }
.thumb-sm { width: 44px; height: 44px; object-fit: contain; background: var(--bg-3); border-radius: var(--radius-sm); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; font-size: .92rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 550; }

.gallery-main { background: var(--bg-3); border-radius: var(--radius); aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs button { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); padding: 0; width: 62px; height: 62px; cursor: pointer; overflow: hidden; }
.gallery-thumbs button.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }

.sticky-side { position: sticky; top: 84px; }

.log-view {
    font-family: var(--mono); font-size: .8rem; background: var(--ink); color: #c9d4df;
    padding: 14px; border-radius: var(--radius-sm); overflow-x: auto;
    max-height: 620px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.log-view .warn { color: #f6c04e; }
.log-view .err { color: #f38b82; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 54px; }
.bars i { flex: 1; background: var(--brand-light); border-radius: 2px 2px 0 0; min-height: 2px; display: block; }
.bars i.hot { background: var(--danger); }

/* ---- print ------------------------------------------------------- */
@media print {
    .site-header, .site-footer, .admin-side, .admin-top, .no-print { display: none !important; }
    body { font-size: 12px; }
    .card { box-shadow: none; border-color: #ccc; }
    .admin-layout { display: block; }
    .admin-content { padding: 0; }
}

/* ---- responsive -------------------------------------------------- */
@media (max-width: 1000px) {
    .grid-sidebar, .grid-4 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; }
    .admin-side .group { padding-top: 10px; }
    .sticky-side { position: static; }
}

@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .nav-toggle { display: block; margin-left: auto; }
    .nav {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--line);
        flex-direction: column; align-items: stretch; padding: 10px; gap: 2px;
        box-shadow: var(--shadow-lg);
    }
    .nav.open { display: flex; }
    .site-header .bar { gap: 12px; }
    .hero { padding: 44px 0 48px; }
    section.pad { padding: 30px 0; }
    .card-pad, .card-body { padding: 16px; }
    .admin-content { padding: 16px; }
    .msg { max-width: 92%; }
}
