/* ————— Stock&Fable design system —————
   Black + oklch(0.66 0.20 38) coral. Soft, rounded, gentle. */

:root {
  --bg: #0d0c0b;
  --surface: #171514;
  --surface-2: #1f1c1a;
  --surface-3: #282422;
  --border: #2b2725;
  --border-soft: #221f1d;
  --text: #f4efe9;
  --text-dim: #b5aca3;
  --muted: #7d756d;
  --accent: oklch(0.66 0.2 38);
  --accent-bright: oklch(0.72 0.2 38);
  --accent-dim: oklch(0.55 0.17 38);
  --accent-soft: oklch(0.66 0.2 38 / 0.14);
  --accent-softer: oklch(0.66 0.2 38 / 0.08);
  --green: oklch(0.72 0.15 155);
  --green-soft: oklch(0.72 0.15 155 / 0.14);
  --amber: oklch(0.78 0.14 85);
  --amber-soft: oklch(0.78 0.14 85 / 0.14);
  --blue: oklch(0.72 0.12 250);
  --blue-soft: oklch(0.72 0.12 250 / 0.14);
  --red: oklch(0.64 0.19 25);
  --red-soft: oklch(0.64 0.19 25 / 0.12);
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --r-pill: 999px;
  --shadow: 0 8px 30px rgb(0 0 0 / 0.35);
  --shadow-soft: 0 2px 12px rgb(0 0 0 / 0.25);
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@supports not (color: oklch(0.5 0.1 30)) {
  :root {
    --accent: #ec6a3f; --accent-bright: #f47d51; --accent-dim: #c4552f;
    --accent-soft: rgba(236, 106, 63, 0.14); --accent-softer: rgba(236, 106, 63, 0.08);
  }
}

html[data-theme="light"] {
  --bg: #f6f2ee;
  --surface: #fffdfb;
  --surface-2: #f3ede8;
  --surface-3: #e9e1da;
  --border: #ded4cb;
  --border-soft: #eae2da;
  --text: #211c18;
  --text-dim: #5c534b;
  --muted: #93887d;
  --accent-bright: oklch(0.6 0.2 38);
  --green: oklch(0.55 0.15 155);
  --amber: oklch(0.6 0.14 85);
  --blue: oklch(0.55 0.12 250);
  --red: oklch(0.55 0.19 25);
  --shadow: 0 8px 30px rgb(60 35 15 / 0.1);
  --shadow-soft: 0 2px 12px rgb(60 35 15 / 0.07);
}
html[data-theme="light"] .login-glow { opacity: 0.55; }
html[data-theme="light"] .modal-back { background: rgb(40 25 12 / 0.35); }

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ————— logo ————— */
.logo { font-weight: 750; letter-spacing: -0.03em; font-size: 19px; user-select: none; white-space: nowrap; }
.logo .amp { color: var(--accent); font-weight: 800; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: grid; place-items: center;
  color: #16100c; font-weight: 800; font-size: 17px; letter-spacing: -0.05em;
}

/* ————— buttons ————— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit; font-size: 14.5px; font-weight: 600;
  border-radius: var(--r-pill); padding: 11px 22px; letter-spacing: -0.01em;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #16100c; }
.btn-primary:hover { background: var(--accent-bright); box-shadow: 0 4px 20px oklch(0.66 0.2 38 / 0.35); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-soft { background: var(--accent-soft); color: var(--accent-bright); }
.btn-soft:hover { background: var(--accent-softer); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 7px 15px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.45; cursor: default; pointer-events: none; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 13px; }

/* ————— inputs ————— */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-dim); letter-spacing: 0.01em; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.input, textarea.input, select.input {
  width: 100%; background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 12px 16px; font-family: inherit; font-size: 14.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
  outline: none;
}
.input:focus { border-color: var(--accent); background: var(--surface); }
.input::placeholder { color: var(--muted); }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237d756d' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }

/* chips (selectable pills) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  border-radius: var(--r-pill); padding: 8px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.13s ease; user-select: none; font-family: inherit;
}
.chip:hover { border-color: var(--accent-dim); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-bright); }

/* toggle */
.toggle { position: relative; width: 46px; height: 27px; flex: none; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .tr {
  position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3);
  transition: background 0.18s ease; border: 1px solid var(--border);
}
.toggle .tr::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--text-dim); transition: all 0.18s ease;
}
.toggle input:checked + .tr { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .tr::after { left: 22px; background: #16100c; }

/* ————— cards & badges ————— */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: 24px;
}
.card-hover { transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease; cursor: pointer; }
.card-hover:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill); padding: 4px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.b-accent { background: var(--accent-soft); color: var(--accent-bright); }
.badge.b-green { background: var(--green-soft); color: var(--green); }
.badge.b-amber { background: var(--amber-soft); color: var(--amber); }
.badge.b-blue { background: var(--blue-soft); color: var(--blue); }
.badge.b-grey { background: var(--surface-3); color: var(--text-dim); }
.badge.b-red { background: var(--red-soft); color: var(--red); }

/* progress */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

/* ————— layout ————— */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: none; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border-soft); position: sticky; top: 0; height: 100vh;
}
.sidebar .logo-row { display: flex; align-items: center; gap: 11px; padding: 6px 10px 22px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-md);
  color: var(--text-dim); font-weight: 600; font-size: 14.5px; cursor: pointer; border: none;
  background: transparent; font-family: inherit; text-align: left; width: 100%;
  transition: background 0.13s ease, color 0.13s ease;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent-bright); }
.nav-item svg { flex: none; }
.nav-spacer { flex: 1; }
.main { flex: 1; min-width: 0; padding: 34px 40px 80px; max-width: 1160px; margin: 0 auto; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.topbar > * { min-width: 0; }
.topbar h1, .topbar p { overflow-wrap: anywhere; }

/* mobile */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border-soft); padding: 12px 14px; }
  .sidebar .logo-row { padding: 0 10px 0 0; }
  .nav-item { width: auto; padding: 9px 14px; }
  .nav-item span.lbl { display: none; }
  .main { padding: 22px 18px 60px; }
}

/* grid helpers */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-2 { margin-bottom: 16px; }

.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-2col { grid-template-columns: 1fr; } }

/* big stat */
.stat-num { font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; }
.stat-num .accent { color: var(--accent); }

/* ————— list rows (Polestar-style) ————— */
.rows { display: flex; flex-direction: column; }
.rows > * { padding: 15px 6px; border-bottom: 1px solid var(--border-soft); }
.rows > *:last-child { border-bottom: none; }
.arrow-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; color: var(--text); }
.arrow-link:hover .arr { transform: translateX(3px); }
.arr { color: var(--accent); transition: transform 0.15s ease; flex: none; }

/* ————— modal ————— */
.modal-back {
  position: fixed; inset: 0; background: rgb(0 0 0 / 0.6); backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  animation: fadeIn 0.18s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 28px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow); animation: popIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } }

/* ————— toast ————— */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-pill); padding: 11px 22px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; gap: 9px; align-items: center;
}
.toast.ok::before { content: "✓"; color: var(--green); font-weight: 800; }
.toast.err::before { content: "!"; color: var(--red); font-weight: 800; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
.toast.bye { opacity: 0; transform: translateY(8px); transition: all 0.3s ease; }

/* ————— wizard ————— */
.wizard { display: grid; grid-template-columns: 220px 1fr; gap: 34px; align-items: start; }
@media (max-width: 900px) { .wizard { grid-template-columns: 1fr; } .wizard-steps { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 6px; } .wstep .desc { display: none; } }
.wizard-steps { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 30px; }
.wstep {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md);
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background 0.13s ease, color 0.13s ease; border: none; background: none; font-family: inherit; text-align: left;
}
.wstep:hover { background: var(--surface); }
.wstep .dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted);
  transition: all 0.15s ease;
}
.wstep.on { color: var(--text); }
.wstep.on .dot { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-soft); }
.wstep.done .dot { background: var(--accent); border-color: var(--accent); color: #16100c; }
.wizard-pane { animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } }

/* ————— tabs ————— */
.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border-soft); padding: 5px; border-radius: var(--r-pill); width: fit-content; max-width: 100%; overflow-x: auto; }
.tab {
  border: none; background: none; font-family: inherit; cursor: pointer;
  padding: 8px 18px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--text-dim);
  transition: all 0.15s ease; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { background: var(--accent); color: #16100c; }
.tab .cnt { font-size: 11.5px; opacity: 0.75; margin-left: 5px; font-weight: 700; }

/* ————— task board ————— */
.task-row {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  transition: border-color 0.15s ease;
}
.task-row:hover { border-color: var(--border); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st-todo { background: var(--muted); } .st-in_progress { background: var(--blue); }
.st-review { background: var(--amber); } .st-done { background: var(--green); }

/* ————— feed ————— */
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-card {
  display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: 16px 18px;
}
.feed-card.from-admin { border-left: 3px solid var(--accent); }
.feed-sys {
  display: flex; align-items: center; gap: 10px; padding: 7px 18px;
  color: var(--muted); font-size: 13px;
}
.feed-sys::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex: none; }
.feed-item { display: flex; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--border-soft); }
.feed-item:last-child { border-bottom: none; }

/* ————— checklist ————— */
.cl-item { display: flex; align-items: center; gap: 11px; padding: 8px 4px; border-radius: var(--r-sm); font-size: 14px; }
.cl-item:hover { background: var(--surface-2); }
.cl-item.done span { color: var(--muted); text-decoration: line-through; }
.cl-tick {
  width: 23px; height: 23px; border-radius: 8px; flex: none; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface-2); color: transparent;
  font-size: 13px; font-weight: 800; display: grid; place-items: center; font-family: inherit;
  transition: all 0.13s ease;
}
.cl-tick:hover { border-color: var(--accent); }
.cl-item.done .cl-tick { background: var(--accent); border-color: var(--accent); color: #16100c; }
.cl-del { border: none; background: none; color: var(--muted); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; flex: none; }
.cl-del:hover { background: var(--red-soft); color: var(--red); }

/* ————— due dates & action comments ————— */
.due-overdue { color: var(--red); font-weight: 650; }
.due-soon { color: var(--amber); font-weight: 650; }
.feed-card.needs-action { border-color: var(--amber); background: var(--amber-soft); }

/* ————— task detail / review ————— */
.review-banner {
  border: 1.5px solid var(--amber); background: var(--amber-soft);
  border-radius: var(--r-md); padding: 20px;
}
.task-row.clickable { cursor: pointer; }
.task-row.clickable:hover { border-color: var(--accent-dim); transform: translateY(-1px); }
.task-row { transition: border-color 0.15s ease, transform 0.15s ease; }
.avatar {
  width: 38px; height: 38px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font-weight: 750; font-size: 14px;
}
.avatar.a-admin { background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: #16100c; }
.avatar.a-client { background: var(--surface-3); color: var(--text-dim); }

/* ————— access platform card ————— */
.plat { border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--surface); overflow: hidden; transition: border-color 0.15s ease; }
.plat.open { border-color: var(--border); }
.plat-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; user-select: none; flex-wrap: wrap; }
.plat-head > div:nth-child(2) { flex-basis: 180px; }
.plat-icon {
  width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-soft); font-size: 17px;
}
.plat-body { padding: 4px 18px 20px 72px; animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
@media (max-width: 640px) { .plat-body { padding-left: 18px; } }
.steps-list { margin: 10px 0 0; padding-left: 20px; color: var(--text-dim); font-size: 14px; display: flex; flex-direction: column; gap: 7px; }
.steps-list b, .steps-list code { color: var(--text); }
code.k {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 2px 8px; font-size: 13px; font-family: Consolas, monospace; color: var(--accent-bright);
}

/* ————— upload slots ————— */
.slot { border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: 18px; transition: all 0.15s ease; background: var(--surface); }
.slot.drag { border-color: var(--accent); background: var(--accent-softer); }
.file-pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--r-pill); padding: 6px 8px 6px 14px; font-size: 13px;
  max-width: 100%;
}
.file-pill .x { cursor: pointer; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.file-pill .x:hover { background: var(--red-soft); color: var(--red); }
.file-pill .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-glow {
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, oklch(0.66 0.2 38 / 0.13), transparent 65%);
  top: -260px; right: -160px; pointer-events: none;
}
.login-card { width: 100%; max-width: 400px; padding: 38px 34px; position: relative; }

.divider { height: 1px; background: var(--border-soft); margin: 20px 0; border: none; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .big { font-size: 38px; margin-bottom: 10px; }

.copy-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 16px; font-family: Consolas, monospace; font-size: 14px;
}
