/* dbl0m's Audio License Panel - brushed silver / gray theme */
:root {
  --bg-1: #e7e8ea;
  --bg-2: #b9bcc1;
  --metal-1: #fbfbfc;
  --metal-2: #e3e5e8;
  --metal-3: #cfd2d6;
  --edge: #a3a7ad;
  --edge-soft: #c3c6cb;
  --text: #24262a;
  --text-2: #4a4e55;
  --muted: #6b7078;
  --graphite-1: #747982;
  --graphite-2: #464a51;
  --graphite-3: #2f3237;
  --inset: #f1f2f4;
  --good: #4f7a5c;
  --warn: #8a7340;
  --bad: #8c4a4a;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 -1px 0 rgba(0,0,0,.06) inset, 0 6px 18px rgba(40,44,52,.14), 0 1px 3px rgba(40,44,52,.12);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: #c4c7cc; }
body {
  font: 14px/1.45 var(--font);
  color: var(--text);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, rgba(0,0,0,.018) 1px 3px),
    radial-gradient(1200px 700px at 15% -10%, #f6f7f8 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
a { color: var(--graphite-3); }
code, .mono { font-family: var(--mono); }

/* icons */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -2px; }
.ic.xs { width: 12px; height: 12px; }
.ic.xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* metal surfaces */
.metal {
  background: linear-gradient(180deg, var(--metal-1) 0%, var(--metal-2) 55%, var(--metal-3) 100%);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metal-dark {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #8d9198 0%, #6a6e75 45%, #55595f 100%);
  color: #f3f4f5;
  border-right: 1px solid #44474c;
  box-shadow: 1px 0 0 rgba(255,255,255,.25) inset, 4px 0 18px rgba(0,0,0,.18);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px;
  font: 600 13.5px var(--font); color: var(--text); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, #ffffff 0%, #e6e8eb 50%, #d4d7db 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.95) inset, 0 1px 2px rgba(0,0,0,.12);
  transition: filter .12s, transform .05s, box-shadow .12s;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(0,0,0,.16); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(0,0,0,.2) inset; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, input:focus-visible, .seg button:focus-visible { outline: 2px solid var(--graphite-2); outline-offset: 2px; }
.btn.primary {
  color: #fff; border-color: #2e3136;
  background: linear-gradient(180deg, #858a92 0%, #5b6068 48%, #41454c 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 2px 5px rgba(0,0,0,.25);
  text-shadow: 0 -1px 0 rgba(0,0,0,.35);
}
.btn.danger { color: #6d2e2e; }
.btn.danger:hover { color: #5a1f1f; border-color: #9a7a7a; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.metal-dark .btn.ghost { color: #f1f2f3; }
.metal-dark .btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn.icon { width: 36px; padding: 0; }
.btn.wide { width: 100%; }

/* inputs */
.field { display: block; margin: 0 0 14px; }
.label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--text-2); margin: 0 0 6px; text-transform: none; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .lead { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
input, textarea, select {
  font: 14px var(--font); color: var(--text);
}
.input-wrap input, .custom input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--edge); border-radius: 9px;
  background: linear-gradient(180deg, #e9ebee, var(--inset) 30%, #fff);
  box-shadow: 0 1px 2px rgba(0,0,0,.12) inset;
}
.input-wrap input:focus { outline: none; border-color: var(--graphite-2); box-shadow: 0 1px 2px rgba(0,0,0,.12) inset, 0 0 0 3px rgba(70,74,81,.18); }
.input-wrap .eye { position: absolute; right: 6px; height: 28px; width: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.input-wrap .eye:hover { background: rgba(0,0,0,.06); color: var(--text); }
.grow { flex: 1; min-width: 200px; }

/* custom checkbox */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-weight: 600; color: var(--text-2); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: transparent;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, #fff, #dfe1e4);
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(0,0,0,.12);
}
.check input:checked + .box { color: #fff; border-color: #33363b; background: linear-gradient(180deg, #7e838b, #484c53); }
.check input:focus-visible + .box { outline: 2px solid var(--graphite-2); outline-offset: 2px; }
.check .box .ic { stroke-width: 3; }
.check input:not(:checked) + .box .ic { visibility: hidden; }
.table th .check .box .ic { color: #fff; }
.check.solo { gap: 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; padding: 30px 28px 26px; }
.login-card h1 { margin: 12px 0 2px; text-align: center; font-size: 24px; letter-spacing: .3px; }
.login-card .center { text-align: center; margin: 0 0 22px; }
.login-card .check { margin: 2px 0 18px; }
.brand-badge {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #a9adb3, #5c6068 55%, #3b3e44);
  border: 1px solid #2e3136;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 6px 14px rgba(0,0,0,.25);
}
.brand-badge .ic { width: 30px; height: 30px; }
.brand-badge.sm { width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.brand-badge.sm .ic { width: 20px; height: 20px; }
.form-error { display: flex; align-items: center; gap: 7px; color: var(--bad); font-weight: 600; margin: -6px 0 14px; }

/* app shell */
.app { display: flex; min-height: 100vh; }
.side { width: 240px; flex: none; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 20px; border-bottom: 1px solid rgba(0,0,0,.18); box-shadow: 0 1px 0 rgba(255,255,255,.14); margin-bottom: 14px; }
.side-brand strong { display: block; font-size: 15px; text-shadow: 0 -1px 0 rgba(0,0,0,.3); }
.side-brand small { color: #dfe1e4; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: #eef0f2; text-decoration: none; font-weight: 600; border: 1px solid transparent;
}
.side nav a:hover { background: rgba(255,255,255,.1); }
.side nav a.on {
  color: var(--text);
  background: linear-gradient(180deg, #fafbfb, #dcdfe2);
  border-color: #3f4247;
  box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(0,0,0,.25);
}
.side-foot { border-top: 1px solid rgba(0,0,0,.18); box-shadow: 0 -1px 0 rgba(255,255,255,.14) inset; padding-top: 12px; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; color: #e9ebed; font-weight: 600; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; padding: 18px 26px 40px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 21px; flex: 1; }
.topbar h2 .ic { width: 22px; height: 22px; }
.top-actions { display: flex; gap: 8px; }
.menu-btn { display: none; }

.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border-radius: 10px; border: 1px solid #b6a98a; background: linear-gradient(180deg, #f3efe5, #e3ddcd); color: #5c4f2e; font-weight: 600; }

.card { padding: 18px; }
.card h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: start; }
.page[data-page=settings] .grid-2 { grid-template-columns: minmax(0,1fr) minmax(0,1.7fr); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.page { display: none; }
.page.on { display: block; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 16px; display: flex; gap: 13px; align-items: center; }
.stat .tile {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(180deg, #8a8f97, #4e525a); border: 1px solid #383b40;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 2px 5px rgba(0,0,0,.2);
}
.stat .tile .ic { width: 22px; height: 22px; }
.stat b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; font-size: 12.5px; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-weight: 600; }
.bar-row .lab { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.bar { height: 12px; border-radius: 6px; background: linear-gradient(180deg, #c5c8cc, #e6e8ea); box-shadow: 0 1px 2px rgba(0,0,0,.18) inset; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(180deg, #a2a6ad, #5c6068); }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 11px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--edge-soft); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #fff, #d9dce0); border: 1px solid var(--edge-soft); color: var(--text-2); }
.feed .dot.bad { color: var(--bad); }
.feed .dot.good { color: var(--good); }
.feed .t { color: var(--muted); font-size: 12px; }
.feed .what { font-weight: 600; }
.feed code { font-size: 12px; color: var(--text-2); }

/* toolbar + segmented */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.1); flex-wrap: wrap; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; cursor: pointer;
  font: 600 13px var(--font); color: var(--text-2);
  background: linear-gradient(180deg, #fff, #e1e3e6);
  border-right: 1px solid var(--edge-soft);
}
.seg button:last-child { border-right: 0; }
.seg button.on { color: #fff; background: linear-gradient(180deg, #7b8088, #4a4e55); box-shadow: 0 1px 3px rgba(0,0,0,.3) inset; }

.bulk { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; margin-bottom: 12px; }
.bulk > span { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* tables */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2); padding: 11px 12px; white-space: nowrap;
  background: linear-gradient(180deg, #eef0f2, #d8dbdf); border-bottom: 1px solid var(--edge);
}
.table th .ic { margin-right: 3px; color: var(--muted); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--edge-soft); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: rgba(255,255,255,.55); }
.table tbody tr.sel { background: rgba(120,126,134,.14); }
.table .c-check { width: 44px; }
.table .c-act { width: 120px; text-align: right; }
.table td.c-act { white-space: nowrap; }
.keycell { display: flex; align-items: center; gap: 8px; }
.keycell code { font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.keycell .note { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mini { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.mini:hover { background: linear-gradient(180deg, #fff, #dfe2e5); border-color: var(--edge-soft); color: var(--text); }
.cell-ic { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell-ic .ic { color: var(--muted); }
.table-foot { margin: 0; padding: 10px 14px; font-size: 12.5px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty p { margin: 8px 0 16px; font-weight: 600; }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 12px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  border: 1px solid var(--edge); background: linear-gradient(180deg, #fff, #e0e2e5); color: var(--text-2);
  box-shadow: 0 1px 0 #fff inset;
}
.pill .ic { width: 13px; height: 13px; }
.pill.active { color: var(--good); }
.pill.expired { color: var(--warn); }
.pill.banned { color: var(--bad); }
.pill.unused { color: var(--text-2); }

/* modals */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(48,52,58,.45); backdrop-filter: blur(3px); }
.dialog { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px 20px; }
.dialog.narrow { max-width: 420px; }
.dialog header { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 14px; }
.dialog header h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 17px; }
.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.plan {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 6px; border-radius: 10px; cursor: pointer;
  font: 600 12.5px var(--font); color: var(--text-2);
  border: 1px solid var(--edge); background: linear-gradient(180deg, #fff, #dfe1e4);
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(0,0,0,.1);
}
.plan .ic { width: 20px; height: 20px; }
.plan.on { color: #fff; border-color: #33363b; background: linear-gradient(180deg, #81868e, #4a4e55); box-shadow: 0 1px 3px rgba(0,0,0,.3) inset; }
.custom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ok-line { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--good); margin: 0 0 10px; }
.code {
  display: block; width: 100%; margin: 0 0 12px; padding: 12px; border-radius: 9px; resize: vertical;
  font: 12.5px/1.55 var(--mono); color: #e9ebee; white-space: pre; overflow: auto; max-height: 300px;
  background: linear-gradient(180deg, #43474e, #33363b); border: 1px solid #26282c; box-shadow: 0 2px 6px rgba(0,0,0,.35) inset;
}
.key-hero { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; background: linear-gradient(180deg, #45494f, #33363b); color: #f1f2f3; }
.key-hero code { font-size: 15px; font-weight: 700; letter-spacing: .5px; word-break: break-all; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0 0 16px; }
.details div { min-width: 0; }
.details dt { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.details dd { margin: 2px 0 0; font-weight: 600; word-break: break-all; }
.actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--edge-soft); }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px; font-weight: 600; color: #f3f4f5;
  background: linear-gradient(180deg, #5d6168, #3a3d43); border: 1px solid #26282c; box-shadow: 0 8px 20px rgba(0,0,0,.25);
  animation: pop .18s ease-out; }
.toast.bad .ic { color: #f0b9b9; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* responsive */
@media (max-width: 1100px) { .hide-lg { display: none; } }
@media (max-width: 860px) {
  .hide-md { display: none; }
  .grid-2, .page[data-page=settings] .grid-2 { grid-template-columns: minmax(0,1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 .field:last-child { grid-column: 1 / -1; }
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .main { padding: 12px 16px 32px; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .topbar h2 { font-size: 17px; }
  .details { grid-template-columns: 1fr; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .table .c-act { width: 56px; }
  .table .c-act .mini { display: none; }
  .keycell code { font-size: 12px; white-space: nowrap; }
  .topbar { flex-wrap: wrap; }
  .table td, .table th { padding: 9px 8px; }
}

.link-state { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; margin: 0 0 14px; font-size: 13px; line-height: 1.45; }
.link-state .ic { margin-top: 1px; }
.link-state.ok { color: #2f5a3d; background: linear-gradient(180deg, #eef3ef, #dbe5dd); border: 1px solid #a9bfae; }
.link-state.warn { color: #6a5520; background: linear-gradient(180deg, #f4efe2, #e5dcc6); border: 1px solid #c2b28a; }
.link-state code { font-size: 12px; }
.more { margin-top: 14px; }
.more summary { display: flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 600; color: var(--text-2); margin-bottom: 12px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }

.about-card { max-width: 380px; margin: 10px auto; text-align: center; padding: 30px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.about-pic { width: 180px; height: 180px; border-radius: 22px; object-fit: cover; border: 1px solid var(--edge); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.about-name { justify-content: center; font-size: 20px; margin: 6px 0 0; }
.about-card .muted { margin: 4px 0 0; }
