/*
 * VYRTX WIRE — Admin Control Console (iOS 26 Liquid Glass)
 * Frosted translucent layers, specular rim highlights, ambient mesh backdrop,
 * crisp Apple SF / Inter typography, Day & Night glass modes.
 */

:root {
    color-scheme: dark;

    --bg:         #050711;
    --bg-mesh-1:  rgba(229, 24, 20, 0.28);
    --bg-mesh-2:  rgba(255, 75, 68, 0.15);
    --bg-mesh-3:  rgba(175, 18, 22, 0.16);

    --glass:      rgba(18, 22, 38, 0.62);
    --glass-hi:   rgba(26, 32, 54, 0.74);
    --glass-solid:rgba(16, 20, 34, 0.92);
    --fill:       rgba(255, 255, 255, 0.045);
    --hover:      rgba(255, 255, 255, 0.085);

    --line:       rgba(255, 255, 255, 0.10);
    --line-hi:    rgba(255, 255, 255, 0.17);
    --rim:        inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.03);

    --text:       #f5f7ff;
    --muted:      #a8b1cc;
    --dim:        #747e9c;

    --accent:     #e51814;
    --accent-hi:  #ff5e59;
    --accent-lo:  #c41410;
    --accent-soft:rgba(229, 24, 20, 0.18);

    --green:      #34d399;
    --amber:      #fbbf24;
    --red:        #f87171;
    --cool:       #38bdf8;
    --green-bg:   rgba(52, 211, 153, 0.14);
    --amber-bg:   rgba(251, 191, 36, 0.14);
    --red-bg:     rgba(248, 113, 113, 0.14);
    --cool-bg:    rgba(56, 189, 248, 0.14);

    --r-2xl:      24px;
    --r-xl:       20px;
    --r-lg:       14px;
    --r:          11px;

    --ui:         -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
    --display:    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
    --mono:       'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --sbw:        264px;
    --blur:       blur(28px) saturate(185%);
    --shadow:     0 10px 30px rgba(0, 0, 0, 0.28);
    --shadow-lg:  0 28px 70px rgba(0, 0, 0, 0.56);
    --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
    color-scheme: light;

    --bg:         #f8f1f1;
    --bg-mesh-1:  rgba(229, 24, 20, 0.16);
    --bg-mesh-2:  rgba(255, 75, 68, 0.15);
    --bg-mesh-3:  rgba(229, 24, 20, 0.10);

    --glass:      rgba(255, 255, 255, 0.68);
    --glass-hi:   rgba(255, 255, 255, 0.84);
    --glass-solid:rgba(255, 255, 255, 0.95);
    --fill:       rgba(15, 23, 42, 0.04);
    --hover:      rgba(15, 23, 42, 0.07);

    --line:       rgba(15, 23, 42, 0.085);
    --line-hi:    rgba(15, 23, 42, 0.14);
    --rim:        inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 0 0 1px rgba(255, 255, 255, 0.55);

    --text:       #0b1022;
    --muted:      #4b5572;
    --dim:        #76819e;

    --accent:     #e51814;
    --accent-hi:  #c41410;
    --accent-lo:  #a6100d;
    --accent-soft:rgba(229, 24, 20, 0.11);

    --green:      #059669;
    --amber:      #b45309;
    --red:        #dc2626;
    --cool:       #0284c7;
    --green-bg:   rgba(16, 185, 129, 0.12);
    --amber-bg:   rgba(245, 158, 11, 0.13);
    --red-bg:     rgba(239, 68, 68, 0.11);
    --cool-bg:    rgba(14, 165, 233, 0.12);

    --shadow:     0 8px 26px rgba(48, 16, 16, 0.07);
    --shadow-lg:  0 28px 65px rgba(48, 16, 16, 0.16);
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100dvh;
    color: var(--text);
    background: var(--bg);
    font: 14px/1.55 var(--ui);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    font-family: var(--display);
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
    background: var(--line-hi);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--dim); background-clip: content-box; }

[hidden], .hide { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Ambient Liquid Mesh Backdrop ── */
.scanlines { display: none !important; }
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(62% 52% at 10% -5%, var(--bg-mesh-1) 0%, transparent 65%),
        radial-gradient(54% 48% at 95% 8%, var(--bg-mesh-2) 0%, transparent 62%),
        radial-gradient(50% 45% at 60% 105%, var(--bg-mesh-3) 0%, transparent 64%);
}
.glow-orb {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    width: 460px;
    height: 460px;
    top: -120px;
    left: 22%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(229, 24, 20, 0.22) 0%, transparent 68%);
    filter: blur(70px);
    animation: orbDrift 18s ease-in-out infinite;
}
.glow-orb.orb-2 {
    top: auto;
    left: auto;
    right: -80px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 75, 68, 0.15) 0%, transparent 70%);
    animation-delay: -9s;
}
@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-28px, 22px) scale(1.06); }
}

/* ── Day | Night Liquid Glass Segmented Control ── */
.theme-seg {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border-radius: 999px;
    background: var(--fill);
    border: 1px solid var(--line);
    box-shadow: var(--rim);
}
.theme-seg .seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 600 12px/1 var(--ui);
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.theme-seg .seg-ic {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}
.theme-seg .seg-btn:hover:not([aria-pressed="true"]) { color: var(--text); }
.theme-seg .seg-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--accent) 0%, #f6423d 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(229, 24, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.theme-seg .seg-btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 680px) {
    .theme-seg .seg-btn span { display: none; }
    .theme-seg .seg-btn { padding: 7px 9px; }
}

/* ── Icons & Logo Mark ── */
svg.ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; }
.logo-mark {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(229, 24, 20, 0.22), rgba(229, 24, 20, 0.08));
    border: 1px solid rgba(255, 69, 64, 0.32);
    box-shadow: var(--rim), 0 6px 16px rgba(229, 24, 20, 0.22);
}
.logo-mark svg { width: 19px; height: 19px; fill: none; stroke: currentColor; }
.logo-mark img { width: 100%; height: 100%; object-fit: contain; padding: 5px; display: block; }

/* ── Primitives ── */
button {
    font: 600 13px/1.1 var(--ui);
    cursor: pointer;
    border: 0;
    border-radius: var(--r);
    color: #fff;
    transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .14s var(--ease);
    touch-action: manipulation;
}
button:disabled { cursor: not-allowed; opacity: .48; }

input, select, textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 13px;
    color: var(--text);
    background: var(--fill);
    border: 1px solid var(--line-hi);
    border-radius: 12px;
    outline: none;
    font: 400 13.5px/1.4 var(--ui);
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%238892b0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}
select option { background: var(--glass-solid); color: var(--text); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 24%, var(--line-hi)); }
input:focus, select:focus, textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    border-color: var(--accent);
    background: var(--glass-hi);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type="color"] { padding: 4px; height: 40px; cursor: pointer; border-radius: 12px; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    display: inline-grid;
    place-content: center;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    cursor: pointer;
    background: var(--fill);
    border: 1.5px solid var(--line-hi);
    border-radius: 6px;
    box-shadow: none;
    transition: background .14s, border-color .14s;
}
input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform .14s var(--ease);
    background: #fff;
    clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%);
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate {
    background: linear-gradient(135deg, var(--accent), #f6423d);
    border-color: transparent;
}
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:indeterminate::before { transform: scale(1); height: 2px; clip-path: none; border-radius: 1px; }
input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }

label {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font: 600 12px/1.3 var(--ui);
    letter-spacing: 0.01em;
}

.grad-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #f6433e 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 8px 22px rgba(229, 24, 20, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.grad-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ee2b26 0%, #ff5954 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(229, 24, 20, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.grad-btn:active:not(:disabled) { transform: scale(0.975); }

.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--fill);
    border: 1px solid var(--line-hi);
    box-shadow: var(--rim);
    color: var(--text);
    font-size: 12.5px;
}
.ghost:hover:not(:disabled) { background: var(--hover); border-color: color-mix(in srgb, var(--text) 24%, var(--line-hi)); }
.ghost.danger { color: var(--red); }
.ghost.danger:hover:not(:disabled) { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.ghost.icon { min-height: 34px; width: 34px; padding: 0; border-radius: 50%; font-size: 15px; }
.mini { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 999px; }
select.mini { width: auto; min-height: 32px; padding: 0 28px 0 12px; font: 500 12px var(--ui); border-radius: 999px; }

/* ── Topbar Liquid Glass Status Pills ── */
.glass-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--fill);
    border: 1px solid var(--line);
    box-shadow: var(--rim);
    color: var(--muted);
    font: 600 12px/1 var(--ui);
    white-space: nowrap;
}
.glass-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dim);
    flex: none;
}
.glass-pill.maint-pill.is-live { color: var(--green); border-color: color-mix(in srgb, var(--green) 32%, transparent); background: var(--green-bg); }
.glass-pill.maint-pill.is-live .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.glass-pill.maint-pill.is-maint { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-bg); }
.glass-pill.maint-pill.is-maint .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.glass-pill.sync-pill[aria-pressed="true"] {
    color: var(--accent-hi);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: var(--accent-soft);
}
.glass-pill.sync-pill[aria-pressed="true"] .dot {
    background: var(--accent-hi);
    animation: pulseDot 1.8s infinite;
}
.glass-pill:hover { color: var(--text); border-color: var(--line-hi); }

/* ── Login Experience (iOS 26 Liquid Glass) ── */
#login {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    padding: 32px;
    gap: 28px;
    max-width: 1120px;
    margin: 0 auto;
}
.login-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    padding: 38px;
    border-radius: var(--r-2xl);
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    box-shadow: var(--rim), var(--shadow-lg);
    overflow: hidden;
}
.login-aside:after {
    content: "";
    position: absolute;
    inset: auto -20% -35% auto;
    width: 72%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 70%);
    pointer-events: none;
}
.login-aside .brand { position: relative; z-index: 1; }
.login-aside h2 {
    position: relative;
    z-index: 1;
    font-size: 30px;
    line-height: 1.18;
    max-width: 420px;
    margin-bottom: 12px;
}
.login-aside p { position: relative; z-index: 1; color: var(--muted); max-width: 420px; margin: 0; }
.login-points { position: relative; z-index: 1; list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13.5px; }
.login-points svg.ico { width: 18px; height: 18px; color: var(--accent-hi); }
.login-aside small { position: relative; z-index: 1; color: var(--dim); font-size: 12px; }

.login-main { display: grid; place-items: center; }
.login-card {
    width: min(100%, 420px);
    padding: 34px 32px 30px;
    border-radius: var(--r-2xl);
    background: var(--glass-hi);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    box-shadow: var(--rim), var(--shadow-lg);
}
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.login-card .field { margin-bottom: 16px; }
.login-card .grad-btn { width: 100%; min-height: 46px; margin-top: 8px; font-size: 14.5px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 68px; }
.pw-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    min-height: 28px;
    padding: 0 10px;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    border-radius: 999px;
}
.pw-toggle:hover { background: var(--hover); color: var(--text); }
.caps-hint { margin: 6px 0 0; color: var(--amber); font-size: 12px; }
.login-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-size: 12px;
}
.login-foot svg.ico { width: 14px; height: 14px; }
@media (max-width: 900px) {
    #login { grid-template-columns: 1fr; padding: 20px; }
    .login-aside { display: none; }
}

/* ── App Shell (Floating Liquid Glass Sidebar + Topbar) ── */
#app { position: relative; z-index: 1; min-height: 100dvh; display: flex; }

.sidebar {
    width: var(--sbw);
    flex: none;
    position: sticky;
    top: 14px;
    height: calc(100dvh - 28px);
    margin: 14px 0 14px 14px;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    border-radius: var(--r-2xl);
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    box-shadow: var(--rim), var(--shadow);
    overflow-y: auto;
    z-index: 30;
}
.sidebar .brand { padding: 4px 8px 16px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand div { font: 700 15px/1.15 var(--display); color: var(--text); letter-spacing: -0.01em; min-width: 0; }
.brand div .w2 { color: var(--accent-hi); }
.brand small { display: flex; align-items: center; color: var(--dim); font: 500 11px/1 var(--ui); margin-top: 4px; }
.brand .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-left: 6px; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label {
    margin: 16px 10px 6px;
    color: var(--dim);
    font: 600 11px/1 var(--ui);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.nav-label:first-child { margin-top: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 40px;
    text-align: left;
    background: transparent;
    color: var(--muted);
    padding: 0 12px;
    border-radius: 13px;
    font: 500 13.5px/1.1 var(--ui);
    white-space: nowrap;
}
.nav-item svg.ico { width: 17px; height: 17px; opacity: .88; }
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, #f6423d 100%);
    box-shadow: 0 6px 18px rgba(229, 24, 20, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.nav-item.active svg.ico { opacity: 1; stroke: #fff; }
.nav-item.danger:hover { color: var(--red); background: var(--red-bg); }

.sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: var(--fill);
    border: 1px solid var(--line);
}
.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-hi);
    font: 700 13.5px/1 var(--display);
    text-transform: uppercase;
}
.user-chip .who { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.user-chip b { font: 600 13px/1.15 var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip span { color: var(--dim); font-size: 11.5px; text-transform: capitalize; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    margin: 14px 24px 0;
    padding: 10px 18px;
    border-radius: var(--r-xl);
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    box-shadow: var(--rim), var(--shadow);
}
.page-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-title h1 { font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title span { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .search {
    width: 260px;
    max-width: 100%;
    min-height: 35px;
    padding-left: 34px;
    border-radius: 999px;
    background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%238892b0'%3E%3Cpath d='M15.5 14h-.8l-.3-.3A6.5 6.5 0 1 0 14 15.5l.3.3v.8l5 5 1.5-1.5-5-5Zm-6 0a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9Z'/%3E%3C/svg%3E") no-repeat 12px center;
}
.topbar .hamb { display: none; }
.spacer { flex: 1; min-width: 8px; }
.session-timer { color: var(--amber); font: 600 12px var(--mono); white-space: nowrap; }
.wrap { width: 100%; max-width: none; margin: 0; padding: 20px 24px 64px; flex: 1; }

@media (min-width: 901px) {
    #app { height: 100dvh; min-height: 0; overflow: hidden; }
    .main { height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
}

.banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    margin-bottom: 18px;
    border-radius: var(--r-xl);
    background: var(--amber-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid color-mix(in srgb, var(--amber) 42%, transparent);
    color: var(--text);
    font-size: 13px;
}
.banner b { color: var(--amber); }

/* ── Stat Cards & Liquid Glass Sections ── */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1080px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    border-radius: var(--r-xl);
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line);
    box-shadow: var(--rim), var(--shadow);
    transition: transform .22s var(--ease), border-color .2s var(--ease), box-shadow .22s var(--ease);
}
.stat:hover { border-color: var(--line-hi); transform: translateY(-2px); box-shadow: var(--rim), var(--shadow-lg); }
.stat > div { min-width: 0; }
.stat .ic {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-hi);
}
.stat .ic svg.ico { width: 19px; height: 19px; }
.stat b { display: block; margin-top: 10px; font: 700 30px/1 var(--display); letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font: 500 13px/1.3 var(--ui); }
.stat.active .ic { background: var(--green-bg); color: var(--green); }
.stat.expired .ic { background: var(--amber-bg); color: var(--amber); }
.stat.disabled .ic, .stat.banned .ic { background: var(--red-bg); color: var(--red); }
.stat.lifetime .ic, .stat.pending .ic { background: var(--cool-bg); color: var(--cool); }
.stat.devices { cursor: default; }
.stat.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }

.section {
    --pad: 20px;
    padding: var(--pad);
    border-radius: var(--r-xl);
    margin-bottom: 18px;
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line);
    box-shadow: var(--rim), var(--shadow);
}
.section h2 { display: flex; align-items: center; gap: 9px; font-size: 15.5px; margin-bottom: 14px; color: var(--text); }
.section h2 svg.ico { width: 18px; height: 18px; color: var(--accent-hi); }
.card-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.section h2 + .card-sub { margin: -6px 0 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.two-col > .section { margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.row { margin-bottom: 14px; } .row:last-child { margin-bottom: 0; }
.chk-line { display: flex; align-items: center; gap: 9px; min-height: 38px; }
.chk-line label { color: var(--text); font-size: 13.5px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    font: 500 12.5px/1 var(--ui);
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--muted);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.pill.ok .dot { background: var(--green); }
.pill.warn .dot { background: var(--amber); }
.pill.bad .dot { background: var(--red); }
.pill.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 340px; overflow: auto; }
.activity li { display: flex; gap: 10px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.activity li:last-child { border-bottom: 0; }
.activity .a-act { color: var(--text); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.activity .a-who { color: var(--muted); white-space: nowrap; }
.activity .a-t { color: var(--dim); margin-left: auto; white-space: nowrap; font-size: 11.5px; }

.kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.kv > div { padding: 14px 16px; background: var(--fill); }
.kv .k { color: var(--dim); font: 500 12px/1 var(--ui); margin-bottom: 7px; }
.kv .v { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--mono); overflow-wrap: anywhere; }

/* ── Quick Actions Control Center Grid ── */
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qa {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 50px;
    padding: 0 15px;
    border-radius: 14px;
    text-align: left;
    background: var(--fill);
    border: 1px solid var(--line);
    box-shadow: var(--rim);
    color: var(--text);
    font: 600 13px/1.2 var(--ui);
}
.qa:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-hi)); background: var(--hover); transform: translateY(-1px); }
.qa svg.ico { width: 18px; height: 18px; color: var(--accent-hi); }

/* ── Quick Filter Chips on Keys View ── */
.quick-filters {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 0 14px 12px;
}
.qf-chip {
    min-height: 29px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--muted);
    font: 600 11.5px/1 var(--ui);
    cursor: pointer;
}
.qf-chip:hover { color: var(--text); border-color: var(--line-hi); background: var(--hover); }
.qf-chip.on {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    color: var(--accent-hi);
}
.qf-chip.qf-clear { color: var(--dim); }

/* ── Toolbar / Bulk / Filters ── */
.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.tool-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.count { color: var(--dim); font: 500 12.5px/1 var(--ui); white-space: nowrap; margin-right: 4px; }
.bulkbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 9px 12px 9px 16px;
    border-radius: var(--r-lg);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
}
.bulkbar #bulk-count, .bulkbar #fn-bulk-count { color: var(--text); font: 600 13px/1 var(--ui); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input { max-width: 260px; min-height: 36px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pager .ghost[disabled] { opacity: .38; pointer-events: none; }
.pager #audit-page, .pager-info { color: var(--dim); font: 500 12.5px/1.5 var(--ui); padding: 0 6px; text-align: center; }
.chain-note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px; vertical-align: middle; }
th { position: sticky; top: 0; color: var(--dim); background: var(--fill); font: 600 11.5px/1 var(--ui); letter-spacing: 0.03em; text-transform: uppercase; }
th.chk, td.chk { width: 42px; text-align: center; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
tbody tr.picked { background: var(--accent-soft); }
.keycell { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-weight: 500; font-size: 12.5px; color: var(--text); }
.keycell span[data-copy] { cursor: pointer; }
.keycell span[data-copy]:hover { color: var(--accent-hi); }
.copy { cursor: pointer; color: var(--dim); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; transition: .15s; }
.copy:hover { background: var(--hover); color: var(--text); }
.copy svg.ico { width: 14px; height: 14px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font: 600 11.5px/1.4 var(--ui);
    text-transform: capitalize;
    background: var(--fill);
    color: var(--muted);
    border: 1px solid var(--line);
}
.badge:before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.on { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge.expired, .badge.maint { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.badge.disabled, .badge.off, .badge.banned { background: var(--red-bg); color: var(--red); border-color: transparent; }
.badge.lifetime, .badge.pending { background: var(--cool-bg); color: var(--cool); border-color: transparent; }
.badge.owner, .badge.super_admin, .badge.admin, .badge.moderator { background: var(--accent-soft); color: var(--accent-hi); border-color: transparent; }
.badge.owner:before, .badge.super_admin:before, .badge.admin:before, .badge.moderator:before { display: none; }

.tagchip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font: 500 11.5px/1.5 var(--ui);
    background: var(--fill);
    border: 1px solid var(--line);
    color: var(--muted);
    margin: 2px 4px 1px 0;
}
.note-tags small { display: block; color: var(--dim); font-size: 12px; max-width: 240px; white-space: normal; }
.devcell { display: flex; flex-direction: column; gap: 5px; min-width: 80px; }
.devcell .bar { display: block; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.devcell .bar s { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.devcell .bar s.full { background: var(--amber); }
.devcell small { color: var(--dim); font-size: 12px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
td .actions { flex-wrap: nowrap; }
.exp { color: var(--muted); }
.exp small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.muted { color: var(--dim); }
.empty { text-align: center; padding: 40px 20px; color: var(--dim); }

/* ── Generated Result ── */
.gen-box {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--green) 38%, transparent);
    border-radius: var(--r-lg);
    background: var(--green-bg);
}
.gen-box .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.gen-box .head b { color: var(--green); font: 600 13.5px/1.4 var(--ui); }
.gen-box code {
    display: block;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    padding: 9px 13px;
    margin-bottom: 6px;
    background: var(--glass-solid);
    border: 1px solid var(--line);
    border-radius: 10px;
    word-break: break-all;
    cursor: pointer;
    transition: .15s;
}
.gen-box code:hover { border-color: var(--green); }
.gen-box code:last-child { margin-bottom: 0; }

/* ── Seller API Docs ── */
.api-hero { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.api-url {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 13px;
    border-radius: 12px;
    background: var(--fill);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--muted);
    word-break: break-all;
}
.api-url b { color: var(--text); font-weight: 500; }
.verb { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 11px/1.5 var(--mono); }
.verb.post { color: var(--green); background: var(--green-bg); }
.verb.get { color: var(--cool); background: var(--cool-bg); }
.path { font-family: var(--mono); color: var(--text); word-break: break-all; }
.param { color: var(--muted); font-size: 12.5px; line-height: 1.6; white-space: normal; min-width: 180px; }
.code { position: relative; margin: 0 0 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--fill); border: 1px solid var(--line); overflow-x: auto; }
.code pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text); white-space: pre; }
.code .copy {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
    height: auto;
    padding: 4px 11px;
    font: 600 11.5px var(--ui);
    background: var(--glass-solid);
    border: 1px solid var(--line-hi);
    color: var(--muted);
    border-radius: 999px;
}
.code-cap { margin: 0 0 8px; color: var(--muted); font: 600 13px/1 var(--ui); }
.api-note { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--fill); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.api-note b { color: var(--text); }

/* ── Slide-Over Liquid Glass Drawer ── */
.drawer { position: fixed; inset: 0; z-index: 70; display: none; }
.drawer[aria-hidden="false"] { display: block; }
.drawer:before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.48); backdrop-filter: blur(6px); }
.drawer-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(468px, calc(100% - 24px));
    border-radius: var(--r-2xl);
    background: var(--glass-solid);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    display: flex;
    flex-direction: column;
    box-shadow: var(--rim), var(--shadow-lg);
    animation: slidein .26s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
}
@keyframes slidein { from { transform: translateX(34px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.drawer-head b { font-family: var(--mono); font-size: 14.5px; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-body h4 { margin: 22px 0 10px; color: var(--muted); font: 600 12px/1 var(--ui); letter-spacing: 0.04em; text-transform: uppercase; }
.drawer-body h4:first-child { margin-top: 0; }
.d-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.d-meta .k { color: var(--dim); font: 500 12px/1 var(--ui); margin-bottom: 5px; }
.d-meta .v { font-size: 13.5px; color: var(--text); font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.dev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dev-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    background: var(--fill);
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
}
.dev-list li span { min-width: 0; overflow-wrap: anywhere; }

/* ── Modals ── */
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 20px; }
.modal[aria-hidden="false"], .modal.open { display: grid; }
.modal:before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.52); backdrop-filter: blur(8px); }
.modal-card {
    position: relative;
    width: min(100%, 470px);
    max-height: calc(100dvh - 40px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 24px;
    border-radius: var(--r-2xl);
    border: 1px solid var(--line-hi);
    background: var(--glass-solid);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--rim), var(--shadow-lg);
    animation: pop .22s var(--ease);
}
@keyframes pop { from { transform: translateY(8px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-card h3 { font-size: 17px; margin-bottom: 10px; color: var(--text); }
.modal-card p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.modal-card textarea { resize: vertical; min-height: 126px; font: 13px/1.6 var(--mono); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-foot button { min-width: 88px; }

/* ── Toasts ── */
#toasts { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 95; display: flex; flex-direction: column; gap: 8px; }
.toast {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    max-width: min(420px, calc(100vw - 36px));
    overflow-wrap: anywhere;
    background: var(--glass-solid);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    color: var(--text);
    box-shadow: var(--rim), var(--shadow-lg);
    animation: toastIn .26s var(--ease);
}
.toast:before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-hi); }
.toast.ok:before { background: var(--green); }
.toast.err { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.toast.err:before { background: var(--red); }
.toast:after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; opacity: .25; transform-origin: left; animation: toastBar 3.2s linear forwards; }
.toast.ok:after { background: var(--green); opacity: .7; }
.toast.err:after { background: var(--red); opacity: .7; }
.toast.out { animation: fadeIn .2s reverse forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── Command Palette (Spotlight Glass) ── */
kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--line-hi);
    background: var(--fill);
    color: var(--muted);
    font: 500 11px/1.4 var(--mono);
}
.cmdk-btn { gap: 8px; color: var(--muted); }
.cmdk { position: fixed; inset: 0; z-index: 88; display: none; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk[aria-hidden="false"] { display: flex; }
.cmdk:before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); }
.cmdk-card {
    position: relative;
    width: min(100%, 640px);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--glass-solid);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    border-radius: var(--r-2xl);
    box-shadow: var(--rim), var(--shadow-lg);
    animation: pop .16s var(--ease);
}
.cmdk-card > input { min-height: 54px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 15px; padding: 0 20px; }
.cmdk-card > input:focus { box-shadow: none; background: transparent; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.cmdk-group { padding: 10px 10px 4px; color: var(--dim); font: 600 11px/1 var(--ui); letter-spacing: .05em; text-transform: uppercase; }
.cmdk-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 11px; cursor: pointer; }
.cmdk-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item span.mono { font-family: var(--mono); font-size: 13px; }
.cmdk-item small { flex: none; max-width: 50%; color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item.on, .cmdk-item:hover { background: var(--hover); }
.cmdk-item.on { box-shadow: inset 3px 0 0 var(--accent); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--dim); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.cmdk-foot kbd { margin-right: 3px; }

/* ── Search Tips & Inline Editors ── */
.search-help { margin: 12px 2px 0; color: var(--dim); font-size: 12px; line-height: 2; }
.search-help code { padding: 2px 7px; border-radius: 6px; background: var(--fill); border: 1px solid var(--line); color: var(--muted); font: 12px var(--mono); }
.editor { display: flex; flex-direction: column; gap: 8px; }
.editor label { margin: 6px 0 0; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 150px; }
.fn-add-row { margin: 0 12px 14px; padding: 10px 12px; border: 1px dashed var(--line-hi); border-radius: var(--r-lg); background: var(--fill); }
.fn-add-row #fn-new-name { flex: 1.4 1 190px; }
.fn-add-row #fn-new-note { flex: 1.6 1 200px; }
.fn-add-row select.mini { flex: none; }
tr.hide { display: none; }

/* ── Licenses View ── */
.page-head { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .ghost, .page-head .grad-btn { min-height: 36px; }
.ghost svg.ico, .grad-btn svg.ico { width: 16px; height: 16px; }
.ghost svg.chev { width: 14px; height: 14px; margin-left: -2px; }
.table-card, .section.table-card { padding: 0; overflow: hidden; --pad: 0px; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 12px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    margin-bottom: -1px;
    background: transparent;
    color: var(--muted);
    font: 600 13px/1 var(--ui);
    border-radius: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tab span { min-width: 22px; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--muted); font: 600 11.5px/1.4 var(--ui); text-align: center; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab.on span { background: var(--accent-soft); color: var(--accent-hi); }
.tabs-meta { margin-left: auto; padding: 0 6px; color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.table-tools { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; flex-wrap: wrap; }
.search-inline { position: relative; flex: 1; min-width: 220px; max-width: 460px; }
.search-inline svg.ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.search-inline input { min-height: 36px; padding-left: 36px; border-radius: 999px; }
.table-tools .count { margin-left: auto; }
.table-card .bulkbar { margin: 0 14px 12px; }
.table-wrap.flush { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.lic-table th { background: transparent; padding-top: 12px; padding-bottom: 12px; }
.lic-table td { padding-top: 11px; padding-bottom: 11px; }
th.right, td.right { text-align: right; width: 56px; }
.key-link { cursor: pointer; }
.key-link:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.hwid { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--fill); font: 500 12px/1.5 var(--mono); color: var(--text); }
.hwid.full { background: var(--amber-bg); color: var(--amber); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.table-foot .search-help { margin: 0; }
.table-foot .pager { margin: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty-state svg.ico { width: 34px; height: 34px; color: var(--dim); margin-bottom: 6px; }
.empty-state span { color: var(--dim); font-size: 13px; margin-bottom: 10px; }

/* ── Dropdown Menus ── */
.dd { position: relative; display: inline-block; }
.dd-menu {
    display: none;
    position: fixed;
    z-index: 95;
    min-width: 196px;
    padding: 6px;
    background: var(--glass-solid);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--line-hi);
    border-radius: 16px;
    box-shadow: var(--rim), var(--shadow-lg);
    text-align: left;
}
.dd.open .dd-menu { display: block; animation: pop .14s var(--ease); }
.dd-menu button { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 34px; padding: 0 11px; background: transparent; color: var(--text); font: 500 13px/1 var(--ui); border-radius: 9px; text-align: left; }
.dd-menu button:hover { background: var(--hover); }
.dd-menu button.danger { color: var(--red); }
.dd-menu button.danger:hover { background: var(--red-bg); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.row-dd .ghost.icon { width: 32px; min-height: 32px; border-color: transparent; background: transparent; }
.row-dd .ghost.icon:hover, .row-dd.open .ghost.icon { background: var(--hover); border-color: var(--line-hi); }

/* ── Create Keys Dialog ── */
.modal-card.wide { width: min(100%, 560px); padding: 0; }
.modal-card.wide form, .modal-card.wide #ck-result { padding: 18px 22px 22px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { margin: 0; }
.grid.two { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.hint { margin: 6px 0 0; color: var(--dim); font-size: 12.5px; }
.hint code, label code { font-family: var(--mono); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { min-height: 29px; padding: 0 12px; border-radius: 999px; background: var(--fill); border: 1px solid var(--line-hi); color: var(--muted); font: 500 12px/1 var(--ui); }
.chip:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.adv { margin-top: 6px; color: var(--muted); font-size: 13px; }
.adv summary { cursor: pointer; width: max-content; }
.adv summary:hover { color: var(--text); }
.ck-list { max-height: 280px; overflow: auto; }
.inline label.chk-line { display: inline-flex; align-items: center; min-height: 38px; gap: 7px; font-size: 13.5px; color: var(--text); font-weight: 500; cursor: pointer; }
.inline input[type="checkbox"] { flex: none; min-width: 0; }

/* ── Dashboard Overview Hero, Charts & Lists ── */
.hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 24px 26px;
    border-radius: var(--r-2xl);
    overflow: hidden;
    border: 1px solid var(--line-hi);
    background:
        radial-gradient(110% 130% at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 58%),
        radial-gradient(80% 120% at 0% 100%, rgba(255, 75, 68, 0.12), transparent 60%),
        var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--rim), var(--shadow);
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker { margin: 0 0 6px; color: var(--accent-hi); font: 600 12.5px/1 var(--ui); }
.hero-title { margin: 0; font: 700 26px/1.2 var(--display); letter-spacing: -0.02em; }
.hero-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat.kpi { position: relative; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; min-height: 138px; padding: 18px 20px; overflow: hidden; cursor: default; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kpi-top > span:first-child { color: var(--muted); font: 500 13.5px/1.2 var(--ui); }
.stat.kpi b { margin-top: 14px; font-size: 32px; }
.kpi-foot { margin-top: 8px; color: var(--dim); font-size: 12.5px; position: relative; z-index: 1; }
.trend { font-weight: 600; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--dim); }
.spark { position: absolute; right: 0; bottom: 0; width: 58%; height: 54px; opacity: .9; pointer-events: none; }
.spark .area { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.spark .ln { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.2s var(--ease) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid > .section { margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font: 600 15px/1.3 var(--display); }
.card-head p { margin: 3px 0 0; color: var(--dim); font-size: 12.5px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill); border: 1px solid var(--line); }
.seg button { min-height: 27px; padding: 0 11px; border-radius: 999px; background: transparent; color: var(--muted); font: 500 12px/1 var(--ui); }
.seg button.on { background: var(--glass-solid); color: var(--text); box-shadow: var(--shadow); }

.chart { width: 100%; }
.area-chart { display: block; width: 100%; height: auto; }
.area-chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.area-chart .ax { fill: var(--dim); font: 500 10.5px var(--ui); }
.area-chart .stroke { fill: none; stroke: var(--accent); stroke-width: 2.3; stroke-linejoin: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.4s var(--ease) forwards; }
.area-chart .fill { animation: fadeIn .9s ease .3s both; }
.area-chart .pt circle { fill: var(--glass-solid); stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .15s; }
.area-chart .pt:hover circle { opacity: 1; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; }
.donut circle:not(.track) { animation: fadeIn .6s ease both; transition: stroke-width .15s; }
.donut circle:not(.track):hover { stroke-width: 17; }
.donut .track { stroke: var(--hover); }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font: 700 26px/1 var(--display); letter-spacing: -.02em; }
.donut-c span { color: var(--dim); font-size: 12px; margin-top: 4px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; display: grid; gap: 9px; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto 38px; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 4px; }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend span { color: var(--dim); font-size: 12px; text-align: right; }

.list-card { display: flex; flex-direction: column; }
.rows-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rows-list li:last-child { border-bottom: 0; }
.rows-list .mk-key { font-family: var(--mono); font-size: 12.5px; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: auto; }
.rows-list .mk-key:hover { color: var(--accent-hi); }
.rows-list small { white-space: nowrap; }
.rows-list .empty-row, .timeline .empty-row { justify-content: center; padding: 22px 10px; color: var(--dim); border: 1px dashed var(--line-hi); border-radius: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.timeline li { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.timeline li:not(:last-child):before { content: ""; position: absolute; left: 14px; top: 38px; bottom: -6px; width: 1px; background: var(--line-hi); }
.t-ic { flex: none; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-hi); }
.t-ic svg.ico { width: 14px; height: 14px; }
.timeline li.ok .t-ic { background: var(--green-bg); color: var(--green); }
.timeline li.bad .t-ic { background: var(--red-bg); color: var(--red); }
.timeline li > div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.timeline b { font: 500 12.5px/1.3 var(--mono); color: var(--text); }
.timeline li > div > span { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline small { color: var(--dim); font-size: 11.5px; white-space: nowrap; padding-top: 2px; }

.section > .table-wrap { margin: 16px calc(var(--pad) * -1) 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.section > .table-wrap:last-child { margin-bottom: calc(var(--pad) * -1); }
.section > .toolbar + .table-wrap, .section > h2 + .table-wrap { margin-top: 0; }
.section > .pager { margin: 0 calc(var(--pad) * -1) calc(var(--pad) * -1); padding: 12px var(--pad); border-top: 1px solid var(--line); }
.section > .field-row:last-child {
    margin: 20px calc(var(--pad) * -1) calc(var(--pad) * -1);
    padding: 14px var(--pad);
    border-top: 1px solid var(--line);
    background: var(--fill);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
    justify-content: flex-end;
}
.section > h2:first-child { margin-bottom: 6px; }
.section > h2:first-child + .grid,
.section > h2:first-child + .pills,
.section > h2:first-child + .kv,
.section > h2:first-child + .chk-line { margin-top: 14px; }
.th-actions { text-align: right; }

/* ── Animations & Skeletons ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-hi) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } }

.view:not(.hide) > * { animation: fadeUp .36s var(--ease) both; }
.view:not(.hide) > *:nth-child(2) { animation-delay: .04s; }
.view:not(.hide) > *:nth-child(3) { animation-delay: .08s; }
.view:not(.hide) > *:nth-child(4) { animation-delay: .12s; }
.view:not(.hide) > *:nth-child(5) { animation-delay: .16s; }
.cards > .stat { animation: fadeUp .38s var(--ease) both; }
.cards > .stat:nth-child(2) { animation-delay: .03s; }
.cards > .stat:nth-child(3) { animation-delay: .06s; }
.cards > .stat:nth-child(4) { animation-delay: .09s; }
tbody.anim tr { animation: rowIn .28s var(--ease) both; }
.brand .dot { animation: pulseDot 2.4s infinite; }
.skel td { padding: 14px; }
.skel i { display: block; height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--fill) 0, var(--line-hi) 40%, var(--fill) 80%); background-size: 800px 100%; animation: shimmer 1.2s linear infinite; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ── Control Panel Widgets (Preserved cleanly) ── */
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; vertical-align: middle; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-hi); transition: background .18s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ── Responsive Layout ── */
@media (max-width: 1200px) {
    .dash-grid.three { grid-template-columns: 1fr 1fr; }
    .dash-grid.three > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 10px;
        top: 10px;
        bottom: 10px;
        height: auto;
        margin: 0;
        transform: translateX(calc(-100% - 20px));
        transition: transform .24s var(--ease);
        max-width: calc(100vw - 56px);
    }
    #app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .topbar { margin: 10px 14px 0; padding: 10px 14px; top: 10px; }
    .topbar .hamb { display: inline-flex; }
    .two-col { grid-template-columns: 1fr; }
    .wrap { padding: 16px 14px 60px; }
    .section { --pad: 16px; }
    .topbar .search { width: 180px; }
}
@media (max-width: 680px) {
    .topbar { flex-wrap: wrap; gap: 8px; }
    .topbar .search { order: 5; flex: 1 1 100%; width: 100%; }
    .session-timer, .cmdk-btn kbd { display: none; }
    .cards, .kpis { grid-template-columns: 1fr; }
    .dash-grid.three, .quick-actions { grid-template-columns: 1fr; }
    .grid.two, .d-meta { grid-template-columns: 1fr; }
    .hero { padding: 18px; }
    .hero-title { font-size: 21px; }
    .modal { padding: 12px; }
    .modal-card { padding: 18px; max-height: calc(100dvh - 24px); overflow-y: auto; }
    .modal-card.wide form, .modal-card.wide #ck-result { padding: 14px 16px 18px; }
    .modal-foot { flex-wrap: wrap; }
    .two-col > *, .toolbar > * { min-width: 0; max-width: 100%; }
    .table-wrap { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 480px) {
    .topbar { margin: 8px 10px 0; padding: 9px 11px; border-radius: 16px; }
    .wrap { padding: 12px 10px 44px; }
    .section { --pad: 14px; border-radius: 18px; }
    .table-tools { padding: 12px 12px 8px; }
    .table-foot { padding: 10px 12px; }
    .quick-filters { gap: 6px; }
    .filter-pill { padding: 6px 10px; font-size: 11px; }
    .glass-pill { font-size: 11px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
