/* TEAM HQ — Crave & Create · design tokens and components (approved Design Preview v1) */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url(../fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url(../fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url(../fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #0E0F13; --panel: #121419; --card: #16181E; --card-2: #1B1E26; --hover: #1C1F27; --line: #262A33; --line-soft: #1F222B;
  --text: #E8EAF0; --text-2: #C9CDD6; --muted: #9AA0AE; --faint: #8A90A0;
  --accent: #FF7A45; --accent-text: #FF8A5B; --on-accent: #1A0E08; --accent-soft: rgba(255,122,69,.14);
  --ok: #4ADE80; --ok-soft: rgba(74,222,128,.14); --warn: #FBBF24; --warn-soft: rgba(251,191,36,.14);
  --bad: #F87171; --bad-soft: rgba(248,113,113,.14); --info: #60A5FA; --info-soft: rgba(96,165,250,.14);
  --track: #232631; --radius: 14px; --radius-s: 10px;
  --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F4F5F8; --panel: #FFFFFF; --card: #FFFFFF; --card-2: #F7F8FA; --hover: #EEF0F4; --line: #DDE1E8; --line-soft: #E8EBF0;
  --text: #15171C; --text-2: #33373F; --muted: #5B6170; --faint: #6B7180;
  --accent: #E85F28; --accent-text: #B8461A; --on-accent: #FFFFFF; --accent-soft: rgba(232,95,40,.10);
  --ok: #15803D; --ok-soft: rgba(21,128,61,.10); --warn: #A16207; --warn-soft: rgba(161,98,7,.10);
  --bad: #B91C1C; --bad-soft: rgba(185,28,28,.08); --info: #1D4ED8; --info-soft: rgba(29,78,216,.08); --track: #E3E6EC;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .info { color: var(--info); } .accent { color: var(--accent-text); }
.mono { font-variant-numeric: tabular-nums; }
.lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.big { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.15; }

/* ── Layout ── */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 0 0 232px; padding: 18px 12px; border-right: 1px solid var(--line-soft); background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font: 700 12.5px var(--display); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-name { font: 700 14px var(--display); letter-spacing: .04em; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; }
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--line-soft); color: var(--text); font-weight: 600; }
.nav .sep { height: 1px; background: var(--line-soft); margin: 8px 4px; }
.nav .foot { margin-top: auto; padding: 12px 8px 0; font-size: 12px; color: var(--muted); }
.count { background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 11px; border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center; }
.count.soft { background: var(--accent-soft); color: var(--accent-text); }
.main { flex: 999 1 560px; min-width: 0; padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 16px; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.topbar .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.row > .grow { flex: 999 1 520px; min-width: 0; } .row > .side { flex: 1 1 340px; min-width: 0; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; } .stack-s { display: flex; flex-direction: column; gap: 6px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 980px) { .g4, .g5, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: minmax(0, 1fr); } .span2, .span3 { grid-column: auto; } }
@media (max-width: 720px) { .nav { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line-soft); } .nav .foot, .nav .sep { display: none; } .main { padding: 16px; } .g2 { grid-template-columns: minmax(0, 1fr); } }

/* ── Cards & bits ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.tight { padding: 14px; } .card.flush { padding: 6px 8px; }
.card > h2 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); } .chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.bar { height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 6px; background: var(--accent); border-radius: 999px; width: 0; transition: width .2s ease; }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.list > .item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline { border-left: 2px solid var(--line); padding-left: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.empty { color: var(--muted); font-size: 13px; padding: 14px 4px; }
.notice { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); border-radius: var(--radius-s); padding: 10px 12px; font-size: 13px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.kpi .big { margin-top: 2px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--hover); }
tr.sel td { background: var(--card-2); }
td.r, th.r { text-align: right; }

/* ── Forms ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.good { background: var(--ok); border-color: var(--ok); color: #062010; font-weight: 700; }
.btn.warn { border-color: var(--warn); color: var(--warn); background: transparent; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn.ghost { background: transparent; }
.btn.small { height: 32px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { height: 38px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 11px; font-size: 13.5px; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 9px; cursor: pointer; }
.check:hover { background: var(--hover); }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
.check.done .t { color: var(--faint); text-decoration: line-through; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg button, .seg a { height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; font-size: 13px; }
.seg .on { background: var(--line-soft); color: var(--text); font-weight: 600; }

/* ── Stage stepper ── */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.stepper li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.stepper li.past { background: var(--card-2); border-color: transparent; }
.stepper li.now { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }

/* ── Kanban ── */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.kcard:hover { border-color: var(--accent); text-decoration: none; }

/* ── Modal & toast ── */
.modal-back { position: fixed; inset: 0; background: rgba(5,6,9,.62); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(640px, 100%); display: flex; flex-direction: column; gap: 14px; }
.modal.wide { width: min(860px, 100%); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 13px; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.bad { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--ok); }
.syncpill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ── Charts (CSS bars) ── */
.bars { height: 160px; display: flex; gap: 10px; align-items: stretch; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 48px; background: var(--track); border-radius: 6px 6px 0 0; height: 0; transition: height .2s; }
.bars .b.hi i { background: var(--accent); } .bars .b.hi span:first-child { color: var(--text); font-weight: 600; }

/* ── Login ── */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Links that wrap whole blocks keep the text colour */
a.card, a.item, a.between, a.kcard, a.row-s, .w-sec a.small { color: inherit; }
a.card:hover, a.item:hover, a.between:hover, a.row-s:hover { text-decoration: none; }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
a.item:hover { background: var(--hover); }
.wrap > .input, .wrap > select.input { width: auto; flex: 0 1 200px; }
.wrap > input.input:first-of-type { flex: 1 1 260px; }
.stack > .seg, .stack > .wrap { align-self: stretch; }
.stack > .seg { align-self: flex-start; }
