:root {
  color-scheme: dark;
  --bg: #0b0c12;
  --panel: rgba(20, 22, 33, .88);
  --panel-strong: #151722;
  --panel-soft: #1c1e2a;
  --line: rgba(203, 199, 255, .12);
  --muted: #9294a7;
  --text: #f4f2ff;
  --purple: #a28bff;
  --purple-bright: #8066f4;
  --mint: #71dfc3;
  --amber: #e9be77;
  --red: #f28f9a;
  font-family: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(ellipse at 15% 0%, #242043 0, transparent 33%), radial-gradient(ellipse at 92% 34%, #172738 0, transparent 30%), var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(100px); opacity: .12; }
.ambient-a { width: 400px; height: 400px; background: #8066f4; top: -190px; left: -180px; }
.ambient-b { width: 350px; height: 350px; background: #47c9b0; right: -200px; bottom: -190px; }
.shell { width: min(1220px, calc(100% - 44px)); margin: 0 auto; position: relative; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .14em; font-weight: 500; margin-top: 3px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 12px; background: linear-gradient(145deg, #bcadff, #7054db); color: #151129; font-weight: 700; box-shadow: 0 6px 22px #8066f455; }
.brand-logo { display: block; width: 70px; height: 70px; object-fit: contain; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px #71dfc388; }
.status-pill.offline i { background: var(--red); box-shadow: 0 0 12px #f28f9a88; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; min-height: 38px; padding: 0 15px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; transition: .15s ease; text-decoration: none; white-space: nowrap; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary { color: #17122e; background: linear-gradient(135deg, #c1b4ff, #9380f6); box-shadow: 0 5px 20px #8066f433; }
.soft { color: #e7e1ff; background: #9c88ff12; border-color: #aa98ff30; }
.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.danger { color: #ffbbc3; background: #f28f9a14; border-color: #f28f9a35; }
.full { width: 100%; min-height: 47px; margin-top: 10px; }
.hidden { display: none !important; }
.login-layout { min-height: calc(100vh - 83px); display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 9%; padding: 70px 6%; }
.intro { max-width: 540px; }
.eyebrow, .section-kicker { color: var(--purple); font-size: 10px; letter-spacing: .19em; font-weight: 700; }
.intro h1 { font-size: clamp(42px, 5vw, 64px); line-height: 1.16; letter-spacing: -.06em; margin: 20px 0 18px; }
.intro h1 span { color: #b5a5ff; }
.intro p { max-width: 430px; color: #a6a7b7; line-height: 1.9; font-size: 15px; }
.intro-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 36px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; color: #c4c2d2; font-size: 12px; background: #ffffff05; }
.spark { color: var(--mint); font-size: 16px; }
.card { border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, #1c1d29e8, #13151fe8); box-shadow: 0 22px 80px #05060b70; }
.login-card { width: 100%; max-width: 385px; padding: 32px; justify-self: end; }
.login-card h2 { font-size: 23px; margin: 8px 0 26px; letter-spacing: -.035em; }
label { display: flex; flex-direction: column; gap: 8px; color: #c4c3d2; font-size: 12px; font-weight: 500; }
input, select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #ffffff16; border-radius: 9px; background: #0d0f17; color: var(--text); outline: none; }
input::placeholder { color: #67697b; }
input:focus, select:focus { border-color: #a28bff9c; box-shadow: 0 0 0 3px #a28bff18; }
.login-foot { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 17px; color: var(--muted); font-size: 10px; }
.lock { color: var(--mint); margin-right: 5px; }
.form-error { color: var(--red); font-size: 12px; min-height: 16px; margin-bottom: 0; }
.welcome { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 42px 0 25px; }
.welcome h1 { margin: 7px 0 5px; font-size: 30px; letter-spacing: -.04em; }
.welcome p, .panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 29px; }
.metric-card { padding: 18px 19px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, #1a1c28db, #151722d9); }
.metric-card span { display: block; color: #b1b1c0; font-size: 12px; }
.metric-card strong { display: block; margin: 12px 0 4px; font-size: 30px; letter-spacing: -.05em; font-weight: 600; }
.metric-card small { color: #777a8d; font-size: 10px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { position: relative; border: 0; border-radius: 9px 9px 0 0; background: transparent; color: var(--muted); padding: 12px 15px 14px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.tab.active { color: #e8e2ff; background: #9c88ff13; }
.tab.active::after { content: ""; position: absolute; height: 2px; background: var(--purple); bottom: -1px; left: 12px; right: 12px; border-radius: 2px; }
.count-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 9px; margin-left: 5px; background: #ffcf8b; color: #1d1720; font-size: 10px; }
.panel { display: none; padding-top: 24px; }
.panel.active { display: block; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0 0 5px; font-size: 19px; letter-spacing: -.03em; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.search-box { display: flex; align-items: center; gap: 9px; width: min(390px, 100%); height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #10121a; color: #888a9a; }
.search-box input { border: 0; box-shadow: none; height: 36px; padding: 0; background: transparent; }
.muted { color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #11131bcb; }
table { width: 100%; border-collapse: collapse; min-width: 740px; font-size: 12px; }
th { padding: 12px 14px; text-align: left; color: #8c8fa0; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); }
td { padding: 12px 14px; border-bottom: 1px solid #ffffff0b; color: #deddea; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #ffffff04; }
.member-name { font-weight: 600; }
.member-sub { display: block; margin-top: 3px; color: #838596; font-size: 10px; }
.state { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 5px 9px; background: #ffffff09; color: #bec0ce; font-size: 10px; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9497a9; }
.state.active { color: #a5e9d7; background: #71dfc312; }.state.active::before { background: var(--mint); }
.state.pending { color: #f4d69f; background: #e9be7710; }.state.pending::before { background: var(--amber); }
.state.paused, .state.revoked, .state.expired { color: #ffb3bc; background: #f28f9a12; }.state.paused::before, .state.revoked::before, .state.expired::before { background: var(--red); }
.row-actions { display: flex; gap: 6px; }
.mini-button { border: 1px solid var(--line); background: transparent; color: #c8c5d5; border-radius: 7px; padding: 6px 8px; cursor: pointer; font-size: 10px; white-space: nowrap; }
.mini-button:hover { border-color: #a28bff65; color: #ded6ff; }
.mini-button.warn { color: #ffb4bd; }
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 12px; }
.sync-error { color: #ffb3bc; max-width: 280px; white-space: normal; }
.form-drawer { margin-top: 17px; border: 1px solid var(--line); border-radius: 12px; background: #11131b88; }
.form-drawer summary { padding: 15px 17px; cursor: pointer; color: #d4ceef; font-size: 12px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 20px; }
.form-drawer .form-grid { padding-top: 3px; }
.wide { grid-column: 1 / -1; }
.form-grid small { color: #777a8b; font-size: 10px; line-height: 1.5; }
.form-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.check-label { align-self: end; flex-direction: row; align-items: center; min-height: 42px; }
.check-label input, .check-list input { width: 15px; height: 15px; accent-color: var(--purple-bright); }
.resource-form { margin-bottom: 18px; }
.resource-checks { border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.resource-checks legend { padding: 0 8px; color: #c4c3d2; font-size: 12px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 2px; }
.check-list label { flex-direction: row; align-items: center; gap: 7px; font-size: 11px; }
.plan-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; background: #141620d9; padding: 17px; }
.plan-card h3 { margin: 0 0 7px; font-size: 15px; }
.plan-meta { display: flex; gap: 14px; color: var(--muted); font-size: 10px; }
.plan-resources { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 8px; border: 1px solid #9c88ff2d; border-radius: 20px; color: #c7baff; background: #9c88ff10; font-size: 10px; }
.stack-list { display: grid; gap: 10px; }
.request-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 11px; background: #141620d9; padding: 15px 17px; }
.request-card strong { display: block; font-size: 12px; margin-bottom: 4px; }
.request-card small { color: var(--muted); font-size: 10px; }
.application-toolbar { align-items: center; flex-wrap: wrap; }
.application-info { display: grid; gap: 4px; min-width: 0; }
.application-heading { display: flex; align-items: center; gap: 9px; }
.application-heading input { width: 16px; height: 16px; accent-color: var(--purple-bright); }
.application-card { align-items: center; }
.device-card { margin: 8px 0; }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 25px 0 20px; color: #717487; font-size: 10px; }
.detail-dialog { width: min(720px, calc(100% - 26px)); max-height: 90vh; overflow-y: auto; border: 1px solid #b2a3ff42; border-radius: 16px; background: #151722; color: var(--text); padding: 23px; box-shadow: 0 25px 90px #000a; }
.detail-dialog::backdrop { background: #05060acc; backdrop-filter: blur(8px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.dialog-head h2 { margin: 5px 0 0; }
.icon-button { width: 31px; height: 31px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: #aaaabd; cursor: pointer; font-size: 20px; }
.detail-content { color: #c2c2d0; font-size: 11px; line-height: 1.8; }
.detail-content h3 { color: #e6e3f1; font-size: 12px; margin: 15px 0 4px; }
.detail-content code { color: #b7a8ff; }
.compact { padding: 17px 0 0; border-top: 1px solid var(--line); margin-top: 18px; }
.renew-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.token-result { white-space: pre-wrap; overflow-wrap: anywhere; padding: 13px; border: 1px solid #71dfc340; border-radius: 9px; background: #71dfc30d; color: #bbf6e4; font-size: 11px; line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); padding: 10px 15px; border: 1px solid var(--line); border-radius: 9px; background: #222431; color: #efedf9; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: 0 8px 35px #0008; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 780px) {
  .shell { width: min(100% - 28px, 620px); }
  .login-layout { grid-template-columns: 1fr; min-height: auto; padding: 48px 0; gap: 28px; }
  .intro h1 { font-size: 43px; }
  .login-card { justify-self: stretch; max-width: unset; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .welcome { align-items: flex-start; flex-direction: column; padding-top: 30px; }
  .plan-list { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}
@media (max-width: 500px) {
  .form-grid { grid-template-columns: 1fr; padding: 15px; }
  .form-grid > * { grid-column: auto; }
  .form-grid .wide { grid-column: auto; }
  .form-submit { align-items: flex-start; }
  .metrics { gap: 8px; }
  .metric-card { padding: 13px; }
  .metric-card strong { font-size: 25px; }
  .panel-heading { align-items: flex-start; }
  .request-card { align-items: flex-start; flex-direction: column; }
}
