:root {
  --bg: #eef4f8;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #657481;
  --line: #d6e1e8;
  --soft: #f5f9fc;
  --blue: #2f77a8;
  --blue-dark: #205a82;
  --steel: #8ea3b2;
  --success: #277347;
  --danger: #a33b35;
  --shadow: 0 18px 44px rgba(33, 57, 75, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 119, 168, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(142, 163, 178, 0.14), transparent 34%),
    var(--bg);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0.25rem; font-size: 1.65rem; line-height: 1.08; letter-spacing: 0; }
h2 { margin-bottom: 0.2rem; font-size: 1.35rem; letter-spacing: 0; }
p { margin-bottom: 0; color: var(--muted); line-height: 1.42; }
code { font-family: "Cascadia Mono", Consolas, monospace; }
.hidden { display: none !important; }

.portal-shell { min-height: 100vh; }

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-panel {
  width: min(520px, 100%);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.brand-row.compact {
  margin-bottom: 0;
}

.brand-row.compact span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(33, 57, 75, 0.11);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.25rem;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tab {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  border-radius: 7px;
  min-height: 2.25rem;
  font-weight: 700;
}

.tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.stack-form { display: grid; gap: 0.55rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
label { display: grid; gap: 0.25rem; }
label span { color: var(--muted); font-size: 0.82rem; }

input {
  width: 100%;
  min-height: 2.3rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.48rem 0.6rem;
  background: #fff;
  color: var(--ink);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 4.2rem;
}

.eye-button {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  min-height: 1.65rem;
  border: 0;
  border-radius: 6px;
  padding: 0 0.5rem;
  color: var(--blue-dark);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
}

.eye-button:hover {
  background: var(--soft);
}

.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.35;
}

input:focus {
  outline: 2px solid rgba(47, 119, 168, 0.18);
  border-color: rgba(47, 119, 168, 0.58);
}

.button {
  min-height: 2.3rem;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  padding: 0.48rem 0.78rem;
  font-weight: 800;
}

.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.button.ghost:hover { background: var(--soft); }
.button.full { width: 100%; }

.status {
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.status.error { color: var(--danger); border-color: rgba(163, 59, 53, 0.35); }
.status.success { color: var(--success); border-color: rgba(31, 122, 69, 0.35); }

.dashboard-view {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 1rem;
}

.workspace {
  width: min(980px, 100%);
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.license-list { display: grid; gap: 0.7rem; }

.license-card,
.account-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.9rem;
}

.license-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.license-key {
  overflow-wrap: anywhere;
  padding: 0.8rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.meta-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.6rem;
  background: #fff;
}

.meta-box span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.account-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-top: 0.7rem;
}

.account-panel span {
  color: var(--muted);
  font-size: 0.78rem;
}

.account-panel strong {
  grid-column: 1;
}

.account-panel .button {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
}
.badge.active { color: var(--success); background: rgba(31, 122, 69, 0.1); }
.badge.expired { color: var(--danger); background: rgba(163, 59, 53, 0.1); }

@media (max-width: 760px) {
  .dashboard-view { padding: 0.75rem; }
  .topbar { grid-template-columns: 1fr; align-items: stretch; }
  .license-head { align-items: stretch; flex-direction: column; }
  .form-row, .meta-grid, .key-row, .account-panel { grid-template-columns: 1fr; }
  .account-panel strong,
  .account-panel .button {
    grid-column: auto;
    grid-row: auto;
  }
}
