:root {
    /* ----------------------------------------------------- */
    /* THEME: Coral Blue Dark (Material 3)                   */
    /* ----------------------------------------------------- */

    /* Color Tokens */
    --md-sys-color-background: #0D1117;
    --md-sys-color-on-background: #E6EDF3;
    --md-sys-color-surface: #161B22;
    --md-sys-color-surface-container: #21262D;
    --md-sys-color-surface-container-high: #30363D;

    --md-sys-color-primary: #FF7F50;
    --md-sys-color-on-primary: #3E1C00;
    --md-sys-color-primary-container: #FFDBCC;
    --md-sys-color-on-primary-container: #3E1C00;

    --md-sys-color-secondary: #58A6FF;
    --md-sys-color-on-secondary: #00366D;

    --md-sys-color-outline: #8B949E;
    --md-sys-color-outline-variant: #484F58;

    /* Typography */
    --md-sys-typescale-display-large: 57px;
    --md-sys-typescale-headline-small: 24px;
    --md-sys-typescale-body-large: 16px;
    --md-sys-typescale-body-medium: 14px;

    /* Font Families */
    --font-ui: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-code: 'Fira Code', monospace;

    /* Elevation & shape */
    --md-sys-elevation-level1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-level2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-full: 999px;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    font-family: var(--font-ui);
    font-size: var(--md-sys-typescale-body-medium);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Material Icons Integration */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
    vertical-align: middle;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-full);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-ui);
}

.btn-primary {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
    box-shadow: var(--md-sys-elevation-level1);
    filter: brightness(1.1);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--md-sys-color-on-background);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-background);
    cursor: pointer;
}

.btn-icon:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.sidebar-header {
    padding: 0 16px 24px 16px;
    font-size: 22px;
    font-weight: bold;
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tree Nodes */
.tree-item {
    margin: 2px 0;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    color: var(--md-sys-color-on-background);
    transition: background 0.1s;
}

.tree-node:hover {
    background-color: var(--md-sys-color-surface-container);
}

.tree-node .node-icon {
    color: var(--md-sys-color-outline);
    display: flex;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--md-sys-color-background);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: var(--md-sys-color-surface-container);
    padding: 24px;
    border-radius: 28px;
    min-width: 320px;
    max-width: 90%;
    box-shadow: var(--md-sys-elevation-level2);
    border: 1px solid var(--md-sys-color-outline-variant);
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
}

.toast {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-background);
    padding: 12px 24px;
    border-radius: var(--md-sys-shape-corner-full);
    box-shadow: var(--md-sys-elevation-level1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--md-sys-color-outline-variant);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Inputs */
input,
select,
textarea {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-background);
    padding: 10px 16px;
    border-radius: 8px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--md-sys-color-primary);
    border-color: transparent;
}