/* ============================
   BrainZMonitor SEO Tool - Modern Dark Theme
   ============================ */

/* ----- CSS Variables / Dark Theme ----- */
:root {
    /* Dark Theme - Backgrounds */
    --bg-primary: #1A1D29;
    --bg-secondary: #232734;
    --bg-tertiary: #2A2F3F;
    --bg-elevated: #2F3545;
    
    /* Glassmorphism */
    --glass-bg: rgba(35, 39, 52, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(139, 92, 246, 0.3);
    
    /* Accent Colors */
    --accent-purple: #8B5CF6;
    --accent-purple-light: #A78BFA;
    --accent-purple-dark: #7C3AED;
    --accent-blue: #60A5FA;
    --accent-cyan: #06B6D4;
    --accent-pink: #EC4899;
    --accent-orange: #F97316;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    
    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-pink: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    --gradient-chart: linear-gradient(180deg, rgba(139, 92, 246, 0.4) 0%, rgba(139, 92, 246, 0) 100%);
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, rgba(96, 165, 250, 0.15) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
    
    /* Text Colors */
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-inverse: #1A1D29;
    
    /* Status Colors */
    --status-success: #10B981;
    --status-warning: #F59E0B;
    --status-error: #EF4444;
    --status-info: #3B82F6;
    
    /* Borders & Dividers */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    
    /* Shadows & Glows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.3);
    --shadow-glow-blue: 0 0 30px rgba(96, 165, 250, 0.3);
    --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.3);
    
    /* Sizing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;
    
    /* Border Radius */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Transitions */
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    background-image: var(--gradient-mesh);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    transition: var(--transition-base);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    transition: var(--transition-base);
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* ----- Scrollbar Styling ----- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-medium);
}

/* ----- Utility Classes ----- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.glass-light {
    background: var(--glass-bg-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

.gradient-purple {
    background: var(--gradient-purple);
}

.gradient-blue {
    background: var(--gradient-blue);
}

.gradient-cyan {
    background: var(--gradient-cyan);
}

/* ----- Sidebar ----- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    transition: width var(--transition-smooth);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    padding-bottom: 0;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: var(--space-md);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-image {
    width: 70%;
    height: auto;
    object-fit: contain;
}

.logo i {
    font-size: 28px;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    position: absolute;
    right: 0;
    top: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.sidebar-toggle:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
}

/* ----- Website Selector ----- */
.website-selector {
    margin-bottom: var(--space-xl);
    position: relative;
}

.website-selector select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 44px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    transition: var(--transition-base);
}

.website-selector select:hover {
    border-color: var(--border-medium);
    background: var(--bg-elevated);
}

.website-selector select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.website-selector::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.selector-favicon {
    position: absolute !important;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: var(--radius-xs);
    pointer-events: none;
    z-index: 1;
}

/* ----- Navigation Menu ----- */
.nav-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: var(--space-xs);
    position: relative;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-item a i {
    width: 20px;
    font-size: 18px;
    transition: var(--transition-base);
}

.nav-item a:hover {
    background: var(--glass-bg-light);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active a {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

.nav-item.active a i {
    transform: scale(1.1);
}

.nav-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-purple);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    opacity: 0;
    transition: var(--transition-base);
}

.nav-item.active a::before {
    opacity: 0;
}

/* Nav items disabled when "All Sites" is selected */
.nav-item.nav-disabled {
    pointer-events: none;
}
.nav-item.nav-disabled a {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    background: none !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}
/* Settings nav-item is itself an <a>, apply same visual rules directly */
a.nav-item.nav-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    background: none !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}
.nav-item.nav-disabled a::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted, #8b8fa8);
    margin-left: auto;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ----- Badge ----- */
.badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

.badge-danger {
    background: var(--accent-red);
    color: white;
}

.badge-warning {
    background: var(--accent-orange);
    color: white;
}

.badge-success {
    background: var(--accent-green);
    color: white;
}

.badge-info {
    background: var(--accent-blue);
    color: white;
}

/* ----- Sidebar Footer ----- */
.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--glass-bg-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    cursor: pointer;
    transition: var(--transition-base);
}

.user-info:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 12px;
    color: var(--text-muted);
}

/* ----- Main Content ----- */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-smooth), width var(--transition-smooth);
}

/* ----- Top Bar ----- */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.search-bar {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 48px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-base);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--bg-elevated);
}

.search-bar i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* ── Live Crawl Ribbon ── */
.crawl-ribbon {
    flex: 1;
    min-width: 0;
    max-width: 640px;
    height: 40px;
    margin: 0 var(--space-md);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
}

/* When active crawls exist, show the ticker; hide idle label */
.crawl-ribbon.has-active .crawl-ribbon-idle { display: none; }
.crawl-ribbon:not(.has-active) .crawl-ribbon-inner { display: none; }

/* Idle state */
.crawl-ribbon-idle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 13px;
    width: 100%;
}
.crawl-ribbon-idle i {
    color: var(--accent-green);
    font-size: 14px;
}

/* Scrolling ticker */
.crawl-ribbon-inner {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    animation: ribbon-scroll 56s linear infinite;
    will-change: transform;
    padding-left: 100%;
}
.crawl-ribbon:hover .crawl-ribbon-inner {
    animation-play-state: paused;
}
@keyframes ribbon-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Each crawl pill */
.ribbon-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 0 14px;
    border-right: 1px solid var(--border-subtle);
    font-size: 12.5px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.ribbon-item:last-child { border-right: none; }

/* Pulsing dot */
.ribbon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 6px var(--accent-cyan);
    animation: ribbon-pulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes ribbon-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.55; transform: scale(0.75); }
}

/* Site name */
.ribbon-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Progress bar + pill */
.ribbon-progress-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ribbon-bar {
    width: 70px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--border-medium);
    overflow: hidden;
}
.ribbon-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    transition: width 0.6s ease;
}
.ribbon-pct {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--accent-cyan);
    min-width: 32px;
}

/* Stats chips */
.ribbon-stats {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ribbon-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.ribbon-chip i { font-size: 10px; }
.ribbon-chip.warn { color: var(--accent-orange); border-color: rgba(249,115,22,0.3); }
.ribbon-chip.fast { color: var(--accent-green); }
.ribbon-chip.ribbon-retry { 
    color: var(--accent-orange); 
    border-color: rgba(249,115,22,0.5);
    background: rgba(249,115,22,0.1);
    font-weight: 500;
}
.ribbon-chip.ribbon-retry i { 
    animation: spin-slow 2s linear infinite; 
}
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Queued badge (right edge) */
.ribbon-queued-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    border-left: 1px solid var(--border-subtle);
    height: 100%;
    background: transparent;
    white-space: nowrap;
    position: absolute;
    right: 0;
    top: 0;
    background: linear-gradient(90deg, transparent, var(--glass-bg) 30%);
}

/* Ribbon eye-toggle button */
.ribbon-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 38px;
    border: none;
    background: linear-gradient(90deg, transparent, var(--glass-bg) 40%);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    z-index: 3;
    transition: color var(--transition-base);
    flex-shrink: 0;
    font-size: 12px;
}
.ribbon-toggle:hover { color: var(--text-primary); }

/* Hidden state: blur content, show eye-slash */
.crawl-ribbon.ribbon-hidden .crawl-ribbon-inner,
.crawl-ribbon.ribbon-hidden .crawl-ribbon-idle {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* Responsive: hide ribbon on very small screens */
@media (max-width: 900px) {
    .crawl-ribbon { display: none; }
}

.icon-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    position: relative;
    transition: var(--transition-base);
}

.icon-button:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.icon-button.has-notification::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    padding-left: var(--space-sm);
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
}

.user-menu:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border-hover);
}

.user-menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

/* ----- Notification Panel ----- */
.notification-panel {
    display: none;
    position: fixed;
    top: 70px;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: calc(100vh - 70px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-default);
    z-index: 1000;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.notification-panel.active {
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.notification-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.notification-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notif-header-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.notification-item {
    padding: var(--space-md);
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    cursor: pointer;
    transition: var(--transition-base);
}

.notification-item:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border-hover);
    transform: translateX(-4px);
}

.notification-item.unread {
    background: var(--glass-bg);
    border-color: var(--accent-purple);
}

.notification-item .notification-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: var(--space-md);
}

.notification-item .notification-icon.info {
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-blue);
}

.notification-item .notification-icon.warning {
    background: rgba(251, 146, 60, 0.15);
    color: var(--accent-orange);
}

.notification-item .notification-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.notification-item .notification-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notification-item .notification-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ----- Global Notification Bell: sections, badges, states ----- */
.notif-section-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md) 6px;
    margin-top: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.notification-item.notif-clickable {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    transition: background var(--transition-fast);
}
.notification-item.notif-clickable:hover {
    background: var(--surface-hover, rgba(255,255,255,0.05));
    transform: none;
}

.notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-site-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-alert-count {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent-red, #e53e3e);
    border-radius: 20px;
    padding: 1px 8px;
    width: fit-content;
}

.notif-blocked-label {
    font-size: 12px;
    color: var(--text-muted);
}

.notif-arrow {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.notification-item .notification-icon.critical {
    background: rgba(229, 62, 62, 0.15);
    color: var(--accent-red, #e53e3e);
}

.notification-item .notification-icon.blocked {
    background: rgba(237, 137, 54, 0.15);
    color: var(--accent-orange, #ed8936);
}

.notif-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: calc(var(--space-xl) * 2) var(--space-lg);
    color: var(--text-muted);
    text-align: center;
}
.notif-empty-state i {
    font-size: 36px;
    color: var(--accent-green, #48bb78);
    opacity: 0.7;
}
.notif-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ----- Crawl Progress Overlay ----- */
.crawl-progress-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 29, 41, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.crawl-progress-overlay.active {
    display: flex;
}

.crawl-progress-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.crawl-progress-spinner {
    font-size: 48px;
    color: var(--accent-purple);
    margin-bottom: var(--space-lg);
}

.crawl-progress-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
}

.crawl-progress-card p {
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg) 0;
}

.crawl-funny-status {
    color: var(--accent-purple) !important;
    font-size: 1rem !important;
    font-weight: 500;
    font-style: italic;
    margin: 0.75rem 0 !important;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.crawl-progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.crawl-progress-bar {
    height: 100%;
    background: var(--gradient-purple);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}



/* ----- Page Container ----- */
.page-container {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Page Header ----- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.page-site-favicon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-xs);
}

.page-site-name {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: var(--space-sm);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ----- Date Range Picker ----- */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.date-range-picker i {
    color: var(--text-muted);
    font-size: 14px;
}

.date-range-picker select,
.date-range-picker input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

.date-range-picker select:focus,
.date-range-picker input:focus {
    outline: none;
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    transition: var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--glass-bg-light);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 13px;
}

/* Monitoring table action buttons */
.site-action-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
    white-space: nowrap;
}

.site-action-btns .btn {
    width: 100%;
    text-align: center;
}

.site-action-btns .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: 16px;
}

/* ----- Cards ----- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: var(--space-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-color: var(--border-medium);
}

.card.full-width {
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.card-body {
    color: var(--text-secondary);
}

/* ----- Dashboard Grid ----- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* ----- Stat Cards ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-purple);
    opacity: 0;
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    opacity: 0.2;
    filter: blur(20px);
}

.stat-icon i {
    position: relative;
    z-index: 1;
}

.stat-icon.purple {
    background: var(--gradient-purple);
}

.stat-icon.blue {
    background: var(--gradient-blue);
}

.stat-icon.cyan {
    background: var(--gradient-cyan);
}

.stat-icon.green {
    background: var(--gradient-green);
}

.stat-icon.orange {
    background: var(--gradient-orange);
}

.stat-icon.pink {
    background: var(--gradient-pink);
}

.stat-body {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-legend-icon {
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.15s;
    font-size: 11px;
    position: relative;
}

.stat-legend-icon:hover { opacity: 1; }

/* Tooltip rendered from the `title` attribute — styled via CSS for browsers
   that support the pseudo-element approach, native title otherwise */

.stat-value {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    color: var(--accent-purple);
    transform: scale(1.05);
}

/* Health score tier colour classes (applied dynamically by JS) */
#healthScore.score-excellent { color: #22c55e; }   /* ≥85  → green  */
#healthScore.score-good      { color: #84cc16; }   /* ≥70  → lime   */
#healthScore.score-fair      { color: #eab308; }   /* ≥60  → amber  */
#healthScore.score-poor      { color: #f97316; }   /* ≥30  → orange */
#healthScore.score-critical  { color: #ef4444; }   /* <30  → red    */

.stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: var(--space-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
}

.stat-change.positive {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.stat-change i {
    font-size: 10px;
}

/* ----- Pages Health Breakdown ----- */
.health-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.health-bar-container {
    width: 100%;
    position: relative;
}

.health-bar {
    display: flex;
    width: 100%;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.health-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.health-segment:hover {
    filter: brightness(1.1);
}

.health-segment.healthy {
    background: linear-gradient(135deg, #27AE60 0%, var(--accent-green) 100%);
}

.health-segment.warning {
    background: linear-gradient(135deg, #E67E22 0%, var(--accent-orange) 100%);
}

.health-segment.critical {
    background: linear-gradient(135deg, #C0392B 0%, var(--accent-red) 100%);
}

.health-legend {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-item .dot.healthy {
    background: var(--accent-green);
}

.legend-item .dot.warning {
    background: var(--accent-orange);
}

.legend-item .dot.critical {
    background: var(--accent-red);
}

/* ----- Chart Container ----- */
.chart-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-base);
}

.chart-container:hover {
    border-color: var(--border-medium);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* ----- Data Tables ----- */
.table-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.table-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--bg-tertiary);
}

thead th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-base);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--glass-bg-light);
}

tbody td {
    padding: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    vertical-align: middle;
}

tbody td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ----- Progress Bar ----- */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill.purple {
    background: var(--gradient-purple);
}

.progress-fill.blue {
    background: var(--gradient-blue);
}

.progress-fill.cyan {
    background: var(--gradient-cyan);
}

.progress-fill.green {
    background: var(--gradient-green);
}

.progress-fill.orange {
    background: var(--gradient-orange);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ----- Badges & Pills ----- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pill-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.pill-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.pill-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.pill-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.pill-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

/* ----- Status Indicators ----- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-right: var(--space-xs);
}

.status-dot.success {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.warning {
    background: var(--accent-orange);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-dot.error {
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-dot.info {
    background: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* ----- Forms & Inputs ----- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-base);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--bg-elevated);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ----- Form Group Styles ----- */
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7) brightness(1.2);
    cursor: pointer;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: var(--bg-elevated);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B92A6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

.form-group select optgroup {
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    padding: 4px 0;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    appearance: none;
    background: var(--glass-bg-light);
    border: 2px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: var(--accent-purple);
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.checkbox-label input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Disabled channel checkbox */
.checkbox-label:has(input[type="checkbox"]:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.form-hint {
    margin-top: var(--space-sm);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-hint .fa-info-circle {
    color: var(--accent-purple);
    margin-right: 4px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* ----- Modal Styles (Legacy - DO NOT USE) ----- */
/* Note: New modals use .modal-overlay pattern defined at end of file */
.legacy-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.legacy-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.legacy-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-strong);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--glass-bg-light);
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

/* ----- Loading States ----- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-purple);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent);
    animation: shimmer 1.5s infinite;
}

/* ----- Responsive Design ----- */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* ── Sidebar ── */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
        max-width: 100vw;
        /* overflow-x intentionally NOT hidden — allows tables inside to scroll horizontally */
    }

    /* ── Topbar: hide search + crawl ribbon, just show hamburger + icons ── */
    .topbar {
        padding: 0 12px;
        gap: 6px;
        height: 56px;
    }
    .search-bar,
    .crawl-ribbon {
        display: none;
    }

    /* ── Page layout ── */
    .page-container {
        padding: 12px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }
    .page-header h1 {
        font-size: 20px;
    }
    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-header-actions .btn {
        flex: 1 1 auto;
        min-width: 100px;
        justify-content: center;
        font-size: 13px;
        padding: 8px 12px;
    }
    .date-range-picker {
        flex: 1 1 100%; /* own full-width row so action buttons sit together below */
    }

    /* ── Stat cards: 2×2 instead of 1 column ── */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card {
        padding: 14px 12px;
    }
    .stat-card:hover {
        transform: none;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 10px;
    }
    .stat-value {
        font-size: 26px;
    }
    .stat-label {
        font-size: 11px;
    }
    .stat-meta,
    .stat-meta-row {
        font-size: 11px;
    }

    /* ── Charts + 2-col utility grids: stack vertically ── */
    .charts-row,
    .grid-2,
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* ── Issues page summary cards: 2×2 ── */
    .issue-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .issue-stat {
        padding: 16px 12px;
        min-height: 110px;
    }
    .issue-stat i {
        font-size: 26px;
    }
    .issue-stat-count {
        font-size: 22px;
    }

    /* ── Pages table: enable horizontal scroll ── */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    .data-table {
        min-width: 580px;
    }
    .data-table tbody td,
    .data-table thead th {
        padding: 10px 6px;
        font-size: 12px;
    }

    /* ── Filters bar: compact ── */
    .filters-bar {
        gap: 8px;
        padding: 12px;
    }
    .filter-group {
        flex: 1 1 auto;
        min-width: 0;
    }
    .filter-group label {
        font-size: 11px;
    }
    .filter-group select,
    .filter-group input {
        font-size: 13px;
        padding: 6px 8px;
    }

    /* ── Pagination: compact ── */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }
    .pagination-total {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }
}

/* ----- Dark Theme Enhancements ----- */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-purple);
    border-radius: inherit;
    opacity: 0;
    filter: blur(20px);
    transition: var(--transition-base);
    z-index: -1;
}

.glow-effect:hover::before {
    opacity: 0.3;
}

/* ----- Utility Classes ----- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--accent-purple); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-orange); }
.text-danger { color: var(--accent-red); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; gap: 12px; }
    .grid-3 { grid-template-columns: 1fr; gap: 12px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ========================================================
   ENHANCED UX COMPONENTS - Filters, Tables, Issues, Alerts
   ======================================================== */

/* ----- Filters Bar ----- */
.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 16px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-group select {
    padding: var(--space-md) var(--space-lg);
    background: rgba(35, 39, 52, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
}

.filter-group select:hover {
    border-color: var(--accent-purple);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-filter {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-filter i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-filter input {
    width: 100%;
    padding: var(--space-md) var(--space-lg) var(--space-md) 44px;
    background: rgba(35, 39, 52, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-filter input::placeholder {
    color: var(--text-muted);
}

.search-filter input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ----- Data Tables ----- */
.table-container {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: var(--space-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    .data-table {
        min-width: 580px;
    }
    .data-table tbody td,
    .data-table thead th {
        padding: 10px 6px;
        font-size: 12px;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-medium);
}

.data-table thead th {
    padding: var(--space-lg) var(--space-md);
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-base);
}

.data-table thead th.sortable:hover {
    color: var(--accent-purple);
    background: var(--bg-elevated);
}

.data-table thead th i {
    margin-left: var(--space-xs);
    opacity: 0.5;
    font-size: 10px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-base);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--glass-bg);
}

.data-table tbody td {
    padding: 12px 8px;
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: middle;
}

.data-table .url-cell {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent-blue);
    cursor: pointer;
}

.data-table .url-cell:hover {
    color: var(--primary);
    text-decoration: underline;
}

.data-table .title-cell {
    max-width: 280px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.data-table .health-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.data-table .health-badge.good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.data-table .health-badge.fair {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.data-table .health-badge.poor {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.data-table .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

/* "linked from N pages" hint shown under redirect/error status badges */
.linked-from-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--accent-blue, #60a5fa);
    margin-top: 3px;
    white-space: nowrap;
}
.linked-from-hint i {
    font-size: 0.6rem;
    opacity: 0.8;
}

.data-table .status-badge.s200 {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.data-table .status-badge.s301,
.data-table .status-badge.s302 {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.data-table .status-badge.s404,
.data-table .status-badge.s410 {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.data-table .status-badge.s500,
.data-table .status-badge.s503 {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.data-table .indexable-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 13px;
}

.data-table .indexable-badge.yes {
    color: var(--accent-green);
}

.data-table .indexable-badge.no {
    color: var(--text-muted);
}

/* ----- Pagination ----- */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    justify-content: center;
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-total {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: var(--space-lg);
}

/* ----- Issue Stats Row ----- */
.issue-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
    .issue-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .issue-stat {
        padding: 16px 12px;
        min-height: 110px;
    }
    .issue-stat i {
        font-size: 26px;
        margin-bottom: 4px;
    }
    .issue-stat-count {
        font-size: 22px;
    }
}

.issue-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl) var(--space-xl);
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    min-height: 180px;
}

.issue-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.8;
}

.issue-stat.critical::before {
    background: var(--gradient-red);
}

.issue-stat.warning::before {
    background: var(--gradient-orange);
}

.issue-stat.info::before {
    background: var(--gradient-blue);
}

.issue-stat.resolved::before {
    background: var(--gradient-green);
}

.issue-stat.ignored::before {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.issue-stat:hover {
    transform: translateY(-8px);
    border-color: var(--border-medium);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.issue-stat i {
    font-size: 40px;
    margin-bottom: var(--space-sm);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.issue-stat.critical i {
    color: var(--accent-red);
}

.issue-stat.warning i {
    color: var(--accent-orange);
}

.issue-stat.info i {
    color: var(--accent-blue);
}

.issue-stat.resolved i {
    color: var(--accent-green);
}

.issue-stat.ignored i {
    color: #9ca3af;
}

.issue-stat-count {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.issue-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ----- Issues Container ----- */
.issues-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-sm);
    height: fit-content;
}

.issue-item {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.issue-item.critical {
    border-left-color: var(--accent-red);
}

.issue-item.warning {
    border-left-color: var(--accent-orange);
}

.issue-item.info {
    border-left-color: var(--accent-blue);
}

.issue-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

.issue-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.issue-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.issue-item .issue-severity,
.issue-severity-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.issue-item.critical .issue-severity,
.issue-item.critical .issue-severity-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.issue-item.warning .issue-severity,
.issue-item.warning .issue-severity-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.issue-item.info .issue-severity,
.issue-item.info .issue-severity-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

/* Issue content container — matches .issue-card .issue-body */
.issue-item .issue-body,
.issue-item .issue-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding-top: 4px;
}

.issue-item .issue-body h4,
.issue-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.issue-item .issue-body p,
.issue-item .issue-desc {
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    font-size: 13px;
}

.issue-image-urls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.issue-image-url {
    display: block;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.issue-image-url:hover {
    text-decoration: underline;
}

/* Auto-Fix card processing animation */
@keyframes af-processing-pulse {
    0%   { outline-color: rgba(99,179,237,0.35); }
    50%  { outline-color: rgba(99,179,237,0.85); }
    100% { outline-color: rgba(99,179,237,0.35); }
}
.af-card--processing {
    outline: 2px solid rgba(99,179,237,0.35);
    outline-offset: -1px;
    animation: af-processing-pulse 1.8s ease-in-out infinite;
}

.issue-item .issue-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.issue-item .issue-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.issue-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-shrink: 0;
}

.issue-pages-count {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.issue-detected {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
    color: var(--text-muted);
}

.issue-category {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.issue-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.issue-fix-suggestion {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.issue-fix-suggestion i {
    color: var(--accent-purple);
    margin-top: 2px;
}

.issue-fix-suggestion strong {
    color: var(--text-primary);
    font-weight: 600;
}

.issue-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.issue-action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
   padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-base);
}

.issue-action-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* ===================================== */
/* RECENT CHANGES (Dashboard)           */
/* ===================================== */

/* Recent Changes card — identical to .issue-card */
.change-item {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.change-item.critical { border-left-color: var(--accent-red); }
.change-item.warning  { border-left-color: var(--accent-orange); }
.change-item.info     { border-left-color: var(--accent-blue); }

.change-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* Small circle icon */
.change-item .change-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.change-icon.title    { background: rgba(59,  130, 246, 0.15); color: var(--accent-blue); }
.change-icon.meta     { background: rgba(245, 158,  11, 0.15); color: var(--accent-orange); }
.change-icon.status   { background: rgba(239,  68,  68, 0.15); color: var(--accent-red); }
.change-icon.content  { background: rgba(34,  197,  94, 0.15); color: var(--accent-green); }
.change-icon.canonical,
.change-icon.robots   { background: rgba(139,  92, 246, 0.15); color: var(--accent-purple); }

/* Body — matches .issue-card .issue-body */
.change-item .change-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding-top: 4px;
}

.change-item .change-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.change-item .change-body .change-page {
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    font-size: 13px;
    word-break: break-all;
}

.change-item .change-body .change-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.change-item .change-body .change-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ------ Tab Bar ----- */
.tab-bar {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    margin-bottom: var(--space-xl);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tab-btn {
    flex: 1;
    padding: var(--space-md) var(--space-2xl);
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.12);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* ----- Alert Tab Content ----- */
.alert-tab-content {
    display: none;
}

.alert-tab-content.active {
    display: block;
}

/* ----- Alert Rules ----- */
.alert-rules-list,
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* alert-card (active alerts) keeps the old flat row style */
.alert-card {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 4px;
    border-left: 2px solid var(--accent-purple);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* ── Alert Rule card — responsive vertical layout ─────────── */
.alert-rule-card {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-purple);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-rule-card:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.12);
}

/* Row 1: icon + name + enable toggle + delete */
.arc-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arc-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.arc-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.arc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.arc-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.arc-delete-btn:hover {
    color: #F87171;
    background: rgba(239, 68, 68, 0.12);
}

/* Edit button */
.arc-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.arc-edit-btn:hover {
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.12);
}

/* Action items: control (toggle/button) stacked above a tiny label */
.arc-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.arc-action-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
}

/* Row 2: meta pills (trigger / scope / min pages) */
.arc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 28px; /* align with rule name */
}

.arc-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.arc-meta-pill i {
    font-size: 0.65rem;
    color: var(--accent-purple);
    opacity: 0.8;
}

/* Row 3: channel notification toggles */
.arc-channels {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 28px;
}


.alert-rule-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.alert-rule-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.alert-rule-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    font-size: 10px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.alert-rule-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.alert-rule-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-rule-toggle input[type="checkbox"] {
    width: 40px;
    height: 22px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-base);
}

.alert-rule-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: var(--transition-base);
}

.alert-rule-toggle input[type="checkbox"]:checked {
    background: var(--accent-purple);
}

.alert-rule-toggle input[type="checkbox"]:checked::before {
    left: 20px;
    background: white;
}

.alert-rule-details {
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    font-size: 11px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
}

.alert-rule-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.alert-rule-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.alert-rule-meta-item strong {
    color: var(--text-primary);
    font-weight: 500;
}

.rule-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
}

.rule-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.rule-info p {
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    font-size: 11px;
}

.rule-channels {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.channel-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* Alert rule — per-channel notification toggles (Slack / Email) */
/* .rule-channel-toggles kept for any legacy references */
.rule-channel-toggles {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rule-channel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.rule-channel-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Disabled channel item — dim and block pointer on the toggle itself */
.rule-channel-item:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.45;
}

.rule-channel-item:has(input:disabled) label.toggle-switch {
    pointer-events: none;
}

.toggle-switch {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
    width: 36px;
    height: 20px;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-base);
    border: 1px solid var(--border-subtle);
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 1px;
    left: 1px;
    transition: var(--transition-base);
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.toggle-switch input[type="checkbox"]:checked::before {
    left: 17px;
    background: white;
}

.toggle-slider {
    display: none;
}

.alert-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.alert-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
}

.alert-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.alert-body p {
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    font-size: 11px;
}

.alert-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    margin-top: 4px;
}

.alert-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

/* ----- Empty States ----- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
}

.empty-state-message {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

/* ----- Date Range Picker ----- */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.date-range-picker label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.date-range-picker input[type="date"],
.date-range-picker select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-base);
}

.date-range-picker input[type="date"]:hover,
.date-range-picker select:hover {
    border-color: var(--accent-purple);
    background: var(--bg-elevated);
}

.date-range-picker input[type="date"]:focus,
.date-range-picker select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* ----- Changes Timeline ----- */
.changes-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.timeline-date {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: var(--space-md) 0;
    border-bottom: 2px solid var(--border-subtle);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timeline items — same compact card design as .issue-card */
.timeline-item {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

/* Impact → left border colour (mirrors issue-card severity) */
.timeline-item.high   { border-left-color: var(--accent-red); }
.timeline-item.medium { border-left-color: var(--accent-orange); }
.timeline-item.low    { border-left-color: var(--accent-blue); }

.timeline-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* Small circle icon — matches .issue-severity */
.timeline-item .change-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: none;
}

.change-icon.title    { background: rgba(59,  130, 246, 0.15); color: var(--accent-blue); }
.change-icon.meta     { background: rgba(245, 158,  11, 0.15); color: var(--accent-orange); }
.change-icon.status   { background: rgba(239,  68,  68, 0.15); color: var(--accent-red); }
.change-icon.content  { background: rgba(34,  197,  94, 0.15); color: var(--accent-green); }
.change-icon.canonical,
.change-icon.robots   { background: rgba(139,  92, 246, 0.15); color: var(--accent-purple); }

/* Body — matches .issue-body */
.timeline-item .change-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding-top: 4px;
}

.timeline-item .change-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.timeline-item .change-body .change-page {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    word-break: break-all;
}

.timeline-item .change-body .change-diff {
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diff-old {
    color: var(--accent-red);
    text-decoration: line-through;
    opacity: 0.8;
}

.diff-new {
    color: var(--accent-green);
    font-weight: 500;
}

/* Meta row — matches .issue-meta */
.timeline-item .change-body .change-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.timeline-item .change-body .change-timestamp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Impact badge — compact inline pill */
.impact-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.impact-badge.high   { background: rgba(239, 68,  68, 0.15); color: var(--accent-red);    border: 1px solid rgba(239, 68,  68, 0.3); }
.impact-badge.medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); border: 1px solid rgba(245, 158, 11, 0.3); }
.impact-badge.low    { background: rgba(59,  130, 246, 0.15); color: var(--accent-blue);   border: 1px solid rgba(59,  130, 246, 0.3); }

/* ----- Additional Utility Classes & Polish ----- */

/* Success States */
.success-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 500;
}

.success-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Enhanced Badge Styles */
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Enhanced Hover Scale Effect */
.hover-scale {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.03);
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Custom Scrollbar for better UX */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* ----- Toast Notifications ----- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    padding: 14px 16px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: all;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-purple);
}

.toast.success::before {
    background: var(--accent-green);
}

.toast.error::before {
    background: var(--accent-red);
}

.toast.warning::before {
    background: var(--accent-orange);
}

.toast.info::before {
    background: var(--accent-blue);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast.success .toast-icon {
    color: var(--accent-green);
}

.toast.error .toast-icon {
    color: var(--accent-red);
}

.toast.warning .toast-icon {
    color: var(--accent-orange);
}

.toast.info .toast-icon {
    color: var(--accent-blue);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-content p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.toast-content span {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: block;
}

.toast-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    font-size: 12px;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toast-close:active {
    transform: scale(0.95);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.9);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.loading-overlay.active {
    display: flex;
}

.loader {
    text-align: center;
    color: var(--text-primary);
}

.loader p {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== LOG FILE ANALYZER ===== */
.log-analyzer-upload-section {
    margin-bottom: var(--space-2xl);
}

.log-upload-zone {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px dashed var(--border-subtle);
    border-radius: 20px;
    padding: 64px 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.log-upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.log-upload-zone:hover::before,
.log-upload-zone.drag-over::before {
    opacity: 1;
}

.log-upload-zone:hover,
.log-upload-zone.drag-over {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

.log-upload-zone .upload-icon {
    font-size: 4rem;
    color: var(--accent-purple);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.log-upload-zone h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.log-upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.log-upload-zone p strong {
    color: var(--accent-purple);
    font-weight: 600;
}

.log-upload-zone .upload-formats {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.log-upload-zone .btn {
    position: relative;
    z-index: 1;
}

.log-upload-progress {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 64px 48px;
    text-align: center;
}

.log-upload-progress .upload-progress-icon {
    font-size: 3rem;
    color: var(--accent-purple);
    margin-bottom: 20px;
}

.log-upload-progress h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.log-upload-progress p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Log Analyzer Steps */
.log-analyzer-steps {
    margin-bottom: var(--space-2xl);
}

.log-analyzer-steps h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-analyzer-steps h2 i {
    color: var(--accent-orange);
    font-size: 1.3rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.step-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.step-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-card:hover::before {
    opacity: 1;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--border-medium);
}

.step-number {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-purple);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    z-index: 2;
}

.step-icon {
    font-size: 2.5rem;
    color: var(--accent-purple);
    margin-bottom: 16px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.step-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Log Analyzer Results */
.log-analyzer-results {
    margin-top: var(--space-2xl);
}

.stats-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: var(--space-xl);
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.charts-row .chart-card.large {
    grid-column: span 2;
}

.chart-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: var(--space-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--border-medium);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h3 i {
    color: var(--accent-purple);
    font-size: 1rem;
}

.chart-body {
    position: relative;
}

/* Responsive */
@media (max-width: 992px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .charts-row .chart-card.large {
        grid-column: span 1;
    }
    
    .log-upload-zone {
        padding: 48px 32px;
    }
}

@media (max-width: 576px) {
    .stats-grid.cols-4 {
        grid-template-columns: 1fr;
    }
    
    .log-upload-zone {
        padding: 40px 24px;
    }
    
    .log-upload-zone .upload-icon {
        font-size: 3rem;
    }
    
    .log-upload-zone h3 {
        font-size: 1.3rem;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation for Live Status */
.status-live {
    position: relative;
}

.status-live::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Enhanced Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* Smooth Page Transitions */
.page-content {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Gradient Overlays */
.gradient-overlay-purple {
    position: relative;
    overflow: hidden;
}

.gradient-overlay-purple::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-purple);
}

/* Improved Tooltip Styles */
.tooltip {
    position: absolute;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: var(--space-sm) var(--space-md);
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
}

/* ----- Issue Cards (Full Issues Page) ----- */
.issue-card {
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 12px;
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.issue-card.critical {
    border-left-color: var(--accent-red);
}

.issue-card.warning {
    border-left-color: var(--accent-orange);
}

.issue-card.info {
    border-left-color: var(--accent-blue);
}

.issue-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

.issue-card .issue-severity {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.issue-card.critical .issue-severity {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.issue-card.warning .issue-severity {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.issue-card.info .issue-severity {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.issue-card .issue-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding-top: 4px;
}

.issue-card .issue-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.issue-card .issue-body p {
    color: var(--text-secondary);
    line-height: 1.3;
    margin: 0;
    font-size: 13px;
}

.issue-card .issue-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.issue-card .issue-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.issue-pages-toggle {
    cursor: pointer;
    padding: 2px var(--space-xs);
    background: var(--bg-secondary);
    border-radius: 4px;
    transition: all 0.3s ease;
    user-select: none;
}

.issue-pages-toggle:hover {
    background: var(--bg-elevated);
    color: var(--accent-purple);
    transform: translateY(-1px);
}

.issue-toggle-icon {
    transition: transform 0.3s ease;
}

.issue-pages-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.issue-pages-panel.open {
    max-height: 800px;
    overflow-y: auto;
    margin-top: var(--space-md);
}

.issue-pages-table {
    width: 100%;
    table-layout: fixed;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    margin: var(--space-md) 0;
}

.issue-pages-table thead tr {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.issue-pages-table thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 10px 14px;
}

.issue-pages-table thead th:first-child {
    width: 35%;
}

.issue-page-row {
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s ease;
}

.issue-page-row td {
    padding: 10px 14px;
    vertical-align: middle;
    overflow: hidden;
}

.issue-page-row:last-child {
    border-bottom: none;
}

.issue-page-row:hover {
    background: var(--bg-elevated);
}

.issue-page-url {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.issue-page-url:hover {
    text-decoration: underline;
}

.issue-pages-table .health-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.issue-pages-table .health-badge.good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.issue-pages-table .health-badge.fair {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.issue-pages-table .health-badge.poor {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.issue-pages-table .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.issue-pages-table .status-badge.s200 {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.issue-pages-table .status-badge.s301,
.issue-pages-table .status-badge.s302 {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.issue-pages-table .status-badge.s404,
.issue-pages-table .status-badge.s410 {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.issue-pages-table .status-badge.s500,
.issue-pages-table .status-badge.s503 {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* General status badges */
.issue-pages-table .status-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.issue-pages-table .status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.issue-pages-table .status-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Character count badges */
.issue-pages-table .char-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.issue-pages-table .char-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Time-based badges */
.issue-pages-table .time-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Size-based badges */
.issue-pages-table .size-critical {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* ── Status-code filter bar (4xx issues) ─────────────────────────── */
.sc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 10px 14px 8px;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--border-subtle);
}

.sc-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    letter-spacing: 0.02em;
}
.sc-filter-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.sc-filter-btn.active {
    background: rgba(99,102,241,0.18);
    color: #a5b4fc;
    border-color: rgba(99,102,241,0.45);
}

/* "All" button active state */
.sc-btn-all.active { background: rgba(99,102,241,0.18); color: #a5b4fc; border-color: rgba(99,102,241,0.45); }

/* 4xx code button */
.sc-btn-warn.active { background: rgba(245,158,11,0.18); color: #fbbf24; border-color: rgba(245,158,11,0.45); }
.sc-btn-warn:hover  { color: #fbbf24; }

/* 5xx code button */
.sc-btn-error.active { background: rgba(239,68,68,0.18); color: #f87171; border-color: rgba(239,68,68,0.45); }
.sc-btn-error:hover  { color: #f87171; }

/* Total count pill inside "All" button */
.sc-count {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 0 5px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}
.sc-btn-all.active .sc-count {
    background: rgba(99,102,241,0.25);
    color: #c7d2fe;
}

/* URL cell — always truncate, never wrap */
.issue-pages-table td.url-cell {
    color: var(--accent-blue, #818cf8);
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    min-width: 0;
}
.issue-pages-table td.url-cell:hover {
    text-decoration: underline;
    color: #a5b4fc;
}

/* Title / description cell — truncate */
.issue-pages-table td.title-cell {
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Date cell */
.issue-pages-table td.date-cell {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Linked-From cell — flex-wrap to show pills on multiple lines */
.issue-pages-table td.linked-from-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

/* Individual source-page path pills */
.linked-from-tag {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-blue, #818cf8);
    border: 1px solid rgba(99, 102, 241, 0.25);
    cursor: default;
    transition: background 0.15s;
}
.linked-from-tag:hover {
    background: rgba(99, 102, 241, 0.22);
}

/* "+n more" overflow pill */
.more-links {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted, #8b8fa8);
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
}

/* Code elements */
.issue-pages-table .robots-code,
.issue-pages-table .hash-code {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 500;
}

/* Truncation indicators */
.issue-pages-table .more-links,
.issue-pages-table .more-images {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    margin-left: 4px;
}

/* Date cells */
.issue-pages-table .date-cell {
    color: var(--text-secondary);
    font-size: 11px;
}

/* Link list cells */
.issue-pages-table .link-list {
    font-size: 11px;
}

.issue-pages-table .link-list a {
    color: var(--accent-blue);
    text-decoration: none;
}

.issue-pages-table .link-list a:hover {
    text-decoration: underline;
}

.issue-pages-table td {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-pages-table .url-cell {
    color: var(--accent-blue);
    word-break: break-all;
}

.issue-pages-table .title-cell {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Change-type alert tables: 2-column layout (Page path + Change description) */
.issue-pages-table.change-type-table thead tr,
.issue-pages-table.change-type-table .issue-page-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 3fr);
}

.issue-pages-table.change-type-table .url-cell {
    font-size: 13px;
    font-family: var(--font-mono, monospace);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.change-desc-cell {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Action column (eye icon button per row) ─────────────────────── */
.action-col-header,
.action-col {
    width: 64px;
    min-width: 64px;
    text-align: center;
    white-space: nowrap;
    padding: 10px 8px !important;
}

.action-col-empty {
    color: var(--text-muted);
    font-size: 14px;
}

.btn-row-action {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 9px;
    font-size: 0.78rem;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    line-height: 1;
}

.btn-row-action:hover {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
}

.issue-help {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: var(--space-sm);
    margin-top: var(--space-sm);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.issue-card.expanded .issue-help {
    max-height: 500px;
    opacity: 1;
    margin-top: var(--space-sm);
}

/* Ignored issues section (dark) */
.ignored-section {
    margin-top: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.ignored-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    cursor: pointer;
    user-select: none;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.ignored-section-header:hover {
    background: var(--bg-body);
}

.ignored-section-header .ignored-toggle-icon {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.ignored-section-body {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-body);
}

.ignored-section-body.open {
    display: flex;
}

.ignored-card {
    opacity: 0.65;
    transition: opacity 0.2s;
}

.ignored-card:hover {
    opacity: 1;
}

.issue-help strong {
    color: var(--accent-purple);
    font-size: 12px;
    display: block;
    margin-bottom: var(--space-xs);
}

.issue-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.issue-actions .btn {
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
}

.issue-pages-loading {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
}

.issue-pages-empty {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
    font-size: 14px;
}

/* ===================================== */
/* SETTINGS PAGE                        */
/* ===================================== */

.settings-container {
    max-width: 900px;
    margin: 0 auto;
}

.settings-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Whitelist guide ──────────────────────────────────── */
.whitelist-guide {
    background: var(--bg-secondary, #13151e);
    border: 1px solid var(--border, #2e3148);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary, #a0a3b1);
}
.whitelist-guide-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e2e4f0);
    margin-bottom: 10px;
}
.whitelist-guide-header i {
    color: var(--primary, #6366f1);
    font-size: 0.9rem;
}
.whitelist-guide-intro {
    margin-bottom: 16px;
}
.whitelist-guide-block {
    background: var(--surface, #1a1d27);
    border: 1px solid var(--border, #2e3148);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.whitelist-guide-block-title {
    font-weight: 600;
    color: var(--text-primary, #e2e4f0);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.whitelist-guide-block-title i {
    color: var(--accent-blue, #60a5fa);
    font-size: 0.8rem;
}
.whitelist-guide-block p {
    margin: 0 0 8px;
}
.whitelist-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary, #13151e);
    border: 1px solid var(--border, #2e3148);
    border-radius: 6px;
    padding: 8px 12px;
    flex-wrap: wrap;
}
.whitelist-code-row code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #a5f3fc;
    background: transparent;
    padding: 0;
    flex: 1;
    min-width: 0;
    word-break: break-all;
}
.btn-copy-snippet {
    background: var(--bg-elevated, #1e2130);
    border: 1px solid var(--border, #2e3148);
    border-radius: 5px;
    color: var(--text-muted, #8b8fa8);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 9px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-copy-snippet:hover {
    background: var(--primary, #6366f1);
    color: #fff;
    border-color: var(--primary, #6366f1);
}
.whitelist-guide-note {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 7px;
    color: var(--text-secondary, #a0a3b1);
    font-size: 0.8rem;
    line-height: 1.55;
}
.whitelist-guide-note i {
    color: var(--primary, #6366f1);
    margin-right: 5px;
}

.settings-section:hover {
    border-color: var(--border-medium);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes settingsSectionPulse {
    0%   { border-color: var(--accent-purple); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50%  { border-color: var(--accent-purple); box-shadow: 0 0 0 6px rgba(139, 92, 246, 0); }
    100% { border-color: var(--border-medium); box-shadow: none; }
}

.settings-section--highlight {
    animation: settingsSectionPulse 2s ease-out forwards;
}

.settings-section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.settings-section h3 i {
    font-size: 1.1rem;
    color: var(--accent-purple);
    width: 24px;
    text-align: center;
}

.settings-section .form-group {
    margin-bottom: var(--space-lg);
}

.settings-section .form-group:last-child {
    margin-bottom: 0;
}

.settings-section .form-group > label:first-child {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.settings-section input[type="text"],
.settings-section input[type="url"],
.settings-section input[type="email"],
.settings-section input[type="number"],
.settings-section select,
.settings-section textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-section input[type="text"]:focus,
.settings-section input[type="url"]:focus,
.settings-section input[type="email"]:focus,
.settings-section input[type="number"]:focus,
.settings-section select:focus,
.settings-section textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.settings-section textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.settings-section .toggle-switch {
    margin: 0;
}

/* Settings Danger Zone */
.settings-danger-zone {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.04));
}

.settings-danger-zone:hover {
    border-color: rgba(239, 68, 68, 0.6);
}

.settings-danger-zone h3 {
    color: var(--accent-red);
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.settings-danger-zone h3 i {
    color: var(--accent-red);
}

.danger-zone-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.danger-zone-info {
    flex: 1;
    min-width: 250px;
}

.danger-zone-info strong {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-weight: 600;
}

.danger-zone-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.danger-zone-content .btn-danger {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-lg);
}

.form-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
}

/* ===================================== */
/* MODALS */
/* ===================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
    border: 2px solid var(--border-subtle);
}

.modal-large {
    max-width: 800px;
    width: 95%;
}

/* ============================================================ */
/* GSC QUERIES TABLE                                            */
/* ============================================================ */
.gsc-queries-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    margin-top: 8px;
}

.gsc-queries-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.gsc-queries-table thead tr {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.gsc-queries-table thead th {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    white-space: nowrap;
}

.gsc-queries-table thead th.gsc-q-num,
.gsc-queries-table tbody td.gsc-q-num {
    text-align: right;
    white-space: nowrap;
}

.gsc-queries-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s ease;
}

.gsc-queries-table tbody tr:last-child {
    border-bottom: none;
}

.gsc-queries-table tbody tr:hover {
    background: var(--bg-elevated);
}

.gsc-queries-table tbody td {
    padding: 9px 12px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.gsc-queries-table .gsc-q-query {
    color: var(--text-primary);
    word-break: break-word;
    min-width: 120px;
}

/* ============================================================ */
/* MODAL RESPONSIVE — 768px                                     */
/* ============================================================ */
@media (max-width: 768px) {
    .modal-large {
        width: 100%;
        max-width: 100%;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        border-radius: 16px 16px 0 0;
    }

    .modal-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 2px;
        padding: 6px 8px;
        scrollbar-width: none;
    }

    .modal-tabs::-webkit-scrollbar {
        display: none;
    }

    .modal-tab {
        padding: 7px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-tab-content {
        padding: 12px;
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    /* 4-stat GSC row → 2×2 on mobile */
    #gscTabContent .detail-grid,
    #gscTabContent .detail-grid-4,
    #performanceTabContent .detail-grid:first-of-type {
        grid-template-columns: repeat(2, 1fr);
    }

    .gsc-queries-table {
        font-size: 0.8rem;
    }

    .gsc-queries-table thead th,
    .gsc-queries-table tbody td {
        padding: 7px 8px;
    }

    .section-title {
        font-size: 0.9rem;
        padding: 9px 12px;
        margin: 16px 0 12px 0;
    }
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 2px solid var(--border);
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
}

.modal-header h2 {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--accent-red);
    transform: scale(1.05);
}

.modal-body {
    padding: 28px;
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin: 0;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-subtle);
    border-bottom: 2px solid var(--border);
}

.modal-tab {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    background: transparent;
   border: none;
    cursor: pointer;
}

.modal-tab:hover { color: var(--text-primary); }
.modal-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.modal-tab-content {
    display: none;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.modal-tab-content.active {
    display: block;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: 24px;
}

/* 4-column stat row (GSC & Lighthouse summary) */
.detail-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    background: var(--glass-bg-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.detail-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.detail-item span,
.detail-item a {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Section Title in Modal */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 16px 0;
    padding: 12px 16px;
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-purple);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Issue List Container */
.issue-list {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ===================================== */
/* ADD WEBSITE MODAL                    */
/* ===================================== */

#addWebsiteModal .modal {
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

#addWebsiteModal .modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
}

#addWebsiteModal .modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

#addWebsiteModal .modal-body {
    padding: 32px 28px;
    background: var(--bg-card);
    border: none;
    margin: 0;
}

#addWebsiteModal .form-group {
    margin-bottom: var(--space-xl);
}

#addWebsiteModal .form-group:last-of-type {
    margin-bottom: var(--space-lg);
}

#addWebsiteModal .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.01em;
}

#addWebsiteModal .form-group input[type="text"],
#addWebsiteModal .form-group input[type="url"],
#addWebsiteModal .form-group select {
    width: 100%;
    padding: 13px 16px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#addWebsiteModal .form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

#addWebsiteModal .form-group input:focus,
#addWebsiteModal .form-group select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

#addWebsiteModal .form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B92A6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 42px;
}

#addWebsiteModal .form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

#addWebsiteModal .form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

#addWebsiteModal .form-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#addWebsiteModal .form-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), rgba(139, 92, 246, 0.85));
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

#addWebsiteModal .form-actions .btn-primary:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), var(--accent-purple));
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

#addWebsiteModal .form-actions .btn-outline {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

#addWebsiteModal .form-actions .btn-outline:hover {
    background: var(--glass-bg-light);
    border-color: var(--border-medium);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* =====================================================
   DASHBOARD 3-CARD METRICS ROW
   ===================================================== */

.dashboard-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metrics-main-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metrics-main-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border-color: var(--glass-border-hover);
}

.metrics-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.metrics-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.metrics-card-icon--system     { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.metrics-card-icon--gsc        { background: rgba(66, 133, 244, 0.15);  color: #4285F4; }
.metrics-card-icon--cwv { background: rgba(251, 146, 60, 0.15);  color: #fb923c; }

.metrics-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

/* Grid of mini metric items */
.metrics-items-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.metrics-items-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.metrics-items-grid--5 {
    grid-template-columns: repeat(5, 1fr);
    margin-top: 8px;
}

.metric-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.2s;
}

.metric-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.metric-item-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.metric-item-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* Smaller size for CWV timing values */
.metric-item-value--sm {
    font-size: 1.15rem;
}

.metric-item-meta {
    margin-top: 4px;
}

.metric-item-meta .meta-line {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Empty state: GSC not connected / Lighthouse no data */
.metrics-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    gap: 6px;
}

.metrics-empty-icon {
    font-size: 2rem;
    opacity: 0.2;
    margin-bottom: 4px;
}

.metrics-empty-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.metrics-empty-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0;
}

/* Responsive */
@media (max-width: 960px) {
    .dashboard-metrics-row {
        grid-template-columns: 1fr;
    }

    .metrics-items-grid--4,
    .metrics-items-grid--5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   MONITORING DASHBOARD
   ===================================================== */

/* Summary Cards Grid */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    border-left: 3px solid var(--border-medium);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.summary-card.card-primary {
    border-left-color: var(--accent-blue);
}

.summary-card.card-success {
    border-left-color: var(--accent-green);
}

.summary-card.card-warning {
    border-left-color: var(--accent-orange);
}

.summary-card.card-danger {
    border-left-color: var(--accent-red);
}

/* Worker card dynamic states */
.summary-card.summary-card-danger {
    border-left-color: var(--accent-red) !important;
    background: rgba(231, 76, 60, 0.08) !important;
}

.summary-card.summary-card-danger .card-value {
    color: var(--accent-red, #e74c3c) !important;
}

.summary-card.summary-card-ok {
    border-left-color: var(--accent-green, #27ae60) !important;
}

.summary-card.summary-card-ok .card-value {
    color: var(--accent-green, #27ae60) !important;
}

.summary-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.summary-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.summary-card .card-label {
    font-size: 0.813rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Monitoring Table */
.monitoring-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.monitoring-table th {
    background: var(--glass-bg-light);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-medium);
}

.monitoring-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.monitoring-table tr:hover {
    background: var(--glass-bg-light);
}

/* Row color coding */
.monitoring-table .row-healthy {
    background: rgba(16, 185, 129, 0.03);
}

.monitoring-table .row-degraded {
    background: rgba(245, 158, 11, 0.05);
}

.monitoring-table .row-failing {
    background: rgba(239, 68, 68, 0.05);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-crawling {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.status-queued {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-idle {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Crawl Progress Mini Bar (shown in monitoring table status cell) */
.crawl-progress-mini {
    margin-top: 6px;
    min-width: 160px;
}

.crawl-progress-mini-track {
    height: 5px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.crawl-progress-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.crawl-progress-mini-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.crawl-progress-pages {
    font-size: 11px;
    color: var(--text-secondary);
    flex: 1;
}

.crawl-progress-pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
}

.crawl-progress-elapsed {
    font-size: 10px;
    color: var(--text-muted, #6B7280);
}

/* Circuit Breaker Badge */
.cb-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cb-badge.cb-closed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cb-badge.cb-half-open {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.cb-badge.cb-open {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Success Rate Badge */
.success-rate {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
}

.success-rate.success-rate-high {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.success-rate.success-rate-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.success-rate.success-rate-low {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Next Crawl Time */
.next-crawl-time {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 12px;
}

/* Failure Items */
.failure-item {
    background: var(--glass-bg);
    border-left: 3px solid var(--accent-red);
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
}

.failure-item:last-child {
    margin-bottom: 0;
}

.failure-type {
    display: inline-block;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    margin-right: 8px;
}

.failure-message {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Page Header for Monitoring */
.page-header {
    margin-bottom: 2rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* =====================================================
   SYSTEM RESOURCES PANEL
   ===================================================== */

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.resource-card {
    background: var(--bg-card, #1e2130);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 1rem;
    transition: opacity 0.3s;
}

.resource-card.resource-card-offline {
    opacity: 0.45;
}

.resource-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.resource-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.resource-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 32px;
    flex-shrink: 0;
}

.resource-bar-wrap {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.resource-bar {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.6s ease, background-color 0.4s ease;
    background: #22c55e; /* green default */
}

.resource-bar.bar-green  { background: #22c55e; }
.resource-bar.bar-yellow { background: #f59e0b; }
.resource-bar.bar-red    { background: #ef4444; }
.resource-bar.bar-blue   { background: #3b82f6; }

.resource-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 52px;
    text-align: right;
}

.resource-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* =====================================================
   WORKER NODES PANEL (Distributed Monitoring)
   ===================================================== */

.worker-nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.worker-node-card {
    background: var(--bg-card, #1e2130);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 1rem 1.15rem;
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
}
.worker-node-card:hover {
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 0 12px rgba(139,92,246,0.1);
}
.worker-node-card.node-local {
    border-left: 3px solid #8B5CF6;
}
.worker-node-card.node-remote {
    border-left: 3px solid #3b82f6;
}

.worker-node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}
.worker-node-hostname {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.worker-node-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.worker-node-badge.badge-local {
    background: rgba(139,92,246,0.18);
    color: #c4b5fd;
}
.worker-node-badge.badge-remote {
    background: rgba(59,130,246,0.18);
    color: #93c5fd;
}

.worker-node-counts {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.worker-node-count-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.worker-node-count-item .count-num {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.worker-node-workers-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.worker-node-workers-list::-webkit-scrollbar {
    width: 4px;
}
.worker-node-workers-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

.worker-node-worker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-size: 0.75rem;
}
.worker-node-worker-row .wn-name {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.worker-node-worker-row .wn-state {
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
}
.wn-state.state-busy {
    background: rgba(34,197,94,0.18);
    color: #86efac;
}
.wn-state.state-idle {
    background: rgba(156,163,175,0.15);
    color: #9ca3af;
}
.wn-state.state-suspended {
    background: rgba(245,158,11,0.18);
    color: #fcd34d;
}
.wn-state.state-started {
    background: rgba(59,130,246,0.18);
    color: #93c5fd;
}

.worker-nodes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    gap: 0.5rem;
}
.worker-nodes-empty .empty-icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* =====================================================
   WORKERS MANAGEMENT PANEL
   ===================================================== */

.workers-control-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.workers-control-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.workers-control-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.worker-slider {
    -webkit-appearance: none;
    width: 200px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
}

.worker-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue, #3b82f6);
    cursor: pointer;
    border: 2px solid var(--bg-card, #1e2130);
}

.worker-number-input {
    width: 56px;
    text-align: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 6px;
    font-size: 0.9rem;
}

.workers-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

.workers-apply-msg {
    font-size: 0.85rem;
    min-height: 1.2em;
    padding: 4px 8px;
    border-radius: 6px;
}

.workers-apply-msg.msg-success {
    color: #22c55e;
    background: rgba(34,197,94,0.1);
}

.workers-apply-msg.msg-error {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
}

.workers-status-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.workers-status-badge.badge-active {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.workers-status-badge.badge-inline {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

/* =====================================================
   ENGINE BADGES (worker vs inline thread)
   ===================================================== */

.engine-badge {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.03em;
    width: fit-content;
}

/* Active: RQ worker */
.engine-worker {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Active: inline thread */
.engine-inline {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Idle prediction: will use worker */
.engine-next-worker {
    background: transparent;
    color: rgba(96, 165, 250, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* Idle prediction: will use inline */
.engine-next-inline {
    background: transparent;
    color: rgba(251, 191, 36, 0.45);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

/* ── Crawl Technique Badges ── */
.technique-badge {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    text-transform: none;
    margin-left: 3px;
}

.technique-playwright {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.technique-curl_cffi {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.technique-requests {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* ── Recent Status badges (Sites Monitoring table) ── */
.lrs-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    white-space: nowrap;
}
.lrs-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.lrs-blocked {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.lrs-down {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.lrs-timeout {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.lrs-network {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.lrs-error {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}
.lrs-time {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Crawling Worker Badges (Sites Monitoring table) ── */
.crawling-worker-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}
.cwb-local {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.cwb-remote {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.cwb-idle {
    color: rgba(148, 163, 184, 0.4);
    font-size: 0.85rem;
}

.avg-page-time {
    font-size: 0.72rem;
    color: rgba(148, 163, 184, 0.7);
    font-style: italic;
}

/* ══════════════════════════════════════════
   MOBILE NAVIGATION
══════════════════════════════════════════ */

/* Sidebar overlay backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
    display: block;
}

/* Team table: scrollable container on mobile */
.team-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile hamburger button — hidden on desktop */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-base);
    margin-right: 8px;
}
.mobile-menu-btn:hover {
    background: var(--glass-bg-light);
    color: var(--accent-purple);
}

/* Mobile site-switcher bar — hidden on desktop */
.mobile-site-bar {
    display: none;
}

@media (max-width: 768px) {
    /* Show hamburger */
    .mobile-menu-btn {
        display: flex;
    }

    /* Show mobile site bar */
    .mobile-site-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-subtle);
        position: sticky;
        top: 56px;
        z-index: 100;
    }

    .mobile-site-icon {
        color: var(--text-muted);
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .mobile-site-select {
        flex: 1;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        color: var(--text-primary);
        font-size: 0.95rem;
        font-weight: 600;
        padding: 8px 12px;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        min-width: 0;
    }
    .mobile-site-select:focus {
        outline: none;
        border-color: var(--accent-purple);
    }
    .mobile-site-select option {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    .mobile-site-chevron {
        color: var(--text-muted);
        font-size: 0.8rem;
        pointer-events: none;
        flex-shrink: 0;
    }

    /* Page content doesn't need left margin — sidebar is overlaid */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* ── Alert Rules — mobile tweaks ────────────────────────── */
    .alert-rule-card {
        padding: 12px 12px;
    }

    /* Rule name can wrap on mobile */
    .arc-name {
        white-space: normal;
        font-size: 0.88rem;
    }

    /* Meta pills wrap naturally */
    .arc-meta {
        padding-left: 0;
    }

    /* Channel toggles — full width row, spread out */
    .arc-channels {
        padding-left: 0;
        gap: 16px;
        flex-wrap: wrap;
    }

    /* Slightly larger touch target for toggles on mobile */
    .toggle-switch input[type="checkbox"] {
        width: 40px;
        height: 22px;
    }

    /* "Copy rules to all sites" button full-width on mobile */
    #copyAlertRulesToAllBtn {
        width: 100%;
        justify-content: center;
    }

    /* Create Alert Rule modal — full-screen sheet on mobile */
    #alertRuleModal .modal {
        width: 100%;
        max-width: 100%;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Modal min_pages field — narrower input */
    #alertRuleMinPages {
        width: 80px !important;
    }
}

/* ============================================================ */
/* CHANGE DETAIL MODAL                                          */
/* ============================================================ */
.modal-change-detail { max-width: 600px; }

.cd-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.cd-header-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cd-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(108, 99, 255, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.2s, color 0.2s;
}

.cd-modal-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.cd-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.cd-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cd-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Before / After diff */
.cd-diff-section {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.cd-diff-card {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    min-width: 0;
    word-break: break-word;
}

.cd-diff-before { border-top: 3px solid #ef4444; }
.cd-diff-after  { border-top: 3px solid #22c55e; }

.cd-diff-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cd-diff-value {
    font-size: 0.875rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: normal;
    color: var(--text-primary);
    max-height: 150px;
    overflow-y: auto;
}

/* Word-diff spans */
.cd-diff-removed {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    text-decoration: line-through;
    border-radius: 3px;
    padding: 1px 2px;
}
.cd-diff-added {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border-radius: 3px;
    padding: 1px 2px;
}
.cd-diff-eq   { color: var(--text-secondary); }
.cd-empty     { color: var(--text-muted); font-style: italic; opacity: 0.65; }

/* Remove old hardcoded single-colour for the whole card — spans now carry colour */
.cd-diff-before .cd-diff-value { color: inherit; font-style: normal; }
.cd-diff-after  .cd-diff-value { color: inherit; }

.cd-diff-arrow {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
    padding: 0 2px;
}

/* Meta info rows */
.cd-meta-grid {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cd-meta-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.865rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.cd-meta-row:last-child { border-bottom: none; }
.cd-meta-row:nth-child(odd) { background: rgba(255,255,255,0.015); }

.cd-meta-label {
    width: 130px;
    flex-shrink: 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.83rem;
}

.cd-meta-value {
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    flex: 1;
}

a.cd-page-link {
    color: var(--primary);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.83rem;
    font-weight: 400;
}
a.cd-page-link:hover { text-decoration: underline; }

.impact-text-high   { color: #f87171; }
.impact-text-medium { color: #fb923c; }
.impact-text-low    { color: #60a5fa; }

.cd-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
}

/* Clickable timeline items */
.timeline-item { cursor: pointer; }
.issue-item     { cursor: pointer; }

/* =====================================================
   CHART ANNOTATIONS
   ===================================================== */

/* Separator between period buttons and bookmark button */
.chart-controls-sep {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 4px;
    align-self: center;
}

/* Bookmark pin overlaid on chart */
.chart-ann-pin {
    position: absolute;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #f59e0b;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    transition: background 0.15s, transform 0.15s;
}
.chart-ann-pin:hover {
    background: rgba(245, 158, 11, 0.3);
    transform: translateX(-50%) scale(1.2);
}

/* Annotation modal sizing */
.modal-annotation {
    max-width: 480px;
    width: 100%;
}

/* Body text in view mode */
.ann-body-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    min-height: 40px;
}

/* Action row */
.ann-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Delete button */
.ann-delete-btn {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.ann-delete-btn:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.5);
}
.alert-card     { cursor: pointer; }

/* Severity variants for impact-badge (critical / warning / info) */
.impact-badge.critical { background: rgba(239, 68,  68, 0.15); color: var(--accent-red);    border: 1px solid rgba(239, 68,  68, 0.3); }
.impact-badge.warning  { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); border: 1px solid rgba(245, 158, 11, 0.3); }
.impact-badge.info     { background: rgba(59,  130, 246, 0.15); color: var(--accent-blue);  border: 1px solid rgba(59,  130, 246, 0.3); }

/* Affected-pages section inside Issue Detail modal */
.cd-pages-section { margin-top: 16px; }
.cd-section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.cd-pages-list { max-height: 260px; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
/* Compact overrides for the issue-pages-table when rendered inside the modal */
.cd-pages-list .issue-pages-table { margin: 0; border-radius: 0; }
.cd-pages-list .issue-pages-table thead tr,
.cd-pages-list .issue-page-row { gap: var(--space-sm); padding: 7px 10px; font-size: 0.8rem; }
.cd-pages-list .url-cell { font-size: 0.8rem; }
/* Clickable rows in the modal open page in new tab */
.cd-pages-list .issue-page-row .url-cell { color: var(--accent-blue); cursor: pointer; }
.cd-pages-list .issue-page-row .url-cell:hover { text-decoration: underline; }
.cd-pages-loading { text-align: center; color: var(--text-muted); font-size: 0.82rem; padding: 12px 0; }
.cd-pages-empty   { text-align: center; color: var(--text-muted); font-size: 0.82rem; padding: 10px 0; font-style: italic; }

/* Alert card — inline compact pages preview */
.alert-pages-preview {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 6px; min-height: 16px;
}
.alp-loading { color: var(--text-muted); font-size: 0.75rem; }
.alp-chip {
    display: inline-block;
    background: rgba(99,102,241,0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.72rem;
    max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: default;
}
.alp-more {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 1px 4px;
    font-style: italic;
}

/* ============================================================ */
/* ISSUE DETAIL MODAL - TABS (Too many on-page links)           */
/* ============================================================ */
.modal-change-detail.id-wide { max-width: 820px; }

.id-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border-subtle);
    margin: -20px -24px 4px -24px;
    padding: 0 24px;
    background: var(--bg-secondary);
    border-radius: 0;
}

.id-tab-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.id-tab-btn:hover { color: var(--text-primary); }
.id-tab-btn.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.id-tab-panel { display: block; }

/* Links tab controls */
.id-links-page-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}
.id-links-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.id-links-select {
    flex: 1;
    min-width: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.82rem;
}
.id-links-reload {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 5px;
    padding: 5px 9px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.id-links-reload:hover { color: var(--accent-purple); border-color: var(--accent-purple); }

/* Links result tables */
.id-links-stats {
    margin-bottom: 14px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}
.id-links-stats strong { color: var(--text-primary); }

.id-links-section { margin-bottom: 18px; }
.id-links-section-hdr {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.id-links-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.id-links-table th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}
.id-links-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.id-links-table tr:hover td { background: rgba(108,99,255,0.05); }
.id-links-href {
    color: var(--accent-blue);
    cursor: pointer;
}
.id-links-href:hover { text-decoration: underline; }
.id-links-broken { color: #ef4444 !important; }
.id-links-broken:hover { color: #f87171 !important; }
.id-links-nofollow {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Page Detail Modal — Links tab toolbar */
.pdl-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}
.pdl-url {
    flex: 1;
    font-size: 0.8rem;
    color: var(--accent-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Description box inside detail modals */
.cd-description-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
    white-space: pre-wrap;
}

/* =====================================================
   VIEW TOGGLE BUTTONS (grid / list)
   ===================================================== */
.view-toggle-btns {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary, #13151e);
    border: 1px solid var(--border, #2e3148);
    border-radius: 8px;
    padding: 3px;
}
.view-toggle {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted, #8b8fa8);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.85rem;
}
.view-toggle:hover {
    background: var(--bg-elevated, #1e2130);
    color: var(--text-primary, #e2e4f0);
}
.view-toggle.active {
    background: var(--primary, #6366f1);
    color: #fff;
}

/* =====================================================
   ALL-SITES OVERVIEW DASHBOARD
   ===================================================== */
.all-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 4px 0 24px;
}

/* ── List view ─────────────────────────────────────── */
.all-sites-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0 24px;
}
.site-row {
    background: var(--surface, #1a1d27);
    border: 1px solid var(--border, #2e3148);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}
.site-row:hover {
    background: var(--bg-elevated, #1e2130);
    border-color: var(--primary, #6366f1);
}
.site-row-favicon {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    flex-shrink: 0;
    object-fit: contain;
}
.site-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.site-row-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #e2e4f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-row-domain {
    font-size: 0.72rem;
    color: var(--text-muted, #8b8fa8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-row-score {
    font-size: 0.85rem;
    font-weight: 700;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.site-row-score.healthy  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.site-row-score.warning  { background: rgba(234,179,8,0.15);  color: #eab308; }
.site-row-score.critical { background: rgba(239,68,68,0.15);  color: #ef4444; }
.site-row-stats {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}
.site-row-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-secondary, #a0a3b1);
    white-space: nowrap;
}
.site-row-stats span i {
    font-size: 0.7rem;
    color: var(--text-muted, #8b8fa8);
}
.site-row-health-bar {
    width: 90px;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    background: var(--bg-secondary, #13151e);
    flex-shrink: 0;
}
.site-row-health-bar .health-seg-healthy  { background: #22c55e; }
.site-row-health-bar .health-seg-warning  { background: #eab308; }
.site-row-health-bar .health-seg-critical { background: #ef4444; }
.site-row-inaccessible-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 5px;
    padding: 2px 7px;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .site-row-stats { display: none; }
    .site-row-health-bar { display: none; }
}

.site-card {
    background: var(--surface, #1a1d27);
    border: 1px solid var(--border, #2e3148);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;  /* needed for the 403/404 accessibility overlay */
    overflow: hidden;
}

/* ── 403 / 404 inaccessibility overlay ─────────────────── */
.site-card-inaccessible-overlay {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;   /* clicks pass through to the card */
    z-index: 5;
}
.site-card-inaccessible-badge {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ef4444;
    text-shadow: 0 2px 16px rgba(239, 68, 68, 0.55);
    background: rgba(10, 6, 6, 0.62);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 10px;
    padding: 7px 20px;
    line-height: 1;
    backdrop-filter: blur(2px);
}
.site-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.35);
    border-color: var(--primary, #6366f1);
}

.site-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-card-favicon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: contain;
}
.site-card-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.site-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #e2e4f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-card-domain {
    font-size: 0.75rem;
    color: var(--text-muted, #8b8fa8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-card-score {
    font-size: 1.1rem;
    font-weight: 700;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.site-card-score.healthy  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.site-card-score.warning  { background: rgba(234,179,8,0.15);  color: #eab308; }
.site-card-score.critical { background: rgba(239,68,68,0.15);  color: #ef4444; }

.site-card-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.site-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: var(--bg-secondary, #13151e);
    border-radius: 8px;
}
.site-card-stat i {
    font-size: 0.75rem;
    color: var(--text-muted, #8b8fa8);
    margin-bottom: 2px;
}
.site-card-stat span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #e2e4f0);
}
.site-card-stat small {
    font-size: 0.65rem;
    color: var(--text-muted, #8b8fa8);
    text-align: center;
}

.site-card-health-bar {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    background: var(--bg-secondary, #13151e);
}
.site-card-health-bar .health-seg-healthy  { background: #22c55e; }
.site-card-health-bar .health-seg-warning  { background: #eab308; }
.site-card-health-bar .health-seg-critical { background: #ef4444; }

.site-card-health-legend {
    font-size: 0.72rem;
    color: var(--text-muted, #8b8fa8);
    display: flex;
    align-items: center;
    gap: 4px;
}
.site-card-health-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.site-card-health-legend .dot.healthy  { background: #22c55e; }
.site-card-health-legend .dot.warning  { background: #eab308; }
.site-card-health-legend .dot.critical { background: #ef4444; }

.sc-leg-label {
    color: var(--text-secondary, #a0a3b1);
    font-size: 0.7rem;
    margin-right: 2px;
}
.sc-leg-pct {
    color: var(--text-primary, #e2e8f0);
    font-weight: 600;
    font-size: 0.7rem;
    margin-right: 8px;
}

/* ── Linked From tab panel ─────────────────────────────── */
.lf-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px 2px;
}
.lf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    background: var(--bg-secondary, #13151e);
    color: var(--accent-blue, #60a5fa);
    text-decoration: none;
    font-size: 0.82rem;
    transition: background 0.15s;
    min-width: 0;
}
.lf-item:hover { background: var(--bg-elevated, #1e2130); }
.lf-icon { flex-shrink: 0; font-size: 0.75rem; opacity: 0.7; }
.lf-path {
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.lf-ext-icon {
    flex-shrink: 0;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s;
    color: var(--accent-blue, #60a5fa);
}
.lf-item:hover .lf-ext-icon { opacity: 0.7; }
.lf-domain {
    font-size: 0.72rem;
    color: var(--text-muted, #8b8fa8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Alert-modal tab buttons (same styling as id-tab-btn) */
.ad-tab-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.ad-tab-btn:hover { color: var(--text-primary); }
.ad-tab-btn.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

/* Loading / empty states */
.all-sites-loading,
.all-sites-error,
.all-sites-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #8b8fa8);
    font-size: 0.95rem;
}
.all-sites-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}
.all-sites-error { color: #ef4444; }

/* ══════════════════════════════════════════════════════════════
   Admin Panel — Tab bar, badges, modal, admin-specific styles
   ══════════════════════════════════════════════════════════════ */

/* Tab bar */
.mon-tab-bar {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}
.mon-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mon-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}
.mon-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}
.mon-tab-content {
    display: none;
}
.mon-tab-content.active {
    display: block;
}

/* Admin badges */
.admin-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.admin-badge-owner {
    background: rgba(139, 92, 246, 0.18);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.admin-badge-member {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.22);
}
.admin-badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.22);
}
.admin-badge-blocked {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.22);
}
.admin-badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.22);
}

/* Search input */
.admin-search-input {
    padding: 0.45rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    min-width: 180px;
}
.admin-search-input:focus {
    border-color: var(--accent-purple);
}
.admin-search-input::placeholder {
    color: var(--text-muted);
}

/* Admin table tweaks */
.admin-users-table th,
.admin-sites-table th {
    font-size: 0.78rem;
    white-space: nowrap;
}
.admin-user-name {
    font-weight: 600;
    color: var(--text-primary);
}
.admin-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.admin-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.35rem;
}
.admin-actions-cell .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-width: unset;
}
.row-blocked {
    opacity: 0.55;
}
.row-blocked:hover {
    opacity: 0.85;
}
.admin-site-url {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.82rem;
}
.admin-site-url:hover {
    text-decoration: underline;
}
.admin-rate { font-weight: 600; }
.rate-high { color: var(--status-success); }
.rate-med  { color: var(--status-warning); }
.rate-low  { color: var(--status-error); }

/* Admin modal */
.admin-modal-overlay {
    position: fixed; inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.admin-modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-strong);
}
.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}
.admin-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.admin-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}
.admin-modal-close:hover {
    color: var(--text-primary);
}
.admin-modal-body {
    padding: 1.5rem;
}

/* Admin form (inside modal) */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.admin-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: -0.35rem;
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.admin-form input:focus {
    border-color: var(--accent-purple);
}
.admin-form input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.admin-form-actions {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Admin site checkboxes */
.admin-site-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}
.admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Admin site detail (inside modal) */
.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}
.admin-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.admin-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-detail-item > span:last-child {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* KV settings table */
.admin-kv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-kv-table th,
.admin-kv-table td {
    padding: 0.4rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.admin-kv-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.admin-kv-key {
    font-weight: 600;
    color: var(--accent-cyan);
    white-space: nowrap;
}

/* Activate / Block button colors */
.admin-btn-block {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}
.admin-btn-block:hover {
    background: rgba(239, 68, 68, 0.3) !important;
}
.admin-btn-activate {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}
.admin-btn-activate:hover {
    background: rgba(16, 185, 129, 0.3) !important;
}

/* ========================================================
   OBSERVABILITY TAB
   ======================================================== */

/* Summary row */
.obs-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.obs-summary-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    min-width: 130px;
}
.obs-card-icon { font-size: 1.5rem; }
.obs-card-num  { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.obs-card-label { font-size: 0.78rem; color: var(--text-secondary); }
.obs-card-critical { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }
.obs-card-critical .obs-card-num { color: var(--accent-red); }
.obs-card-error { border-color: rgba(249, 115, 22, 0.35); background: rgba(249, 115, 22, 0.07); }
.obs-card-error .obs-card-num { color: var(--accent-orange); }
.obs-card-warning { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.06); }
.obs-card-warning .obs-card-num { color: var(--status-warning); }
.obs-card-total { border-color: rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.06); }
.obs-card-total .obs-card-num { color: var(--accent-purple-light); }

/* Component chips in summary */
.obs-comp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    padding-top: 0.25rem;
}
.obs-comp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.obs-comp-chip:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
}
.obs-comp-chip strong { color: var(--text-primary); }

/* Filter bar */
.obs-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.obs-select {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-medium);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}
.obs-select:focus { outline: none; border-color: var(--accent-purple); }
.obs-count-label {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Logs table overrides */
.obs-table { font-size: 0.85rem; }
.obs-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Level badges */
.obs-level-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.obs-level-critical  { color: #fca5a5; }
.obs-level-error     { color: #fdba74; }
.obs-level-warning   { color: #fcd34d; }
.obs-level-badge.obs-level-critical { background: rgba(239, 68, 68, 0.18); }
.obs-level-badge.obs-level-error    { background: rgba(249, 115, 22, 0.16); }
.obs-level-badge.obs-level-warning  { background: rgba(245, 158, 11, 0.14); }

/* Row tinting */
tr.obs-log-row.obs-level-critical { background: rgba(239, 68, 68, 0.06); }
tr.obs-log-row.obs-level-error    { background: rgba(249, 115, 22, 0.04); }
tr.obs-log-row.obs-level-warning  { background: rgba(245, 158, 11, 0.03); }
tr.obs-log-row:hover { background: rgba(255, 255, 255, 0.04); }

/* Component badges */
.obs-comp-badge {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
}

/* Expand button */
.obs-expand-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    margin-left: 0.4rem;
    border-radius: 3px;
    vertical-align: middle;
}
.obs-expand-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Detail block */
.obs-detail-block { margin-top: 0.5rem; }
.obs-detail-pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
    margin: 0.3rem 0;
}
.obs-context-pre { color: var(--accent-cyan); }

/* Summary cell */
.obs-summary-cell { max-width: 500px; word-break: break-word; }
