/* Meuble admin on the Maerev design system. Load order: tokens.css, maerev.css, app.css.
   Only Maerev tokens here; component values follow docs/Maerev Design System. Light theme only. */

* { box-sizing: border-box; }
body { margin: 0; }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

/* Nav: quiet bar, underline tabs with an Indigo active state */
nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-5); padding: 0 var(--space-6); background: var(--surface-card); border-bottom: 1px solid var(--border-default); }
nav .brand { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; margin-right: var(--space-3); color: var(--ink); font-weight: var(--weight-bold); font-size: 18px; }
nav .brand img { width: 28px; height: 28px; }
nav .brand:hover { text-decoration: none; }
nav .tab { padding: 18px 2px 15px; color: var(--text-muted); font-weight: var(--weight-medium); font-size: 15px; border-bottom: 2px solid transparent; transition: color var(--duration-fast) var(--ease-out); }
nav .tab:hover { color: var(--ink); text-decoration: none; }
nav .tab.active { color: var(--ink); border-bottom-color: var(--maerev-indigo); }
nav form { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); font-size: 14px; }

main { max-width: 1200px; margin: 0 auto; padding: var(--space-6); }

/* Type */
h1 { font-size: 36px; font-weight: var(--weight-bold); line-height: var(--leading-heading); margin: 0 0 var(--space-5); }
h2 { font-size: 24px; font-weight: var(--weight-semibold); line-height: var(--leading-heading); margin: var(--space-7) 0 var(--space-4); }
.eyebrow, th, label.caption { font-family: var(--font-mono); font-size: var(--text-caption); font-weight: var(--weight-medium); letter-spacing: var(--tracking-caption); text-transform: uppercase; color: var(--text-muted); }
.tagline { font-family: var(--font-serif); font-style: italic; font-size: 19px; color: var(--text-muted); margin: 0 0 var(--space-5); }
.muted { color: var(--text-muted); }
.missing { color: var(--text-muted); font-style: italic; }
.neg { color: var(--feedback-error); }
code, pre { font-family: var(--font-mono); font-size: 13px; }
code { background: var(--sand); padding: 1px 6px; border-radius: var(--radius-sm); }
pre { background: var(--sand); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* Card */
.card { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5); margin-bottom: var(--space-5); }
.card > h2:first-of-type { margin-top: 0; }
.stat strong { display: block; font-size: 24px; font-weight: var(--weight-semibold); line-height: var(--leading-heading); margin-top: var(--space-1); }

/* Table inside the card surface */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); vertical-align: top; }
th { padding-top: var(--space-4); background: var(--surface-card); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--duration-fast) var(--ease-out); }
tbody tr:hover td { background: var(--paper); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.low td, tr.low:hover td { background: var(--feedback-warning-soft); }

/* Badge: soft fills, no borders, always a word */
.badge { display: inline-block; padding: 5px 10px 3px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: var(--weight-medium); line-height: 1.2; background: var(--mist); color: var(--ink); white-space: nowrap; vertical-align: 1px; }
.badge.mcp { background: var(--indigo-soft); color: var(--maerev-indigo); }
.badge.low { background: var(--feedback-warning-soft); color: color-mix(in oklch, var(--feedback-warning) 75%, var(--ink)); }

/* Buttons: primary solid Indigo; .secondary outlined card; .ghost transparent Indigo */
button, .btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 11px 18px 9px; font-family: var(--font-sans); font-size: 15px; font-weight: var(--weight-medium); line-height: 1; border: none; border-radius: var(--radius-md); cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--maerev-indigo); color: var(--text-on-accent); transition: background var(--duration-fast) var(--ease-out); }
button:hover, .btn:hover { background: var(--indigo-hover); text-decoration: none; }
button:active, .btn:active { background: var(--indigo-press); }
button.secondary, .btn.secondary { background: var(--surface-card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--sand); }
button.secondary:active, .btn.secondary:active { background: var(--mist); }
button.ghost, .btn.ghost { background: transparent; color: var(--maerev-indigo); }
button.ghost:hover, .btn.ghost:hover { background: var(--indigo-soft); }
button.ghost:active, .btn.ghost:active { background: color-mix(in oklch, var(--maerev-indigo) 18%, var(--paper)); }
button.sm, .btn.sm { height: 32px; padding: 8px 14px 6px; font-size: 13px; }
button.link { height: auto; padding: 0; background: none; color: var(--text-muted); }
button.link:hover { color: var(--ink); background: none; }

/* Forms: quiet border, Indigo focus */
label { display: block; font-size: 14px; font-weight: var(--weight-medium); color: var(--ink); margin-bottom: 6px; }
label.check { display: inline-flex; align-items: center; gap: 10px; font-weight: var(--weight-regular); font-size: 15px; cursor: pointer; margin: 0; }
input, select, textarea { width: 100%; height: 44px; padding: 2px 14px 0; font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: var(--surface-card); border: none; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border-strong); outline: none; transition: box-shadow var(--duration-fast) var(--ease-out); }
textarea { height: auto; padding: 10px 14px; line-height: var(--leading-body); }
input:focus, select:focus, textarea:focus { box-shadow: inset 0 0 0 1.5px var(--border-focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; } /* the inset Indigo ring is the focus cue */
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select { appearance: none; padding: 0 36px 0 14px; cursor: pointer; background: var(--surface-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23656b6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
input[type=checkbox] { width: 20px; height: 20px; padding: 0; margin: 0; box-shadow: none; accent-color: var(--maerev-indigo); cursor: pointer; }
.field { margin-bottom: var(--space-4); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.grid .card { margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-5); }
.toolbar .spacer { flex: 1; }
.toolbar > label.check { height: 44px; }
table.ratecard { table-layout: fixed; } /* same column widths in every category table */
table.ratecard .c-code { width: 15%; } table.ratecard .c-name { width: 33%; } table.ratecard .c-unit { width: 10%; }
table.ratecard .c-price { width: 15%; } table.ratecard .c-small { width: 9%; }

/* Feedback: soft fill plus a word, ink text for contrast */
.flash, .errors { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); margin-bottom: var(--space-5); color: var(--ink); }
.flash { background: var(--feedback-success-soft); }
.errors { background: var(--feedback-error-soft); }
.errors ul { margin: 0; padding-left: 18px; }

/* Login: centered card on a warm Sand band */
body.guest { background: var(--sand); }
.narrow { max-width: 440px; margin: 10vh auto; }
.narrow .logo { width: 40px; height: 40px; margin-bottom: var(--space-4); }

@media (max-width: 720px) {
    nav, main { padding-left: var(--space-4); padding-right: var(--space-4); }
    nav form { margin-left: 0; width: 100%; padding-bottom: var(--space-3); }
    h1 { font-size: 30px; }
    table { display: block; overflow-x: auto; }
    table.ratecard { table-layout: auto; }
    th, td { white-space: nowrap; }
    .toolbar > div, .toolbar > .btn, .toolbar > button { flex: 1 1 100%; }
    .toolbar .spacer { display: none; }
}

.cat-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--border-default); flex: 1; min-width: 0; cursor: grab; }
.cat-tabs a { flex: none; white-space: nowrap; padding: 10px 12px 8px; color: var(--text-muted); font-weight: var(--weight-medium); border-bottom: 3px solid transparent; }
.cat-tabs a:hover { color: var(--ink); text-decoration: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a.active { color: var(--maerev-indigo); font-weight: var(--weight-semibold, 600); border-bottom-color: var(--maerev-indigo); background: color-mix(in oklch, var(--maerev-indigo) 8%, transparent); border-radius: 6px 6px 0 0; }
.cat-tabs-wrap { display: flex; align-items: stretch; gap: 4px; margin: 0 0 16px; box-shadow: inset 0 -1px 0 var(--border-default); }
.cat-tabs.dragging { cursor: grabbing; user-select: none; }
.cat-arrow { flex: none; width: 32px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 6px; }
.cat-arrow:hover:not(:disabled) { background: color-mix(in oklch, var(--maerev-indigo) 8%, transparent); }
.cat-arrow:disabled { opacity: .25; cursor: default; }
