/* ── Design tokens ── */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #edf3f7;
  --surface-3: #f9fbfd;
  --ink: #172333;
  --muted: #647287;
  --line: #dbe4ea;
  --teal: #087a78;
  --teal-2: #0b9b92;
  --teal-soft: #dff4f1;
  --emerald: #16845f;
  --emerald-soft: #def4e9;
  --amber: #bb7d0e;
  --amber-soft: #fff1cf;
  --coral: #d75b4c;
  --coral-soft: #ffe2dc;
  --lavender: #705fd4;
  --lavender-soft: #ebe7ff;
  --sky: #2479b8;
  --sky-soft: #e0f0fb;
  --shadow: 0 2px 8px rgba(30,50,70,0.07), 0 12px 32px rgba(30,50,70,0.07);
  --shadow-lg: 0 4px 16px rgba(30,50,70,0.09), 0 24px 56px rgba(30,50,70,0.09);
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar: 272px;
  --topbar: 68px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
svg { display: block; }

/* ── App shell ── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  padding: 20px 16px;
  color: #eaf6f6;
  background: #11202f;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  background: linear-gradient(135deg, var(--teal), var(--lavender));
  border-radius: 9px;
}
.brand strong { display: block; font-size: 13.5px; line-height: 1.2; color: #e8f4f4; }
.brand span:last-child { display: block; margin-top: 2px; color: #7a9bac; font-size: 11.5px; }

.persona-switch { display: grid; gap: 4px; margin-bottom: 8px; }
.side-nav { display: grid; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar-footer { display: grid; gap: 4px; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); }

.persona-button,
.nav-button,
.icon-text-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 32px;
  padding: 5px 10px;
  color: #94afc0;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.15s;
}
.persona-button:hover,
.nav-button:hover,
.icon-text-button:hover {
  color: #e8f4f4;
  background: rgba(255,255,255,0.07);
}
.persona-button.is-active,
.nav-button.is-active {
  color: #fff;
  background: rgba(8,122,120,0.28);
  border-color: rgba(122,222,215,0.22);
}
.persona-button { font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Nav icons (inline SVG via JS) ── */
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.nav-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* ── Workspace ── */
.workspace {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar);
  padding: 0 28px;
  background: rgba(246,248,251,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Views ── */
.view { display: none; }
.view.is-active { display: block; }

/* ── Control grid ── */
.control-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto;
  gap: 20px;
  padding: 24px 28px 40px;
}
.hero-panel    { grid-column: 1 / 2; }
.ai-panel      { grid-column: 2 / 3; grid-row: 1 / 3; }
.portfolio-panel { grid-column: 1 / 2; }
.claims-panel  { grid-column: 1 / 3; }
.finance-panel { grid-column: 1 / 2; }
.activity-panel { grid-column: 2 / 3; }

/* ── Section headings ── */
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-heading h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }

/* ── Eyebrow ── */
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 3px;
}

/* ── Panels ── */
.hero-panel,
.ai-panel,
.module-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

/* ── Segmented control ── */
.segmented-control {
  display: flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.segmented-control button {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.segmented-control button.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(30,50,70,0.1);
}
.segmented-control.compact button { padding: 4px 9px; font-size: 11px; }

/* ── Metric grid ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.metric-tile {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-tile .metric-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.metric-tile .metric-value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-family: 'DM Mono', monospace; }
.metric-tile .metric-delta { font-size: 11px; font-weight: 500; color: var(--muted); }
.metric-tile.tone-success .metric-value { color: var(--emerald); }
.metric-tile.tone-warning .metric-value { color: var(--amber); }
.metric-tile.tone-urgent  .metric-value { color: var(--coral); }
.metric-tile.tone-ai      .metric-value { color: var(--lavender); }
.metric-tile.tone-info    .metric-value { color: var(--sky); }

/* ── Agent list ── */
.agent-list { display: flex; flex-direction: column; gap: 8px; }
.agent-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.agent-card:hover { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(8,122,120,0.07); }
.agent-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-name { font-size: 13px; font-weight: 600; }
.agent-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.agent-note { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tone-urgent .agent-status  { background: var(--coral-soft);   color: var(--coral); }
.tone-warning .agent-status { background: var(--amber-soft);   color: var(--amber); }
.tone-info .agent-status    { background: var(--sky-soft);     color: var(--sky); }
.tone-ai .agent-status      { background: var(--lavender-soft);color: var(--lavender); }

/* ── Status pills ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.status-pill.success { background: var(--emerald-soft); color: var(--emerald); }
.status-pill.warning { background: var(--amber-soft);   color: var(--amber); }
.status-pill.urgent  { background: var(--coral-soft);   color: var(--coral); }
.status-pill.ai      { background: var(--lavender-soft);color: var(--lavender); }
.status-pill.info    { background: var(--sky-soft);     color: var(--sky); }
.status-pill.small   { font-size: 10px; padding: 2px 7px; }
.status-pill.small::before { width: 5px; height: 5px; flex: 0 0 5px; }

/* ── Portfolio layout ── */
.portfolio-layout { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: start; }
.map-board {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.map-cell {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
}
.map-cell:hover { transform: scale(1.15); z-index: 1; }
.map-cell.occupied  { background: var(--teal-soft);   border-color: var(--teal-2); }
.map-cell.at-risk   { background: var(--amber-soft);  border-color: var(--amber); }
.map-cell.open      { background: var(--surface-2);   border-color: var(--line); }
.map-cell.maintenance { background: var(--coral-soft);border-color: var(--coral); }
.map-cell.selected  { box-shadow: 0 0 0 2.5px var(--teal); }
.unit-list { display: flex; flex-direction: column; gap: 6px; }
.unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.unit-row:hover { border-color: var(--teal-2); }
.unit-row.selected { border-color: var(--teal); background: var(--teal-soft); }
.unit-id { font-weight: 700; font-family: 'DM Mono', monospace; font-size: 12px; }
.unit-resident { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-legend { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend-dot.occupied    { background: var(--teal-soft);  border: 1px solid var(--teal-2); }
.legend-dot.at-risk     { background: var(--amber-soft); border: 1px solid var(--amber); }
.legend-dot.open        { background: var(--surface-2);  border: 1px solid var(--line); }
.legend-dot.maintenance { background: var(--coral-soft); border: 1px solid var(--coral); }

/* ── Claims ── */
.claims-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.claims-list { display: flex; flex-direction: column; gap: 6px; }
.claim-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.claim-row:hover { border-color: var(--teal-2); }
.claim-row.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(8,122,120,0.12); }
.claim-bar { width: 6px; height: 36px; border-radius: 3px; flex: 0 0 6px; }
.priority-urgent  .claim-bar { background: var(--coral); }
.priority-warning .claim-bar { background: var(--amber); }
.priority-info    .claim-bar { background: var(--sky); }
.priority-success .claim-bar { background: var(--emerald); }
.claim-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.claim-meta  { font-size: 11.5px; color: var(--muted); }
.claim-sla   { font-size: 11px; font-weight: 600; text-align: right; }
.priority-urgent  .claim-sla { color: var(--coral); }
.priority-warning .claim-sla { color: var(--amber); }
.priority-info    .claim-sla { color: var(--sky); }
.priority-success .claim-sla { color: var(--emerald); }

.claim-detail { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.detail-field { margin-bottom: 14px; }
.detail-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 4px; }
.detail-value { font-size: 13.5px; font-weight: 500; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ── Finance ── */
.chart-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.bar-chart { display: flex; align-items: flex-end; gap: 7px; height: 80px; padding: 0 4px; }
.bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.bar-col {
  width: 100%;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, var(--teal-2), var(--teal-soft));
  min-height: 4px;
  transition: height 0.4s ease;
}
.bar-col.low { background: linear-gradient(180deg, var(--amber), var(--amber-soft)); }
.bar-label { font-size: 10px; color: var(--muted); font-weight: 500; }
.finance-list { display: flex; flex-direction: column; gap: 6px; }
.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  transition: border-color 0.15s;
}
.finance-row:hover { border-color: var(--teal-2); background: var(--teal-soft); }
.finance-row-label { font-weight: 500; color: var(--ink); }
.finance-row-amount { font-weight: 700; font-family: 'DM Mono', monospace; }
.finance-row-amount.at-risk { color: var(--coral); }
.finance-row-amount.good    { color: var(--emerald); }

/* ── Activity ── */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  transition: border-color 0.15s;
}
.activity-item:hover { border-color: var(--lavender); background: var(--lavender-soft); }
.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lavender);
  flex: 0 0 7px;
  margin-top: 5px;
}

/* ── Buttons ── */
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.primary-button:hover { background: var(--teal-2); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}
.ghost-button:hover { color: var(--ink); border-color: var(--teal-2); background: var(--teal-soft); }
.ghost-button.small { padding: 5px 10px; font-size: 11.5px; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: all 0.15s;
}
.icon-button:hover { color: var(--ink); border-color: var(--teal-2); background: var(--teal-soft); }

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(8,122,120,0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.action-button:hover { background: var(--teal-2); color: #fff; }

/* ── Resident portal ── */
.resident-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px 28px 40px;
}
.resident-hero {
  grid-column: 1 / 3;
  background: linear-gradient(135deg, #11202f 0%, #0f3040 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.resident-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.resident-hero .eyebrow { color: rgba(255,255,255,0.5); }
.resident-hero h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 6px 0 8px; }
.resident-meta { font-size: 13px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resident-meta strong { color: #fff; }
.resident-hero .primary-button { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); backdrop-filter: blur(8px); flex-shrink: 0; }
.resident-hero .primary-button:hover { background: rgba(255,255,255,0.25); }

.quick-actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.quick-action-btn:hover { background: rgba(255,255,255,0.15); color: #fff; transform: translateY(-1px); }
.quick-action-btn .nav-icon { width: 20px; height: 20px; }
.quick-action-btn .nav-icon svg { width: 20px; height: 20px; }
.qa-label { font-size: 11px; font-weight: 600; line-height: 1.2; }
.qa-detail { font-size: 10px; color: rgba(255,255,255,0.5); line-height: 1.2; }

/* ── Request timeline ── */
.request-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 14px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-left { display: flex; flex-direction: column; align-items: center; }
.timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  font-size: 10px;
  font-weight: 700;
}
.timeline-icon.done  { background: var(--teal-soft);    border-color: var(--teal); color: var(--teal); }
.timeline-icon.pending { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.timeline-icon.next  { background: var(--sky-soft);     border-color: var(--sky);  color: var(--sky); }
.timeline-line { width: 2px; flex: 1; background: var(--line); margin: 2px 0; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content { padding-top: 3px; }
.timeline-label { font-size: 13px; font-weight: 600; }
.timeline-time  { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ── Payments ── */
.payment-list { display: flex; flex-direction: column; gap: 6px; }
.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  gap: 8px;
}
.payment-left { display: flex; flex-direction: column; gap: 2px; }
.payment-label  { font-size: 13px; font-weight: 600; }
.payment-date   { font-size: 11.5px; color: var(--muted); }
.payment-right  { display: flex; align-items: center; gap: 10px; }
.payment-amount { font-size: 14px; font-weight: 700; font-family: 'DM Mono', monospace; }
.payment-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.payment-status.paid    { background: var(--emerald-soft); color: var(--emerald); }
.payment-status.pending { background: var(--amber-soft);   color: var(--amber); }

/* ── Community chat ── */
.resident-chat-panel { display: flex; flex-direction: column; }
.chat-thread { flex: 1; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; max-height: 220px; overflow-y: auto; }
.chat-bubble { display: flex; flex-direction: column; gap: 3px; }
.chat-bubble.mine { align-items: flex-end; }
.chat-author { font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.chat-text {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.chat-bubble:not(.mine) .chat-text { background: var(--surface-2); border: 1px solid var(--line); }
.chat-bubble.mine .chat-text { background: var(--teal-soft); border: 1px solid rgba(8,122,120,0.2); }
.chat-compose { display: flex; gap: 8px; align-items: center; }
.chat-input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--teal-2); background: var(--surface); }
.send-button {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  flex: 0 0 38px;
}
.send-button:hover { background: var(--teal-2); }
.send-button .nav-icon svg { stroke: #fff; }

/* ── Amenities ── */
.amenity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.amenity-card {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.amenity-card:hover { border-color: var(--teal-2); background: var(--teal-soft); }
.amenity-card.booked { border-color: var(--teal); background: var(--teal-soft); }
.amenity-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.amenity-hours { font-size: 11.5px; color: var(--muted); }
.amenity-action { font-size: 11.5px; font-weight: 600; color: var(--teal); margin-top: 8px; }

/* ── Documents ── */
.document-list { display: flex; flex-direction: column; gap: 6px; }
.document-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.document-row:hover { border-color: var(--teal-2); }
.document-icon { color: var(--sky); flex: 0 0 16px; }
.document-name { font-size: 13px; font-weight: 500; flex: 1; }
.document-date { font-size: 11px; color: var(--muted); }

/* ── Drawer ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,30,0.45);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer-overlay.is-open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -4px 0 32px rgba(10,20,30,0.14);
  z-index: 90;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0, 0.15, 1);
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-header h3 { font-size: 16px; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── Drawer: claim form ── */
.draft-section { margin-bottom: 20px; }
.draft-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.draft-options { display: flex; flex-wrap: wrap; gap: 6px; }
.draft-option {
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.draft-option:hover { border-color: var(--teal-2); color: var(--ink); }
.draft-option.selected { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); font-weight: 600; }
.draft-summary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
}
.draft-summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.draft-summary-row:last-child { border-bottom: none; }
.draft-summary-row span:first-child { color: var(--muted); }
.draft-summary-row span:last-child { font-weight: 600; }
.drawer-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.drawer-submit:hover { background: var(--teal-2); }

/* ── Drawer: vision ── */
.vision-section { margin-bottom: 20px; }
.vision-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.vision-section p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.vision-tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vision-tag { padding: 4px 10px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #11202f;
  color: #fff;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  :root { --sidebar: 220px; }
  .control-grid { grid-template-columns: 1fr; padding: 16px; }
  .ai-panel { grid-column: 1; grid-row: auto; }
  .claims-panel { grid-column: 1; }
  .finance-panel { grid-column: 1; }
  .activity-panel { grid-column: 1; }
  .resident-grid { grid-template-columns: 1fr; padding: 16px; }
  .resident-hero { grid-column: 1; }
  .portfolio-layout { grid-template-columns: 1fr; }
  .chart-card { grid-template-columns: 1fr; }
  .claims-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 16px; }
  .control-grid, .resident-grid { padding: 12px; gap: 12px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100%; }
}
