/* ===== Woodring Ventures brand fonts ===== */
@font-face {
  font-family: "Iowan Old Style";
  src: url("fonts/IowanOldStyle-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Iowan Old Style";
  src: url("fonts/IowanOldStyle-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Iowan Old Style";
  src: url("fonts/IowanOldStyle-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Andada";
  src: url("fonts/Andada-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Andada";
  src: url("fonts/Andada-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Andada";
  src: url("fonts/Andada-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --serif-head: "Iowan Old Style", Georgia, "Times New Roman", serif;
  --serif-body: "Andada", Georgia, serif;

  --bg: #f7f2ea;
  --card: #ffffff;
  --ink: #423c35;
  --heading: #35302c;
  --muted: #7a6a55;
  --line: #e5dccd;
  --accent: #997e5b;
  --accent-hover: #866c4b;
  --accent-soft: #f0e8da;
  --panel: #35302c;
  --green: #4f6b57;
  --red: #a05252;
  --amber: #997e5b;
  /* Pill palettes */
  --pill-primary-bg: #e8efe6;
  --pill-primary-fg: #4f6b57;
  --pill-land-bg: #f3ebd9;
  --pill-land-fg: #8a6d3b;
  --pill-business-bg: #efe8dd;
  --pill-business-fg: #6f5c3f;
  --callout-border: #e0d3ba;
  /* Chart border between segments (matches surface) */
  --chart-segment-border: #ffffff;
  --shadow: 0 1px 2px rgba(53, 48, 44, 0.06), 0 4px 12px rgba(53, 48, 44, 0.05);
}

[data-theme="dark"] {
  --bg: #1e1a17;
  --card: #262019;
  --ink: #ece3d6;
  --heading: #f5efe4;
  --muted: #b3a892;
  --line: #3a332b;
  --accent: #b8996b;
  --accent-hover: #cdb488;
  --accent-soft: #322a20;
  --panel: #15110e;
  --green: #6fa389;
  --red: #d17f7f;
  --amber: #b8996b;
  --pill-primary-bg: #26332a;
  --pill-primary-fg: #6fa389;
  --pill-land-bg: #35301f;
  --pill-land-fg: #cdb488;
  --pill-business-bg: #302820;
  --pill-business-fg: #cdb488;
  --callout-border: #4a4030;
  --chart-segment-border: #262019;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--serif-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-title { font-family: var(--serif-head); color: var(--heading); }

/* ===== Ambient dot-grid texture (behind all content) ===== */
.dot-texture {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ===== Login screen ===== */
.login {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  overflow: hidden;
}
/* Soft gold radial glow above the dot texture. */
.login::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 38%, rgba(153, 126, 91, 0.12), transparent 70%);
  pointer-events: none;
}
[data-theme="dark"] .login::before {
  background: radial-gradient(60% 55% at 50% 38%, rgba(184, 153, 107, 0.10), transparent 70%);
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px 40px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 70px rgba(53, 48, 44, 0.22);
  text-align: center;
}
.login-ring {
  width: 74px;
  height: 74px;
  display: block;
  margin: 0 auto 18px;
}
.login-title {
  margin: 0 0 4px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.login-sub {
  margin: 0 0 30px;
  color: var(--accent);
  font-family: var(--serif-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
}
.login-card .field { text-align: left; margin-bottom: 16px; }
.login-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.login-card input {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--serif-body);
  font-size: 15px;
}
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-card button {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--serif-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.login-card button:hover { background: var(--accent-hover); }
.login-card button:disabled { opacity: 0.6; cursor: default; }
.login-error { color: var(--red); font-size: 13px; margin: 16px 0 0; }

/* ===== App shell: rail + main ===== */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ---- Left rail ---- */
:root { --rail-open: 248px; --rail-closed: 72px; }

.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  flex: 0 0 auto;
  width: var(--rail-open);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: width 0.2s ease;
  z-index: 30;
}
[data-rail="closed"] .rail { width: var(--rail-closed); }
/* Collapsed → hover peeks open without changing saved state. */
[data-rail="closed"] .rail:hover { width: var(--rail-open); box-shadow: var(--shadow); }

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 65px;
}
.rail-ring { width: 32px; height: 32px; flex: 0 0 auto; }
.rail-wordmark {
  font-family: var(--serif-head);
  color: var(--heading);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.rail-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 14px 10px; }
.nav-group { margin-bottom: 18px; }
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 8px;
  font-family: var(--serif-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  white-space: nowrap;
}
.nav-index { color: var(--accent); font-variant-numeric: tabular-nums; opacity: 0.8; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg); }
.nav-icon { flex: 0 0 auto; }
.nav-label { flex: 1 1 auto; overflow: hidden; }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item.disabled { color: var(--muted); opacity: 0.55; cursor: default; pointer-events: none; }
.nav-soon {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
}

.rail-footer {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rail-signout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--serif-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.rail-signout:hover { background: var(--bg); color: var(--ink); }

/* Hide labels/wordmark when collapsed (and not hover-peeking). */
[data-rail="closed"] .rail:not(:hover) .rail-wordmark,
[data-rail="closed"] .rail:not(:hover) .nav-label,
[data-rail="closed"] .rail:not(:hover) .nav-group-label,
[data-rail="closed"] .rail:not(:hover) .nav-soon,
[data-rail="closed"] .rail:not(:hover) .rail-signout .nav-label { display: none; }
[data-rail="closed"] .rail:not(:hover) .theme-toggle { display: none; }
[data-rail="closed"] .rail:not(:hover) .rail-footer { align-items: center; }

/* ---- Main content ---- */
.main-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.eyebrow {
  font-family: var(--serif-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  color: var(--muted);
}
.rail-toggle, .hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.rail-toggle:hover, .hamburger:hover { color: var(--ink); background: var(--bg); }
.hamburger { display: none; }

.view-root { flex: 1 1 auto; overflow-y: auto; padding: 28px; }
.view { max-width: 1200px; margin: 0 auto; }
.view-head { margin-bottom: 20px; }
.view-title { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.3px; }
.view-caption { color: var(--muted); font-size: 13px; margin: 0; }

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 0 0;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

/* Off-canvas scrim (mobile) */
.rail-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 14, 0.45);
  z-index: 25;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.theme-btn + .theme-btn { border-left: 1px solid var(--line); }
.theme-btn:hover { color: var(--ink); }
.theme-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-family: var(--serif-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.section { display: none; }
.section.active { display: block; }

/* Layout helpers */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.two-col { grid-template-columns: 1fr 1fr; }
.section h2 { font-size: 20px; margin: 4px 0 16px; }
.section h3 { font-size: 16px; margin: 0 0 12px; }

@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Off-canvas rail under 760px */
@media (max-width: 760px) {
  .hamburger { display: inline-flex; }
  .rail-toggle { display: none; }
  .rail {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--rail-open) !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .rail-mobile-open .rail { transform: translateX(0); box-shadow: var(--shadow); }
  [data-rail="closed"] .rail:not(:hover) .rail-wordmark,
  [data-rail="closed"] .rail:not(:hover) .nav-label,
  [data-rail="closed"] .rail:not(:hover) .nav-group-label,
  [data-rail="closed"] .rail:not(:hover) .nav-soon,
  [data-rail="closed"] .rail:not(:hover) .theme-toggle { display: revert; }
  .view-root { padding: 18px; }
  .view-header { padding: 0 16px; }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi .value { font-family: var(--serif-head); color: var(--heading); font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -0.3px; }
.kpi .sub { font-size: 12px; margin-top: 4px; color: var(--muted); }
.kpi .sub.down { color: var(--red); }
.kpi .sub.up { color: var(--green); }

.chart-wrap { position: relative; height: 300px; }
.chart-wrap.tall { height: 380px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); color: var(--heading); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.rental { background: var(--accent-soft); color: var(--accent); }
.pill.primary { background: var(--pill-primary-bg); color: var(--pill-primary-fg); }
.pill.land { background: var(--pill-land-bg); color: var(--pill-land-fg); }
.pill.business { background: var(--pill-business-bg); color: var(--pill-business-fg); }
.pill.checking { background: var(--accent-soft); color: var(--accent); }

/* Property cards */
.prop-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 20px; }
.prop-card .addr { font-weight: 700; font-size: 14px; color: var(--heading); }
.prop-card .row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.prop-card .row .k { color: var(--muted); }
.prop-card .equity { color: var(--green); font-weight: 700; }

/* IRS */
.callout {
  background: var(--accent-soft);
  border: 1px solid var(--callout-border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
}
.callout strong { color: var(--accent); }
.progress-track { background: var(--line); border-radius: 999px; height: 12px; overflow: hidden; margin: 10px 0 6px; }
.progress-fill { background: var(--accent); height: 100%; }
.note { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.mb16 { margin-bottom: 16px; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--red); }

/* ===== Tasks view ===== */
.task-add {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.task-add input {
  flex: 1 1 auto;
  padding: 12px 14px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--serif-body);
  font-size: 15px;
}
.task-add input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.task-add-btn {
  flex: 0 0 auto;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--serif-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.task-add-btn:hover { background: var(--accent-hover); }

.task-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) { .task-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .task-board { grid-template-columns: 1fr; } }

.task-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.task-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--heading);
}
.col-index { color: var(--accent); font-variant-numeric: tabular-nums; opacity: 0.8; }
.task-count {
  margin-left: auto;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0;
}
.task-col-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.task-col-empty { color: var(--muted); text-align: center; padding: 14px 0; opacity: 0.5; }

.task {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 11px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid transparent;
}
.task-main { display: flex; align-items: flex-start; gap: 8px; }
.task-meta { display: flex; align-items: center; gap: 8px; padding-left: 24px; }
.task:hover { border-color: var(--line); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check { flex: 0 0 auto; width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.prio-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.prio-dot.prio-0 { background: var(--muted); opacity: 0.5; }
.prio-dot.prio-1 { background: var(--green); }
.prio-dot.prio-2 { background: var(--amber); }
.prio-dot.prio-3 { background: var(--red); }
.task-title {
  flex: 1 1 auto;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.task-title:focus { box-shadow: 0 0 0 2px var(--accent-soft); border-radius: 4px; }
.task-due {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.task-status {
  flex: 0 0 auto;
  font-family: var(--serif-body);
  font-size: 11px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 4px;
  cursor: pointer;
}
.task-del {
  flex: 0 0 auto;
  margin-left: auto;
  width: 22px; height: 22px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.task-del:hover { color: var(--red); background: var(--card); }

.tasks-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.tasks-empty-mark {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}
.tasks-empty h3 { margin: 0 0 6px; font-size: 18px; }
.tasks-empty p { margin: 0; font-size: 13.5px; }

/* ===== Hub Launcher view ===== */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.hub-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.hub-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.hub-card .hub-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.hub-body { flex: 1 1 auto; min-width: 0; }
.hub-name {
  font-family: var(--serif-head);
  color: var(--heading);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hub-here {
  font-family: var(--serif-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
}
.hub-url { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.hub-arrow { flex: 0 0 auto; color: var(--muted); }
.hub-card:hover .hub-arrow { color: var(--accent); }
.hub-card.here { border-color: var(--accent); }
