:root {
    --text-dark: #333;
    --cub-green: #2e7d32;
    --cub-primary: #004a8f;
    --cub-pink: #DF0D7D;

    --lvl-1: #004a8f; --lvl-1-bg: #f1f6ff;
    --lvl-2: #8e24aa; --lvl-2-bg: #faf2ff;
    --lvl-3: #e67e22; --lvl-3-bg: #fffaf5;
    --lvl-4: #2e7d32; --lvl-4-bg: #f7fff3;
}

.gr-page-bg {  padding-bottom: 40px; overflow-x: hidden; }
.gr-container { max-width: 1350px; margin: 0 auto; padding: 20px; }

.dashboard-wrapper { display: flex; gap: 30px; margin-top: 30px; min-height: 550px; }

.timeline-sidebar {
    flex: 1; background: #fff; border-radius: 30px; padding: 25px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; display: flex; flex-direction: column;
    gap: 15px; position: sticky; top: 100px; height: fit-content;
}

.timeline-node {
    display: flex; align-items: center; gap: 15px; padding: 18px;
    border-radius: 18px; cursor: pointer; transition: 0.3s;
    border: 2px solid #eee; background: #fcfcfc;
}

.node-number {
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 10px; background: #eee; color: #999; flex-shrink: 0;
}

.node-info b { font-size: 10px; color: #666; display: block;text-transform: uppercase; }
.node-info span { font-size: 11px; color: #999;text-transform: uppercase; }

.timeline-sidebar p {
    font-size: 10px;font-weight: 800;color: var(--cub-primary);text-transform: uppercase;letter-spacing: 1.2px;
    margin: 15px 0 8px 12px;line-height: 1.4;text-align: left;position: relative;padding-left: 15px;
}

.timeline-sidebar p::before {
    content: '';position: absolute;left: 0;top: 50%;transform: translateY(-50%);
    width: 3px;height: 18px;background-color: var(--cub-pink);border-radius: 2px;
}
.timeline-sidebar p:first-of-type {margin-top: 5px;}
.down-arrow-separator + p {margin-top: 5px;color: var(--cub-primary); }

.timeline-node.active { background: #fff; box-shadow: 0 8px 15px rgba(0,0,0,0.05); transform: translateX(8px); }
.timeline-node[data-target="1"].active { border-color: var(--lvl-1); }
.timeline-node[data-target="1"].active .node-number { background: var(--lvl-1); color: #fff; }
.timeline-node[data-target="1"].active .node-info b { color: var(--lvl-1); }
.timeline-node[data-target="2"].active { border-color: var(--lvl-2); }
.timeline-node[data-target="2"].active .node-number { background: var(--lvl-2); color: #fff; }
.timeline-node[data-target="2"].active .node-info b { color: var(--lvl-2); }
.timeline-node[data-target="3"].active { border-color: var(--lvl-3); }
.timeline-node[data-target="3"].active .node-number { background: var(--lvl-3); color: #fff; }
.timeline-node[data-target="3"].active .node-info b { color: var(--lvl-3); }
.timeline-node[data-target="4"].active { border-color: var(--lvl-4); }
.timeline-node[data-target="4"].active .node-number { background: var(--lvl-4); color: #fff; }
.timeline-node[data-target="4"].active .node-info b { color: var(--lvl-4); }

.content-display { flex: 2.5; width: 100%; }
.detail-panel {
    background: #fff; border-radius: 35px; padding: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.05); display: none;
    border-top: 8px solid #eee; animation: fadeInRight 0.4s ease;
}
.detail-panel.active { display: block; }

.summary-card { 
    padding: 30px; border-radius: 25px; border: 1.5px dashed #ccc; 
    background: #fff; cursor: pointer; transition: 0.3s; position: relative; color: #000; font-size: 11px;
}
.summary-card:hover { border-style: dashed; transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }
.summary-card:after { content: 'Click for details →'; position: absolute; bottom: 15px; right: 20px; font-size: 10px; font-weight: 900; color: var(--cub-pink); }

#panel-1 .summary-card:hover { border-color: var(--lvl-1); background: var(--lvl-1-bg); }
#panel-2 .summary-card:hover { border-color: var(--lvl-2); background: var(--lvl-2-bg); }
#panel-3 .summary-card:hover { border-color: var(--lvl-3); background: var(--lvl-3-bg); }
#panel-4 .summary-card:hover { border-color: var(--lvl-4); background: var(--lvl-4-bg); }

#drilldown-view-container { display: none; }
.back-btn { 
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 25px; background: var(--cub-primary); border-radius: 30px;
    font-weight: 700; color: #fff; cursor: pointer; margin-bottom: 30px; transition: 0.3s;border: none;
}
.back-btn:hover { background: var(--cub-primary); transform: translateX(-5px); }

.level-section { border: 2px solid #eee; border-radius: 40px; padding: 35px; background: #fff; animation: fadeInUp 0.5s ease; margin-bottom: 30px; }
.level-badge { display: inline-block; font-weight: 800; font-size: 0.9rem; border-bottom: 3px solid #eee; padding-bottom: 5px; margin-bottom: 15px; }

.sec-1 { border-color: var(--lvl-1); } .sec-1 .level-badge { color: var(--lvl-1); border-color: var(--lvl-1); }
.sec-2 { border-color: var(--lvl-2); } .sec-2 .level-badge { color: var(--lvl-2); border-color: var(--lvl-2); }
.sec-3 { border-color: var(--lvl-3); } .sec-3 .level-badge { color: var(--lvl-3); border-color: var(--lvl-3); }
.sec-4 { border-color: var(--lvl-4); } .sec-4 .level-badge { color: var(--lvl-4); border-color: var(--lvl-4); }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-card { border: 1.5px dashed #ccc; border-radius: 20px; padding: 25px; background: #fff; transition: 0.3s; height: 100%; position: relative; }
.info-card:hover { border-style: dashed; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }

.sec-1 .info-card:hover { border-color: var(--lvl-1); background: var(--lvl-1-bg); }
.sec-2 .info-card:hover { border-color: var(--lvl-2); background: var(--lvl-2-bg); }
.sec-3 .info-card:hover { border-color: var(--lvl-3); background: var(--lvl-3-bg); }
.sec-4 .info-card:hover { border-color: var(--lvl-4); background: var(--lvl-4-bg); }

.card-label { font-size: 10px; color: #888; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; display: block; margin-bottom: 14px; }
.card-name { font-size: 12px; font-weight: 800; color: var(--cub-primary); display: block; margin-bottom: 2px; }
.card-subtext { font-style: italic; color: #666; font-size: 10px; display: block; margin-bottom: 12px; line-height: 1.4; }
.card-address-block { border-top: 1px solid #eee; padding-top: 12px; margin-top: 10px; font-size: 10px; line-height: 1.5; color: #444; }
.card-head { font-weight: 700; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; color: var(--cub-green); font-size: 11px; }
.btn-link { color: #0b63ce; font-weight: 700; text-decoration: underline; cursor: pointer; display: inline-block; margin-top: 10px; }

.cub-modal { display: none; position: fixed; z-index: 100000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.mlcontent { background: #fff; margin: 8% auto; padding: 35px; border-radius: 30px; width: 550px; max-width: 92%; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.3); animation: zoomIn 0.3s; height: auto; }
.close-modal { position: absolute; right: 25px; top: 20px; font-size: 22px; cursor: pointer; color: #aaa; z-index: 10; }

.detail-row { padding: 8px 0; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; font-size: 10px; align-items: flex-start; }
.detail-row strong { color: #555; width: 40%; flex-shrink: 0; }
.detail-row span { color: #000; font-weight: 600; width: 55%; text-align: left; word-wrap: break-word; }

.branch-info-card .detail-row strong { color: #555; width: 20%; flex-shrink: 0;text-align: left; }
.branch-info-card .detail-row span { color: #000; font-weight: 600; width: 80%; text-align: left; word-wrap: break-word; }

/* .branch-info-card { background: var(--lvl-2-bg); padding: 20px; border-radius: 15px; border-left: 5px solid var(--lvl-2); margin-top: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); } */
.branch-info-card { padding: 0 20px; border-radius: 15px; border-left: 5px solid var(--lvl-1); margin-top: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.down-arrow-separator {
    text-align: center; color: var(--cub-pink); font-size: 13px; margin: -5px 0;
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

@media (max-width: 1024px) {
    .dashboard-wrapper { flex-direction: column; gap: 20px; }
    /* .down-arrow-separator { display: none; } */
    .timeline-sidebar { 
        /* flex-direction: row;  */
        flex-direction: column; 
        overflow-x: auto; 
        padding: 15px; 
        position: relative; 
        top: 0; 
        -webkit-overflow-scrolling: touch;
    }
    .timeline-node { min-width: 180px; flex-shrink: 0; transform: none !important; }
    .detail-panel { padding: 25px; border-radius: 20px; }
    .cards-grid { grid-template-columns: 1fr; }
    .level-section { border-radius: 20px; padding: 20px; }
    .mlcontent { padding: 25px; margin: 15% auto; }
}

@media (max-width: 500px) {
    .timeline-node { min-width: 150px; padding: 12px; }
    .node-info b { font-size: 10px; }
    .summary-card { padding: 20px; border-radius: 15px; }
    .detail-row { flex-direction: column; gap: 5px; }
    .detail-row strong, .detail-row span { width: 100%; text-align: left; }
    .close-modal { right: 15px; top: 15px; font-size: 20px; }
}
.select2-container--default .select2-selection--single {
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    height: 45px !important;
    padding: 8px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
}
.select2-results__option {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}