/* Dispatch Desk — warm, natural look: cream background, deep herbal green. */
:root {
  --bg: #f6f3ea;
  --surface: #ffffff;
  --surface-2: #fbfaf5;
  --text: #1d2621;
  --muted: #6b746e;
  --border: #e8e3d5;
  --border-strong: #d6d0bf;
  --brand: #1f5c44;
  --brand-hover: #174a36;
  --brand-soft: #e3efe7;
  --brand-text: #1a5039;
  --on-brand: #ffffff;
  --urgent: #c8432b;
  --urgent-soft: #fbe8e3;
  --part: #a9690f;
  --part-soft: #fbefd8;
  --done: #1f7a4d;
  --done-soft: #e1f2e8;
  --wait: #4d5b7a;
  --wait-soft: #e9edf5;
  --shadow: 0 1px 2px rgba(31, 44, 36, .05), 0 6px 20px rgba(31, 44, 36, .06);
  --shadow-lift: 0 2px 4px rgba(31, 44, 36, .06), 0 12px 28px rgba(31, 44, 36, .10);
  --radius: 16px;
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411;
    --surface: #181e1a;
    --surface-2: #1d241f;
    --text: #e9eee9;
    --muted: #9aa69e;
    --border: #28312b;
    --border-strong: #3a453d;
    --brand: #5cbf8f;
    --brand-hover: #74cfa2;
    --brand-soft: #1b2e24;
    --brand-text: #8fdab3;
    --on-brand: #0c1a13;
    --urgent: #f18b73;
    --urgent-soft: #3a1f1a;
    --part: #e7b45c;
    --part-soft: #362a15;
    --done: #6fcf9b;
    --done-soft: #17301f;
    --wait: #a9b8d8;
    --wait-soft: #232a3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lift: 0 4px 18px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); }
h1 { font-size: 24px; margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.loading { padding: 64px 16px; text-align: center; color: var(--muted); }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 67, 43, .45); } 70% { box-shadow: 0 0 0 7px rgba(200, 67, 43, 0); } }
.view { animation: rise .35s var(--ease) both; }
.cards > * { animation: rise .4s var(--ease) both; }
.cards > *:nth-child(2) { animation-delay: .03s; }
.cards > *:nth-child(3) { animation-delay: .06s; }
.cards > *:nth-child(4) { animation-delay: .09s; }
.cards > *:nth-child(5) { animation-delay: .12s; }
.cards > *:nth-child(n+6) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.main { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }

.nav {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; justify-content: space-around; height: var(--nav-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lift); padding: 6px;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 16px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 15px; transition: background .25s var(--ease); }
.nav a.on { color: var(--brand-text); }
.nav a.on .nav-icon { background: var(--brand-soft); }
.nav .ti { font-size: 22px; }
.dot {
  position: absolute; top: -3px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--urgent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface);
}
.nav-brand { display: none; }

@media (min-width: 900px) {
  .nav {
    top: 0; left: 0; right: auto; bottom: 0; width: 240px; height: auto; border-radius: 0;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 22px 14px;
    background: var(--brand); border: 0; box-shadow: none; backdrop-filter: none;
  }
  .nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; padding: 0 8px 26px; color: #fff; }
  .nav a { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 10px 10px; color: rgba(255, 255, 255, .75); }
  .nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .nav a.on { background: rgba(255, 255, 255, .16); color: #fff; }
  .nav a.on .nav-icon { background: transparent; }
  .nav-icon { width: 24px; height: 24px; }
  .nav .ti { font-size: 20px; }
  .dot { border-color: var(--brand); right: -8px; }
  .main { margin-left: 240px; margin-right: auto; padding: 28px 40px 120px; max-width: 1020px; }
  .actions.sticky { left: 240px; }
}
@media (min-width: 900px) and (prefers-color-scheme: dark) {
  .nav { background: #13251c; }
  .nav-brand { color: var(--text); }
}

.logo {
  width: 64px; height: 64px; border-radius: 20px; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 34px;
}
.logo-sm { width: 34px; height: 34px; border-radius: 11px; font-size: 19px; background: rgba(255, 255, 255, .16); }

/* ---------- Hero and tiles ---------- */
.hero { margin: 6px 0 18px; }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-hello { color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tile {
  --tone: var(--text); --tone-soft: var(--surface-2);
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); animation: pop .4s var(--ease) both;
}
.tile-urgent { --tone: var(--urgent); --tone-soft: var(--urgent-soft); }
.tile-part { --tone: var(--part); --tone-soft: var(--part-soft); }
.tile-brand { --tone: var(--brand-text); --tone-soft: var(--brand-soft); }
.tile-icon {
  width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--tone-soft); color: var(--tone); font-size: 19px; margin-bottom: 8px;
}
.tile:not([class*="tile-"]) .tile-icon, .tile.tile-btn:not(.tile-urgent) .tile-icon { background: var(--brand-soft); color: var(--brand-text); }
.tile-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--tone); }
.tile:not(.tile-urgent):not(.tile-part):not(.tile-brand) .tile-value { color: var(--text); }
.tile-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tile-btn { cursor: pointer; font: inherit; transition: transform .15s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.tile-btn:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.tile-btn:active { transform: scale(.98); }
.tile-active { border-color: var(--tone); background: var(--tone-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 18px; border-radius: 13px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  font-weight: 600; white-space: nowrap;
  transition: transform .12s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--urgent); }
.btn-danger:hover { border-color: var(--urgent); background: var(--urgent-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-text); padding: 0 10px; box-shadow: none; }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; }
.btn-sm { min-height: 34px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn .ti { font-size: 18px; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--muted);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; }
.icon-btn .ti { font-size: 21px; }
.link { background: none; border: 0; padding: 0; color: var(--brand-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.actions.sticky {
  position: fixed; left: 0; right: 0; z-index: 10; margin: 0;
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  padding: 10px 16px; justify-content: center;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (min-width: 900px) { .actions.sticky { bottom: 0; padding: 14px 40px; } }
.actions.sticky .btn { flex: 1; max-width: 280px; }

/* ---------- Top bar / back ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; flex-wrap: wrap; }
.topbar-title { flex: 1; min-width: 160px; }
.topbar .icon-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.backrow { margin: 0 0 10px -6px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; cursor: pointer;
  color: var(--brand-text); font-weight: 600; padding: 6px 8px; border-radius: 10px;
}
.back-btn:hover { background: var(--brand-soft); }
.back-btn .ti { font-size: 20px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
.segmented button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 600;
  transition: background .25s var(--ease), color .25s;
}
.segmented button.on { background: var(--brand); color: var(--on-brand); }
.count { font-size: 12px; opacity: .85; margin-left: 2px; }
.search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.search .ti { color: var(--muted); font-size: 18px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 44px; }

/* ---------- Cards ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px; color: inherit; box-shadow: var(--shadow);
}
.cards .card { margin-bottom: 0; }
.card-link { text-decoration: none; transition: transform .18s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.card-link:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); border-color: var(--border-strong); }
.card-link:active { transform: scale(.99); }
.row-card { display: flex; gap: 14px; align-items: flex-start; }
.chev { color: var(--border-strong); align-self: center; font-size: 20px; transition: transform .2s var(--ease), color .2s; }
.card-link:hover .chev { color: var(--muted); transform: translateX(2px); }
.card-urgent { border-color: color-mix(in srgb, var(--urgent) 45%, var(--border)); background: linear-gradient(to right, var(--urgent-soft), var(--surface) 40%); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 2px; }
.card-title { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.section-title { font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.note { margin-top: 8px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.note .ti { margin-top: 2px; }
.note-card { display: flex; gap: 10px; align-items: flex-start; background: var(--part-soft); border-color: transparent; color: var(--part); box-shadow: none; font-weight: 500; }
.note-card .ti { margin-top: 2px; font-size: 18px; }
.meta { margin: 6px 4px; }
.done-line, .done-text { color: var(--done); display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 600; }
.done-text { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.chip-more { color: var(--muted); }

.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.badges-left { justify-content: flex-start; margin-top: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--border);
}
.badge-urgent { background: var(--urgent); color: #fff; border-color: transparent; animation: pulse 2s infinite; }
.badge-done { background: var(--done-soft); color: var(--done); border-color: transparent; }
.badge-part { background: var(--part-soft); color: var(--part); border-color: transparent; }
.badge-wait { background: var(--wait-soft); color: var(--wait); border-color: transparent; }

.bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .8s var(--ease); }
.progress-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.progress-row .bar { flex: 1; }

/* ---------- Avatars ---------- */
.avatar {
  --a: #1f5c44; --a-soft: #e3efe7;
  width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--a-soft); color: var(--a);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
.avatar-lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }
.av-0 { --a: #1f5c44; --a-soft: #dcefe3; }
.av-1 { --a: #9a4a12; --a-soft: #fbe6d4; }
.av-2 { --a: #2c5a8a; --a-soft: #dfeaf6; }
.av-3 { --a: #7a3d7a; --a-soft: #f3e2f3; }
.av-4 { --a: #6b6410; --a-soft: #f2efcf; }
.av-5 { --a: #a1323d; --a-soft: #f8dfe2; }
.av-6 { --a: #0f6b6b; --a-soft: #d7efee; }
.av-7 { --a: #5a4a8f; --a-soft: #e6e2f6; }
@media (prefers-color-scheme: dark) {
  .av-0 { --a: #8fdab3; --a-soft: #1b3226; }
  .av-1 { --a: #f2b383; --a-soft: #3a2616; }
  .av-2 { --a: #9cc3ee; --a-soft: #1b2a3b; }
  .av-3 { --a: #e0a8e0; --a-soft: #33203a; }
  .av-4 { --a: #e3d877; --a-soft: #33301a; }
  .av-5 { --a: #f2a1aa; --a-soft: #3b1e22; }
  .av-6 { --a: #84d6d4; --a-soft: #15302f; }
  .av-7 { --a: #b9adf0; --a-soft: #262141; }
}

/* ---------- Detail ---------- */
.detail-hero { display: flex; gap: 16px; align-items: center; padding: 20px; }
.detail-hero h1 { font-size: 21px; }
.hero-kg { margin-top: 8px; }
.ring { position: relative; width: 72px; height: 72px; flex: none; }
.ring svg { display: block; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ring-value { fill: none; stroke: var(--brand); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring-done .ring-value { stroke: var(--done); }
.ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.ring-done span { color: var(--done); font-size: 26px; }
.status-orb {
  width: 64px; height: 64px; flex: none; border-radius: 50%; background: var(--wait-soft); color: var(--wait);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.orb-done { background: var(--done-soft); color: var(--done); }

.items { display: flex; flex-direction: column; gap: 16px; }
.item-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.item-name { font-weight: 600; }
.item .muted { margin-top: 4px; }

.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.tl-row { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 16px; }
.tl-row:last-child { padding-bottom: 0; }
.tl-row:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--border); }
.tl-icon { width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--done-soft); color: var(--done); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.tl-body { flex: 1; min-width: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; font-weight: 500; }
.kv dd { margin: 0; white-space: pre-wrap; font-weight: 500; }

.history { padding: 4px 0; }
.history-row { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: 0; }

.person { display: flex; align-items: center; gap: 12px; }
.person select {
  min-height: 40px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); padding: 0 10px; font-weight: 600;
}

.empty { text-align: center; padding: 56px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon {
  width: 72px; height: 72px; border-radius: 24px; background: var(--brand-soft); color: var(--brand-text);
  display: flex; align-items: center; justify-content: center; font-size: 34px; margin-bottom: 8px;
}
.empty-title { font-weight: 700; color: var(--text); font-size: 16px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 700; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 13px; color: var(--urgent); font-weight: 600; }
.form input:not([type="checkbox"]), .form textarea, .auth input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 16px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus, .auth input:focus, select:focus {
  outline: 0; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.check {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); transition: border-color .2s, background .2s;
}
.check:has(input:checked) { border-color: var(--urgent); background: var(--urgent-soft); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--urgent); }
.item-row, .dispatch-row { display: flex; gap: 8px; align-items: center; }
.dispatch-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.item-row .qty, .dispatch-row .qty { width: 92px !important; flex: none; }
.item-row .rate { width: 100px !important; flex: none; }
@media (max-width: 480px) {
  .item-row { flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .item-row .grow { flex-basis: calc(100% - 48px); }
  .item-row .qty, .item-row .rate { flex: 1; width: auto !important; }
}

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand {
  background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -140px; bottom: -160px; border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.auth-brand .logo { background: rgba(255, 255, 255, .14); }
.auth-name { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.auth-tag { font-size: 17px; opacity: .85; max-width: 340px; }
.auth-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 10px; align-items: center; opacity: .9; }
.auth-points .ti { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  border-radius: 22px; padding: 28px; display: flex; flex-direction: column; gap: 14px; animation: pop .45s var(--ease) both;
}
.auth p { margin: 0; }
.person-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
  transition: border-color .2s, transform .12s var(--ease), background .2s;
}
.person-pick:hover { border-color: var(--brand); background: var(--brand-soft); }
.person-pick:active { transform: scale(.98); }
.person-pick > .ti { color: var(--muted); }
@media (prefers-color-scheme: dark) { .auth-brand { background: #13251c; } }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 36px 24px 56px; align-items: center; text-align: center; gap: 8px; }
  .auth-brand .logo { width: 56px; height: 56px; font-size: 30px; }
  .auth-name { font-size: 26px; }
  .auth-tag { font-size: 15px; }
  .auth-points { display: none; }
  .auth-side { align-items: flex-start; margin-top: -36px; padding: 0 16px 24px; }
}

.demo-banner {
  font-size: 12px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: 12px; padding: 7px 12px; margin-bottom: 12px;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(var(--nav-h) + 90px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 90px; left: calc(50% + 120px); } }
.toast {
  padding: 12px 16px; border-radius: 14px; background: #1d2621; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lift); animation: rise .3s var(--ease) both;
}
.toast-error { background: #9b2a16; }
.toast-urgent { background: var(--urgent); font-weight: 700; }

/* Long names on phones: badges drop under the name instead of squeezing it */
.row-card .card-head { flex-wrap: wrap; row-gap: 6px; }
.row-card .card-title { flex: 1 1 180px; }
@media (max-width: 480px) {
  .row-card .badges { justify-content: flex-start; order: 2; flex-basis: 100%; }
}
@media (max-width: 480px) {
  .detail-hero { padding: 18px 16px; gap: 12px; }
  .detail-hero > .avatar-lg { display: none; }
  .detail-hero h1 { font-size: 19px; }
}
