/* =========================================================
   Akker Portfolio — shared design system
   Demo data only. Tokens live at the top — swap these first
   when the real design pass happens.
   ========================================================= */

:root{
  --bg:#FAF9F5;
  --surface:#FFFFFF;
  --surface-raised:#F2EFE8;
  --ink:#1B1815;
  --ink-soft:#6B6459;
  --ink-faint:#9A9285;
  --border:#E6E1D6;
  --gold:#B6862F;
  --gold-deep:#8F6A24;
  --gold-soft:#EFE2C4;
  --success:#4C6E50;
  --success-soft:#E3EAE0;
  --danger:#9C4B3E;
  --danger-soft:#F3E2DE;
  --watch:#A1762E;
  --watch-soft:#F1E6CC;
  --info:#3F5E73;
  --info-soft:#E2E9ED;
  --shadow-1: 0 1px 2px rgba(27,24,21,0.04), 0 1px 1px rgba(27,24,21,0.03);
  --shadow-2: 0 8px 24px -8px rgba(27,24,21,0.10), 0 2px 6px -2px rgba(27,24,21,0.06);
  --radius: 14px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}

body::before{
  content:"";
  position:fixed; inset:0; pointer-events:none; z-index:9999;
  opacity:0.025;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer;}
table{border-collapse:collapse; width:100%;}

.shell{ display:grid; grid-template-columns:264px 1fr; min-height:100vh; }

/* ---------- SIDEBAR ---------- */
.sidebar{
  background:var(--surface); border-right:1px solid var(--border);
  padding:32px 24px; display:flex; flex-direction:column; gap:36px;
  position:sticky; top:0; height:100vh;
}
.brand{ display:flex; flex-direction:column; gap:2px; }
.brand .mark{ font-family:'Cormorant Garamond', serif; font-size:24px; font-weight:600; }
.brand .mark span{ color:var(--gold-deep); font-style:italic; }
.brand .sub{ font-size:10.5px; letter-spacing:0.18em; text-transform:uppercase; color:var(--ink-faint); }

nav.primary{display:flex; flex-direction:column; gap:2px;}
.nav-label{ font-size:10.5px; letter-spacing:0.16em; text-transform:uppercase; color:var(--ink-faint); margin:18px 0 8px 12px; }
.nav-item{
  display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:10px;
  font-size:14px; font-weight:500; color:var(--ink-soft);
  transition:background .18s ease, color .18s ease;
}
.nav-item svg{ width:17px; height:17px; flex-shrink:0; opacity:0.85; }
.nav-item:hover{ background:var(--surface-raised); color:var(--ink); }
.nav-item.active{ background:linear-gradient(180deg, var(--gold-soft), #F7EFDA); color:var(--gold-deep); font-weight:600; }
.nav-item.active svg{ opacity:1; }

.sidebar-foot{ margin-top:auto; border-top:1px solid var(--border); padding-top:18px; display:flex; align-items:center; gap:10px; }
.avatar{
  width:36px; height:36px; border-radius:50%; background:var(--ink); color:#F2EAD8;
  display:flex; align-items:center; justify-content:center; font-family:'Cormorant Garamond', serif; font-size:15px; font-weight:600;
}
.sidebar-foot .who{ font-size:13px; font-weight:600; line-height:1.2; }
.sidebar-foot .role{ font-size:11.5px; color:var(--ink-faint); }

/* ---------- MAIN / TOPBAR ---------- */
main{ padding:36px 44px 64px; max-width:1280px; }
.topbar{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:32px; flex-wrap:wrap; gap:16px; }
.topbar h1{ font-family:'Cormorant Garamond', serif; font-weight:500; font-size:clamp(26px, 3vw, 34px); margin:0 0 4px; }
.topbar .date{ font-size:13px; color:var(--ink-faint); }
.advisor-pill{ display:flex; align-items:center; gap:10px; background:var(--surface); border:1px solid var(--border); border-radius:100px; padding:8px 16px 8px 8px; box-shadow:var(--shadow-1); }
.advisor-pill .dot{ width:8px; height:8px; border-radius:50%; background:var(--success); }
.advisor-pill .txt{ font-size:12.5px; }
.advisor-pill .txt b{ font-weight:600; }
.advisor-pill button{ border:none; background:var(--ink); color:#F4ECDA; font-size:12px; font-weight:600; padding:7px 13px; border-radius:100px; }

.breadcrumb{ font-size:12px; color:var(--ink-faint); margin-bottom:10px; }
.breadcrumb a{ color:var(--gold-deep); font-weight:600; }

/* ---------- CARDS / KPI ---------- */
.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-1); padding:22px;
  opacity:0; transform:translateY(8px); animation:rise .55s ease forwards;
}
@keyframes rise{ to{ opacity:1; transform:translateY(0); } }

.kpi-row{ display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr 1fr; gap:16px; margin-bottom:28px; }
.kpi-label{ font-size:11px; letter-spacing:0.12em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:10px; }
.kpi-value{ font-family:'IBM Plex Mono', monospace; font-size:26px; font-weight:500; letter-spacing:-0.01em; }
.kpi-main .kpi-value{ font-family:'Cormorant Garamond', serif; font-size:38px; font-weight:600; }
.kpi-badge{ display:inline-flex; align-items:center; gap:5px; font-family:'IBM Plex Mono', monospace; font-size:12.5px; font-weight:500; color:var(--success); background:var(--success-soft); padding:3px 9px; border-radius:100px; margin-top:10px; }
.kpi-badge.neg{ color:var(--danger); background:var(--danger-soft); }
.kpi-sub{ font-size:12px; color:var(--ink-faint); margin-top:8px; }

/* ---------- PANELS / CHARTS ---------- */
.panel-row{ display:grid; grid-template-columns:1.55fr 1fr; gap:20px; margin-bottom:24px; align-items:start; }
.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-1); padding:26px 26px 18px; }
section.panel{ margin-bottom:20px; }
.panel + .panel{ margin-top:0; }
.panel-head{ display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:18px; gap:12px; flex-wrap:wrap; }
.panel-title{ font-family:'Cormorant Garamond', serif; font-size:21px; font-weight:600; }
.panel-title small{ display:block; font-family:'Plus Jakarta Sans'; font-size:12px; color:var(--ink-faint); font-weight:500; margin-top:2px; }

.range-toggle{ display:flex; background:var(--surface-raised); border-radius:100px; padding:3px; gap:2px; }
.range-toggle button{ border:none; background:transparent; font-size:12px; font-weight:600; padding:6px 13px; border-radius:100px; color:var(--ink-faint); transition:background .15s, color .15s; }
.range-toggle button.active{ background:var(--ink); color:#F4ECDA; }
.chart-wrap{ height:230px; }
.chart-wrap.tall{ height:300px; }
.chart-wrap.short{ height:170px; }

/* ---------- INSIGHTS ---------- */
.insight-card{ border-left:3px solid var(--gold); background:var(--surface-raised); border-radius:10px; padding:13px 15px; margin-bottom:10px; }
.insight-card.attention{ border-left-color:var(--danger); }
.insight-card.opportunity{ border-left-color:var(--info); }
.insight-card p{ margin:0; font-size:13px; line-height:1.5; color:var(--ink); }
.insight-card .tag{ font-size:10px; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-faint); display:block; margin-bottom:5px; font-weight:600; }
.insight-card .meta{ font-size:11px; color:var(--ink-faint); margin-top:6px; }

/* ---------- RECOMMENDATIONS ---------- */
.reco-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.reco-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-1); padding:18px; border-top:3px solid var(--gold); }
.reco-card.sell{ border-top-color:var(--danger); }
.reco-card.hold{ border-top-color:var(--success); }
.reco-card.refinance{ border-top-color:var(--info); }
.reco-card .kind{ font-size:10px; letter-spacing:0.12em; text-transform:uppercase; color:var(--ink-faint); font-weight:700; margin-bottom:6px; }
.reco-card h3{ font-family:'Cormorant Garamond', serif; font-size:18px; margin:0 0 8px; }
.reco-card p{ font-size:12.5px; color:var(--ink-soft); line-height:1.5; margin:0; }

/* ---------- SECTIONS ---------- */
.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin:8px 0 16px; flex-wrap:wrap; gap:8px; }
.section-head h2{ font-family:'Cormorant Garamond', serif; font-size:22px; font-weight:600; margin:0; }
.section-head a, .section-head .link{ font-size:12.5px; font-weight:600; color:var(--gold-deep); border-bottom:1px solid var(--gold-soft); padding-bottom:2px; }

/* ---------- PROPERTY CARDS ---------- */
.property-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-bottom:32px; }
.property-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-1); overflow:hidden; transition:box-shadow .2s ease, transform .2s ease; opacity:0; transform:translateY(8px); animation:rise .55s ease forwards; }
.property-card:hover{ box-shadow:var(--shadow-2); transform:translateY(-2px); }
.property-thumb{ height:120px; position:relative; overflow:hidden; background:linear-gradient(135deg, #2B2722, #423B30); }
.property-thumb svg{ position:absolute; inset:0; width:100%; height:100%; opacity:0.5; }
.status-chip{ position:absolute; top:10px; right:10px; font-size:10px; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; padding:4px 9px; border-radius:100px; }
.status-chip.excellent{ background:var(--success-soft); color:var(--success); }
.status-chip.monitor{ background:var(--watch-soft); color:var(--watch); }
.status-chip.action{ background:var(--danger-soft); color:var(--danger); }
.property-body{ padding:16px 16px 18px; }
.property-body .name{ font-weight:700; font-size:14.5px; margin-bottom:2px; }
.property-body .addr{ font-size:12px; color:var(--ink-faint); margin-bottom:14px; }
.pstat-row{ display:flex; justify-content:space-between; font-size:12px; padding:7px 0; border-top:1px dashed var(--border); }
.pstat-row .k{ color:var(--ink-faint); }
.pstat-row .v{ font-family:'IBM Plex Mono', monospace; font-weight:500; }
.pstat-row .v.pos{ color:var(--success); }
.pstat-row .v.neg{ color:var(--danger); }
.card-cta{ display:block; text-align:center; margin-top:12px; padding:9px; border-radius:8px; background:var(--surface-raised); font-size:12.5px; font-weight:600; color:var(--ink); }
.card-cta:hover{ background:var(--gold-soft); color:var(--gold-deep); }

/* ---------- PROPERTY DETAIL ---------- */
.hero{ border-radius:var(--radius); height:220px; background:linear-gradient(135deg,#2B2722,#4A4030); position:relative; overflow:hidden; margin-bottom:22px; display:flex; align-items:flex-end; }
.hero svg{ position:absolute; inset:0; width:100%; height:100%; opacity:0.45; }
.hero-info{ position:relative; z-index:2; padding:22px 26px; color:#F4ECDA; width:100%; }
.hero-info .name{ font-family:'Cormorant Garamond', serif; font-size:28px; font-weight:600; }
.hero-info .addr{ font-size:13px; opacity:0.85; margin-top:2px; }
.hero-stats{ display:flex; gap:32px; margin-top:18px; flex-wrap:wrap; }
.hero-stats .k{ display:block; font-size:10px; letter-spacing:0.1em; text-transform:uppercase; opacity:0.7; margin-bottom:4px; }
.hero-stats .v{ display:block; font-family:'IBM Plex Mono', monospace; font-size:17px; font-weight:600; }
.hero-stats .v.pos{ color:#D9C98A; }

.tabbar{ display:flex; gap:6px; border-bottom:1px solid var(--border); margin-bottom:22px; }
.tabbar button{ border:none; background:none; padding:10px 4px; font-size:13.5px; font-weight:600; color:var(--ink-faint); border-bottom:2px solid transparent; margin-right:18px; }
.tabbar button.active{ color:var(--gold-deep); border-bottom-color:var(--gold); }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

.fact-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:24px; }
.fact{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:16px; }
.fact .k{ font-size:10.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:8px; }
.fact .v{ font-family:'IBM Plex Mono', monospace; font-size:18px; font-weight:600; }
.fact .v.pos{ color:var(--success); }
.fact .v.neg{ color:var(--danger); }

/* ---------- TABLES ---------- */
.data-table{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-1); }
.data-table thead th{ text-align:left; font-size:10.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-faint); background:var(--surface-raised); padding:12px 16px; font-weight:700; }
.data-table tbody td{ padding:13px 16px; font-size:13px; border-top:1px solid var(--border); }
.data-table tbody tr:hover{ background:#FBF9F3; }
.data-table .mono{ font-family:'IBM Plex Mono', monospace; }
.data-table .pos{ color:var(--success); font-weight:600; }
.data-table .neg{ color:var(--danger); font-weight:600; }

.pill{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:700; padding:4px 10px; border-radius:100px; letter-spacing:0.02em; }
.pill.pending{ background:var(--watch-soft); color:var(--watch); }
.pill.progress{ background:var(--info-soft); color:var(--info); }
.pill.done{ background:var(--success-soft); color:var(--success); }
.pill.review{ background:var(--gold-soft); color:var(--gold-deep); }

.doc-row{ display:flex; align-items:center; gap:14px; padding:14px 16px; border-top:1px solid var(--border); }
.doc-row:first-child{ border-top:none; }
.doc-icon{ width:36px; height:36px; border-radius:9px; background:var(--surface-raised); display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:9.5px; font-weight:700; letter-spacing:0.04em; color:var(--gold-deep); }
.doc-icon svg{ width:17px; height:17px; color:var(--gold-deep); }
.doc-meta{ flex:1; }
.doc-meta .title{ font-size:13.5px; font-weight:600; }
.doc-meta .sub{ font-size:11.5px; color:var(--ink-faint); }
.doc-dl{ margin-left:auto; font-size:12px; font-weight:600; color:var(--gold-deep); background:none; border:1px solid var(--gold-soft); padding:6px 12px; border-radius:100px; flex-shrink:0; }
.doc-dl:hover{ background:var(--gold-soft); }

.muted-note{ font-size:12px; color:var(--ink-faint); margin:14px 0 0; line-height:1.5; }

/* ---------- ACTION CENTRE ---------- */
.tile-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:32px; }
.tile{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-1); padding:20px; cursor:pointer; transition:box-shadow .2s, transform .2s; }
.tile:hover{ box-shadow:var(--shadow-2); transform:translateY(-2px); border-color:var(--gold-soft); }
.tile-icon{ width:38px; height:38px; border-radius:10px; background:var(--gold-soft); display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.tile-icon svg{ width:19px; height:19px; color:var(--gold-deep); }
.tile h3{ font-size:14.5px; margin:0 0 4px; font-weight:700; }
.tile p{ font-size:12px; color:var(--ink-faint); margin:0; line-height:1.5; }

/* ---------- PROFILE ---------- */
.profile-grid{ display:grid; grid-template-columns:1fr 1.4fr; gap:20px; align-items:start; }
.stat-list{ display:flex; flex-direction:column; }
.stat-row{ display:flex; justify-content:space-between; padding:13px 0; border-top:1px dashed var(--border); font-size:13.5px; }
.stat-row:first-child{ border-top:none; }
.stat-row .k{ color:var(--ink-faint); }
.stat-row .v{ font-weight:600; }

.health-wrap{ display:flex; align-items:center; gap:22px; }
.health-ring{ width:108px; height:108px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; position:relative; }
.health-ring .num{ font-family:'Cormorant Garamond', serif; font-size:30px; font-weight:700; }
.health-ring .lbl{ position:absolute; bottom:-18px; font-size:10px; letter-spacing:0.1em; text-transform:uppercase; color:var(--ink-faint); white-space:nowrap; }

footer.note{ margin-top:40px; padding-top:18px; border-top:1px solid var(--border); font-size:11.5px; color:var(--ink-faint); display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; }

*:focus-visible{ outline:2px solid var(--gold-deep); outline-offset:2px; border-radius:6px; }

/* stagger helpers */
.kpi-row .card:nth-child(1){animation-delay:.02s;} .kpi-row .card:nth-child(2){animation-delay:.08s;}
.kpi-row .card:nth-child(3){animation-delay:.14s;} .kpi-row .card:nth-child(4){animation-delay:.20s;}
.kpi-row .card:nth-child(5){animation-delay:.26s;}
.property-grid .property-card:nth-child(1){animation-delay:.10s;} .property-grid .property-card:nth-child(2){animation-delay:.18s;}
.property-grid .property-card:nth-child(3){animation-delay:.26s;} .property-grid .property-card:nth-child(4){animation-delay:.34s;}
.property-grid .property-card:nth-child(5){animation-delay:.42s;} .property-grid .property-card:nth-child(6){animation-delay:.50s;}
.property-grid .property-card:nth-child(7){animation-delay:.58s;}

@media (max-width:1100px){
  .kpi-row{ grid-template-columns:repeat(2,1fr); }
  .kpi-main{ grid-column:1 / -1; }
  .panel-row{ grid-template-columns:1fr; }
  .property-grid{ grid-template-columns:repeat(2,1fr); }
  .tile-grid{ grid-template-columns:repeat(2,1fr); }
  .reco-grid{ grid-template-columns:repeat(2,1fr); }
  .fact-grid{ grid-template-columns:repeat(2,1fr); }
  .profile-grid{ grid-template-columns:1fr; }
}
@media (max-width:780px){
  .shell{ grid-template-columns:1fr; }
  .sidebar{ position:relative; height:auto; flex-direction:row; align-items:center; padding:16px 18px; gap:0; overflow-x:auto; }
  .sidebar-foot{ display:none; }
  nav.primary{ flex-direction:row; gap:4px; }
  .nav-label{ display:none; }
  .nav-item span{ display:none; }
  .brand{ margin-right:18px; flex-shrink:0; }
  main{ padding:24px 18px 48px; }
  .kpi-row, .property-grid, .tile-grid, .reco-grid, .fact-grid{ grid-template-columns:1fr; }
}
