/* biz.dfive.us — Dfive Biz.
 *
 * Dark, dense, and deliberately unexciting: this is a screen you open when
 * something is due, read in fifteen seconds, and close. The only colour that
 * carries meaning is the state of an obligation — overdue is red, soon is
 * amber, everything else is quiet. Nothing else competes with that.
 */

:root {
  --bg: #0c0a12;
  --bg-2: #14111d;
  --panel: #1a1626;
  --line: #2a2440;
  --ink: #efecf7;
  --ink-2: #a49dbd;
  --ink-3: #6f6790;
  --accent: #a78bfa;
  --bad: #f87171;
  --bad-bg: #2a1620;
  --warn: #fbbf24;
  --warn-bg: #271f14;
  --ok: #34d399;
  --radius: 12px;
  --wrap: 940px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 2px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.empty { color: var(--ink-3); padding: 14px 0; }
.hint { color: var(--ink-3); font-size: 13px; }

/* ── chrome ─────────────────────────────────────────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: var(--bg-2); position: sticky; top: 0; z-index: 20;
}
.top-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.top-right { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.who { color: var(--ink-3); font-size: 13px; }
@media (max-width: 640px) { .who { display: none; } }
.crumbs { display: flex; gap: 8px; min-width: 0; overflow: hidden; }
.crumb { color: var(--ink-2); text-decoration: none; font-size: 13px; white-space: nowrap; }
.crumb + .crumb::before { content: "/"; color: var(--ink-3); margin-right: 8px; }
.crumb-here { color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px 60px; }
.section-h { margin: 28px 0 10px; color: var(--ink-2); font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.08em; }

/* ── the unverified banner ───────────────────────────────────────────────
   Deliberately loud and impossible to dismiss. Every rule in this app came
   from a secondary source; presenting those dates as fact would be the worst
   thing this software could do. */
.banner {
  border: 1px solid var(--warn); background: var(--warn-bg); color: var(--ink);
  border-radius: var(--radius); padding: 12px 14px; margin: 0 0 18px; font-size: 14px;
}
.banner strong { color: var(--warn); }

/* ── stats ──────────────────────────────────────────────────────────────── */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; }
.stat {
  flex: 1 1 140px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat-n { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stat-l { color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-bad { border-color: var(--bad); }
.stat-bad .stat-n { color: var(--bad); }

/* ── obligation rows ────────────────────────────────────────────────────── */
.group { margin: 0 0 22px; }
.group-h {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
  font-size: 14px; color: var(--ink-2); font-weight: 600;
}
.pill {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-3);
  border-radius: 999px; padding: 1px 9px; font-size: 12px;
}
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.row-bad { border-left-color: var(--bad); background: var(--bad-bg); }
.row-warn { border-left-color: var(--warn); }
.row-main { min-width: 0; }
.row-t { font-weight: 600; }
.row-m { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.row-c { color: var(--bad); font-size: 13px; margin-top: 6px; }
.row-u { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.row-actions { display: flex; gap: 8px; flex: 0 0 auto; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.fact {
  flex: 1 1 220px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}
.fact-l { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.fact-v { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 2px;
  word-break: break-word; }

/* ── cards ──────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { border-color: var(--accent); }

/* ── buttons and forms ──────────────────────────────────────────────────── */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 0; }
.btn {
  font: inherit; border-radius: 9px; padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #16111f; font-weight: 600; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; text-decoration: none; display: inline-block; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form h2 { margin-bottom: 2px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.file { color: var(--ink-2); font: inherit; }
.upload {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 0; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius);
}
.upload .ds-input { width: auto; }

/* ── sheet and toast ────────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(6, 4, 12, 0.7); }
.sheet-body {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet-body { border-radius: 18px; }
}
.sheet-grip {
  display: block; width: 40px; height: 4px; border: 0; border-radius: 2px;
  background: var(--line); margin: 0 auto 12px; cursor: pointer;
}
.sheet-x {
  position: absolute; top: 12px; right: 14px; border: 0; background: transparent;
  color: var(--ink-3); font-size: 16px; cursor: pointer;
}
body.sheet-open { overflow: hidden; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 80;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 10px 18px; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); max-width: min(520px, 92vw);
}
.toast[hidden] { display: none; }
