@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ===== DESIGN TOKENS ===== */
:root {
  --bg: #F6F5F1;
  --surface: #FBFAF7;
  --surface-2: #FFFFFF;
  --ink: #0E0E10;
  --ink-2: #2C2C31;
  --muted: #7A7A82;
  --muted-2: #A3A3AA;
  --line: #EAE7DD;
  --line-2: #F1EEE5;
  --accent: #3E5641;
  --accent-2: #5A7A5D;
  --gold: #B8935A;
  --rust: #B04E2D;
  --plum: #6B4E71;
  --success: #3E7C4D;
  --danger: #B04E2D;
  --warn: #B8935A;
  --shadow-sm: 0 1px 2px rgba(20,20,25,.02);
  --shadow-md: 0 1px 2px rgba(20,20,25,.03), 0 12px 32px -18px rgba(20,20,25,.12);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.08), 0 20px 60px -20px rgba(0,0,0,.15);
  --ease-out: cubic-bezier(.4, 0, .2, 1);
  --ease-in-out: cubic-bezier(.4, 0, .6, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 350ms;
}

/* ===== RESETS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: 'Geist', sans-serif; font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }

/* ===== TYPOGRAPHY ===== */
.mono { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.serif { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -.01em; }
.num { font-family: 'Geist Mono', monospace; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ===== LAYOUT ===== */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }
.side { width: 236px; position: sticky; top: 0; height: 100vh; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 28px 32px 40px; flex: 1; }

/* ===== SIDEBAR ===== */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #0E0E10, #3E5641); display: grid; place-items: center; color: #FBFAF7; font-family: 'Instrument Serif', serif; font-size: 19px; }
.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.workspace { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); margin-bottom: 14px; cursor: pointer; }
.ws-icon { width: 22px; height: 22px; border-radius: 6px; background: #EFE9DC; display: grid; place-items: center; font-size: 10.5px; color: var(--accent); font-weight: 600; }
.ws-text { flex: 1; font-size: 12.5px; font-weight: 500; }
.ws-role { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.section { margin: 12px 0 4px; padding: 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13px; font-weight: 450; cursor: pointer; margin-bottom: 1px; position: relative; transition: background var(--duration-fast) var(--ease-out); }
.nav-item:hover { background: #F1EEE5; }
.nav-item.active { background: var(--ink); color: #FBFAF7; }
.nav-item .ico, .nav-item .i { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: .9; }
.nav-item.active .ico, .nav-item.active .i { opacity: 1; }
.nav-item .badge { margin-left: auto; font-size: 10.5px; color: var(--muted); font-family: 'Geist Mono', monospace; }
.nav-item.active .badge { color: #FBFAF7; opacity: .7; }
.nav-item .pulse { margin-left: auto; width: 6px; height: 6px; background: var(--rust); border-radius: 50%; box-shadow: 0 0 0 3px rgba(176,78,45,.15); }
.side-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }

/* ===== TOPBAR ===== */
.topbar { height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(246,245,241,.85); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.crumbs .cur { color: var(--ink); font-weight: 500; }
.crumbs .sep { color: var(--muted-2); }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); padding: 0 14px 0 40px; font: inherit; font-size: 13px; color: var(--ink); outline: none; }
.search input::placeholder { color: var(--muted-2); }
.search .i, .search .i-lg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: 'Geist Mono', monospace; font-size: 10.5px; color: var(--muted); background: var(--bg); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); }

/* ===== BUTTONS ===== */
.icon-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative; transition: background var(--duration-fast) var(--ease-out); }
.icon-btn:hover { background: #F1EEE5; }
.icon-btn .n-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--rust); border-radius: 50%; border: 1.5px solid var(--surface-2); }
.btn { height: 38px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; white-space: nowrap; transition: background var(--duration-fast) var(--ease-out), transform 60ms, box-shadow var(--duration-fast); }
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: #FBFAF7; }
.btn-ink:hover { background: #2C2C31; }
.btn-outline { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: #F1EEE5; }
.btn-ghost { background: transparent; color: var(--ink-2); border: none; }
.btn-ghost:hover { background: #F1EEE5; }

/* ===== ICONS ===== */
.i { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-lg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ===== HERO ===== */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-family: 'Geist Mono', monospace; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.eyebrow .live { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 3px rgba(62,124,77,.18); }
.hero h1 { font-family: 'Instrument Serif', serif; font-size: 44px; line-height: 1.05; letter-spacing: -.015em; color: var(--ink); margin-bottom: 8px; font-weight: 400; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .desc { font-size: 13.5px; color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; gap: 8px; align-items: center; }
.range-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.range-pill .caret { color: var(--muted); }

/* ===== KPI RIBBON ===== */
.ribbon { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 4px; box-shadow: var(--shadow-md); margin-bottom: 22px; display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; }
.rib { padding: 20px 22px; border-right: 1px solid var(--line-2); position: relative; }
.rib:last-child { border-right: none; }
.rib-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: 'Geist Mono', monospace; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.rib-label .icn { width: 26px; height: 26px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); }
.rib-val { font-family: 'Instrument Serif', serif; font-size: 38px; line-height: 1; letter-spacing: -.02em; color: var(--ink); font-weight: 400; display: flex; align-items: baseline; gap: 6px; }
.rib-val .of { font-family: 'Geist', sans-serif; font-size: 14px; color: var(--muted-2); font-weight: 400; }
.rib-delta { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.chip-delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-family: 'Geist Mono', monospace; font-size: 11px; font-weight: 500; }
.chip-delta.up { background: rgba(62,124,77,.09); color: var(--success); }
.chip-delta.dn { background: rgba(176,78,45,.09); color: var(--rust); }
.chip-delta.warn { background: rgba(184,147,90,.12); color: var(--gold); }
.spark { margin-top: 12px; height: 26px; width: 100%; }

/* ===== GRID ===== */
.grid { display: grid; gap: 18px; margin-bottom: 20px; }
.grid.a { grid-template-columns: 1.5fr 1fr; }
.grid.b { grid-template-columns: 1fr 1fr 1fr; }

/* ===== CARDS ===== */
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); transition: box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out); }
.card:hover { }
.card.raised { box-shadow: var(--shadow-md); }
.card-hd { padding: 18px 22px 14px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line-2); }
.card-hd h3 { font-family: 'Instrument Serif', serif; font-size: 22px; font-weight: 400; letter-spacing: -.01em; line-height: 1.15; }
.card-hd .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-bd { padding: 20px 22px; }

/* ===== DONUT ===== */
.bucket-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.donut { position: relative; }
.donut svg { transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center .num { font-family: 'Instrument Serif', serif; font-size: 44px; line-height: 1; letter-spacing: -.02em; }
.donut-center .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; font-family: 'Geist Mono', monospace; }
.blist { display: flex; flex-direction: column; gap: 2px; }
.brow { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line-2); }
.brow:last-child { border-bottom: none; }
.bdot { width: 10px; height: 10px; border-radius: 3px; }
.bname { font-size: 13px; font-weight: 500; }
.bsub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.bpct { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--muted); width: 40px; text-align: right; }
.bcount { font-family: 'Instrument Serif', serif; font-size: 22px; letter-spacing: -.01em; width: 38px; text-align: right; }

/* ===== FEED ===== */
.feed { padding: 8px 0; }
.feed-item { display: flex; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--line-2); align-items: flex-start; cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.feed-item:hover { background: #FBF9F2; }
.feed-item:last-child { border-bottom: none; }
.f-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.f-icon.rust { background: rgba(176,78,45,.09); color: var(--rust); }
.f-icon.gold { background: rgba(184,147,90,.14); color: var(--gold); }
.f-icon.plum { background: rgba(107,78,113,.11); color: var(--plum); }
.f-icon.green { background: rgba(62,124,77,.1); color: var(--success); }
.f-body { flex: 1; min-width: 0; }
.f-title { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.f-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.f-meta .dot-sep { width: 3px; height: 3px; background: var(--muted-2); border-radius: 50%; }
.f-arrow { color: var(--muted-2); align-self: center; }

/* ===== PIPELINE ===== */
.stages { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; position: relative; }
.stage { padding: 18px 16px 16px; position: relative; border-right: 1px solid var(--line-2); }
.stage:last-child { border-right: none; }
.stage-name { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: 'Geist Mono', monospace; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.stage-name .swatch { width: 8px; height: 8px; border-radius: 2px; }
.stage-num { font-family: 'Instrument Serif', serif; font-size: 34px; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.stage-meta { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.stage-bar { height: 3px; border-radius: 2px; margin-top: 14px; background: var(--line-2); overflow: hidden; }
.stage-bar > div { height: 100%; border-radius: 2px; }
.stage.warn .stage-meta { color: var(--rust); }

/* ===== TABLE ===== */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 22px; border-bottom: 1px solid var(--line); font-family: 'Geist Mono', monospace; }
.tbl td { padding: 16px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #FBF9F2; }

/* ===== PERSON ===== */
.person { display: flex; align-items: center; gap: 11px; }
.avat, .avatar { border-radius: 50%; color: #FBFAF7; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; letter-spacing: .01em; }
.avat { width: 32px; height: 32px; font-size: 11.5px; }
.avatar { width: 30px; height: 30px; font-size: 11px; background: linear-gradient(135deg, #3E5641, #B8935A); }
.pname { font-weight: 500; font-size: 13.5px; letter-spacing: -.005em; }
.pmail { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ===== COMMIT ===== */
.commit-cell { display: flex; align-items: center; gap: 10px; }
.commit-track { width: 88px; height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.commit-track > div { height: 100%; border-radius: 3px; }

/* ===== PILLS ===== */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid transparent; }
.pill.ok { background: rgba(62,124,77,.08); color: var(--success); border-color: rgba(62,124,77,.15); }
.pill.warn { background: rgba(184,147,90,.11); color: var(--gold); border-color: rgba(184,147,90,.2); }
.pill.risk { background: rgba(176,78,45,.09); color: var(--rust); border-color: rgba(176,78,45,.18); }
.pill.mute { background: var(--bg); color: var(--muted); border-color: var(--line); }

/* ===== LINKS ===== */
.link { color: var(--ink); font-size: 12.5px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; transition: border-color var(--duration-fast); }
.link:hover { border-color: var(--ink); }

/* ===== MINI STATS ===== */
.mini-stat { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.mini-stat:last-child { border-bottom: none; }
.ms-lbl { font-size: 12.5px; color: var(--ink-2); }
.ms-val { font-family: 'Instrument Serif', serif; font-size: 24px; letter-spacing: -.01em; }
.ms-val.g { color: var(--success); }
.ms-val.r { color: var(--rust); }
.ms-sub { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--muted); margin-left: 6px; }

/* ===== HUDDLE CARD ===== */
.huddle { position: relative; background: linear-gradient(155deg, #0E0E10 0%, #1E2620 55%, #3E5641 100%); color: #FBFAF7; border-radius: 16px; padding: 22px; overflow: hidden; }
.huddle::before { content: ""; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(184,147,90,.35), transparent 60%); border-radius: 50%; }
.huddle .eyebrow-2 { font-family: 'Geist Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(251,250,247,.6); margin-bottom: 10px; }
.huddle h4 { font-family: 'Instrument Serif', serif; font-size: 26px; line-height: 1.15; font-weight: 400; letter-spacing: -.01em; margin-bottom: 8px; }
.huddle p { font-size: 12.5px; color: rgba(251,250,247,.72); line-height: 1.55; max-width: 280px; margin-bottom: 18px; }
.huddle .actions { display: flex; gap: 8px; position: relative; z-index: 2; }
.h-btn { height: 36px; padding: 0 14px; border-radius: 9px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; transition: background var(--duration-fast), transform 60ms; }
.h-btn:active { transform: scale(.97); }
.h-btn.primary { background: #FBFAF7; color: var(--ink); }
.h-btn.ghost { background: rgba(251,250,247,.08); color: #FBFAF7; border-color: rgba(251,250,247,.18); }
.h-meta { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(251,250,247,.12); display: flex; gap: 16px; font-size: 11px; color: rgba(251,250,247,.55); font-family: 'Geist Mono', monospace; }

/* ===== FOOTER ===== */
.foot { padding: 24px 32px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

.animate-in { animation: slideUp var(--duration-slow) var(--ease-out) both; }
.transition-all { transition: all var(--duration-normal) var(--ease-out); }
.transition-opacity { transition: opacity var(--duration-normal) var(--ease-out); }
.transition-transform { transition: transform var(--duration-normal) var(--ease-out); }
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* Card hover lift */
.company-card:hover, .opp-card:hover, .shortcut-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
