/* ODYSSEUSS design system — "Aegean".
   Night-sea navy surfaces, Corinthian bronze-gold as the single accent, marble light mode.
   Display type is Cormorant Garamond (classical, restrained); UI type is Inter.
   A Greek key (meander) runs as a thin rule under the brand — the only ornament. */
:root {
  --bg: #090e1a; --surface: #0f172a; --surface-2: #142038; --surface-3: #1a2a48; --surface-4: #21355a;
  --line: #1f2d4a; --line-strong: #2d4068;
  --text: #eef1f7; --text-2: #b4bdd0; --text-3: #7f8aa3;
  --gold: #d4a94a; --gold-2: #e9c46a; --gold-3: #9d7628; --gold-soft: rgba(212,169,74,.13); --gold-line: rgba(212,169,74,.35);
  --aegean: #3b7dd8; --aegean-soft: rgba(59,125,216,.14);
  --terracotta: #c9633d; --olive: #8aa36b;
  --ok: #3fae78; --warn: #d6883a; --danger: #d64c4c; --info: #5b8def;
  --radius: 12px; --radius-sm: 8px; --gutter: 16px;
  --shadow: 0 14px 40px rgba(2,6,16,.55), 0 1px 0 rgba(255,255,255,.03) inset;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cormorant Garamond', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --meander: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'><path d='M0 .75H20M0 11.25H20M3 9V2.5H16V9H9V5.5H12.5' fill='none' stroke='%23d4a94a' stroke-opacity='.45' stroke-width='1.25'/></svg>");
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f1ea; --surface: #fffdf8; --surface-2: #f7f3ea; --surface-3: #efe9dc; --surface-4: #e6dfcf;
  --line: #e3dccc; --line-strong: #cfc5ad;
  --text: #171d2b; --text-2: #414a5e; --text-3: #6d7688;
  --gold: #a8802a; --gold-2: #c1962f; --gold-3: #7d5e1c; --gold-soft: rgba(168,128,42,.12); --gold-line: rgba(168,128,42,.45);
  --shadow: 0 14px 40px rgba(23,29,43,.10);
  --meander: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'><path d='M0 .75H20M0 11.25H20M3 9V2.5H16V9H9V5.5H12.5' fill='none' stroke='%23a8802a' stroke-opacity='.55' stroke-width='1.25'/></svg>");
  color-scheme: light;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { background-image: radial-gradient(1200px 600px at 10% -10%, rgba(59,125,216,.10), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(212,169,74,.07), transparent 55%); background-attachment: fixed; }
:root[data-theme="light"] body { background-image: radial-gradient(1200px 600px at 10% -10%, rgba(59,125,216,.07), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(168,128,42,.08), transparent 55%); }
a { color: var(--gold-2); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; }
h2 { font-size: 28px; line-height: 1.15; } h3 { font-size: 21px; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(160deg, var(--surface-3), var(--surface)); border: 1px solid var(--gold-line); display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset; }
.brand-mark img, .brand-mark svg { width: 26px; height: 26px; display: block; }
.brand h1 { font-family: var(--display); font-size: 20px; letter-spacing: .22em; margin: 0; font-weight: 700; line-height: 1; color: var(--text); }
.brand small { display: block; color: var(--gold); letter-spacing: .14em; font-size: 10px; text-transform: uppercase; margin-top: 3px; font-weight: 600; }
.meander { height: 12px; background: var(--meander) repeat-x left center; }

/* ---- auth screen ---- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--gutter); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 30px 30px 26px; box-shadow: var(--shadow); position: relative; }
.auth-card::before { content: ""; position: absolute; left: 30px; right: 30px; top: 84px; height: 12px; background: var(--meander) repeat-x left center; }
.auth-card .brand { margin-bottom: 30px; }
.auth-card .tagline { font-family: var(--display); font-style: italic; color: var(--text-2); font-size: 17px; margin: 0 0 14px; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.input { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; min-height: 44px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-3); cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--gold-line); background: var(--surface-4); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #1a1406; border-color: var(--gold-3); text-shadow: 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { background: linear-gradient(180deg, #f0cf78, var(--gold-2)); border-color: var(--gold-3); }
.btn-block { width: 100%; }
.apps { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1.2em; }
.muted { color: var(--text-3); font-size: 13px; }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.nav { background: linear-gradient(180deg, var(--surface), var(--bg)); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100dvh; }
.nav .brand { padding: 4px 6px 0; margin: 0 0 6px; }
.nav .meander { margin: 0 6px 12px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); min-height: 38px; border: 1px solid transparent; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a[aria-current="page"] { background: var(--gold-soft); color: var(--gold-2); font-weight: 600; border-color: var(--gold-line); }
.nav a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; }
.nav a[aria-current="page"]::before { opacity: 1; }
.nav .spacer { flex: 1; }
.nav .user { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.main { padding: 26px clamp(16px, 3vw, 36px) 40px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h2 { margin: 0; }
.search { flex: 1; min-width: 200px; max-width: 520px; }
.quick-add { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 190px; padding: 6px; display: none; z-index: 20; }
.menu[data-open="1"] { display: block; }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; background: none; border: 0; border-radius: 6px; cursor: pointer; min-height: 40px; }
.menu button:hover { background: var(--surface-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold), transparent 70%); opacity: .7; }
.card .k { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.card .v { font-family: var(--display); font-size: 34px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.card .s { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--text-2); background: var(--surface); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); border: 1px solid var(--line); letter-spacing: .01em; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); font-weight: 600; }
table.list tbody tr { cursor: pointer; } table.list tr:hover td { background: var(--surface-2); }
.status-strip { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); } .dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: auto 0 0 0; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-top: 1px solid var(--line); z-index: 30; background: var(--surface); }
  .nav .brand, .nav .meander, .nav .spacer, .nav .user { display: none; }
  .nav a { flex: 0 0 auto; padding: 10px 12px; }
  .main { padding-bottom: 84px; }
  h2 { font-size: 24px; }
}
