:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050a12;
  color: #e5edf7;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0%, #102741 0, transparent 38%), #050a12; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 32px 0 70px; }
.login-card { width: min(440px, 100%); margin: 8vh auto 0; padding: 32px; border: 1px solid #1c334b; border-radius: 22px; background: rgba(8, 17, 29, .94); box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg,#16a6ca,#2563eb); font-weight: 900; letter-spacing: -.04em; }
.eyebrow { margin: 16px 0 5px; color: #4dd7f0; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px,4vw,40px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 19px; }
.muted { color: #8496aa; font-size: 13px; }
.stack { display: grid; gap: 15px; margin-top: 25px; }
label { display: grid; gap: 7px; color: #94a8bd; font-size: 12px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #23384e; border-radius: 10px; outline: none; background: #081321; color: #eef7ff; padding: 11px 12px; }
input:focus, select:focus { border-color: #28b8d6; box-shadow: 0 0 0 3px rgba(40,184,214,.12); }
button { border: 0; border-radius: 10px; padding: 10px 14px; color: white; font-weight: 800; font-size: 12px; }
.primary { background: linear-gradient(135deg,#0891b2,#2563eb); }
.secondary { border: 1px solid #29435b; background: #101f2e; }
.danger-ghost { border: 1px solid #57303b; background: #22131a; color: #ff9bad; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.topbar .eyebrow { margin-top: 0; }
.toolbar { display: flex; gap: 9px; }
.message { margin: 14px 0; padding: 12px 14px; border: 1px solid #1f7182; border-radius: 11px; background: #0b2a32; color: #9deafa; font-size: 13px; }
.message.error { border-color: #71313e; background: #2a1118; color: #ffafbd; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.stats article { padding: 16px; border: 1px solid #192e42; border-radius: 14px; background: rgba(8,18,31,.86); }
.stats span { display: block; color: #71859a; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.stats strong { display: block; margin-top: 7px; color: #dcf8ff; font-size: 24px; }
.panel { margin-top: 16px; padding: 20px; border: 1px solid #192e42; border-radius: 16px; background: rgba(8,18,31,.88); }
.panel-heading { margin-bottom: 17px; }
.panel-heading .eyebrow { margin-top: 0; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.search { width: min(320px,100%); }
.form-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; align-items: end; }
.form-submit { min-height: 42px; }
.customer-list { display: grid; gap: 12px; }
.customer-card { padding: 15px; border: 1px solid #1d3348; border-radius: 13px; background: #07111d; }
.customer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.customer-name { font-size: 15px; font-weight: 850; }
.username { color: #67cfe4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.badge { display: inline-flex; margin-left: 8px; padding: 4px 7px; border: 1px solid #29546a; border-radius: 999px; color: #7bdff3; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.badge.off { border-color: #4b3840; color: #a48d95; }
.license-grid { display: grid; grid-template-columns: 110px 100px 120px 150px auto; gap: 8px; margin-top: 13px; align-items: end; }
.license-grid label { font-size: 10px; }
.license-grid input, .license-grid select { padding: 8px; font-size: 12px; }
.device-list { display: grid; gap: 7px; margin-top: 12px; }
.device { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: #0b1826; }
.device-main { min-width: 0; }
.device-title { font-size: 12px; font-weight: 800; }
.device-meta { margin-top: 3px; color: #6f8296; font-size: 10px; word-break: break-all; }
.device-actions, .customer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.small { padding: 7px 9px; font-size: 10px; }
.approve { background: #0d5a47; color: #a8ffe0; }
.revoke { background: #5c2432; color: #ffc0cd; }
.neutral { background: #243649; color: #c9d7e4; }
.empty { padding: 22px; border: 1px dashed #263b4e; border-radius: 12px; color: #71859a; text-align: center; font-size: 12px; }
@media (max-width: 850px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: repeat(2,1fr); }
  .license-grid { grid-template-columns: repeat(2,1fr); }
  .topbar, .split, .customer-head { flex-direction: column; }
  .search { width: 100%; }
}
@media (max-width: 520px) {
  .shell { width: min(100% - 18px,1180px); padding-top: 14px; }
  .login-card, .panel { padding: 16px; }
  .form-grid, .license-grid { grid-template-columns: 1fr; }
  .device { align-items: flex-start; flex-direction: column; }
}
