:root {
  --bg: #0b1220;
  --panel: #111a2f;
  --panel-soft: #16213c;
  --line: rgba(255,255,255,0.08);
  --text: #ecf2ff;
  --muted: #9fb0d0;
  --primary: #4da3ff;
  --primary-strong: #1d7cf2;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 20px 50px rgba(0,0,0,0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: linear-gradient(180deg, #08101d 0%, #0d1628 100%); color: var(--text); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }

.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 28px 20px; background: rgba(6, 11, 22, 0.65); backdrop-filter: blur(18px); display: flex; flex-direction: column; gap: 20px; }
.sidebar h1 { margin: 4px 0 8px; font-size: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: #83b8ff; }
.muted { color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav button { width: 100%; text-align: left; background: transparent; color: var(--text); border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.nav button:hover, .nav button.active { background: rgba(77,163,255,0.12); border-color: rgba(77,163,255,0.25); }
.sidebar-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.sidebar-card-title { font-weight: 700; margin-bottom: 10px; }
.sidebar-card ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }

.main { padding: 26px; }
.hero { background: radial-gradient(circle at top left, rgba(77,163,255,0.16), transparent 42%), var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px; display: flex; justify-content: space-between; align-items: end; gap: 16px; box-shadow: var(--shadow); }
.hero h2 { margin: 6px 0 10px; font-size: 34px; }
.hero p { margin: 0; color: var(--muted); max-width: 680px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
button.primary, button.secondary { border-radius: 12px; padding: 12px 18px; border: 1px solid var(--line); cursor: pointer; }
button.primary { background: linear-gradient(180deg, var(--primary), var(--primary-strong)); color: white; border: none; }
button.secondary { background: rgba(255,255,255,0.04); color: var(--text); }

.page { display: none; margin-top: 22px; }
.page.active { display: block; }
.section-header { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-header h3 { margin: 0 0 6px; font-size: 24px; }
.section-header p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 8px; font-size: 34px; font-weight: 700; }
.metric-footnote { margin-top: 8px; font-size: 13px; color: #7ecb95; }

.panel-grid { display: grid; gap: 14px; margin-top: 14px; }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.panel-title-row h4 { margin: 0; font-size: 18px; }
.tag { border-radius: 999px; padding: 6px 10px; background: rgba(255,255,255,0.05); color: var(--muted); font-size: 12px; }

.funnel-step { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; margin-bottom: 12px; }
.funnel-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #63b3ff, #1d7cf2); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--muted); font-weight: 600; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.pill.success { background: rgba(34,197,94,0.15); color: #7ee2a1; }
.pill.warning { background: rgba(245,158,11,0.16); color: #f7ca71; }
.pill.danger { background: rgba(239,68,68,0.16); color: #ff9a9a; }
.pill.info { background: rgba(77,163,255,0.15); color: #9bc8ff; }

.lead-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead-form label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 14px; }
.lead-form input, .lead-form select, .lead-form textarea, .filters select { width: 100%; background: var(--panel-soft); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 14px; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; margin-bottom: 12px; }

.todo-list { display: grid; gap: 12px; }
.todo-card, .kanban-column { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.todo-card-head, .lead-mini { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.todo-card h5, .lead-mini strong { margin: 0; font-size: 15px; }
.todo-meta, .lead-sub { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.todo-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.todo-actions button { background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kanban-column h5 { margin: 0 0 10px; font-size: 15px; }
.kanban-cards { display: grid; gap: 10px; }
.lead-mini { flex-direction: column; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

.notes-block { color: var(--muted); line-height: 1.8; }
.notes-block p { margin: 0 0 10px; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .metric-grid, .two-up, .kanban, .lead-form, .filters { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: start; }
}
