:root {
  --bg: #07101a;
  --bg-soft: rgba(10, 19, 30, 0.82);
  --card: rgba(12, 24, 36, 0.9);
  --line: rgba(135, 202, 244, 0.14);
  --line-strong: rgba(135, 202, 244, 0.26);
  --text: #edf6fb;
  --muted: #9bb2c4;
  --accent: #8fd2ff;
  --accent-strong: #32a8d8;
  --danger: #ff7c8c;
  --ok: #85f0bf;
  --warning: #ffd470;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --radius: 24px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(50, 168, 216, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(0, 196, 179, 0.18), transparent 22%),
    linear-gradient(160deg, #040a10 0%, #08131d 36%, #07101a 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  margin: 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(13, 26, 39, 0.96), rgba(6, 12, 19, 0.84));
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: 124px;
  height: 68px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 6px;
  color: #7fd9ff;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
}

.muted {
  margin: 4px 0 0;
  color: var(--muted);
}

.actions,
.row-actions,
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hub-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 0;
}

.hub-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
}

.hub-tab.is-active {
  background: linear-gradient(135deg, #9fe4ff, #32a8d8);
  color: #041119;
  border-color: transparent;
  box-shadow: 0 12px 34px rgba(50, 168, 216, 0.24);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, opacity 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn svg {
  flex: 0 0 auto;
}

.btn-primary {
  background: linear-gradient(135deg, #9fe4ff, #32a8d8);
  color: #041119;
  box-shadow: 0 12px 34px rgba(50, 168, 216, 0.24);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(135deg, #ff9aa9, #ff6e80);
  color: #20060b;
}

.btn-icon {
  gap: 10px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn.is-static {
  cursor: default;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 18px;
  padding: 18px 0 36px;
}

.stack {
  display: grid;
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12, 24, 36, 0.92), rgba(7, 14, 22, 0.9));
  box-shadow: var(--shadow);
  padding: 24px;
}

.card h1,
.card h2,
.card h3 {
  margin: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head p {
  margin: 8px 0 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.license-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 13, 19, 0.85);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 108px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(50, 168, 216, 0.16);
}

.flash {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.flash-success {
  border-color: rgba(133, 240, 191, 0.28);
  background: rgba(133, 240, 191, 0.1);
}

.flash-error {
  border-color: rgba(255, 124, 140, 0.26);
  background: rgba(255, 124, 140, 0.1);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill-ok {
  background: rgba(133, 240, 191, 0.14);
  color: var(--ok);
}

.pill-warning {
  background: rgba(255, 212, 112, 0.14);
  color: var(--warning);
}

.pill-danger {
  background: rgba(255, 124, 140, 0.14);
  color: var(--danger);
}

.empty-state {
  padding: 18px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.license-card,
.device-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(50, 168, 216, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(9, 19, 28, 0.86), rgba(7, 14, 22, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.license-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.license-card-top,
.device-card-top,
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.license-key {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.license-user strong,
.device-card-title h4 {
  display: block;
  margin: 0;
  font-size: 17px;
}

.license-meta-grid,
.device-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.license-stat,
.device-meta-item {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.license-stat span,
.device-meta-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.license-stat strong,
.device-meta-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.license-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.device-modal {
  width: min(1100px, calc(100% - 32px));
  max-width: 1100px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.device-modal::backdrop {
  background: rgba(2, 8, 14, 0.82);
  backdrop-filter: blur(8px);
}

.modal-shell {
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(50, 168, 216, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(10, 21, 31, 0.98), rgba(5, 11, 18, 0.96));
  box-shadow: var(--shadow);
  padding: 24px;
}

.device-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
}

.device-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.device-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(143, 210, 255, 0.1);
  color: var(--accent);
}

.device-icon svg {
  width: 22px;
  height: 22px;
}

.device-card-title {
  flex: 1 1 auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

td {
  font-size: 14px;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
}

.login-card .brand {
  margin-bottom: 24px;
}

.hint-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.plan-shop-card,
.download-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(50, 168, 216, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(9, 19, 28, 0.86), rgba(7, 14, 22, 0.92));
}

.plan-shop-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.price-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(143, 210, 255, 0.14);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

@media (max-width: 1080px) {
  .layout,
  .grid-2,
  .grid-3,
  .plan-grid,
  .download-grid,
  .license-card-grid,
  .device-card-grid,
  .device-meta {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .license-card-top,
  .device-card-top,
  .modal-head {
    flex-direction: column;
    align-items: flex-start;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  td {
    padding: 8px 0;
    border: 0;
  }
}
