/* novikit shared components, version B (showroom): console, admin and planner. Uses novikit-tokens.css only. No literal colours.
   Quiet chrome: surfaces with a 1 px line, 12 px controls, 16-24 px cards, verdigris accent, no gradients, no glow. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font: var(--t-body); background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.t-h1 { font: var(--t-large); letter-spacing: -.02em; }
.t-h2 { font: var(--t-title); letter-spacing: -.01em; }
.t-h3 { font: 600 16px/24px var(--font-ui); }
.t-small { font: var(--t-sec); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.ink2, .ink3 { color: var(--text2); } .delft { color: var(--accent); }
.wordmark { font: 600 22px/24px var(--font-ui); letter-spacing: -.02em; color: var(--text); }
.grow { flex: 1; min-width: 0; }

/* card */
.tile { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-xl); padding: var(--s5); position: relative; }
.tile--flat { border-radius: var(--r-lg); }
.tile--wash { background: var(--accent-soft); box-shadow: none; color: var(--on-accent-soft); }
.tile--pad0 { padding: 0; overflow: hidden; }
.tile--lift { box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }

/* controls: 48 px, 12 px radius; primary is verdigris, secondary is a sunken fill with a hairline */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: var(--r-md); border: 0; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font: 500 16px/1 var(--font-ui); cursor: pointer; transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), filter var(--t-fast) var(--ease); white-space: nowrap; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn:active { transform: scale(.97); filter: brightness(.94); }
.btn--pri { background: var(--accent); box-shadow: none; color: var(--on-accent); }
.btn--pri:hover { box-shadow: none; filter: brightness(1.06); }
.btn--sm { height: 44px; padding: 0 16px; font-size: 15px; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 17px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn--bad { color: var(--err); }
.btn:disabled { opacity: .45; cursor: default; transform: none; filter: none; }

.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-sm); font: 500 12px/1 var(--font-ui); background: var(--sunken); color: var(--text); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }
.chip--attn { background: var(--warn-soft); color: var(--warn); }
.chip--bad { background: var(--err-soft); color: var(--err); }
.chip--accent { background: var(--accent-soft); color: var(--on-accent-soft); }
.chip--plain { }

.label { font: var(--t-lab); color: var(--text2); margin: 16px 0 8px; display: block; }
.field, input.field, select.field, textarea.field { width: 100%; height: 52px; display: flex; align-items: center; padding: 0 16px; border-radius: var(--r-md); background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font: var(--t-body); transition: box-shadow var(--t-fast) var(--ease); }
textarea.field { height: auto; padding: 14px 16px; }
input.field::placeholder { color: var(--text2); }
input.field:focus, select.field:focus, textarea.field:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
.field.err, input.field.err { box-shadow: inset 0 0 0 2px var(--err); }
select.field { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%); background-position: calc(100% - 22px) 23px, calc(100% - 17px) 23px; background-size: 5px 5px; background-repeat: no-repeat; }

/* checkbox: 24 px box, verdigris when on */
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font: var(--t-body); margin: 0; cursor: pointer; }
.check small { margin-left: auto; font: var(--t-sec); color: var(--text2); text-align: right; }
.check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; flex: none; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.check input:checked { background: var(--accent); box-shadow: none; }
.check input:checked::after { content: ""; width: 6px; height: 12px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check input:disabled { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.check input:disabled:checked { background: var(--accent-soft); box-shadow: none; }
.check input:disabled:checked::after { border-color: var(--on-accent-soft); }
.check:has(input:disabled) { color: var(--text2); cursor: default; }

/* table: quiet header row, hairline rows, accent bar on the selected row */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font: var(--t-body); }
.tbl th { text-align: left; font: 500 13px/16px var(--font-ui); color: var(--text2); background: transparent; padding: 0 16px; height: 48px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 0 16px; height: 56px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--text2); font: var(--t-cap); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: var(--sunken); }
.tbl tr.sel td, .tbl tr.sel:hover td { background: var(--accent-soft); color: var(--on-accent-soft); }
.tbl tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl td.act { text-align: right; }
.tbl-scroll { overflow-x: auto; }
.dense .tbl td { height: 44px; } .dense .tbl th { height: 40px; }

/* stat card */
.stat { padding: 16px 20px; }
.stat .k { font: var(--t-sec); color: var(--text2); }
.stat .v { font: 600 32px/36px var(--font-ui); letter-spacing: -.02em; margin: 4px 0 2px; }
.stat .v small { font-size: 18px; color: var(--text2); font-weight: 400; }
.stat .c { font: var(--t-sec); color: var(--text2); }

/* page head and tabs (underline) */
.pagehead { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tabs button { padding: 0 16px; height: 48px; color: var(--text2); font: 500 16px/1 var(--font-ui); position: relative; background: none; border: 0; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }

/* top bar (console): wordmark, product tag, tools */
.rail { position: fixed; left: 0; right: 0; top: 0; height: 64px; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 12px; z-index: 5; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.rail .wordmark { font-size: 24px; }
.rail .ctag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--r-sm); background: var(--dark-surface); color: var(--on-dark); font: 500 13px/1 var(--font-ui); }
.rail .tilebtn { min-width: 44px; height: 44px; padding: 0 12px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text); border: 0; background: transparent; cursor: pointer; font: 500 14px/1 var(--font-ui); transition: background var(--t-fast) var(--ease); }
.rail .tilebtn:hover { background: var(--sunken); }
.rail .tilebtn.on { background: var(--accent); color: var(--on-accent); }
.rail .sp { flex: 1; }
.rail .tilebtn.quiet { box-shadow: inset 0 0 0 1px var(--line); }

@media (prefers-reduced-motion: no-preference) {
  .settle > * { animation: settle var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
  @keyframes settle { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0ms !important; animation: none !important; } }
