:root {
  --blue-950: #082f49;
  --blue-800: #075985;
  --blue-600: #2563eb;
  --cyan: #06b6d4;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbeafe;
  --bg: #f4f8ff;
  --panel: rgba(255, 255, 255, .92);
  --shadow: 0 22px 60px rgba(30, 64, 175, .14);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at top left, #dff7ff 0, transparent 34%), linear-gradient(135deg, #eff6ff 0%, #f8fbff 44%, #e0f2fe 100%); }
a { color: var(--blue-600); text-decoration: none; }
button, .button { border: 0; border-radius: 8px; padding: 11px 16px; color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--cyan)); font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
button.ghost, .ghost { color: var(--blue-600); background: #eef6ff; }
button.secondary, .secondary { width: 100%; margin-top: 10px; background: linear-gradient(135deg, #0f172a, #075985); }
input, select, textarea { width: 100%; border: 1px solid #c7ddff; border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--ink); font: inherit; min-height: 40px; }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; text-align: left; }
th, td { padding: 14px 12px; border-bottom: 1px solid #e8f1ff; vertical-align: top; }
td small { display: block; color: var(--muted); margin-top: 4px; }
tr[onclick] { cursor: pointer; }
tr[onclick]:hover { background: #f0f7ff; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; padding: 22px; color: #fff; background: linear-gradient(180deg, var(--blue-950), var(--blue-800) 62%, #0e7490); box-shadow: var(--shadow); }
.brand { display: flex; gap: 12px; align-items: center; color: #fff; margin-bottom: 28px; }
.brand small { display: block; color: #bfdbfe; font-size: 12px; margin-top: 3px; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: linear-gradient(135deg, #38bdf8, #2563eb); color: white; font-weight: 900; box-shadow: 0 12px 26px rgba(14,165,233,.35); }
.brand-mark.large { width: 72px; height: 72px; font-size: 32px; margin-bottom: 16px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { color: #e0f2fe; padding: 12px 14px; border-radius: 8px; font-weight: 700; }
.sidebar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.main { margin-left: 270px; padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); }
.topbar form { display: flex; align-items: center; gap: 10px; }
.eyebrow { color: var(--blue-800); font-size: 12px; text-transform: uppercase; font-weight: 900; margin: 0 0 4px; }
.user-pill, .badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; background: #e0f2fe; color: var(--blue-800); font-size: 12px; font-weight: 800; }
.alert { margin: 12px 0; padding: 12px 14px; border-radius: 8px; font-weight: 800; }
.alert.success { color: #065f46; background: #dcfce7; }
.alert.error { color: #991b1b; background: #fee2e2; }

.panel, .stat-grid article, .deal { background: var(--panel); border: 1px solid rgba(191, 219, 254, .75); border-radius: 8px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.panel { padding: 20px; margin-bottom: 20px; overflow-x: auto; }
.panel h2 { margin: 0 0 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.narrow { max-width: 920px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; margin-bottom: 20px; }
.stat-grid article { padding: 22px; min-height: 124px; }
.stat-grid span { color: var(--muted); font-weight: 800; }
.stat-grid strong { display: block; margin-top: 8px; font-size: 38px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.inline-form, .search { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; align-items: end; }
.stack { display: grid; gap: 12px; margin-bottom: 16px; }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px; color: #fff; background: linear-gradient(135deg, var(--blue-800), var(--blue-600), var(--cyan)); border-radius: 8px; margin-bottom: 20px; box-shadow: var(--shadow); }
.detail-head h2 { margin: 0 0 6px; font-size: 32px; }
.detail-head p { margin: 0; color: #dff7ff; }
.detail-head .button { background: #fff; color: var(--blue-800); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li { border-left: 3px solid var(--cyan); padding-left: 12px; }
.timeline span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.timeline.spacious li { padding: 14px 0 14px 14px; border-bottom: 1px solid #e8f1ff; }
.stage-bars { display: grid; gap: 14px; }
.stage-bars div { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.stage-bars i { grid-column: 1 / -1; display: block; width: var(--w); height: 9px; border-radius: 999px; background: var(--c); }

.kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { min-height: 420px; }
.kanban-col h3 { margin: 0 0 12px; padding: 12px; border-top: 4px solid; background: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.deal { padding: 14px; display: grid; gap: 9px; margin-bottom: 12px; }
.deal span, .deal small { color: var(--muted); }
.deal form { display: grid; gap: 7px; }

.login-page { display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #082f49 0%, #075985 48%, #38bdf8 100%); }
.login-shell { width: min(1040px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: stretch; }
.login-hero { color: #fff; padding: 54px; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.login-hero h1 { font-size: clamp(42px, 6vw, 72px); margin: 0 0 12px; }
.login-hero p { color: #dff7ff; font-size: 18px; max-width: 560px; }
.login-card { display: grid; gap: 16px; align-content: center; padding: 34px; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 32px; }

@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 18px; }
  .grid.two, .grid.three, .stat-grid, .login-shell { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
}
