:root{
    --bg:#0b1120;
    --card:#162132;
    --card2:#111827;
    --border:#2a3954;

    --text:#ffffff;
    --muted:#94a3b8;

    --blue:#3b82f6;
    --green:#22c55e;
    --orange:#f59e0b;
    --red:#ef4444;
    --purple:#8b5cf6;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Inter,Arial,sans-serif;
    background:linear-gradient(180deg,#070b14,#0f172a);
    color:var(--text);
}


.modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.75);
    backdrop-filter:blur(6px);
    z-index:9999;
}

.modal-content{
    width:90%;
    max-width:900px;
    margin:60px auto;
    background:#0f172a;
    border:1px solid #334155;
    border-radius:16px;
    padding:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.5);
}

.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px;
}

#closeModal{
    cursor:pointer;
    font-size:28px;
    color:#fff;
}

.monitor-box{
    margin-top:10px;
    padding-top:10px;
    border-top:1px solid #334155;
}

.monitor-box .line{
    display:flex;
    justify-content:space-between;
    margin-top:6px;
    font-size:12px;
}

.load.green{
    color:#22c55e;
    font-weight:bold;
}

.load.orange{
    color:#f59e0b;
    font-weight:bold;
}

.load.red{
    color:#ef4444;
    font-weight:bold;
}

.db{
    color:#38bdf8;
    font-weight:bold;
}

.monitor-box{
    margin-top:12px;
    padding-top:10px;
    border-top:1px solid #334155;
}

.monitor-box .line{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:6px 0;
    font-size:13px;
}

.monitor-box .load,
.monitor-box .db{
    font-weight:700;
}
/* ================= CONTAINER ================= */

.container{
    width:96%;
    max-width:1700px;
    margin:auto;
    padding:25px 0;
}

/* ================= HEADER ================= */

.header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:25px;
}

.header h1{
    font-size:28px;
    font-weight:800;
}

.header p{
    color:var(--muted);
    font-size:13px;
    margin-top:4px;
}

.header-buttons{
    display:flex;
    gap:10px;
}

.btn{
    padding:10px 16px;
    border-radius:10px;
    background:#1f2937;
    border:1px solid #2d3b56;
    color:white;
    text-decoration:none;
    font-size:13px;
    transition:.2s;
}

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

.btn.primary{
    background:linear-gradient(90deg,#2563eb,#4f46e5);
}

/* ================= SUMMARY ================= */

.summary{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin-bottom:20px;
}

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

.summary-icon{
    width:40px;
    height:40px;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
}

.summary-card h2{
    font-size:20px;
}

.summary-card span{
    font-size:12px;
    color:var(--muted);
}

/* ================= GRID ================= */

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

/* ================= CARD ================= */

.server-card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:14px;
    padding:14px;
    transition:.2s;
    overflow:hidden;
}

.server-card:hover{
    transform:translateY(-4px);
    border-color:#3b82f6;
}

.monitor-box{
    margin-top:10px;
    padding:10px;
    border-top:1px solid #334155;
}

.load{
    color:#38bdf8;
    font-weight:bold;
}

.db{
    color:#facc15;
    font-weight:bold;
}

/* ================= HEADER ================= */

.server-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:12px;
}

.server-header h3{
    font-size:15px;
}

.server-header span{
    font-size:11px;
    color:var(--muted);
}

.badge{
    font-size:10px;
    padding:4px 10px;
    border-radius:20px;
}

.badge.online{
    background:rgba(34,197,94,.15);
    color:var(--green);
}

.badge.offline{
    background:rgba(239,68,68,.15);
    color:var(--red);
}

/* ================= RINGS ================= */

.circle-area{
    display:flex;
    justify-content:space-between;
    margin:12px 0;
}

.circle-item{
    text-align:center;
    width:33%;
}

.circle{
    --size:62px;
    width:var(--size);
    height:var(--size);
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
}

.circle::after{
    content:"";
    position:absolute;
    inset:6px;
    background:var(--card2);
    border-radius:50%;
}

.circle span{
    position:relative;
    z-index:2;
    font-size:12px;
    font-weight:700;
}

/* colors */

.disk::before,
.ram::before,
.cpu::before{
    content:"";
    position:absolute;
    inset:0;
    border-radius:50%;
}

.disk::before{
    background: conic-gradient(
        var(--disk-color) calc(var(--percent)*1%),
        #2a364b 0
    );
}

.ram::before{
    background:conic-gradient(var(--blue) calc(var(--percent)*1%),#2a364b 0);
}

.cpu::before{
    background:conic-gradient(var(--purple) calc(var(--percent)*1%),#2a364b 0);
}

/* ================= TEXT ================= */

.circle-item h4{
    font-size:11px;
    margin-top:6px;
}

.circle-item small{
    font-size:10px;
    color:var(--muted);
}

/* ================= CPU BOX ================= */

.cpu-box{
    margin-top:10px;
    padding:10px;
    border-radius:10px;
    background:var(--card2);
    border:1px solid var(--border);
}

.cpu-title{
    font-size:10px;
    color:var(--muted);
    margin-bottom:4px;
}

.cpu-model{
    font-size:12px;
}

/* ================= FOOTER ================= */

.card-footer{
    display:flex;
    gap:8px;
    margin-top:12px;
}

.card-footer a,
.card-footer button{
    flex:1;
    padding:8px;
    font-size:12px;
    border-radius:10px;
    text-align:center;
    text-decoration:none;
    border:none;
    cursor:pointer;
}

.history-btn{
    background:linear-gradient(90deg,#2563eb,#4f46e5);
    color:white;
}

.refresh-btn{
    background:#1f2937;
    color:white;
    border:1px solid #2d3b56;
}

/* ================= MODAL CHART ================= */

.modal-content{
    width:90%;
    max-width:900px;
    margin:60px auto;
    background:#0f172a;
    border:1px solid #334155;
    border-radius:16px;
    padding:20px;
}

#diskChart{
    width:100% !important;
    height:420px !important;
}

/* ================= RESPONSIVE ================= */

@media(max-width:1400px){
    .server-grid{grid-template-columns:repeat(3,1fr);}
}

@media(max-width:1000px){
    .server-grid{grid-template-columns:repeat(2,1fr);}
    .summary{grid-template-columns:repeat(2,1fr);}
}

@media(max-width:700px){
    .server-grid{grid-template-columns:1fr;}
    .summary{grid-template-columns:1fr;}
    .header{flex-direction:column;align-items:flex-start;gap:10px;}
}