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

:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --ink: #14140F;
  --ink-2: #3A3A32;
  --muted: #85857A;
  --line: #E8E6DE;
  --line-soft: #EFEDE5;
  --accent: #2B4536;
  --accent-soft: #E8EDE7;
  --amber: #B4732A;
  --amber-soft: #F5EBD9;
  --rose: #A6412F;
  --rose-soft: #F3DFDA;
  --lilac: #6A5CB7;
  --lilac-soft: #E9E6F5;

  --font-serif: 'Instrument Serif', serif;
  --font-sans: 'Geist', sans-serif;
  --font-mono: 'Geist Mono', monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  --shadow-card: 0 1px 0 rgba(20,20,15,0.02), 0 20px 40px -20px rgba(20,20,15,0.06);
  --shadow-dropdown: 0 8px 24px -4px rgba(20,20,15,0.12), 0 2px 6px -1px rgba(20,20,15,0.06);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); font-size: 13.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--bg); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; padding: 20px 14px; border-right: 1px solid var(--line-soft); z-index: 30; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { padding: 18px 32px; display: flex; align-items: center; gap: 20px; position: sticky; top: 0; background: rgba(246,245,241,0.85); backdrop-filter: blur(20px); z-index: 20; border-bottom: 1px solid var(--line-soft); }
.content { padding: 28px 32px 48px; flex: 1; }

/* ===== SIDEBAR ===== */
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; font-family: var(--font-serif); }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-name span { color: var(--muted); font-weight: 400; }

.ws { padding: 10px 12px; border-radius: 11px; background: var(--surface); display: flex; align-items: center; gap: 10px; margin-bottom: 18px; border: 1px solid var(--line); cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out); }
.ws:hover { border-color: var(--ink); }
.ws-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #2B4536, #4a6b58); display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.ws-info { flex: 1; min-width: 0; }
.ws-name { font-size: 12.5px; font-weight: 500; }
.ws-plan { font-size: 11px; color: var(--muted); }

.nav-group-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 12px 6px; font-family: var(--font-mono); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; margin-bottom: 1px; letter-spacing: -0.005em; transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.nav-item:hover { background: rgba(20,20,15,0.03); }
.nav-item:active { transform: scale(0.98); }
.nav-item.active { background: var(--ink); color: var(--bg); }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.nav-item.active .count { color: rgba(255,255,255,0.6); }

.sidebar-foot { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line-soft); }
.user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; font-family: var(--font-mono); }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--muted); }
.user-actions { margin-left: auto; color: var(--muted); cursor: pointer; transition: color var(--duration-fast) var(--ease-out); }
.user-actions:hover { color: var(--ink); }
.logout-btn { margin-left: auto; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; transition: color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out); }
.logout-btn:hover { color: var(--rose); background: var(--rose-soft); }

/* ===== TOPBAR ===== */
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); white-space: nowrap; }
.crumbs .now { color: var(--ink); font-weight: 500; }
.crumbs span.crumb-link { cursor: pointer; transition: color var(--duration-fast) var(--ease-out); }
.crumbs span.crumb-link:hover { color: var(--ink); }
.search-wrap { flex: 1; max-width: 440px; margin-left: 20px; position: relative; }
.search-wrap input { width: 100%; height: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 0 14px 0 40px; font-size: 13px; font-family: inherit; color: var(--ink); transition: border-color var(--duration-fast) var(--ease-out); }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:focus { outline: none; border-color: var(--ink); }
.search-wrap svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.kbd { position: absolute; right: 10px; top: 10px; font-size: 10.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-family: var(--font-mono); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { height: 38px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: inherit; transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out); }
.chip:hover { border-color: var(--ink); }
.icon-b { width: 38px; height: 38px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; position: relative; transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out); }
.icon-b:hover { border-color: var(--ink); }
.icon-b .ping { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); border: 2px solid var(--surface); }
.cta { height: 38px; padding: 0 16px; background: var(--ink); color: var(--bg); border: none; border-radius: 11px; font-size: 12.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: inherit; transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.cta:hover { background: var(--ink-2); }
.cta:active { transform: scale(0.97); }
.cta-accent { background: var(--accent); color: white; }
.cta-accent:hover { background: #1d3326; }
.cta-danger { background: var(--rose); color: white; }
.cta-danger:hover { background: #8a3627; }
.cta-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.cta-outline:hover { border-color: var(--ink); background: var(--bg); }

/* ===== HERO ===== */
.hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.greeting { font-family: var(--font-serif); font-size: 40px; letter-spacing: -0.02em; font-weight: 400; line-height: 1.05; }
.greeting em { font-style: italic; color: var(--muted); }
.hero-sub { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.hero-meta { display: flex; gap: 24px; align-items: flex-end; }
.hero-meta .cell { text-align: right; }
.hero-meta .cell-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-mono); margin-bottom: 4px; }
.hero-meta .cell-value { font-size: 15px; font-weight: 500; }

/* ===== KPI ROW ===== */
.kpi-row { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px; margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, 1fr); box-shadow: var(--shadow-card); }
.kpi { padding: 22px 24px; border-right: 1px solid var(--line-soft); position: relative; }
.kpi:last-child { border-right: none; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-mono); margin-bottom: 14px; }
.kpi-value { font-family: var(--font-serif); font-size: 38px; letter-spacing: -0.015em; font-weight: 400; line-height: 1; }
.kpi-value .unit { font-family: var(--font-sans); font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.kpi-foot { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-family: var(--font-mono); font-size: 11.5px; }
.trend.up { color: var(--accent); }
.trend.down { color: var(--rose); }
.spark { margin-top: 14px; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-2-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-detail { display: grid; grid-template-columns: 1.8fr 1fr; gap: 24px; }

/* ===== PANEL ===== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.panel-head { padding: 22px 24px 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.panel-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.panel-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ===== PILLS ===== */
.pill-group { display: inline-flex; background: var(--bg); border-radius: 9px; padding: 3px; border: 1px solid var(--line-soft); }
.pill { padding: 5px 11px; font-size: 11.5px; font-weight: 500; color: var(--muted); cursor: pointer; border-radius: 6px; font-family: var(--font-mono); transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.pill:hover { color: var(--ink-2); }
.pill.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,20,15,0.05); }

/* ===== LINK ===== */
.link { font-size: 12px; color: var(--ink); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; transition: color var(--duration-fast) var(--ease-out); }
.link:hover { color: var(--accent); }

/* ===== PIPELINE ===== */
.pipeline-body { padding: 4px 24px 26px; }
.pipe-stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 22px; }
.pipe-stage { padding: 14px 14px 16px; border-radius: 13px; background: var(--bg); border: 1px solid var(--line-soft); position: relative; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.pipe-stage:hover { border-color: var(--accent); transform: translateY(-1px); }
.pipe-stage-name { font-size: 11px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.pipe-stage-val { font-family: var(--font-serif); font-size: 22px; letter-spacing: -0.01em; }
.pipe-stage-count { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: var(--font-mono); }
.pipe-bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.pipe-bar-fill { height: 100%; background: var(--accent); transition: width var(--duration-slow) var(--ease-out); }

/* ===== CHART ===== */
.chart { height: 180px; position: relative; padding: 0 4px; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid div { height: 1px; background: var(--line-soft); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); padding: 0 4px; }

/* ===== SIGNALS ===== */
.signal-list { padding: 4px 12px 20px; }
.signal { display: flex; gap: 14px; padding: 14px 12px; border-radius: 12px; cursor: pointer; align-items: flex-start; transition: background var(--duration-fast) var(--ease-out); }
.signal:hover { background: var(--bg); }
.sig-mark { width: 4px; align-self: stretch; border-radius: 3px; background: var(--muted); flex-shrink: 0; }
.sig-mark.rose { background: var(--rose); }
.sig-mark.amber { background: var(--amber); }
.sig-mark.accent { background: var(--accent); }
.sig-mark.lilac { background: var(--lilac); }
.sig-body { flex: 1; min-width: 0; }
.sig-tag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; font-weight: 500; }
.sig-tag.rose { background: var(--rose-soft); color: var(--rose); }
.sig-tag.amber { background: var(--amber-soft); color: var(--amber); }
.sig-tag.accent { background: var(--accent-soft); color: var(--accent); }
.sig-tag.lilac { background: var(--lilac-soft); color: var(--lilac); }
.sig-title { font-size: 13.5px; font-weight: 500; color: var(--ink); margin-bottom: 3px; letter-spacing: -0.005em; }
.sig-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.sig-time { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 8px; }

/* ===== ENGAGEMENTS ===== */
.eng-list { padding: 4px 8px 12px; }
.eng { display: grid; grid-template-columns: 1fr 90px 130px 100px 90px; gap: 20px; padding: 16px 16px; align-items: center; border-radius: 12px; cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.eng:hover { background: var(--bg); }
.eng-primary { display: flex; align-items: center; gap: 14px; }
.eng-logo { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; font-family: var(--font-mono); flex-shrink: 0; }
.eng-name { font-size: 13.5px; font-weight: 500; letter-spacing: -0.005em; }
.eng-client { font-size: 12px; color: var(--muted); margin-top: 2px; }
.eng-num { font-family: var(--font-serif); font-size: 20px; letter-spacing: -0.01em; }
.eng-num-unit { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.eng-progress { display: flex; align-items: center; gap: 10px; }
.eng-prog-bar { flex: 1; height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; }
.eng-prog-fill { height: 100%; border-radius: 3px; transition: width var(--duration-slow) var(--ease-out); }
.eng-prog-text { font-size: 11.5px; font-family: var(--font-mono); color: var(--ink-2); font-weight: 500; }

/* ===== STATUS CHIPS ===== */
.chip-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; font-family: var(--font-mono); white-space: nowrap; }
.chip-status .d { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.st-ok { background: var(--accent-soft); color: var(--accent); }
.st-ok .d { background: var(--accent); }
.st-watch { background: var(--amber-soft); color: var(--amber); }
.st-watch .d { background: var(--amber); }
.st-risk { background: var(--rose-soft); color: var(--rose); }
.st-risk .d { background: var(--rose); }
.st-new { background: var(--lilac-soft); color: var(--lilac); }
.st-new .d { background: var(--lilac); }
.st-neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.st-neutral .d { background: var(--muted); }

/* ===== AVATARS ===== */
.avstack { display: flex; }
.avstack .av { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -7px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: white; font-family: var(--font-mono); }
.avstack .av:first-child { margin-left: 0; }

/* ===== TABLE HEADER ===== */
.eng-th { display: grid; grid-template-columns: 1fr 90px 130px 100px 90px; gap: 20px; padding: 12px 16px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-mono); border-bottom: 1px solid var(--line-soft); font-weight: 500; }
.th-row { display: grid; padding: 12px 16px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-mono); border-bottom: 1px solid var(--line-soft); font-weight: 500; }
.th-sortable { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: color var(--duration-fast) var(--ease-out); }
.th-sortable:hover { color: var(--ink); }
.th-sortable.active { color: var(--ink); }

/* ===== COMMUNICATIONS ===== */
.comms { padding: 4px 12px 12px; }
.comm { display: flex; gap: 13px; padding: 13px 12px; border-radius: 12px; cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.comm:hover { background: var(--bg); }
.comm-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 12px; font-family: var(--font-mono); position: relative; }
.channel { position: absolute; bottom: -3px; right: -3px; width: 17px; height: 17px; border-radius: 6px; border: 2.5px solid var(--surface); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: white; font-family: var(--font-mono); }
.ch-s { background: #611F69; }
.ch-z { background: #2D8CFF; }
.ch-w { background: #25D366; }
.ch-m { background: #E85A4F; }
.ch-p { background: var(--accent); }
.ch-i { background: var(--ink); }
.comm-body { flex: 1; min-width: 0; }
.comm-head { display: flex; justify-content: space-between; margin-bottom: 3px; align-items: baseline; }
.comm-name { font-size: 13px; font-weight: 500; letter-spacing: -0.005em; }
.comm-time { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.comm-text { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-text .ai { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; background: var(--lilac-soft); color: var(--lilac); font-size: 10.5px; margin-right: 6px; font-family: var(--font-mono); font-weight: 500; }

/* ===== TASKS ===== */
.tasks { padding: 4px 12px 12px; }
.task { display: flex; gap: 12px; padding: 14px 12px; border-radius: 12px; align-items: flex-start; transition: background var(--duration-fast) var(--ease-out); }
.task:hover { background: var(--bg); }
.tk-check { width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 6px; margin-top: 1px; flex-shrink: 0; cursor: pointer; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.tk-check.on { background: var(--ink); border-color: var(--ink); }
.tk-body { flex: 1; }
.tk-title { font-size: 13px; font-weight: 500; letter-spacing: -0.005em; }
.tk-title.done { text-decoration: line-through; color: var(--muted); }
.tk-meta { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); }

/* ===== TAGS ===== */
.tag { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 500; font-family: var(--font-mono); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.rose { background: var(--rose-soft); color: var(--rose); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.lilac { background: var(--lilac-soft); color: var(--lilac); }
.tag.slate { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

/* ===== FOOTER BAR ===== */
.footer-bar { padding: 24px 32px 32px; display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); border-top: 1px solid var(--line-soft); margin-top: 30px; }
.footer-bar .status { display: flex; align-items: center; gap: 8px; }
.footer-bar .dot-live { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px var(--accent-soft); }
.footer-links { display: flex; gap: 24px; }
.footer-links a, .footer-links span { color: var(--muted); text-decoration: none; cursor: pointer; transition: color var(--duration-fast) var(--ease-out); }
.footer-links a:hover, .footer-links span:hover { color: var(--ink); }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 500; color: white; background: var(--ink); box-shadow: 0 8px 24px rgba(20,20,15,0.2); display: flex; align-items: center; gap: 10px; animation: toastIn var(--duration-normal) var(--ease-out); max-width: 380px; }
.toast.toast-success { background: var(--accent); }
.toast.toast-warning { background: var(--amber); }
.toast.toast-error { background: var(--rose); }
.toast.toast-exit { animation: toastOut var(--duration-normal) var(--ease-out) forwards; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,20,15,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn var(--duration-normal) var(--ease-out); }
.modal { background: var(--surface); border-radius: 18px; width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: 0 24px 48px rgba(20,20,15,0.2); animation: scaleIn var(--duration-normal) var(--ease-out); }
.modal-header { padding: 24px 24px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line-soft); }
.modal-header h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px 24px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line-soft); }

/* ===== DROPDOWN ===== */
.dropdown-trigger { cursor: pointer; }
.dropdown-panel { position: absolute; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-dropdown); z-index: 100; min-width: 180px; padding: 6px; display: none; animation: slideDown var(--duration-fast) var(--ease-out); }
.dropdown-panel.open { display: block; }
.dropdown-option { padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.dropdown-option:hover { background: var(--bg); }
.dropdown-option.selected { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.dropdown-wrap { position: relative; display: inline-block; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.form-input { width: 100%; height: 40px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; font-size: 13.5px; color: var(--ink); transition: border-color var(--duration-fast) var(--ease-out); }
.form-input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.form-textarea { width: 100%; min-height: 80px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; font-size: 13.5px; color: var(--ink); resize: vertical; transition: border-color var(--duration-fast) var(--ease-out); }
.form-textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.form-select { width: 100%; height: 40px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; font-size: 13.5px; color: var(--ink); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2385857A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; transition: border-color var(--duration-fast) var(--ease-out); }
.form-select:focus { outline: none; border-color: var(--ink); }

/* ===== KANBAN ===== */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { min-width: 240px; flex: 1; }
.kanban-col-header { padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-mono); font-weight: 500; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kanban-col-count { background: var(--bg); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; font-size: 10.5px; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 8px; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.kanban-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(20,20,15,0.08); transform: translateY(-1px); }
.kanban-card-title { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.kanban-card-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.kanban-card-meta { display: flex; justify-content: space-between; align-items: center; }
.kanban-card-value { font-family: var(--font-serif); font-size: 16px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.kanban-card-days { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

/* ===== DATA TABLE ===== */
.data-table { width: 100%; }
.data-table-header { display: grid; padding: 12px 20px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: var(--font-mono); border-bottom: 1px solid var(--line-soft); font-weight: 500; }
.data-table-row { display: grid; padding: 14px 20px; align-items: center; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background var(--duration-fast) var(--ease-out); }
.data-table-row:hover { background: var(--bg); }
.data-table-row:last-child { border-bottom: none; }

/* ===== EMPTY STATE ===== */
.empty-state { padding: 60px 40px; text-align: center; color: var(--muted); }
.empty-state-icon { margin-bottom: 16px; color: var(--line); }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.empty-state-desc { font-size: 13px; line-height: 1.6; max-width: 320px; margin: 0 auto; }

/* ===== DETAIL PAGE ===== */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.detail-title { font-family: var(--font-serif); font-size: 32px; letter-spacing: -0.02em; font-weight: 400; line-height: 1.1; margin-bottom: 8px; }
.detail-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.detail-meta-item { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ===== TAB CONTENT ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); border-radius: 1px; }
.timeline-item { position: relative; padding: 12px 0; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.timeline-item.completed::before { background: var(--accent); border-color: var(--accent); }
.timeline-item.active::before { background: var(--amber); border-color: var(--amber); }
.timeline-item.delayed::before { background: var(--rose); border-color: var(--rose); }

/* ===== MILESTONE ===== */
.milestone-card { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.milestone-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.milestone-name { font-size: 14px; font-weight: 600; }
.milestone-date { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.milestone-progress { margin-top: 8px; }

/* ===== CONTACT CARD ===== */
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.contact-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(20,20,15,0.06); }
.contact-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.contact-card-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; font-family: var(--font-mono); }
.contact-card-name { font-size: 14px; font-weight: 500; }
.contact-card-role { font-size: 12px; color: var(--muted); }
.contact-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }

/* ===== INTEGRATION CARD ===== */
.integration-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.integration-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.integration-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.integration-name { font-size: 15px; font-weight: 600; }
.integration-status { font-size: 12px; margin-top: 2px; }

/* ===== REPORT CARD ===== */
.report-section { margin-bottom: 24px; }
.report-chart { padding: 20px; }

/* ===== LOGIN ===== */
.login-page { width: 1440px; margin: 0 auto; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-container { width: 480px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; justify-content: center; }
.login-brand .brand-mark { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
.login-brand .brand-name { font-size: 22px; }
.login-title { font-family: var(--font-serif); font-size: 28px; text-align: center; margin-bottom: 8px; letter-spacing: -0.02em; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 32px; font-size: 14px; }
.login-cards { display: grid; gap: 10px; margin-bottom: 24px; }
.login-card { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
.login-card:hover { border-color: var(--ink-2); }
.login-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; color: white; font-family: var(--font-mono); }
.login-card-info { flex: 1; }
.login-card-name { font-size: 14px; font-weight: 500; }
.login-card-role { font-size: 12px; color: var(--muted); }
.login-card-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.login-card.selected .login-card-check { background: var(--accent); border-color: var(--accent); }
.login-btn { width: 100%; height: 48px; background: var(--ink); color: var(--bg); border: none; border-radius: 12px; font-size: 15px; font-weight: 500; cursor: pointer; transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.login-btn:hover { background: var(--ink-2); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px; }
.page-btn { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-family: var(--font-mono); cursor: pointer; border: 1px solid transparent; transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.page-btn:hover { background: var(--bg); border-color: var(--line); }
.page-btn.active { background: var(--ink); color: var(--bg); }

/* ===== PROGRESS BAR (standalone) ===== */
.progress-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width var(--duration-slow) var(--ease-out); }

/* ===== STRENGTH INDICATOR ===== */
.strength-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.strength-dot.strong { background: var(--accent); }
.strength-dot.medium { background: var(--amber); }
.strength-dot.weak { background: var(--line); }

/* ===== SYNC STATUS ===== */
.sync-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono); font-weight: 500; }
.sync-synced { background: var(--accent-soft); color: var(--accent); }
.sync-pending { background: var(--amber-soft); color: var(--amber); }
.sync-conflict { background: var(--rose-soft); color: var(--rose); }
.sync-not-linked { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

/* ===== BEFORE/AFTER ===== */
.diff-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.diff-col { padding: 16px; border-radius: 12px; }
.diff-col.before { background: var(--rose-soft); }
.diff-col.after { background: var(--accent-soft); }
.diff-col-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-mono); font-weight: 500; margin-bottom: 12px; }
.diff-row { font-size: 13px; margin-bottom: 8px; }
.diff-label { color: var(--muted); font-size: 11px; font-family: var(--font-mono); }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }

/* ===== INLINE DETAIL ===== */
.inline-detail { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px; margin: 8px 0; animation: slideDown var(--duration-normal) var(--ease-out); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

.animate-in { animation: slideUp var(--duration-normal) var(--ease-out) both; }
.animate-fade { animation: fadeIn var(--duration-normal) var(--ease-out) both; }
.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; }

/* ===== FUNNEL CHART ===== */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-bar { display: flex; align-items: center; gap: 12px; }
.funnel-label { width: 100px; font-size: 11.5px; font-family: var(--font-mono); color: var(--muted); text-align: right; }
.funnel-fill { height: 28px; border-radius: 6px; background: var(--accent); display: flex; align-items: center; padding: 0 10px; color: white; font-size: 11px; font-family: var(--font-mono); font-weight: 500; min-width: 30px; transition: width var(--duration-slow) var(--ease-out); }
.funnel-value { font-size: 12px; font-family: var(--font-mono); color: var(--ink-2); margin-left: 10px; }

/* ===== DONUT ===== */
.donut-container { display: flex; align-items: center; gap: 24px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ===== TOGGLE ===== */
.toggle { width: 40px; height: 22px; border-radius: 11px; background: var(--line); cursor: pointer; position: relative; transition: background var(--duration-fast) var(--ease-out); }
.toggle.active { background: var(--accent); }
.toggle::after { content: ''; width: 18px; height: 18px; border-radius: 50%; background: white; position: absolute; top: 2px; left: 2px; transition: transform var(--duration-fast) var(--ease-out); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle.active::after { transform: translateX(18px); }

/* ===== BANNER ===== */
.banner { padding: 14px 20px; border-radius: 12px; display: flex; align-items: center; gap: 12px; font-size: 13px; margin-bottom: 20px; }
.banner-info { background: var(--lilac-soft); color: var(--lilac); border: 1px solid rgba(106,92,183,0.2); }
.banner-warning { background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(180,115,42,0.2); }
.banner-error { background: var(--rose-soft); color: var(--rose); border: 1px solid rgba(166,65,47,0.2); }
.banner-success { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(43,69,54,0.2); }

/* ===== SCREEN TITLE ===== */
.screen-title { font-family: var(--font-serif); font-size: 32px; letter-spacing: -0.02em; font-weight: 400; margin-bottom: 6px; }
.screen-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

/* ===== MISC ===== */
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-mono { font-family: var(--font-mono); }
.font-serif { font-family: var(--font-serif); }
.mb-20 { margin-bottom: 20px; }
.mb-12 { margin-bottom: 12px; }
.gap-10 { gap: 10px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
