        :root {
            --primary: #2AB9AD;
            --primary-dark: #229990;
            --secondary: #000065;
            --bg: #0a0a14;
            --sidebar-bg: #0f0f1a;
            --card-bg: #14142a;
            --card-hover: #1a1a3a;
            --text: #e4e4e7;
            --text-muted: #a1a1aa; /* zinc-400: subido desde #71717a por bajo contraste sobre fondo oscuro (AA ~6.8:1) */
            --border: #1f1f3a;
            --success: #22c55e;
            --warning: #f59e0b;
            --error: #ef4444;
            --info: #3b82f6;
            --perfex: #28a745;
            --wordpress: #21759b;
            --laravel: #ff2d20;
            --nextjs: #000000;
            --html: #e34c26;
            --php: #777bb4;
            --sidebar-width: 260px;
            --topbar-bg: var(--sidebar-bg); /* separable desde /config (Joan 2026-07-02) */
        }
        /* Light Theme */
        [data-theme="light"] {
            --bg: #f5f5f7;
            --sidebar-bg: #ffffff;
            --card-bg: #ffffff;
            --card-hover: #f0f0f5;
            --text: #1a1a2e;
            --text-muted: #64748b;
            --border: #e2e8f0;
            --nextjs: #6b7280;
        }
        [data-theme="light"] .sidebar-header {
            background: linear-gradient(135deg, rgba(255,107,53,0.1), rgba(247,147,30,0.05));
        }
        [data-theme="light"] .nav-item.active {
            box-shadow: 0 2px 8px rgba(255,107,53,0.3);
        }
        [data-theme="light"] .plesk-dashboard {
            background: linear-gradient(135deg, rgba(42,185,173,0.05), rgba(0,0,101,0.05));
        }
        [data-theme="light"] .ionos-dashboard {
            background: linear-gradient(135deg, rgba(0,58,112,0.05), rgba(0,156,222,0.05));
        }
        /* Logo theme switching */
        .logo-light { display: none; }
        .logo-dark { display: block; }
        [data-theme="light"] .logo-light { display: block; }
        [data-theme="light"] .logo-dark { display: none; }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', -apple-system, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            display: flex;
        }
        /* Sidebar */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--sidebar-bg);
            border-right: 1px solid var(--border);
            height: 100vh;
            position: fixed;
            display: flex;
            flex-direction: column;
            z-index: 100;
        }
        .sidebar-header {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(247,147,30,0.1));
            flex-shrink: 0;
        }
        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .sidebar-logo svg { width: 40px; height: 40px; }
        .sidebar-logo h1 { font-size: 1.1rem; font-weight: 700; }
        .sidebar-logo span { font-size: 0.65rem; color: var(--text-muted); display: block; }
        .sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0.5rem; scrollbar-width: none; -ms-overflow-style: none; }
        .sidebar-nav::-webkit-scrollbar { display: none; }
        .nav-section { margin-bottom: 0.75rem; }
        .nav-section-title {
            font-size: 0.65rem;
            text-transform: uppercase;
            color: var(--text-muted);
            padding: 0.5rem 0.75rem;
            letter-spacing: 0.05em;
        }
        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.55rem 0.65rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.82rem;
        }
        .nav-item:hover { background: var(--card-bg); color: var(--text); }
        .nav-item.active { background: linear-gradient(135deg, #FF6B35, #F7931E); color: white; }
        .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
        .nav-item .badge {
            margin-left: auto;
            background: linear-gradient(135deg, #FF6B35, #F7931E);
            color: white;
            font-size: 0.6rem;
            padding: 0.15rem 0.4rem;
            border-radius: 10px;
        }
        .sidebar-footer {
            padding: 0.75rem;
            border-top: 1px solid var(--border);
            font-size: 0.65rem;
            color: var(--text-muted);
            flex-shrink: 0;
        }
        .server-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #FF6B35;
            box-shadow: 0 0 8px rgba(255,107,53,0.5);
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        /* Sidebar colapsable en desktop (clase en <html>, persistida en localStorage) */
        html.sidebar-collapsed .sidebar { transform: translateX(-100%); }
        html.sidebar-collapsed .main { margin-left: 0; }
        @media (min-width: 1025px) {
            .sidebar { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
            .main { transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
        }
        /* User chip compacto en la topbar */
        .topbar-user { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.5rem; border: 1px solid var(--border); border-radius: 20px; }
        .topbar-user .user-avatar { width: 26px; height: 26px; border-radius: 50%; }
        .topbar-user .user-details { display: flex; flex-direction: column; line-height: 1.1; }
        .topbar-user .user-name { font-size: 0.72rem; font-weight: 600; }
        .topbar-user .user-email { font-size: 0.6rem; color: var(--text-muted); }
        .topbar-user .logout-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; padding: 0.2rem; }
        .topbar-user .logout-btn:hover { color: var(--text); }
        @media (max-width: 700px) { .topbar-user .user-details { display: none; } }
        #sidebar-customize-btn span { font-size: 0.72rem; }
        @media (max-width: 900px) { #sidebar-customize-btn { display: none; } }


        /* ── Visor embebido de sitios + menú contextual (Joan 02/07) ── */
        #site-embed-modal { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: flex; flex-direction: column; }
        #site-embed-modal .embed-toolbar { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem; background: var(--sidebar-bg); border-bottom: 1px solid var(--border); }
        #site-embed-modal .embed-title { font-weight: 700; font-size: 0.9rem; }
        #site-embed-modal .embed-url { color: var(--text-muted); font-size: 0.75rem; }
        #site-embed-modal .embed-body { flex: 1; position: relative; min-height: 0; }
        #site-embed-modal .embed-frame { width: 100%; height: 100%; border: none; background: #fff; }
        #site-embed-modal .embed-loading { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); }
        #site-embed-modal .embed-hint { position: absolute; bottom: 0; left: 0; right: 0; font-size: 0.65rem; color: var(--text-muted); background: var(--sidebar-bg); border-top: 1px solid var(--border); padding: 0.25rem 0.9rem; opacity: 0.85; }
        #site-embed-modal .embed-blocked { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 0.6rem; text-align: center; padding: 1rem; }
        #site-embed-modal .embed-blocked-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
        #site-embed-modal .embed-fab { position: absolute; right: 22px; bottom: 40px; width: 52px; height: 52px; border-radius: 50%; border: none; background: linear-gradient(135deg, #FF6B35, #F7931E); color: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 6px 20px rgba(255,107,53,0.45); z-index: 5; }
        #site-embed-modal .embed-fab:hover { transform: scale(1.08); }
        #site-ctx-menu { position: fixed; z-index: 950; min-width: 230px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 0.35rem; box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
        #site-ctx-menu .ctx-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 0.4rem 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; }
        #site-ctx-menu .ctx-item { display: block; width: 100%; text-align: left; background: transparent; border: none; color: var(--text); padding: 0.5rem 0.6rem; border-radius: 8px; font-size: 0.82rem; cursor: pointer; }
        #site-ctx-menu .ctx-item:hover { background: linear-gradient(135deg, rgba(255,107,53,0.2), rgba(247,147,30,0.15)); }
        #site-ctx-menu .ctx-sep { height: 1px; background: var(--border); margin: 0.3rem 0.4rem; }

        /* Main Content */
        .main {
            margin-left: var(--sidebar-width);
            flex: 1;
            min-height: 100vh;
        }
        .topbar {
            background: var(--topbar-bg);
            border-bottom: 1px solid var(--border);
            padding: 0.75rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 50;
        }
        .topbar-left { display: flex; align-items: center; gap: 1rem; }
        .topbar-title { font-size: 1rem; font-weight: 600; }
        .topbar-actions { display: flex; gap: 0.5rem; }
        .btn {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text);
            cursor: pointer;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.2s;
            text-decoration: none;
        }
        .btn:hover { border-color: var(--primary); background: rgba(42,185,173,0.1); }
        .btn-primary { background: var(--primary); border-color: var(--primary); color: white; }
        .btn-primary:hover { background: var(--primary-dark); }
        /* Content */
        .content { padding: 1.5rem; min-height: calc(100vh - 60px); }
        .page {
            display: none;
            width: 100%;
            min-height: 100%;
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 1rem;
        }
        .page.active { display: block; }
        /* Cards Grid */
        .cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            transition: all 0.2s;
        }
        .card:hover { border-color: var(--primary); }
        .card-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        .card-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .card-title { font-weight: 600; font-size: 0.95rem; }
        .card-subtitle { font-size: 0.75rem; color: var(--text-muted); }
        .card-value { font-size: 2rem; font-weight: 700; }
        .card-label { font-size: 0.75rem; color: var(--text-muted); }
        /* Stats Row */
        .stats-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .stat-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .stat-card:hover, .stat-card.active { border-color: var(--primary); }
        .stat-card.active { background: rgba(42,185,173,0.1); }
        .stat-number { font-size: 1.75rem; font-weight: 700; }
        .stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
        /* Health Bar */
        .health-bar {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex-wrap: wrap;
        }
        .health-title { font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; }
        .health-stats { display: flex; gap: 1rem; flex: 1; }
        .health-stat { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; }
        .health-dot { width: 8px; height: 8px; border-radius: 50%; }
        .health-dot.online { background: var(--success); }
        .health-dot.offline { background: var(--error); }
        .health-dot.checking { background: var(--warning); }
        .health-progress { flex: 1; min-width: 150px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
        .health-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }
        /* Search */
        .search-box {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.6rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
        .search-box input {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text);
            font-size: 0.9rem;
            outline: none;
        }
        .search-box input::placeholder { color: var(--text-muted); }
        /* Sites Grid */
        .sites-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
            gap: 1.25rem;
        }
        .site-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        .site-card:hover {
            border-color: var(--primary);
            transform: translateY(-4px);
            box-shadow: 0 12px 24px rgba(0,0,0,0.25), 0 0 0 1px var(--primary);
        }
        .site-thumbnail {
            width: 100%;
            height: 200px;
            background-size: cover;
            background-position: top center;
            background-repeat: no-repeat;
            position: relative;
            overflow: hidden;
            border-radius: 12px 12px 0 0;
        }
        .site-thumbnail.placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            font-weight: 700;
            color: rgba(255,255,255,0.3);
        }
        .site-thumbnail.perfex { background: linear-gradient(135deg, var(--perfex), #1a4a6e); }
        .site-thumbnail.wordpress { background: linear-gradient(135deg, var(--wordpress), #1a3a5c); }
        .site-thumbnail.laravel { background: linear-gradient(135deg, var(--laravel), #7a1a1a); }
        .site-thumbnail.nextjs { background: linear-gradient(135deg, #333, #000); }
        .site-thumbnail.html { background: linear-gradient(135deg, var(--html), #8a3a00); }
        .site-thumbnail.php { background: linear-gradient(135deg, var(--php), #3a3a6e); }
        .site-thumbnail.unknown { background: linear-gradient(135deg, var(--text-muted), #444); }
        .site-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top center;
            transition: transform 0.4s ease, opacity 0.3s ease;
            background: var(--card-bg);
        }
        .site-thumbnail img[src*="mshots"] {
            /* Subtle inner shadow for depth */
            filter: brightness(1.02) contrast(1.02);
        }
        .site-card:hover .site-thumbnail img {
            transform: scale(1.08);
            filter: brightness(1.05) contrast(1.02);
        }
        .site-thumbnail .thumb-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: linear-gradient(transparent, rgba(0,0,0,0.7));
            pointer-events: none;
        }
        /* Loading shimmer for thumbnails */
        .site-thumbnail::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
            animation: thumbShimmer 1.5s infinite;
            z-index: 1;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .site-thumbnail:not(.placeholder) img:not([complete])::before,
        .site-thumbnail:not(.loaded)::before {
            opacity: 1;
        }
        @keyframes thumbShimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }
        .site-header { padding: 1rem; display: flex; align-items: flex-start; gap: 0.75rem; border-bottom: 1px solid var(--border); }
        .site-icon {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.7rem;
            flex-shrink: 0;
        }
        .site-icon.perfex { background: var(--perfex); }
        .site-icon.wordpress { background: var(--wordpress); }
        .site-icon.laravel { background: var(--laravel); }
        .site-icon.nextjs { background: #000; border: 1px solid #333; }
        .site-icon.html { background: var(--html); }
        .site-icon.php { background: var(--php); }
        .site-icon.unknown { background: var(--text-muted); }
        .site-info { flex: 1; min-width: 0; }
        .site-name { font-weight: 600; font-size: 0.9rem; }
        .site-name-row { display: flex; align-items: center; gap: 0.35rem; }
        .site-name.custom { color: var(--primary); }
        .edit-name-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.2rem;
            opacity: 0;
            transition: opacity 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .edit-name-btn svg { width: 12px; height: 12px; color: var(--text-muted); }
        .edit-name-btn:hover svg { color: var(--primary); }
        .site-info:hover .edit-name-btn { opacity: 1; }
        .edit-name-btn-table {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.2rem;
            opacity: 0;
            transition: opacity 0.2s;
            display: inline-flex;
            align-items: center;
            margin-left: 0.3rem;
            vertical-align: middle;
        }
        .edit-name-btn-table svg { width: 12px; height: 12px; color: var(--text-muted); }
        .edit-name-btn-table:hover svg { color: var(--primary); }
        .site-name-cell:hover .edit-name-btn-table { opacity: 1; }
        .custom-name { color: var(--primary); }
        .site-url { font-size: 0.75rem; color: var(--text-muted); }
        .site-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.4rem; }
        .badge { font-size: 0.6rem; padding: 0.15rem 0.4rem; border-radius: 4px; background: rgba(255,255,255,0.1); }
        .badge-ssl { background: rgba(34,197,94,0.2); color: var(--success); }
        .site-status { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
        .site-status.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
        .site-status.offline { background: var(--error); }
        .site-status.checking { background: var(--warning); animation: pulse 1s infinite; }
        .site-path {
            padding: 0.5rem 1rem;
            background: rgba(0,0,0,0.2);
            font-family: monospace;
            font-size: 0.7rem;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .site-path:hover { color: var(--text); }
        .site-actions { padding: 0.75rem 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .action-btn {
            flex: 1;
            min-width: 60px;
            padding: 0.45rem 0.6rem;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font-size: 0.7rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.3rem;
            text-decoration: none;
        }
        .action-btn:hover { border-color: var(--primary); }
        .action-btn.primary { background: var(--primary); border-color: var(--primary); }
        /* Plesk Links */
        .plesk-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1rem;
        }
        .plesk-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
            color: var(--text);
            transition: all 0.2s;
        }
        .plesk-card:hover { border-color: var(--primary); background: rgba(42,185,173,0.05); }
        .plesk-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .plesk-title { font-weight: 500; font-size: 0.85rem; }
        .plesk-desc { font-size: 0.7rem; color: var(--text-muted); }
        .plesk-header-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: linear-gradient(135deg, #52c4c0, #3a8f8c);
            border-radius: 12px;
            padding: 1rem 1.5rem;
            margin-bottom: 1.5rem;
        }
        .plesk-logo-link {
            display: flex;
            align-items: center;
            text-decoration: none;
            color: white;
            opacity: 0.9;
            transition: opacity 0.2s;
        }
        .plesk-logo-link:hover { opacity: 1; }
        .plesk-section-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text);
            margin: 1.5rem 0 0.75rem 0;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border);
        }
        .plesk-section-title svg { opacity: 0.6; }
        .plesk-grid { margin-bottom: 0.5rem; }
        /* Tools Section */
        .tools-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }
        .tool-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
        }
        .tool-card h3 { font-size: 0.95rem; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
        .tool-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
        .tool-card .btn { width: 100%; justify-content: center; }
        /* API Section */
        .api-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1rem;
        }
        .api-card h3 { font-size: 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
        .api-card .description { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
        .api-feature { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.8rem; }
        .api-feature svg { color: var(--success); flex-shrink: 0; margin-top: 2px; }
        .code-block {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 1rem;
            font-family: monospace;
            font-size: 0.75rem;
            overflow-x: auto;
            margin-top: 1rem;
        }
        /* IONOS */
        .ionos-dashboard {
            background: linear-gradient(135deg, rgba(0,58,112,0.15), rgba(0,156,222,0.1));
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        .ionos-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .ionos-header h3 { font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
        .ionos-status { font-size: 0.75rem; padding: 0.25rem 0.75rem; border-radius: 20px; background: rgba(255,255,255,0.1); }
        .ionos-status.connected { background: rgba(34,197,94,0.2); color: var(--success); }
        .ionos-status.error { background: rgba(239,68,68,0.2); color: var(--error); }
        .ionos-alerts { margin-top: 1rem; }
        .ionos-alert {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            background: var(--bg);
            border-radius: 8px;
            margin-bottom: 0.5rem;
            font-size: 0.85rem;
        }
        .ionos-alert.urgent { border-left: 3px solid var(--error); }
        .ionos-alert.warning { border-left: 3px solid var(--warning); }
        .ionos-alert-icon { font-size: 1.2rem; }
        .ionos-alert-days { font-weight: 700; color: var(--warning); }
        .ionos-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }
        .ionos-table th, .ionos-table td {
            text-align: left;
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .ionos-table th { color: var(--text-muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; }
        .ionos-table tr:hover { background: var(--card-hover); }
        .ionos-badge {
            display: inline-block;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 500;
        }
        .ionos-badge.active { background: rgba(34,197,94,0.2); color: var(--success); }
        .ionos-badge.expiring { background: rgba(245,158,11,0.2); color: var(--warning); }
        .ionos-badge.expired { background: rgba(239,68,68,0.2); color: var(--error); }
        .ionos-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border);
            padding-bottom: 0.75rem;
        }
        .ionos-tab {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85rem;
            color: var(--text-muted);
            transition: all 0.2s;
        }
        .ionos-tab:hover { background: var(--card-bg); color: var(--text); }
        .ionos-tab.active { background: linear-gradient(135deg, #003A70, #009CDE); color: white; }
        .ionos-section { display: none; }
        .ionos-section.active { display: block; }
        .ionos-dns-record {
            display: grid;
            grid-template-columns: 120px 1fr 80px 60px;
            gap: 0.75rem;
            padding: 0.75rem;
            background: var(--bg);
            border-radius: 8px;
            margin-bottom: 0.5rem;
            font-size: 0.85rem;
            align-items: center;
        }
        .ionos-dns-type {
            font-family: monospace;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .ionos-dns-type.A { background: rgba(59,130,246,0.2); color: var(--info); }
        .ionos-dns-type.CNAME { background: rgba(147,51,234,0.2); color: #9333ea; }
        .ionos-dns-type.MX { background: rgba(236,72,153,0.2); color: #ec4899; }
        .ionos-dns-type.TXT { background: rgba(245,158,11,0.2); color: var(--warning); }
        .ionos-dns-type.NS { background: rgba(34,197,94,0.2); color: var(--success); }
        .ionos-dns-content { font-family: monospace; color: var(--text-muted); word-break: break-all; }
        /* Wiki */
        .wiki-container {
            display: grid;
            grid-template-columns: 280px 1fr;
            gap: 1.5rem;
            height: calc(100vh - 120px);
        }
        .wiki-sidebar {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .wiki-search {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .wiki-search input {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text);
            font-size: 0.85rem;
            outline: none;
        }
        .wiki-stats {
            padding: 0.5rem 0.75rem;
            font-size: 0.7rem;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 1rem;
        }
        .wiki-tree {
            flex: 1;
            overflow-y: auto;
            padding: 0.5rem;
        }
        .wiki-folder, .wiki-file {
            padding: 0.4rem 0.6rem;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.8rem;
            color: var(--text-muted);
            transition: all 0.15s;
        }
        .wiki-folder:hover, .wiki-file:hover {
            background: var(--bg);
            color: var(--text);
        }
        .wiki-file.active {
            background: linear-gradient(135deg, #FF6B35, #F7931E);
            color: white;
        }
        .wiki-folder-icon { color: #F7931E; }
        .wiki-file-icon { color: var(--text-muted); }
        .wiki-children {
            margin-left: 1rem;
            border-left: 1px solid var(--border);
            padding-left: 0.5rem;
            display: none;
        }
        .wiki-children.open { display: block; }
        .wiki-content {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .wiki-breadcrumb {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
            font-size: 0.75rem;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .wiki-breadcrumb span { color: var(--text); }
        .wiki-article {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem;
        }
        .wiki-welcome {
            text-align: center;
            padding: 3rem;
            color: var(--text-muted);
        }
        .wiki-welcome h2 { color: var(--text); margin: 1rem 0 0.5rem; }
        .wiki-article h1 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
        .wiki-article h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; color: #FF6B35; }
        .wiki-article h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; color: var(--text); }
        .wiki-article p { margin-bottom: 0.75rem; line-height: 1.7; color: var(--text-muted); }
        .wiki-article ul, .wiki-article ol { margin: 0.75rem 0; padding-left: 1.5rem; color: var(--text-muted); }
        .wiki-article li { margin-bottom: 0.4rem; }
        .wiki-article code {
            background: var(--bg);
            padding: 0.15rem 0.4rem;
            border-radius: 4px;
            font-family: monospace;
            font-size: 0.85rem;
            color: #F7931E;
        }
        .wiki-article pre {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem;
            overflow-x: auto;
            margin: 1rem 0;
        }
        .wiki-article pre code {
            background: none;
            padding: 0;
            color: var(--text);
        }
        .wiki-article table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            font-size: 0.85rem;
        }
        .wiki-article th, .wiki-article td {
            border: 1px solid var(--border);
            padding: 0.5rem 0.75rem;
            text-align: left;
        }
        .wiki-article th {
            background: var(--bg);
            color: var(--text);
        }
        .wiki-article blockquote {
            border-left: 3px solid #FF6B35;
            margin: 1rem 0;
            padding: 0.5rem 1rem;
            background: rgba(255,107,53,0.1);
            color: var(--text);
        }
        .wiki-article a { color: #FF6B35; text-decoration: none; }
        .wiki-article a:hover { text-decoration: underline; }
        .wiki-article hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
        .wiki-search-results {
            padding: 0.5rem;
        }
        .wiki-search-result {
            padding: 0.75rem;
            border-radius: 8px;
            cursor: pointer;
            margin-bottom: 0.5rem;
            background: var(--bg);
        }
        .wiki-search-result:hover { background: rgba(255,107,53,0.1); }
        .wiki-search-result h4 { font-size: 0.85rem; color: var(--text); margin-bottom: 0.25rem; }
        .wiki-search-result p { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
        @media (max-width: 1024px) {
            .wiki-container { grid-template-columns: 1fr; height: auto; }
            .wiki-sidebar { max-height: 300px; }
        }

        /* Toast */
        .toast {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            background: var(--card-bg);
            border: 1px solid var(--primary);
            padding: 1rem 1.5rem;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transform: translateY(100px);
            opacity: 0;
            transition: all 0.3s;
            z-index: 1000;
        }
        .toast.show { transform: translateY(0); opacity: 1; }
        /* Plesk Dashboard */
        .plesk-dashboard {
            background: linear-gradient(135deg, rgba(42,185,173,0.1), rgba(0,0,101,0.1));
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
        .plesk-api-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .plesk-api-header h3 { margin: 0; font-size: 1rem; }
        .plesk-api-actions { display: flex; align-items: center; gap: 1rem; }
        .plesk-api-status {
            font-size: 0.75rem;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            background: var(--card-bg);
        }
        .plesk-api-status.connected { background: rgba(34,197,94,0.2); color: var(--success); }
        .plesk-api-status.error { background: rgba(239,68,68,0.2); color: var(--error); }
        .plesk-server-info {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
            font-size: 0.8rem;
        }
        .server-info-item { display: flex; gap: 0.5rem; }
        .server-info-item span:first-child { color: var(--text-muted); }
        .plesk-error {
            background: rgba(239,68,68,0.1);
            border: 1px solid var(--error);
            border-radius: 8px;
            padding: 1rem;
            margin-top: 1rem;
            font-size: 0.85rem;
        }
        .plesk-error a { color: var(--primary); }
        /* Dashboard Improved */
        .dashboard-grid {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }
        @media (max-width: 900px) {
            .dashboard-grid { grid-template-columns: 1fr; }
        }
        .dashboard-main { display: flex; flex-direction: column; gap: 1.5rem; }
        .quick-actions {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
        }
        @media (max-width: 700px) {
            .quick-actions { grid-template-columns: repeat(2, 1fr); }
        }
        .quick-action {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            color: var(--text);
        }
        .quick-action:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(42,185,173,0.15); }
        .quick-action-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.75rem;
        }
        .quick-action-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
        .quick-action-desc { font-size: 0.7rem; color: var(--text-muted); }
        /* Donut Chart */
        .chart-container {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
        }
        .chart-header { font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
        .donut-wrapper {
            position: relative;
            width: 180px;
            height: 180px;
            margin: 0 auto 1rem;
        }
        .donut-chart {
            width: 100%;
            height: 100%;
            transform: rotate(-90deg);
        }
        .donut-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }
        .donut-center-number { font-size: 2rem; font-weight: 700; line-height: 1; }
        .donut-center-label { font-size: 0.7rem; color: var(--text-muted); }
        .chart-legend { display: flex; flex-direction: column; gap: 0.5rem; }
        .legend-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.8rem;
        }
        .legend-item:hover { background: var(--card-hover); }
        .legend-left { display: flex; align-items: center; gap: 0.5rem; }
        .legend-dot { width: 12px; height: 12px; border-radius: 3px; }
        .legend-count { font-weight: 600; }
        /* Status Cards */
        .status-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.75rem;
        }
        @media (max-width: 600px) {
            .status-cards { grid-template-columns: 1fr; }
        }
        .status-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            text-align: center;
        }
        .status-card-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.75rem;
        }
        .status-card-value { font-size: 1.5rem; font-weight: 700; }
        .status-card-label { font-size: 0.7rem; color: var(--text-muted); }
        .status-card-bar {
            height: 4px;
            background: var(--border);
            border-radius: 2px;
            margin-top: 0.75rem;
            overflow: hidden;
        }
        .status-card-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
        /* Section headers */
        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
        }
        .section-title { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
        .section-link { font-size: 0.75rem; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 0.25rem; }
        .section-link:hover { text-decoration: underline; }
        /* Responsive */
        @media (max-width: 1400px) {
            .page { max-width: 100%; padding: 0 0.5rem; }
        }
        @media (max-width: 1024px) {
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                box-shadow: none;
            }
            .sidebar.open {
                transform: translateX(0);
                box-shadow: 4px 0 20px rgba(0,0,0,0.3);
            }
            .sidebar { height: 100dvh; }
            /* min-height:0 es OBLIGATORIO: sin el, un flex-child con overflow no encoge bajo
               su contenido y no scrollea (la sidebar movil no llegaba a Sistema/Seguridad). */
            .sidebar-nav { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
            .main { margin-left: 0; }
            .page { padding: 0; }
            .sites-grid { grid-template-columns: 1fr; }
            .site-thumbnail { height: 220px; }
            #menu-btn { display: flex !important; }
            .search-hint { display: none; }
            .topbar-actions .btn span { display: none; }
            .topbar-actions .btn { padding: 0.5rem; min-width: 40px; justify-content: center; }
            .welcome-banner { padding: 1rem; }
            .welcome-content h2 { font-size: 1.1rem; }
            .live-clock .time { font-size: 1.5rem; }
            .plesk-grid { grid-template-columns: repeat(2, 1fr); }
            .tools-grid { grid-template-columns: 1fr; }
        }

        /* Tablets */
        @media (max-width: 768px) {
            .topbar { padding: 0.5rem 1rem; }
            .topbar-title { font-size: 0.9rem; }
            .content { padding: 1rem; }
            .cards-grid { grid-template-columns: 1fr; }
            .stats-row { grid-template-columns: repeat(2, 1fr); }
            .quick-actions { grid-template-columns: repeat(2, 1fr); }
            .site-card { margin-bottom: 0; }
            .site-actions { flex-wrap: wrap; }
            .action-btn { flex: 1 1 45%; }
            .plesk-grid { grid-template-columns: 1fr; }
            .dashboard-favorites-grid { grid-template-columns: 1fr !important; }
            .ssl-monitor { padding: 1rem; }
        }

        /* Mobile small */
        @media (max-width: 480px) {
            .content { padding: 0.75rem; }
            .topbar-actions { gap: 0.25rem; }
            .topbar-actions .btn { padding: 0.4rem; min-width: 36px; }
            .topbar-actions .btn svg { width: 12px; height: 12px; }
            #theme-btn, .auto-refresh-indicator { display: none; }
            .welcome-banner {
                flex-direction: column;
                text-align: center;
                gap: 0.75rem;
                padding: 0.75rem;
            }
            .welcome-right {
                flex-direction: row;
                justify-content: center;
                gap: 1rem;
            }
            .welcome-content h2 { font-size: 1rem; }
            .welcome-content p { font-size: 0.75rem; }
            .live-clock .time { font-size: 1.2rem; }
            .live-clock .date { font-size: 0.7rem; }
            .server-badge { padding: 0.35rem 0.6rem; }
            .server-badge span { font-size: 0.65rem; }
            .quick-actions { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
            .quick-action { padding: 0.75rem; }
            .quick-action-icon { width: 40px; height: 40px; margin-bottom: 0.5rem; }
            .quick-action-icon svg { width: 20px; height: 20px; }
            .quick-action-title { font-size: 0.75rem; }
            .quick-action-desc { font-size: 0.65rem; }
            .stats-row { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
            .stat-card { padding: 0.75rem; }
            .stat-number { font-size: 1.25rem; }
            .stat-label { font-size: 0.6rem; }
            .status-cards { grid-template-columns: 1fr; gap: 0.5rem; }
            .section-header { margin-bottom: 0.75rem; }
            .section-title { font-size: 0.85rem; }
            .health-bar {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
                padding: 0.75rem;
            }
            .health-stats { flex-wrap: wrap; gap: 0.5rem; }
            .health-progress { width: 100%; min-width: unset; }
            .site-thumbnail { height: 180px; }
            .site-header { padding: 0.75rem; }
            .site-icon { width: 36px; height: 36px; }
            .site-name { font-size: 0.85rem; }
            .site-url { font-size: 0.7rem; }
            .site-path { font-size: 0.65rem; padding: 0.4rem 0.75rem; }
            .site-actions { padding: 0.5rem 0.75rem; gap: 0.35rem; }
            .action-btn {
                flex: 1 1 30%;
                padding: 0.4rem;
                font-size: 0.65rem;
            }
            .action-btn svg { width: 10px; height: 10px; }
            .tips-card { padding: 0.75rem; margin-bottom: 1rem; }
            .tips-text { font-size: 0.8rem; }
            .chart-container { padding: 1rem; }
            .donut-wrapper { width: 150px; height: 150px; }
            .donut-center-number { font-size: 1.5rem; }
            .legend-item { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
            .sidebar { width: 80vw; max-width: 280px; }
            .sidebar-header { padding: 0.75rem; }
            .sidebar-logo h1 { font-size: 0.95rem; }
            .sidebar-logo svg { width: 32px; height: 32px; }
            .nav-section { margin-bottom: 0.5rem; }
            .nav-section-title { padding: 0.35rem 0.5rem; font-size: 0.6rem; }
            .nav-item { padding: 0.5rem 0.6rem; font-size: 0.78rem; gap: 0.5rem; }
            .nav-item svg { width: 16px; height: 16px; }
            .sidebar-footer { font-size: 0.6rem; padding: 0.5rem 0.75rem; }
            .server-status { gap: 0.35rem; margin-bottom: 0.25rem; }
        }
        @media (min-width: 1400px) {
            /* Even larger thumbnails on wide screens */
            .site-thumbnail { height: 240px; }
            .sites-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
        }

        /* ==========================================
           NEW IMPROVEMENTS - CMD+K, Favorites, etc.
           ========================================== */

        /* Welcome Banner */
        .welcome-banner {
            background: linear-gradient(135deg, rgba(42,185,173,0.15) 0%, rgba(0,0,101,0.15) 100%);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            overflow: hidden;
        }
        .welcome-banner::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 300px;
            height: 300px;
            background: radial-gradient(circle, rgba(42,185,173,0.1) 0%, transparent 70%);
            pointer-events: none;
        }
        .welcome-content h2 {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .welcome-content p {
            color: var(--text-muted);
            font-size: 0.85rem;
        }
        .welcome-right {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }
        .live-clock {
            text-align: right;
        }
        .live-clock .time {
            font-size: 2rem;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
            color: var(--text);
            line-height: 1;
        }
        .live-clock .date {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }
        .server-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--card-bg);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            border: 1px solid var(--border);
        }
        .server-badge .pulse {
            width: 10px;
            height: 10px;
            background: var(--success);
            border-radius: 50%;
            animation: serverPulse 2s infinite;
        }
        @keyframes serverPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
            50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
        }
        .server-badge span {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--success);
        }
        @media (max-width: 700px) {
            .welcome-banner { flex-direction: column; text-align: center; gap: 1rem; }
            .welcome-right { flex-direction: column; }
            .live-clock { text-align: center; }
        }

        /* Server Info Card */
        .server-info-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .server-info-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.85rem;
            margin-bottom: 0.75rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .server-info-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }
        .server-info-item {
            display: flex;
            flex-direction: column;
            padding: 0.5rem;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
        }
        .server-info-label {
            font-size: 0.65rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .server-info-value {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text);
            font-family: 'SF Mono', 'Monaco', monospace;
        }

        /* Animated Counter */
        .animated-counter {
            display: inline-block;
            transition: transform 0.3s ease;
        }
        .animated-counter.counting {
            animation: counterBounce 0.5s ease;
        }
        @keyframes counterBounce {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        /* Recent Activity */
        .activity-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
        }
        .activity-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .activity-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.85rem;
        }
        .activity-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-height: 200px;
            overflow-y: auto;
        }
        .activity-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem;
            border-radius: 8px;
            transition: background 0.2s;
        }
        .activity-item:hover {
            background: var(--card-hover);
        }
        .activity-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .activity-info {
            flex: 1;
            min-width: 0;
        }
        .activity-name {
            font-size: 0.8rem;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .activity-desc {
            font-size: 0.7rem;
            color: var(--text-muted);
        }
        .activity-time {
            font-size: 0.65rem;
            color: var(--text-muted);
            white-space: nowrap;
        }

        /* Uptime Monitor */
        .uptime-grid {
            display: flex;
            gap: 2px;
            flex-wrap: wrap;
            margin-top: 0.5rem;
        }
        .uptime-bar {
            width: 8px;
            height: 24px;
            border-radius: 2px;
            background: var(--success);
            transition: all 0.2s;
        }
        .uptime-bar.warning { background: var(--warning); }
        .uptime-bar.error { background: var(--error); }
        .uptime-bar:hover {
            transform: scaleY(1.2);
        }
        .uptime-stats {
            display: flex;
            justify-content: space-between;
            margin-top: 0.75rem;
            font-size: 0.7rem;
            color: var(--text-muted);
        }
        .uptime-percent {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--success);
        }

        /* Enhanced Quick Actions */
        .quick-action {
            position: relative;
            overflow: hidden;
        }
        .quick-action::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
            transition: left 0.5s ease;
        }
        .quick-action:hover::before {
            left: 100%;
        }
        .quick-action-badge {
            position: absolute;
            top: 8px;
            right: 8px;
            background: var(--primary);
            color: white;
            font-size: 0.6rem;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 600;
        }

        /* 1. Click to Copy */
        .copyable {
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            border-radius: 4px;
            padding: 2px 4px;
            margin: -2px -4px;
        }
        .copyable:hover {
            background: rgba(42,185,173,0.15);
        }
        .copyable::after {
            content: 'Click para copiar';
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: var(--card-bg);
            border: 1px solid var(--border);
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 0.65rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
            z-index: 100;
        }
        .copyable:hover::after {
            opacity: 1;
        }
        .copyable.copied::after {
            content: 'Copiado!';
            background: var(--success);
            color: white;
            border-color: var(--success);
        }

        /* 2. Dashboard Favorites */
        .dashboard-favorites {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-left: 3px solid #f59e0b;
            border-radius: 12px;
            padding: 1rem 1.15rem;
            margin-bottom: 1.25rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.15);
        }
        .dashboard-favorites-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.85rem;
            cursor: pointer;
            user-select: none;
        }
        .dashboard-favorites.collapsed .dashboard-favorites-header { margin-bottom: 0; }
        .dashboard-favorites-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 700;
            font-size: 0.95rem;
            letter-spacing: 0.2px;
        }
        .dashboard-favorites-chevron {
            transition: transform 0.2s ease;
            opacity: 0.6;
            margin-right: 0.1rem;
        }
        .dashboard-favorites.collapsed .dashboard-favorites-chevron { transform: rotate(-90deg); }
        .dashboard-favorites-count {
            background: rgba(245,158,11,0.15);
            color: #f59e0b;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.05rem 0.45rem;
            border-radius: 999px;
            min-width: 1.1rem;
            text-align: center;
        }
        .dashboard-favorites.collapsed .dashboard-favorites-grid { display: none; }
        .dashboard-favorites-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 0.5rem;
        }
        .dashboard-fav-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            color: var(--text);
        }
        .dashboard-fav-item:hover {
            background: var(--primary);
            color: white;
        }
        .dashboard-fav-icon {
            width: 24px;
            height: 24px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-weight: 700;
        }
        .dashboard-fav-name {
            font-size: 0.75rem;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .dashboard-favorites-empty {
            color: var(--text-muted);
            font-size: 0.8rem;
            text-align: center;
            padding: 1rem;
        }
        /* Speed-dial: miniatura mshots (igual que renderSiteCard) */
        .dashboard-fav-speed {
            display: block;
            border-radius: 10px;
            overflow: hidden;
            background: rgba(0,0,0,0.2);
            border: 1px solid var(--border);
            text-decoration: none;
            color: var(--text);
            transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
        }
        .dashboard-fav-speed:hover {
            transform: translateY(-2px);
            border-color: var(--primary);
            box-shadow: 0 4px 12px rgba(42,185,173,0.18);
        }
        .dashboard-fav-thumb {
            position: relative;
            width: 100%;
            aspect-ratio: 4 / 3;
            background: rgba(0,0,0,0.25);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        /* Placeholder propio (no depende de .site-icon ni del orden de cascada) */
        .dashboard-fav-thumb.is-placeholder { background: rgba(0,0,0,0.35); }
        .dashboard-fav-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .dashboard-fav-speed .dashboard-fav-name {
            display: block;
            padding: 0.4rem 0.55rem;
        }
        /* Buscador web centrado (start page) */
        .web-search-bar {
            max-width: 640px;
            margin-left: auto;
            margin-right: auto;
            flex-wrap: wrap;
        }
        .web-search-bar #web-search-input { min-width: 140px; }

        /* 3. Keyboard Shortcuts Modal */
        .shortcuts-modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(4px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .shortcuts-modal.open { display: flex; }
        .shortcuts-content {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 1.5rem;
            max-width: 400px;
            width: 90%;
            animation: cmdPaletteIn 0.2s ease;
        }
        .shortcuts-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .shortcuts-title {
            font-weight: 600;
            font-size: 1rem;
        }
        .shortcuts-close {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 0.25rem;
        }
        .shortcuts-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .shortcut-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0;
        }
        .shortcut-keys {
            display: flex;
            gap: 0.25rem;
        }
        .shortcut-key {
            background: rgba(0,0,0,0.3);
            border: 1px solid var(--border);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-family: monospace;
            font-weight: 600;
        }
        .shortcut-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        /* 4. Tips Card */
        .tips-card {
            background: linear-gradient(135deg, rgba(147,51,234,0.1), rgba(59,130,246,0.1));
            border: 1px solid rgba(147,51,234,0.3);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .tips-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .tips-icon {
            width: 28px;
            height: 28px;
            background: rgba(147,51,234,0.2);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .tips-label {
            font-size: 0.7rem;
            color: #9333ea;
            font-weight: 600;
            text-transform: uppercase;
        }
        .tips-text {
            font-size: 0.85rem;
            line-height: 1.4;
        }
        .tips-nav {
            display: flex;
            justify-content: flex-end;
            margin-top: 0.75rem;
            gap: 0.5rem;
        }
        .tips-nav button {
            background: rgba(147,51,234,0.2);
            border: none;
            color: var(--text);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.7rem;
        }
        .tips-nav button:hover {
            background: rgba(147,51,234,0.4);
        }

        /* 5. Quick Links Editable */
        .quick-links-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
        }
        .quick-links-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        .quick-links-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.85rem;
        }
        .quick-links-edit {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        .quick-links-edit:hover { color: var(--primary); }
        .quick-links-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }
        .quick-link-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            color: var(--text);
            font-size: 0.75rem;
        }
        .quick-link-item:hover {
            background: var(--card-hover);
            border-color: var(--primary);
        }
        .quick-link-icon {
            font-size: 1rem;
        }

        /* 6. Construction Mode */
        .construction-modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.8);
            backdrop-filter: blur(4px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        .construction-modal.open { display: flex; }
        .construction-content {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 1.5rem;
            max-width: 450px;
            width: 100%;
            animation: cmdPaletteIn 0.2s ease;
        }
        .construction-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.25rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        .construction-header-icon {
            width: 48px;
            height: 48px;
            background: rgba(245,158,11,0.2);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }
        .construction-header-text h3 {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        .construction-header-text p {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        .construction-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        .construction-field label {
            display: block;
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .construction-field input,
        .construction-field textarea {
            width: 100%;
            padding: 0.75rem;
            background: rgba(0,0,0,0.3);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            font-size: 0.9rem;
            font-family: inherit;
        }
        .construction-field textarea {
            min-height: 80px;
            resize: vertical;
        }
        .construction-field input:focus,
        .construction-field textarea:focus {
            outline: none;
            border-color: var(--primary);
        }
        .construction-actions {
            display: flex;
            gap: 0.75rem;
            margin-top: 0.5rem;
        }
        .construction-actions button {
            flex: 1;
            padding: 0.75rem;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .construction-btn-cancel {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text);
        }
        .construction-btn-cancel:hover {
            background: var(--card-hover);
        }
        .construction-btn-enable {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            border: none;
            color: white;
        }
        .construction-btn-enable:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(245,158,11,0.3);
        }
        .construction-btn-disable {
            background: linear-gradient(135deg, #22c55e, #16a34a);
            border: none;
            color: white;
        }

        /* Construction Badge on Site Card */
        .site-construction-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 4px;
            z-index: 10;
            box-shadow: 0 2px 8px rgba(245,158,11,0.4);
        }
        .site-thumbnail { position: relative; }

        /* Construction Button in Actions */
        .action-btn.construction {
            background: rgba(245,158,11,0.15);
            border-color: rgba(245,158,11,0.3);
            color: #f59e0b;
        }
        .action-btn.construction:hover {
            background: rgba(245,158,11,0.25);
        }
        .action-btn.construction.active {
            background: #f59e0b;
            color: white;
        }

        /* Construction Modal Form Styles */
        .construction-field {
            margin-bottom: 1rem;
        }
        .construction-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            margin-bottom: 1rem;
            font-weight: 600;
        }
        .construction-status.enabled {
            background: rgba(34,197,94,0.15);
            color: #22c55e;
            border: 1px solid rgba(34,197,94,0.3);
        }
        .btn-secondary {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text);
            padding: 0.75rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }
        .btn-secondary:hover {
            background: var(--card-hover);
        }
        .btn-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            border: none;
            color: white;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }
        .btn-danger:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(239,68,68,0.3);
        }
        .btn-construction {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            border: none;
            color: white;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }
        .btn-construction:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(245,158,11,0.3);
        }
        .btn-construction:disabled,
        .btn-danger:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        /* ==========================================
           MODULES SECTION STYLES
           ========================================== */

        /* Modules badge on Perfex site cards */
        .site-modules-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            background: linear-gradient(135deg, rgba(147,51,234,0.2), rgba(147,51,234,0.1));
            border: 1px solid rgba(147,51,234,0.3);
            border-radius: 6px;
            font-size: 0.7rem;
            color: #9333ea;
            cursor: pointer;
            transition: all 0.2s;
        }
        .site-modules-badge:hover {
            background: rgba(147,51,234,0.3);
            transform: translateY(-1px);
        }
        .site-modules-badge svg {
            width: 12px;
            height: 12px;
        }

        /* Site path with server path display */
        .site-path {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.75rem;
            background: rgba(0,0,0,0.2);
            border-radius: 6px;
            margin: 0.5rem 0;
            font-family: 'SF Mono', Monaco, monospace;
            font-size: 0.7rem;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            gap: 0.5rem;
        }
        .site-path:hover {
            background: rgba(42,185,173,0.15);
            color: var(--primary);
        }
        .site-path span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* Modules Modal */
        .modules-modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.8);
            backdrop-filter: blur(8px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }
        .modules-modal.open { display: flex; }
        .modules-content {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 16px;
            width: 100%;
            max-width: 900px;
            max-height: 85vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .modules-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border);
        }
        .modules-header-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .modules-header-icon {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, rgba(147,51,234,0.2), rgba(147,51,234,0.1));
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }
        .modules-header-text h3 {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
        }
        .modules-header-text p {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        .modules-close {
            width: 32px;
            height: 32px;
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .modules-close:hover {
            background: rgba(239,68,68,0.2);
            color: #ef4444;
        }

        /* Modules tabs/selector */
        .modules-selector {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-bottom: 1px solid var(--border);
            overflow-x: auto;
        }
        .modules-selector select {
            background: var(--bg);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.85rem;
            cursor: pointer;
            min-width: 200px;
        }
        .modules-selector-info {
            margin-left: auto;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        /* Modules list */
        .modules-list {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }
        .modules-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 0.75rem;
        }
        .module-card {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            transition: all 0.2s;
        }
        .module-card:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
        }
        .module-card.salescloud {
            border-color: rgba(147,51,234,0.4);
            background: linear-gradient(135deg, rgba(147,51,234,0.05), transparent);
        }
        .module-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }
        .module-name {
            font-weight: 600;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .module-sc-badge {
            background: linear-gradient(135deg, #9333ea, #7c3aed);
            color: white;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.6rem;
            font-weight: 700;
        }
        .module-version {
            font-size: 0.7rem;
            color: var(--text-muted);
            background: var(--card-bg);
            padding: 2px 8px;
            border-radius: 4px;
        }
        .module-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
            line-height: 1.4;
        }
        .module-stats {
            display: flex;
            gap: 1rem;
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }
        .module-stats span {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .module-actions {
            display: flex;
            gap: 0.5rem;
        }
        .module-btn {
            flex: 1;
            padding: 0.5rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }
        .module-btn-download {
            background: linear-gradient(135deg, var(--primary), #1a9088);
            color: white;
        }
        .module-btn-download:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(42,185,173,0.3);
        }
        .module-btn-info {
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--border);
            color: var(--text);
        }
        .module-btn-info:hover {
            background: rgba(255,255,255,0.1);
        }

        /* SalesCloud modules section */
        .salescloud-modules-section {
            padding: 0.75rem 1.5rem;
            background: linear-gradient(135deg, rgba(147,51,234,0.1), rgba(147,51,234,0.05));
            border-bottom: 1px solid rgba(147,51,234,0.2);
        }
        .salescloud-modules-title {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #9333ea;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .salescloud-modules-grid {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .sc-module-chip {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--card-bg);
            border: 1px solid rgba(147,51,234,0.3);
            border-radius: 20px;
            font-size: 0.75rem;
            color: var(--text);
            cursor: pointer;
            transition: all 0.2s;
        }
        .sc-module-chip:hover {
            background: rgba(147,51,234,0.2);
            border-color: #9333ea;
        }
        .sc-module-chip .status {
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }
        .sc-module-chip .status.production { background: #22c55e; }
        .sc-module-chip .status.active { background: #3b82f6; }
        .sc-module-chip .status.development { background: #f59e0b; }

        /* Modules Comparator */
        .comparator-selectors {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 1.5rem;
            background: var(--bg);
            border-bottom: 1px solid var(--border);
        }
        .comparator-select-group {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .comparator-select-group label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .comparator-select-group select {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 0.75rem;
            border-radius: 8px;
            font-size: 0.9rem;
        }
        .comparator-vs {
            font-weight: 700;
            color: var(--primary);
            font-size: 1.2rem;
            padding: 0 1rem;
        }
        .comparator-results {
            padding: 1.5rem;
            min-height: 300px;
            max-height: 400px;
            overflow-y: auto;
        }
        .comparator-placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            padding: 3rem;
            color: var(--text-muted);
            text-align: center;
        }
        .comparator-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 1rem;
        }
        .comparator-column {
            background: var(--bg);
            border-radius: 8px;
            padding: 1rem;
        }
        .comparator-column-title {
            font-weight: 600;
            font-size: 0.85rem;
            padding-bottom: 0.75rem;
            margin-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .comparator-column-title.only-a { color: #ef4444; }
        .comparator-column-title.both { color: #22c55e; }
        .comparator-column-title.only-b { color: #3b82f6; }
        .comparator-module-item {
            padding: 0.5rem 0.75rem;
            font-size: 0.8rem;
            border-radius: 4px;
            margin-bottom: 0.5rem;
            background: rgba(255,255,255,0.03);
            border-left: 3px solid;
        }
        .comparator-module-item.only-a { border-left-color: #ef4444; }
        .comparator-module-item.both { border-left-color: #22c55e; }
        .comparator-module-item.only-b { border-left-color: #3b82f6; }
        .comparator-module-version {
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }
        .comparator-stats {
            display: flex;
            gap: 1.5rem;
            margin-bottom: 1rem;
            padding: 0.75rem 1rem;
            background: var(--card);
            border-radius: 8px;
        }
        .comparator-stat {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
        }
        .comparator-stat .count {
            font-weight: 700;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            min-width: 24px;
            text-align: center;
        }
        .comparator-stat .count.only-a { background: rgba(239,68,68,0.2); color: #ef4444; }
        .comparator-stat .count.both { background: rgba(34,197,94,0.2); color: #22c55e; }
        .comparator-stat .count.only-b { background: rgba(59,130,246,0.2); color: #3b82f6; }

        /* ==========================================
           VIEW TOGGLE (Grid/Table)
           ========================================== */
        .view-toggle {
            display: flex;
            gap: 0.25rem;
            background: var(--bg);
            padding: 0.25rem;
            border-radius: 8px;
            border: 1px solid var(--border);
        }
        .view-toggle-btn {
            padding: 0.5rem 0.75rem;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 6px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.8rem;
            transition: all 0.2s;
        }
        .view-toggle-btn:hover {
            color: var(--text);
            background: rgba(255,255,255,0.05);
        }
        .view-toggle-btn.active {
            background: var(--primary);
            color: white;
        }
        .view-btn {
            padding: 0.5rem;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .view-btn:hover {
            color: var(--text);
            background: rgba(255,255,255,0.05);
        }
        .view-btn.active {
            background: var(--primary);
            color: white;
        }

        /* Sites Toolbar */
        .sites-toolbar {
            display: flex;
            gap: 1rem;
            align-items: center;
            flex-wrap: wrap;
            margin-bottom: 1.5rem;
        }
        .sites-toolbar .search-box {
            flex: 1;
            min-width: 200px;
            margin-bottom: 0;
        }
        .sites-filters {
            display: flex;
            gap: 0.5rem;
        }
        .sites-filters select {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            font-size: 0.85rem;
            cursor: pointer;
            min-width: 140px;
        }
        .sites-filters select:focus {
            outline: none;
            border-color: var(--primary);
        }

        /* Bulk Actions */
        .bulk-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: var(--card);
            border-radius: 8px;
            margin-top: 1rem;
            border: 1px solid var(--primary);
        }
        .bulk-actions span {
            color: var(--primary);
            font-weight: 500;
        }
        .bulk-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: var(--bg);
            border: 1px solid var(--border);
            color: var(--text);
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s;
        }
        .bulk-btn:hover {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        /* Sites Table View */
        .sites-table-container {
            display: none;
            overflow-x: auto;
        }
        .sites-table-container.active {
            display: block;
        }
        .sites-grid-container.hidden {
            display: none;
        }
        .sites-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }
        .sites-table th {
            text-align: left;
            padding: 0.75rem 1rem;
            background: var(--bg);
            border-bottom: 1px solid var(--border);
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            white-space: nowrap;
            cursor: pointer;
            user-select: none;
        }
        .sites-table th:hover {
            color: var(--text);
        }
        .sites-table th.sorted {
            color: var(--primary);
        }
        .sites-table th .sort-icon {
            margin-left: 4px;
            opacity: 0.5;
        }
        .sites-table td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
            vertical-align: middle;
        }
        .sites-table tr:hover td {
            background: rgba(42,185,173,0.05);
        }
        .sites-table .site-name-cell {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        .sites-table .type-badge {
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
        }
        .sites-table .type-badge.perfex { background: rgba(40,167,69,0.15); color: var(--perfex); }
        .sites-table .type-badge.wordpress { background: rgba(33,117,155,0.15); color: var(--wordpress); }
        .sites-table .type-badge.laravel { background: rgba(255,45,32,0.15); color: var(--laravel); }
        .sites-table .type-badge.nextjs { background: rgba(107,114,128,0.15); color: #6b7280; }
        .sites-table .type-badge.html { background: rgba(227,76,38,0.15); color: var(--html); }
        .sites-table .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            display: inline-block;
        }
        .sites-table .status-dot.online { background: var(--success); }
        .sites-table .status-dot.offline { background: var(--error); }
        .sites-table .status-dot.unknown { background: var(--text-muted); }
        .sites-table .path-cell {
            font-family: 'SF Mono', Monaco, monospace;
            font-size: 0.75rem;
            color: var(--text-muted);
            max-width: 300px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .sites-table .actions-cell {
            display: flex;
            gap: 0.25rem;
        }
        .sites-table .action-btn-mini {
            padding: 0.25rem 0.5rem;
            font-size: 0.7rem;
            border-radius: 4px;
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--border);
            color: var(--text);
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .sites-table .action-btn-mini:hover {
            background: rgba(42,185,173,0.15);
            border-color: var(--primary);
        }
        .sites-table .action-btn-mini.primary {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        /* Bulk Actions Bar */
        .bulk-actions-bar {
            display: none;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem 1rem;
            background: linear-gradient(135deg, rgba(42,185,173,0.15), rgba(42,185,173,0.05));
            border: 1px solid rgba(42,185,173,0.3);
            border-radius: 10px;
            margin-bottom: 1rem;
        }
        .bulk-actions-bar.visible {
            display: flex;
        }
        .bulk-actions-bar .selected-count {
            font-weight: 600;
            color: var(--primary);
        }
        .bulk-actions-bar .bulk-btn {
            padding: 0.5rem 1rem;
            background: var(--primary);
            border: none;
            color: white;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .bulk-actions-bar .bulk-btn:hover {
            opacity: 0.9;
        }
        .bulk-actions-bar .bulk-btn.secondary {
            background: rgba(255,255,255,0.1);
            border: 1px solid var(--border);
        }

        /* Log Viewer Modal */
        .log-viewer-modal {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(8px);
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        .log-viewer-modal.open { display: flex; }
        .log-viewer-content {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 16px;
            width: 100%;
            max-width: 1100px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .log-viewer-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border);
        }
        .log-viewer-title {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 600;
        }
        .log-viewer-title span { font-size: 1.25rem; }
        .log-viewer-tabs {
            display: flex;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-bottom: 1px solid var(--border);
            overflow-x: auto;
        }
        .log-viewer-tab {
            padding: 0.5rem 1rem;
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-muted);
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .log-viewer-tab:hover {
            border-color: var(--primary);
            color: var(--text);
        }
        .log-viewer-tab.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        .log-viewer-body {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .log-viewer-output {
            flex: 1;
            overflow: auto;
            padding: 1rem;
            background: #0d0d12;
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            font-size: 0.75rem;
            line-height: 1.6;
            white-space: pre-wrap;
            word-break: break-all;
        }
        .log-viewer-output .log-line {
            padding: 2px 0;
        }
        .log-viewer-output .log-line.error {
            color: #ef4444;
            background: rgba(239,68,68,0.1);
        }
        .log-viewer-output .log-line.warning {
            color: #f59e0b;
        }
        .log-viewer-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 1.5rem;
            border-top: 1px solid var(--border);
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        /* Advanced Filters */
        .filters-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
        }
        .filter-select {
            padding: 0.5rem 1rem;
            background: var(--bg);
            border: 1px solid var(--border);
            color: var(--text);
            border-radius: 8px;
            font-size: 0.85rem;
            cursor: pointer;
        }
        .filter-select:focus {
            border-color: var(--primary);
            outline: none;
        }
        .filter-chip {
            padding: 0.4rem 0.75rem;
            background: rgba(42,185,173,0.15);
            border: 1px solid rgba(42,185,173,0.3);
            color: var(--primary);
            border-radius: 20px;
            font-size: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .filter-chip .remove {
            cursor: pointer;
            opacity: 0.7;
        }
        .filter-chip .remove:hover {
            opacity: 1;
        }

        /* Page Transitions */
        .page {
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        .page.active {
            opacity: 1;
            transform: translateY(0);
        }

        /* Command Palette (CMD+K) */
        .cmd-palette-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(4px);
            z-index: 2000;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding-top: 15vh;
        }
        .cmd-palette-overlay.open { display: flex; }
        .cmd-palette {
            width: 100%;
            max-width: 600px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 16px;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
            overflow: hidden;
            animation: cmdPaletteIn 0.2s ease;
        }
        @keyframes cmdPaletteIn {
            from { opacity: 0; transform: scale(0.95) translateY(-20px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }
        .cmd-palette-input {
            display: flex;
            align-items: center;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border);
            gap: 0.75rem;
        }
        .cmd-palette-input svg { color: var(--text-muted); flex-shrink: 0; }
        .cmd-palette-input input {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text);
            font-size: 1rem;
            outline: none;
        }
        .cmd-palette-input input::placeholder { color: var(--text-muted); }
        .cmd-palette-input kbd {
            font-size: 0.7rem;
            padding: 0.2rem 0.5rem;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--text-muted);
        }
        .cmd-palette-results {
            max-height: 400px;
            overflow-y: auto;
            padding: 0.5rem;
        }
        .cmd-palette-group {
            padding: 0.5rem 0.75rem 0.25rem;
            font-size: 0.65rem;
            text-transform: uppercase;
            color: var(--text-muted);
            letter-spacing: 0.05em;
        }
        .cmd-palette-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .cmd-palette-item:hover, .cmd-palette-item.selected {
            background: rgba(42,185,173,0.15);
        }
        .cmd-palette-item.selected {
            background: var(--primary);
            color: white;
        }
        .cmd-palette-item-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 600;
        }
        .cmd-palette-item-info { flex: 1; }
        .cmd-palette-item-title { font-weight: 500; font-size: 0.9rem; }
        .cmd-palette-item-subtitle { font-size: 0.75rem; color: var(--text-muted); }
        .cmd-palette-item.selected .cmd-palette-item-subtitle { color: rgba(255,255,255,0.7); }
        .cmd-palette-item-action {
            font-size: 0.7rem;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        .cmd-palette-empty {
            text-align: center;
            padding: 2rem;
            color: var(--text-muted);
        }
        .cmd-palette-footer {
            padding: 0.75rem 1rem;
            border-top: 1px solid var(--border);
            display: flex;
            gap: 1rem;
            font-size: 0.7rem;
            color: var(--text-muted);
        }
        .cmd-palette-footer span { display: flex; align-items: center; gap: 0.25rem; }
        .cmd-palette-footer kbd {
            font-size: 0.65rem;
            padding: 0.15rem 0.35rem;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 3px;
        }

        /* Favorites */
        .favorite-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.25rem;
            color: var(--text-muted);
            transition: all 0.2s;
        }
        .favorite-btn:hover { color: #f59e0b; transform: scale(1.1); }
        .favorite-btn.active { color: #f59e0b; }
        .favorite-btn.active svg { fill: #f59e0b; }
        .favorites-section {
            padding: 0.5rem 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .favorites-section.fav-section-collapsed #favorites-list-wrap {
            display: none;
        }
        .sidebar-customize-mode .sidebar-draggable-block {
            cursor: grab;
            outline: 1px dashed var(--border);
            outline-offset: -2px;
        }
        .sidebar-customize-mode .sidebar-draggable-block:active {
            cursor: grabbing;
        }
        .sidebar-customize-mode .sidebar-draggable-item {
            cursor: grab;
        }
        .sidebar-customize-mode .sidebar-draggable-item:hover {
            background: var(--card-hover);
        }
        .favorites-section-title {
            font-size: 0.65rem;
            text-transform: uppercase;
            color: #f59e0b;
            padding: 0.25rem 0;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        .favorite-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0.5rem;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            color: var(--text-muted);
            transition: all 0.15s;
        }
        .favorite-item:hover { background: var(--card-bg); color: var(--text); }
        .favorite-favicon, .dashboard-fav-favicon {
            width: 20px;
            height: 20px;
            border-radius: 4px;
            object-fit: contain;
            flex-shrink: 0;
        }
        .dashboard-fav-favicon {
            width: 24px;
            height: 24px;
        }

        /* Notification Badge */
        .nav-item .notification-badge {
            margin-left: auto;
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            background: var(--error);
            color: white;
            font-size: 0.6rem;
            font-weight: 600;
            border-radius: 9px;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: badgePulse 2s infinite;
        }
        @keyframes badgePulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
            50% { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
        }

        /* Loading Skeletons */
        .skeleton {
            background: linear-gradient(90deg, var(--card-bg) 25%, var(--card-hover) 50%, var(--card-bg) 75%);
            background-size: 200% 100%;
            animation: skeletonShimmer 1.5s infinite;
            border-radius: 6px;
        }
        @keyframes skeletonShimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .skeleton-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
        }
        .skeleton-thumb { height: 140px; }
        .skeleton-header { padding: 1rem; display: flex; gap: 0.75rem; }
        .skeleton-icon { width: 42px; height: 42px; border-radius: 10px; }
        .skeleton-text { flex: 1; }
        .skeleton-line { height: 12px; margin-bottom: 0.5rem; }
        .skeleton-line.short { width: 60%; }

        /* Auto-refresh indicator */
        .auto-refresh-indicator {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.7rem;
            color: var(--text-muted);
            padding: 0.35rem 0.7rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .auto-refresh-indicator:hover { border-color: var(--primary); }
        .auto-refresh-indicator.active { border-color: var(--success); color: var(--success); }
        .auto-refresh-indicator.active .refresh-dot {
            background: var(--success);
            animation: refreshPulse 2s infinite;
        }
        .refresh-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--text-muted);
        }
        @keyframes refreshPulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }

        /* SSL Monitor Card */
        .ssl-monitor-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
        .ssl-monitor-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
        }
        .ssl-monitor-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.95rem;
        }
        .ssl-item {
            display: flex;
            align-items: center;
            padding: 0.6rem 0;
            border-bottom: 1px solid var(--border);
            font-size: 0.85rem;
        }
        .ssl-item:last-child { border-bottom: none; }
        .ssl-item-domain { flex: 1; font-weight: 500; }
        .ssl-item-days {
            padding: 0.2rem 0.6rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .ssl-item-days.ok { background: rgba(34,197,94,0.15); color: var(--success); }
        .ssl-item-days.warning { background: rgba(245,158,11,0.15); color: var(--warning); }
        .ssl-item-days.danger { background: rgba(239,68,68,0.15); color: var(--error); }

        /* Collapsible Sidebar (improved mobile) */
        .sidebar-toggle {
            display: none;
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FF6B35, #F7931E);
            border: none;
            color: white;
            cursor: pointer;
            z-index: 150;
            box-shadow: 0 4px 16px rgba(255,107,53,0.4);
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .sidebar-toggle:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(255,107,53,0.5); }
        .sidebar-toggle:active { transform: scale(0.95); }
        .sidebar-toggle .icon-menu,
        .sidebar-toggle .icon-close { transition: opacity 0.2s, transform 0.2s; position: absolute; }
        .sidebar-toggle .icon-close { opacity: 0; transform: rotate(-90deg); }
        .sidebar-toggle.active .icon-menu { opacity: 0; transform: rotate(90deg); }
        .sidebar-toggle.active .icon-close { opacity: 1; transform: rotate(0); }
        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 99;
            opacity: 0;
            transition: opacity 0.25s ease;
            backdrop-filter: blur(3px);
            -webkit-backdrop-filter: blur(3px);
        }
        .sidebar-overlay.active {
            display: block;
            opacity: 1;
        }
        @media (max-width: 1024px) {
            .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
        }
        @media (max-width: 480px) {
            .sidebar-toggle {
                bottom: 1rem;
                right: 1rem;
                width: 48px;
                height: 48px;
            }
            .sidebar-toggle svg {
                width: 20px;
                height: 20px;
            }
        }

        /* Search shortcut hint in topbar */
        .search-hint {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0.8rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        .search-hint:hover { border-color: var(--primary); color: var(--text); }
        .search-hint kbd {
            font-size: 0.65rem;
            padding: 0.15rem 0.4rem;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 4px;
        }

        /* ==========================================
           FAIL2BAN MANAGEMENT STYLES
           ========================================== */

        /* Your IP Banner */
        .f2b-your-ip {
            background: linear-gradient(135deg, rgba(42,185,173,0.1), rgba(0,0,101,0.1));
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex-wrap: wrap;
        }
        .f2b-your-ip-left {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
            min-width: 200px;
        }
        .f2b-your-ip-icon {
            width: 50px;
            height: 50px;
            border-radius: 12px;
            background: var(--card-bg);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            transition: all 0.3s;
        }
        .f2b-your-ip-icon.safe {
            background: rgba(34,197,94,0.2);
            color: var(--success);
        }
        .f2b-your-ip-icon.danger {
            background: rgba(239,68,68,0.2);
            color: var(--error);
            animation: pulse 1s infinite;
        }
        .f2b-your-ip-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .f2b-your-ip-value {
            font-size: 1.25rem;
            font-weight: 700;
            font-family: monospace;
        }
        .f2b-status-badge {
            padding: 0.35rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
        }
        .f2b-status-badge.loading {
            background: rgba(245,158,11,0.2);
            color: var(--warning);
        }
        .f2b-status-badge.safe {
            background: rgba(34,197,94,0.2);
            color: var(--success);
        }
        .f2b-status-badge.banned {
            background: rgba(239,68,68,0.2);
            color: var(--error);
        }
        .f2b-status-badge.unprotected {
            background: rgba(245,158,11,0.2);
            color: var(--warning);
        }

        /* Stats Cards */
        .f2b-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .f2b-stat-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            text-align: center;
        }
        .f2b-stat-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.75rem;
        }
        .f2b-stat-value {
            font-size: 2rem;
            font-weight: 700;
            line-height: 1;
            margin-bottom: 0.25rem;
        }
        .f2b-stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
        }

        /* Jails Grid */
        .f2b-jails-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }
        .f2b-jail-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            transition: all 0.2s;
        }
        .f2b-jail-card:hover {
            border-color: var(--primary);
        }
        .f2b-jail-card.has-bans {
            border-color: var(--error);
            background: rgba(239,68,68,0.05);
        }
        .f2b-jail-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        .f2b-jail-name {
            font-weight: 600;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .f2b-jail-name svg {
            width: 16px;
            height: 16px;
            color: var(--text-muted);
        }
        .f2b-jail-badge {
            padding: 0.2rem 0.5rem;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 600;
        }
        .f2b-jail-badge.active {
            background: rgba(34,197,94,0.2);
            color: var(--success);
        }
        .f2b-jail-badge.has-bans {
            background: rgba(239,68,68,0.2);
            color: var(--error);
        }
        .f2b-jail-stats {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }
        .f2b-jail-stat {
            background: var(--bg);
            padding: 0.5rem;
            border-radius: 6px;
            text-align: center;
        }
        .f2b-jail-stat-value {
            font-size: 1.1rem;
            font-weight: 700;
        }
        .f2b-jail-stat-label {
            font-size: 0.65rem;
            color: var(--text-muted);
        }
        .f2b-jail-actions {
            display: flex;
            gap: 0.5rem;
        }
        .f2b-jail-actions .btn {
            flex: 1;
            padding: 0.4rem;
            font-size: 0.75rem;
            justify-content: center;
        }

        /* Banned IPs Modal/Expand */
        .f2b-banned-list {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
            max-height: 150px;
            overflow-y: auto;
        }
        .f2b-banned-ip {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.35rem 0.5rem;
            background: var(--bg);
            border-radius: 4px;
            margin-bottom: 0.25rem;
            font-family: monospace;
            font-size: 0.8rem;
        }
        .f2b-banned-ip:hover {
            background: var(--card-hover);
        }
        .f2b-banned-ip button {
            background: rgba(239,68,68,0.2);
            border: none;
            color: var(--error);
            padding: 0.2rem 0.4rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.7rem;
        }
        .f2b-banned-ip button:hover {
            background: var(--error);
            color: white;
        }

        /* Whitelist */
        .f2b-whitelist {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
        }
        .f2b-whitelist-ips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .f2b-whitelist-ip {
            background: rgba(34,197,94,0.15);
            border: 1px solid rgba(34,197,94,0.3);
            color: var(--success);
            padding: 0.4rem 0.75rem;
            border-radius: 20px;
            font-family: monospace;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .f2b-whitelist-ip.is-you {
            background: rgba(42,185,173,0.2);
            border-color: var(--primary);
            color: var(--primary);
        }
        .f2b-whitelist-ip svg {
            width: 12px;
            height: 12px;
        }

        /* Tools */
        .f2b-tools {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1rem;
        }
        .f2b-tool-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1.25rem;
        }
        .f2b-tool-card h4 {
            font-size: 0.95rem;
            margin-bottom: 0.5rem;
        }
        .f2b-tool-card p {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 1rem;
        }
        .f2b-unban-form {
            display: flex;
            gap: 0.5rem;
        }
        .f2b-unban-form input {
            flex: 1;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            color: var(--text);
            font-family: monospace;
            font-size: 0.85rem;
        }
        .f2b-unban-form input:focus {
            outline: none;
            border-color: var(--primary);
        }
        .f2b-check-result {
            margin-top: 1rem;
            padding: 0.75rem;
            border-radius: 6px;
            font-size: 0.85rem;
            display: none;
        }
        .f2b-check-result.show {
            display: block;
        }
        .f2b-check-result.safe {
            background: rgba(34,197,94,0.1);
            border: 1px solid rgba(34,197,94,0.3);
            color: var(--success);
        }
        .f2b-check-result.banned {
            background: rgba(239,68,68,0.1);
            border: 1px solid rgba(239,68,68,0.3);
            color: var(--error);
        }

        /* Loading */
        .f2b-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            padding: 2rem;
            color: var(--text-muted);
        }
        .f2b-spinner {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Responsive Fail2Ban */
        @media (max-width: 768px) {
            .f2b-your-ip {
                flex-direction: column;
                text-align: center;
            }
            .f2b-your-ip-left {
                flex-direction: column;
            }
            .f2b-stats {
                grid-template-columns: 1fr;
            }
            .f2b-tools {
                grid-template-columns: 1fr;
            }
            .f2b-unban-form {
                flex-direction: column;
            }
        }
        @media (max-width: 480px) {
            .f2b-jails-grid {
                grid-template-columns: 1fr;
            }
            .f2b-stat-value {
                font-size: 1.5rem;
            }
        }

        /* ========================================== */
        /* MODSECURITY STYLES */
        /* ========================================== */
        .modsec-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .modsec-stat-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1.25rem;
            text-align: center;
        }
        .modsec-stat-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.75rem;
        }
        .modsec-stat-value {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text);
        }
        .modsec-stat-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 0.25rem;
        }
        .modsec-engine-status {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
        }
        .modsec-engine-status.detection-only {
            border-color: var(--warning);
            background: rgba(245,158,11,0.1);
        }
        .modsec-engine-status.on {
            border-color: var(--success);
            background: rgba(34,197,94,0.1);
        }
        .modsec-engine-icon {
            color: var(--primary);
        }
        .modsec-top-row {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .modsec-panel {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem;
        }
        .modsec-panel .section-header {
            margin-bottom: 0.75rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .modsec-top-list {
            max-height: 250px;
            overflow-y: auto;
        }
        .modsec-top-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--border);
        }
        .modsec-top-item:last-child {
            border-bottom: none;
        }
        .modsec-top-item-info {
            display: flex;
            flex-direction: column;
            gap: 0.125rem;
        }
        .modsec-top-item-main {
            font-weight: 500;
            color: var(--text);
            font-family: 'Monaco', 'Menlo', monospace;
            font-size: 0.85rem;
        }
        .modsec-top-item-sub {
            font-size: 0.75rem;
            color: var(--text-secondary);
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .modsec-top-item-count {
            background: var(--error);
            color: white;
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            min-width: 40px;
            text-align: center;
        }
        .modsec-top-item-count.warning {
            background: var(--warning);
        }
        .modsec-filters {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }
        .modsec-filters select {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            color: var(--text);
            font-size: 0.85rem;
        }
        .modsec-events-table {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            overflow: hidden;
        }
        .modsec-events-table table {
            width: 100%;
            border-collapse: collapse;
        }
        .modsec-events-table th {
            background: var(--sidebar-bg);
            padding: 0.75rem;
            text-align: left;
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .modsec-events-table td {
            padding: 0.75rem;
            border-top: 1px solid var(--border);
            font-size: 0.85rem;
        }
        .modsec-events-table tr:hover {
            background: var(--hover);
        }
        .modsec-events-table .ip-cell {
            font-family: 'Monaco', 'Menlo', monospace;
            color: var(--primary);
        }
        .modsec-events-table .uri-cell {
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-family: 'Monaco', 'Menlo', monospace;
            font-size: 0.8rem;
        }
        .modsec-events-table .time-cell {
            white-space: nowrap;
            color: var(--text-secondary);
            font-size: 0.8rem;
        }
        .modsec-severity-badge {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
        }
        .modsec-severity-badge.critical {
            background: rgba(239,68,68,0.2);
            color: var(--error);
        }
        .modsec-severity-badge.warning {
            background: rgba(245,158,11,0.2);
            color: var(--warning);
        }
        .modsec-severity-badge.error {
            background: rgba(239,68,68,0.15);
            color: #f87171;
        }
        .modsec-severity-badge.info {
            background: rgba(42,185,173,0.2);
            color: var(--primary);
        }
        .modsec-category-badge {
            display: inline-block;
            padding: 0.2rem 0.4rem;
            background: var(--hover);
            border-radius: 4px;
            font-size: 0.7rem;
            color: var(--text-secondary);
        }
        .modsec-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 2rem;
            color: var(--text-secondary);
        }
        .modsec-spinner {
            width: 24px;
            height: 24px;
            border: 2px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .modsec-loading-cell {
            text-align: center !important;
        }
        .modsec-empty {
            text-align: center;
            padding: 2rem;
            color: var(--text-secondary);
        }

        /* Responsive ModSecurity */
        @media (max-width: 1024px) {
            .modsec-stats {
                grid-template-columns: repeat(2, 1fr);
            }
            .modsec-top-row {
                grid-template-columns: 1fr;
            }
        }
        @media (max-width: 768px) {
            .modsec-stats {
                grid-template-columns: 1fr;
            }
            .modsec-filters {
                flex-direction: column;
                align-items: stretch;
            }
            .modsec-events-table {
                overflow-x: auto;
            }
            .modsec-events-table table {
                min-width: 600px;
            }
        }
        @media (max-width: 480px) {
            .modsec-stat-value {
                font-size: 1.5rem;
            }
        }

        /* ========================================== */
        /* MALWARE SCANNER STYLES */
        /* ========================================== */
        .malware-status {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 1.25rem;
            background: var(--card-bg);
            border: 1px solid var(--success);
            border-radius: 8px;
            margin-bottom: 1.5rem;
        }
        .malware-status.scanning {
            border-color: var(--warning);
            background: rgba(245,158,11,0.1);
        }
        .malware-status.danger {
            border-color: var(--error);
            background: rgba(239,68,68,0.1);
        }
        .malware-status-icon {
            color: var(--success);
            flex-shrink: 0;
        }
        .malware-status.scanning .malware-status-icon {
            color: var(--warning);
            animation: pulse 1.5s infinite;
        }
        .malware-status.danger .malware-status-icon {
            color: var(--error);
        }
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .malware-status-text {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }
        .malware-status-text strong {
            color: var(--text);
        }
        .malware-status-text span {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        .malware-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .malware-stat-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1.25rem;
            text-align: center;
        }
        .malware-stat-card.critical .malware-stat-icon { color: var(--error); background: rgba(239,68,68,0.2); }
        .malware-stat-card.high .malware-stat-icon { color: #f97316; background: rgba(249,115,22,0.2); }
        .malware-stat-card.medium .malware-stat-icon { color: var(--warning); background: rgba(245,158,11,0.2); }
        .malware-stat-card.scanned .malware-stat-icon { color: var(--primary); background: rgba(42,185,173,0.2); }
        .malware-stat-icon {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.75rem;
        }
        .malware-stat-value {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text);
        }
        .malware-stat-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 0.25rem;
        }
        .malware-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        .malware-actions .btn-lg {
            padding: 0.75rem 1.5rem;
            font-size: 1rem;
        }
        .malware-threats-list {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            max-height: 500px;
            overflow-y: auto;
        }
        .malware-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem;
            color: var(--text-secondary);
            gap: 1rem;
        }
        .malware-threat-item {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
        }
        .malware-threat-item:last-child {
            border-bottom: none;
        }
        .malware-threat-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 0.5rem;
        }
        .malware-threat-file {
            font-family: 'Monaco', 'Menlo', monospace;
            font-size: 0.85rem;
            color: var(--primary);
            word-break: break-all;
        }
        .malware-threat-meta {
            font-size: 0.75rem;
            color: var(--text-secondary);
            display: flex;
            gap: 1rem;
            margin-bottom: 0.5rem;
        }
        .malware-threat-detections {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .malware-detection {
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
            padding: 0.5rem;
            background: var(--hover);
            border-radius: 4px;
            font-size: 0.8rem;
        }
        .malware-severity {
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            flex-shrink: 0;
        }
        .malware-severity.critical { background: rgba(239,68,68,0.2); color: var(--error); }
        .malware-severity.high { background: rgba(249,115,22,0.2); color: #f97316; }
        .malware-severity.medium { background: rgba(245,158,11,0.2); color: var(--warning); }
        .malware-severity.low { background: rgba(100,116,139,0.2); color: var(--text-secondary); }
        .malware-detection-desc {
            color: var(--text);
            flex: 1;
        }
        .malware-detection-match {
            font-family: 'Monaco', 'Menlo', monospace;
            font-size: 0.7rem;
            color: var(--text-secondary);
            background: var(--sidebar-bg);
            padding: 0.25rem 0.5rem;
            border-radius: 3px;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .malware-results-count {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }
        .malware-custom-scan {
            display: flex;
            gap: 0.5rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem;
        }
        .malware-custom-scan input {
            flex: 1;
            padding: 0.5rem 0.75rem;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font-family: 'Monaco', 'Menlo', monospace;
            font-size: 0.85rem;
        }
        .malware-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem;
            gap: 1rem;
        }
        .malware-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        /* Responsive Malware Scanner */
        @media (max-width: 1024px) {
            .malware-stats {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        @media (max-width: 768px) {
            .malware-stats {
                grid-template-columns: 1fr;
            }
            .malware-actions {
                flex-direction: column;
            }
            .malware-actions .btn {
                width: 100%;
                justify-content: center;
            }
            .malware-custom-scan {
                flex-direction: column;
            }
            .malware-threat-header {
                flex-direction: column;
            }
        }
        @media (max-width: 480px) {
            .malware-stat-value {
                font-size: 1.5rem;
            }
        }

        /* ==========================================
           RESOURCE MONITOR STYLES
           ========================================== */
        .resource-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .resource-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
        }
        .resource-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }
        .resource-card-title { font-size: 0.85rem; color: var(--text-muted); }
        .resource-card-value { font-size: 1.5rem; font-weight: 700; }
        .resource-bar {
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 0.5rem;
        }
        .resource-bar-fill {
            height: 100%;
            border-radius: 4px;
            transition: width 0.5s ease;
        }
        .resource-bar-fill.cpu { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
        .resource-bar-fill.mem { background: linear-gradient(90deg, #22c55e, #84cc16); }
        .resource-bar-fill.disk { background: linear-gradient(90deg, #f59e0b, #ef4444); }
        .resource-bar-fill.swap { background: linear-gradient(90deg, #ec4899, #f43f5e); }
        .resource-card-detail { font-size: 0.75rem; color: var(--text-muted); }
        .resource-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
        }
        .resource-panel {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
        }
        .resource-panel h3 { font-size: 0.95rem; margin-bottom: 1rem; }
        .info-list { display: flex; flex-direction: column; gap: 0.5rem; }
        .info-item {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--border);
        }
        .info-item:last-child { border-bottom: none; }
        .services-list { display: flex; flex-direction: column; gap: 0.5rem; }
        .service-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem;
            background: rgba(0,0,0,0.2);
            border-radius: 6px;
        }
        .service-item-name { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
        .service-status {
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
        }
        .service-status.running { background: rgba(34,197,94,0.2); color: var(--success); }
        .service-status.stopped { background: rgba(239,68,68,0.2); color: var(--error); }
        .quick-actions-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }
        .quick-action-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem;
            background: var(--border);
            border: none;
            border-radius: 8px;
            color: var(--text);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .quick-action-btn:hover { background: var(--primary); color: white; }

        /* LOG VIEWER STYLES */
        .logs-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .logs-filters {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .logs-filters select, .logs-filters input {
            padding: 0.5rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font-size: 0.85rem;
        }
        .logs-filters input { width: 150px; }
        .logs-info { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 1rem; }
        .logs-container {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            max-height: 600px;
            overflow-y: auto;
            font-family: monospace;
            font-size: 0.8rem;
        }
        .log-line {
            padding: 0.35rem 0.5rem;
            border-radius: 4px;
            margin-bottom: 0.25rem;
        }
        .log-line.error { background: rgba(239,68,68,0.15); color: #fca5a5; }
        .log-line.warning { background: rgba(245,158,11,0.15); color: #fcd34d; }
        .log-line.info { background: rgba(59,130,246,0.1); }
        .logs-placeholder { text-align: center; color: var(--text-muted); padding: 2rem; }

        /* DATABASE STYLES */
        .db-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        .db-stats { display: flex; gap: 2rem; }
        .db-stat { text-align: center; }
        .db-stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
        .db-stat-label { font-size: 0.8rem; color: var(--text-muted); }
        .db-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1rem;
        }
        .db-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            transition: all 0.2s;
        }
        .db-card:hover { border-color: var(--primary); }
        .db-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }
        .db-card-name { font-weight: 600; font-size: 0.95rem; }
        .db-card-size {
            padding: 0.25rem 0.5rem;
            background: rgba(42,185,173,0.15);
            color: var(--primary);
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 600;
        }
        .db-card-info { font-size: 0.8rem; color: var(--text-muted); }
        .db-card-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
        .db-card-actions .btn { font-size: 0.75rem; padding: 0.4rem 0.75rem; }

        /* CRON STYLES */
        .crons-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        .crons-header h3 { margin: 0; }
        .crons-container { display: flex; flex-direction: column; gap: 1rem; }
        .cron-group {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
        }
        .cron-group-header {
            padding: 1rem;
            background: rgba(0,0,0,0.2);
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .cron-group-source {
            padding: 0.25rem 0.5rem;
            background: var(--primary);
            color: white;
            border-radius: 4px;
            font-size: 0.7rem;
        }
        .cron-jobs { padding: 1rem; }
        .cron-job {
            padding: 0.75rem;
            border-radius: 8px;
            background: rgba(0,0,0,0.2);
            margin-bottom: 0.5rem;
            font-family: monospace;
            font-size: 0.8rem;
        }
        .cron-job:last-child { margin-bottom: 0; }
        .cron-job-schedule { color: var(--primary); font-weight: 600; }
        .cron-job-human { color: var(--text-muted); font-size: 0.75rem; margin-left: 0.5rem; }
        .cron-job-command { margin-top: 0.5rem; word-break: break-all; }

        /* BACKUP STYLES */
        .backups-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .backups-stats { display: flex; gap: 1.5rem; }
        .backup-stat { text-align: center; }
        .backup-stat-value { font-size: 1.5rem; font-weight: 700; }
        .backup-stat-label { font-size: 0.75rem; color: var(--text-muted); }
        .backup-stat.gdrive .backup-stat-value { color: var(--success); }
        .backups-actions { display: flex; gap: 0.5rem; }
        .backups-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        .backup-tab {
            padding: 0.6rem 1.25rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            cursor: pointer;
            transition: all 0.2s;
        }
        .backup-tab:hover { border-color: var(--primary); }
        .backup-tab.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        .backup-tab-content { display: none; }
        .backup-tab-content.active { display: block; }
        /* Hub Seguridad: tabs propios (desacoplados de showBackupTab) */
        .sec-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
        .sec-tab {
            padding: 0.6rem 1.25rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            cursor: pointer;
            transition: all 0.2s;
        }
        .sec-tab:hover { border-color: var(--primary); }
        .sec-tab.active { background: var(--primary); border-color: var(--primary); color: white; }
        .backups-table {
            width: 100%;
            border-collapse: collapse;
            background: var(--card-bg);
            border-radius: 10px;
            overflow: hidden;
            border: 1px solid var(--border);
        }
        .backups-table th {
            text-align: left;
            padding: 0.75rem 1rem;
            background: var(--bg);
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid var(--border);
        }
        .backups-table td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
            vertical-align: middle;
        }
        .backups-table tr:last-child td { border-bottom: none; }
        .backups-table tr:hover { background: var(--bg); }
        .backup-name { font-weight: 600; word-break: break-all; }
        .backup-name small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.75rem; margin-top: 0.25rem; }
        .backup-type {
            display: inline-block;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
        }
        .backup-type.database { background: #e3f2fd; color: #1565c0; }
        .backup-type.files { background: #fff3e0; color: #e65100; }
        .backup-type.plesk { background: #f3e5f5; color: #7b1fa2; }
        .backup-size { font-family: monospace; white-space: nowrap; }
        .backup-date { white-space: nowrap; color: var(--text-muted); font-size: 0.85rem; }
        .backup-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
        .backup-actions .btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
        .backup-actions .btn svg { width: 12px; height: 12px; }
        .btn-restore { background: var(--success); color: white; border-color: var(--success); }
        .btn-restore:hover { background: #218838; border-color: #218838; }
        .gdrive-not-connected {
            text-align: center;
            padding: 3rem;
            color: var(--text-muted);
        }
        .gdrive-not-connected p { margin: 1rem 0; }
        .gdrive-account {
            padding: 1rem;
            background: rgba(34,197,94,0.1);
            border-radius: 8px;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        /* Dashboard Alerts Panel */
        .dashboard-alerts {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .alerts-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        .alerts-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
        }
        .alerts-count {
            display: flex;
            gap: 0.5rem;
        }
        .alert-badge {
            font-size: 0.7rem;
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            font-weight: 600;
        }
        .alert-badge.critical { background: rgba(239,68,68,0.2); color: #ef4444; }
        .alert-badge.warning { background: rgba(245,158,11,0.2); color: #f59e0b; }
        .alerts-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .alert-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.6rem 0.75rem;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            font-size: 0.85rem;
        }
        .alert-item.critical { border-left: 3px solid #ef4444; }
        .alert-item.warning { border-left: 3px solid #f59e0b; }
        .alert-icon {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .alert-icon.critical { background: rgba(239,68,68,0.2); }
        .alert-icon.warning { background: rgba(245,158,11,0.2); }
        .alert-content { flex: 1; min-width: 0; }
        .alert-message { font-weight: 500; }
        .alert-action { font-size: 0.75rem; color: var(--text-muted); }
        .alerts-empty {
            text-align: center;
            padding: 1.5rem;
            color: var(--text-muted);
            font-size: 0.85rem;
        }
        .alerts-empty svg { margin-bottom: 0.5rem; opacity: 0.5; }

        /* Dashboard Activity Feed */
        .dashboard-activity {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .activity-feed-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        .activity-feed-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
        }
        .activity-feed-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-height: 200px;
            overflow-y: auto;
        }
        .activity-feed-item {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.5rem;
            border-radius: 6px;
            font-size: 0.8rem;
            transition: background 0.2s;
        }
        .activity-feed-item:hover { background: rgba(0,0,0,0.2); }
        .activity-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-top: 5px;
            flex-shrink: 0;
        }
        .activity-dot.auth { background: #3b82f6; }
        .activity-dot.php_error { background: #ef4444; }
        .activity-dot.system { background: #22c55e; }
        .activity-feed-text {
            flex: 1;
            min-width: 0;
            word-break: break-word;
            color: var(--text-muted);
        }
        .activity-feed-time {
            font-size: 0.7rem;
            color: var(--text-muted);
            white-space: nowrap;
        }

        /* System Quick Actions */
        .system-actions {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }
        .system-action-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            padding: 1rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.8rem;
            text-align: center;
        }
        .system-action-btn:hover {
            border-color: var(--primary);
            background: var(--card-hover);
            transform: translateY(-2px);
        }
        .system-action-btn.loading {
            opacity: 0.7;
            pointer-events: none;
        }
        .system-action-btn .icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .system-action-btn .label { font-weight: 500; }
        .system-action-btn .desc { font-size: 0.7rem; color: var(--text-muted); }

        /* Services Status Mini */
        .services-mini {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }
        .service-pill {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.65rem;
            background: rgba(0,0,0,0.2);
            border-radius: 20px;
            font-size: 0.75rem;
        }
        .service-pill .dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }
        .service-pill .dot.running { background: #22c55e; }
        .service-pill .dot.stopped { background: #ef4444; }

        /* Spin animation */
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        .spin { animation: spin 1s linear infinite; }

        /* Responsive for new sections */
        @media (max-width: 1024px) {
            .resource-stats { grid-template-columns: repeat(2, 1fr); }
            .resource-grid { grid-template-columns: 1fr; }
            .system-actions { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 768px) {
            .resource-stats { grid-template-columns: 1fr; }
            .logs-filters { flex-direction: column; }
            .logs-filters select, .logs-filters input { width: 100%; }
            .db-stats { flex-direction: column; gap: 1rem; }
            .backups-stats { flex-direction: column; gap: 0.75rem; }
            .backups-actions { flex-direction: column; }
            .backups-actions .btn { width: 100%; justify-content: center; }
            .backups-table { font-size: 0.85rem; }
            .backups-table th, .backups-table td { padding: 0.5rem 0.5rem; }
            .backup-name { font-size: 0.8rem; }
            .backup-actions { flex-wrap: wrap; }
            .system-actions { grid-template-columns: repeat(2, 1fr); }
            /* Stack alerts and activity on mobile */
            #page-dashboard > div[style*="grid-template-columns: 1fr 1fr"] {
                grid-template-columns: 1fr !important;
            }
        }

/* Setup Instructions */
.setup-instructions {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--info);
    border-radius: 8px;
    text-align: left;
}

.setup-instructions h3 {
    font-size: 0.9rem;
    color: var(--info);
    margin-bottom: 0.5rem;
}

.setup-instructions p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.setup-instructions code {
    display: block;
    background: var(--bg);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text);
    word-break: break-all;
    margin-bottom: 0.75rem;
}

.btn-setup {
    display: inline-block;
    background: var(--info);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-setup:hover {
    background: #2563eb;
}

/* ==========================================
   LOGIN SCREEN
   ========================================== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg) 0%, #1a1a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    border: 1px solid var(--border);
}

.login-logo { margin-bottom: 1.5rem; }

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: left;
}

.google-login-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: white;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.google-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.login-footer {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1.5rem;
}

.auth-checking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* USER INFO */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 12px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

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

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

[data-theme="light"] .login-screen {
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8f0 100%);
}

        /* ==========================================
           ALERTS PANEL STYLES
           ========================================== */
        .alerts-panel {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1rem;
        }
        .alerts-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        .alerts-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            font-weight: 600;
        }
        .alerts-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
        }
        .alert-card {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .alert-card:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
        }
        .alert-card.status-ok { border-left: 3px solid var(--success); }
        .alert-card.status-warning { border-left: 3px solid var(--warning); }
        .alert-card.status-error { border-left: 3px solid var(--error); }
        .alert-icon {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .alert-icon.sites { background: rgba(42,185,173,0.15); color: var(--primary); }
        .alert-icon.ssl { background: rgba(34,197,94,0.15); color: var(--success); }
        .alert-icon.backup { background: rgba(255,107,53,0.15); color: #FF6B35; }
        .alert-icon.security { background: rgba(239,68,68,0.15); color: var(--error); }
        .alert-content { flex: 1; min-width: 0; }
        .alert-label {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .alert-value {
            font-size: 1.25rem;
            font-weight: 700;
            line-height: 1.2;
        }
        .alert-status {
            font-size: 0.75rem;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .alert-status.ok { color: var(--success); }
        .alert-status.warning { color: var(--warning); }
        .alert-status.error { color: var(--error); }

        /* Responsive */
        @media (max-width: 1024px) {
            .alerts-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 480px) {
            .alerts-grid { grid-template-columns: 1fr; }
            .alert-card { padding: 0.75rem; }
            .alert-icon { width: 36px; height: 36px; }
            .alert-value { font-size: 1.1rem; }
        }

        /* ==========================================
           RESOURCE CHARTS
           ========================================== */
        .charts-section {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
        .charts-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid var(--border);
        }
        .charts-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--text);
        }
        .charts-controls {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .chart-hours-select {
            background: var(--bg);
            color: var(--text);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 0.35rem 0.6rem;
            font-size: 0.8rem;
            cursor: pointer;
        }
        .chart-hours-select:focus {
            outline: none;
            border-color: var(--primary);
        }
        .charts-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
        }
        .chart-card {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            transition: all 0.2s;
        }
        .chart-card:hover {
            border-color: var(--primary);
            box-shadow: 0 4px 12px rgba(42, 185, 173, 0.1);
        }
        .chart-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }
        .chart-label {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text);
        }
        .chart-current {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary);
        }
        .chart-container {
            position: relative;
            height: 120px;
            width: 100%;
        }
        .chart-stats {
            display: flex;
            justify-content: space-between;
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        .chart-stats strong {
            color: var(--text);
        }
        .charts-note {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 1rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border);
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        /* Chart responsive */
        @media (max-width: 1200px) {
            .charts-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 600px) {
            .charts-grid { grid-template-columns: 1fr; }
            .chart-container { height: 100px; }
        }

        /* ==========================================
           WEB TERMINAL
           ========================================== */
        #page-terminal {
            display: none;
            height: calc(100vh - 120px);
            padding: 0 !important;
        }
        #page-terminal.active {
            display: flex;
            gap: 1rem;
        }
        .terminal-wrapper {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #0d1117;
            border: 1px solid #30363d;
            border-radius: 12px;
            overflow: hidden;
            min-height: 500px;
        }
        .terminal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1rem;
            background: #161b22;
            border-bottom: 1px solid #30363d;
        }
        .terminal-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
            color: #58a6ff;
        }
        .terminal-controls {
            display: flex;
            gap: 0.5rem;
        }
        .terminal-btn {
            background: transparent;
            border: 1px solid #30363d;
            border-radius: 6px;
            padding: 0.4rem;
            color: #8b949e;
            cursor: pointer;
            transition: all 0.2s;
        }
        .terminal-btn:hover {
            background: #21262d;
            color: #c9d1d9;
            border-color: #8b949e;
        }
        .terminal-body {
            flex: 1;
            padding: 1rem;
            overflow-y: auto;
            font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
            font-size: 0.85rem;
            line-height: 1.5;
            color: #c9d1d9;
            background: #0d1117;
        }
        .terminal-welcome {
            color: #58a6ff;
            margin-bottom: 1rem;
        }
        .terminal-welcome pre {
            font-size: 0.7rem;
            line-height: 1.2;
            color: #39d353;
        }
        .terminal-entry {
            margin-bottom: 0.75rem;
        }
        .terminal-command-line {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #8b949e;
        }
        .terminal-command-line .cmd {
            color: #79c0ff;
            font-weight: 500;
        }
        .terminal-output {
            margin-top: 0.25rem;
            padding-left: 0;
            white-space: pre-wrap;
            word-break: break-word;
            color: #c9d1d9;
        }
        .terminal-output.error {
            color: #f85149;
        }
        .terminal-output.success {
            color: #39d353;
        }
        .terminal-timestamp {
            font-size: 0.7rem;
            color: #484f58;
            margin-left: auto;
        }
        .terminal-input-wrapper {
            display: flex;
            align-items: center;
            padding: 0.75rem 1rem;
            background: #161b22;
            border-top: 1px solid #30363d;
            gap: 0.5rem;
        }
        .terminal-prompt {
            color: #39d353;
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            font-size: 0.85rem;
            white-space: nowrap;
        }
        .terminal-input {
            flex: 1;
            background: transparent;
            border: none;
            color: #c9d1d9;
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            font-size: 0.85rem;
            outline: none;
        }
        .terminal-input::placeholder {
            color: #484f58;
        }
        .terminal-send-btn {
            background: #238636;
            border: none;
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            color: white;
            cursor: pointer;
            transition: background 0.2s;
        }
        .terminal-send-btn:hover {
            background: #2ea043;
        }
        .terminal-suggestions {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 0;
            right: 0;
            background: #161b22;
            border: 1px solid #30363d;
            border-radius: 8px 8px 0 0;
            max-height: 200px;
            overflow-y: auto;
            margin-bottom: -1px;
        }
        .terminal-suggestions.active {
            display: block;
        }
        .terminal-suggestion {
            padding: 0.5rem 1rem;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .terminal-suggestion:hover,
        .terminal-suggestion.selected {
            background: #21262d;
        }
        .terminal-suggestion .cmd-name {
            color: #79c0ff;
            font-family: monospace;
        }
        .terminal-suggestion .cmd-desc {
            color: #8b949e;
            font-size: 0.75rem;
        }
        .terminal-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem 1rem;
            background: #0d1117;
            border-top: 1px solid #30363d;
            font-size: 0.7rem;
            color: #484f58;
        }
        .terminal-status {
            color: #39d353;
        }
        .terminal-status.loading {
            color: #f0883e;
        }
        /* Quick Commands Panel */
        .terminal-quick-panel {
            width: 200px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            height: fit-content;
        }
        .quick-panel-header {
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--text);
            margin-bottom: 0.75rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border);
        }
        .quick-commands {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }
        .quick-cmd {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 0.5rem 0.75rem;
            color: var(--text);
            font-size: 0.75rem;
            font-family: monospace;
            cursor: pointer;
            text-align: left;
            transition: all 0.2s;
        }
        .quick-cmd:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        /* Terminal responsive */
        @media (max-width: 900px) {
            #page-terminal.active {
                flex-direction: column;
            }
            .terminal-quick-panel {
                width: 100%;
            }
            .quick-commands {
                flex-direction: row;
                flex-wrap: wrap;
            }
            .quick-cmd {
                flex: 1 1 calc(33% - 0.5rem);
            }
        }
        @media (max-width: 600px) {
            .terminal-wrapper {
                min-height: 400px;
            }
            .terminal-prompt {
                font-size: 0.75rem;
            }
            .terminal-input {
                font-size: 0.8rem;
            }
            .quick-cmd {
                flex: 1 1 calc(50% - 0.25rem);
            }
        }

        /* ==========================================
           SKELETON LOADERS
           ========================================== */
        .skeleton {
            background: linear-gradient(90deg, var(--card-bg) 25%, var(--border) 50%, var(--card-bg) 75%);
            background-size: 200% 100%;
            animation: skeleton-loading 1.5s infinite;
            border-radius: 6px;
        }
        @keyframes skeleton-loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        
        /* Skeleton Cards */
        .skeleton-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            overflow: hidden;
        }
        .skeleton-thumbnail {
            height: 160px;
            margin: -1rem -1rem 1rem -1rem;
        }
        .skeleton-title {
            height: 18px;
            width: 70%;
            margin-bottom: 0.5rem;
        }
        .skeleton-text {
            height: 14px;
            width: 50%;
            margin-bottom: 0.5rem;
        }
        .skeleton-badge {
            height: 22px;
            width: 60px;
            border-radius: 4px;
        }
        .skeleton-btn {
            height: 32px;
            width: 100%;
            margin-top: 0.75rem;
        }
        
        /* Skeleton Grid */
        .skeleton-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1rem;
        }
        
        /* Skeleton Table */
        .skeleton-table {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
        }
        .skeleton-row {
            display: flex;
            align-items: center;
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            gap: 1rem;
        }
        .skeleton-row:last-child { border-bottom: none; }
        .skeleton-avatar {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            flex-shrink: 0;
        }
        .skeleton-cell {
            height: 14px;
            flex: 1;
        }
        .skeleton-cell-sm {
            height: 14px;
            width: 80px;
            flex-shrink: 0;
        }
        
        /* Skeleton Stats */
        .skeleton-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .skeleton-stat {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            text-align: center;
        }
        .skeleton-stat-value {
            height: 28px;
            width: 60%;
            margin: 0 auto 0.5rem;
        }
        .skeleton-stat-label {
            height: 12px;
            width: 80%;
            margin: 0 auto;
        }
        
        @media (max-width: 1024px) {
            .skeleton-stats { grid-template-columns: repeat(2, 1fr); }
            .skeleton-grid { grid-template-columns: 1fr; }
        }
        @media (max-width: 480px) {
            .skeleton-stats { grid-template-columns: 1fr 1fr; }
        }

        /* ==========================================
           BREADCRUMB NAVIGATION
           ========================================== */
        .breadcrumb-bar {
            background: var(--sidebar-bg);
            border-bottom: 1px solid var(--border);
            padding: 0.5rem 1.5rem;
        }
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
        }
        .breadcrumb-home {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            color: var(--text-muted);
            transition: all 0.2s;
        }
        .breadcrumb-home:hover {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        .breadcrumb-separator {
            color: var(--text-muted);
            font-size: 0.8rem;
            opacity: 0.5;
        }
        .breadcrumb-category {
            color: var(--text-muted);
            font-size: 0.8rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .breadcrumb-current {
            font-weight: 600;
            color: var(--text);
        }
        
        /* Responsive */
        @media (max-width: 600px) {
            .breadcrumb-category,
            .breadcrumb-separator:nth-child(2) {
                display: none;
            }
            .breadcrumb { gap: 0.4rem; }
            .breadcrumb-current { font-size: 0.85rem; }
        }

        /* ==========================================
           CONNECTION STATUS BANNER
           ========================================== */
        .connection-banner {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 9999;
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
            padding: 0;
            max-height: 0;
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: 0 2px 10px rgba(239,68,68,0.3);
        }
        .connection-banner.visible {
            padding: 0.75rem 1rem;
            max-height: 60px;
        }
        .connection-banner-content {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            font-size: 0.85rem;
            font-weight: 500;
        }
        .connection-banner svg {
            flex-shrink: 0;
            animation: pulse-icon 1.5s infinite;
        }
        @keyframes pulse-icon {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .connection-retry-btn {
            background: rgba(255,255,255,0.2);
            border: 1px solid rgba(255,255,255,0.3);
            color: white;
            padding: 0.35rem 0.75rem;
            border-radius: 4px;
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .connection-retry-btn:hover {
            background: rgba(255,255,255,0.3);
        }
        
        /* Adjust main content when banner is visible */
        .connection-banner.visible ~ .sidebar,
        .connection-banner.visible ~ .main {
            margin-top: 44px;
        }
        .connection-banner.visible ~ .sidebar {
            height: calc(100vh - 44px);
        }

        /* Connection restored toast */
        .connection-restored {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: linear-gradient(135deg, #22c55e, #16a34a);
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            box-shadow: 0 4px 20px rgba(34,197,94,0.3);
            z-index: 9999;
            transition: transform 0.3s ease;
        }
        .connection-restored.visible {
            transform: translateX(-50%) translateY(0);
        }

/* ============================================================
   MEJORA UI 2026-06-21 (control.salescloud.es) — aditivo, usa
   las variables existentes. Layout consistente + transiciones +
   responsive de tablas/código + micro-interacciones.
   ============================================================ */

/* Layout: centrar el contenido de cada página y padding fluido */
.page { margin-left: auto; margin-right: auto; padding-left: clamp(0.75rem, 2vw, 1.5rem); padding-right: clamp(0.75rem, 2vw, 1.5rem); }

/* Transición fluida al cambiar de página (showPage añade .active) */
.page.active { animation: pageFadeIn .28s ease both; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Bloques de código siempre con scroll horizontal, nunca rompen el ancho */
.page pre, pre.prompt-body { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* En móvil: tablas con scroll horizontal interno (sin forzar ancho con nowrap)
   + guard anti-desbordamiento horizontal a nivel de página. El contenido que
   deba scrollear tiene su propio contenedor con overflow-x. */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  #app-container { max-width: 100%; overflow-x: hidden; }
  .page { max-width: 100%; }
  .page table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Micro-interacciones: lift sutil en cards, deslizamiento en nav, feedback en botones */
.card { transition: transform .18s ease, box-shadow .18s ease, background .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.30); border-color: var(--primary); }
.nav-item { transition: background .15s ease, color .15s ease, transform .15s ease; }
.nav-item:hover { transform: translateX(2px); }
button, .btn-prompt, .btn-new { transition: filter .15s ease, transform .12s ease, box-shadow .15s ease; }
button:hover:not(:disabled), .btn-prompt:hover, .btn-new:hover { filter: brightness(1.07); }
button:active:not(:disabled), .btn-prompt:active, .btn-new:active { transform: translateY(1px); }

/* Respeta a quien prefiere menos movimiento (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
  .card:hover, .nav-item:hover, button:active { transform: none; }
}

/* ============================================================
   PULIDO PREMIUM 2026-06-21 (control.salescloud.es) — toques
   modernos que faltaban (no duplica skeleton/nav-activo, ya existían).
   ============================================================ */

/* Scroll suave en navegación por anclas */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Selección de texto con el color de marca */
::selection { background: rgba(42,185,173,0.35); color: var(--text); }

/* Scrollbars modernas y discretas en todo el panel (no solo sidebar) */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); background-clip: padding-box; }

/* Foco visible accesible SOLO con teclado (no molesta al ratón) — anillo de marca */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible, .nav-item:focus-visible, .card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   FIX CRÍTICO DE ANCHO (2026-06-21) — causa raíz: body es flex y
   #app-container era un flex-item SIN flex-grow ni min-width:0, así
   que se ENCOGÍA al ancho del contenido de cada página (cada sección
   un ancho distinto) y el contenido ancho (Recursos 24h) lo estiraba
   y desbordaba por la derecha. Forzar que llene el body y que el
   contenido ancho scrollee en vez de expandir el contenedor.
   ============================================================ */
#app-container { flex: 1 1 auto; min-width: 0; width: 100%; }
.main { min-width: 0; }
.content { min-width: 0; }

/* FIX overflow charts dashboard (2026-06-21): repeat(N,1fr) no baja del min-content
   y los canvas de Chart.js tienen ancho intrínseco → desbordaban a 1881px.
   minmax(0,1fr) deja encoger la columna; el canvas se adapta a 100%. */
.charts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart-card { min-width: 0; }
.chart-card canvas, .chart-container canvas { max-width: 100% !important; height: auto; }
.chart-container { min-width: 0; overflow: hidden; }

/* FIX contraste visor de logs (2026-06-21): los colores de nivel
   (error #fca5a5 / warning #fcd34d / info) son claros y SOLO se leen sobre
   fondo oscuro; en tema claro el card-bg blanco hacía el texto amarillo
   ilegible. El visor de logs va con fondo consola SIEMPRE (ambos temas). */
.logs-container { background: #0d1117 !important; color: #e6edf3; border-color: #30363d; }
.logs-container .log-line.info { color: #9ecbff; }
#logs-file-path, .logs-file-path { color: #8b949e; }

/* ============================================================
   DOGMA TEMA OSCURO (Joan 2026-06-21, canon): si el tema es OSCURO,
   NADA puede tener fondo blanco/claro hardcodeado. Red de seguridad que
   fuerza los elementos con #fff/#f8fafc/#f1f5f9 a las variables de tema.
   El fix correcto es usar var(--card-bg)/--bg en origen; esto lo blinda.
   ============================================================ */
html:not([data-theme="light"]) #page-prompts .prompts-side,
html:not([data-theme="light"]) #page-prompts .prompt-card,
html:not([data-theme="light"]) #prompt-modal .pm-box {
  background: var(--card-bg) !important; color: var(--text) !important; border-color: var(--border) !important;
}
html:not([data-theme="light"]) #page-prompts .prompt-body,
html:not([data-theme="light"]) #page-prompts .ptag,
html:not([data-theme="light"]) #page-prompts .pcat-link .n,
html:not([data-theme="light"]) #page-prompts .psec .n,
html:not([data-theme="light"]) #prompt-modal input,
html:not([data-theme="light"]) #prompt-modal textarea {
  background: var(--bg) !important; color: var(--text) !important; border-color: var(--border) !important;
}
html:not([data-theme="light"]) #page-prompts .prompt-title,
html:not([data-theme="light"]) #page-prompts .psec { color: var(--text) !important; }
html:not([data-theme="light"]) #page-prompts .pcat-link { color: var(--text-muted) !important; }
/* General: ninguna tabla, card, pre, modal o thumb con fondo blanco en oscuro */
html:not([data-theme="light"]) table,
html:not([data-theme="light"]) .ionos-table,
html:not([data-theme="light"]) .sites-table,
html:not([data-theme="light"]) .data-table {
  background: var(--card-bg); color: var(--text);
}
html:not([data-theme="light"]) th { background: var(--bg) !important; color: var(--text) !important; }
html:not([data-theme="light"]) td { border-color: var(--border) !important; }
html:not([data-theme="light"]) [style*="background:#fff"],
html:not([data-theme="light"]) [style*="background: #fff"],
html:not([data-theme="light"]) [style*="background:#ffffff"],
html:not([data-theme="light"]) [style*="background:white"] {
  background: var(--card-bg) !important; color: var(--text) !important;
}

/* DOGMA TEMA OSCURO (ampliado): inputs/selects/textareas/labels/botones —
   NUNCA fondo blanco en oscuro; si el fondo es oscuro, la LETRA es clara. */
html:not([data-theme="light"]) input:not([type=checkbox]):not([type=radio]):not([type=range]),
html:not([data-theme="light"]) textarea,
html:not([data-theme="light"]) select {
  background: var(--card-bg) !important; color: var(--text) !important; border-color: var(--border) !important;
}
html:not([data-theme="light"]) input::placeholder,
html:not([data-theme="light"]) textarea::placeholder { color: var(--text-muted) !important; }
html:not([data-theme="light"]) label,
html:not([data-theme="light"]) #prompt-modal label,
html:not([data-theme="light"]) h1, html:not([data-theme="light"]) h2,
html:not([data-theme="light"]) h3, html:not([data-theme="light"]) h4 { color: var(--text) !important; }
/* Botones de fondo claro hardcodeado → oscuros con letra clara.
   Los botones de color (primary/azul/verde: .btn-new, .btn-prompt.copy, .btn-prompt.use, .btn-primary) conservan su color por sus propias reglas. */
html:not([data-theme="light"]) .btn-tool,
html:not([data-theme="light"]) .btn-prompt:not(.copy):not(.use):not(.danger),
html:not([data-theme="light"]) button[style*="background:#fff"],
html:not([data-theme="light"]) button[style*="background:#f1f5f9"],
html:not([data-theme="light"]) button[style*="background: #fff"] {
  background: var(--card-bg) !important; color: var(--text) !important; border-color: var(--border) !important;
}
/* Cualquier elemento con color de texto oscuro hardcodeado sobre fondo oscuro → texto claro */
html:not([data-theme="light"]) [style*="color:#0f172a"],
html:not([data-theme="light"]) [style*="color:#1e293b"],
html:not([data-theme="light"]) [style*="color:#334155"],
html:not([data-theme="light"]) [style*="color:#111"] { color: var(--text) !important; }

/* DOGMA TEMA OSCURO — cobertura completa del módulo Prompts v3 (override del CSS
   inyectado por prompts.js que trae #fff/#f8fafc hardcodeados). */
html:not([data-theme="light"]) #page-prompts .seg button,
html:not([data-theme="light"]) #page-prompts .prompts-sort select,
html:not([data-theme="light"]) #page-prompts .prompt-card,
html:not([data-theme="light"]) #page-prompts .prompts-side,
html:not([data-theme="light"]) #prompt-modal .pm-box,
html:not([data-theme="light"]) #prompt-modal .pm-preview,
html:not([data-theme="light"]) #prompt-modal .pm-tabs button { background: var(--card-bg) !important; color: var(--text) !important; border-color: var(--border) !important; }
html:not([data-theme="light"]) #page-prompts .prompt-body,
html:not([data-theme="light"]) #page-prompts .ptag,
html:not([data-theme="light"]) #page-prompts .pcat-link .n,
html:not([data-theme="light"]) #page-prompts .psec .n,
html:not([data-theme="light"]) #page-prompts .psec:hover,
html:not([data-theme="light"]) #page-prompts .pcat-link:hover { background: var(--bg) !important; }
html:not([data-theme="light"]) #page-prompts .psec,
html:not([data-theme="light"]) #page-prompts .pside-h,
html:not([data-theme="light"]) #page-prompts .prompt-title,
html:not([data-theme="light"]) #page-prompts .presult-count,
html:not([data-theme="light"]) #page-prompts .seg button { color: var(--text) !important; }
html:not([data-theme="light"]) #page-prompts .pcat-link { color: var(--text-muted) !important; }
html:not([data-theme="light"]) #page-prompts .seg,
html:not([data-theme="light"]) #page-prompts .ptag { border-color: var(--border) !important; }

/* Miniaturas de sitios: fondo oscuro de carga (la captura externa de la web real
   puede ser blanca; el contenedor no debe blanquear mientras carga/falla). */
html:not([data-theme="light"]) .site-thumbnail { background: var(--card-bg) !important; }

/* ===================== Galería (screenshots) ===================== */
.gal-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.gal-search-wrap {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
    display: flex;
    align-items: center;
}
.gal-search-wrap svg {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}
.gal-search {
    width: 100%;
    padding: 8px 10px 8px 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
}
.gal-select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
}
.gal-count {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.gal-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: 12px;
}
.gal-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}
.gal-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}
.gal-card-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--bg);
    overflow: hidden;
}
.gal-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gal-card-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gal-card-domain {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gal-card-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Lightbox fullscreen tipo presentacion */
.gal-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
}
.gal-lightbox.open {
    display: flex;
}
.gal-lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
    max-height: 90vh;
}
.gal-lb-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.gal-lb-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    color: #f4f4f5;
    font-size: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.gal-lb-domain { font-weight: 700; }
.gal-lb-date, .gal-lb-pos { color: #a1a1aa; font-size: 12px; }
.gal-lb-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: transparent;
    border: none;
    color: #f4f4f5;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}
.gal-lb-close:hover { color: var(--primary); }
.gal-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: none;
    color: #f4f4f5;
    font-size: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gal-lb-nav:hover { background: rgba(255,255,255,0.18); }
.gal-lb-prev { left: 20px; }
.gal-lb-next { right: 20px; }

@media (max-width: 640px) {
    .gal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .gal-lb-nav { width: 40px; height: 40px; font-size: 18px; }
    .gal-lb-prev { left: 8px; }
    .gal-lb-next { right: 8px; }
    .gal-toolbar { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   REDISEÑO GLOBAL — Glassmorphism minimal (worker irene44, 2026-07-01)
   Aplica a las ~29 secciones vía las clases de contenedor compartidas.
   Reversible: bloque autocontenido al final del fichero.
   ============================================================ */
:root {
    --glass-bg: rgba(20, 20, 42, 0.55);
    --glass-bg-strong: rgba(20, 20, 42, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 14px;
    --glass-radius: 16px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    --glass-caustic-1: rgba(42, 185, 173, 0.16);   /* teal marca */
    --glass-caustic-2: rgba(0, 0, 101, 0.20);      /* indigo marca */
    --glass-caustic-3: rgba(59, 130, 246, 0.10);   /* info */
}
[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.60);
    --glass-bg-strong: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-shadow: 0 8px 32px rgba(31, 45, 61, 0.12);
    --glass-caustic-1: rgba(42, 185, 173, 0.12);
    --glass-caustic-2: rgba(0, 58, 112, 0.10);
    --glass-caustic-3: rgba(59, 130, 246, 0.08);
}

/* Fondo con cáusticas suaves de bajo contraste (solo compositor, sin coste GPU alto) */
body::before {
    content: "";
    position: fixed;
    inset: -20% -20% -20% -20%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(38% 42% at 18% 22%, var(--glass-caustic-1) 0%, transparent 60%),
        radial-gradient(46% 48% at 82% 30%, var(--glass-caustic-2) 0%, transparent 62%),
        radial-gradient(40% 44% at 62% 82%, var(--glass-caustic-3) 0%, transparent 60%),
        radial-gradient(34% 38% at 30% 78%, var(--glass-caustic-1) 0%, transparent 58%);
    filter: blur(28px);
    opacity: 0.9;
    animation: causticDrift 34s ease-in-out infinite alternate;
}
@keyframes causticDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(1.5%, -1.2%, 0) scale(1.04); }
    100% { transform: translate3d(-1.5%, 1.4%, 0) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}

/* Paneles de cristal esmerilado — mucho aire, bordes finos, blur sutil */
.card,
.stat-card,
.status-card,
.tool-card,
.panel,
.plesk-dashboard,
.ionos-dashboard {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.1);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-shadow);
}
.card { padding: 1.5rem; }
.card:hover {
    border-color: var(--glass-border);
    background: var(--glass-bg-strong);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
    transform: translateY(-2px);
}
[data-theme="light"] .card:hover { box-shadow: 0 12px 40px rgba(31, 45, 61, 0.16); }

/* Top bar como lámina de cristal fija */
.top-bar {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.1);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.1);
    border-bottom: 1px solid var(--glass-border);
}
/* Sidebar translúcido a juego */
.sidebar {
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
    border-right: 1px solid var(--glass-border);
}

/* Iconografía monocroma más grande (decorativa; se respetan colores de estado) */
.card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
}
.card-icon svg { width: 24px; height: 24px; }
.card-header h3 svg,
.card-title svg { width: 20px; height: 20px; }

/* ==========================================================================
   LOGS MEJORADO (Bloque 7) — multi-fuente + ventana temporal + copiar 100
   ========================================================================== */
.logs-enhanced {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    background: var(--card-bg, var(--card));
    border: 1px solid var(--border);
    border-radius: 10px;
}
.logs-enhanced .le-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.logs-enhanced .le-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary, var(--text-muted));
    min-width: 62px;
}
.logs-enhanced .le-muted { color: var(--text-muted); font-size: .75rem; }
.logs-enhanced .le-sources { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.logs-enhanced .le-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--hover, transparent);
    font-size: .78rem;
    cursor: pointer;
    user-select: none;
}
.logs-enhanced .le-chip input { accent-color: var(--primary); cursor: pointer; }
.logs-enhanced .le-chip em { font-style: normal; }
.logs-enhanced .le-windows { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.logs-enhanced .le-win.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.logs-enhanced .le-filter {
    flex: 1;
    min-width: 160px;
    padding: .35rem .6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: .8rem;
}
.log-line .le-src-badge {
    display: inline-block;
    min-width: 84px;
    margin-right: .5rem;
    padding: 0 .35rem;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   Bloque 1 — Sites: modal de iframe embebido + drag-and-drop de tarjetas
   ════════════════════════════════════════════════════════════════════════════ */
.site-embed-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    flex-direction: column;
    background: var(--bg, #0e1116);
}
.site-embed-modal.open { display: flex; }
.site-embed-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--card-bg, #171b22);
    border-bottom: 1px solid var(--border, #2a2f3a);
    flex: 0 0 auto;
}
.site-embed-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.site-embed-name { font-weight: 600; color: var(--text, #e6e9ef); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-embed-url { font-size: .72rem; color: var(--text-muted, #8b93a1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-embed-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.site-embed-status {
    font-size: .72rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: var(--text-muted, #8b93a1);
    white-space: nowrap;
}
.site-embed-status.ok { background: rgba(34,197,94,.15); color: #4ade80; }
.site-embed-status.blocked { background: rgba(245,158,11,.15); color: #fbbf24; }
.site-embed-body { flex: 1 1 auto; position: relative; background: #fff; overflow: hidden; }
.site-embed-iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.site-embed-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted, #8b93a1); background: var(--bg, #0e1116);
    font-size: .9rem;
}
.site-embed-blocked {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 12px; padding: 24px;
    background: var(--bg, #0e1116); color: var(--text, #e6e9ef);
}
.site-embed-blocked-icon { font-size: 2.6rem; }
.site-embed-blocked h3 { margin: 0; font-size: 1.15rem; }
.site-embed-blocked p { margin: 0; color: var(--text-muted, #8b93a1); max-width: 520px; }
.site-embed-reason {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .74rem !important;
    background: rgba(255,255,255,.05);
    padding: 6px 10px; border-radius: 6px; word-break: break-word;
}
.site-embed-fallback-hint {
    position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    background: var(--card-bg, #171b22); color: var(--text, #e6e9ef);
    border: 1px solid var(--border, #2a2f3a);
    padding: 8px 14px; border-radius: 10px; font-size: .8rem;
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
}

/* Drag-and-drop: pista visual mientras se arrastra */
.site-card { transition: box-shadow .15s ease; }
.site-card.sortable-chosen { cursor: grabbing; }
.site-card-ghost { opacity: .45; outline: 2px dashed var(--primary, #3b82f6); outline-offset: -2px; }

@media (max-width: 640px) {
    .site-embed-topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .site-embed-title { flex: 1 1 100%; order: 1; }
    .site-embed-actions { flex: 1 1 100%; order: 2; justify-content: flex-end; }
    .site-embed-status { display: none; }
}

/* ===== Logs: KPI por nivel (estilo PowerTools) + badges de nivel — 2026-07-02 ===== */
.lk-card { cursor: pointer; user-select: none; }
.lk-card.lk-error .stat-value { color: #ef4444; }
.lk-card.lk-warning .stat-value { color: #f59e0b; }
.lk-card.lk-info .stat-value { color: #3b82f6; }
.lk-card.lk-debug .stat-value { color: #a855f7; }
.lk-card.active { outline: 2px solid var(--primary); outline-offset: -2px; }
.lk-card.lk-error.active { outline-color: #ef4444; background: rgba(239,68,68,0.08); }
.lk-card.lk-warning.active { outline-color: #f59e0b; background: rgba(245,158,11,0.08); }
.lk-card.lk-info.active { outline-color: #3b82f6; background: rgba(59,130,246,0.08); }
.lk-card.lk-debug.active { outline-color: #a855f7; background: rgba(168,85,247,0.08); }
.le-level-badge {
    display: inline-block; font-size: .62rem; font-weight: 700; text-transform: uppercase;
    padding: 1px 6px; border-radius: 4px; margin-right: 6px; vertical-align: middle;
    background: rgba(148,163,184,0.2); color: var(--text-muted);
}
.le-level-badge.error { background: rgba(239,68,68,0.25); color: #fca5a5; }
.le-level-badge.warning { background: rgba(245,158,11,0.25); color: #fcd34d; }
.le-level-badge.info { background: rgba(59,130,246,0.2); color: #93c5fd; }
.le-level-badge.debug { background: rgba(168,85,247,0.2); color: #d8b4fe; }

/* ===== Mejoras Log Viewer 2026-07-10 (select all, live, highlight, interactivo) ===== */
.le-all-btn { font-size: 0.72rem; padding: 1px 8px; }
.le-live-label { font-size: 0.75rem; user-select: none; }
.le-line-num { font-family: ui-monospace, monospace; font-size: 0.7rem; color: #64748b; min-width: 32px; display: inline-block; text-align: right; margin-right: 6px; opacity: 0.7; }
.le-raw { flex: 1; word-break: break-word; }
.le-time { color: var(--text-muted); margin-right: 4px; font-size: 0.8rem; }
.log-line { display: flex; align-items: flex-start; gap: 4px; padding: 3px 6px; border-radius: 3px; margin-bottom: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.25; }
.le-line-btn { font-size: 0.65rem; padding: 0 4px; margin-left: auto; background: rgba(148,163,184,0.15); border: 1px solid rgba(148,163,184,0.3); border-radius: 3px; cursor: pointer; opacity: 0.7; }
.le-line-btn:hover { opacity: 1; background: rgba(148,163,184,0.3); }
.log-highlight { background: #fde047; color: #111827; padding: 0 1px; border-radius: 2px; font-weight: 600; }

/* ===== Explorador/Editor de archivos (estilo PowerTools Code Studio) — 2026-07-02 ===== */
.fe-toolbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.fe-toolbar .fe-status { margin-left: auto; font-size: .8rem; color: var(--text-muted); }
.fe-toolbar .fe-danger { border-color: rgba(239,68,68,.4); color: #fca5a5; }
.fe-badge-ro { background: rgba(245,158,11,.2); color: #fcd34d; padding: 1px 6px; border-radius: 4px; font-size: .7rem; }
.fe-badge-dirty { color: #fcd34d; font-size: .75rem; }
.fe-badge-ok { color: #4ade80; font-size: .75rem; }
.fe-searchbar { display: flex; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.fe-searchbar input { flex: 1; min-width: 140px; background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155); color: inherit; border-radius: 6px; padding: .4rem .6rem; font-size: .85rem; }
#fe-search-results, #fe-history { background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155); border-radius: 8px; padding: .5rem; margin-bottom: .75rem; max-height: 260px; overflow-y: auto; }
.fe-search-hit { padding: .35rem .5rem; border-radius: 6px; cursor: pointer; font-size: .8rem; display: flex; flex-direction: column; gap: 2px; }
.fe-search-hit:hover { background: rgba(148,163,184,.1); }
.fe-search-hit code { color: var(--primary); }
.fe-hist-row { display: flex; align-items: center; justify-content: space-between; padding: .3rem .5rem; font-size: .8rem; }
.fe-layout { display: flex; gap: .75rem; height: calc(100vh - 260px); min-height: 420px; }
.fe-tree { width: 300px; min-width: 220px; overflow: auto; background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155); border-radius: 8px; padding: .5rem; font-size: .82rem; }
.fe-children { margin-left: 14px; border-left: 1px dotted rgba(148,163,184,.25); padding-left: 6px; }
.fe-row { display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.fe-row:hover { background: rgba(148,163,184,.12); }
.fe-row.active { background: rgba(42,185,173,.18); }
.fe-row.fe-locked { opacity: .45; }
.fe-row em { margin-left: auto; font-style: normal; font-size: .7rem; color: var(--text-muted); }
.fe-caret { width: 12px; display: inline-block; color: var(--text-muted); }
.fe-muted { color: var(--text-muted); font-size: .78rem; padding: .3rem; }
.fe-editor-wrap { flex: 1; border: 1px solid var(--border, #334155); border-radius: 8px; overflow: hidden; }
#fe-editor { width: 100%; height: 100%; }
@media (max-width: 900px) {
  .fe-layout { flex-direction: column; height: auto; }
  .fe-tree { width: 100%; max-height: 300px; }
  .fe-editor-wrap { height: 60vh; }
}

/* ===== Scanner (escáner de seguridad estilo PowerTools) ===== */
.sc-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.sc-toolbar input[type="text"] { flex: 1; min-width: 260px; padding: 8px 10px; background: var(--bg-card, #1a1d24); color: var(--text, #e6e6e6); border: 1px solid var(--border, #2c313c); border-radius: 6px; }
.sc-toolbar select { padding: 8px 10px; background: var(--bg-card, #1a1d24); color: var(--text, #e6e6e6); border: 1px solid var(--border, #2c313c); border-radius: 6px; }
.sc-meta { margin: 10px 0; font-size: 0.85rem; color: var(--text-muted, #8a919e); }
.sc-muted { color: var(--text-muted, #8a919e); padding: 8px; font-size: 0.9rem; }
.sc-results { max-height: 55vh; overflow: auto; }
.sc-issue { border-bottom: 1px solid var(--border, #2c313c); padding: 10px 8px; }
.sc-issue-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sc-rule { font-weight: 600; font-size: 0.85rem; }
.sc-file { font-size: 0.8rem; opacity: 0.85; word-break: break-all; }
.sc-msg { font-size: 0.85rem; margin: 4px 0; color: var(--text-muted, #a5adba); }
.sc-snippet { font-size: 0.78rem; background: rgba(0,0,0,0.25); padding: 6px 8px; border-radius: 4px; overflow-x: auto; margin: 0; white-space: pre-wrap; word-break: break-all; }
/* Badges de severidad: rojo/naranja/amarillo/azul */
.sc-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.72rem; font-weight: 700; color: #fff; text-transform: uppercase; }
.sc-badge.sc-critical { background: #dc3545; }
.sc-badge.sc-high { background: #fd7e14; }
.sc-badge.sc-medium { background: #d4a017; }
.sc-badge.sc-low { background: #0d6efd; }
.sc-critical-txt { color: #dc3545; }
.sc-high-txt { color: #fd7e14; }
.sc-medium-txt { color: #d4a017; }
.sc-low-txt { color: #0d6efd; }
.sc-score-good { color: #28a745; }
.sc-score-warn { color: #d4a017; }
.sc-score-bad { color: #dc3545; }
.sc-hist-title { margin: 18px 0 8px; font-size: 1rem; }
.sc-history { border: 1px solid var(--border, #2c313c); border-radius: 8px; }
.sc-hist-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border, #2c313c); flex-wrap: wrap; }
.sc-hist-row:last-child { border-bottom: none; }
.sc-hist-info { font-size: 0.83rem; }
.sc-hist-actions { display: flex; gap: 6px; }
.sc-danger { color: #dc3545; }

/* ===== Command Center (réplica PowerTools) — 2026-07-02 ===== */
.cc-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px; padding: 14px 20px; margin-bottom: 1rem; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.cc-hero-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2); border-radius: 9px; font-size: 20px; }
.cc-hero h1 { font-size: 1.1rem; font-weight: 700; margin: 0; color: #fff; }
.cc-hero p { font-size: .75rem; margin: 0; color: rgba(255,255,255,.8); }
.cc-hero-stats { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cc-pill { background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 12px;
  font-size: .7rem; display: flex; align-items: center; gap: 6px; color: #fff; }
.cc-pill-live { background: rgba(72,187,120,.45); font-weight: 700; animation: ccPulse 2s infinite; }
.cc-pulse { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: ccPulse 1.5s infinite; }
@keyframes ccPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.cc-critical-alert { display: flex; align-items: center; gap: 10px; padding: .7rem 1rem;
  border: 1px solid #ef4444; border-radius: 8px; background: rgba(239,68,68,.12);
  margin-bottom: 1rem; font-size: .85rem; animation: ccPulse 2.5s infinite; }
.cc-critical-alert button { margin-left: auto; }
.cc-kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 1rem; }
.cc-kpi { border-radius: 12px; padding: 14px 16px; color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.cc-kpi-value { font-size: 1.45rem; font-weight: 700; }
.cc-kpi-label { font-size: .68rem; opacity: .85; text-transform: uppercase; letter-spacing: .4px; }
.cc-kpi-purple  { background: linear-gradient(135deg,#667eea,#764ba2); }
.cc-kpi-danger  { background: linear-gradient(135deg,#f56565,#c53030); }
.cc-kpi-warning { background: linear-gradient(135deg,#ed8936,#c05621); }
.cc-kpi-info    { background: linear-gradient(135deg,#4299e1,#2b6cb0); }
.cc-kpi-success { background: linear-gradient(135deg,#48bb78,#2f855a); }
.cc-kpi-cyan    { background: linear-gradient(135deg,#38b2ac,#285e61); }
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-widget { background: var(--bg-card, #1e293b); border: 1px solid var(--border, #334155);
  border-radius: 12px; overflow: hidden; }
.cc-widget-wide { grid-column: 1 / -1; }
.cc-widget-header { padding: 10px 16px; border-bottom: 1px solid var(--border, #334155);
  font-size: .85rem; font-weight: 600; }
.cc-widget-body { padding: 14px 16px; }
.cc-chart-box { height: 250px; position: relative; }
.cc-chart-sm { height: 200px; }
.cc-src-row { display: flex; justify-content: space-between; padding: .4rem .5rem;
  border-radius: 6px; cursor: pointer; font-size: .82rem; }
.cc-src-row:hover { background: rgba(148,163,184,.12); }
@media (max-width: 1200px) { .cc-kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .cc-kpi-row { grid-template-columns: repeat(2, 1fr); } .cc-grid { grid-template-columns: 1fr; } }

/* ===== Vulnerabilidades (sección Seguridad · añadido 2026-07-08) ===== */
.vq-cve-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.vq-cve { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px;
    background: var(--card-bg, #171b22); border: 1px solid var(--border, #2a2f3a);
    border-left: 3px solid #dc3545; border-radius: 6px; font-size: 0.82rem; }
.vq-cve-id { font-weight: 600; color: #dc3545; text-decoration: none; }
.vq-cve-id:hover { text-decoration: underline; }
.vq-cve-comp { color: var(--text, #e6e6e6); }
.vq-cve-due { color: var(--text-muted, #8a919e); font-size: 0.78rem; }

.vq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.vq-item { padding: 10px 12px; background: var(--card-bg, #171b22);
    border: 1px solid var(--border, #2a2f3a); border-left: 3px solid var(--text-muted, #8a919e);
    border-radius: 6px; }
.vq-item.vq-crit { border-left-color: #dc3545; }
.vq-item.vq-high { border-left-color: #fd7e14; }
.vq-item.vq-med  { border-left-color: #f0ad4e; }
.vq-item.vq-low  { border-left-color: #6c757d; }
.vq-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.vq-id { font-weight: 700; font-size: 0.82rem; letter-spacing: .3px; }
.vq-tier { font-size: 0.76rem; color: var(--text-muted, #8a919e); }
.vq-ssvc { font-size: 0.72rem; padding: 1px 6px; border-radius: 4px;
    background: rgba(220,53,69,.15); color: #dc3545; }
.vq-hallazgo { font-size: 0.88rem; color: var(--text, #e6e6e6); line-height: 1.4; }
.vq-estado { font-size: 0.78rem; color: var(--text-muted, #8a919e); margin-top: 4px; line-height: 1.35; }
.vq-term { font-size: 0.72rem; color: var(--text-muted, #8a919e); margin-top: 3px; opacity: .8; }
