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

:root {
  --ink: #0B1220;
  --paper: #F6F8FB;
  --card: #FFFFFF;
  --line: #E2E7F0;
  --muted: #5B6577;
  --accent: #1F4BFF;
  --accent-ink: #1436D8;
  --accent-soft: #EAEFFF;
  --signal: #C6F24E;
  --danger: #D92D20;
  --danger-soft: #FEE4E2;
  --ok: #067647;
  --ok-soft: #DCFAE6;
  --warn: #B54708;
  --warn-soft: #FEF0C7;
  --radius: 14px;
  --sidebar: 220px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Onest', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(31,75,255,.10), transparent 60%),
    radial-gradient(700px 360px at 100% 0%, rgba(198,242,78,.14), transparent 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 16px 40px rgba(17,26,46,.06);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; }
.brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  background: rgba(255,255,255,.78);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { margin: 4px 8px 18px; color: inherit; }
.side-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 4px;
}
.side-link:hover { background: var(--accent-soft); color: var(--accent-ink); }
.side-link.active { background: var(--accent); color: #fff; }
.side-user { margin-top: 24px; padding: 12px; color: var(--muted); font-size: .9rem; }

.main { padding: 22px 24px 40px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.page-head h1 { margin: 0; margin-right: auto; font-size: 1.55rem; letter-spacing: -.02em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font-family: 'JetBrains Mono', monospace;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  width: 100%;
}
.eyebrow::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 0 4px rgba(198,242,78,.25);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat h3 { margin: 0 0 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat .num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font: inherit; background: #fff; outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,75,255,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; padding: 10px 15px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; margin-top: 14px; }

.alert { border-radius: 12px; padding: 11px 13px; margin: 0 0 14px; font-weight: 500; }
.alert-error { background: var(--danger-soft); color: #912018; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.table th {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.table tr:hover td { background: #fafbfe; }
.hint { color: var(--muted); font-size: .9rem; }
.badge {
  display: inline-flex; border-radius: 999px; padding: 3px 9px;
  font-size: .75rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink);
}
.badge-lead { background: #FEF3C7; color: #92400E; }
.badge-qualified { background: #E0F2FE; color: #075985; }
.badge-proposal { background: #F3E8FF; color: #6B21A8; }
.badge-negotiation { background: var(--accent-soft); color: var(--accent-ink); }
.badge-won { background: var(--ok-soft); color: var(--ok); }
.badge-lost { background: #EEF2F6; color: #475467; }
.badge-open { background: var(--warn-soft); color: var(--warn); }
.badge-done { background: var(--ok-soft); color: var(--ok); }
.badge-cancelled { background: #EEF2F6; color: #475467; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { width: auto; min-width: 160px; }
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; overflow-x: auto; }
.pipe-col {
  background: #f8faff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 180px;
}
.pipe-col h3 { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.pipe-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; margin-bottom: 8px; color: inherit;
}
.pipe-card:hover { border-color: #c8d2ff; }
.pipe-card strong { display: block; margin-bottom: 4px; }
.notes { display: grid; gap: 10px; }
.note {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; white-space: pre-wrap;
}
.note .meta { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .sidebar .brand { width: 100%; }
  .side-user { margin-top: 0; }
  .grid-3, .form-row, .pipeline { grid-template-columns: 1fr; }
}
