@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #080a0f;
  --sidebar: #0b0e14;
  --panel: #11151e;
  --panel-2: #151a25;
  --line: #222834;
  --line-soft: rgba(255,255,255,.065);
  --text: #f5f6f8;
  --muted: #8c95a5;
  --muted-2: #616a79;
  --accent: #795cff;
  --accent-light: #a998ff;
  --blue: #51a8ff;
  --green: #29d6a2;
  --red: #ff6b7d;
  --amber: #f5bd56;
  font-family: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
a { color: inherit; }

.shell { display: grid; grid-template-columns: 252px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 18px 18px; border-right: 1px solid var(--line); background: linear-gradient(180deg,#0c0f16,#090c12); }
.sidebar-top { padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.035em; }
.brand > span:last-child { line-height: 1.05; }
.brand small { display: block; margin-top: 5px; color: var(--muted-2); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; filter: drop-shadow(0 8px 16px rgba(0,149,255,.22)); }
.brand-mark img { display: block; width: 46px; height: 46px; object-fit: contain; }
.environment { display: inline-flex; align-items: center; gap: 7px; margin-top: 26px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: #9da6b5; background: rgba(255,255,255,.025); font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; }
.environment i, .live i, .trend.online i, .sidebar-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(41,214,162,.1); }

.sidebar-nav { display: grid; gap: 4px; margin-top: 36px; }
.nav-label { margin: 17px 12px 8px; color: #525b69; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; color: #8f98a8; text-decoration: none; font-size: 13px; font-weight: 600; transition: .18s ease; }
.sidebar-nav a:hover { color: #dfe3e9; background: rgba(255,255,255,.035); }
.sidebar-nav a.active { color: #fff; border-color: rgba(121,92,255,.2); background: linear-gradient(90deg,rgba(121,92,255,.16),rgba(121,92,255,.06)); box-shadow: inset 3px 0 var(--accent); }
.nav-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #929baa; background: rgba(255,255,255,.035); font-size: 13px; }
.sidebar-nav a.active .nav-icon { color: #c7bcff; background: rgba(121,92,255,.18); }
.sidebar-status { margin-top: auto; padding: 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(255,255,255,.018); }
.sidebar-status span { display: flex; align-items: center; gap: 8px; color: #b8c0cc; font-size: 11px; font-weight: 700; }
.sidebar-status small { display: block; margin: 6px 0 0 14px; color: #555e6c; font: 400 9px "DM Mono", monospace; }
.aside-footer { display: grid; grid-template-columns: 34px minmax(0,1fr) 28px; align-items: center; gap: 10px; margin-top: 12px; padding: 13px 8px 2px; border-top: 1px solid var(--line-soft); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #d7d0ff; background: #211b3d; font-size: 12px; font-weight: 800; }
.identity { min-width: 0; }
.identity strong, .identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity strong { font-size: 11px; }
.identity small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.icon-button { width: 28px; height: 28px; border: 0; border-radius: 7px; color: #6f7887; background: transparent; cursor: pointer; }
.icon-button:hover { color: #fff; background: rgba(255,255,255,.05); }

.main-content { min-width: 0; background: radial-gradient(circle at 90% -10%,rgba(121,92,255,.08),transparent 30rem), var(--bg); }
.content-wrap { width: min(1380px,100%); margin: 0 auto; padding: 48px clamp(28px,4vw,62px) 70px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 32px; }
.page-header h1 { margin: 5px 0 8px; font-size: clamp(28px,3.2vw,42px); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; }
.page-header p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0; color: var(--accent-light)!important; font: 500 9px "DM Mono",monospace; letter-spacing: .17em; text-transform: uppercase; }
.header-actions { display: flex; gap: 9px; }
.header-actions a { text-decoration: none; }

.primary, .secondary, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 38px; padding: 9px 14px; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; transition: .17s ease; }
.primary { border: 1px solid #866eff; color: white; background: linear-gradient(180deg,#8066ff,#694ae9); box-shadow: 0 8px 24px rgba(105,74,233,.18), inset 0 1px rgba(255,255,255,.16); }
.primary:hover { transform: translateY(-1px); filter: brightness(1.08); }
.secondary { border: 1px solid #2b3240; color: #c0c7d2; background: #141923; }
.secondary:hover { color: #fff; border-color: #3a4253; background: #1a202b; }
.danger-button { border: 1px solid rgba(255,107,125,.28); color: #ffadba; background: rgba(255,107,125,.08); }
.small { min-height: 29px; padding: 5px 9px; font-size: 10px; }

.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.stats article, .panel, .license-card { border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg,rgba(19,23,33,.98),rgba(13,17,25,.98)); box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.stats article { position: relative; overflow: hidden; padding: 20px; }
.stats article::after { content: ""; position: absolute; width: 110px; height: 110px; right: -50px; bottom: -65px; border-radius: 50%; background: rgba(121,92,255,.06); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.stat-icon { display: grid!important; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: 14px!important; }
.stat-icon.purple { color: #bcafff!important; background: rgba(121,92,255,.13); }
.stat-icon.blue { color: #9bceff!important; background: rgba(81,168,255,.11); }
.stat-icon.green { color: #9bf1d7!important; background: rgba(41,214,162,.1); }
.trend { display: inline-flex!important; align-items: center; gap: 7px; width: max-content; padding: 5px 7px; border: 1px solid var(--line-soft); border-radius: 6px; color: #6c7584!important; font: 500 8px "DM Mono",monospace!important; text-transform: uppercase; letter-spacing: .08em; }
.trend.online { color: #80dcbc!important; }
.stats article > span { display: block; color: #8e97a6; font-size: 11px; font-weight: 600; }
.stats strong { display: block; margin-top: 7px; font-size: 30px; font-weight: 700; letter-spacing: -.05em; }
.stats article > small { display: block; margin-top: 6px; color: #555e6d; font-size: 9px; }
.stats .text-status { font-size: 21px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(300px,.7fr); gap: 16px; align-items: start; }
.panel { margin-bottom: 18px; padding: 20px; }
.panel-heading, .form-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.panel h2 { margin: 0 0 5px; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.panel p { margin: 0; color: var(--muted-2); font-size: 10px; }
.live, .status { display: inline-flex; align-items: center; gap: 7px; width: max-content; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: #737c8b; font-size: 9px; font-weight: 700; }
.live { color: #8be0c3; border-color: rgba(41,214,162,.18); background: rgba(41,214,162,.05); }
.status.good { color: #88dfc1; border-color: rgba(41,214,162,.18); background: rgba(41,214,162,.05); }

.health-list { display: grid; margin-top: 20px; }
.health-list > div { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.health-list > div:last-child { border-bottom: 0; }
.health-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #a99cff; background: rgba(121,92,255,.1); font: 500 8px "DM Mono",monospace; }
.health-list p strong, .health-list p small { display: block; }
.health-list p strong { color: #cbd0d8; font-size: 10px; }
.health-list p small { margin-top: 3px; color: #555e6c; font-size: 8px; }
.health-list b { color: #76cfae; font: 500 8px "DM Mono",monospace; text-transform: uppercase; }
.grace-note { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px; border: 1px solid rgba(121,92,255,.14); border-radius: 11px; background: rgba(121,92,255,.055); }
.grace-note > span { color: #b7aaff; font: 500 17px "DM Mono",monospace; }
.grace-note strong, .grace-note small { display: block; }
.grace-note strong { color: #c8cdd6; font-size: 10px; }
.grace-note small { margin-top: 3px; color: #5d6674; font-size: 8px; }

.table-wrap { overflow-x: auto; margin: 13px -8px -8px; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { text-align: left; color: #586170; font: 500 8px "DM Mono",monospace; letter-spacing: .1em; text-transform: uppercase; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td { color: #aeb5c0; }
tbody tr:last-child td { border-bottom: 0; }
.clickable { cursor: pointer; transition: .14s ease; }
.clickable:hover { background: rgba(121,92,255,.045); }
.tag { padding: 5px 7px; border-radius: 6px; color: #aab3c1; background: #1b202c; font-size: 9px; text-transform: capitalize; }
.empty { padding: 34px!important; color: var(--muted-2)!important; text-align: center!important; }
.actions { text-align: right; }
.action-group { display: flex; justify-content: flex-end; gap: 6px; }

.form-panel { margin-bottom: 16px; }
.stack { display: grid; gap: 17px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form.wide { flex: 1; justify-content: flex-end; }
label { display: grid; gap: 7px; color: #a5adba; font-size: 10px; font-weight: 700; }
label small { color: var(--muted-2); font-weight: 500; }
input, select { min-width: 210px; padding: 10px 11px; border: 1px solid #2c3340; border-radius: 8px; outline: none; color: var(--text); background: #0b0e15; font-size: 11px; transition: .16s ease; }
input::placeholder { color: #444c59; }
input:focus, select:focus { border-color: #7259e8; box-shadow: 0 0 0 3px rgba(121,92,255,.11); }
.check { display: flex; align-items: center; padding: 10px 0; }
.check input { width: 15px; height: 15px; min-width: 0; accent-color: var(--accent); }
.alert { margin-bottom: 17px; padding: 13px 15px; border: 1px solid rgba(121,92,255,.24); border-radius: 10px; color: #d7d0ff; background: rgba(121,92,255,.075); font-size: 11px; line-height: 1.6; }
.alert.success { color: #b9f5df; border-color: rgba(41,214,162,.22); background: rgba(41,214,162,.055); }
.alert.danger { color: #ffb3bd; border-color: rgba(255,107,125,.24); background: rgba(255,107,125,.065); }
code { color: #bcafff; font-family: "DM Mono",monospace; font-size: .92em; }
.key-created { display: grid; gap: 12px; }
.key-created strong, .key-created small { display: block; }
.key-created small { margin-top: 4px; color: #78bfa7; }
.key-panel { display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.key-panel > div:first-child { flex: 0 1 320px; }
.key-panel .eyebrow { margin-bottom: 8px; }
.key-copy-row { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px; border: 1px solid rgba(121,92,255,.18); border-radius: 9px; background: rgba(7,9,14,.58); }
.key-copy-row code { overflow: hidden; flex: 1; padding: 0 8px; color: #d7d0ff; text-overflow: ellipsis; white-space: nowrap; }
.key-copy-row.large { flex: 1 1 520px; max-width: 650px; min-height: 48px; }
.copy-button, .mini-copy { flex: 0 0 auto; border: 1px solid rgba(121,92,255,.34); border-radius: 7px; color: #ded8ff; background: rgba(121,92,255,.14); cursor: pointer; font-size: 10px; font-weight: 800; transition: .15s ease; }
.copy-button { min-width: 76px; padding: 9px 11px; }
.mini-copy { padding: 5px 7px; }
.copy-button:hover, .mini-copy:hover, .copy-button.copied, .mini-copy.copied { color: #fff; background: rgba(121,92,255,.28); }
.copy-button.copied, .mini-copy.copied { border-color: rgba(41,214,162,.35); color: #9af0d3; background: rgba(41,214,162,.1); }
.table-key { display: flex; align-items: center; gap: 7px; }
.table-key > span { color: #5e6775; font-size: 8px; }
.legacy-key { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 14px; }
.legacy-key > p { max-width: 330px; text-align: right; }
.account-key { margin-top: 12px; }
.narrow { max-width: 560px; }
.back { display: inline-block; margin-bottom: 10px; color: var(--accent-light); text-decoration: none; font-size: 11px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); gap: 15px; }
.license-card { padding: 20px; }
.license-card h2 { margin: 16px 0 8px; font-size: 18px; }
.license-card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
dt { color: var(--muted-2); font-size: 9px; }
dd { margin: 5px 0 0; font-size: 12px; font-weight: 700; }

.auth-page { overflow-x: hidden; background: #080a0f; }
.auth-shell { display: grid; grid-template-columns: minmax(400px,1.12fr) minmax(420px,.88fr); min-height: 100vh; }
.auth-visual { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 44px 54px; border-right: 1px solid var(--line); background: radial-gradient(circle at 12% 100%,rgba(121,92,255,.24),transparent 28rem),linear-gradient(145deg,#111520,#090c13); }
.auth-visual::before { content:""; position:absolute; inset:0; opacity:.13; background-image:linear-gradient(rgba(255,255,255,.14) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.14) 1px,transparent 1px); background-size:52px 52px; mask-image:linear-gradient(to bottom,black,transparent 90%); }
.auth-visual::after { content:"V"; position:absolute; right:-3vw; bottom:-16vw; color:rgba(255,255,255,.017); font-size:48vw; font-weight:800; line-height:1; transform:rotate(-8deg); }
.auth-brand, .visual-copy, .platform-row { position: relative; z-index: 1; }
.visual-copy { margin: auto 0; max-width: 650px; }
.visual-kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 27px; color: #a49dab; font: 500 9px "DM Mono",monospace; letter-spacing:.12em; text-transform:uppercase; }
.visual-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(41,214,162,.1); }
.visual-copy h1 { margin: 0; font-size: clamp(42px,5vw,72px); line-height: .98; letter-spacing: -.065em; }
.visual-copy h1 em { color: #9f8dff; font-style: normal; }
.visual-copy p { max-width: 500px; margin: 24px 0 0; color: #8e97a6; font-size: 15px; line-height: 1.75; }
.platform-row { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-row span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; color: #697282; background: rgba(255,255,255,.025); font: 500 8px "DM Mono",monospace; text-transform: uppercase; letter-spacing:.07em; }
.auth-panel { display: grid; place-items: center; padding: 44px; background: #0a0d13; }
.auth-card { width: min(390px,100%); }
.auth-copy { margin: 16px 0 28px; }
.auth-copy h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.045em; }
.auth-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.input-wrap { position: relative; display: block; }
.input-wrap input { width: 100%; min-width: 0; height: 44px; padding-left: 39px; }
.input-icon { position: absolute; z-index: 1; left: 13px; top: 50%; color: #5e6674; font: 500 12px "DM Mono",monospace; transform: translateY(-50%); }
.auth-submit { width: 100%; height: 43px; margin-top: 3px; }
.auth-submit span { margin-left: auto; font-size: 16px; }
.auth-note { margin: 20px 0 0; color: #48515e; font-size: 9px; text-align: center; }

@media (max-width: 1050px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .health-panel { display: none; }
  .auth-visual { padding: 36px; }
}
@media (max-width: 840px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 18px; flex-direction: row; align-items: center; gap: 16px; }
  .sidebar-top { padding: 0; }
  .environment, .sidebar-status, .aside-footer { display: none; }
  .sidebar-nav { display: flex; gap: 4px; margin: 0 0 0 auto; }
  .nav-label, .nav-icon { display: none; }
  .sidebar-nav a { padding: 8px 10px; font-size: 10px; }
  .sidebar-nav a.active { box-shadow: none; }
  .content-wrap { padding: 34px 20px 60px; }
  .stats { grid-template-columns: 1fr; }
  .page-header, .panel-heading, .form-panel { align-items: stretch; flex-direction: column; }
  .key-panel, .legacy-key { align-items: stretch; flex-direction: column; }
  .legacy-key > p { max-width: none; text-align: left; }
  .key-copy-row.large { flex-basis: auto; width: 100%; }
  .inline-form { display: grid; width: 100%; }
  .inline-form label, .inline-form input, .inline-form select { width: 100%; min-width: 0; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 360px; padding: 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .visual-copy { margin: 65px 0; }
  .visual-copy h1 { font-size: 45px; }
}
@media (max-width: 560px) {
  .sidebar { overflow: hidden; padding: 12px 10px; gap: 8px; }
  .brand > span:last-child { display: none; }
  .sidebar-nav { gap: 1px; }
  .sidebar-nav a { padding: 8px 7px; white-space: nowrap; font-size: 9px; }
  .page-header { align-items: flex-start; }
  .header-actions { width: 100%; }
  .header-actions a { flex: 1; }
  .auth-visual { min-height: 300px; }
  .visual-copy { margin: 45px 0; }
  .visual-copy h1 { font-size: 36px; }
  .visual-copy p { font-size: 12px; }
  .platform-row { display: none; }
  .auth-panel { padding: 40px 22px; }
}
