﻿* {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html, body {
            width: 100%;
            max-width: 100vw;
            overflow-x: hidden;
        }

        body {
            font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: var(--bg-base);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding-top: 64px;
            background-image: 
                radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.1) 0%, transparent 40%);
            background-attachment: fixed;
        }

        /* Glassmorphism Navigation */
        .navbar {
            background: var(--bg-navbar);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border-color);
            position: fixed;
            top: 0;
            left: 0;
            z-index: 1000;
            padding: 0.85rem 1.5rem;
            width: 100%;
        }

        .nav-container {
            max-width: 1850px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            gap: 0.5rem;
            transition: max-width 0.25s ease, width 0.25s ease;
        }

        .nav-brand-group {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-shrink: 0;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
            color: var(--text-main);
            font-family: 'Outfit', sans-serif;
            font-weight: 800;
            font-size: 1.35rem;
            letter-spacing: -0.02em;
            white-space: nowrap;
        }

        .brand-icon {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, var(--primary), #8b5cf6);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
            box-shadow: 0 4px 12px var(--primary-glow);
            flex-shrink: 0;
        }

        .nav-user {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-shrink: 0;
        }

        .user-avatar {
            width: 34px;
            height: 34px;
            border-radius: 50%;
            border: 2px solid var(--primary);
            object-fit: cover;
            flex-shrink: 0;
        }

        .user-badge {
            font-size: 0.72rem;
            padding: 0.2rem 0.55rem;
            border-radius: 6px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            white-space: nowrap;
        }
        .badge-admin { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
        .badge-user { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.4); }

        .btn {
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-weight: 600;
            font-size: 0.88rem;
            padding: 0.6rem 1.2rem;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            text-decoration: none;
            white-space: nowrap;
        }

        .mobile-toggle {
            display: none;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            padding: 0.4rem 0.65rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1.25rem;
            line-height: 1;
        }
        .mobile-toggle:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        /* Sidebar Backdrop Overlay */
        .sidebar-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 150;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
            pointer-events: none;
        }
        .sidebar-backdrop.active {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }

        .sidebar-mobile-header {
            display: none;
        }

        @media (max-width: 900px) {
            .mobile-toggle {
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }
            .app-layout {
                flex-direction: column !important;
                position: relative;
                width: 100% !important;
            }
            .sidebar {
                position: fixed !important;
                top: 0 !important;
                left: 0 !important;
                width: 280px !important;
                max-width: 85vw !important;
                height: 100vh !important;
                z-index: 200 !important;
                transform: translateX(-100%) !important;
                transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
                box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6) !important;
                display: flex !important;
                padding: 1.25rem 1rem !important;
                background: var(--bg-sidebar) !important;
            }
            .sidebar.active {
                transform: translateX(0) !important;
            }
            .sidebar-mobile-header {
                display: flex !important;
                justify-content: space-between;
                align-items: center;
                padding-bottom: 1rem;
                border-bottom: 1px solid var(--border-color);
                margin-bottom: 0.5rem;
            }
            .sidebar-close-btn {
                background: rgba(255, 255, 255, 0.08);
                border: 1px solid var(--border-color);
                color: var(--text-main);
                width: 32px;
                height: 32px;
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                font-size: 0.9rem;
            }
            .sidebar-mobile-logout {
                display: inline-flex !important;
            }
            .main-content {
                padding: 1rem 0.25rem !important;
                width: 100% !important;
            }
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), #4f46e5);
            color: white;
            box-shadow: 0 4px 14px var(--primary-glow);
        }
        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px var(--primary-glow);
        }

        .btn-puffer {
            background: linear-gradient(135deg, #0ea5e9, #0284c7);
            color: white;
            box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
        }
        .btn-puffer:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
            color: white;
        }

        .btn-outline {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-main);
            border: 1px solid var(--border-color);
        }
        .btn-outline:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.2);
        }

        /* Container & Layout */
        .container {
            max-width: 1850px;
            margin: 0 auto;
            padding: 2.5rem 1.5rem;
            flex: 1;
            width: 100%;
            transition: max-width 0.25s ease, width 0.25s ease;
        }

        /* Fluid Layout for Ultra-Wide / 4K / Multi-Monitor Screens */
        html.fluid-layout .nav-container,
        body.fluid-layout .nav-container {
            max-width: 98vw !important;
            width: 98vw !important;
            padding-left: 1vw !important;
            padding-right: 1vw !important;
        }

        html.fluid-layout .container,
        body.fluid-layout .container {
            max-width: 98vw !important;
            width: 98vw !important;
            padding-left: 1.5vw !important;
            padding-right: 1.5vw !important;
        }

        /* Screen Fluid Toggle Button in Navbar */
        .btn-layout-toggle {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 0.35rem 0.75rem;
            font-size: 0.76rem;
            font-weight: 700;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            white-space: nowrap;
        }
        .btn-layout-toggle:hover {
            background: rgba(99, 102, 241, 0.18);
            border-color: rgba(99, 102, 241, 0.4);
            color: #a5b4fc;
            transform: translateY(-1px);
        }
        html.fluid-layout .btn-layout-toggle {
            background: rgba(56, 189, 248, 0.18);
            border-color: rgba(56, 189, 248, 0.45);
            color: #38bdf8;
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
        }

        /* Standby Simulated Node Badge & Accents */
        .badge-standby {
            background: rgba(245, 158, 11, 0.15) !important;
            color: #fbbf24 !important;
            border: 1px solid rgba(245, 158, 11, 0.35) !important;
        }

        /* Fixed Floating Toast Notifications (Zero Layout Shift) */
        .toast-container {
            position: fixed;
            top: 75px;
            right: 24px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            max-width: 480px;
            width: calc(100% - 48px);
            pointer-events: none;
        }

        .alert {
            pointer-events: auto;
            padding: 0.9rem 1.25rem;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            font-size: 0.9rem;
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
            backdrop-filter: blur(16px);
            animation: slideInToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }

        @keyframes slideInToast {
            from {
                opacity: 0;
                transform: translateY(-16px) scale(0.96);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .alert-success { background: rgba(16, 185, 129, 0.95); border: 1px solid #10b981; color: #ffffff; }
        .alert-error { background: rgba(239, 68, 68, 0.95); border: 1px solid #ef4444; color: #ffffff; }

        /* Hero / Non-logged-in Landing (Exact Match to Legacy High-End Aesthetic) */
        .hero-section {
            text-align: center;
            padding: 4.5rem 1rem 3rem 1rem;
            max-width: 920px;
            margin: 0 auto;
        }
        .hero-title {
            font-family: 'Outfit', sans-serif;
            font-size: 3.1rem;
            font-weight: 800;
            line-height: 1.25;
            margin-bottom: 1.5rem;
            color: #ffffff;
            letter-spacing: -0.02em;
        }
        .hero-subtitle {
            font-size: 1.15rem;
            color: #94a3b8;
            margin-bottom: 3.5rem;
            line-height: 1.7;
        }

        /* Feature Cards (2-Column Panorama Grid from Legacy Design) */
        .features-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
            max-width: 860px;
            margin: 0 auto;
            text-align: center;
        }
        .feature-card {
            background: var(--bg-card);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 20px;
            padding: 2.25rem 2rem;
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            transition: all 0.25s ease;
        }
        .feature-card:hover {
            border-color: rgba(99, 102, 241, 0.35);
            transform: translateY(-3px);
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
        }
        .feature-icon {
            font-size: 1.85rem;
            color: #818cf8;
            margin-bottom: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .feature-card h3 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.22rem;
            font-weight: 700;
            color: #ffffff;
            margin-bottom: 0.65rem;
            letter-spacing: -0.01em;
        }
        .feature-card p {
            font-size: 0.9rem;
            color: #94a3b8;
            line-height: 1.6;
        }

        @media (max-width: 768px) {
            .hero-title {
                font-size: 2.2rem;
            }
            .hero-subtitle {
                font-size: 1rem;
            }
            .features-grid {
                grid-template-columns: 1fr;
                gap: 1.25rem;
            }
        }

        /* Dashboard View (Logged In) */
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .dashboard-title h1 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.85rem;
            font-weight: 700;
        }
        .dashboard-title p {
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        /* Banner Card */
        .puffer-banner {
            background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(99, 102, 241, 0.15));
            border: 1px solid rgba(14, 165, 233, 0.3);
            border-radius: 16px;
            padding: 1.5rem 1.75rem;
            margin-bottom: 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1.25rem;
        }
        .puffer-banner-text h3 {
            font-size: 1.2rem;
            font-weight: 700;
            color: #38bdf8;
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .puffer-banner-text p {
            color: var(--text-muted);
            font-size: 0.88rem;
        }

        /* ========================================================================= */
        /* --- Panorama Server Card & Control Center --- */
        /* ========================================================================= */
        .panorama-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 2rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.35);
            margin-top: 1rem;
            width: 100%;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }

        .panorama-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 1.5rem;
            margin-bottom: 1.75rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .server-title-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .server-heading {
            font-size: 1.6rem;
            font-weight: 800;
            color: var(--text-primary);
            margin: 0;
            letter-spacing: -0.02em;
            word-break: break-word;
        }

        .btn-rename-trigger {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 1.1rem;
            padding: 0.25rem;
            transition: color 0.2s ease;
        }
        .btn-rename-trigger:hover {
            color: var(--primary);
        }

        .server-meta-row {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-top: 0.35rem;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            flex-wrap: wrap;
        }

        .server-plan-badge {
            background: rgba(99, 102, 241, 0.15);
            color: #a5b4fc;
            padding: 0.15rem 0.55rem;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.78rem;
        }

        .server-vmid-badge {
            font-family: 'JetBrains Mono', monospace;
            color: #818cf8;
            font-weight: 700;
            font-size: 0.88rem;
        }

        .meta-separator {
            color: var(--border-color);
        }

        .panorama-header-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .btn-open-panel {
            padding: 0.65rem 1.4rem;
            font-size: 0.92rem;
            font-weight: 700;
        }

        .panorama-grid {
            display: grid;
            grid-template-columns: 1fr 1.35fr;
            gap: 2rem;
            align-items: start;
            width: 100%;
        }

        .server-specs-col {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            min-width: 0;
        }

        .server-specs-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 1.4rem;
        }

        .specs-card-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-secondary);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .server-info-list {
            list-style: none;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
        }

        .server-info-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.7rem 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            gap: 0.75rem;
        }
        .server-info-item:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }
        .server-info-item:first-child {
            padding-top: 0;
        }

        .info-label {
            color: var(--text-muted);
            font-size: 0.85rem;
            white-space: nowrap;
        }

        .info-val {
            font-weight: 600;
            font-size: 0.88rem;
            text-align: right;
            word-break: break-word;
        }

        .font-mono {
            font-family: 'JetBrains Mono', monospace;
        }

        .text-days-left {
            color: #38bdf8;
            font-weight: 700;
        }

        .server-controls-wrapper {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }

        .server-ctrl-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            gap: 0.6rem;
            width: 100%;
        }

        .ctrl-form {
            margin: 0;
            width: 100%;
        }

        .btn-ctrl {
            width: 100%;
            justify-content: center;
            padding: 0.7rem 0.6rem;
            font-size: 0.85rem;
        }

        .btn-start-server {
            width: 100%;
            justify-content: center;
            background: #10b981;
            border-color: #10b981;
            padding: 0.7rem 0.6rem;
            font-weight: 700;
        }
        .btn-start-server:hover {
            background: #059669;
            border-color: #059669;
        }

        .btn-stop-server {
            color: #f87171 !important;
            border-color: rgba(239, 68, 68, 0.4) !important;
        }
        .btn-stop-server:hover {
            background: rgba(239, 68, 68, 0.15) !important;
        }

        .btn-delete-server {
            color: #f87171 !important;
            border-color: rgba(239, 68, 68, 0.3) !important;
        }
        .btn-delete-server:hover {
            background: rgba(239, 68, 68, 0.15) !important;
        }

        .btn-extend-action {
            width: 100%;
            justify-content: center;
            padding: 0.7rem 1rem;
            border-color: rgba(99, 102, 241, 0.35);
        }

        /* PBS Backup Card */
        .pbs-backup-card {
            background: var(--bg-surface);
            border: 1px solid rgba(99, 102, 241, 0.25);
            border-radius: 16px;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            min-width: 0;
        }

        .pbs-backup-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .pbs-title {
            font-size: 1.05rem;
            font-weight: 800;
            color: var(--text-primary);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .pbs-subtitle {
            font-size: 0.8rem;
            color: #94a3b8;
            margin-top: 0.35rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .pbs-count {
            color: #38bdf8;
            font-weight: 600;
            font-family: 'JetBrains Mono', monospace;
        }

        .pbs-create-form {
            margin: 0;
        }

        .btn-create-backup {
            background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
            border: none;
            padding: 0.55rem 1.1rem;
            font-size: 0.82rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .pbs-snapshot-list {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            max-height: 280px;
            overflow-y: auto;
            padding-right: 0.25rem;
        }

        .pbs-snapshot-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(30, 41, 59, 0.75);
            border: 1px solid var(--border-color);
            padding: 0.7rem 1.1rem;
            border-radius: 10px;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .pbs-snapshot-info {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .pbs-snapshot-icon {
            background: rgba(56, 189, 248, 0.12);
            color: #38bdf8;
            border-radius: 8px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .pbs-snapshot-time {
            color: var(--text-primary);
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.88rem;
        }

        .pbs-snapshot-meta {
            color: var(--text-muted);
            font-size: 0.75rem;
            margin-top: 0.15rem;
        }

        .pbs-restore-form {
            margin: 0;
        }

        .btn-restore-snapshot {
            border-color: rgba(56, 189, 248, 0.4);
            color: #38bdf8;
            font-size: 0.8rem;
            padding: 0.4rem 0.9rem;
            font-weight: 600;
        }

        .pbs-empty-box {
            background: rgba(30, 41, 59, 0.4);
            border: 1px dashed rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 2rem 1.5rem;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.88rem;
            line-height: 1.6;
        }

        .status-migrating {
            background: rgba(234, 179, 8, 0.15);
            color: #facc15;
            border: 1px solid rgba(234, 179, 8, 0.4);
            padding: 0.5rem 1rem;
            font-size: 0.85rem;
            font-weight: 700;
        }
        .status-stopped {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.3);
            padding: 0.5rem 1rem;
            font-size: 0.85rem;
        }
        .status-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.25rem 0.65rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
        }
        .status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
        .status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

        /* Modal */
        .modal-backdrop {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }
        .modal-backdrop.active { display: flex; }
        .modal-content {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 2rem;
            max-width: 480px;
            width: 90%;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
        }
        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 1rem;
        }
        .form-group {
            margin-bottom: 1.25rem;
        }
        .form-label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 0.4rem;
            color: var(--text-muted);
        }
        .form-input, .form-select, select {
            width: 100%;
            padding: 0.6rem 0.85rem;
            background: #1e293b !important;
            border: 1px solid var(--border-color);
            border-radius: 10px;
            color: #f8fafc !important;
            font-family: inherit;
            font-size: 0.88rem;
            color-scheme: dark;
            cursor: pointer;
        }
        .form-input:focus, .form-select:focus, select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 2px var(--primary-glow);
        }
        select option {
            background-color: #0f172a !important;
            color: #f8fafc !important;
            padding: 0.6rem 0.85rem;
        }
        .app-layout {
            display: flex;
            min-height: calc(100vh - 64px);
            width: 100%;
            position: relative;
        }
        .sidebar {
            width: 250px;
            background: var(--bg-sidebar);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-right: 1px solid var(--border-color);
            padding: 1.5rem 0.85rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            flex-shrink: 0;
            position: fixed;
            top: 64px;
            left: 0;
            height: calc(100vh - 64px);
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
            z-index: 100;
        }
        .sidebar::-webkit-scrollbar {
            width: 5px;
        }
        .sidebar::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }
        .main-content {
            flex: 1;
            margin-left: 250px;
            min-width: 0;
            width: calc(100% - 250px);
            padding: 1.5rem 2rem 3rem 2rem;
            box-sizing: border-box;
        }

        /* Quick Charge Grid & Dedicated Responsive Buttons */
        .quick-charge-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.65rem;
            width: 100%;
            box-sizing: border-box;
        }
        .charge-btn {
            width: 100% !important;
            box-sizing: border-box !important;
            min-width: 0 !important;
            padding: 0.6rem 0.5rem !important;
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            gap: 0.2rem !important;
            border: 1px solid rgba(99, 102, 241, 0.35) !important;
            border-radius: 10px !important;
            background: rgba(99, 102, 241, 0.06) !important;
            color: #ffffff !important;
            transition: all 0.2s ease !important;
        }
        .charge-btn:hover {
            background: rgba(99, 102, 241, 0.18) !important;
            border-color: #818cf8 !important;
            transform: translateY(-1px);
        }
        .charge-btn-pt {
            font-weight: 800;
            color: #facc15;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.78rem;
            white-space: nowrap;
            letter-spacing: -0.02em;
        }
        .charge-btn-yen {
            font-size: 0.72rem;
            color: var(--text-muted);
            font-family: 'JetBrains Mono', monospace;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .sidebar-section-title {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            font-weight: 700;
            padding: 0 0.75rem;
            margin-bottom: 0.5rem;
        }
        .sidebar-menu {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }
        .sidebar-link {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.65rem 0.85rem;
            border-radius: 10px;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.88rem;
            font-weight: 600;
            transition: all 0.2s ease;
        }
        .sidebar-link:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.06);
        }
        .sidebar-link.active {
            color: #fff;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.35));
            border: 1px solid rgba(99, 102, 241, 0.4);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
        }
        .main-content {
            flex: 1;
            padding: 2.25rem 2.5rem;
            min-width: 0;
            overflow-x: auto;
        }

        /* Data Tables */
        .data-table-container {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            overflow-x: auto;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .data-table {
            width: 100%;
            border-collapse: collapse;
            text-align: left;
            font-size: 0.88rem;
            white-space: nowrap;
        }
        .data-table th {
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-muted);
            font-weight: 700;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            white-space: nowrap;
        }
        .data-table td {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            vertical-align: middle;
            white-space: nowrap;
        }
        .data-table tr:hover {
            background: rgba(255, 255, 255, 0.02);
        }
        .btn-sm {
            padding: 0.35rem 0.75rem;
            font-size: 0.78rem;
            border-radius: 8px;
        }
        .btn-danger {
            background: rgba(239, 68, 68, 0.2);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.4);
        }
        .btn-danger:hover {
            background: rgba(239, 68, 68, 0.35);
        }
        .btn-success {
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
            border: 1px solid rgba(16, 185, 129, 0.4);
        }
        .btn-success:hover {
            background: rgba(16, 185, 129, 0.35);
        }

        /* Heatmap & Memory Grid Cell Styles */
        .mem-grid-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        .mem-node-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            padding: 1.5rem;
            position: relative;
            overflow: hidden;
        }
        .mem-cells-wrapper {
            display: grid;
            grid-template-columns: repeat(16, minmax(0, 1fr));
            gap: 3px;
            background: rgba(0, 0, 0, 0.35);
            padding: 8px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
        }
        .disk-cells-wrapper {
            display: grid;
            grid-template-columns: repeat(10, minmax(0, 1fr));
            gap: 3px;
            background: rgba(0, 0, 0, 0.35);
            padding: 8px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            width: 100%;
            box-sizing: border-box;
            overflow: hidden;
        }
        @media (max-width: 580px) {
            .mem-cells-wrapper {
                grid-template-columns: repeat(8, minmax(0, 1fr));
            }
        }
        .mem-cell {
            aspect-ratio: 1 / 1;
            border-radius: 4px;
            position: relative;
            cursor: pointer;
            transition: all 0.18s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.52rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            user-select: none;
            box-sizing: border-box;
            min-width: 0;
            overflow: hidden;
        }
        .mem-cell:hover, .cell-highlight-linked {
            transform: scale(1.18);
            z-index: 30;
            box-shadow: 0 0 14px rgba(255, 255, 255, 0.7) !important;
            border: 2px solid #ffffff !important;
        }
        /* Reserved System Cell */
        .mem-cell-reserved {
            background: repeating-linear-gradient(45deg, #1e293b, #1e293b 3px, #0f172a 3px, #0f172a 6px);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: #64748b;
        }
        /* Core Infrastructure Cell */
        .mem-cell-core {
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(126, 34, 206, 0.6));
            border: 1px solid #a855f7;
            color: #e9d5ff;
        }
        /* Free Slot Cell */
        .mem-cell-free {
            background: rgba(16, 185, 129, 0.03);
            border: 1px dashed rgba(16, 185, 129, 0.25);
            color: rgba(52, 211, 153, 0.4);
        }
        .mem-cell-free:hover {
            background: rgba(16, 185, 129, 0.15);
            border-color: #34d399;
        }
        /* Dynamic Overcommit Slot Cell (超過プロビジョニング枠) */
        .mem-cell-overcommit {
            background: rgba(168, 85, 247, 0.04) !important;
            border: 1px dashed rgba(168, 85, 247, 0.38) !important;
            color: rgba(192, 132, 252, 0.5) !important;
        }
        .mem-cell-overcommit:hover {
            background: rgba(168, 85, 247, 0.2) !important;
            border-color: #c084fc !important;
            color: #ffffff !important;
        }
        /* Physical Boundary Line Marker across 8 columns */
        .mem-divider-physical {
            grid-column: 1 / -1;
            margin: 0.35rem 0;
            padding: 0.2rem 0.5rem;
            background: rgba(245, 158, 11, 0.12);
            border: 1px dashed rgba(245, 158, 11, 0.4);
            border-radius: 6px;
            font-size: 0.68rem;
            font-weight: 800;
            color: #fbbf24;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-family: 'JetBrains Mono', monospace;
            box-sizing: border-box;
            width: 100%;
        }
        /* Active Container Cell */
        .mem-cell-active {
            border: 1px solid rgba(255, 255, 255, 0.35);
            color: #ffffff;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8);
            box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
        }
        .mem-cell-highload {
            animation: heatPulse 1.6s infinite alternate;
        }
        @keyframes heatPulse {
            0% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); border-color: #f59e0b; }
            100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.9); border-color: #ef4444; }
        }

        /* Drag & Drop Live Migration Styles */
        .mem-cell-draggable {
            cursor: grab !important;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .mem-cell-draggable:active {
            cursor: grabbing !important;
        }
        .mem-cell-dragging {
            opacity: 0.35 !important;
            transform: scale(0.9) !important;
            border: 2px dashed #38bdf8 !important;
        }
        .node-card-droppable {
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }
        .node-card-drop-hover {
            border: 2px solid #34d399 !important;
            box-shadow: 0 0 30px rgba(52, 211, 153, 0.45) !important;
            background: rgba(16, 185, 129, 0.06) !important;
            transform: translateY(-2px);
        }
        .node-card-drop-hover::after {
            content: "📥 ここにドロップして安全移動（PBS経由）";
            position: absolute;
            top: 10px;
            right: 15px;
            background: linear-gradient(135deg, #10b981, #059669);
            color: #ffffff;
            font-size: 0.76rem;
            font-weight: 800;
            padding: 0.3rem 0.75rem;
            border-radius: 20px;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
            pointer-events: none;
            z-index: 50;
            animation: bounceIn 0.25s ease;
        }
        .node-card-drop-denied {
            border: 2px solid #ef4444 !important;
            box-shadow: 0 0 30px rgba(239, 68, 68, 0.4) !important;
            background: rgba(239, 68, 68, 0.06) !important;
            cursor: not-allowed;
        }
        .node-card-drop-denied::after {
            content: "🚫 空き容量不足のため移動できません";
            position: absolute;
            top: 10px;
            right: 15px;
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: #ffffff;
            font-size: 0.76rem;
            font-weight: 800;
            padding: 0.3rem 0.75rem;
            border-radius: 20px;
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
            pointer-events: none;
            z-index: 50;
        }
        @keyframes bounceIn {
            0% { transform: scale(0.8); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }

        /* Mode Switch Tab */
        .heatmap-tab-btn {
            padding: 0.5rem 1.15rem;
            font-size: 0.85rem;
            font-weight: 700;
            border-radius: 10px;
            border: 1px solid var(--border-color);
            background: rgba(15, 23, 42, 0.6);
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
        }
        .heatmap-tab-btn.active {
            background: rgba(99, 102, 241, 0.2);
            color: #818cf8;
            border-color: #6366f1;
            box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
        }

        /* Tooltip Popup */
        .mem-tooltip {
            position: fixed;
            pointer-events: none;
            background: rgba(15, 23, 42, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(12px);
            border-radius: 10px;
            padding: 0.75rem 1rem;
            font-size: 0.8rem;
            color: #f1f5f9;
            box-shadow: 0 10px 25px rgba(0,0,0,0.6);
            z-index: 99999;
            display: none;
            line-height: 1.5;
            max-width: 280px;
        }

        /* Footer & Responsive Enhancements */
        footer {
            margin-top: auto;
            padding: 2rem 1.5rem;
            text-align: center;
            border-top: 1px solid var(--border-color);
            color: var(--text-muted);
            font-size: 0.84rem;
            background: rgba(10, 14, 23, 0.6);
        }

        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            flex-wrap: wrap;
            margin-bottom: 1.75rem;
        }
        .dashboard-title h1 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.75rem;
            font-weight: 800;
            margin-bottom: 0.4rem;
            letter-spacing: -0.02em;
        }
        .dashboard-title p {
            color: var(--text-muted);
            font-size: 0.92rem;
        }

        .btn-points-badge {
            padding: 0.38rem 0.75rem;
            font-size: 0.84rem;
            border-color: rgba(234, 179, 8, 0.4);
            color: #facc15;
            font-weight: 700;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            background: rgba(234, 179, 8, 0.08);
            border-radius: 9999px;
            white-space: nowrap;
        }

        .btn-points-badge .points-coin-icon {
            font-size: 0.95rem;
            color: #facc15;
        }

        .btn-points-badge .points-amount {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 800;
        }

        [data-theme="light"] .btn-points-badge {
            color: #b45309;
            border-color: #fde68a;
            background: #fef3c7;
        }

        .user-profile-summary {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .fallback-avatar {
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            color: white;
        }

        .btn-logout {
            padding: 0.42rem 0.75rem;
            font-size: 0.82rem;
            border-radius: 8px;
        }

        /* Tier 1: Width <= 1100px (Laptops, Medium Windows) */
        @media (max-width: 1100px) {
            .btn-logout {
                padding: 0.42rem 0.6rem !important;
            }
            .btn-logout .logout-text {
                display: none !important;
            }
            .nav-user {
                gap: 0.5rem !important;
            }
        }

        /* Tier 2: Width <= 880px (Tablets, Split Windows, e.g. 787px) */
        @media (max-width: 880px) {
            .navbar {
                padding: 0.65rem 0.85rem !important;
            }
            .nav-container {
                gap: 0.35rem !important;
            }
            .brand-name {
                font-size: 1.1rem !important;
            }
            .brand-icon {
                width: 32px !important;
                height: 32px !important;
                font-size: 1rem !important;
            }
            .nav-user {
                gap: 0.35rem !important;
            }
            .user-profile-summary .user-badge {
                display: none !important;
            }
            .btn-points-badge {
                padding: 0.32rem 0.5rem !important;
                font-size: 0.8rem !important;
                gap: 0.25rem !important;
            }
            .btn-points-badge .points-unit {
                display: none !important;
            }
            .btn-layout-toggle {
                display: none !important;
            }
        }

        /* Tier 3: Width <= 768px (Mobile Devices) */
        @media (max-width: 768px) {
            body {
                padding-top: 54px !important;
            }
            .navbar {
                padding: 0.5rem 0.65rem !important;
            }
            .nav-container {
                gap: 0.25rem !important;
                width: 100% !important;
            }
            .nav-brand-group {
                gap: 0.35rem !important;
                flex-shrink: 0 !important;
            }
            .brand {
                gap: 0.35rem !important;
            }
            .brand-name {
                display: none !important;
            }
            .brand-icon {
                width: 30px !important;
                height: 30px !important;
                font-size: 0.95rem !important;
                border-radius: 8px !important;
            }
            .nav-user {
                gap: 0.25rem !important;
                flex-shrink: 0 !important;
            }
            .btn-layout-toggle {
                display: none !important;
            }
            .user-avatar {
                width: 30px !important;
                height: 30px !important;
            }
            .btn-logout {
                padding: 0.3rem 0.45rem !important;
                font-size: 0.8rem !important;
            }
            .btn-logout .logout-text {
                display: none !important;
            }
            .btn-points-badge {
                padding: 0.25rem 0.4rem !important;
                font-size: 0.75rem !important;
                gap: 0.2rem !important;
            }
            .theme-switcher-pill {
                padding: 2px !important;
                gap: 1px !important;
            }
            .theme-pill-btn {
                padding: 0.22rem 0.32rem !important;
                font-size: 0.75rem !important;
            }
            .container {
                padding: 1rem 0.65rem !important;
            }
            .dashboard-header {
                flex-direction: column;
                align-items: stretch;
                gap: 0.75rem;
                margin-bottom: 1.25rem;
            }
            .dashboard-title h1 {
                font-size: 1.4rem !important;
            }
            .dashboard-title p {
                font-size: 0.84rem !important;
            }

            /* Panorama Card Mobile Rules */
            .panorama-card {
                padding: 1.25rem 0.85rem !important;
                border-radius: 16px !important;
                margin-top: 0.5rem !important;
            }
            .panorama-card-header {
                flex-direction: column;
                align-items: stretch;
                gap: 1rem;
                padding-bottom: 1.25rem;
                margin-bottom: 1.25rem;
            }
            .server-heading {
                font-size: 1.28rem !important;
            }
            .panorama-header-actions {
                display: flex;
                flex-direction: column;
                width: 100%;
                gap: 0.65rem;
            }
            .btn-open-panel {
                width: 100% !important;
                justify-content: center;
                padding: 0.75rem 1rem !important;
                font-size: 0.95rem !important;
            }
            .panorama-header-actions-desktop {
                display: none !important;
            }
            .panorama-grid {
                grid-template-columns: 1fr !important;
                gap: 1.25rem !important;
            }
            .server-specs-card {
                padding: 1.1rem 0.85rem !important;
            }
            .server-info-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.25rem;
                padding: 0.6rem 0;
            }
            .info-label {
                font-size: 0.78rem;
            }
            .info-val {
                font-size: 0.88rem;
                text-align: left;
            }
            .server-ctrl-grid {
                grid-template-columns: 1fr 1fr !important;
                gap: 0.5rem !important;
            }
            .ctrl-form-danger {
                grid-column: span 2 !important;
            }
            .btn-ctrl {
                width: 100%;
                padding: 0.65rem 0.45rem !important;
                font-size: 0.82rem !important;
            }
            .btn-extend-action {
                width: 100%;
                justify-content: center;
                padding: 0.7rem 0.65rem !important;
                font-size: 0.84rem !important;
            }

            /* PBS Backup Section Mobile */
            .pbs-backup-card {
                padding: 1.1rem 0.85rem !important;
            }
            .pbs-backup-header {
                flex-direction: column;
                align-items: stretch;
                gap: 0.75rem;
            }
            .pbs-title {
                font-size: 0.98rem !important;
            }
            .btn-create-backup {
                width: 100% !important;
                justify-content: center;
                padding: 0.65rem 1rem !important;
                font-size: 0.85rem !important;
            }
            .pbs-snapshot-item {
                flex-direction: row !important;
                align-items: center !important;
                justify-content: space-between !important;
                gap: 0.5rem !important;
                padding: 0.65rem 0.75rem !important;
            }
            .btn-restore-snapshot {
                width: auto !important;
                white-space: nowrap !important;
                padding: 0.35rem 0.65rem !important;
            }

            .quick-charge-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
                gap: 0.5rem !important;
            }
            .point-charge-btn {
                padding: 0.65rem 0.65rem !important;
            }
        }

        @media (max-width: 440px) {
            .navbar {
                padding: 0.55rem 0.65rem !important;
            }
            .brand-name {
                font-size: 1rem !important;
            }
            .container {
                padding: 0.75rem 0.45rem !important;
            }
            .panorama-card {
                padding: 1rem 0.65rem !important;
            }
            .quick-charge-grid {
                grid-template-columns: 1fr !important;
            }
        }

[data-theme="light"] .hero-title {
    color: #0f172a !important;
}

[data-theme="light"] .hero-subtitle {
    color: #475569 !important;
}

[data-theme="light"] .stat-card,
[data-theme="light"] .card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidebar-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

[data-theme="light"] .sidebar-link.active {
    background: #eef2ff;
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

[data-theme="light"] .table-dark {
    background: #ffffff;
    color: #0f172a;
}

[data-theme="light"] .table-dark th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .table-dark td {
    border-bottom: 1px solid #f1f5f9;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .modal-title {
    color: #0f172a;
}

[data-theme="light"] pre,
[data-theme="light"] code {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}


/* ========================================================================= */
/* --- Next-Gen Dual-Bar Overcommit Matrix Gauges --- */
/* ========================================================================= */
.dual-gauge-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
}

[data-theme="light"] .dual-gauge-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

/* Overcommit Danger Box Highlighting */
.dual-gauge-box.overcommit-danger-box {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15) !important;
}

[data-theme="light"] .dual-gauge-box.overcommit-danger-box {
    background: #fef2f2 !important;
    border: 1px solid #fca5a5 !important;
}

.gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}

.phys-limit-label {
    font-size: 0.82rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bar-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.bar-tag {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bar-val {
    font-weight: 600;
}

/* Track */
.gauge-bar-track {
    width: 100% !important;
    height: 8px !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border-radius: 4px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--border-color) !important;
    display: block !important;
}

[data-theme="light"] .gauge-bar-track {
    background: #e2e8f0 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    border-color: #cbd5e1 !important;
}

.gauge-bar-track.track-danger {
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Fill */
.gauge-bar-fill {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    border-radius: 4px !important;
    transition: width 0.3s ease !important;
}

/* Overcommit Danger Red with Diagonal Stripes & Intense Pulse */
.gauge-bar-danger-red {
    background: repeating-linear-gradient(
        -45deg,
        #ef4444,
        #ef4444 8px,
        #b91c1c 8px,
        #b91c1c 16px
    ) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.9) !important;
    animation: dangerPulse 1.2s infinite alternate ease-in-out !important;
}

@keyframes dangerPulse {
    from {
        opacity: 0.85;
        filter: brightness(1) drop-shadow(0 0 3px rgba(239, 68, 68, 0.6));
    }
    to {
        opacity: 1;
        filter: brightness(1.25) drop-shadow(0 0 10px rgba(239, 68, 68, 1));
    }
}

.gauge-phys-marker {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 2px !important;
    background: #ffffff !important;
    z-index: 10 !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.9) !important;
}

[data-theme="light"] .gauge-phys-marker {
    background: #0f172a !important;
}

/* Badges */
.ratio-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.ratio-badge.badge-normal {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid var(--border-card);
}

[data-theme="light"] .ratio-badge.badge-normal {
    background: #eef2ff !important;
    color: #4f46e5 !important;
    border: 1px solid #c7d2fe !important;
}

.ratio-badge.badge-overcommit-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: 1px solid #f87171 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
    animation: urgentBadgePulse 1s infinite alternate;
}

@keyframes urgentBadgePulse {
    from { transform: scale(1); box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
    to { transform: scale(1.02); box-shadow: 0 0 14px rgba(239, 68, 68, 0.9); }
}

.overcommit-matrix-table td {
    border-bottom: 1px solid var(--border-color) !important;
}

/* =========================================================================
   KYM Game: Next-Gen Cyber Glassmorphism Game Dashboard Components
   ========================================================================= */

/* 1. Expiry Alert Floating Banner */
.expiry-gold-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(180, 83, 9, 0.22));
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    animation: goldBannerFloat 3s infinite ease-in-out alternate;
}

.expiry-gold-banner.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.3));
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 4px 25px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

@keyframes goldBannerFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

.expiry-banner-icon {
    font-size: 1.75rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.expiry-gold-banner.critical .expiry-banner-icon {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.expiry-banner-text {
    flex: 1;
    min-width: 260px;
}

.expiry-banner-text h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #fef08a;
    margin: 0 0 0.2rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expiry-gold-banner.critical .expiry-banner-text h4 {
    color: #fecaca;
}

.expiry-banner-text p {
    font-size: 0.84rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.4;
}

.btn-extend-gold {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 0.88rem !important;
    padding: 0.6rem 1.35rem !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-extend-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6) !important;
    filter: brightness(1.1);
}

/* 2. Universal Custom Connection Domain Hero Card */
.domain-hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 1.15rem 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.domain-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #38bdf8, #6366f1);
}

.domain-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.domain-hero-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.domain-hero-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-edit-domain {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-edit-domain:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #c7d2fe;
}

.domain-display-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(10, 15, 29, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 0.75rem 1.15rem;
    border-radius: 10px;
}

.domain-primary-text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.03em;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.domain-primary-text .domain-accent {
    color: #38bdf8;
}

.domain-tag {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-copy-neon {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
    white-space: nowrap;
}

.btn-copy-neon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.6);
    filter: brightness(1.1);
}

.btn-copy-neon.copied {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #10b981 !important;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.5) !important;
}

.domain-meta-subtext {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 3. Port Matrix & Security Showcase Card */
.port-matrix-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.port-matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.port-matrix-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.port-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.port-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.port-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #cbd5e1;
}

.port-pill strong {
    font-family: 'JetBrains Mono', monospace;
    color: #38bdf8;
}

.port-security-footer {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
}

/* 4. SFTP File Transfer Card */
.sftp-ide-card {
    background: rgba(10, 15, 29, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.sftp-ide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.sftp-ide-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #c084fc;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sftp-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.sftp-grid-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
}

.sftp-cell-label {
    font-size: 0.66rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.15rem;
}

.sftp-cell-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    word-break: break-all;
}

.sftp-ide-hint {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* 5. Custom Domain Change Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-glass {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    color: #f8fafc;
}

.modal-content-glass h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-content-glass p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.modal-input-group {
    display: flex;
    align-items: center;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 1rem;
}

.modal-input-group:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.modal-input-field {
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
}

.modal-input-suffix {
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

.modal-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Custom Stylish Internal Scrollbars for Data Tables */
div[style*="overflow-x: auto"]::-webkit-scrollbar,
div[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-track,
div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 4px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb,
div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.45);
    border-radius: 4px;
}
.port-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #cbd5e1;
}

.port-pill strong {
    font-family: 'JetBrains Mono', monospace;
    color: #38bdf8;
}

.port-security-footer {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
}

/* 4. SFTP File Transfer Card */
.sftp-ide-card {
    background: rgba(10, 15, 29, 0.7);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.sftp-ide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.sftp-ide-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #c084fc;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sftp-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.sftp-grid-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
}

.sftp-cell-label {
    font-size: 0.66rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.15rem;
}

.sftp-cell-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: #f1f5f9;
    word-break: break-all;
}

.sftp-ide-hint {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* 5. Custom Domain Change Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-glass {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    color: #f8fafc;
}

.modal-content-glass h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-content-glass p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.modal-input-group {
    display: flex;
    align-items: center;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 1rem;
}

.modal-input-group:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.modal-input-field {
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
}

.modal-input-suffix {
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

.modal-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Custom Stylish Internal Scrollbars for Data Tables */
div[style*="overflow-x: auto"]::-webkit-scrollbar,
div[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-track,
div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 4px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb,
div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.45);
    border-radius: 4px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb:hover,
div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.75);
}

/* ==========================================================================
   Scenario Testing Console & Overall Responsive Architecture
   ========================================================================== */
.scenario-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    cursor: pointer;
    gap: 0.75rem;
    user-select: none;
    transition: background 0.15s ease;
}
.scenario-top-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}
.scenario-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}
.scenario-bottom-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}
.scenario-mobile-actions {
    display: none;
}
.scenario-desktop-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        display: flex !important;
    }
    .sidebar.active {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.85rem 0.65rem 3rem 0.65rem !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.85rem !important;
    }
    .dashboard-header > div:last-child {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
    }
    .dashboard-header .btn {
        font-size: 0.75rem !important;
        padding: 0.38rem 0.55rem !important;
        flex: 1 1 calc(50% - 0.4rem) !important;
        justify-content: center !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    /* Test Scenario Item Mobile Optimizations (2-Tier Stack) */
    .scenario-header-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        padding: 0.65rem 0.75rem !important;
    }
    .scenario-top-line {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    .scenario-title-group {
        display: flex !important;
        align-items: center !important;
        gap: 0.45rem !important;
        min-width: 0 !important;
        flex: 1 !important;
    }
    .scenario-title-text {
        font-size: 0.82rem !important;
        max-width: 170px !important;
    }
    .scenario-category-badge {
        display: none !important; /* Hide redundant category on mobile to preserve title space */
    }
    .scenario-mobile-actions {
        display: flex !important;
        align-items: center !important;
        gap: 0.45rem !important;
        flex-shrink: 0 !important;
    }
    .scenario-desktop-actions {
        display: none !important;
    }

    .scenario-bottom-line {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.4rem !important;
        width: 100% !important;
        padding-top: 0.4rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }
    .scenario-endpoint-tag {
        max-width: 58% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 0.68rem !important;
    }

    /* Section Header Mobile */
    .test-section-box {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        padding: 0.75rem 0.85rem !important;
    }
    .test-section-btns {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 0.35rem !important;
    }
    .test-section-btns .btn {
        flex: 1 !important;
        padding: 0.35rem 0.35rem !important;
        font-size: 0.7rem !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* ==========================================================================
       Dashboard Panorama Mobile Clean Balanced Margin & Overflow Guards
       ========================================================================== */
    .panorama-card {
        border-radius: 12px !important;
        margin: 0 0 1rem 0 !important;
        padding: 0.85rem 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .panorama-content {
        padding: 0.5rem 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .panel-features-guide {
        padding: 0.45rem 0.5rem !important;
        box-sizing: border-box !important;
    }

    /* 2. Domain Hero Card (ゲーム接続アドレス & 操作パネル) */
    .domain-hero-card {
        padding: 0.85rem 0.75rem !important;
        border-radius: 12px !important;
        margin-bottom: 0.85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .domain-hero-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .domain-hero-grid > div {
        padding: 0.95rem 0.85rem !important;
        border-radius: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .domain-action-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
    }
    .domain-action-row > div {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        box-sizing: border-box !important;
    }
    .domain-action-row input[type="number"] {
        max-width: 75px !important;
        box-sizing: border-box !important;
    }
    .domain-action-row .btn-copy-neon {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.6rem !important;
        font-size: 0.82rem !important;
        box-sizing: border-box !important;
    }

    /* 専用操作パネル ボタン群 */
    .panel-btn-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .panel-btn-group .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.5rem 0.3rem !important;
        font-size: 0.75rem !important;
        box-sizing: border-box !important;
    }
    .panel-btn-group .btn:last-child {
        grid-column: 1 / -1 !important;
        font-size: 0.84rem !important;
        padding: 0.6rem !important;
        box-sizing: border-box !important;
    }

    /* 3. Custom Domain Card & Controls */
    .custom-srv-card,
    .server-controls-card,
    .pbs-backup-card {
        padding: 0.85rem 0.75rem !important;
        border-radius: 12px !important;
        margin-bottom: 0.85rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .custom-srv-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .custom-srv-item {
        padding: 0.65rem 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
        min-width: 0 !important;
    }
    .custom-srv-item > div:first-child {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }
    .custom-srv-actions {
        display: flex !important;
        gap: 0.35rem !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }
    .custom-srv-actions .btn {
        flex-shrink: 0 !important;
    }
    .custom-srv-input-group {
        width: 100% !important;
        min-width: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.35rem !important;
        box-sizing: border-box !important;
    }
    .custom-srv-input-group input {
        border-radius: 8px !important;
        border-right: 1px solid rgba(168, 85, 247, 0.4) !important;
        width: 100% !important;
        padding: 0.55rem 0.75rem !important;
        font-size: 0.9rem !important;
        box-sizing: border-box !important;
    }
    .custom-srv-input-group select {
        border-radius: 8px !important;
        width: 100% !important;
        padding: 0.55rem 0.75rem !important;
        font-size: 0.86rem !important;
        box-sizing: border-box !important;
    }
    .custom-srv-submit-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.6rem !important;
        font-size: 0.84rem !important;
        box-sizing: border-box !important;
    }

    /* 4. PBS Backup Card (自動バックアップ保全) */
    .pbs-backup-card {
        padding: 0.85rem 0.3rem !important; /* 外枠を端まで広げる */
        border-radius: 10px !important;
    }
    .pbs-backup-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
    }
    .pbs-create-form {
        width: 100% !important;
        margin: 0 !important;
    }
    .btn-create-backup {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.86rem !important;
    }
    .pbs-snapshot-list {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    .pbs-snapshot-item {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        padding: 0.65rem 0.75rem !important;
    }
    .pbs-snapshot-info {
        min-width: 0 !important;
        flex: 1 !important;
    }
    .pbs-restore-form {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    .btn-restore-snapshot {
        width: auto !important;
        white-space: nowrap !important;
        padding: 0.35rem 0.65rem !important;
    }

    /* 有効期限バナーのスマホ左右スリム化 */
    .expiry-gold-banner {
        padding: 0.85rem 0.6rem !important;
        border-radius: 10px !important;
        gap: 0.85rem !important;
    }
    .expiry-gold-banner .btn-extend-gold {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Custom SRV Input Group Desktop Styles: Expand Subdomain Input, Compact Domain Select */
@media (min-width: 769px) {
    .custom-srv-input-group {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }
    .custom-srv-input-group input[name="subdomain"] {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 140px !important;
    }
    .custom-srv-input-group select[name="base_domain"] {
        width: auto !important;
        max-width: 180px !important;
        flex: 0 0 auto !important;
    }
}

@media (max-width: 640px) {
    .dashboard-container form {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1rem;
    }
}

