:root {
  color-scheme: dark;
  --bg: #07101c;
  --panel: #0e1a2a;
  --panel-soft: #122136;
  --line: #20334d;
  --text: #eef4fb;
  --muted: #91a4bc;
  --accent: #d89a3a;
  --accent-soft: #3a2a17;
  --ok: #36c98b;
  --danger: #ff6b72;
  --shadow: 0 20px 60px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.04em; }
h2 { margin-bottom: 20px; font-size: 22px; letter-spacing: -.02em; }
.muted, .lead { color: var(--muted); }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 13px; font-weight: 850; letter-spacing: .1em; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #d59a42; border-radius: 15px; color: #f4bd65; background: linear-gradient(145deg,#382815,#121a25); font-weight: 900; letter-spacing: -.05em; box-shadow: inset 0 0 20px rgba(216,154,58,.12); }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }

.login-body { background: radial-gradient(circle at 15% 20%, #19304b 0, transparent 32%), radial-gradient(circle at 90% 85%, #2a2117 0, transparent 30%), var(--bg); }
.login-shell { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(340px,480px); align-items: center; gap: 8vw; width: min(1180px,calc(100% - 40px)); min-height: 100vh; margin: auto; }
.login-brand h1 { max-width: 650px; font-size: clamp(48px,7vw,82px); line-height: .96; }
.login-brand .lead { max-width: 580px; font-size: 18px; line-height: 1.65; }
.login-brand .brand-mark { margin-bottom: 36px; }
.login-panel { padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: rgba(14,26,42,.88); box-shadow: var(--shadow); backdrop-filter: blur(18px); }

.appbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; min-height: 68px; padding: 0 max(24px,calc((100vw - 1360px)/2)); border-bottom: 1px solid var(--line); background: rgba(7,16,28,.88); backdrop-filter: blur(18px); }
.appbar-actions { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 13px; }
.appbar-actions form { margin: 0; }
.health-dot { color: var(--ok); }
.app-shell { width: min(1360px,calc(100% - 48px)); margin: 0 auto; padding: 44px 0 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.metrics article { min-height: 126px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg,var(--panel),#0b1726); }
.metrics span, .metrics small { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; margin: 6px 0; font-size: 38px; }
.split-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; align-items: start; gap: 18px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px 0; }
.panel-heading h2 { margin-bottom: 14px; }
.counter { display: grid; place-items: center; min-width: 34px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; }
.form-panel { padding: 24px; }
.customer-list { border-top: 1px solid var(--line); }
.customer-row { display: grid; grid-template-columns: 42px minmax(180px,1fr) auto auto 20px; align-items: center; gap: 14px; min-height: 72px; padding: 12px 20px; border-bottom: 1px solid rgba(32,51,77,.7); transition: .18s ease; }
.customer-row:last-child { border-bottom: 0; }
a.customer-row:hover { background: var(--panel-soft); transform: translateX(2px); }
.customer-row.static { grid-template-columns: 42px minmax(180px,1fr) auto; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #f3be6c; background: var(--accent-soft); font-size: 12px; font-weight: 900; }
.avatar.site { color: #8dc5ff; background: #132d48; font-size: 20px; }
.customer-main strong, .customer-main small { display: block; }
.customer-main small, .site-count { margin-top: 4px; color: var(--muted); font-size: 12px; }
.arrow { color: var(--accent); }
.source-badges { display: flex; gap: 5px; }
.source-badges i, .status-pill { padding: 5px 8px; border: 1px solid #2e4665; border-radius: 99px; color: #9fb9d6; background: #132238; font-size: 10px; font-style: normal; text-transform: uppercase; }
.source-badges.large i { padding: 7px 11px; }
.status-pill.neutral { color: var(--muted); }
.empty { display: grid; gap: 7px; padding: 55px 24px; color: var(--muted); text-align: center; }
.empty strong { color: var(--text); }

.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #bdcadd; font-size: 12px; font-weight: 700; }
input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #2b405c; border-radius: 10px; outline: none; color: var(--text); background: #0a1524; transition: .15s ease; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,154,58,.12); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 800; }
.button.primary { min-height: 46px; color: #17110a; background: linear-gradient(135deg,#efb452,#c78328); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.security-note { margin: 18px 0 0; color: #71869f; font-size: 11px; line-height: 1.5; }
.alert { margin-bottom: 16px; padding: 11px 13px; border-radius: 9px; font-size: 13px; }
.alert.error { color: #ffc1c4; border: 1px solid #71343a; background: #371a20; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; gap: 30px; padding: 50px 0; }
  .login-brand h1 { font-size: 48px; }
  .split-layout { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .health-dot { display: none; }
}
@media (max-width: 620px) {
  .app-shell { width: min(100% - 26px,1360px); padding-top: 28px; }
  .appbar { padding: 0 14px; }
  .appbar-actions > span { display: none; }
  .customer-row { grid-template-columns: 42px 1fr 20px; }
  .source-badges, .site-count { display: none; }
  .page-heading { align-items: start; flex-direction: column; gap: 16px; }
}
