@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Titanium / Gunmetal / Metallic Gray Palette */
    --bg-base: #0a0c10;
    --bg-surface: #12151c;
    --bg-surface-elevated: #181c26;
    --bg-surface-hover: #1f2430;
    --bg-input: #0c0e14;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-metallic: rgba(255, 255, 255, 0.14);
    --border-highlight: rgba(255, 255, 255, 0.24);
    
    --text-pure: #ffffff;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --metal-light: #cbd5e1;
    --metal-dark: #334155;
    
    /* Accents */
    --accent-silver: #e2e8f0;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.3);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.3);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    --shadow-card: 0 12px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    --shadow-elevated: 0 20px 48px -6px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(148, 163, 184, 0.08), transparent 70%),
        radial-gradient(circle at 10% 40%, rgba(71, 85, 105, 0.04), transparent 40%),
        radial-gradient(circle at 90% 60%, rgba(51, 65, 85, 0.04), transparent 40%);
    /* no background-attachment: fixed, it repaints the whole viewport on every scroll */
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 99%;
    max-width: 1840px;
    padding: 1rem 0.5rem;
    margin: 0.5rem auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.08));
}

h1 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 10%, #e2e8f0 45%, #94a3b8 80%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.35rem;
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.glass-panel {
    /* nearly opaque: no backdrop-filter (invisible here, and a blur per panel, nested inside the blurred modals) */
    background: linear-gradient(180deg, rgba(22, 26, 35, 0.88) 0%, rgba(14, 17, 23, 0.94) 100%);
    border: 1px solid var(--border-metallic);
    border-radius: 14px;
    padding: 1.2rem 1.2rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow-card);
    margin-bottom: 1.75rem;
    position: relative;
    width: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-pure);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #f8fafc, #94a3b8);
    border-radius: 2px;
}

/* Forms & Inputs */
.form-group {
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-field {
    flex: 1;
    min-width: 280px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-metallic);
    border-radius: 8px;
    padding: 0.8rem 1.1rem;
    color: var(--text-pure);
    font-size: 0.95rem;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.08);
}

input::placeholder {
    color: var(--text-muted);
}

/* Buttons - Brushed Metallic & Industrial */
.btn-primary {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 40%, #cbd5e1 80%, #94a3b8 100%);
    color: #0b0f17;
    border: 1px solid #ffffff;
    border-radius: 8px;
    padding: 0.8rem 1.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 40%, #e2e8f0 80%, #cbd5e1 100%);
    box-shadow: inset 0 1px 0 #ffffff, 0 0 16px rgba(255, 255, 255, 0.25), 0 6px 16px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(180deg, #242934 0%, #171b22 100%);
    border: 1px solid var(--border-metallic);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: linear-gradient(180deg, #2e3442 0%, #1e222c 100%);
    color: var(--text-pure);
    transform: translateY(-1px);
}

.btn-lock {
    background: linear-gradient(180deg, #1e222a 0%, #13161c 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-lock:hover {
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
}

/* Compact Action Buttons in Table */
.btn-sm {
    padding: 0.32rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #6ee7b7;
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--success);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.btn-ghost-danger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.btn-ghost-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger-border);
    color: #f87171;
}

/* Table Architecture - NO UGLY BARS, NO HORIZONTAL OVERFLOW ON DESKTOP */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(10, 12, 16, 0.5);
    
    /* Sleek metallic scrollbar if ever needed */
    scrollbar-width: thin;
    scrollbar-color: #2b303c transparent;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #2b303c;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

th, td {
    padding: 0.65rem 0.6rem;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    background: rgba(18, 22, 29, 0.85);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-metallic);
}

th:first-child { border-top-left-radius: 9px; }
th:last-child { border-top-right-radius: 9px; }

tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-subtle);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr td {
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

/* License Key Display - NEVER WRAPS */
.key-container {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.key-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    background: #080a0e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    color: #e2e8f0;
    white-space: nowrap;
    letter-spacing: 0.3px;
    user-select: all;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-metallic);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-pure);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Metric Badges & Pills */
.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-pure);
    white-space: nowrap;
}

.metric-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 0.35rem;
    font-weight: 400;
}

/* Instance Status Badge (Interactive) */
.instance-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.instance-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.instance-pill.active {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #34d399;
}

.instance-pill.blocked {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: #f87171;
}

.instance-pill.offline {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.active {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #34d399;
}

.status-badge.revoked {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #f87171;
}

/* Modals & Overlays */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 7, 10, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s linear 0s;
}

/* Closed overlays must leave the render tree: with opacity 0 alone, every closed modal kept a full-screen
   backdrop blur composited on every frame (10 of them, redrawn continuously by the pulsing live dot) */
.auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.auth-box {
    max-width: 440px;
    width: 90%;
    text-align: center;
    background: linear-gradient(180deg, #1b1f28 0%, #11141b 100%);
    border: 1px solid var(--border-highlight);
    box-shadow: var(--shadow-elevated);
}

/* Instance Modal List Card */
.instance-card {
    background: #0e1117;
    border: 1px solid var(--border-metallic);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin-bottom: 0.85rem;
    transition: border-color 0.2s ease;
}

.instance-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.35s ease forwards;
}

@keyframes pulse {
    0% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.92); opacity: 0.7; }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #34d399;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #34d399;
    animation: pulse 1.6s infinite ease-in-out;
}

/* Tabs */
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: 6px 6px 0 0;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
    background: rgba(56, 189, 248, 0.06);
}

/* Hosting Badges */
.badge-cloud {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}
.badge-onprem {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Feature Item Card */
.feature-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}
.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}
.feature-card input[type="checkbox"] {
    accent-color: #38bdf8;
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}

/* =====================================================================
   App shell: sidebar navigation + licenses page
   ===================================================================== */
body { display: block; }

.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; width: 100%; }

.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    background: linear-gradient(180deg, #10131a 0%, #0c0e14 100%);
    border-right: 1px solid var(--border-subtle); padding: 1.1rem 0.75rem 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0.2rem 0.55rem 1.2rem; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-name { font-weight: 700; color: var(--text-pure); font-size: 1rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.72rem; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted);
               padding: 1.1rem 0.7rem 0.4rem; }
.nav-item { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.55rem 0.7rem; border-radius: 8px;
            background: none; border: 1px solid transparent; color: var(--text-secondary); font-size: 0.86rem; font-weight: 500;
            text-align: left; text-decoration: none; cursor: pointer; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: var(--bg-surface-hover); color: var(--text-pure); }
.nav-item.active { background: var(--bg-surface-elevated); border-color: var(--border-subtle); color: var(--text-pure); }
.nav-ico { width: 20px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-count { font-size: 0.7rem; color: var(--text-secondary); background: var(--bg-surface-hover); border-radius: 999px; padding: 0.05rem 0.5rem; }
.nav-count:empty { display: none; }

.sidebar-user { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.55rem 0.2rem; margin-top: 0.6rem;
                border-top: 1px solid var(--border-subtle); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
               background: var(--bg-surface-hover); border: 1px solid var(--border-metallic); color: var(--text-pure);
               font-weight: 700; font-size: 0.85rem; text-transform: uppercase; }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 0.84rem; font-weight: 600; color: var(--text-pure); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; flex-shrink: 0;
            background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); cursor: pointer;
            font-size: 1rem; line-height: 1; transition: all 0.15s; }
.icon-btn:hover { background: var(--bg-surface-hover); color: var(--text-pure); border-color: var(--border-metallic); }

.main { padding: 1.6rem 2rem 2.5rem; min-width: 0; max-width: 1600px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-title { font-size: 1.55rem; font-weight: 700; color: var(--text-pure); letter-spacing: -0.02em; margin: 0;
              background: none; -webkit-text-fill-color: currentColor; }
.page-sub { font-size: 0.86rem; color: var(--text-secondary); margin-top: 0.25rem; }
.page-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search-ico { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; }
.search input { width: 320px; max-width: 70vw; background: var(--bg-input); border: 1px solid var(--border-metallic); border-radius: 9px;
                padding: 0.62rem 0.8rem 0.62rem 2.1rem; color: var(--text-pure); font-size: 0.86rem; outline: none; }
.search input:focus { border-color: var(--border-highlight); }
.btn-new { padding: 0.62rem 1.05rem !important; font-size: 0.86rem !important; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 1.1rem; }
.stat { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 0.9rem 1rem; }
.stat[role="button"] { cursor: pointer; transition: border-color 0.15s; }
.stat[role="button"]:hover { border-color: var(--border-metallic); }
.stat-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-size: 1.65rem; font-weight: 700; color: var(--text-pure); margin: 0.25rem 0 0.1rem; letter-spacing: -0.02em; }
.stat-of { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.stat-sub { font-size: 0.75rem; color: var(--text-secondary); }
.stat.warn { border-color: var(--warning-border); background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), var(--bg-surface)); }
.stat.warn .stat-value { color: #fbbf24; }
.stat.ok .stat-value { color: #34d399; }

.list-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; overflow: hidden; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap;
                padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border-subtle); }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { white-space: nowrap; padding: 0.38rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500; cursor: pointer;
        background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); transition: all 0.15s; }
.chip:hover { color: var(--text-pure); border-color: var(--border-metallic); }
.chip.active { background: var(--bg-surface-hover); border-color: var(--border-highlight); color: var(--text-pure); }
.list-tools { display: flex; align-items: center; gap: 0.6rem; }

.list-card .table-wrapper { border: none; border-radius: 0; margin: 0; }
.lic-table { width: 100%; border-collapse: collapse; }
.lic-table th { text-align: left; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
                color: var(--text-muted); padding: 0.65rem 0.9rem; background: rgba(255, 255, 255, 0.015);
                border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.lic-table td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; font-size: 0.86rem; }
.lic-table tbody tr { transition: background 0.12s; }
.lic-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.lic-table tbody tr:last-child td { border-bottom: none; }
.lic-table tr.is-revoked td:not(.row-actions) { opacity: 0.55; }
.lic-table td.empty { text-align: center; padding: 2.6rem; color: var(--text-muted); }
.lic-table td.empty a { color: var(--text-pure); }

.client-name { font-weight: 600; color: var(--text-pure); font-size: 0.92rem; }
.cell-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.2rem; white-space: nowrap; }
.cell-sub.warn { color: #fbbf24; }
.cell-strong { font-weight: 600; color: var(--text-pure); }
.cell-muted { color: var(--text-muted); }
.cell-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 0.3rem 0.45rem; margin: -0.3rem -0.45rem;
            text-align: left; color: var(--text-primary); cursor: pointer; font-size: 0.86rem; min-width: 110px; }
.cell-btn:hover { background: var(--bg-surface-hover); border-color: var(--border-subtle); }
.tag { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 0.05rem 0.45rem; border-radius: 5px; margin-right: 0.3rem; }
.tag.cloud { color: #7dd3fc; background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.25); }
.tag.onprem { color: var(--text-secondary); background: var(--bg-surface-hover); border: 1px solid var(--border-subtle); }

.key-chip { display: inline-flex; align-items: center; gap: 0.25rem; background: var(--bg-input); border: 1px solid var(--border-subtle);
            border-radius: 7px; padding: 0.2rem 0.25rem 0.2rem 0.55rem; }
.key-chip code { font-family: 'JetBrains Mono', monospace; font-size: 0.76rem; color: var(--text-primary); }
.key-chip .copy-btn { width: 24px; height: 24px; font-size: 0.85rem; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.45rem; vertical-align: 1px; }
.dot.green { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }
.dot.amber { background: #fbbf24; }
.dot.grey { background: #475569; }

.quota { height: 4px; background: var(--bg-surface-hover); border-radius: 4px; margin-top: 0.35rem; width: 90px; overflow: hidden; }
.quota-fill { height: 100%; background: #34d399; border-radius: 4px; }
.quota-fill.hot { background: #f59e0b; }

.pill { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.74rem; font-weight: 600; padding: 0.2rem 0.6rem;
        border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { color: #6ee7b7; background: var(--success-bg); border-color: var(--success-border); }
.pill.amber { color: #fcd34d; background: var(--warning-bg); border-color: var(--warning-border); }
.pill.red { color: #fca5a5; background: var(--danger-bg); border-color: var(--danger-border); }
.pill.grey { color: var(--text-secondary); background: var(--bg-surface-hover); border-color: var(--border-subtle); }

.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn-sm { margin-right: 0.3rem; }
.row-menu { position: fixed; z-index: 1200; min-width: 210px; padding: 0.35rem; border-radius: 10px;
            background: var(--bg-surface-elevated); border: 1px solid var(--border-metallic); box-shadow: var(--shadow-elevated); }
.row-menu.hidden { display: none; }
.row-menu button { display: block; width: 100%; text-align: left; padding: 0.55rem 0.7rem; border-radius: 7px; border: none;
                   background: none; color: var(--text-primary); font-size: 0.84rem; cursor: pointer; }
.row-menu button:hover { background: var(--bg-surface-hover); color: var(--text-pure); }
.row-menu button.danger { color: #fca5a5; }
.row-menu button.danger:hover { background: var(--danger-bg); }
.row-menu-sep { height: 1px; background: var(--border-subtle); margin: 0.3rem 0.2rem; }

.toast { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 1300; max-width: 460px; padding: 0.85rem 1rem; border-radius: 10px;
         background: var(--bg-surface-elevated); border: 1px solid var(--border-metallic); box-shadow: var(--shadow-elevated);
         color: var(--text-primary); font-size: 0.86rem; opacity: 0; transform: translateY(10px); pointer-events: none;
         transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast code { font-family: 'JetBrains Mono', monospace; color: var(--text-pure); }

/* New license dialog */
.seg { display: flex; gap: 0.4rem; }
.seg label, .smtp-field .seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 0.6rem; border-radius: 8px;
             background: var(--bg-input); border: 1px solid var(--border-metallic); color: var(--text-secondary); font-size: 0.84rem;
             text-transform: none; letter-spacing: 0; font-weight: 500; cursor: pointer; margin: 0; }
.seg label:has(input:checked), .smtp-field .seg label:has(input:checked) { border-color: var(--border-highlight); color: var(--text-pure); background: var(--bg-surface-hover); }
.seg input { display: none; }
.field-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-muted); }
.feat-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.feat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.55rem; margin-top: 0.8rem; }

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.6rem; }
    .brand { padding: 0.2rem 0.4rem; }
    .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; order: 3; flex: 0 0 100%; min-width: 0; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .list-toolbar .chips { flex-wrap: nowrap; overflow-x: auto; }
    .nav-section { display: none; }
    .nav-item { width: auto; white-space: nowrap; }
    .sidebar-user { margin: 0 0 0 auto; border: none; padding: 0; }
    .main { padding: 1rem; }
    .search input { width: 100%; max-width: none; }
    .page-actions, .search { width: 100%; }
}
