.container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    main.pb-3 { padding-bottom: 0 !important; }

    :root {
        --bg-panel: #1e1e1e;
        --bg-input: #2d2d2d;
        --accent: #ffc107;
        --accent-hover: #ffca2c;
        --text-main: #e0e0e0;
        --text-muted: #a0a0a0;
        --border: #333;
        --radius: 6px;
        --transition: all 0.2s ease;
    }

    .workspace {
        height: calc(100vh - 130px); 
        display: flex;
        overflow: hidden;
        position: relative;
        background-color: #121212;
    }

    .sidebar {
        width: 420px;
        min-width: 420px;
        background-color: var(--bg-panel);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        z-index: 10;
        color: var(--text-main);
        transition: transform 0.3s ease;
    }

    .sidebar-mobile-header {
        display: none;
        padding: 15px;
        background-color: #252526;
        border-bottom: 1px solid var(--border);
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    .sidebar-content-wrapper {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
    }

    .sidebar-scroll { flex: 1; overflow-y: auto; padding: 20px; }
    .sidebar-footer { padding: 20px; border-top: 1px solid var(--border); background: #252526; }

    .config-section {
        background: rgba(255,255,255,0.03);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 15px;
        overflow: hidden;
        transition: var(--transition);
    }
    .config-section.active { border-color: #555; background: rgba(255,255,255,0.04); }
    
    .section-header {
        padding: 14px 15px;
        background: rgba(0,0,0,0.2);
        cursor: pointer;
        display: flex; justify-content: space-between; align-items: center;
        font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
        color: var(--text-main); user-select: none;
    }
    .section-header:hover { background: rgba(255,255,255,0.05); }
    .config-section.active .section-header { border-bottom: 1px solid var(--border); color: var(--accent); }
    .config-section.collapsed .section-content { display: none; }
    .section-content { padding: 15px; }

    .form-group { margin-bottom: 18px; }
    label { display: flex; justify-content: space-between; font-size: 0.8rem; color: #aaa; margin-bottom: 6px; font-weight: 500; }
    label span.val { color: var(--accent); font-family: monospace; }
    
    .form-control, .form-select {
        width: 100%;
        background-color: var(--bg-input);
        border: 1px solid var(--border);
        color: #fff;
        padding: 10px 12px;
        border-radius: 4px;
        font-size: 0.9rem;
        transition: var(--transition);
    }
    .form-control:focus, .form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

    .custom-check {
        display: flex; align-items: center; cursor: pointer;
        background: rgba(0,0,0,0.2); padding: 10px;
        border-radius: 4px; border: 1px solid var(--border);
        transition: var(--transition);
    }
    .custom-check:hover { border-color: #666; background: rgba(255,255,255,0.05); }
    .custom-check input { margin-right: 12px; accent-color: var(--accent); width: 18px; height: 18px; cursor: pointer; }
    
    .btn-primary-custom {
        width: 100%; padding: 14px;
        background-color: var(--accent); color: #000;
        border: none; border-radius: var(--radius);
        font-weight: 800; font-size: 1rem; text-transform: uppercase;
        cursor: pointer; transition: var(--transition);
        display: flex; justify-content: center; align-items: center; gap: 10px;
    }
    .btn-primary-custom:hover { background-color: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4); }
    .btn-primary-custom:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(1); transform: none; }

    .btn-pdf-custom {
        width: 100%; padding: 12px;
        background: transparent; color: var(--accent);
        border: 2px solid var(--accent); border-radius: var(--radius);
        font-weight: 700; font-size: 0.9rem;
        cursor: pointer; transition: var(--transition);
        display: flex; justify-content: center; align-items: center; gap: 8px;
        margin-top: 12px; text-transform: uppercase;
    }
    .btn-pdf-custom:hover { background: rgba(255, 193, 7, 0.12); transform: translateY(-1px); }
    .btn-pdf-custom:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

    .hidden { display: none !important; }
    .row-2 { display: flex; gap: 10px; }
    .col { flex: 1; }
    .sub-options { margin-left: 10px; margin-top: 10px; padding: 15px; background: rgba(0,0,0,0.3); border-radius: 4px; border-left: 2px solid var(--accent); }
    
    .viewport-container {
        flex: 1; 
        position: relative;
        background-color: #121212;
        overflow: hidden; 
        width: 100%; 
        height: 100%;
        padding: 20px;
        display: flex; 
        align-items: center; 
        justify-content: center;
    }

    .viz-window {
        position: relative; width: 100%; height: 100%;
        background-color: #000;
        border: 1px solid var(--accent);
        border-radius: 8px;
        box-shadow: 0 0 30px rgba(0,0,0,0.5);
        overflow: hidden;
    }

    #vizContainer { width: 100%; height: 100%; display: block; outline: none; }

    .viewport-toolbar { 
        position: absolute; top: 20px; left: 20px; 
        display: flex; gap: 10px; z-index: 50; 
    }
    
    .tool-btn { 
        width: 40px; height: 40px; 
        background: rgba(30,30,30,0.85); backdrop-filter: blur(5px); 
        border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; 
        color: #fff; display: flex; align-items: center; justify-content: center; 
        cursor: pointer; transition: var(--transition); 
    }
    .tool-btn:hover { background: var(--accent); color: #000; }
    
    .status-bar-custom {
        height: 32px; background-color: var(--bg-panel); border-top: 1px solid var(--border);
        display: flex; align-items: center; padding: 0 15px;
        font-size: 0.75rem; color: var(--text-muted);
        justify-content: space-between; font-family: monospace;
    }
    .status-dot { width: 8px; height: 8px; border-radius: 50%; background-color: #444; }
    .status-dot.ok { background-color: #4caf50; box-shadow: 0 0 6px #4caf50; }
    .status-dot.busy { background-color: var(--accent); }
    
    .overlay-debug { 
        position: absolute; bottom: 10px; right: 10px; 
        background: rgba(0,0,0,0.7); padding: 5px 10px; border-radius: 4px; 
        font-family: 'Consolas', monospace; font-size: 0.7rem; color: #ccc; 
        pointer-events: none; 
    }

    .validation-summary-valid { display: none; }
    .validation-summary-errors {
        background-color: rgba(255, 68, 68, 0.1);
        border: 1px solid #ff4444;
        color: #ff8888;
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 15px;
        font-size: 0.85rem;
        display: block;
    }
    .validation-summary-errors ul { list-style: none; padding: 0; margin: 0; }
    .text-danger { color: #ff6666 !important; font-size: 0.8em; margin-top: 4px; display: block; }

    @media (max-width: 991.98px) {
        .workspace {
            flex-direction: column;
            height: auto !important;
            overflow: visible;
        }

        .sidebar {
            width: 100%;
            min-width: 0;
            border-right: none;
            border-bottom: 1px solid var(--border);
            height: auto;
            order: 1;
        }

        .sidebar-mobile-header { display: flex; }
        .sidebar-content-wrapper { display: none; }
        
        .sidebar-content-wrapper.mobile-expanded { 
            display: flex; 
            max-height: 500px;
        }
        
        .viewport-container {
            order: 2;
            flex: none !important;
            height: 50vh !important;
            min-height: 400px;
            padding: 10px;
            display: block;
        }
        
        .viz-window {
            height: 100% !important;
        }
    }

.portfolio-demo .sidebar-footer--actions { display: none !important; }
.cfg-portfolio-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; margin-bottom: 12px; }
.cfg-portfolio-link:hover { color: var(--accent); }
.workspace { height: 100vh !important; }
