:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f8f7f7;
  background: #0b0c0f;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(#ffffff05 1px, transparent 1px),
    linear-gradient(90deg, #ffffff05 1px, transparent 1px),
    radial-gradient(circle at 8% 5%, #9e162636 0, transparent 32%),
    #0b0c0f;
  background-size: 44px 44px, 44px 44px, auto, auto;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid #ffffff12; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 118px; height: 42px; border-radius: 10px; object-fit: contain; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 19px; }
h2 { margin-bottom: 10px; font-size: 26px; letter-spacing: -0.02em; }
.eyebrow { margin-bottom: 6px; color: #ef5363; font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.muted, .hint { color: #ad9da0; }
.hint { font-size: 12px; line-height: 1.5; }
.session-actions { display: flex; align-items: center; gap: 14px; color: #c4b7b9; font-size: 13px; }
.auth-card, .panel, .metric { border: 1px solid #ffffff14; background: #111319ed; box-shadow: 0 24px 70px #00000066; }
.auth-stage { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(380px, 460px); align-items: center; gap: clamp(50px, 9vw, 150px); width: min(1040px, 100%); min-height: calc(100vh - 150px); margin: 0 auto; }
.auth-identity { max-width: 520px; }
.auth-identity img { width: 220px; margin-bottom: 34px; border-radius: 18px; box-shadow: 0 24px 60px #0008; }
.auth-identity h2 { margin-bottom: 18px; font-size: clamp(42px, 5vw, 68px); line-height: .98; letter-spacing: -.055em; }
.auth-identity > p:last-child { max-width: 470px; color: #9c9fa8; font-size: 16px; line-height: 1.6; }
.auth-card { width: 100%; margin: 0; padding: 34px; border-radius: 22px; border-top: 3px solid #ed1c24; }
.stack { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 7px; color: #c8bbbd; font-size: 12px; font-weight: 700; }
input, textarea { width: 100%; min-height: 48px; padding: 0 14px; color: white; border: 1px solid #ffffff1a; border-radius: 10px; outline: none; background: #08090c; }
textarea { min-height: 132px; padding: 13px 14px; line-height: 1.45; resize: vertical; }
input:focus, textarea:focus { border-color: #f43f52aa; box-shadow: 0 0 0 4px #f43f5218; }
.button { min-height: 44px; padding: 0 16px; color: white; border: 1px solid transparent; border-radius: 9px; font-weight: 760; }
.button.primary { background: #d7192d; box-shadow: 0 10px 24px #d7192d25; }
.button.primary:hover { background: #ed263b; }
.button.ghost { border-color: #ffffff18; background: #ffffff0b; }
.error { min-height: 1em; margin: 0; color: #ff8a94; font-size: 13px; }
.success { min-height: 1em; margin: 0; color: #69dea0; font-size: 13px; }
.notice { max-width: 760px; margin: 10vh auto; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-radius: 12px; color: #9c9fa8; border-left: 3px solid #293e78; }
.metric strong { color: white; font-size: 30px; }
.workspace { display: grid; grid-template-columns: minmax(330px, .65fr) minmax(720px, 1.7fr); gap: 18px; align-items: start; }
.panel { padding: 26px; border-radius: 16px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 10px; color: #8f8184; font-size: 10px; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
td { padding: 15px 10px; border-top: 1px solid #ffffff0d; color: #d4cacc; font-size: 13px; vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: #8f8184; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.badge.enabled { color: #78e4aa; background: #1fa76220; }
.badge.disabled { color: #ff929a; background: #ef334620; }
.row-actions { min-width: 170px; white-space: nowrap; }
.table-action { padding: 5px 7px; color: #cabfc1; border: 0; background: transparent; font-size: 12px; font-weight: 700; }
.table-action:hover { color: white; }
.table-action.danger { color: #ff7e88; }
dialog { width: min(480px, calc(100% - 30px)); color: white; border: 1px solid #ffffff20; border-radius: 22px; background: #170a0c; box-shadow: 0 35px 90px #000; }
dialog::backdrop { background: #000b; backdrop-filter: blur(7px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
code { color: #ff9ca4; }
.activation-result { display: grid; gap: 10px; padding: 14px; border: 1px solid #69dea033; border-radius: 10px; background: #1fa76212; }
.activation-result input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.issue-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 20px; padding: 4px; border: 1px solid #ffffff12; border-radius: 10px; background: #08090c; }
.issue-mode button { min-height: 38px; color: #938a8c; border: 0; border-radius: 7px; background: transparent; font-size: 12px; font-weight: 800; }
.issue-mode button.active { color: white; background: #d7192d; box-shadow: 0 7px 18px #d7192d2e; }
.batch-heading, .batch-results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.batch-heading { margin-top: 22px; }
.batch-heading h3, .batch-results-heading h3 { margin-bottom: 0; }
.batch-heading h3 { font-size: 18px; }
.batch-limit { flex: none; padding: 5px 8px; color: #ff8f99; border: 1px solid #ef536344; border-radius: 99px; background: #ef536312; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.batch-form { margin-top: 18px; }
.batch-results { margin-top: 24px; padding-top: 24px; border-top: 1px solid #ffffff12; }
.batch-results-heading h3 { font-size: 18px; }
.batch-results-list { display: grid; gap: 9px; margin-top: 14px; }
.batch-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid #ffffff10; border-radius: 10px; background: #08090c; }
.batch-result strong, .batch-result small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-result strong { font-size: 12px; }
.batch-result small { margin-top: 4px; color: #70dba4; font-size: 10px; }
.batch-result.failed small { color: #ff8a94; }
.batch-result-actions { display: flex; gap: 4px; }
.batch-result-actions .table-action { border: 1px solid #ffffff12; border-radius: 7px; background: #ffffff08; }
.button:disabled { cursor: wait; opacity: .55; }
.license-line { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.license-line > strong { min-width: 35px; color: #fff; }
.limit-input { width: 46px; min-height: 32px; padding: 0 6px; text-align: center; }
.device-row td { padding-top: 0; border-top: 0; }
.device-list { margin: 0 2px 12px; padding: 12px; border: 1px solid #ffffff0d; border-radius: 14px; background: #05020355; }
.device-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: #8f8184; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.device-heading small { letter-spacing: 0; }
.device-card { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 10px; border-top: 1px solid #ffffff0b; }
.device-card:first-of-type { border-top: 0; }
.device-card strong, .device-card small { display: block; }
.device-card small { margin-top: 3px; color: #8f8184; font-size: 10px; }
.device-empty, .empty-state { color: #8f8184; font-size: 12px; }
.device-empty { margin: 0; padding: 4px 1px; }
.empty-state { padding: 28px 10px; text-align: center; }
.legal-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; padding-top: 20px; color: #756b6d; border-top: 1px solid #ffffff10; font-size: 11px; }
.legal-footer span { margin-right: auto; }
.legal-footer a { color: #bcaeb1; text-decoration: none; }
.legal-footer a:hover { color: white; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .shell { width: min(100% - 24px, 760px); }
  .topbar { align-items: flex-start; gap: 20px; }
  .auth-stage { grid-template-columns: 1fr; gap: 30px; padding: 36px 0; }
  .auth-identity { display: none; }
  .auth-card { width: min(460px, 100%); margin: 0 auto; }
  .device-card { grid-template-columns: 1fr auto; }
  .device-card .table-action { grid-column: 1 / -1; justify-self: start; }
}
