/* ========================================
   ENS THEME - Light default, html.dark for dark mode
   PentestOps V2
   Matching Website and Portal Theme
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Brand Colors - ENS Navy/Teal */
    --primary: #0F2B5B;
    --primary-dark: #091a38;
    --primary-light: #3d83f6;
    --primary-glow: rgba(0, 180, 216, 0.3);

    /* Secondary Colors */
    --secondary: #00B4D8;
    --secondary-glow: rgba(6, 182, 212, 0.3);
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.3);

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Light Theme Background (default) */
    --bg-dark: #F0F4F8;
    --bg-base: #F0F4F8;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --bg-elevated: #ffffff;
    --border: rgba(0, 0, 0, 0.08);

    /* Glass Effects - Light (default) */
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-bg-strong: rgba(255, 255, 255, 0.95);
    --glass-bg-hover: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-subtle: rgba(0, 0, 0, 0.06);
    --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --glass-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --glass-hover: rgba(0, 0, 0, 0.04);
    --blur-sm: 12px;
    --blur-md: 16px;
    --blur-lg: 20px;

    /* Text Colors - Light (default) */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #1e293b;

    /* Shadows - Light */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 60px rgba(0, 180, 216, 0.15);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 100px;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0F2B5B 0%, #1a65d6 50%, #00B4D8 100%);
    --gradient-hero: none;

    /* Font */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ========================================
   DARK MODE (activated by html.dark class)
   ======================================== */

html.dark {
    --bg-dark: #0A1628;
    --bg-base: #0A1628;
    --bg-card: #1E293B;
    --bg-card-hover: #1e293b;
    --bg-elevated: #1e293b;
    --border: rgba(255, 255, 255, 0.08);

    --glass-bg: rgba(15, 23, 42, 0.95);
    --glass-bg-strong: rgba(15, 23, 42, 0.95);
    --glass-bg-hover: rgba(30, 41, 59, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-subtle: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.4);
    --glass-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(0, 180, 216, 0.3);

    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 180, 216, 0.3), transparent);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for mobile */
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    height: 100dvh;
    overflow: hidden; /* Prevent page scrolling */
    -webkit-font-smoothing: antialiased;
}

/* Background Effects - Purple Glow */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0, 180, 216, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

/* Container */
.container {
    max-width: 2200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   SIDEBAR - Intense Glass Panel
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
    margin: 0;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

.sidebar-header .admin-badge {
    display: inline-block;
    background: rgba(0, 180, 216, 0.15);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    border: 1px solid rgba(0, 180, 216, 0.3);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(0, 180, 216, 0.1);
    color: var(--secondary);
    border-left-color: rgba(0, 180, 216, 0.5);
}

.nav-item.active {
    background: rgba(0, 180, 216, 0.15);
    color: var(--secondary);
    border-left: 3px solid var(--secondary);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: 0.7rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
}
.sidebar-footer-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
}
.sidebar-version {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.sidebar-copyright {
    font-size: 0.66rem;
    color: var(--text-muted);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: 220px;
    padding: 1.25rem 1.5rem;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto; /* Enable internal scrolling */
    overflow-x: hidden;
    position: relative;
    z-index: 1;
    transition: margin-left 0.3s ease, margin-right 0.3s ease;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.content-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-md);
}

/* ========================================
   CARDS - Intense Glass Panels
   ======================================== */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-lg);
    border-color: rgba(0, 180, 216, 0.2);
}

/* .glass-card: the MSP templates + agent-fleet use this class as their card
   container, but only a GPU-hint rule existed for it (theme.css) - so every
   card rendered transparent, square-cornered and shadowless in both themes.
   Give it the same glass surface as .card. No margin-bottom: these are used
   inside gap-spaced grids, so a bottom margin would double the spacing. Padding
   is included but any element that sets inline padding (e.g. table wrappers with
   padding:0) overrides it. Dark variant comes free via the --glass-* tokens. */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}
.glass-card:hover {
    box-shadow: var(--glass-shadow-lg);
    border-color: rgba(0, 180, 216, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    /* Additional body styling if needed */
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   STATS GRID - Glass Stat Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-lg);
    border-color: rgba(0, 180, 216, 0.25);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.stat-icon.secondary {
    background: linear-gradient(135deg, var(--accent-secondary), #0891b2);
}

.stat-icon.accent {
    background: linear-gradient(135deg, var(--accent), #059669);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-family: var(--font-mono);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ========================================
   TABLES - Clean Glass Style
   ======================================== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: rgba(0, 180, 216, 0.08);
}

.table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 180, 216, 0.15);
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(0, 180, 216, 0.05);
}

.row-danger {
    background: rgba(239, 68, 68, 0.05) !important;
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-cell-sm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #ffffff;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

/* ========================================
   BUTTONS - Intense Glass Pills
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: var(--font-sans);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.btn-primary {
    background: rgba(0, 180, 216, 0.2);
    color: var(--secondary);
    border: 1px solid rgba(0, 180, 216, 0.3);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.15);
}

.btn-primary:hover {
    background: rgba(0, 180, 216, 0.35);
    box-shadow: 0 0 30px rgba(0, 180, 216, 0.3);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-top: 1px solid rgba(16, 185, 129, 0.5);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.9);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-top: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-top: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.9);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

.btn-outline {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    background: rgba(0, 180, 216, 0.1);
    color: var(--secondary);
    border-color: rgba(0, 180, 216, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-group {
    display: flex;
    gap: 0.25rem;
}

/* ========================================
   BADGES - Intense Glass Pills
   ======================================== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.25);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}

/* Neutral/unknown badge -- readable in BOTH themes (the bare .badge default
   was grey-on-grey + unreadable in light mode, e.g. the SSL "Unknown" pill). */
.badge-neutral {
    background: rgba(100, 116, 139, 0.18);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.35);
}
html:not(.dark) .badge-neutral {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
    border-color: rgba(100, 116, 139, 0.3);
}

.badge-info {
    background: rgba(6, 182, 212, 0.12);
    color: var(--info);
    border-color: rgba(6, 182, 212, 0.25);
}

.badge-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.1);
}

.badge-primary {
    background: rgba(0, 0, 0, 0.08);
    color: var(--secondary);
    border-color: rgba(0, 0, 0, 0.15);
}

/* ========================================
   FORMS - Glass Inputs
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label,
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    background: var(--glass-bg-hover);
    border-color: var(--secondary);
    box-shadow:
        0 0 0 3px rgba(0, 180, 216, 0.15),
        0 0 20px rgba(0, 180, 216, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch input[type="checkbox"] {
    width: 48px;
    height: 24px;
    appearance: none;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent);
}

.toggle-switch input[type="checkbox"]:checked::after {
    left: 26px;
    background: var(--accent);
}

.toggle-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
}

/* ========================================
   FILTERS
   ======================================== */
.filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-group select {
    min-width: 140px;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    background: var(--glass-bg-hover);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(0, 180, 216, 0.2);
}

/* ========================================
   TABS
   ======================================== */
.tabs {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0;
}

.tab {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    white-space: nowrap;
    margin-bottom: -0.0625rem;
}

.tab:hover {
    color: var(--secondary);
    background: rgba(0, 180, 216, 0.05);
}

.tab.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    background: transparent;
}

.tab .badge {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    min-width: 20px;
    text-align: center;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(6, 182, 212, 0.08);
    color: var(--info);
    border-color: rgba(6, 182, 212, 0.2);
}

/* ========================================
   MODAL - Intense Glass Overlay
   ======================================== */
/* Modal is moved to <body> by JS so position:fixed works reliably.
   It acts as full-screen overlay + flex-centers its content. */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--glass-bg-strong);
    border: 1px solid rgba(0, 180, 216, 0.15);
    padding: 0;
    width: 90%;
    max-width: 600px;
    position: relative;
    z-index: 10001;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 100px rgba(0, 180, 216, 0.1);
    max-height: 80vh;
    /* Clip to the rounded corners and let only the BODY scroll. Previously
       `overflow:auto` here put the scrollbar on the whole card, squaring off
       the rounded top-right corner next to the close button. */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 180, 216, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 180, 216, 0.05);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-primary);
    overflow-y: auto;
}

.modal-body label,
.modal-body .form-label {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 180, 216, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(0, 180, 216, 0.03);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    flex-shrink: 0;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ========================================
   DANGER MODAL VARIANT
   ======================================== */
.modal-danger .modal-header {
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.modal-danger .modal-header h3 {
    color: var(--danger);
}

.modal-danger .modal-content {
    border-color: rgba(239, 68, 68, 0.3);
}

/* Dark theme danger modal */
body[data-theme="dark"] .modal-danger .modal-header {
    background: rgba(255, 68, 68, 0.15);
    border-bottom: 1px solid rgba(255, 68, 68, 0.25);
}

body[data-theme="dark"] .modal-danger .modal-header h3 {
    color: #ff6666;
}

body[data-theme="dark"] .modal-danger .modal-content {
    border-color: rgba(255, 68, 68, 0.3);
}

/* ========================================
   APPROVAL CARDS - Intense Glass
   ======================================== */
.approval-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
}

.approval-card:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-lg);
    border-color: rgba(0, 180, 216, 0.2);
}

.approval-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.approval-header h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tenant-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.approval-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.approval-details {
    display: grid;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-row {
    display: flex;
    gap: 0.75rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 160px;
    font-size: 0.85rem;
}

.detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

/* ========================================
   HEALTH STATUS - Intense Glass
   ======================================== */
.status-banner {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid;
    box-shadow: var(--glass-shadow);
}

.status-banner.status-healthy {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.status-banner.status-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.status-banner.status-critical {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.status-icon {
    font-size: 3rem;
}

.status-text h2 {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.status-text p {
    color: var(--text-secondary);
    margin: 0;
}

/* Health Grid */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.health-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.health-card:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(0, 180, 216, 0.2);
}

.health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.health-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.health-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.status-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.health-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.health-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.health-metric .metric-value {
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value {
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-bar {
    width: 80px;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ========================================
   LOGIN PAGE - Intense Glass
   ======================================== */
/* Login page body - center content without scrolling */
body:has(.login-container) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.25rem;
}

.login-container {
    max-width: 340px;
    width: 100%;
    margin: 0 auto;
    padding: 1.625rem 1.375rem;
    background: var(--glass-bg-strong);
    border: 1px solid rgba(0, 180, 216, 0.15);
    border-radius: var(--radius-xl);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 100px rgba(0, 180, 216, 0.1);
    position: relative;
    z-index: 10;
}

.login-logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
    text-align: center;
    margin-bottom: 0.375rem;
    font-family: var(--font-mono);
}

.admin-badge-login {
    background: rgba(0, 180, 216, 0.15);
    color: var(--secondary);
    padding: 0.3125rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 180, 216, 0.3);
}

.login-form .form-group {
    margin-bottom: 0.875rem;
}

.login-form .btn-primary,
.login-container .btn-primary {
    width: 100%;
    padding: 0.625rem;
    font-size: 0.85rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
}

.login-form .btn-primary:hover,
.login-container .btn-primary:hover {
    box-shadow: 0 6px 25px rgba(0, 180, 216, 0.4);
}

/* ========================================
   PLANS GRID
   ======================================== */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.plan-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
}

.plan-card:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(0, 180, 216, 0.2);
    box-shadow: var(--glass-shadow-lg);
}

.plan-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Integration Card */
.integration-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.integration-card:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(0, 180, 216, 0.2);
}

.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.integration-header h4 {
    margin: 0;
    color: var(--text-primary);
}

/* ========================================
   CODE BLOCK - Terminal Style
   ======================================== */
.code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    color: var(--secondary);
}

/* ========================================
   ROW LAYOUT
   ======================================== */
.row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.flex-1 {
    flex: 1;
}

/* Action List for Maintenance Buttons */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-list .btn {
    position: relative;
    z-index: 1;
}

/* Event Items */
.event-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.event-item:last-child {
    border-bottom: none;
}

.event-icon {
    font-size: 1.25rem;
    width: 32px;
    text-align: center;
}

.event-content {
    flex: 1;
}

.event-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.event-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination .btn {
    min-width: 40px;
    justify-content: center;
}

/* ========================================
   DEPLOYMENT URL STYLES
   ======================================== */
.deployment-url {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deployment-url a {
    color: var(--secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.deployment-url a:hover {
    text-decoration: underline;
    color: var(--accent);
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-sm { font-size: 0.8rem; }
.text-monospace { font-family: var(--font-mono); }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: #b45309 !important; }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.loading-spinner {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-top: 3px solid var(--secondary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Glow Animation for Accents */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 180, 216, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 180, 216, 0.5); }
}

.glow-accent {
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.3);
}

/* ========================================
   MOBILE MENU TOGGLE
   ======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 102;
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: scale(1.05);
}

.mobile-menu-toggle.active {
    background: var(--bg-elevated);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Large desktop (1600px and above) */
@media (min-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .main-content {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 180px;
    }

    .main-content {
        margin-left: 180px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h2,
    .sidebar-header .admin-badge,
    .nav-item span:not(.nav-icon),
    .sidebar-footer button span {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 0.75rem;
    }

    .main-content {
        margin-left: 60px;
        padding: 1rem;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .filter-group select {
        flex: 1;
        min-width: 120px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
    }

    .health-grid {
        grid-template-columns: 1fr;
    }

    .approval-header {
        flex-direction: column;
    }

    .approval-actions {
        width: 100%;
        flex-direction: column;
    }

    .approval-actions button {
        width: 100%;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        white-space: nowrap;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-label {
        min-width: auto;
    }

    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    /* Sidebar slides in from left on mobile */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 70px; /* Space for mobile toggle */
    }
}

/* Scrollbar - Dark Purple Style */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.25);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 180, 216, 0.4);
}

/* Selection */
::selection {
    background: rgba(0, 180, 216, 0.3);
    color: var(--text-primary);
}

/* ========================================
   ENS DESIGN PATTERNS
   ======================================== */

/* Glass-morphism on all cards */
.card, .stat-card, .metric-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.card:hover, .stat-card:hover {
    border-color: rgba(0, 180, 216, 0.15);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 180, 216, 0.05);
}

/* Stat card accent glow */
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    background: radial-gradient(circle, currentColor, transparent);
    transform: translate(30%, -30%);
    pointer-events: none;
}

/* Button hover lift */
.btn-primary:hover, .btn-success:hover, .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.25);
}

.btn-primary:active, .btn-success:active, .btn-danger:active {
    transform: translateY(0);
}

/* Page content fade-in */
.main-content {
    animation: fadeIn 0.3s ease-out;
}

/* Sidebar glass effect */
.sidebar {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Active nav indicator bar */
.sidebar .nav-item.active {
    position: relative;
}
.sidebar .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: linear-gradient(180deg, #0F2B5B, #00B4D8);
    border-radius: 0 4px 4px 0;
}

/* Input focus glow */
input:focus, select:focus, textarea:focus, .form-control:focus, .form-input:focus {
    border-color: #00B4D8 !important;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15) !important;
    outline: none;
}

/* Table row hover transition */
.table tbody tr {
    transition: background 0.15s ease;
}

/* Modal glass effect */
.modal-content {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Badge rounded-full */
.badge {
    border-radius: 9999px;
}

/* Toast notification styling */
.toast {
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Smooth scrollbar for all containers */
.sidebar-nav {
    scrollbar-width: thin;
}

/* Page header glass */
.page-header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ENS: rounded-2xl on all interactive elements */
.btn, button:not(.theme-toggle-btn):not(.mobile-menu-toggle) { border-radius: 16px; }
.form-control, .form-input, .form-select, .form-textarea, input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="number"], select, textarea { border-radius: 12px; }
.modal, .modal-content { border-radius: 16px; }

/* ENS: dark shimmer */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer, .shimmer-dark {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
html:not(.dark) .shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

/* ENS: brand-tinted button shadows */
.btn-primary { box-shadow: 0 4px 14px rgba(0, 180, 216, 0.2); }
.btn-primary:hover { box-shadow: 0 8px 25px rgba(0, 180, 216, 0.3); }
.btn-danger { box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2); }
.btn-danger:hover { box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3); }
.btn-success { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2); }
.btn-success:hover { box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3); }

/* ENS: modal backdrop blur */
.modal-overlay, .modal-backdrop { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

/* ENS: empty state pattern */
.empty-state { text-align: center; padding: 4rem 1.5rem; }
.empty-state-container { background: rgba(255, 255, 255, 0.03); border: 2px dashed rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 3rem; }
html:not(.dark) .empty-state-container { background: rgba(0, 0, 0, 0.02); border-color: rgba(0, 0, 0, 0.1); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty-state-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state-description { font-size: 0.875rem; color: var(--text-muted, #64748b); margin-bottom: 1.5rem; }

/* v3.5.80: brand logo dark-mode = theme-swapped PNGs (no CSS filter).
 * Light PNG (navy wordmark/mark) shows by default; dark PNG (white+blue)
 * shows when html.dark is set. Both variants have identical dimensions so
 * the swap is seamless. Wordmark = full lockup; mark = chevron icon only. */
.pentestops-wordmark--dark { display: none !important; }
html.dark .pentestops-wordmark--light { display: none !important; }
html.dark .pentestops-wordmark--dark { display: block !important; }

.pentestops-mark--dark { display: none !important; }
html.dark .pentestops-mark--light { display: none !important; }
html.dark .pentestops-mark--dark { display: inline-block !important; }

/* ENS: table-modern */
.table-modern { width: 100%; }
.table-modern thead { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.table-modern th { padding: 0.875rem 1.25rem; text-align: left; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted, #64748b); }
.table-modern td { padding: 1rem 1.25rem; font-size: 0.875rem; }
.table-modern tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.03); transition: background 0.15s ease; }
.table-modern tbody tr:hover { background: rgba(0, 180, 216, 0.03); }
html:not(.dark) .table-modern thead { border-bottom-color: rgba(0, 0, 0, 0.06); }
html:not(.dark) .table-modern tbody tr { border-bottom-color: rgba(0, 0, 0, 0.04); }
html:not(.dark) .table-modern tbody tr:hover { background: rgba(0, 0, 0, 0.02); }

/* ========================================
   LIGHT MODE ELEMENT STYLES (default, excluded in dark)
   ======================================== */

/* ── Body & Background ── */
html:not(.dark) body { background: #F0F4F8; color: #1e293b; }
html:not(.dark) body::before { background: none; }

/* ── Typography - headings, paragraphs, labels ── */
html:not(.dark) h1, html:not(.dark) h2, html:not(.dark) h3, html:not(.dark) h4, html:not(.dark) h5, html:not(.dark) h6 { color: #1e293b; }
html:not(.dark) p { color: #475569; }
html:not(.dark) .content-header h1 { color: #1e293b; }
html:not(.dark) .content-header p { color: #64748b; }
html:not(.dark) .text-muted { color: #64748b; }
html:not(.dark) .text-secondary { color: #475569; }
html:not(.dark) .text-primary { color: #1e293b; }
html:not(.dark) label { color: #475569; }
html:not(.dark) .form-label { color: #475569; }
html:not(.dark) .form-group label { color: #475569; }
html:not(.dark) .toggle-label { color: #475569; }
html:not(.dark) .checkbox-label { color: #475569; }
html:not(.dark) strong { color: #1e293b; }

/* ── Links ── */
html:not(.dark) a:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-secondary):not(.nav-item) { color: #1a65d6; }
html:not(.dark) a:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-secondary):not(.nav-item):hover { color: #0F2B5B; }

/* ── Sidebar ── */
html:not(.dark) .sidebar { background: rgba(255, 255, 255, 0.9); border-right: 1px solid rgba(0, 0, 0, 0.08); box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05); }
html:not(.dark) .sidebar .nav-item { color: #64748b; }
html:not(.dark) .sidebar .nav-item:hover { background: rgba(0, 0, 0, 0.04); color: #1e293b; }
html:not(.dark) .sidebar .nav-item.active { background: rgba(0, 180, 216, 0.15); color: #0F2B5B; border-left: 3px solid #00B4D8; }
html:not(.dark) .sidebar-header { border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .sidebar-footer { border-top: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .sidebar-header h2 { color: #0F2B5B; }

/* ── Cards ── */
html:not(.dark) .card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.06); backdrop-filter: blur(8px); }
html:not(.dark) .card:hover { background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
html:not(.dark) .card-header { border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .card-header h3 { color: #1e293b; }

/* ── Stat Cards - dashboard numbers & labels ── */
html:not(.dark) .stat-card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .stat-value { color: #1e293b; }
html:not(.dark) .stat-label { color: #64748b; }
html:not(.dark) .stat-trend.neutral { color: #64748b; }

/* ── Forms & Inputs ── */
html:not(.dark) input, html:not(.dark) select, html:not(.dark) textarea { background: rgba(255, 255, 255, 0.9); border-color: rgba(0, 0, 0, 0.12); color: #1e293b; }
html:not(.dark) .form-control, html:not(.dark) .form-input, html:not(.dark) .form-select { background: #ffffff; border-color: rgba(0, 0, 0, 0.12); color: #1e293b; }
/* The base .form-control uses a heavy dark INSET shadow for the glass/dark
   theme; on white light-mode inputs that reads as an ugly floating box. Reset
   to a crisp 1px border with no inner shadow in light mode. */
html:not(.dark) .form-control, html:not(.dark) .form-input, html:not(.dark) .form-select,
html:not(.dark) input, html:not(.dark) select, html:not(.dark) textarea { box-shadow: none; }
html:not(.dark) input::placeholder, html:not(.dark) textarea::placeholder { color: #94a3b8; }

/* ── Tables ── */
html:not(.dark) .table th { color: #64748b; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
html:not(.dark) .table td { border-bottom: 1px solid rgba(0, 0, 0, 0.04); color: #1e293b; }
html:not(.dark) .table tr:hover { background: rgba(0, 0, 0, 0.02); }

/* ── Page Header ── */
html:not(.dark) .page-header { background: rgba(255, 255, 255, 0.9); border-bottom: 1px solid rgba(0, 0, 0, 0.06); backdrop-filter: blur(12px); }

/* ── Modals ── */
html:not(.dark) .modal { background: rgba(0, 0, 0, 0.5); }
html:not(.dark) .modal-content { background: #ffffff; color: #1e293b; }
html:not(.dark) .modal-overlay { background: rgba(0, 0, 0, 0.4); }

/* Modal text visibility - ensure readable in both light and dark modes */
.modal-content { color: var(--text-primary); }
.modal-content h2, .modal-content h3 { color: var(--text-primary); }
.modal-content p, .modal-content label { color: var(--text-primary); }
.modal-content input, .modal-content select, .modal-content textarea { color: var(--text-primary); background: var(--bg-elevated); border-color: var(--border); }

/* ── Badges ── */
html:not(.dark) .badge { background: rgba(0, 0, 0, 0.05); color: #475569; }
html:not(.dark) .badge-success { background: rgba(16, 185, 129, 0.12); color: #059669; }
html:not(.dark) .badge-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
html:not(.dark) .badge-warning { background: rgba(245, 158, 11, 0.12); color: #b45309; }
html:not(.dark) .badge-info { background: rgba(0, 180, 216, 0.12); color: #0e7490; }
html:not(.dark) .badge-primary { background: rgba(15, 43, 91, 0.1); color: #0F2B5B; }
/* .badge-secondary had no light-mode override (every sibling badge does), so it
   fell back to the soft --text-secondary slate. Pin a darker slate for crisp
   contrast on the near-white chip across the ~20 pages that use it. */
html:not(.dark) .badge-secondary { background: rgba(0, 0, 0, 0.06); color: #334155; }
/* Dark code blocks (MSP DNS/SSL CNAME records): the value is light text on a
   navy box, but selecting it to copy used the browser's default light
   selection highlight -> light-on-light, invisible. Force a readable teal
   selection. (::selection and ::-moz-selection must be separate rules.) */
.code-dark::selection,
html:not(.dark) .code-dark::selection, html.dark .code-dark::selection,
html:not(.dark) .code-dark *::selection, html.dark .code-dark *::selection { background: #38bdf8; color: #0a1628; }
.code-dark::-moz-selection,
html:not(.dark) .code-dark::-moz-selection, html.dark .code-dark::-moz-selection,
html:not(.dark) .code-dark *::-moz-selection, html.dark .code-dark *::-moz-selection { background: #38bdf8; color: #0a1628; }
html:not(.dark) .badge-critical { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
html:not(.dark) .badge-high { background: rgba(245, 158, 11, 0.12); color: #b45309; }
html:not(.dark) .badge-medium { background: rgba(234, 179, 8, 0.12); color: #a16207; }
html:not(.dark) .badge-low { background: rgba(59, 130, 246, 0.12); color: #2563eb; }

/* ── Buttons ── */
html:not(.dark) .btn-primary { box-shadow: 0 4px 15px rgba(0, 180, 216, 0.2); color: white; }
html:not(.dark) .btn-secondary { color: white; }
html:not(.dark) .btn-danger { color: white; }
html:not(.dark) .btn-success { color: white; }
html:not(.dark) .btn-outline { color: #475569; border-color: rgba(0, 0, 0, 0.12); }
html:not(.dark) .btn-outline:hover { color: #1e293b; background: rgba(0, 0, 0, 0.04); }
html:not(.dark) .btn-ghost { color: #475569; }
html:not(.dark) .btn-ghost:hover { color: #1e293b; background: rgba(0, 0, 0, 0.04); }
html:not(.dark) .login-form .btn-primary { color: white; }

/* ── Tabs ── */
html:not(.dark) .tab { color: #64748b; }
html:not(.dark) .tab:hover:not(.active) { color: #475569; }
html:not(.dark) .tab.active { color: #0F2B5B; }

/* ── Dropdowns ── */
html:not(.dark) .dropdown-menu { background: rgba(255, 255, 255, 0.98); border: 1px solid rgba(0, 0, 0, 0.08); }
html:not(.dark) .dropdown-item { color: #475569; }
html:not(.dark) .dropdown-item:hover { background: rgba(0, 0, 0, 0.04); color: #1e293b; }

/* ── Alerts ── */
html:not(.dark) .alert { border-color: rgba(0, 0, 0, 0.08); }
html:not(.dark) .alert-info { background: rgba(0, 180, 216, 0.06); color: #0e7490; border-color: rgba(0, 180, 216, 0.15); }

/* ── Toasts ── */
html:not(.dark) .toast { background: rgba(255, 255, 255, 0.98); border: 1px solid rgba(0, 0, 0, 0.08); color: #1e293b; }

/* ── Selection ── */
html:not(.dark) ::selection { background: rgba(0, 180, 216, 0.2); color: #0F2B5B; }

/* ── Log viewer & Pre (keep dark) ── */
html:not(.dark) .log-viewer, html:not(.dark) pre { background: #1e293b; color: #e2e8f0; }

/* ── Login ── */
html:not(.dark) .login-container { background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(0, 0, 0, 0.08); }
html:not(.dark) .login-logo { color: #0F2B5B; }
html:not(.dark) .admin-badge, html:not(.dark) .admin-badge-login { background: rgba(0, 180, 216, 0.1); color: #0F2B5B; border-color: rgba(0, 180, 216, 0.2); }

/* ── Empty State ── */
html:not(.dark) .empty-state { color: #64748b; }
html:not(.dark) .empty-state-title { color: #1e293b; }
html:not(.dark) .empty-state-description { color: #64748b; }

/* ── Progress bars ── */
html:not(.dark) .progress-bar-container, html:not(.dark) .progress-bar { background: rgba(0, 0, 0, 0.08); }
html:not(.dark) .progress-bar.low { background: linear-gradient(90deg, #10b981, #34d399); }
html:not(.dark) .progress-bar.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
html:not(.dark) .progress-bar.high { background: linear-gradient(90deg, #ef4444, #f87171); }
html:not(.dark) .progress-fill { background: linear-gradient(90deg, #0F2B5B, #00B4D8); }

/* ── System Health - metrics, health cards ── */
html:not(.dark) .metric-value { color: #1e293b; }
html:not(.dark) .health-metric { color: #475569; }
html:not(.dark) .health-metric span { color: #475569; }
html:not(.dark) .health-metric .metric-value { color: #1e293b; }
html:not(.dark) .health-header h3 { color: #1e293b; }
html:not(.dark) .health-card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .health-card:hover { background: rgba(255, 255, 255, 0.9); }
html:not(.dark) .status-text h2 { color: #1e293b; }
html:not(.dark) .status-text p { color: #475569; }

/* ── Pods page ── */
html:not(.dark) .pod-row td { color: #1e293b; }
html:not(.dark) .pod-row:hover { background: rgba(0, 180, 216, 0.04); }
html:not(.dark) .namespace-badge { background: rgba(0, 180, 216, 0.08); color: #0e7490; }
html:not(.dark) .status-dot.running { background: #10b981; }

/* ── Plan Cards (Settings > Plan Limits) ── */
html:not(.dark) .plan-card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .plan-card:hover { background: rgba(255, 255, 255, 0.9); border-color: rgba(0, 180, 216, 0.2); }
html:not(.dark) .plan-card h4 { color: #1e293b; }
html:not(.dark) .plan-card label { color: #475569; }
html:not(.dark) .plan-card .form-group label { color: #475569; }

/* ── Integration Tiles (Settings > Integrations) ── */
html:not(.dark) .integration-tile { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.08); }
html:not(.dark) .integration-tile:hover { background: rgba(0, 180, 216, 0.04); border-color: rgba(0, 180, 216, 0.3); }
html:not(.dark) .tile-info h4 { color: #1e293b; }
html:not(.dark) .tile-info p { color: #64748b; }
html:not(.dark) .tile-arrow { color: #94a3b8; }
html:not(.dark) .integration-card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.06); }
html:not(.dark) .integration-card:hover { background: rgba(255, 255, 255, 0.9); }
html:not(.dark) .integration-header h4 { color: #1e293b; }
html:not(.dark) .panel-header h3 { color: #1e293b; }

/* ── Audit Logs - event items ── */
html:not(.dark) .event-item { color: #1e293b; border-bottom-color: rgba(0, 0, 0, 0.06); }
html:not(.dark) .event-text { color: #1e293b; }
html:not(.dark) .event-time { color: #64748b; }

/* ── Chatbot quick actions ── */
html:not(.dark) .quick-action { color: #1e293b; background: rgba(0, 180, 216, 0.05); border-color: rgba(0, 180, 216, 0.15); }
html:not(.dark) .quick-action:hover { color: #1e293b; background: rgba(0, 180, 216, 0.1); }
html:not(.dark) .chatbot-quick-action { color: #1e293b; background: rgba(0, 180, 216, 0.05); border-color: rgba(0, 180, 216, 0.15); }
html:not(.dark) .welcome-title { color: #1e293b; }
html:not(.dark) .welcome-text { color: #64748b; }
html:not(.dark) .chatbot-name { color: #1e293b; }

/* ── User Avatar ── */
html:not(.dark) .user-avatar { color: white; }

/* ── Code block ── */
html:not(.dark) .code-block { background: #1e293b; color: #22d3ee; }

/* ── Chart container ── */
html:not(.dark) .chart-container canvas { border-radius: 12px; }

/* ── Breadcrumbs ── */
html:not(.dark) .breadcrumb { color: #64748b; }
html:not(.dark) .breadcrumb a { color: #1a65d6; }

/* ── Scrollbar ── */
html:not(.dark) ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #94a3b8, #cbd5e1); }
html:not(.dark) ::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #64748b, #94a3b8); }
html:not(.dark) ::-webkit-scrollbar-track { background: #e2e8f0; }

/* ── MSP tab buttons ──
   .tab-btn (MSP detail: Overview/DNS/SSL/…) and .doc-tab (MSP legal docs)
   are `btn btn-outline` whose JS toggles `.active`, but there was no matching
   style - so the selected tab looked identical to the rest. Give the active
   tab a filled primary look (works in both themes). */
.tab-btn.active,
.doc-tab.active,
.msp-tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
.tab-btn.active:hover,
.doc-tab.active:hover,
.msp-tab-btn.active:hover { color: #fff; }
/* Light mode: `html:not(.dark) .btn-outline` (0-2-1) out-specifies the bare
   `.tab-btn.active` (0-2-0) above and repaints the text slate-grey on the navy
   pill -> unreadable. Re-assert white at matching specificity. */
html:not(.dark) .tab-btn.active,
html:not(.dark) .doc-tab.active,
html:not(.dark) .msp-tab-btn.active { color: #fff; }
html:not(.dark) .tab-btn.active:hover,
html:not(.dark) .doc-tab.active:hover,
html:not(.dark) .msp-tab-btn.active:hover { color: #fff; }
/* Dark mode: the navy gradient sinks into the dark page, so use a brighter
   blue to cyan gradient + glow so the active tab is clearly visible. */
html.dark .tab-btn.active,
html.dark .doc-tab.active,
html.dark .msp-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    color: #04141f;
    box-shadow: 0 0 0 1px var(--secondary), 0 2px 10px rgba(0, 180, 216, 0.35);
}
html.dark .tab-btn.active:hover,
html.dark .doc-tab.active:hover,
html.dark .msp-tab-btn.active:hover { color: #04141f; }

/* ── Onboard MSP: selected tier card ──
   The tier radios are inside .tier-option cards; without this the chosen card
   had no visual highlight. :has() lights up the card whose radio is checked. */
.tier-option:has(input[type="radio"]:checked) {
    border-color: var(--secondary) !important;
    background: rgba(0, 180, 216, 0.08);
    box-shadow: inset 0 0 0 1px var(--secondary);
}

/* ── UI-audit fixes: undefined classes + dark-mode gaps ── */

/* .btn-info: pods "Rolling Restart" used btn-info but no variant existed, so it
   fell back to the bare .btn and rendered near-invisible. Teal/info tone. */
.btn-info {
    background: linear-gradient(135deg, var(--secondary), var(--primary-light));
    color: #04141f;
    border-color: transparent;
}
.btn-info:hover { filter: brightness(1.08); color: #04141f; }

/* .user-header / .user-details: the View User modal referenced these undefined
   classes, so the 64px avatar stacked on the name with no alignment. */
.user-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.user-details { min-width: 0; }

/* .access-status-grid / .access-info: the Active Access Session card referenced
   these undefined classes; fields rendered as bare stacked divs. Auto-fit so it
   reflows across mobile/tablet/desktop. */
.access-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.access-info { min-width: 0; }

/* Dark-mode: the progress-bar track and the "Warning" health pill had no dark
   variant and were near-invisible on the dark glass card. */
html.dark .progress-bar-container,
html.dark .progress-bar { background: rgba(255, 255, 255, 0.1); }
html.dark .status-warning { color: var(--warning); }
