/* Haller Holdings Command Center — mobile-first.
   Palette: navy #1E3A42, sand #E8DAB4, coral #B5512E, seafoam #5C7A72, cream #FBF7EE */
:root {
  --navy: #1E3A42;
  --sand: #E8DAB4;
  --coral: #B5512E;
  --coral-light: #F5E3DA;
  --seafoam: #5C7A72;
  --seafoam-light: #E2EEE9;
  --cream: #FBF7EE;
  --card: #FFFFFF;
  --amber: #BA7517;
  --amber-light: #FAEEDA;
  --border: #EAE3D2;
  --divider: #F4F0E3;
  --text: #1E3A42;
  --text-soft: #5C5A4E;
  --text-faint: #8B8878;
  --input-bg: #FFFEFB;
  --shadow: 0 1px 2px rgba(30,58,66,.05), 0 4px 14px rgba(30,58,66,.06);
  --shadow-lift: 0 2px 4px rgba(30,58,66,.07), 0 10px 24px rgba(30,58,66,.09);
  --ring-track: #EFE8D8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #14262C;
    --card: #1E3A42;
    --navy: #E8EEE9;
    --text: #E8EEE9;
    --sand: #E8DAB4;
    --coral-light: #4A2E22;
    --seafoam-light: #27423D;
    --amber-light: #42351C;
    --border: #2C4A52;
    --divider: #27424B;
    --text-soft: #A9B8B2;
    --text-faint: #7A8D89;
    --input-bg: #173037;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 4px 14px rgba(0,0,0,.25);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.3), 0 10px 24px rgba(0,0,0,.35);
    --ring-track: #27424B;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
}
.wrap { max-width: 1020px; margin: 0 auto; padding: 14px 14px 96px; }
@media (min-width: 700px) { .wrap { padding: 28px 22px 80px; } }

/* header + nav */
.hero { display: flex; justify-content: space-between; align-items: flex-end;
  gap: 10px; margin-bottom: 14px; padding-bottom: 8px; }
.hero h1 { font-size: 22px; margin: 0; letter-spacing: -0.02em; font-weight: 800; }
.hero .sub { font-size: 12px; color: var(--text-soft); letter-spacing: .06em; text-transform: uppercase; }
.btn-ghost { background: none; border: 1px solid var(--border); border-radius: 16px;
  padding: 5px 12px; font-size: 12px; color: var(--text-soft); cursor: pointer; }
.tabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; margin-bottom: 18px; padding-bottom: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 20px;
  border: none; background: var(--card); color: var(--text-soft);
  white-space: nowrap; text-decoration: none; box-shadow: var(--shadow); }
.tab-btn.active { background: var(--coral); color: #fff; }
@media (max-width: 699px) {
  .tabs { display: none; }
  .hero form { display: none; }
}

/* bottom nav (mobile only) */
.bottom-nav { display: none; }
@media (max-width: 699px) {
  .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    display: flex; justify-content: space-around; align-items: stretch;
    background: var(--card); box-shadow: 0 -2px 16px rgba(30,58,66,.12);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    font-size: 10.5px; font-weight: 600; color: var(--text-faint); text-decoration: none;
    background: none; border: none; padding: 4px 0; cursor: pointer; border-radius: 10px; }
  .bn-icon { font-size: 20px; line-height: 1.2; }
  .bn-item.active { color: var(--coral); }
}
.more-sheet { position: fixed; bottom: calc(64px + env(safe-area-inset-bottom)); right: 10px;
  z-index: 41; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: 8px; display: flex; flex-direction: column; min-width: 210px; }
.more-link { padding: 12px 14px; border-radius: 10px; text-decoration: none;
  color: var(--text); font-size: 14.5px; font-weight: 600; background: none;
  border: none; text-align: left; cursor: pointer; width: 100%; font-family: inherit; }
.more-link:active, .more-link:hover { background: var(--divider); }

/* cards */
.card { background: var(--card); border: none; border-radius: 14px;
  margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 11px; padding: 14px 15px;
  cursor: pointer; user-select: none; list-style: none; }
.card-head::-webkit-details-marker { display: none; }
.card-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--seafoam-light);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.card-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-title { font-size: 14.5px; font-weight: 700; }
.card-sub { font-size: 11.5px; color: var(--text-faint); }
.chevron { font-size: 11px; color: var(--text-faint); transition: transform .18s ease; }
details[open] > .card-head .chevron { transform: rotate(90deg); }
.card-body { padding: 4px 16px 16px; border-top: 1px solid var(--divider); }
.add-card summary { color: var(--text-faint); }
.add-card { box-shadow: none; border: 1.5px dashed var(--border); background: none; }

/* sections */
.section-label { font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-soft); margin: 18px 0 7px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 8px;
  border-radius: 8px; background: var(--seafoam-light); color: var(--seafoam);
  text-transform: uppercase; letter-spacing: .03em; }
@media (prefers-color-scheme: dark) { .tag { color: #9FC3B8; } }
.body-text { font-size: 13px; margin: 6px 0; }
ul.clean { margin: 4px 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
ul.clean li { margin-bottom: 4px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 4px; }
table.data td { padding: 7px 4px; border-bottom: 1px solid var(--divider); vertical-align: top; }
table.data td:first-child { color: var(--text-soft); }
table.data td:last-child { text-align: right; font-weight: 600; }
table.data tr:first-child td { font-weight: 600; }

/* checklists */
.checklist { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.checklist li { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0;
  border-bottom: 1px solid var(--divider); }
.checklist li:last-child { border-bottom: none; }
.checklist input[type=checkbox] { margin-top: 1px; width: 20px; height: 20px;
  accent-color: var(--seafoam); flex-shrink: 0; cursor: pointer; transition: transform .12s ease; }
.checklist input[type=checkbox]:active { transform: scale(1.25); }
.checklist .item-text { flex: 1; line-height: 1.45; transition: color .25s, opacity .25s; }
.checklist li.checked .item-text { color: var(--text-faint); text-decoration: line-through; opacity: .75; }
.item-actions { display: flex; gap: 2px; opacity: .5; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 13px;
  color: var(--text-faint); padding: 2px 5px; border-radius: 6px; }
.icon-btn:hover { background: var(--coral-light); color: var(--coral); }
.deadline-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 8px; margin-left: 4px; }
.deadline-badge.red, .urgency.red { background: var(--coral-light); color: var(--coral); }
.deadline-badge.amber, .urgency.amber { background: var(--amber-light); color: var(--amber); }
.deadline-badge.green, .urgency.green { background: var(--seafoam-light); color: var(--seafoam); }
@media (prefers-color-scheme: dark) {
  .deadline-badge.red, .urgency.red { color: #E89A7C; }
  .deadline-badge.amber, .urgency.amber { color: #DBAE64; }
  .deadline-badge.green, .urgency.green { color: #9FC3B8; }
}

/* htmx swap smoothing */
.htmx-swapping { opacity: 0; transition: opacity .15s ease-out; }
.htmx-settling { opacity: 0; }
.htmx-settling.htmx-added, li.htmx-settling, div.htmx-settling { animation: settle .25s ease-out forwards; }
@keyframes settle { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* forms */
input, select, textarea, button { font-family: inherit; font-size: 13.5px; }
input, select, textarea { border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; background: var(--input-bg); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--seafoam); border-color: var(--seafoam); }
.stack-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.add-item { margin-top: 8px; }
.add-item input[name=text] { flex: 1; min-width: 140px; }
.btn-small { font-size: 12.5px; font-weight: 600; padding: 9px 15px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--card); cursor: pointer; color: var(--text);
  box-shadow: var(--shadow); }
.btn-small:hover { box-shadow: var(--shadow-lift); }
.btn-danger { color: var(--coral); }
.note-box textarea { width: 100%; min-height: 84px; resize: vertical; }
.save-hint, .faint { font-size: 11.5px; color: var(--text-faint); }
.note-status { margin-top: 3px; }
.section-editor { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.card-mgmt { background: var(--cream); border: 1px dashed var(--border); border-radius: 10px;
  padding: 10px; margin-top: 10px; }

/* today */
.today-venture { background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 16px 17px; margin-bottom: 14px; }
.today-vname { font-size: 16px; margin: 0 0 12px; font-weight: 800; letter-spacing: -0.01em; }
.today-top { display: flex; gap: 16px; align-items: center; }
.today-top .countdown { flex: 1; }
.countdown { background: linear-gradient(135deg, #1E3A42, #2A5058); color: var(--sand);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; display: flex; gap: 22px; flex-wrap: wrap; }
.cd-block { text-align: center; }
.cd-num { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.cd-label { font-size: 10px; opacity: .75; margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.cd-edit input[type=date] { margin-top: 7px; font-size: 11px; padding: 2px 6px;
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: var(--sand);
  color-scheme: dark; }

/* progress ring */
.ring-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.ring { flex-shrink: 0; }
.ring .track { stroke: var(--ring-track); }
.ring .arc { stroke: var(--coral); transition: stroke-dashoffset .8s ease; }
.ring .arc.high { stroke: var(--seafoam); }
.ring-pct { font-size: 19px; font-weight: 800; fill: var(--text); }
.ring-caption { font-size: 12.5px; color: var(--text-soft); }
.ring-caption b { font-size: 15px; color: var(--text); }

.next-actions { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.next-actions li { padding: 9px 0; border-bottom: 1px solid var(--divider); }
.next-actions li:last-child { border-bottom: none; }
.next-actions a { color: var(--text); text-decoration: none; font-weight: 600; }
.urgency { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; margin-right: 6px; white-space: nowrap; }

/* budget + monthly */
.budget-totals { display: flex; gap: 10px; margin: 12px 0; font-size: 13px; flex-wrap: wrap; }
.budget-totals div { background: var(--cream); border-radius: 10px; padding: 9px 14px; }
.budget-totals .lbl { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.budget-totals .val { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.val.neg { color: var(--coral); }
table.budget, table.monthly { width: 100%; border-collapse: collapse; font-size: 13px; }
table.budget th, table.monthly th { text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-faint); padding: 6px 4px; border-bottom: 1px solid var(--border); }
table.budget td, table.monthly td { padding: 5px 3px; border-bottom: 1px solid var(--divider); }
table.budget input.cat { width: 100%; min-width: 150px; border: none; background: transparent; padding: 4px; box-shadow: none; }
input.amt { width: 84px; text-align: right; padding: 6px 6px; font-size: 12.5px; }
.variance { text-align: right; font-weight: 700; white-space: nowrap; }
.variance.over { color: var(--coral); }
.variance.under { color: var(--seafoam); }
table.monthly .subhead th { font-size: 9.5px; }
table.monthly .month-cell { font-weight: 700; white-space: nowrap; }
table.monthly .proj { text-align: right; color: var(--text-soft); white-space: nowrap; }
table.monthly td.good input { background: var(--seafoam-light); }
table.monthly td.bad input { background: var(--coral-light); }
.note-inline { width: 130px; font-size: 12px; }

/* cash-flow chart */
.chart-box { margin: 6px 0 4px; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--text-soft); margin-top: 6px; }
.chart-legend .k { display: inline-block; width: 18px; height: 3px; border-radius: 2px;
  vertical-align: middle; margin-right: 5px; }

/* session log */
.log-entry { background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 13px 16px; margin-bottom: 12px; }

/* login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  margin: 0; background: #1E3A42;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.login-box { background: var(--cream); border-radius: 18px; padding: 36px 30px;
  width: min(90vw, 340px); text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.login-emoji { font-size: 42px; }
.login-box h1 { font-size: 19px; color: var(--text); margin: 8px 0 18px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }
.login-box input { padding: 13px; font-size: 16px; }
.login-box button { padding: 13px; font-size: 15px; font-weight: 700; background: var(--coral);
  color: #fff; border: none; border-radius: 10px; cursor: pointer; }
.login-error { color: var(--coral); font-size: 13px; }

/* confetti overlay */
#confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

/* htmx request indicator */
.htmx-request { opacity: .65; }
