:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #10151b;
  color: #eef3f6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: #10151b;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }

.app-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.topbar, .summary-bar, .table-toolbar, .input-row, .key-display {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  padding: 0 0 26px;
  border-bottom: 1px solid #2b353e;
}

.eyebrow {
  margin: 0 0 7px;
  color: #71d6ca;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 31px; font-weight: 700; line-height: 1.1; }
h2 { margin-bottom: 0; font-size: 21px; line-height: 1.2; }
.section-note { margin: 8px 0 0; color: #8998a3; font-size: 13px; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #aab7c0;
  font-size: 14px;
}

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8b98a2; }
.connection.is-connected { color: #9be4bd; }
.connection.is-connected .status-dot { background: #48c985; }

.login-section, .create-section, .licenses-section { padding: 30px 0; border-bottom: 1px solid #2b353e; }
.login-form { width: min(620px, 100%); margin-top: 22px; }
label { display: grid; gap: 8px; color: #bdc9d0; font-size: 14px; font-weight: 600; }
.input-row { gap: 10px; }
input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #42505c;
  border-radius: 5px;
  background: #151d24;
  color: #eef3f6;
  outline: none;
}
input:focus { border-color: #71d6ca; box-shadow: 0 0 0 3px rgba(113, 214, 202, .14); }
.field-note, .optional { color: #8998a3; font-size: 12px; font-weight: 400; }
.field-note { margin: 10px 0 0; }

.primary-button, .secondary-button, .quiet-button {
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 700;
  white-space: nowrap;
}
.primary-button { padding: 11px 16px; background: #68d5c5; color: #09231f; }
.primary-button:hover { background: #8ae2d5; }
.secondary-button { padding: 9px 12px; background: #1d2a34; color: #d8e3e8; border-color: #42505c; }
.secondary-button:hover { background: #263743; }
.quiet-button { padding: 8px 0; background: transparent; color: #c7d3d9; }
.quiet-button:hover { color: #71d6ca; }

.summary-bar {
  gap: 38px;
  padding: 20px 0;
  border-bottom: 1px solid #2b353e;
}
.summary-bar div { display: grid; gap: 1px; }
.summary-bar span { font-size: 23px; font-weight: 700; }
.summary-bar small { color: #99a8b2; font-size: 12px; }
.summary-bar .quiet-button { margin-left: auto; }

.license-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr); gap: 18px; margin-top: 22px; }
.lifetime-switch { align-content: center; grid-auto-flow: column; grid-template-columns: 18px max-content; justify-content: start; gap: 9px; color: #e1e8eb; }
.lifetime-switch input { width: 17px; height: 17px; accent-color: #68d5c5; }
.form-actions { align-self: end; }

.table-toolbar { justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.search-label { width: min(300px, 42vw); }
.table-wrap { overflow-x: auto; border: 1px solid #2b353e; border-radius: 6px; background: #121a20; }
table { width: 100%; min-width: 820px; border-collapse: collapse; text-align: left; }
th { padding: 12px 15px; color: #9fb0ba; background: #151d24; font-size: 12px; font-weight: 700; }
td { padding: 15px; border-top: 1px solid #2b353e; color: #dce5e9; font-size: 14px; vertical-align: middle; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: #17222a; }
.license-note { display: grid; gap: 3px; }
.license-note small { color: #82939e; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e39a60; }
.status.active::before { background: #48c985; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 300px; }
.action-button { padding: 6px 8px; border: 1px solid #42505c; border-radius: 4px; background: #18222b; color: #d9e4e8; font-size: 12px; font-weight: 700; }
.action-button:hover { border-color: #71d6ca; color: #71d6ca; }
.action-button.danger { border-color: #70464a; color: #f4b4ac; }
.action-button.danger:hover { border-color: #e8786c; background: #321f23; color: #ffb5ac; }
.empty-state { margin: 0; padding: 36px; color: #9aaab4; text-align: center; }

dialog { width: min(560px, calc(100% - 30px)); border: 1px solid #3b4b56; border-radius: 7px; background: #151d24; color: #eef3f6; box-shadow: 0 22px 70px rgba(0, 0, 0, .55); }
dialog::backdrop { background: rgba(5, 9, 12, .75); }
.dialog-content { display: grid; gap: 20px; padding: 10px; }
.dialog-copy { margin: -10px 0 0; color: #aab8c0; }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; border: 1px solid #394955; border-radius: 5px; overflow: hidden; background: #394955; }
.detail-list div { min-width: 0; padding: 12px; background: #11181e; }
.detail-list .detail-wide { grid-column: 1 / -1; }
.detail-list dt { color: #90a1ab; font-size: 11px; font-weight: 700; }
.detail-list dd { margin: 5px 0 0; color: #edf3f5; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.detail-key-row dd { display: grid; gap: 10px; }
.detail-key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.key-display { gap: 10px; padding: 12px; border: 1px solid #41515d; border-radius: 5px; background: #0e1419; }
code { flex: 1; color: #8ae2d5; font-size: 15px; overflow-wrap: anywhere; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 13px 15px; border: 1px solid #e8786c; border-radius: 5px; background: #311d20; color: #ffe6e2; }

@media (max-width: 700px) {
  .app-shell { width: min(100% - 28px, 1200px); padding-top: 25px; }
  h1 { font-size: 26px; }
  .topbar { align-items: flex-end; }
  .summary-bar { gap: 20px; flex-wrap: wrap; }
  .summary-bar .quiet-button { margin-left: 0; }
  .license-form { grid-template-columns: 1fr; }
  .table-toolbar { align-items: flex-end; }
  .search-label { width: 48%; }
  .input-row { align-items: stretch; flex-direction: column; }
  .input-row .primary-button { width: 100%; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list .detail-wide { grid-column: auto; }
}

:root {
  --canvas: #0d0f0d;
  --surface: #151815;
  --surface-raised: #1a1e1a;
  --line: #30362f;
  --line-strong: #4a5448;
  --text: #f0f2ec;
  --muted: #9da69c;
  --subtle: #6f786f;
  --accent: #b8dc7a;
  --accent-hover: #cae99b;
  --accent-ink: #202b10;
  --good: #8fd3a2;
  --warn: #e2bb78;
  --danger: #ec9388;
  background: var(--canvas);
  color: var(--text);
}

body { background: var(--canvas); line-height: 1.35; }
.app-shell { width: min(1260px, calc(100% - 48px)); padding: 28px 0 72px; }
.topbar { min-height: 72px; padding-bottom: 24px; border-color: var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #d5eba7; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; }
.eyebrow { margin-bottom: 5px; color: var(--subtle); font-size: 11px; font-weight: 750; }
h1 { font-size: 26px; font-weight: 720; }
h2 { font-size: 18px; font-weight: 720; }
.section-note { color: var(--muted); }
.connection { color: var(--muted); font-size: 13px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; background: var(--subtle); }
.connection.is-connected { color: var(--good); }
.connection.is-connected .status-dot { background: var(--good); }

.login-section, .create-section, .licenses-section { padding: 30px 0; border-color: var(--line); }
label { color: var(--muted); font-size: 13px; font-weight: 680; }
input { height: 42px; padding: 0 12px; border-color: var(--line-strong); background: #101210; color: var(--text); }
input::placeholder { color: #687167; }
input:hover { border-color: #667260; }
input:focus { border-color: var(--accent); background: #121510; box-shadow: 0 0 0 3px rgba(184, 220, 122, .12); }
.field-note, .optional { color: var(--subtle); }

.primary-button, .secondary-button, .quiet-button { min-height: 40px; font-weight: 720; }
.primary-button { background: var(--accent); color: var(--accent-ink); }
.primary-button:hover { background: var(--accent-hover); }
.secondary-button { border-color: var(--line-strong); background: #20241f; color: var(--text); }
.secondary-button:hover { border-color: #788672; background: #292f27; }
.quiet-button { color: var(--muted); }
.quiet-button:hover { color: var(--text); }

.summary-bar { display: grid; grid-template-columns: repeat(3, minmax(118px, 1fr)) auto; gap: 0; padding: 18px 0; border-color: var(--line); }
.summary-bar div { min-height: 48px; padding: 0 22px; border-left: 1px solid var(--line); }
.summary-bar div:first-child { padding-left: 0; border-left: 0; }
.summary-bar span { font-size: 22px; font-weight: 740; }
.summary-bar small { color: var(--muted); font-weight: 600; }
.summary-bar .quiet-button { margin-left: 28px; }

.dashboard-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tab-button { min-height: 46px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 720; }
.tab-button:hover { color: var(--text); }
.tab-button.is-active { border-bottom-color: var(--accent); color: var(--text); }
.tab-button span { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 5px; border-radius: 10px; background: #2a3225; color: var(--accent); font-size: 11px; }
.reports-section { padding: 30px 0; }
.reports-list { display: grid; gap: 10px; }
.report-item { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.report-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.report-heading strong { color: var(--text); font-size: 14px; }
.report-heading time, .report-item small { color: var(--subtle); font-size: 12px; }
.report-message { margin: 10px 0 7px; color: #f0c2bb; overflow-wrap: anywhere; }
.report-item details { margin-top: 12px; }
.report-item summary { color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.report-item pre { max-height: 260px; margin: 9px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--line); background: #101210; color: #cfd7cb; font: 11px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.reports-empty { border: 1px solid var(--line); background: var(--surface); }

.license-form { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 16px; margin-top: 20px; }
.license-form > label:nth-child(1) { grid-column: span 5; }
.license-form > label:nth-child(2) { grid-column: span 5; }
.license-form > .lifetime-switch { grid-column: span 2; }
.license-form > #expiry-field { grid-column: 1 / span 3; }
.form-actions { grid-column: 11 / -1; justify-self: end; }
.form-actions .primary-button { width: 100%; }
.lifetime-switch { min-height: 42px; color: var(--text); }
.lifetime-switch input { accent-color: var(--accent); }

.table-toolbar { gap: 26px; margin-bottom: 18px; }
.table-wrap { border-color: var(--line); background: var(--surface); }
table { min-width: 920px; }
th { color: var(--subtle); background: #111410; font-size: 11px; font-weight: 760; }
td { border-color: #292e29; color: #dde1d9; font-size: 13px; }
tbody tr:hover { background: #1c211c; }
.license-note strong { color: var(--text); font-size: 14px; }
.license-note small { color: var(--subtle); }
.status { color: var(--warn); font-weight: 720; }
.status::before { background: var(--warn); }
.status.active { color: var(--good); }
.status.active::before { background: var(--good); }
.actions { min-width: 305px; gap: 6px; }
.action-button { min-height: 30px; border-color: var(--line-strong); background: #20241f; color: #d7ddd2; font-size: 11px; font-weight: 720; }
.action-button:hover { border-color: #93a28b; background: #293028; color: var(--text); }
.action-button.danger { border-color: #734c48; color: #f2bbb4; }
.action-button.danger:hover { border-color: var(--danger); background: #33211f; color: #ffd0ca; }

dialog { border-color: var(--line-strong); background: #171a16; color: var(--text); }
.dialog-copy { color: var(--muted); }
.detail-list { border-color: var(--line); background: var(--line); }
.detail-list div { background: #111410; }
.detail-list dt { color: var(--subtle); }
.detail-list dd { color: var(--text); }
.key-display { border-color: var(--line-strong); background: #101210; }
code { color: var(--accent); }
.toast { border-color: #824e49; background: #2c1c1a; color: #ffe0dc; }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 28px, 1260px); padding-top: 22px; }
  .summary-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 15px; }
  .summary-bar div { min-width: 0; padding: 0 12px; }
  .summary-bar div:first-child { padding-left: 0; }
  .summary-bar .quiet-button { grid-column: 1 / -1; justify-self: start; margin-left: 0; }
  .report-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .license-form { grid-template-columns: 1fr 1fr; }
  .license-form > label:nth-child(n), .license-form > #expiry-field, .form-actions { grid-column: auto; }
  .license-form > label:nth-child(1), .license-form > label:nth-child(2) { grid-column: 1 / -1; }
  .form-actions { justify-self: stretch; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; gap: 15px; }
  .connection { padding-top: 7px; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-label { width: 100%; }
  .license-form { grid-template-columns: 1fr; }
  .license-form > label:nth-child(n), .license-form > #expiry-field, .form-actions { grid-column: 1; }
}
