:root {
    --bg-color: #f0f2f5;
    --primary: #2c3e50;
    --accent: #3498db;
    --level-1: #f1c40f; /* Emas */
    --level-2: #3498db; /* Biru */
    --level-3: #2ecc71; /* Hijau */
    --level-4: #95a5a6; /* Abu */
    --node-width: 180px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    overflow: hidden;
}

.top-bar {
    background: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
    height: 55px;
}

.brand h1 { margin: 0; font-size: 18px; color: var(--primary); }
.tree-selector { display: flex; gap: 8px; align-items: center; }

select.pilih-pohon {
    padding: 6px 12px;
    border-radius: 20px;
    border: 2px solid var(--accent);
    font-weight: bold;
    font-size: 13px;
    outline: none;
}

.btn-new-tree {
    background: var(--accent);
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: 0.3s;
}

.btn-new-tree:hover { background: #2980b9; }

#chart-container {
    height: calc(100vh - 75px);
    width: 100%;
    overflow: auto;
    text-align: center;
    background-image: radial-gradient(#d1d1d1 1px, transparent 1px);
    background-size: 30px 30px;
    cursor: grab;
}

#chart-container:active { cursor: grabbing; }

/* OrgChart Responsive Overrides */
.orgchart { background: transparent; padding: 20px; }

.orgchart .node { 
    width: var(--node-width) !important;
    height: auto !important;
    min-height: 60px;
    transition: transform 0.2s;
    margin: 0 10px;
}

.orgchart .node:hover { transform: scale(1.05); z-index: 10; }

.orgchart .node .title {
    font-size: 13px; 
    font-weight: bold; 
    padding: 8px 5px;
    border-radius: 8px 8px 0 0; 
    background-color: var(--primary);
    height: auto !important;
    line-height: 1.2;
    overflow: visible;
    white-space: normal;
}

.orgchart .node .content {
    background: white; 
    border: 1px solid #ddd; 
    border-top: none;
    padding: 10px; 
    font-size: 11px; 
    border-radius: 0 0 8px 8px;
    height: auto !important;
    min-height: 40px;
    line-height: 1.4;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: visible;
    white-space: normal;
    color: #333;
		white-space: pre-line !important; /* Mengubah \n menjadi baris baru */
		word-wrap: break-word;
}

.orgchart .node.level-1 .title { background-color: var(--level-1) !important; color: #000 !important; }
.orgchart .node.level-2 .title { background-color: var(--level-2) !important; color: #fff !important;}
.orgchart .node.level-3 .title { background-color: var(--level-3) !important; color: #fff !important;}
.orgchart .node.level-4 .title { background-color: var(--level-4) !important; color: #fff !important;}

.orgchart.vertical .node { 
    width: var(--node-width) !important;
    margin: 10px auto;
}

.fab-group {
    position: fixed; bottom: 25px; right: 25px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 99;
}

.fab {
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--primary); color: white; border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}

.fab:hover { transform: scale(1.1); background: #34495e; }

/* Styling tambahan untuk textarea di modal agar rapi */
.swal2-textarea {
    width: 100% !important;
    box-sizing: border-box;
    margin: 5px 0 !important;
    font-size: 14px !important;
    font-family: inherit;
}