/* ── AppraisalEdge design system ─────────────────────────────────────────────
   Palette   chart-ink #10222B · fieldsheet #EEF2F1 · surface #FFFFFF
             lakeshore #146C60 (action) · benchmark #B9C6C2 (chain, rules)
             ok #1E7A46 · warn #8A5A00 · bad #B3352C · info #24557E
   Type      Archivo (display) · Inter (body) · Spline Sans Mono (refs/money)
   Signature the survey-chain pipeline rail: benchmark diamonds on a chain   */

:root {
  --ink: #10222B;
  --ink-soft: #33474F;
  --sheet: #EEF2F1;
  --surface: #FFFFFF;
  --line: #D7DEDC;
  --chain: #B9C6C2;
  --act: #146C60;
  --act-deep: #0E4E45;
  --act-tint: #E3EFEC;
  --ok-bg: #E1F0E7; --ok-fg: #1E5C38;
  --warn-bg: #F6ECD6; --warn-fg: #6E4A00;
  --bad-bg: #F7E1DE; --bad-fg: #8F2A22;
  --info-bg: #E2EAF2; --info-fg: #24557E;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,34,43,.06), 0 4px 14px rgba(16,34,43,.05);
  --display: "Archivo", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sheet); color: var(--ink);
  font: 15px/1.55 var(--body);
}
a { color: var(--act); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
.mono, .mono-h { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mono-h { letter-spacing: 0; }
.muted { color: #64757C; }
.hint { display: block; font-size: 12.5px; color: #64757C; margin-top: 4px; }
:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; border-radius: 4px; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--ink); color: #C6D2D6; padding: 22px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-family: var(--display); font-weight: 700; font-size: 16.5px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: #6FBFAF; font-size: 13px; transform: rotate(0deg); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6C8089; margin: 14px 10px 4px; }
.nav a {
  color: #C6D2D6; padding: 8px 10px 8px 14px; border-radius: 7px; font-weight: 500;
  border-left: 2px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.on { color: #fff; background: rgba(111,191,175,.13); border-left-color: #6FBFAF; }
.nav-cta { color: #8FD6C7 !important; }
.side-user { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; font-size: 13px; }
.side-user-name { color: #fff; font-weight: 600; }
.side-user-role { text-transform: capitalize; color: #8A9CA3; margin-bottom: 6px; }
.linklike { background: none; border: 0; color: #8FD6C7; cursor: pointer; padding: 0; font: inherit; }
.linklike:hover { text-decoration: underline; }

.main { padding: 30px 36px 60px; max-width: 1180px; width: 100%; }

/* ── page furniture ─────────────────────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--act); font-weight: 600; margin-bottom: 4px; }
.head-actions { display: flex; align-items: center; gap: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-narrow { max-width: 640px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.empty { text-align: center; color: #64757C; padding: 26px 10px; }
.empty .btn { margin-top: 6px; }

.flash { border-radius: 8px; padding: 11px 14px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: #BFDCC9; }
.flash-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: #E4D2A6; }
.flash-bad { background: var(--bad-bg); color: var(--bad-fg); border-color: #E7BEB8; }

/* ── buttons, chips ─────────────────────────────────────────────────────── */
.btn {
  display: inline-block; border-radius: 8px; padding: 9px 15px; font: 600 14px var(--body);
  cursor: pointer; border: 1px solid transparent; text-align: center;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--act); color: #fff; }
.btn-primary:hover { background: var(--act-deep); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--act); color: var(--act); }
.btn-ghost[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.chip {
  display: inline-block; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip-ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip-warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip-bad { background: var(--bad-bg); color: var(--bad-fg); }
.chip-info { background: var(--info-bg); color: var(--info-fg); }
.chip-xs { font-size: 10.5px; padding: 2px 7px; vertical-align: 2px; }

/* ── stats ──────────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-n { font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.stat-l { font-size: 12.5px; color: #64757C; margin-top: 2px; }
.stat-accent { border-top: 3px solid var(--act); }

/* ── tables ─────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: #64757C; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid #E8EDEB; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #F6F9F8; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.trunc { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── forms ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; flex: 1; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
input, select, textarea {
  font: 400 14.5px var(--body); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--act); outline: none; box-shadow: 0 0 0 3px rgba(20,108,96,.12); }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.check input { width: 16px; height: 16px; accent-color: var(--act); }
.form-actions { display: flex; gap: 10px; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
fieldset.prov-set { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
fieldset.prov-set legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }

/* ── filters, tabs ──────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type="search"] { min-width: 260px; flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-weight: 600; font-size: 14px; color: #4A5D64; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--act); text-decoration: none; }
.tabs a.on { color: var(--act); border-bottom-color: var(--act); }

/* ── layout: order pages ────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.order-form { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.order-form-side { position: sticky; top: 24px; }
.quote { margin: 0; }
.quote > div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #E2E8E6; }
.quote dt { color: #4A5D64; font-size: 13.5px; }
.quote dd { margin: 0; font-weight: 600; }
.quote-total { border-bottom: 0 !important; padding-top: 10px !important; }
.quote-total dt { color: var(--ink); font-weight: 700; }
.quote-total dd { font-size: 18px; }
.quote-card .btn { margin-top: 14px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px 20px; margin: 0; }
.detail-grid dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: #64757C; }
.detail-grid dd { margin: 2px 0 0; font-weight: 500; }
.notebox { background: #F5F8F7; border-left: 3px solid var(--chain); border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 14px 0 0; }

/* ── the survey chain (signature) ───────────────────────────────────────── */
.chainrail { display: flex; align-items: flex-start; padding: 22px 20px 14px; overflow-x: auto; gap: 0; }
.chainstop { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 74px; text-align: center; }
.stn {
  width: 13px; height: 13px; background: #fff; border: 2px solid var(--chain);
  transform: rotate(45deg); border-radius: 2px; flex: none;
}
.chainstop.done .stn { background: var(--act); border-color: var(--act); }
.chainstop.now .stn {
  background: #fff; border-color: var(--act); width: 16px; height: 16px;
  box-shadow: 0 0 0 4px rgba(20,108,96,.16);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(20,108,96,.08); } }
@media (prefers-reduced-motion: reduce) { .chainstop.now .stn { animation: none; } }
.stn-label { font-size: 11px; font-weight: 600; color: #64757C; line-height: 1.25; }
.chainstop.now .stn-label { color: var(--act); }
.chainstop.done .stn-label { color: var(--ink-soft); }
.lnk { flex: 1; min-width: 18px; height: 2px; background: var(--act); margin-top: 7px; }
.lnk.dash { background: repeating-linear-gradient(90deg, var(--chain) 0 6px, transparent 6px 11px); }
.chain-note { margin-left: 18px; align-self: center; color: var(--warn-fg); background: var(--warn-bg); border-radius: 8px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* ── timeline ───────────────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EEF2F1; }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); background: var(--chain); margin-top: 5px; flex: none; }
.tl-paid, .tl-created { background: var(--act); }
.tl-status_changed { background: var(--info-fg); }
.tl-document_uploaded { background: var(--warn-fg); }
.tl-detail { font-weight: 500; }
.tl-meta { font-size: 12.5px; color: #64757C; }
.note-row, .upload-row { display: flex; gap: 8px; flex-wrap: wrap; }
.note-row input { flex: 1; min-width: 200px; }
.upload-row { margin-top: 14px; }

/* ── map ────────────────────────────────────────────────────────────────── */
.map { height: 280px; border-radius: 8px; border: 1px solid var(--line); }
.map-fallback { display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, #F2F5F4 0 12px, #ECF0EF 12px 24px); color: #64757C; text-align: center; padding: 20px; }

/* ── payments, plans ────────────────────────────────────────────────────── */
.paygrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.paycard h2 { margin-bottom: 4px; }
.paycard .btn { margin-top: 12px; }
.pay-list { margin-top: 10px; border-top: 1px solid #EEF2F1; padding-top: 8px; }
.pay-item { font-size: 13px; padding: 3px 0; color: #4A5D64; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plancard-off { opacity: .65; }
.plan-price { font-size: 30px; font-weight: 600; margin: 6px 0 2px; }
.plan-per { font-size: 14px; color: #64757C; }
.plan-feats { padding-left: 18px; margin: 10px 0; }
.plan-feats li { margin: 3px 0; }
.plancard .btn { margin-top: 10px; }

.fee-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px dashed #E2E8E6; }
.fee-input { display: flex; align-items: center; gap: 6px; font-family: var(--mono); }
.fee-input input { width: 110px; text-align: right; font-family: var(--mono); }
.keybox { background: var(--act-tint); border: 1px solid #BEDAD3; border-radius: 6px; padding: 4px 8px; word-break: break-all; }

/* ── auth ───────────────────────────────────────────────────────────────── */
.auth-body { background: var(--sheet); }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-side { background: var(--ink); color: #C6D2D6; display: flex; align-items: center; padding: 48px; }
.auth-side-inner { max-width: 460px; }
.brand-lg { font-size: 21px; margin-bottom: 34px; }
.auth-tag { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: #fff; margin: 0 0 28px; }
.auth-sub { color: #8A9CA3; max-width: 380px; }
.auth-chain { display: flex; align-items: center; margin: 26px 0; max-width: 340px; }
.auth-chain .stn { border-color: #4E656E; background: transparent; }
.auth-chain .stn.done { background: #6FBFAF; border-color: #6FBFAF; }
.auth-chain .stn.now { border-color: #6FBFAF; box-shadow: 0 0 0 4px rgba(111,191,175,.18); width: 15px; height: 15px; }
.auth-chain .lnk { background: #6FBFAF; margin-top: 0; }
.auth-chain .lnk.dash { background: repeating-linear-gradient(90deg, #4E656E 0 6px, transparent 6px 11px); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px; max-width: 480px; width: 100%; margin: 0 auto; }
.auth-h { margin-bottom: 20px; }
.auth-alt { margin-top: 18px; color: #64757C; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  .side-user { border-top: 0; padding-top: 0; margin-left: auto; }
  .main { padding: 20px 16px 50px; }
  .two-col, .order-form { grid-template-columns: 1fr; }
  .order-form-side { position: static; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 30px; }
  .auth-tag { font-size: 25px; }
}

/* ── Website CMS ── */
.brand-logo { height: 30px; width: auto; max-width: 170px; }
.form-sub { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); }
.mono-area { font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.brand-preview { display: inline-flex; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); margin: 8px 0 6px; max-width: 100%; }
.brand-preview img { max-height: 56px; width: auto; max-width: 260px; }
.brand-preview-dark { background: var(--ink); }
.fav-img { height: 32px !important; }
.serp { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--sheet); }
.serp-url { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 4px; }
.serp-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; }
.serp-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
