:root {
    color-scheme: dark;
    --bg: #08101d;
    --bg-deep: #060c16;
    --panel: #0f1a2b;
    --panel-2: #121f33;
    --panel-3: #17263d;
    --line: #24344d;
    --line-soft: rgba(148, 163, 184, .14);
    --text: #f3f7ff;
    --muted: #8ea0bb;
    --muted-2: #6f829e;
    --blue: #5b7fff;
    --blue-hover: #6d8dff;
    --green: #37d69b;
    --amber: #f6b84b;
    --red: #ff667d;
    --purple: #a678ff;
    --shadow: 0 22px 65px rgba(0, 0, 0, .24);
    --radius: 18px;
    --radius-small: 11px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 26px;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
summary,
select {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(91, 127, 255, .38);
    outline-offset: 2px;
}

a {
    color: inherit;
    text-decoration: none;
}

code,
pre {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

[hidden] {
    display: none !important;
}

.eyebrow {
    margin: 0 0 5px;
    color: #7891b4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.subtle {
    color: var(--muted);
}

.text-danger {
    color: var(--red) !important;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(122, 151, 255, .42);
    border-radius: 13px;
    background: linear-gradient(145deg, #6386ff, #405bd5);
    box-shadow: 0 9px 28px rgba(71, 95, 214, .35), inset 0 1px rgba(255, 255, 255, .26);
    color: white;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand-mark-large {
    width: 64px;
    height: 64px;
    margin-bottom: 36px;
    border-radius: 19px;
    font-size: 20px;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
    transition: border-color .18s, background .18s, color .18s, transform .18s;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, #6385ff, #4c68e6);
    box-shadow: 0 10px 25px rgba(76, 104, 230, .22);
    color: white;
}

.button-primary:hover {
    background: linear-gradient(135deg, #7291ff, #5874ed);
}

.button-secondary {
    border-color: #354966;
    background: #182740;
}

.button-secondary:hover,
.button-ghost:hover {
    border-color: #4b6286;
    background: #1c2d48;
}

.button-ghost {
    border-color: var(--line);
    background: #111d30;
    color: #c8d3e4;
}

.button-success {
    border-color: rgba(55, 214, 155, .24);
    background: rgba(55, 214, 155, .14);
    color: #77efc3;
}

.button-success:hover {
    background: rgba(55, 214, 155, .22);
}

.button-danger {
    background: linear-gradient(135deg, #df4965, #b52e4a);
    color: white;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .42;
    transform: none;
}

.button-small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 12px;
}

.button-large {
    width: 100%;
    min-height: 50px;
    margin-top: 7px;
    border-radius: 12px;
    font-size: 14px;
}

.icon-button,
.text-button {
    border: 0;
    background: transparent;
    color: #8da9ff;
    font-size: 11px;
    font-weight: 800;
}

.icon-button:hover,
.text-button:hover {
    color: #c2d0ff;
}

/* Login */
.login-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-deep);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.15fr) minmax(430px, .85fr);
}

.login-visual {
    position: relative;
    display: grid;
    overflow: hidden;
    place-items: center;
    padding: 70px;
    border-right: 1px solid rgba(123, 145, 181, .12);
    background:
        linear-gradient(rgba(8, 17, 31, .45), rgba(8, 17, 31, .72)),
        radial-gradient(circle at 22% 16%, rgba(91, 127, 255, .26), transparent 32%),
        radial-gradient(circle at 78% 78%, rgba(55, 214, 155, .13), transparent 30%),
        #0b1525;
}

.login-visual::before {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 50px 50px;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.login-visual-content {
    position: relative;
    z-index: 2;
    max-width: 580px;
}

.login-visual h1 {
    max-width: 650px;
    margin: 0 0 24px;
    font-size: clamp(45px, 5.5vw, 78px);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: 1.03;
}

.login-visual-content > p:not(.eyebrow) {
    max-width: 540px;
    margin: 0;
    color: #9aabc2;
    font-size: 17px;
    line-height: 1.7;
}

.feature-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 38px;
}

.feature-chips span {
    padding: 8px 13px;
    border: 1px solid rgba(137, 160, 198, .2);
    border-radius: 999px;
    background: rgba(19, 34, 55, .75);
    color: #b8c5d8;
    font-size: 12px;
    font-weight: 700;
}

.visual-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(1px);
}

.visual-orb-one {
    top: -180px;
    right: -220px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(91, 127, 255, .22);
    box-shadow: inset 0 0 120px rgba(91, 127, 255, .07);
}

.visual-orb-two {
    bottom: -130px;
    left: -120px;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(55, 214, 155, .18);
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 48px;
    background: #09111e;
}

.login-card {
    width: min(100%, 420px);
}

.login-card h2 {
    margin: 2px 0 7px;
    font-size: 33px;
    letter-spacing: -.035em;
}

.login-card > .subtle {
    margin: 0 0 32px;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 11px;
    margin-bottom: 40px;
}

.login-footnote {
    margin: 24px 0 0;
    color: var(--muted-2);
    font-size: 11px;
    text-align: center;
}

/* Forms */
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 17px;
}

.field > span:first-child,
.filter-field > span {
    color: #a8b6c9;
    font-size: 12px;
    font-weight: 700;
}

.field small {
    color: var(--muted-2);
    font-weight: 500;
}

.field input,
.field select,
.field textarea,
.search-field input,
.filter-field select {
    width: 100%;
    border: 1px solid #293a55;
    border-radius: 10px;
    background: #0b1525;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.field input,
.field select {
    height: 46px;
    padding: 0 13px;
}

.field textarea {
    min-height: 92px;
    padding: 12px 13px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder {
    color: #53657e;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.filter-field select:focus {
    border-color: #627ff0;
    background: #0c1728;
    box-shadow: 0 0 0 3px rgba(91, 127, 255, .13);
    outline: 0;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 65px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 11px;
    border: 0;
    background: transparent;
    color: #8da9ff;
    font-size: 11px;
    font-weight: 800;
    transform: translateY(-50%);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-hint {
    margin: -5px 0 3px;
    color: var(--muted);
    font-size: 12px;
}

/* App shell */
.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 24px 18px 18px;
    border-right: 1px solid #17243a;
    background: #090f1a;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
    letter-spacing: -.01em;
}

.brand small {
    margin-top: 1px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 42px;
}

.nav-link {
    display: flex;
    min-height: 43px;
    align-items: center;
    gap: 12px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #8090a7;
    font-size: 13px;
    font-weight: 700;
    transition: background .18s, color .18s, border-color .18s;
}

.nav-link:hover {
    background: #111b2b;
    color: #c9d4e4;
}

.nav-link.active {
    border-color: rgba(91, 127, 255, .16);
    background: linear-gradient(90deg, rgba(91, 127, 255, .18), rgba(91, 127, 255, .06));
    color: #dce5ff;
}

.nav-icon {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    place-items: center;
    color: #92a9e9;
    font-size: 16px;
}

.nav-count {
    min-width: 20px;
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(246, 184, 75, .18);
    color: #ffd07d;
    font-size: 10px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 7px 18px;
    color: #b8c4d4;
}

.service-status strong,
.service-status small {
    display: block;
}

.service-status strong {
    font-size: 11px;
}

.service-status small {
    color: var(--muted-2);
    font-size: 9px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(55, 214, 155, .1), 0 0 14px rgba(55, 214, 155, .45);
}

.signout-button {
    display: flex;
    width: 100%;
    height: 42px;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    border: 1px solid #1e2b40;
    border-radius: 10px;
    background: #0d1625;
    color: #8494aa;
    font-size: 12px;
    font-weight: 700;
}

.signout-button:hover {
    border-color: #3b3040;
    color: #e9a4af;
}

.main-content {
    width: 100%;
    max-width: 1700px;
    min-width: 0;
    margin: 0 auto;
    padding: 30px clamp(22px, 3vw, 50px) 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(24px, 2.2vw, 32px);
    letter-spacing: -.035em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.server-clock {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 15px;
    border-right: 1px solid var(--line);
}

.server-clock small,
.server-clock strong {
    display: block;
}

.server-clock small {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.server-clock strong {
    color: #cbd5e4;
    font-size: 11px;
}

.mobile-menu {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
}

/* Alerts */
.alert {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border: 1px solid;
    border-radius: 11px;
    color: #dbe7f4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.alert-success {
    border-color: rgba(55, 214, 155, .24);
    background: rgba(31, 118, 87, .2);
}

.alert-error {
    border-color: rgba(255, 102, 125, .26);
    background: rgba(141, 43, 62, .22);
}

.login-card .alert {
    margin: -14px 0 22px;
}

.alert-icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    font-size: 12px;
    font-weight: 900;
}

.alert [data-dismiss] {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 18px;
    opacity: .7;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 20px;
}

.metric-card {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 13px;
    overflow: hidden;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(145deg, #111e31, #0d1829);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .1);
}

.metric-card::after {
    position: absolute;
    right: -45px;
    bottom: -50px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    filter: blur(42px);
    opacity: .08;
}

.metric-icon {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    font-size: 17px;
    font-weight: 900;
}

.metric-card span,
.metric-card strong,
.metric-card small {
    display: block;
}

.metric-card span {
    color: #91a2ba;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.metric-card strong {
    margin: 1px 0 0;
    color: var(--text);
    font-size: 25px;
    letter-spacing: -.04em;
}

.metric-card small {
    overflow: hidden;
    color: var(--muted-2);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-blue { color: var(--blue); }
.metric-green { color: var(--green); }
.metric-amber { color: var(--amber); }
.metric-purple { color: var(--purple); }
.metric-red { color: var(--red); }

/* Sections */
.section-block {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(17, 29, 48, .98), rgba(13, 24, 40, .98));
    box-shadow: 0 15px 45px rgba(0, 0, 0, .11);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.025em;
}

.section-heading p:not(.eyebrow) {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.section-count {
    padding: 5px 9px;
    border: 1px solid rgba(246, 184, 75, .18);
    border-radius: 999px;
    background: rgba(246, 184, 75, .09);
    color: #eac376;
    font-size: 10px;
    font-weight: 800;
}

.two-column-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.two-column-grid > .section-block {
    min-width: 0;
}

/* Approvals */
.approval-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.approval-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid #283a56;
    border-radius: 13px;
    background: rgba(12, 23, 39, .7);
}

.approval-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.approval-type {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.approval-card h3 {
    margin: 13px 0 3px;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-text,
.device-id {
    display: block;
    overflow: hidden;
    color: #9fb5f7;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approval-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0;
    padding: 10px 0;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.approval-meta span,
.approval-meta strong {
    display: block;
}

.approval-meta span {
    min-width: 0;
    color: var(--muted-2);
    font-size: 9px;
}

.approval-meta strong {
    overflow: hidden;
    margin-top: 2px;
    color: #c5d0df;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approval-actions {
    display: flex;
    gap: 7px;
}

.approval-actions form:first-child {
    flex: 1;
}

.approval-actions form:first-child .button {
    width: 100%;
}

/* Status */
.status-badge,
.policy-badge {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .02em;
}

.status-active {
    border-color: rgba(55, 214, 155, .22);
    background: rgba(55, 214, 155, .1);
    color: #68e6b7;
}

.status-pending {
    border-color: rgba(246, 184, 75, .23);
    background: rgba(246, 184, 75, .1);
    color: #f6ca77;
}

.status-suspended {
    border-color: rgba(166, 120, 255, .24);
    background: rgba(166, 120, 255, .1);
    color: #c3a4ff;
}

.status-revoked,
.status-expired {
    border-color: rgba(255, 102, 125, .24);
    background: rgba(255, 102, 125, .1);
    color: #ff91a2;
}

.policy-badge {
    border-color: #2a3b55;
    background: #121f31;
    color: #8193ad;
}

/* Licenses */
.license-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 13px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(8, 16, 29, .46);
}

.search-field {
    position: relative;
    display: block;
}

.search-field > span {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: #61748f;
    font-size: 20px;
    transform: translateY(-53%);
}

.search-field input {
    height: 40px;
    padding: 0 13px 0 39px;
}

.filter-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-field select {
    width: 145px;
    height: 40px;
    padding: 0 10px;
}

.results-count {
    padding: 0 4px 10px;
    color: var(--muted-2);
    font-size: 10px;
    white-space: nowrap;
}

.results-count strong {
    color: #c6d3e6;
}

.license-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.license-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(250px, 1.45fr) minmax(125px, .7fr) minmax(115px, .62fr) minmax(135px, .74fr) auto;
    align-items: center;
    gap: 18px;
    padding: 15px;
    border: 1px solid var(--line-soft);
    border-radius: 13px;
    background: rgba(9, 18, 31, .6);
    transition: border-color .18s, background .18s, transform .18s;
}

.license-row:hover {
    border-color: #31445f;
    background: rgba(12, 23, 39, .84);
    transform: translateY(-1px);
}

.license-primary {
    min-width: 0;
}

.license-title-line,
.key-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.license-title-line {
    margin-bottom: 7px;
}

.key-line {
    min-width: 0;
}

.key-line code {
    overflow: hidden;
    color: #b6c6f7;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-name,
.customer-email {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-name {
    margin-top: 7px;
    color: #d9e2ef;
    font-size: 11px;
}

.customer-email {
    color: var(--muted-2);
    font-size: 9px;
}

.license-stat {
    min-width: 0;
}

.license-stat > span,
.license-stat > strong,
.license-stat > small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.license-stat > span {
    color: var(--muted-2);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.license-stat > strong {
    margin: 3px 0 1px;
    color: #cdd7e4;
    font-size: 11px;
}

.license-stat > small {
    color: #6f829d;
    font-size: 8px;
}

.license-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.action-menu {
    position: relative;
}

.action-menu > summary {
    display: grid;
    width: 36px;
    height: 36px;
    list-style: none;
    place-items: center;
    border: 1px solid #2b3c56;
    border-radius: 9px;
    background: #111e31;
    color: #a7b5c8;
    font-weight: 800;
}

.action-menu > summary::-webkit-details-marker {
    display: none;
}

.action-menu[open] > summary {
    border-color: #536fb8;
    background: #192944;
}

.action-menu-popover {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 20;
    width: 190px;
    overflow: hidden;
    padding: 6px;
    border: 1px solid #30425f;
    border-radius: 11px;
    background: #101b2d;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

.action-menu-popover button {
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #aebcd0;
    font-size: 11px;
    text-align: left;
}

.action-menu-popover button:hover {
    background: #1a2a42;
    color: white;
}

.action-menu-popover .menu-danger {
    color: #ff8b9d;
}

.device-details {
    grid-column: 1 / -1;
    margin: -2px -2px -2px;
    padding-top: 9px;
    border-top: 1px solid var(--line-soft);
}

.device-details > summary {
    width: max-content;
    color: #8295b0;
    font-size: 9px;
    font-weight: 800;
}

.device-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 9px;
}

.device-item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: #0a1423;
}

.device-item > div {
    min-width: 0;
}

.device-item code,
.device-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-item code {
    color: #aabce9;
    font-size: 9px;
}

.device-item small {
    color: var(--muted-2);
    font-size: 8px;
}

.empty-state {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 30px;
    border: 1px dashed #2b3b54;
    border-radius: 13px;
    background: rgba(8, 16, 28, .32);
    text-align: left;
}

.empty-state.compact {
    min-height: 90px;
    justify-content: flex-start;
    padding: 18px;
}

.empty-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #2d425e;
    border-radius: 12px;
    background: #142238;
    color: #7e9ff5;
    font-size: 18px;
}

.empty-state strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.empty-state .button {
    margin-top: 12px;
}

/* Activity and integration */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--line-soft);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(55, 214, 155, .08);
}

.activity-dot.activity-danger {
    background: var(--red);
    box-shadow: 0 0 0 3px rgba(255, 102, 125, .08);
}

.activity-item strong,
.activity-item p {
    margin: 0;
}

.activity-item strong {
    color: #cbd6e5;
    font-size: 10px;
}

.activity-item p,
.activity-item time {
    color: var(--muted-2);
    font-size: 8px;
}

.activity-item p code {
    color: #8fa6e7;
}

.activity-item time {
    text-align: right;
}

.endpoint-box {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #0a1423;
}

.endpoint-box > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted-2);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.endpoint-box > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.endpoint-box code {
    overflow: hidden;
    color: #aac0ff;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-block {
    margin: 10px 0;
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #08111e;
    color: #a6baf1;
    font-size: 9px;
    line-height: 1.7;
}

.integration-note {
    display: flex;
    gap: 9px;
    padding: 10px;
    border-radius: 9px;
    background: rgba(91, 127, 255, .07);
    color: #8397b3;
    font-size: 9px;
}

.integration-note span {
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(91, 127, 255, .26);
    border-radius: 999px;
    color: #91a9ef;
    font-weight: 900;
}

.integration-note p {
    margin: 0;
}

/* Modals */
.modal {
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #334765;
    border-radius: 18px;
    background: #101b2d;
    color: var(--text);
    box-shadow: 0 30px 100px rgba(0, 0, 0, .62);
}

.modal-small {
    width: min(500px, calc(100vw - 28px));
}

.modal::backdrop {
    background: rgba(2, 6, 13, .76);
    backdrop-filter: blur(5px);
}

.modal-card {
    max-height: calc(100vh - 34px);
    overflow: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.03em;
}

.modal-header p:not(.eyebrow) {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.modal-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #152238;
    color: #91a0b5;
    font-size: 18px;
}

.modal-close:hover {
    color: white;
}

.modal-key {
    color: #91a7e4 !important;
    font-family: "Cascadia Code", Consolas, monospace;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin: 7px -24px -24px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    background: rgba(7, 14, 25, .34);
}

.danger-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    place-items: center;
    border: 1px solid rgba(255, 102, 125, .25);
    border-radius: 12px;
    background: rgba(255, 102, 125, .1);
    color: var(--red);
    font-size: 18px;
    font-weight: 900;
}

.danger-modal > p {
    color: #a4b1c4;
    font-size: 12px;
}

.delete-confirmation {
    margin: 18px 0;
    padding: 12px;
    border: 1px solid rgba(255, 102, 125, .16);
    border-radius: 10px;
    background: rgba(255, 102, 125, .06);
}

.delete-confirmation span,
.delete-confirmation code {
    display: block;
}

.delete-confirmation span {
    margin-bottom: 5px;
    color: #a18b93;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.delete-confirmation code {
    overflow-wrap: anywhere;
    color: #ffa1af;
    font-size: 11px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    padding: 11px 15px;
    border: 1px solid #355078;
    border-radius: 10px;
    background: #16243a;
    box-shadow: var(--shadow);
    color: #dce7f7;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .18s, transform .18s;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1350px) {
    .metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .approval-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .license-row {
        grid-template-columns: minmax(240px, 1.35fr) minmax(115px, .7fr) minmax(100px, .55fr) auto;
    }

    .license-stat:nth-of-type(4) {
        display: none;
    }
}

@media (max-width: 1050px) {
    .app-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .sidebar {
        padding-right: 12px;
        padding-left: 12px;
    }

    .main-content {
        padding-right: 22px;
        padding-left: 22px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-column-grid {
        grid-template-columns: 1fr;
    }

    .license-row {
        grid-template-columns: minmax(220px, 1fr) minmax(110px, .55fr) auto;
    }

    .license-stat:nth-of-type(3) {
        display: none;
    }
}

@media (max-width: 760px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }

    .login-panel {
        padding: 28px;
    }

    .mobile-brand {
        display: flex;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        width: 250px;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu {
        display: grid;
        flex: 0 0 auto;
        place-items: center;
    }

    .main-content {
        padding: 20px 14px 45px;
    }

    .topbar {
        align-items: flex-start;
        gap: 12px;
    }

    .topbar > div:nth-child(2) {
        flex: 1;
    }

    .topbar-actions .server-clock,
    .topbar-actions .button span {
        display: none;
    }

    .topbar-actions .button {
        min-height: 42px;
        padding: 9px 11px;
        font-size: 11px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .metric-card {
        padding: 13px;
    }

    .metric-icon {
        width: 30px;
        height: 30px;
    }

    .metric-card strong {
        font-size: 21px;
    }

    .metric-card small {
        display: none;
    }

    .section-block {
        padding: 15px;
        border-radius: 15px;
    }

    .section-heading {
        align-items: center;
    }

    .section-heading .button {
        padding: 8px 10px;
        font-size: 10px;
    }

    .approval-grid {
        grid-template-columns: 1fr;
    }

    .license-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .search-field {
        grid-column: 1 / -1;
    }

    .filter-field {
        display: block;
    }

    .filter-field > span {
        display: none;
    }

    .filter-field select {
        width: 100%;
    }

    .results-count {
        text-align: right;
    }

    .license-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 13px;
        padding: 14px;
    }

    .license-primary {
        grid-column: 1 / -1;
        padding-right: 0;
    }

    .license-stat {
        display: block !important;
    }

    .license-stat:nth-of-type(4) {
        display: none !important;
    }

    .license-stat > strong {
        font-size: 10px;
    }

    .license-actions {
        align-self: end;
    }

    .device-list {
        grid-template-columns: 1fr;
    }

    .activity-item {
        grid-template-columns: 10px minmax(0, 1fr);
    }

    .activity-item time {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .modal-card {
        padding: 19px;
    }

    .modal-footer {
        margin: 7px -19px -19px;
        padding: 14px 19px;
    }
}

@media (max-width: 430px) {
    .login-panel {
        padding: 23px;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .metric-card {
        gap: 9px;
    }

    .metric-card span {
        font-size: 8px;
    }

    .metric-card:nth-child(5) {
        grid-column: 1 / -1;
    }

    .section-heading > .button {
        display: none;
    }

    .license-stat:nth-of-type(3) {
        display: none !important;
    }

    .modal-footer .button {
        flex: 1;
        padding-right: 9px;
        padding-left: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
