:root {
  --bg: #0b1117;
  --panel: #141d26;
  --panel2: #10171f;
  --line: #2b3742;
  --text: #f6f8fa;
  --muted: #9aabba;
  --gold: #d4a13c;
  --green: #6bd08c;
  --danger: #ef7777;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(
      circle at 75% 0%,
      rgba(212,161,60,.07),
      transparent 32rem
    ),
    var(--bg);

  color: var(--text);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 76px;
  padding: 0 5vw;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--line);
  background: rgba(11,17,23,.88);
  backdrop-filter: blur(18px);
}

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

  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border: 1px solid var(--gold);
  border-radius: 10px;

  color: var(--gold);
  font-weight: 800;
}

.brand-name {
  letter-spacing: .15em;
  font-size: 14px;
  font-weight: 800;
}

.brand-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .16em;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 18px;

  color: var(--muted);
  font-size: 13px;
}

main {
  width: 100%;
  flex: 1;
}

.login-wrap {
  min-height: calc(100vh - 140px);

  display: grid;
  place-items: center;

  padding: 50px 20px;
}

.login-card {
  width: min(470px, 100%);
  padding: 42px;

  border: 1px solid var(--line);
  border-radius: 18px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.025),
      transparent
    ),
    var(--panel);

  box-shadow:
    0 30px 80px rgba(0,0,0,.24);
}

.eyebrow {
  margin-bottom: 12px;

  color: var(--gold);
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.lead {
  max-width: 680px;
  margin: 14px 0 30px;

  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: 8px;

  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;

  margin-bottom: 15px;
  padding: 14px 15px;

  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;

  background: var(--panel2);
  color: var(--text);
}

input:focus {
  border-color: var(--gold);
}

.code-input {
  text-align: center;
  letter-spacing: .35em;
  font-size: 24px;
  font-weight: 700;
}

.button {
  min-height: 42px;
  padding: 0 18px;

  border: 1px solid var(--line);
  border-radius: 8px;

  cursor: pointer;

  background: transparent;
  color: var(--text);

  font-weight: 750;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.button-primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #11161b;
}

.button-gold {
  border-color: var(--gold);
  color: var(--gold);
}

.button-quiet {
  min-height: 35px;
  color: var(--muted);
}

.button-link {
  border: 0;
  color: var(--muted);
}

.full {
  width: 100%;
}

.message,
.dev-code,
.notice {
  margin-top: 15px;
  padding: 12px 14px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: var(--panel2);

  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message.error {
  border-color: rgba(239,119,119,.5);
  color: var(--danger);
}

.dev-code {
  border-color: rgba(212,161,60,.35);
  color: var(--gold);
}

.dashboard {
  width: min(1180px, 92vw);
  margin: 0 auto;
  padding: 60px 0 70px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;

  margin-bottom: 34px;
}

.status-badge,
.pill {
  border: 1px solid rgba(107,208,140,.38);
  border-radius: 999px;

  background: rgba(107,208,140,.08);
  color: var(--green);

  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-badge {
  padding: 9px 14px;
}

.pill {
  padding: 6px 9px;
}

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

  margin-bottom: 16px;
}

.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.card {
  padding: 23px;
}

.card-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

.card-value {
  margin-top: 10px;

  font-size: 25px;
  font-weight: 760;
  text-transform: capitalize;
}

.card-detail {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.mono {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;

  margin-bottom: 16px;
}

.panel {
  padding: 24px;
}

.panel-header,
.release,
.admin-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.panel-header {
  margin-bottom: 24px;
}

.panel-title {
  font-size: 17px;
  font-weight: 760;
}

.panel-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.release {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.release-name {
  font-weight: 740;
}

.notice {
  margin-top: 18px;
}

.account-list {
  margin: 0;
}

.account-list > div {
  display: grid;
  grid-template-columns: 90px 1fr;

  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.account-list > div:last-child {
  border-bottom: 0;
}

.account-list dt {
  color: var(--muted);
  font-size: 12px;
}

.account-list dd {
  margin: 0;
  text-align: right;
  font-size: 13px;
}

.device-panel {
  margin-bottom: 16px;
}

.device-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;

  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.device-name {
  font-weight: 720;
}

.device-meta {
  margin-top: 5px;

  color: var(--muted);
  font-size: 12px;
}

.device-version {
  color: var(--muted);
  font-size: 12px;
}

.admin-panel {
  border-color: rgba(212,161,60,.35);

  background:
    linear-gradient(
      110deg,
      rgba(212,161,60,.08),
      transparent 48%
    ),
    var(--panel);
}

.admin-title {
  margin-top: 3px;
}

footer {
  padding: 25px 5vw;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
}

.footer-dot {
  margin: 0 7px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {

  .topbar {
    padding: 0 20px;
  }

  .account-actions span {
    display: none;
  }

  .login-card {
    padding: 30px 24px;
  }

  .dashboard {
    width: min(92vw, 620px);
    padding-top: 40px;
  }

  .dashboard-heading,
  .admin-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel .button {
    width: 100%;
  }

}
/* ---------------------------------------------------------
   ADMINISTRATION R1
   --------------------------------------------------------- */

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.admin-table td {
  font-size: 13px;
}

.admin-license-id {
  color: var(--muted);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}

.admin-key {
  color: var(--muted);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}

.admin-status {
  display: inline-block;
  padding: 5px 8px;

  border: 1px solid var(--line);
  border-radius: 999px;

  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-status.active {
  color: var(--green);
  border-color: rgba(107,208,140,.4);
  background: rgba(107,208,140,.08);
}

.admin-status.revoked,
.admin-status.expired,
.admin-status.suspended {
  color: var(--muted);
}

.admin-archive {
  color: var(--muted);
  font-size: 12px;
}

/* ---------------------------------------------------------
   ARCHIVE CONTROLS R2
   --------------------------------------------------------- */

.admin-license-action {
  min-width: 82px;
  min-height: 34px;
  padding: 0 12px;

  border: 1px solid var(--line);
  border-radius: 7px;

  background: transparent;
  color: var(--muted);

  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.admin-license-action.archive:hover {
  border-color: rgba(212,161,60,.6);
  color: var(--gold);
}

.admin-license-action.restore {
  border-color: rgba(107,208,140,.4);
  color: var(--green);
}

.admin-license-action:disabled {
  opacity: .45;
  cursor: wait;
}

/* ---------------------------------------------------------
   ARCLADE BRANDING R1
   --------------------------------------------------------- */

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

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

.login-logo {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: contain;
}

@media (max-width: 760px) {
  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .login-logo {
    width: 58px;
    height: 58px;
  }
}

/* ---------------------------------------------------------
   LICENSE CREATE UI R1
   --------------------------------------------------------- */

.admin-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-dialog {
  width: min(92vw, 620px);
  max-height: 88vh;
  overflow-y: auto;

  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;

  background: var(--panel);
  color: var(--text);

  box-shadow:
    0 30px 80px rgba(0,0,0,.55);
}

.portal-dialog::backdrop {
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(3px);
}

.portal-dialog form,
.issued-key-dialog {
  padding: 28px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 24px;
}

.dialog-heading h2 {
  margin: 4px 0 7px;
  font-size: 25px;
}

.dialog-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-close {
  width: 36px;
  height: 36px;

  flex: 0 0 auto;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: transparent;
  color: var(--muted);

  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--text);
  border-color: var(--muted);
}

.license-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.license-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.license-field-wide {
  grid-column: 1 / -1;
}

.license-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.license-field input,
.license-field select,
.license-field textarea {
  width: 100%;
  box-sizing: border-box;

  padding: 11px 12px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: var(--panel2);
  color: var(--text);

  font: inherit;
  outline: none;
}

.license-field textarea {
  resize: vertical;
  min-height: 84px;
}

.license-field input:focus,
.license-field select:focus,
.license-field textarea:focus {
  border-color: var(--gold);
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  margin-top: 24px;
}

.issued-key-warning {
  margin-bottom: 18px;
  padding: 13px 14px;

  border: 1px solid rgba(212,161,60,.34);
  border-radius: 8px;

  background: rgba(212,161,60,.07);
  color: #e8c982;

  font-size: 12px;
  line-height: 1.5;
}

.issued-key-meta {
  margin-bottom: 9px;

  color: var(--muted);
  font-size: 12px;
}

.issued-key-value {
  display: block;
  width: 100%;
  box-sizing: border-box;

  padding: 16px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: #0b1117;
  color: var(--text);

  font-family: Consolas, "Courier New", monospace;
  font-size: 16px;
  line-height: 1.45;

  overflow-wrap: anywhere;
  user-select: all;
}

@media (max-width: 760px) {

  .admin-heading-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .admin-heading-actions .button {
    width: 100%;
  }

  .license-form-grid {
    grid-template-columns: 1fr;
  }

  .license-field-wide {
    grid-column: auto;
  }

  .portal-dialog form,
  .issued-key-dialog {
    padding: 22px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions .button {
    width: 100%;
  }
}

/* ---------------------------------------------------------
   LICENSE MANAGEMENT UI R1
   --------------------------------------------------------- */

.admin-license-action.manage {
  border-color: rgba(212,161,60,.48);
  color: var(--gold);
}

.admin-license-action + .admin-license-action {
  margin-left: 6px;
}

.manage-license-dialog {
  width: min(94vw, 820px);
}

.manage-license-content {
  padding: 28px;
}

.manage-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;

  margin-bottom: 22px;
}

.manage-meta-card {
  padding: 15px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--panel2);
}

.manage-meta-card span,
.manage-info-grid span,
.manage-notes > span {
  display: block;

  margin-bottom: 7px;

  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.manage-meta-card strong {
  display: block;

  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.manage-section {
  margin-top: 18px;
  padding: 19px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: rgba(16,23,31,.55);
}

.manage-section-title {
  margin-bottom: 14px;

  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.manage-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 12px;
}

.manage-section-heading .manage-section-title {
  margin-bottom: 5px;
}

.manage-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}

.manage-info-grid strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.manage-notes {
  margin-top: 18px;
  padding-top: 16px;

  border-top: 1px solid var(--line);

  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.manage-device-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.manage-device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 13px 14px;

  border: 1px solid var(--line);
  border-radius: 9px;

  background: var(--panel2);
}

.manage-device-main {
  min-width: 0;
}

.manage-device-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.manage-device-detail {
  margin-top: 4px;

  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.manage-device-released {
  opacity: .62;
}

.manage-release-button {
  flex: 0 0 auto;
}

.manage-renew-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.manage-inline-actions,
.manage-control-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;

  margin-top: 16px;
}

.manage-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  border-color: rgba(210,88,88,.34);
  background: rgba(135,40,40,.08);
}

.manage-danger-zone .manage-section-title {
  margin-bottom: 4px;
}

.manage-danger-button {
  border: 1px solid rgba(225,92,92,.48);
  background: rgba(160,45,45,.13);
  color: #ef9b9b;
}

.manage-danger-button:hover {
  border-color: rgba(239,155,155,.8);
  color: #ffd0d0;
}

.manage-danger-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 760px) {

  .manage-summary-grid,
  .manage-info-grid,
  .manage-renew-grid {
    grid-template-columns: 1fr;
  }

  .manage-device,
  .manage-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .manage-device .button,
  .manage-danger-zone .button {
    width: 100%;
  }

  .manage-license-content {
    padding: 22px;
  }
}
