:root {
            --brand-primary: #0ea5e9;
            --brand-secondary: #0284c7;
            --brand-accent: #38bdf8;
            --bg-base: #f1f5f9;
            --surface: #ffffff;
            --text-dark: #0f172a;
            --text-normal: #334155;
            --text-light: #64748b;
            --border-soft: #e2e8f0;
            /* Level Colors */
            --lvl-0: #f59e0b;
            --lvl-1: #10b981;
            --lvl-2: #3b82f6;
            --lvl-3: #8b5cf6;
            --lvl-4: #ec4899;
            --lvl-5: #f43f5e;
            --lvl-6: #14b8a6;
        }
        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: var(--bg-base);
            color: var(--text-normal);
            margin: 0;
            height: 100vh;
            height: 100dvh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background-image:
                radial-gradient(at 0% 0%, hsla(200, 100%, 94%, 1) 0, transparent 50%),
                radial-gradient(at 100% 100%, hsla(210, 100%, 90%, 1) 0, transparent 50%);
        }
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
            border: 1px solid var(--surface);
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }
        .app-container {
            display: flex;
            flex: 1;
            overflow: hidden;
            padding: 0.75rem;
            gap: 0.75rem;
            max-width: 1800px;
            margin: 0 auto;
            width: 100%;
            position: relative;
        }
        @media (min-width: 768px) {
            .app-container {
                padding: 1rem;
                gap: 1rem;
            }
        }
        .panel {
            background: var(--surface);
            border-radius: 0.75rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.5);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        @media (min-width: 768px) {
            .panel {
                border-radius: 1rem;
            }
        }
        /* Sidebar Responsive Drawer Logic */
        .sidebar {
            width: 100%;
            max-width: 360px;
            flex-shrink: 0;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        @media (max-width: 767px) {
            .sidebar {
                position: absolute;
                top: 0.75rem;
                bottom: 0.75rem;
                left: 0.75rem;
                z-index: 40;
                width: calc(100% - 1.5rem);
                max-width: 340px;
                transform: translateX(-105%);
                box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            }
            .sidebar.open {
                transform: translateX(0);
            }
        }
        .sidebar-overlay {
            display: none;
            position: absolute;
            inset: 0;
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(2px);
            z-index: 30;
            transition: opacity 0.3s ease;
        }
        @media (max-width: 767px) {
            .sidebar-overlay.active {
                display: block;
            }
        }
        .tree-header {
            padding: 1rem;
            border-bottom: 1px solid var(--border-soft);
            background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
        }
        .tree-scroll-area {
            flex: 1;
            overflow-y: auto;
            padding: 0.75rem;
        }
        .tree-node-group {
            position: relative;
        }
        .tree-children {
            position: relative;
            margin-left: 10px;
            padding-left: 8px;
            border-left: 2px solid var(--border-soft);
            margin-top: 2px;
            margin-bottom: 2px;
        }
        .tree-item {
            display: flex;
            align-items: center;
            padding: 0.5rem 0.5rem;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            margin-bottom: 2px;
            position: relative;
            border: 1px solid transparent;
            min-height: 40px;
        }
        .tree-item:hover {
            background-color: #f8fafc;
            border-color: #e2e8f0;
            transform: translateX(2px);
        }
        .tree-item.active {
            background-color: #f0f9ff;
            border-color: #bae6fd;
            box-shadow: inset 3px 0 0 var(--brand-primary);
        }
        .toggle-btn {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            color: var(--text-light);
            cursor: pointer;
            margin-right: 4px;
            transition: all 0.2s;
            background: transparent;
            z-index: 2;
            flex-shrink: 0;
        }
        .toggle-btn:hover {
            background: #e2e8f0;
            color: var(--text-dark);
        }
        .toggle-btn.open i {
            transform: rotate(90deg);
        }
        .toggle-btn.leaf {
            opacity: 0;
            pointer-events: none;
        }
        .node-icon {
            font-size: 1.15rem;
            margin-right: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            flex-shrink: 0;
        }
        .lvl-0-icon { color: var(--lvl-0); }
        .lvl-1-icon { color: var(--lvl-1); }
        .lvl-2-icon { color: var(--lvl-2); }
        .lvl-3-icon { color: var(--lvl-3); }
        .lvl-4-icon { color: var(--lvl-4); }
        .lvl-5-icon { color: var(--lvl-5); }
        .lvl-6-icon { color: var(--lvl-6); }
        .node-label {
            font-weight: 500;
            font-size: 0.875rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-grow: 1;
            user-select: none;
            color: var(--text-normal);
        }
        .tree-item.active .node-label {
            color: var(--brand-secondary);
            font-weight: 600;
        }
        .main-content {
            flex: 1;
            background: var(--surface);
            position: relative;
            min-width: 0;
        }
        #viewMindmap {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            position: relative;
        }
        #mindmapCanvas {
            flex: 1;
            width: 100%;
            height: 100%;
            min-height: 300px;
        }
        .mindmap-header {
            position: absolute;
            top: 12px;
            left: 12px;
            right: 12px;
            z-index: 10;
            background: rgba(255, 255, 255, 0.92);
            padding: 10px 14px;
            border-radius: 10px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
            backdrop-filter: blur(6px);
            border: 1px solid var(--border-soft);
            max-width: max-content;
        }
        @media (min-width: 640px) {
            .mindmap-header {
                top: 20px;
                left: 20px;
                right: auto;
                padding: 12px 20px;
                border-radius: 12px;
            }
        }
        .content-header {
            padding: 1.25rem;
            border-bottom: 1px solid var(--border-soft);
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
            display: flex;
            flex-direction: column;
            gap: 1rem;
            position: relative;
        }
        @media (min-width: 640px) {
            .content-header {
                padding: 1.75rem 2rem;
                flex-direction: row;
                align-items: flex-start;
                gap: 1.5rem;
            }
        }
        .content-icon-wrap {
            width: 60px;
            height: 60px;
            border-radius: 1.25rem;
            background: #ffffff;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            flex-shrink: 0;
            border: 1px solid var(--border-soft);
        }
        @media (min-width: 640px) {
            .content-icon-wrap {
                width: 76px;
                height: 76px;
                font-size: 2.25rem;
            }
        }
        .content-body {
            padding: 1rem;
            overflow-y: auto;
            flex: 1;
        }
        @media (min-width: 640px) {
            .content-body {
                padding: 1.75rem 2rem;
            }
        }
        .data-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 0.875rem;
        }
        @media (min-width: 768px) {
            .data-grid {
                grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
                gap: 1rem;
            }
        }
        .data-card {
            background: var(--surface);
            border: 1px solid var(--border-soft);
            border-radius: 0.75rem;
            padding: 1rem;
            transition: all 0.2s;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
        }
        .data-card:hover {
            border-color: var(--brand-accent);
            box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.1);
        }
        .card-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-light);
            font-weight: 700;
            margin-bottom: 0.375rem;
        }
        .card-value {
            font-size: 0.875rem;
            color: var(--text-dark);
            font-weight: 500;
            word-break: break-word;
        }
        .card-value a {
            color: var(--brand-secondary);
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            padding: 0.25rem 0.5rem;
            background: #f0f9ff;
            border-radius: 0.375rem;
            transition: all 0.2s;
            max-width: 100%;
        }
        .badge {
            display: inline-block;
            padding: 0.2rem 0.6rem;
            border-radius: 9999px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        /* Vị trí lưu trữ & Modal Styles - Compact Single Horizontal Row */
        .storage-box {
            background: #ffffff;
            border: 1px solid #cbd5e1;
            border-radius: 0.75rem;
            padding: 0.625rem 0.875rem;
            margin-bottom: 1rem;
            box-shadow: 0 1px 2px rgba(0,0,0,0.04);
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        @media (min-width: 1024px) {
            .storage-box {
                flex-direction: row;
                align-items: center;
                gap: 1rem;
            }
        }
        .storage-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            padding-bottom: 0.375rem;
            border-bottom: 1px solid #f1f5f9;
            flex-shrink: 0;
        }
        @media (min-width: 1024px) {
            .storage-header {
                padding-bottom: 0;
                border-bottom: none;
                border-right: 1px solid #e2e8f0;
                padding-right: 0.875rem;
            }
        }
        .storage-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.5rem;
            flex: 1;
        }
        @media (min-width: 768px) {
            .storage-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 0.625rem;
            }
        }
        .storage-item {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            padding: 0.375rem 0.625rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.2s;
            min-width: 0;
        }
        .storage-item:hover {
            border-color: #38bdf8;
            background: #f0f9ff;
        }
        .storage-icon {
            width: 1.75rem;
            height: 1.75rem;
            border-radius: 0.375rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            flex-shrink: 0;
        }
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.6);
            backdrop-filter: blur(4px);
            z-index: 100;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            animation: fadeIn 0.2s ease;
        }
        .modal-overlay.active {
            display: flex;
        }
        .modal-box {
            background: #ffffff;
            border-radius: 1rem;
            width: 100%;
            max-width: 500px;
            box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
            border: 1px solid #e2e8f0;
            overflow: hidden;
            animation: scaleUp 0.25s ease;
        }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
        /* Custom Context Menu */
        .context-menu {
            position: fixed;
            z-index: 9999;
            background: #ffffff;
            border: 1px solid #cbd5e1;
            border-radius: 0.75rem;
            box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
            min-width: 200px;
            padding: 0.375rem;
            display: none;
            animation: fadeIn 0.15s ease-out;
        }
        .context-menu-header {
            padding: 0.5rem 0.625rem 0.375rem;
            font-size: 11px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            border-bottom: 1px solid #f1f5f9;
            margin-bottom: 0.25rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .context-menu-item {
            display: flex;
            align-items: center;
            gap: 0.625rem;
            padding: 0.5rem 0.625rem;
            font-size: 12px;
            font-weight: 600;
            color: #334155;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.15s;
            user-select: none;
        }
        .context-menu-item:hover {
            background: #f1f5f9;
            color: #0284c7;
        }
        .context-menu-item.danger {
            color: #e11d48;
        }
        .context-menu-item.danger:hover {
            background: #fff1f2;
            color: #be123c;
        }
        .context-menu-divider {
            height: 1px;
            background: #f1f5f9;
            margin: 0.25rem 0;
        }