:root {
  --bg: #f3f6fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-2: rgba(255, 255, 255, 0.95);
  --line: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0891b2;
  --accent-2: #7c3aed;
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at top right, rgba(124, 58, 237, .12), transparent 28%), radial-gradient(circle at 12% 12%, rgba(8, 145, 178, .14), transparent 24%), var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: rgba(255, 255, 255, .9); backdrop-filter: blur(22px); padding: 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 30px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #f8fafc; font-weight: 900; box-shadow: 0 0 28px rgba(8,145,178,.25); }
.brand-title { font-weight: 800; letter-spacing: .02em; }
.brand-subtitle, .eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: grid; gap: 8px; }
.nav-item { padding: 12px 14px; color: #334155; border: 1px solid transparent; border-radius: 14px; }
.nav-item:hover { background: rgba(148, 163, 184, .16); border-color: var(--line); }
.sidebar-card { margin-top: 28px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
select, input { width: 100%; margin-top: 10px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.main { padding: 30px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
h1 { margin: 5px 0 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { font-size: clamp(32px, 5vw, 56px); line-height: .95; margin: 10px 0 16px; letter-spacing: -.06em; }
h3 { margin: 0; }
.status-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 14px; color: #334155; white-space: nowrap; }
.pulse { width: 9px; height: 9px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 8px rgba(52, 211, 153, .1); }
.hero-grid { display: grid; grid-template-columns: 1.7fr .9fr; gap: 18px; margin-bottom: 18px; }
.hero-card, .ai-card, .panel, .kpi-card { background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 250, 252, .98)); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 14px 40px rgba(15,23,42,.08); }
.hero-card { padding: 34px; overflow: hidden; position: relative; }
.hero-card p { color: var(--muted); max-width: 780px; font-size: 17px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; }
.button { padding: 11px 16px; border-radius: 14px; border: 1px solid var(--line); color: var(--text); background: #fff; }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #f8fafc; font-weight: 800; border-color: transparent; }
.ai-card { padding: 26px; position: relative; overflow: hidden; }
.orb { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(110,231,249,.95), rgba(139,92,246,.38), transparent 70%); filter: blur(2px); margin: 0 auto 20px; animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-8px);} }
.ai-title { font-weight: 800; font-size: 20px; }
.ai-card li { color: #334155; margin: 10px 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.kpi-card { padding: 18px; }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.kpi-value { font-size: 30px; font-weight: 900; margin-top: 8px; }
.content-grid { display: grid; grid-template-columns: 1.5fr .9fr; gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; overflow: hidden; }
.panel.wide { min-height: 360px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 16px; }
.timeline { display: grid; gap: 18px; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 14px; align-items: flex-start; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: var(--accent); box-shadow: 0 0 0 8px rgba(110,231,249,.08); }
.timeline-dot.outbound { background: var(--accent-2); }
.timeline-title { font-weight: 800; font-size: 13px; }
.timeline p { margin: 4px 0; color: #334155; }
.timeline span, .doc-row span, small { color: var(--muted); font-size: 12px; }
.doc-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 14px 0; gap: 12px; }
.doc-row div { display: grid; }
.recommendation-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.recommendation-card { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 16px; }
.tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.empty-state { color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; padding: 20px; background: rgba(148,163,184,.08); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: #f8fafc; position: sticky; top: 0; }
td { color: #1e293b; font-size: 13px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
pre { white-space: pre-wrap; max-width: 620px; color: #334155; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(148, 163, 184, .12); }
.clickable-row:focus-within { outline: 2px solid rgba(8, 145, 178, .35); outline-offset: -2px; }
.status-chip { display: inline-block; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; background: #fff; }
.muted-cell { color: var(--muted); font-size: 12px; }
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 70; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.modal-panel { position: relative; width: min(1100px, 92vw); max-height: 88vh; margin: 5vh auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: auto; box-shadow: 0 22px 48px rgba(15, 23, 42, .3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-body { padding: 18px; display: grid; gap: 14px; }
.modal-section { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #f8fafc; }
.modal-section h4 { margin: 0 0 8px; }
.kv-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.modal-actions .button { white-space: nowrap; }
@media (max-width: 1100px) { .shell { grid-template-columns: 1fr; } .sidebar { position: relative; height: auto; } .hero-grid, .content-grid { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(2, 1fr); } .recommendation-grid { grid-template-columns: 1fr; } }
