/**
 * @file        style.css
 * @description SynthFlux styles: SynthetixMind design system (SynthFlux-BrandIdentity.md), Sora / IBM Plex, 768-1920 px (NFR-14, NFR-15)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         795dde2d-02be-4ace-bdde-072014d7b1e5
 * @version     0.2.0.5
 * @created     2026-12-02
 * @updated     2026-12-03
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

@font-face { font-family: 'Sora'; font-weight: 600; font-display: swap; src: url('/fonts/sora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; 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-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-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }

/* Brand palette (SynthFlux-BrandIdentity.md). Orange is never used for text. */
:root {
  --navy: #1C2C37;
  --orange: #FA5800;
  --white: #F2F4F6;
  --beige: #EADDD3;
  --mahogany: #6B2D19;
  --surface: #FFFFFF;
  --line: #CBD2D9;
  --muted: #4A5864;
  --accent-strong: #C24400;
  --border-strong: #7A8691;
  --ok: #1E6B3A;
  --radius: 8px;
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-text: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--navy); font: 400 16px/1.5 var(--font-text); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 16px; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin-top: 32px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--mahogany); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.mono, code, pre { font-family: var(--font-mono); }
code { background: var(--beige); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; word-break: break-all; }
pre { background: var(--navy); color: var(--white); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font-size: 14px; }
pre code { background: none; padding: 0; color: inherit; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Buttons: one orange primary action per view; destructive actions in mahogany. */
.button, button.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: var(--radius);
  border: 2px solid var(--navy); background: var(--surface); color: var(--navy); font: 600 16px var(--font-text); text-decoration: none; cursor: pointer; }
.button:hover { background: var(--beige); color: var(--navy); }
/* Navy on orange is 4.41:1, so primary labels are bold and at least 19 px (large text). */
.button.button-primary { background: var(--orange); border-color: var(--orange); color: var(--navy); font-size: 19px; font-weight: 700; }
.button.button-primary:hover { background: #E04F00; border-color: #E04F00; color: var(--navy); }
.button.button-danger { background: var(--mahogany); border-color: var(--mahogany); color: var(--white); }
.button.button-danger:hover { background: #561F0F; color: var(--white); }
.button-small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.button[disabled], button[disabled] { opacity: 0.55; cursor: not-allowed; }
.link-button { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: inline; }

/* Forms */
form.stack { display: grid; gap: 16px; max-width: 520px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #8A96A0; border-radius: var(--radius); background: var(--surface); color: var(--navy); font: 400 16px var(--font-text); }
input[type=radio], input[type=checkbox], progress { accent-color: var(--navy); }
input[aria-invalid=true] { border-color: var(--mahogany); border-width: 2px; }
.field-error { color: var(--mahogany); font-size: 14px; font-weight: 600; margin: 4px 0 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { width: 20px; height: 20px; margin-top: 2px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 20px; background: var(--surface); }
legend { font: 600 17px var(--font-display); padding: 0 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* Banners */
.banner { padding: 12px 16px; border-radius: var(--radius); margin: 0 0 20px; border-left: 6px solid var(--navy); background: var(--beige); }
.banner-error { border-left-color: var(--mahogany); color: var(--mahogany); font-weight: 600; }
.banner-ok { border-left-color: var(--ok); }
.banner a { color: inherit; }

/* Public pages */
.public-header { padding: 20px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font: 600 20px var(--font-display); }
.brand img { border-radius: 8px; }
.public-card { width: min(480px, calc(100% - 32px)); margin: 24px auto 48px; background: var(--surface); padding: 32px; border-radius: 12px; box-shadow: 0 1px 3px rgba(28,44,55,0.12); }
.public-wide { width: min(960px, calc(100% - 32px)); margin: 24px auto 48px; }
.panel { background: var(--beige); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 20px; }
.panel ul { margin: 8px 0 0; padding-left: 20px; }
.result-icon { font: 600 40px var(--font-display); line-height: 1; margin-bottom: 12px; }

/* App layout: sidebar on desktop (>= 1024 px), top menu below that */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--navy); color: var(--white); }
.topbar .brand { color: var(--white); font-size: 18px; }
.tag { font: 600 12px var(--font-text); text-transform: uppercase; letter-spacing: 0.06em; background: var(--white); color: var(--navy); border-radius: 4px; padding: 2px 6px; }
.account { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.account form { margin: 0; }
.account .link-button { color: var(--white); }
.menu-toggle { display: none; margin-left: auto; background: none; color: var(--white); border: 2px solid var(--white); border-radius: var(--radius); min-height: 40px; padding: 4px 12px; font: 600 15px var(--font-text); }
.layout { display: flex; flex: 1 0 auto; width: 100%; max-width: 1480px; margin: 0 auto; }
.sidebar { width: 230px; flex-shrink: 0; padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar a { text-decoration: none; padding: 10px 14px; border-radius: var(--radius); font-weight: 500; border-left: 4px solid transparent; }
.sidebar a:hover { background: var(--beige); color: var(--navy); }
.sidebar a[aria-current=page] { background: var(--surface); border-left-color: var(--orange); font-weight: 600; }
.content { flex: 1; min-width: 0; max-width: 1200px; padding: 28px 24px 48px; }

/* Cards and tables */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--surface); border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); }
.stat-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat-value { font: 600 30px var(--font-display); margin-top: 4px; font-variant-numeric: tabular-nums; }
/* "New today" carries an orange bar, not orange text (2.95:1 would fail). */
.stat-accent { border-top: 5px solid var(--orange); }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #E1E6EA; vertical-align: top; }
th { font-weight: 600; background: #E9EDF0; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--font-mono); }
tr.row-error td { background: #F6E9E4; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.status::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-ok::before { background: var(--ok); }
.status-error { color: var(--mahogany); }
.status-error::before { background: var(--mahogany); }
.status-warn::before { background: var(--orange); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.toolbar input, .toolbar select { width: auto; min-width: 200px; }
.pagination { display: flex; gap: 12px; align-items: center; }
.truncate { max-width: 320px; }
details summary { cursor: pointer; }
.key-box { display: flex; gap: 8px; align-items: stretch; margin: 12px 0; }
.key-box input { font-family: var(--font-mono); font-size: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

/* Dialogs */
dialog { border: 0; border-radius: 12px; padding: 24px; max-width: min(520px, calc(100% - 32px)); color: var(--navy); box-shadow: 0 10px 40px rgba(28,44,55,0.3); }
dialog::backdrop { background: rgba(28,44,55,0.55); }
dialog h2 { margin-top: 0; }

/* API docs */
.endpoint { background: var(--surface); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); }
.method { font: 600 14px var(--font-mono); background: var(--navy); color: var(--white); padding: 2px 8px; border-radius: 4px; margin-right: 8px; }

@media (max-width: 1023px) {
  .layout { flex-direction: column; }
  .menu-toggle { display: inline-flex; }
  .account { margin-left: 0; }
  .topbar { flex-wrap: wrap; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .sidebar.collapsed { display: none; }
  .content { padding: 20px 16px 40px; }
}
@media (max-width: 480px) {
  .public-card { padding: 22px 18px; }
  h1 { font-size: 24px; }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
  .account .mono { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- SynthFlux additions ---- */
body { padding-bottom: 56px; }
a { color: var(--accent-strong); }
a:hover { color: var(--mahogany); }
.topbar a, .sidebar a, .brand { color: inherit; }
.account a { color: var(--white); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { display: block; font-weight: 600; margin-bottom: 4px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

/* Floating footer on every page (footer rule 2026-12-02) */
.site-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; text-align: center; padding: 10px 16px; font-size: 13px; background: rgba(28, 44, 55, 0.94); color: var(--white); }
.site-footer a.footer-company { color: #FFB38A; text-decoration: underline; }
.site-footer a.footer-letter { color: inherit; text-decoration: none; cursor: text; }

/* Toasts */
.toast { position: fixed; right: 20px; bottom: 64px; z-index: 50; max-width: 420px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 24px rgba(28,44,55,0.25); border-left: 6px solid var(--navy); }
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--mahogany); color: var(--mahogany); font-weight: 600; }
.banner-info { border-left-color: var(--navy); }

/* Status badges: always a word, never colour alone */
.status-active::before { background: var(--ok); }
.status-disabled::before { background: var(--muted); }
.status-expired { color: var(--mahogany); }
.status-expired::before { background: var(--mahogany); }

/* Stat tiles with targets */
.stat-target { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat-missed { border-top: 5px solid var(--mahogany); }
.missed { color: var(--mahogany); }

/* Charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 24px; }
.chart { margin: 0; background: var(--surface); border-radius: 16px; padding: 16px; box-shadow: 0 1px 3px rgba(28,44,55,0.10); }
.chart figcaption { font: 600 15px var(--font-display); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font: 15px var(--font-text); fill: var(--muted); }
.chart .axis { stroke: #D5DADF; }
.chart .line-a { stroke: var(--navy); }
.chart .line-b { stroke: var(--accent-strong); stroke-dasharray: 6 4; }
.chart .bar-a { fill: var(--navy); }
.chart .bar-b { fill: var(--accent-strong); }
.legend { font: 400 13px var(--font-text); display: inline-flex; gap: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 4px; display: inline-block; background: var(--navy); }
.legend-swatch.line-b, .legend-swatch.bar-b { background: var(--accent-strong); }

/* Key list */
.key-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.key-value { background: var(--white); padding: 4px 8px; max-width: 360px; overflow-wrap: anywhere; }
progress { display: block; width: 100px; height: 6px; margin-top: 4px; accent-color: var(--navy); }
.row-menu { position: relative; }
.row-menu summary { list-style: none; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 14px; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu .menu { position: absolute; right: 0; z-index: 20; min-width: 180px; display: grid; gap: 2px; padding: 8px; background: var(--surface); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(28,44,55,0.2); }
.row-menu .menu a, .row-menu .menu button { padding: 8px 10px; text-align: left; text-decoration: none; color: var(--navy); }
.row-menu .menu a:hover, .row-menu .menu button:hover { background: var(--white); }
.danger-text { color: var(--mahogany) !important; }
.key-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 16px; }
.chip[aria-current=page] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.created { max-width: 640px; }
.wide-form { max-width: 880px; }
.password-row { display: flex; gap: 8px; }

/* Login */
.login-brand { text-align: center; margin-bottom: 16px; }
.login-brand .product { font: 600 24px var(--font-display); margin: 8px 0 0; }

/* System and docs */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 12px; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; font-family: var(--font-mono); }
.docs-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.docs-head h1 { margin: 0; }
.docs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.docs-nav { position: sticky; top: 16px; display: grid; gap: 4px; }
.docs-nav a { padding: 6px 10px; border-radius: var(--radius); text-decoration: none; color: var(--navy); }
.docs-nav a:hover { background: var(--beige); }
.docs-main { min-width: 0; }
.docs-main section { margin-bottom: 32px; }
.docs-main pre { white-space: pre-wrap; word-break: break-all; }
.callout { background: var(--beige); color: var(--mahogany); border-radius: 16px; padding: 16px 20px; }
.callout .facts dd { color: var(--mahogany); }
.public-wide { width: min(1200px, calc(100% - 32px)); }
h4 { font: 600 15px var(--font-display); margin: 16px 0 8px; }

@media (max-width: 1023px) { .docs-layout { grid-template-columns: 1fr; } .docs-nav { position: static; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
/* 0.2.0 Metrics and Backups: keep file names, times and sizes on one line; the table scrolls on narrow screens */
.nowrap { white-space: nowrap; }
td.detail { min-width: 280px; }
