:root {
  color-scheme: light;
  --navy: #142238;
  --blue: #225caa;
  --blue-deep: #194c91;
  --ink: #1d2b3e;
  --muted: #637287;
  --line: #dce4ee;
  --paper: #fff;
  --canvas: #f4f7fb;
  --green: #17724c;
  --red: #a82a30;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 86px; display: flex; align-items: center; gap: 14px; padding: 16px max(22px, calc((100% - 1080px) / 2)); color: #fff; background: var(--navy); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #6683a8; border-radius: 12px; color: #fff; background: #203d61; font-size: 24px; font-weight: 800; }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.brand-copy p { margin: 4px 0 0; color: #b9c9dc; font-size: 12px; }
.connection { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #d4e1f1; font-size: 12px; white-space: nowrap; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0b442; box-shadow: 0 0 0 3px #ffffff1c; }
.connection.ready .connection-dot { background: #56d39a; }
.connection.error .connection-dot { background: #ff7379; }
.shell { width: min(1080px, calc(100% - 36px)); margin: 28px auto 40px; }
.tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); }
.tab { padding: 13px 17px; color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: transparent; font-size: 14px; font-weight: 650; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.view { padding: 28px 0 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.section-heading h2 { margin: 5px 0 5px; color: var(--navy); font-size: clamp(22px, 3vw, 27px); letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: #657992; font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.feature-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #cde9dc; border-radius: 999px; color: var(--green); background: #f1fbf6; font-size: 12px; font-weight: 700; white-space: nowrap; }
.card { border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 2px 8px #182d4510; }
.duration-card { padding: 22px 24px 18px; }
.duration-controls { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.duration-controls > label:first-child { color: var(--navy); font-size: 13px; font-weight: 700; }
input[type="number"], select, .search-box input { min-height: 42px; border: 1px solid #cbd6e2; border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
input[type="number"]:focus, select:focus, .search-box:focus-within, .key-line input:focus { border-color: #6a98d1; box-shadow: 0 0 0 3px #2e73c51c; }
#days { width: 112px; padding: 0 12px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); font-size: 13px; }
.check-label input { accent-color: var(--blue); width: 16px; height: 16px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:disabled { cursor: wait; opacity: .6; }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover:not(:disabled) { background: var(--blue-deep); }
.button.secondary { color: var(--navy); border-color: #c9d4e1; background: #fff; }
.button.secondary:hover:not(:disabled) { background: #f1f5f9; }
.button.danger { color: #fff; background: var(--red); }
.button.danger:hover:not(:disabled) { background: #8d2026; }
.field-help { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.issued-card { margin-top: 18px; padding: 22px 24px; }
.issued-head, .detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.issued-head h3, .detail-header h3 { margin: 5px 0 0; color: var(--navy); font-size: 19px; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 750; text-transform: capitalize; }
.status-badge.active { color: #11633f; background: #e7f7ef; }
.status-badge.expired { color: #866115; background: #fff6dc; }
.status-badge.revoked { color: #9e2830; background: #ffebec; }
.key-label { display: block; margin: 18px 0 7px; color: var(--navy); font-size: 12px; font-weight: 700; }
.key-line { display: flex; gap: 8px; }
.key-line input { min-width: 0; flex: 1; min-height: 48px; padding: 0 13px; border: 1px solid #cbd6e2; border-radius: 8px; color: #18324f; background: #f6f9fd; font-family: Consolas, ui-monospace, monospace; font-size: 14px; letter-spacing: .01em; }
.issued-details { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.issued-actions { margin-top: 12px; }
.text-button { padding: 0; color: var(--blue); border: 0; background: transparent; font-size: 13px; font-weight: 700; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 13px 15px; border-radius: 9px; color: #55667b; background: #edf3fa; font-size: 12px; line-height: 1.5; }
.note-icon { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; border: 1px solid #8299b4; border-radius: 50%; font-size: 11px; font-weight: 700; }
.notice { margin: 18px 0 0; padding: 12px 14px; border: 1px solid #d4e2f3; border-radius: 8px; color: #29486c; background: #f1f7fd; font-size: 13px; }
.notice.error { color: #8f2027; border-color: #f0ccd0; background: #fff2f3; }
.notice.success { color: #156641; border-color: #cce6d8; background: #f1fbf5; }
.manage-heading { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 16px; }
.stat-card { display: flex; align-items: center; justify-content: space-between; min-height: 69px; padding: 13px 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { color: var(--navy); font-size: 22px; }
.list-card { overflow: hidden; }
.list-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.search-box { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 11px; border: 1px solid #cbd6e2; border-radius: 8px; color: #73839a; }
.search-box input { width: 100%; min-height: 38px; padding: 0; border: 0; box-shadow: none; }
.filter-label select { min-width: 142px; padding: 0 30px 0 11px; font-size: 13px; }
.license-list { min-height: 108px; }
.license-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.license-table th { padding: 11px 14px; color: #65758a; background: #f8fafc; text-align: left; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.license-table td { padding: 12px 14px; border-top: 1px solid #edf0f4; vertical-align: middle; }
.license-table tr:hover td { background: #f9fbfe; }
.mono { font-family: Consolas, ui-monospace, monospace; font-size: 11px; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.small-button { min-height: 30px; padding: 0 9px; border: 1px solid #d3dce7; border-radius: 6px; color: var(--navy); background: white; font-size: 11px; font-weight: 650; }
.small-button:hover { background: #f0f5fb; }
.small-button.danger { color: #a82a30; border-color: #f1d1d4; }
.empty-state { display: grid; min-height: 128px; place-items: center; padding: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.detail-card { margin-top: 14px; padding: 20px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d6dfeb; border-radius: 7px; color: var(--muted); background: #fff; font-size: 20px; line-height: 1; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px; margin: 18px 0; }
.detail-grid div { min-width: 0; }
.detail-grid dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.detail-grid dd { margin: 0; color: var(--navy); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 13px; border-top: 1px solid #edf0f4; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; color: #7a899b; font-size: 11px; }
.dialog { width: min(470px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 22px 70px #10233d40; }
.dialog::backdrop { background: #101a2a80; backdrop-filter: blur(2px); }
.dialog form { display: grid; gap: 10px; padding: 23px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.dialog h2 { margin: 4px 0; font-size: 21px; color: var(--navy); }
.dialog label { color: var(--navy); font-size: 12px; font-weight: 700; }
.dialog select, .dialog input { width: 100%; padding: 0 11px; }
.dialog-id { margin: -4px 0 7px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  .topbar { min-height: 74px; padding: 13px 17px; gap: 10px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 21px; }
  .brand-copy h1 { font-size: 16px; }
  .brand-copy p { font-size: 10px; }
  .connection { max-width: 100px; font-size: 10px; white-space: normal; }
  .shell { width: min(100% - 24px, 620px); margin-top: 17px; }
  .tab { padding: 12px 11px; font-size: 12px; }
  .view { padding-top: 21px; }
  .section-heading { align-items: flex-start; }
  .section-heading p { max-width: 35ch; font-size: 12px; line-height: 1.5; }
  .feature-pill { padding: 8px 9px; font-size: 10px; }
  .duration-card, .issued-card { padding: 17px; }
  .duration-controls { gap: 10px; }
  .duration-controls > label:first-child { flex: 1 0 100%; }
  #days { width: 92px; }
  .check-label { margin-right: 0; }
  #generate { flex: 1; }
  .key-line { flex-wrap: wrap; }
  .key-line input { flex: 1 0 100%; font-size: 12px; }
  .key-line .button { flex: 1; }
  .stats { gap: 7px; }
  .stat-card { min-height: 58px; padding: 10px; }
  .stat-card span { font-size: 10px; }
  .stat-card strong { font-size: 19px; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .filter-label select { width: 100%; }
  .license-table, .license-table tbody, .license-table tr, .license-table td { display: block; width: 100%; }
  .license-table thead { display: none; }
  .license-table tr { padding: 12px 14px; border-top: 1px solid #edf0f4; }
  .license-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .license-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; }
  .license-table td:first-child { display: block; padding-bottom: 7px; text-align: left; }
  .license-table td:first-child::before { display: block; margin-bottom: 3px; }
  .license-table td:last-child { justify-content: flex-end; padding-top: 9px; }
  .license-table td:last-child::before { display: none; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-actions { justify-content: stretch; }
  .detail-actions .button { flex: 1; padding: 0 8px; font-size: 11px; }
  .footer { font-size: 10px; }
}
