:root {
    --bg: #181818;
    --bg-deep: #131313;
    --panel: #212121;
    --panel-2: #262628;
    --panel-3: #2b2b2e;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --muted: #aaaaaa;
    --muted-2: #707579;
    --accent: #8774e1;
    --accent-rgb: 135, 116, 225;
    --green: #6fe3a8;
    --amber: #e0b45a;
    --red: #e06666;
    --blue: #6ea8e0;
    --teal: #56c6c6;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    font-feature-settings: "cv02", "cv03", "cv04", "ss01";
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
}

.icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    shape-rendering: geometricPrecision;
    overflow: visible;
}

::selection {
    background: rgba(var(--accent-rgb), 0.35);
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #34343a;
    border-radius: 99px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: #42424a;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(1200px 700px at 15% -10%, #241f38 0%, var(--bg-deep) 60%);
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: float 14s var(--ease) infinite alternate;
}

.orb-one {
    width: 520px;
    height: 520px;
    background: rgba(var(--accent-rgb), 0.45);
    top: -180px;
    left: -120px;
}

.orb-two {
    width: 420px;
    height: 420px;
    background: rgba(90, 160, 220, 0.28);
    bottom: -160px;
    right: -100px;
    animation-delay: -6s;
}

@keyframes float {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(40px, 30px, 0) scale(1.08); }
}

.login-card {
    position: relative;
    z-index: 2;
    width: 380px;
    max-width: 100%;
    background: rgba(33, 33, 33, 0.82);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 32px 30px 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    animation: rise 0.5s var(--ease) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand-text strong {
    display: block;
    font-size: 20px;
    letter-spacing: 0.01em;
}

.login-brand-text span {
    font-size: 12px;
    color: var(--muted-2);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.95), rgba(var(--accent-rgb), 0.45));
    box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.35);
}

.brand-mark .icon {
    width: 26px;
    height: 26px;
}

.brand-mark.small {
    width: 42px;
    height: 44px;
    border-radius: 14px;
}

.brand-mark.small .icon {
    width: 22px;
    height: 22px;
}

.login-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0 22px;
}

.field {
    display: block;
    margin-bottom: 15px;
}

.field-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 7px;
}

input, select {
    width: 100%;
    font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
    font-size: 13.5px;
    letter-spacing: 0;
    background: #1a1a1c;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 13px;
    outline: none;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

input::placeholder {
    color: #5c5c63;
}

input[type="password"] {
    letter-spacing: 0.06em;
}

.topbar h1,
.panel h3,
.login-card h1,
.field-label,
.nav-item span {
    text-transform: capitalize;
}

.subtitle,
.login-brand-text span,
.panel-sub {
    text-transform: none;
}

.field-label {
    letter-spacing: 0.1em;
}

input:hover, select:hover {
    border-color: var(--border-strong);
}

input:focus, select:focus {
    border-color: rgba(var(--accent-rgb), 0.75);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
    background: #1d1d20;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-left: 40px;
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    width: 17px;
    height: 17px;
    pointer-events: none;
}

input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
    white-space: nowrap;
}

.btn:hover {
    background: var(--panel-3);
    border-color: var(--border-strong);
}

.btn:active {
    transform: scale(0.975);
}

.btn.primary {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), 0.78));
    border-color: rgba(var(--accent-rgb), 0.9);
    color: #fff;
    box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.28);
}

.btn.primary:hover {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 1), rgba(var(--accent-rgb), 0.92));
    box-shadow: 0 14px 30px rgba(var(--accent-rgb), 0.36);
}

.btn.ghost {
    background: transparent;
}

.btn.ghost:hover {
    background: var(--panel-2);
}

.btn.danger {
    background: rgba(224, 102, 102, 0.12);
    border-color: rgba(224, 102, 102, 0.35);
    color: #f28b8b;
}

.btn.danger:hover {
    background: rgba(224, 102, 102, 0.2);
    border-color: rgba(224, 102, 102, 0.55);
}

.file-field {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0 10px;
    padding: 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.file-field:hover {
    border-color: rgba(var(--accent-rgb), 0.55);
    background: rgba(var(--accent-rgb), 0.05);
}

.file-field input {
    display: none;
}

.file-field span {
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hash-cell {
    font-size: 9.5px !important;
    letter-spacing: 0;
    word-break: break-all;
    text-align: right;
    max-width: 170px;
}

.confirm-text {
    margin: 0 0 6px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.55;
}

.confirm-modal {
    width: 400px;
}

.table tbody tr.clickable,
#keyRows tr {
    cursor: pointer;
}

.btn.wide {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
}

.btn.tiny {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 9px;
}

.btn.active {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.4);
    background: rgba(var(--accent-rgb), 0.1);
}

.form-error {
    min-height: 18px;
    color: var(--red);
    font-size: 12.5px;
    margin: 10px 0 0;
}

.form-note {
    min-height: 18px;
    color: var(--muted);
    font-size: 12.5px;
    margin: 10px 0 0;
}

.default-cred {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(255, 196, 0, 0.06);
    border: 1px solid rgba(255, 196, 0, 0.14);
    color: #c9b58a;
    font-size: 11.5px;
    line-height: 1.45;
}

.default-cred .icon {
    width: 14px;
    height: 14px;
    margin-top: 1px;
    color: #e0b95a;
}

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

.sidebar {
    background: linear-gradient(180deg, #191919, #151515);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: sticky;
    top: 0;
    height: 100vh;
}

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

.sidebar-brand-text strong {
    display: block;
    font-size: 16px;
}

.sidebar-brand-text span {
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 13.5px;
    text-align: left;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.12s var(--ease);
}

.nav-item .icon {
    width: 18px;
    height: 17px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.06));
    box-shadow: inset 2px 0 0 var(--accent);
}

.nav-item.active .icon {
    color: var(--accent);
}

.nav-badge {
    margin-left: auto;
    font-style: normal;
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(var(--accent-rgb), 0.16);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.user-avatar .icon {
    width: 16px;
    height: 16px;
}

.user-chip strong {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
}

.user-chip span {
    font-size: 10.5px;
    color: var(--muted-2);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--muted);
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.icon-btn:hover {
    background: var(--panel-2);
    color: var(--text);
}

.main {
    padding: 26px 34px 64px;
    min-width: 0;
}

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

.topbar h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.subtitle {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--muted-2);
}

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

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 99px;
    font-size: 11.5px;
    color: var(--amber);
    background: rgba(224, 180, 90, 0.08);
    border: 1px solid rgba(224, 180, 90, 0.22);
}

.status-pill .icon {
    width: 13px;
    height: 13px;
}

.view {
    animation: fadeUp 0.35s var(--ease) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.16), rgba(33, 33, 33, 0.9) 55%);
    padding: 26px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
}

.hero-glow {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.28);
    filter: blur(70px);
    right: 10%;
    top: -180px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow .icon {
    width: 13px;
    height: 13px;
}

.hero h2 {
    margin: 10px 0 6px;
    font-size: 22px;
    font-weight: 600;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    max-width: 420px;
}

.hero-stats {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 22px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 22px;
}

.hero-stat span {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.hero-stat strong {
    display: block;
    font-size: 26px;
    font-weight: 650;
    margin: 3px 0 1px;
}

.hero-stat em {
    font-style: normal;
    font-size: 11px;
    color: var(--green);
}

.hero-divider {
    width: 1px;
    height: 48px;
    background: var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: #232323;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.stat-icon .icon {
    width: 18px;
    height: 18px;
}

.stat-icon.violet { color: var(--accent); background: rgba(var(--accent-rgb), 0.13); }
.stat-icon.green { color: var(--green); background: rgba(111, 227, 168, 0.1); }
.stat-icon.amber { color: var(--amber); background: rgba(224, 180, 90, 0.1); }
.stat-icon.red { color: var(--red); background: rgba(224, 102, 102, 0.1); }
.stat-icon.blue { color: var(--blue); background: rgba(110, 168, 224, 0.1); }
.stat-icon.teal { color: var(--teal); background: rgba(86, 198, 198, 0.1); }

.stat-body span {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.stat-body strong {
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 16px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
}

.panel-sub {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted-2);
}

.legend {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--muted-2);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.violet { background: var(--accent); }
.dot.green { background: var(--green); }

.chart-host {
    min-height: 190px;
}

.chart-host svg {
    width: 100%;
    height: 190px;
    display: block;
    overflow: visible;
}

.feed {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 232px;
    overflow-y: auto;
}

.feed-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.16s var(--ease);
}

.feed-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.feed-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.feed-icon .icon {
    width: 14px;
    height: 14px;
}

.feed-icon.ok { color: var(--green); background: rgba(111, 227, 168, 0.1); }
.feed-icon.denied { color: var(--red); background: rgba(224, 102, 102, 0.1); }

.feed-text {
    flex: 1;
    min-width: 0;
}

.feed-text strong {
    display: block;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-text span {
    font-size: 10.5px;
    color: var(--muted-2);
}

.feed-time {
    font-size: 10.5px;
    color: var(--muted-2);
    flex-shrink: 0;
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 42px 20px;
    color: var(--muted-2);
    font-size: 12.5px;
}

.empty .icon {
    width: 26px;
    height: 26px;
    opacity: 0.5;
}

.tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 14px;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--muted);
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.tab.active {
    color: #fff;
    background: rgba(var(--accent-rgb), 0.18);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.3);
}

.tab em {
    font-style: normal;
    font-size: 10.5px;
    padding: 1px 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.tab.active em {
    background: rgba(var(--accent-rgb), 0.28);
    color: #fff;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.toolbar .search {
    flex: 1;
    min-width: 200px;
}

.toolbar .select {
    width: 170px;
}

.table-panel {
    padding: 0;
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.table th {
    text-align: left;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 500;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.015);
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.035);
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.15s var(--ease);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.mono {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11.5px;
    letter-spacing: 0.01em;
}

.key-cell {
    color: #c9bdf7;
    cursor: pointer;
    transition: color 0.15s var(--ease);
}

.key-cell:hover {
    color: #e2d9ff;
}

.cell-label {
    color: var(--text);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-muted {
    color: var(--muted-2);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
}

.pill.active { color: var(--green); background: rgba(111, 227, 168, 0.09); border-color: rgba(111, 227, 168, 0.22); }
.pill.expired { color: var(--amber); background: rgba(224, 180, 90, 0.09); border-color: rgba(224, 180, 90, 0.22); }
.pill.online {
    background: rgba(111, 227, 168, 0.16);
    color: #8bf0b8;
}

.pill.offline {
    background: rgba(224, 102, 102, 0.12);
    color: #f29a9a;
}

.pill.disabled {
    background: rgba(160, 160, 170, 0.14);
    color: #c0c3cc;
}

.pill.banned { color: var(--red); background: rgba(224, 102, 102, 0.09); border-color: rgba(224, 102, 102, 0.22); }
.pill.ok { color: var(--green); background: rgba(111, 227, 168, 0.09); border-color: rgba(111, 227, 168, 0.22); }
.pill.denied { color: var(--red); background: rgba(224, 102, 102, 0.09); border-color: rgba(224, 102, 102, 0.22); }
.pill.admin { color: var(--blue); background: rgba(110, 168, 224, 0.09); border-color: rgba(110, 168, 224, 0.22); }
.pill.license { color: var(--accent); background: rgba(var(--accent-rgb), 0.09); border-color: rgba(var(--accent-rgb), 0.22); }

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

.mini-btn {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 8px;
    color: var(--muted-2);
    border: 1px solid transparent;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.mini-btn .icon {
    width: 14px;
    height: 14px;
}

.mini-btn:hover {
    color: var(--text);
    background: var(--panel-2);
    border-color: var(--border);
}

.mini-btn.danger:hover {
    color: var(--red);
    background: rgba(224, 102, 102, 0.1);
    border-color: rgba(224, 102, 102, 0.25);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--muted-2);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.switch-row:last-of-type {
    border-bottom: none;
}

.switch-row strong {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
}

.switch-row span {
    font-size: 11px;
    color: var(--muted-2);
}

.switch {
    width: 42px;
    height: 24px;
    border-radius: 99px;
    background: #333338;
    border: 1px solid var(--border);
    padding: 2px;
    transition: background 0.2s var(--ease);
    flex-shrink: 0;
}

.switch span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #9a9aa2;
    transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.switch[aria-checked="true"] {
    background: rgba(var(--accent-rgb), 0.8);
}

.switch[aria-checked="true"] span {
    transform: translateX(18px);
    background: #fff;
}

.accent-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input {
    width: 48px;
    height: 38px;
    padding: 3px;
    cursor: pointer;
}

.swatches {
    display: flex;
    gap: 8px;
}

.swatch {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.swatch:hover {
    transform: scale(1.12);
}

.swatch.selected {
    border-color: #fff;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.info-list div:last-child {
    border-bottom: none;
}

.info-list span {
    color: var(--muted-2);
}

.info-list strong {
    font-weight: 500;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11.5px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--muted);
    user-select: none;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-box {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    display: grid;
    place-items: center;
    transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.check-box .icon {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}

.checkbox input:checked + .check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox input:checked + .check-box .icon {
    opacity: 1;
    transform: scale(1);
}

.modal-backdrop,
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 10, 0.66);
    backdrop-filter: blur(6px);
    z-index: 30;
    animation: fadeIn 0.2s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    padding: 24px;
    z-index: 31;
    box-shadow: var(--shadow);
    animation: modalIn 0.26s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-head h3 {
    margin: 6px 0 0;
    font-size: 18px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 100vw;
    background: #1d1d1f;
    border-left: 1px solid var(--border-strong);
    z-index: 31;
    display: flex;
    flex-direction: column;
    box-shadow: -30px 0 80px rgba(0, 0, 0, 0.45);
    animation: drawerIn 0.28s var(--ease);
}

@keyframes drawerIn {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--border);
}

.drawer-head h3 {
    margin: 8px 0 0;
    font-size: 14px;
    font-family: "Cascadia Mono", Consolas, monospace;
    color: #c9bdf7;
    word-break: break-all;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.drawer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 22px 22px;
    border-top: 1px solid var(--border);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-item {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 12px;
}

.detail-item span {
    display: block;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 4px;
}

.detail-item strong {
    font-size: 12.5px;
    font-weight: 500;
    word-break: break-all;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.device-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 11.5px;
}

.device-row .icon {
    width: 15px;
    height: 15px;
    color: var(--muted-2);
}

.device-row div {
    min-width: 0;
    flex: 1;
}

.device-row strong {
    display: block;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11px;
    font-weight: 400;
    word-break: break-all;
}

.device-row span {
    color: var(--muted-2);
    font-size: 10.5px;
}

.toast {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 60;
    background: #242428;
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--green);
    border-radius: 13px;
    padding: 13px 18px;
    font-size: 12.5px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.25s var(--ease);
}

.toast.error {
    border-left-color: var(--red);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(111, 227, 168, 0.5);
    animation: pulse 2s var(--ease) infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(111, 227, 168, 0.42); }
    70% { box-shadow: 0 0 0 7px rgba(111, 227, 168, 0); }
    100% { box-shadow: 0 0 0 0 rgba(111, 227, 168, 0); }
}

.skeleton {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #26262a 25%, #303036 50%, #26262a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.default-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    padding: 10px 13px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.025);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.default-hint code {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--muted);
}

.select {
    position: relative;
    min-width: 150px;
    user-select: none;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #1a1a1c;
    color: var(--text);
    font-size: 12.5px;
    text-align: left;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

.select-trigger:hover {
    border-color: var(--border-strong);
}

.select.open .select-trigger {
    border-color: rgba(var(--accent-rgb), 0.7);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-caret {
    width: 15px;
    height: 15px;
    color: var(--muted-2);
    transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.select.open .select-caret {
    transform: rotate(180deg);
    color: var(--accent);
}

.select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 25;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: #202024;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    animation: menuIn 0.16s var(--ease);
}

@keyframes menuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.select-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    text-align: left;
    color: var(--muted);
    transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.select-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.select-option.selected {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
}

.stepper {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.stepper input {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 13px;
    padding: 10px 6px;
}

.step-btn {
    width: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #1a1a1c;
    color: var(--muted);
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.step-btn:hover {
    background: var(--panel-3);
    border-color: var(--border-strong);
    color: var(--text);
}

.step-btn:active {
    transform: scale(0.94);
}

.step-btn .icon {
    width: 15px;
    height: 15px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    margin-top: 10px;
    cursor: pointer;
}

.range:focus {
    box-shadow: none;
}

.range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.25));
}

.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16);
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.range::-webkit-slider-thumb:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.2);
}

.range::-moz-range-track {
    height: 4px;
    border-radius: 99px;
    background: rgba(var(--accent-rgb), 0.3);
}

.range::-moz-range-progress {
    height: 4px;
    border-radius: 99px;
    background: var(--accent);
}

.range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
}

.range-scale {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--muted-2);
    margin-top: 2px;
}

.shot-thumb {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

.shot-thumb:hover {
    transform: scale(1.04);
    border-color: rgba(var(--accent-rgb), 0.5);
}

.shot-placeholder {
    width: 72px;
    height: 40px;
    border-radius: 7px;
    border: 1px dashed var(--border);
    display: grid;
    place-items: center;
    color: var(--muted-2);
    font-size: 10px;
}

.shot-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 6, 10, 0.9);
    animation: fadeIn 0.2s var(--ease);
}

.shot-modal img {
    max-width: 96vw;
    max-height: 92vh;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.shot-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--panel);
    border: 1px solid var(--border-strong);
}
@media (max-width: 1080px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-stats {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 900px) {
    .app-view {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 14px 16px;
        gap: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav {
        flex-direction: row;
    }

    .nav-item {
        width: auto;
        white-space: nowrap;
    }

    .nav-badge,
    .sidebar-status {
        display: none;
    }

    .sidebar-footer {
        border-top: none;
        padding-top: 0;
        margin-left: auto;
    }

    .sidebar-brand-text {
        display: none;
    }

    .main {
        padding: 20px 16px 48px;
    }

    .hero {
        padding: 20px;
    }

    .drawer {
        width: 100vw;
    }

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

@media (max-width: 620px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .toolbar .select {
        width: 100%;
    }

    .hero-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hero-divider {
        display: none;
    }

    .topbar {
        flex-direction: column;
    }
}
