:root {
    --primary: #2563eb;
    --primary-soft: #eff6ff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-soft: #475569;
    --border: #e2e8f0;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    .btn-excel-export {
        background: #10b981;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    }

    .btn-excel-export:hover {
        background: #059669;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
    }

    .btn-excel-export:active {
        transform: translateY(0);
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: 'Outfit', sans-serif;
        background-color: var(--bg-main);
        color: var(--text-main);
        overflow: hidden;
        height: 100vh;
    }

    .mindmap-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        width: 100vw;
        position: relative;
        overflow: hidden;
    }

    .app-header {
        background: #ffffff;
        padding: 16px 40px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 1000;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    }

    .header-content {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .logo-circle {
        width: 44px;
        height: 44px;
        background: var(--primary);
        color: white;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 1.2rem;
    }

    .title-group h1 {
        font-size: 1.15rem;
        font-weight: 800;
        color: var(--text-main);
    }

    .title-group p {
        font-size: 0.8rem;
        color: var(--text-soft);
    }

    /* View Controls */
    .view-controls {
        display: flex;
        gap: 6px;
        background: #f1f5f9;
        padding: 6px;
        border-radius: 16px;
    }

    .view-controls button {
        background: transparent;
        border: none;
        color: var(--text-soft);
        padding: 8px 20px;
        border-radius: 10px;
        cursor: pointer;
        font-family: inherit;
        font-size: 0.85rem;
        font-weight: 700;
        transition: all 0.2s ease;
    }

    .view-controls button.active {
        background: white;
        color: var(--primary);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    /* Containers */
    .list-container,
    .spreadsheet-container {
        flex: 1;
        overflow-y: auto;
        padding: 40px;
        background: var(--bg-main);
        z-index: 10;
    }

    /* Mindmap Canvas Fixes */
    .mindmap-canvas-wrapper {
        flex: 1;
        overflow: auto;
        background-color: #f1f5f9;
        cursor: grab;
        position: relative;
    }

    .mindmap-canvas {
        position: relative;
        background-image: radial-gradient(#cbd5e1 1px, transparent 0);
        background-size: 40px 40px;
        background-color: #f8fafc;
    }

    .mindmap-svg {
        position: absolute;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 5;
    }

    /* Nodes */
    .node {
        position: absolute;
        background: white;
        padding: 16px 24px;
        border-radius: 20px;
        box-shadow: var(--shadow-soft);
        border: 1px solid var(--border);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10;
        text-align: center;
        min-width: 180px;
    }

    .node:hover {
        transform: translate(-50%, -50%) scale(1.05) !important;
        border-color: var(--primary);
        box-shadow: var(--shadow-heavy);
        z-index: 20;
    }

    .node-center {
        background: var(--primary);
        color: white;
        padding: 24px 36px;
        border-color: transparent;
    }

    .node-avatar {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .node h4 {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .node-sub {
        font-size: 0.75rem;
        color: var(--text-soft);
        font-weight: 500;
    }

    .node-center .node-sub {
        color: rgba(255, 255, 255, 0.8);
    }

    /* Side Panel Layout Fix - CRITICAL */
    .side-panel {
        position: fixed;
        top: 0;
        right: 0;
        width: 440px;
        height: 100vh;
        background: white;
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.08);
        z-index: 2000;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border);
        display: flex;
        flex-direction: column;
    }

    .side-panel.open {
        transform: translateX(0);
    }

    .panel-header {
        padding: 30px;
        border-bottom: 1px solid var(--border);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .close-btn {
        background: none;
        border: none;
        font-size: 1.8rem;
        cursor: pointer;
        color: var(--text-soft);
    }

    .panel-body {
        flex: 1;
        overflow-y: auto;
        padding: 30px;
    }

    /* List View Redesign */
    .employee-list-card {
        background: white;
        border-radius: 24px;
        padding: 32px;
        margin-bottom: 30px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-soft);
        transition: transform 0.2s ease;
    }

    .emp-card-header {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-bottom: 24px;
    }

    .emp-card-avatar {
        font-size: 2.2rem;
        background: var(--primary-soft);
        width: 72px;
        height: 72px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 20px;
    }

    .emp-card-info h3 {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-main);
    }

    .emp-card-info p {
        font-size: 0.9rem;
        color: var(--text-soft);
    }

    .kpi-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 20px;
    }

    .list-kpi-item {
        background: #f8fafc;
        padding: 20px;
        border-radius: 16px;
        border-left: 5px solid var(--primary);
    }

    .list-kpi-item.helping {
        border-left-color: #10b981;
    }

    .pillar {
        font-size: 0.65rem;
        font-weight: 800;
        color: var(--text-soft);
        text-transform: uppercase;
    }

    .type-tag {
        font-size: 0.65rem;
        padding: 4px 10px;
        border-radius: 8px;
        font-weight: 700;
    }

    .type-tag.principal {
        background: #fee2e2;
        color: #ef4444;
    }

    .type-tag.helping {
        background: #dcfce7;
        color: #16a34a;
    }

    .progress-wrap {
        height: 6px;
        background: #e2e8f0;
        border-radius: 3px;
        overflow: hidden;
    }

    .progress-fill {
        height: 100%;
        background: var(--primary);
    }

    /* Spreadsheet Fix */
    .spreadsheet-content {
        background: white;
        border-radius: 20px;
        border: 1px solid var(--border);
        overflow: hidden;
        box-shadow: var(--shadow-soft);
    }

    .kpi-table {
        width: 100%;
        border-collapse: collapse;
    }

    .kpi-table th {
        background: #f8fafc;
        padding: 20px;
        text-align: left;
        font-size: 0.75rem;
        color: var(--text-soft);
        font-weight: 700;
        text-transform: uppercase;
        border-bottom: 1px solid var(--border);
    }

    .kpi-table td {
        padding: 20px;
        border-bottom: 1px solid #f1f5f9;
    }

    .owner-chip {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #eff6ff;
        color: #1e40af;
        padding: 6px 12px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.85rem;
    }

    .status-badge {
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 0.7rem;
        font-weight: 700;
    }

    .status-principal {
        background: #fee2e2;
        color: #ef4444;
    }

    .status-helping {
        background: #dcfce7;
        color: #16a34a;
    }

    .hidden {
        display: none !important;
    }

    @media (max-width: 1024px) {
        .side-panel {
            width: 100%;
        }
    }