/* Hogden House — palette drawn from the wedding: suit navy, wisteria, ivy, sunflower. */
:root {
  --bg: #f1f2f0;
  --surface: #ffffff;
  --surface-2: #f6f7f5;
  --ink: #1c2233;
  --ink-2: #4a5062;
  --muted: #767b88;
  --line: #e0e2df;
  --line-2: #cfd2ce;

  --navy: #1e2a44;
  --navy-2: #2a3a5c;
  --navy-ink: #e9ecf3;
  --wisteria: #6f61a2;
  --wisteria-2: #5b4e8c;
  --wisteria-soft: #eceaf5;
  --ivy: #4e6b4a;
  --ivy-soft: #e6ede4;
  --sun: #b8860b;
  --sun-strong: #d9a21b;
  --sun-soft: #f7efd9;
  --brick: #a8443a;
  --brick-soft: #f5e4e1;

  --night: #6f61a2;
  --day: #d9a21b;
  --gas: #4e6b4a;
  --bar: #2a3a5c;

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 14px;
  --r-md: 8px;
  --r-sm: 5px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171f;
    --surface: #1b1f29;
    --surface-2: #222734;
    --ink: #e8e9ee;
    --ink-2: #c2c5cf;
    --muted: #8f94a2;
    --line: #2c3241;
    --line-2: #3a4152;
    --navy: #0f1524;
    --navy-2: #1d2740;
    --wisteria: #a99de0;
    --wisteria-2: #bfb5ec;
    --wisteria-soft: #2a2740;
    --ivy: #8fb487;
    --ivy-soft: #1f2b20;
    --sun: #e6bb4f;
    --sun-strong: #e6bb4f;
    --sun-soft: #322a14;
    --brick: #e58a7e;
    --brick-soft: #3a201d;
    --night: #a99de0;
    --day: #e6bb4f;
    --gas: #8fb487;
    --bar: #8fa3cf;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.55 var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--wisteria); text-underline-offset: 3px; }
a:hover { color: var(--wisteria-2); }
:focus-visible { outline: 2px solid var(--wisteria); outline-offset: 2px; border-radius: 4px; }
h1 { font: 400 2rem/1.15 var(--serif); margin: 0; letter-spacing: -.005em; }
h2 { font: 600 1rem/1.3 var(--sans); margin: 0 0 14px; }
h3 { font: 600 .95rem/1.3 var(--sans); margin: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--navy); color: var(--navy-ink); padding: 26px 14px 16px;
}
.wordmark { font: 400 1.35rem/1.1 var(--serif); padding: 0 12px; color: #fff; }
.wordmark small { display: block; font: 400 .8rem/1.4 var(--sans); color: rgba(233, 236, 243, .55); margin-top: 6px; }
.nav nav { display: flex; flex-direction: column; gap: 2px; margin-top: 32px; flex: 1; }
.nav nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-md);
  color: rgba(233, 236, 243, .72); text-decoration: none; font-weight: 500;
}
.nav nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav nav a.active { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 3px 0 0 #b9addf; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.who .name { font-weight: 600; color: #fff; line-height: 1.2; }
.who .role { font-size: .8rem; color: rgba(233, 236, 243, .6); }
.who button { margin-left: auto; background: none; border: 0; color: rgba(233, 236, 243, .7); cursor: pointer; padding: 6px; border-radius: 6px; }
.who button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--wisteria); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }

main { padding: 36px clamp(16px, 4vw, 52px) 72px; width: 100%; max-width: 1240px; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 8px 0 0; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; }
  .wordmark { font-size: 1.05rem; padding: 0 4px; white-space: nowrap; }
  .wordmark small { display: none; }
  .nav nav { flex-direction: row; margin: 0; overflow-x: auto; gap: 0; }
  .nav nav a { padding: 8px 10px; gap: 6px; }
  .nav nav a span { display: none; }
  .nav nav a.active { box-shadow: inset 0 -2px 0 #b9addf; }
  .who { border: 0; padding: 0; }
  .who .name, .who .role { display: none; }
  main { padding-top: 24px; }
}

/* ---------- Surfaces ---------- */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head a { font-size: .88rem; }
.stat .label { color: var(--muted); font-size: .86rem; }
.stat .value { font: 400 1.75rem/1.2 var(--serif); margin-top: 6px; }
.stat .sub { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.stat.bad .value { color: var(--brick); }
.stat.warn .value { color: var(--sun); }

/* ---------- Dashboard hero ---------- */
.hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 24px;
  min-height: 340px; display: flex; align-items: flex-end; background: var(--navy);
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 26, 42, 0) 30%, rgba(20, 26, 42, .78) 100%); }
.hero-text { position: relative; z-index: 1; padding: 28px 32px; color: #fff; max-width: 720px; }
.hero-text h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); color: #fff; }
.hero-text p { font-size: 1.06rem; color: rgba(255, 255, 255, .88); margin: 10px 0 0; max-width: 60ch; }
.hero-text p strong { color: #fff; font-weight: 600; }
.hero-actions { position: absolute; top: 20px; right: 20px; z-index: 1; }

/* ---------- Buttons & forms ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  border-radius: var(--r-md); padding: 9px 15px; font: 600 .92rem/1.2 var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn.primary { background: var(--wisteria); border-color: var(--wisteria); color: #fff; }
.btn.primary:hover { background: var(--wisteria-2); border-color: var(--wisteria-2); color: #fff; }
.btn.on-photo { background: rgba(255, 255, 255, .92); border-color: transparent; color: var(--navy); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 11px; font-size: .85rem; }
.btn.danger { color: var(--brick); }
.btn.danger:hover { border-color: var(--brick); color: var(--brick); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
input, select, textarea {
  font: 400 .95rem/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wisteria); box-shadow: 0 0 0 3px var(--wisteria-soft); }
input[type="file"] { padding: 7px; background: var(--surface-2); }
textarea { min-height: 84px; resize: vertical; }
.form { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li[data-item] { cursor: pointer; }
.list li[data-item]:hover .title { color: var(--wisteria); }
.list .title a, td a.doc-link { color: var(--ink); text-decoration: none; }
.list .title a:hover, td a.doc-link:hover { color: var(--wisteria); text-decoration: underline; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list .meta { color: var(--muted); font-size: .86rem; }
.empty { color: var(--muted); padding: 28px 0; text-align: center; }

.cat-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--navy-2); border: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) { .cat-icon { color: var(--ink-2); } }

.datecell { width: 46px; flex: none; text-align: center; line-height: 1.05; }
.datecell .d { font: 400 1.35rem/1 var(--serif); display: block; }
.datecell .m { font-size: .78rem; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r-sm);
  font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.bad { background: var(--brick-soft); color: var(--brick); }
.badge.warn { background: var(--sun-soft); color: var(--sun); }
.badge.ok { background: var(--ivy-soft); color: var(--ivy); }
.chip { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; color: var(--ink-2); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { max-width: 300px; }
.filters select { width: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .84rem; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.panel.table-wrap { padding: 8px 14px; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--sans); }
.chart .grid-line { stroke: var(--line); }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; background: var(--c); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 8px 13px; font: 600 .88rem var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: #fff; }
.bar-share { height: 8px; border-radius: 4px; background: var(--day); overflow: hidden; margin-top: 12px; }
.bar-share > div { height: 100%; background: var(--night); }

/* ---------- Sign in ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.login-art { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .wordmark { font-size: 1.6rem; padding: 0; }
.login-art blockquote { font: 400 clamp(1.6rem, 3vw, 2.4rem)/1.25 var(--serif); margin: 0; max-width: 18ch; }
.login-art .sprig { position: absolute; right: 0; top: 0; width: min(62%, 460px); height: auto; opacity: .9; pointer-events: none; }
.login-art blockquote, .login-art .wordmark { position: relative; z-index: 1; }
.login-side { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login-card { width: min(360px, 100%); display: grid; gap: 18px; }
.login-card h1 { font-size: 1.9rem; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.people button {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-md); padding: 14px;
  font: 600 1rem var(--sans); color: var(--ink); cursor: pointer; text-align: left;
}
.people button:hover { border-color: var(--wisteria); }
.people button[aria-pressed="true"] { border-color: var(--wisteria); box-shadow: 0 0 0 3px var(--wisteria-soft); }
.error { color: var(--brick); min-height: 1.3em; margin: 0; font-size: .9rem; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; min-height: 180px; }
  .login-art blockquote { font-size: 1.5rem; }
}

/* ---------- Modal & toast ---------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 20, 35, .28);
}
dialog::backdrop { background: rgba(18, 23, 38, .5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font: 400 1.35rem/1.2 var(--serif); margin: 0; }
.modal-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: var(--r-md); font-weight: 500;
  opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
.notice { background: var(--sun-soft); color: var(--ink); border-left: 3px solid var(--sun-strong); border-radius: var(--r-sm); padding: 12px 16px; font-size: .93rem; margin-bottom: 20px; }
.notice.calm { background: var(--wisteria-soft); border-left-color: var(--wisteria); }
.doc-checks { display: grid; gap: 6px; max-height: 170px; overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.doc-checks label { flex-direction: row; align-items: center; font-weight: 400; gap: 8px; color: var(--ink); }
.doc-checks input { width: auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Documents: folders ---------- */
.docs-layout { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.docs-main { min-width: 0; }
.folders { padding: 12px; position: sticky; top: 16px; }
.folder {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .93rem;
  border: 1px dashed transparent;
}
.folder:hover { background: var(--surface-2); color: var(--ink); }
.folder.on { background: var(--wisteria-soft); color: var(--wisteria-2); }
.folder .f-name { display: flex; align-items: center; gap: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.folder-sep { border-top: 1px solid var(--line); margin: 8px 4px; }
.drop-over { border-color: var(--wisteria) !important; background: var(--wisteria-soft) !important; }
.crumb-row { justify-content: space-between; margin-bottom: 14px; min-height: 34px; }
.crumbs { font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.subfolders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.subfolder {
  display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: var(--r-md); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px dashed var(--line-2);
}
.subfolder:hover { border-color: var(--wisteria); color: var(--ink); }
.subfolder svg.i { color: var(--wisteria); width: 22px; height: 22px; }
tr[draggable="true"] { cursor: grab; }
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .folders { position: static; }
}

/* ---------- People ---------- */
.person { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .grow { flex: 1; }
.evening { border-radius: var(--r-md); overflow: hidden; margin: -4px 0 16px; aspect-ratio: 16 / 7; background: var(--surface-2); }
.evening img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }

@media (min-width: 821px) {
  .shell { background: linear-gradient(90deg, var(--navy) 236px, transparent 236px); }
}
