:root{
    --ra:#f39c12;
    --kemenag:#1e8449;
    --kemenag-light:#27ae60;
    --mi:#27ae60;
    --mts:#2980b9;
    --ma:#8e44ad;

    --bg:#eef7f1;
    --card:#ffffff;
    --text:#1f2933;
    --muted:#667085;
    --border:#e5e7eb;
    --soft:#f8fafc;

    --success:#1e8449;
    --warning:#f39c12;
    --danger:#e74c3c;
}

*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255,255,255,.3), transparent 28%),
        linear-gradient(135deg,#145a32,#27ae60);
    min-height:100vh;
    color:var(--text);
}

button,
a,
input{
    font-family:inherit;
}

.page{
    width:100%;
    max-width:980px;
    margin:0 auto;
    padding:24px;
}

.container{
    background:var(--card);
    border-radius:24px;
    padding:24px;
    box-shadow:0 18px 45px rgba(0,0,0,.22);
    animation:fadeIn .6s ease;
}

@keyframes fadeIn{
    from{
        opacity:0;
        transform:translateY(20px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* HERO */
.hero{
    background:
        linear-gradient(135deg,rgba(30,132,73,.95),rgba(39,174,96,.95)),
        radial-gradient(circle at top right,rgba(255,255,255,.25),transparent 35%);
    color:#fff;
    border-radius:22px;
    padding:24px;
    display:flex;
    align-items:center;
    gap:18px;
    margin-bottom:18px;
    box-shadow:0 12px 30px rgba(30,132,73,.35);
}

.hero-logo-wrap{
    width:92px;
    height:92px;
    border-radius:24px;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    box-shadow:0 10px 25px rgba(0,0,0,.25);
}

.logo{
    width:72px;
    display:block;
}

.hero-text{
    flex:1;
}

.hero-text h1{
    margin:0 0 6px;
    font-size:28px;
    line-height:1.25;
}

.hero-text p{
    margin:0;
    color:#eafaf1;
    font-size:15px;
}

.hero-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:rgba(255,255,255,.16);
    border:1px solid rgba(255,255,255,.25);
    color:#fff;
    border-radius:999px;
    padding:7px 12px;
    margin-top:12px;
    font-size:13px;
}

/* QUICK STATS */
.quick-stats{
    display:grid;
    grid-template-columns:2fr 1fr 1fr;
    gap:12px;
    margin-bottom:15px;
}

.quick-card{
    background:var(--soft);
    border:1px solid var(--border);
    border-radius:16px;
    padding:14px;
    display:flex;
    align-items:center;
    gap:12px;
}

.quick-card i{
    width:42px;
    height:42px;
    border-radius:14px;
    background:#eafaf1;
    color:var(--kemenag);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    flex-shrink:0;
}

.quick-card span{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-bottom:4px;
}

.quick-card strong{
    display:block;
    color:var(--text);
    font-size:15px;
}

/* TOOLBAR */
.feature-toolbar{
    display:flex;
    gap:10px;
    margin-bottom:15px;
}

.search-box{
    flex:1;
    position:relative;
}

.search-box i{
    position:absolute;
    left:14px;
    top:50%;
    transform:translateY(-50%);
    color:#777;
}

.search-box input{
    width:100%;
    padding:13px 14px 13px 42px;
    border:1px solid var(--border);
    border-radius:14px;
    font-size:14px;
    outline:none;
    background:#fff;
}

.search-box input:focus{
    border-color:var(--kemenag);
    box-shadow:0 0 0 4px rgba(30,132,73,.15);
}

.dark-toggle,
.refresh-btn{
    border:none;
    border-radius:14px;
    padding:0 16px;
    background:#2c3e50;
    color:#fff;
    cursor:pointer;
    font-size:15px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}

.refresh-btn{
    background:var(--kemenag);
    font-weight:bold;
}

.dark-toggle:hover,
.refresh-btn:hover{
    opacity:.9;
}

.no-result{
    display:none;
    text-align:center;
    color:var(--muted);
    background:var(--soft);
    padding:13px;
    border-radius:14px;
    border:1px solid var(--border);
    margin-bottom:15px;
}

/* STATUS SUMMARY */
.status-summary{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
    margin-bottom:15px;
}

.status-summary-item{
    background:var(--soft);
    border:1px solid var(--border);
    border-radius:16px;
    padding:14px;
    display:flex;
    align-items:center;
    gap:12px;
}

.status-summary-item i{
    width:38px;
    height:38px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.status-summary-item.online i{
    background:#d5f5e3;
    color:var(--success);
}

.status-summary-item.offline i{
    background:#fadbd8;
    color:var(--danger);
}

.status-summary-item.total i{
    background:#eaf2f8;
    color:var(--mts);
}

.status-summary-item span{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-bottom:4px;
}

.status-summary-item strong{
    font-size:20px;
    color:var(--text);
}

/* SERVER CARD */
.server-card{
    background:var(--soft);
    border:1px solid var(--border);
    border-radius:18px;
    padding:16px;
    margin-bottom:18px;
}

.server-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    font-weight:bold;
    color:var(--kemenag);
    margin-bottom:12px;
}

.server-title-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.server-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
}

.server-item{
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    padding:14px;
}

.server-label{
    font-size:13px;
    color:var(--muted);
    margin-bottom:6px;
}

.server-value{
    font-size:20px;
    font-weight:bold;
    color:var(--text);
}

.server-small{
    font-size:12px;
    color:var(--muted);
    margin-top:4px;
}

.progress{
    width:100%;
    height:8px;
    background:#e9ecef;
    border-radius:20px;
    margin-top:10px;
    overflow:hidden;
}

.progress-bar{
    height:100%;
    width:0%;
    background:var(--success);
    border-radius:20px;
    transition:width .4s ease, background .4s ease;
}

.progress-bar.warning{
    background:var(--warning);
}

.progress-bar.danger{
    background:var(--danger);
}

.server-status{
    margin-top:10px;
    font-size:12px;
    color:var(--muted);
    text-align:right;
}

/* LEVEL */
.level-group{
    margin-bottom:12px;
}

.level-btn{
    width:100%;
    padding:16px;
    border:none;
    border-radius:16px;
    color:#fff;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:16px;
    box-shadow:
        0 4px 0 rgba(0,0,0,.18),
        0 8px 18px rgba(0,0,0,.18);
    transition:
        transform .2s ease,
        opacity .2s ease,
        box-shadow .2s ease;
}

.level-btn:hover{
    opacity:.95;
    transform:translateY(-2px);
}

.level-btn:active{
    transform:translateY(2px);
    box-shadow:
        0 2px 0 rgba(0,0,0,.18),
        0 4px 10px rgba(0,0,0,.18);
}

.level-left{
    display:flex;
    align-items:center;
    gap:12px;
    text-align:left;
}

.level-icon{
    width:46px;
    height:46px;
    border-radius:16px;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    box-shadow:
        inset 0 -3px 6px rgba(0,0,0,.15),
        0 8px 14px rgba(0,0,0,.18);
    transition:transform .3s ease;
}

.level-btn:hover .level-icon{
    transform:rotate(8deg) scale(1.08);
}

.level-info strong{
    display:block;
    font-size:15px;
    margin-bottom:2px;
}

.level-info small{
    display:block;
    font-size:12px;
    opacity:.9;
}

.arrow{
    font-size:18px;
    transition:transform .3s ease;
}

/* WARNA LEVEL */
.ra{
    background:linear-gradient(135deg,#f39c12,#f5b041);
}

.ra .level-icon{
    color:var(--ra);
}

.mi{
    background:linear-gradient(135deg,#1e8449,#2ecc71);
}

.mi .level-icon{
    color:var(--mi);
}

.mts{
    background:linear-gradient(135deg,#2471a3,#3498db);
}

.mts .level-icon{
    color:var(--mts);
}

.ma{
    background:linear-gradient(135deg,#7d3c98,#9b59b6);
}

.ma .level-icon{
    color:var(--ma);
}

/* SCHOOL LIST */
.school-list{
    max-height:0;
    overflow:hidden;
    opacity:0;
    transform:translateY(-8px);
    transition:
        max-height .55s cubic-bezier(.4,0,.2,1),
        opacity .35s ease,
        transform .35s ease;
}

.school-list.active{
    max-height:1200px;
    opacity:1;
    transform:translateY(0);
}

.school-btn{
    width:100%;
    margin:8px 0;
    padding:12px;
    border-radius:16px;
    background:var(--soft);
    border:1px solid var(--border);
    color:var(--text);
    text-decoration:none;
    display:flex;
    align-items:center;
    gap:12px;
    opacity:0;
    transform:translateY(8px);
    transition:
        opacity .3s ease,
        transform .3s ease,
        background .3s ease,
        border-color .3s ease;
}

.school-list.active .school-btn{
    opacity:1;
    transform:translateY(0);
}

.school-btn:hover{
    background:#eef7f1;
    border-color:#ccebd8;
}

.school-icon{
    width:40px;
    height:40px;
    border-radius:14px;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    color:var(--kemenag);
    box-shadow:0 3px 10px rgba(0,0,0,.08);
}

.school-info{
    flex:1;
    min-width:0;
}

.school-info strong{
    display:block;
    font-size:14px;
    color:var(--text);
}

.school-info small{
    display:block;
    font-size:12px;
    color:var(--muted);
    margin-top:2px;
}

.school-status{
    margin-left:auto;
    flex-shrink:0;
}

.status-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:64px;
    font-size:11px;
    padding:5px 9px;
    border-radius:999px;
    font-weight:bold;
    white-space:nowrap;
}

.status-checking{
    background:#ecf0f1;
    color:#555;
}

.status-online{
    background:#d5f5e3;
    color:#1e8449;
}

.status-offline{
    background:#fadbd8;
    color:#c0392b;
}

.status-error{
    background:#fef5e7;
    color:#b9770e;
}

/* ANIMASI DELAY */
.school-list.active .school-btn:nth-child(1){transition-delay:.04s}
.school-list.active .school-btn:nth-child(2){transition-delay:.08s}
.school-list.active .school-btn:nth-child(3){transition-delay:.12s}
.school-list.active .school-btn:nth-child(4){transition-delay:.16s}
.school-list.active .school-btn:nth-child(5){transition-delay:.20s}
.school-list.active .school-btn:nth-child(6){transition-delay:.24s}
.school-list.active .school-btn:nth-child(7){transition-delay:.28s}
.school-list.active .school-btn:nth-child(8){transition-delay:.32s}

/* FOOTER */
footer{
    text-align:center;
    margin-top:22px;
    color:var(--muted);
    font-size:13px;
}

/* DARK MODE */
body.dark-mode{
    background:
        radial-gradient(circle at top left, rgba(255,255,255,.08), transparent 28%),
        linear-gradient(135deg,#071f15,#145a32);
}

body.dark-mode .container{
    background:#1f2933;
    color:#f1f5f9;
}

body.dark-mode .quick-card,
body.dark-mode .server-card,
body.dark-mode .status-summary-item,
body.dark-mode .no-result{
    background:#263340;
    border-color:#3d4d5c;
}

body.dark-mode .server-item,
body.dark-mode .school-btn,
body.dark-mode .search-box input{
    background:#2f3b46;
    border-color:#3d4d5c;
    color:#fff;
}

body.dark-mode .school-btn:hover{
    background:#364758;
}

body.dark-mode .school-icon{
    background:#1f2933;
}

body.dark-mode .quick-card strong,
body.dark-mode .server-value,
body.dark-mode .status-summary-item strong,
body.dark-mode .school-info strong{
    color:#fff;
}

body.dark-mode .quick-card span,
body.dark-mode .server-label,
body.dark-mode .server-small,
body.dark-mode .server-status,
body.dark-mode .school-info small,
body.dark-mode footer,
body.dark-mode .no-result{
    color:#cfd8dc;
}

body.dark-mode .search-box input::placeholder{
    color:#cfd8dc;
}

/* RESPONSIVE */
@media(max-width:760px){
    .page{
        padding:0;
    }

    .container{
        min-height:100vh;
        border-radius:0;
        padding:18px;
    }

    .hero{
        flex-direction:column;
        text-align:center;
        padding:22px 18px;
    }

    .hero-text h1{
        font-size:23px;
    }

    .quick-stats,
    .server-grid,
    .status-summary{
        grid-template-columns:1fr;
    }

    .feature-toolbar{
        flex-direction:column;
    }

    .dark-toggle,
    .refresh-btn{
        width:100%;
        padding:13px;
    }

    .level-btn{
        padding:14px;
    }

    .level-info strong{
        font-size:14px;
    }

    .school-btn{
        align-items:flex-start;
    }

    .school-status{
        align-self:center;
    }
}
