/* Light admin theme. Colours and type follow the public website: blue #0066d2, slate neutrals, Plus Jakarta Sans. */
:root {
  --blue: #0066d2; --blue-dark: #004fa8; --blue-soft: #eaf3ff;
  --ink: #0f172a; --text: #334155; --muted: #64748b; --line: #e2e8f0; --bg: #f5f8fc; --card: #fff;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --bad-dark: #b91c1c;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .05);
  --side: 252px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font: 14px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; } h3 { font-size: 13px; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .error { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; font-weight: 600; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- sign in ---- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art { position: relative; display: flex; align-items: center; padding: 48px; color: #fff; background: linear-gradient(145deg, #040c18 0%, #0a2a57 55%, #0066d2 130%); overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.art-inner { position: relative; max-width: 420px; z-index: 1; }
.art-logo { height: 42px; width: auto; margin-bottom: 34px; }
.art-inner h2 { color: #fff; font-size: 30px; line-height: 1.2; font-weight: 800; margin-bottom: 22px; }
.art-inner ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; color: #cbd5e1; }
.art-inner li { padding-left: 28px; position: relative; }
.art-inner li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: rgba(96, 165, 250, .25); box-shadow: inset 0 0 0 5px #60a5fa; }
.login-card { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 32px 24px; }
.login-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.login-card label { display: block; font-weight: 600; color: var(--ink); margin-top: 18px; font-size: 13px; }
.logo { height: 40px; width: auto; margin-bottom: 26px; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 102, 210, .15); }
.btn { width: 100%; margin-top: 14px; padding: 12px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; transition: background .15s, transform .05s; box-shadow: 0 6px 16px rgba(0, 102, 210, .28); }
.btn:hover { background: var(--blue-dark); } .btn:active { transform: translateY(1px); } .btn:disabled { opacity: .6; cursor: wait; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---- shell and sidebar ---- */
.shell { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--side); display: flex; flex-direction: column; padding: 18px 14px; background: #fff; border-right: 1px solid var(--line); transition: transform .22s ease; }
.side-brand { display: block; padding: 4px 8px 18px; } .side-brand img { height: 34px; width: auto; display: block; }
.side-label { margin: 6px 10px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; }
.menu { display: grid; gap: 3px; flex: 1; align-content: start; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.menu button svg { width: 18px; height: 18px; flex: none; color: #94a3b8; transition: color .15s; }
.menu button:hover { background: #f1f5f9; color: var(--ink); }
.menu button.on { background: var(--blue-soft); color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); } .menu button.on svg { color: var(--blue); }
.menu .count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; }
.side-foot { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #0066d2, #38bdf8); color: #fff; font-weight: 800; }
.who-text { display: grid; min-width: 0; line-height: 1.3; } .who-text strong { color: var(--ink); font-size: 13px; } .who-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: var(--bad); font: inherit; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.logout svg { width: 17px; height: 17px; } .logout:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--side); }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(245, 248, 252, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { flex: 1; min-width: 0; } .top-title h1 { font-size: 20px; font-weight: 800; } .top-title p { margin: 0; font-size: 12.5px; }
.top-tools { display: flex; align-items: center; gap: 10px; } .top-tools select { width: auto; margin: 0; padding: 8px 12px; font-weight: 600; }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.burger svg { width: 20px; height: 20px; margin: auto; }
.live { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: #ecfdf3; border: 1px solid #bbf7d0; color: #15803d; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.view { max-width: 1320px; margin: 0 auto; padding: 24px 28px 48px; display: grid; gap: 18px; }
.grid { display: grid; gap: 18px; } .kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } .g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } .g3 { grid-template-columns: 2fr 1fr; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; } .card-h small { color: var(--muted); }

/* ---- KPI cards ---- */
.kpi { display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; }
.kpi .ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); }
.kpi .ic svg { width: 22px; height: 22px; }
.kpi .n { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.15; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi.green .ic { background: #ecfdf3; color: var(--ok); } .kpi.amber .ic { background: #fff7e6; color: var(--warn); } .kpi.violet .ic { background: #f0efff; color: #6366f1; } .kpi.teal .ic { background: #e6faf8; color: #0d9488; }

/* ---- charts ---- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: #eef2f7; stroke-width: 1; } .chart .ax { fill: #94a3b8; stroke: none; font-size: 11px; }
.chart .hit { stroke: none; }
.chart .dot { fill: #fff; stroke: var(--blue); stroke-width: 2; opacity: 0; } .chart .hit:hover + .dot, .chart .dot:hover { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--text); } .legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; } .donut svg { width: 150px; height: 150px; flex: none; }
.donut .total { font-size: 22px; font-weight: 800; fill: var(--ink); stroke: none; } .donut .tl { font-size: 10px; fill: #94a3b8; stroke: none; letter-spacing: .08em; }
.donut .legend { flex-direction: column; margin: 0; flex: 1; min-width: 130px; } .legend b { margin-left: auto; padding-left: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend .row { display: flex; align-items: center; gap: 6px; width: 100%; }

/* ---- ranked bars ---- */
.rank { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rank li { display: grid; gap: 5px; } .rank .top-r { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.rank .nm { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rank .nm small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.rank .v { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; white-space: nowrap; }
.track { height: 7px; border-radius: 99px; background: #eef2f7; overflow: hidden; } .track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0066d2, #38bdf8); }
.empty { padding: 26px 8px; text-align: center; color: var(--muted); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
th { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; font-weight: 700; }
tbody tr:hover { background: #fafcff; } tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); } td small { display: block; color: var(--muted); }

/* ---- leads ---- */
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.pipe button { text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.pipe button:hover { border-color: var(--blue); } .pipe button.on { border-color: var(--blue); background: var(--blue-soft); }
.pipe b { display: block; font-size: 22px; color: var(--ink); line-height: 1.2; } .pipe span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; } .filters > * { width: auto; margin: 0; flex: 1 1 170px; }
.filters .ghost { flex: 0 0 auto; }
.ghost { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; } .ghost:hover { border-color: var(--blue); color: var(--blue); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; background: #f1f5f9; color: var(--text); }
.pill.new { background: #dbeafe; color: #1d4ed8; } .pill.contacted { background: #fef3c7; color: #b45309; } .pill.quoted { background: #ede9fe; color: #6d28d9; } .pill.won { background: #dcfce7; color: #15803d; } .pill.lost { background: #fee2e2; color: #b91c1c; }
.lead-edit { display: grid; gap: 6px; min-width: 190px; } .lead-edit select, .lead-edit textarea { margin: 0; padding: 7px 10px; } .lead-edit textarea { min-height: 54px; resize: vertical; }
.lead-edit button { padding: 8px 12px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; } .lead-edit button:hover { background: var(--blue-dark); }
.note { padding: 18px 20px; border: 1px solid #fde68a; border-radius: 14px; background: #fffbeb; color: #78350f; } .note h2 { color: #78350f; margin-bottom: 8px; } .note p { margin: 6px 0; }
.note code { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #fff; border: 1px solid #fde68a; word-break: break-all; }
.skeleton { height: 120px; border-radius: 16px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: sk 1.2s infinite; } @keyframes sk { to { background-position: -200% 0; } }

/* ---- responsive ---- */
@media (max-width: 1000px) { .g3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .side { transform: translateX(-100%); box-shadow: none; } .side.open { transform: none; box-shadow: 8px 0 30px rgba(15, 23, 42, .18); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 42, .4); }
  .main { margin-left: 0; } .burger { display: grid; }
  .top { padding: 12px 14px; } .view { padding: 16px 14px 40px; } .live { display: none; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; } .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; } .g2 { grid-template-columns: 1fr; } .top-title p { display: none; } .kpi .n { font-size: 22px; } }
