:root{
    --bg:#0f172a;
    --bg-light:#1e293b;
    --card:#111827;
    --text:#f8fafc;
    --text-light:#cbd5e1;
    --border:#334155;
    --primary:#38bdf8;
    --success:#22c55e;
    --danger:#ef4444;
    --shadow:0 4px 20px rgba(0,0,0,.25);
}

body.light-theme{
    --bg:#f8fafc;
    --bg-light:#e2e8f0;
    --card:#ffffff;
    --text:#0f172a;
    --text-light:#475569;
    --border:#cbd5e1;
    --shadow:0 4px 12px rgba(0,0,0,.08);
}

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

body{
    font-family:Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
    transition:background .3s,color .3s;
}

.app-container{
    display:flex;
    min-height:100vh;
}

/* sidebar */

.sidebar{
    width:260px;
    background:var(--bg-light);
    border-right:1px solid var(--border);
    padding:24px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.logo{
    padding-bottom:20px;
    margin-bottom:20px;
    border-bottom:1px solid var(--border);
}

.logo h2{
    color:var(--primary);
    font-size:26px;
}

.sidebar ul{
    list-style:none;
}

.sidebar li{
    margin-bottom:10px;
}

.nav-btn{
    width:100%;
    border:none;
    background:none;
    color:var(--text);
    text-align:left;
    padding:12px;
    border-radius:10px;
    cursor:pointer;
    transition:.3s;
    font-size:15px;
}

.nav-btn:hover,
.nav-btn.active{
    background:var(--primary);
    color:#fff;
}

/* theme */

.theme-toggle{
    margin-top:20px;
    padding-top:20px;
    border-top:1px solid var(--border);
}

/* main */

.main-content{
    flex:1;
    padding:24px;
    display:flex;
    flex-direction:column;
    min-height:100vh;
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:24px;
    padding-bottom:16px;
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    background:var(--bg);
    z-index:10;
}

.topbar h1{
    font-size:28px;
}

.status-indicator{
    font-size:14px;
    color:var(--text-light);
}

/* sections */

.content-section{
    display:none;
    animation:fade .3s ease;
}

.content-section.active{
    display:block;
}

@keyframes fade{
    from{
        opacity:0;
        transform:translateY(8px);
    }

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

/* layout */

.panel-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
}

/* cards */

.card,
.card-box{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:12px;
    padding:20px;
    box-shadow:var(--shadow);
    transition:.3s;
}

.card:hover,
.card-box:hover{
    transform:translateY(-2px);
}

.card h3{
    margin-bottom:18px;
}

/* forms */

label{
    display:block;
    margin:12px 0 6px;
    color:var(--text-light);
    font-size:14px;
}

textarea,
select,
input,
input[type="number"]{
    width:100%;
    padding:12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--bg-light);
    color:var(--text);
    outline:none;
}

textarea{
    resize:vertical;
    min-height:100px;
}

textarea:focus,
select:focus,
input:focus{
    border-color:var(--primary);
}

input[type="range"]{
    width:100%;
    margin-top:8px;
}

/* buttons */

.button-group{
    display:flex;
    gap:12px;
    margin-top:20px;
}

button{
    border:none;
    padding:12px 18px;
    border-radius:10px;
    background:var(--primary);
    color:white;
    cursor:pointer;
    transition:.3s;
    font-weight:600;
}

button:hover{
    opacity:.9;
}

button:disabled{
    opacity:.6;
    cursor:not-allowed;
}

/* metrics */

.metrics{
    display:flex;
    justify-content:space-between;
    margin-bottom:16px;
    color:var(--text-light);
    font-size:14px;
    padding:12px;
    background:var(--bg-light);
    border-radius:10px;
    border:1px solid var(--border);
}

/* output */

.output-box{
    min-height:350px;
    max-height:600px;
    overflow-y:auto;
    padding:16px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--bg-light);
    line-height:1.6;
    white-space:pre-wrap;
}

.output-box::-webkit-scrollbar{
    width:8px;
}

.output-box::-webkit-scrollbar-thumb{
    background:var(--border);
    border-radius:20px;
}

/* status */

.status-online{
    color:var(--success);
    font-weight:600;
}

.status-offline{
    color:var(--danger);
    font-weight:600;
}

/* toast */

.toast{
    position:fixed;
    right:20px;
    bottom:20px;
    background:var(--primary);
    color:white;
    padding:14px 20px;
    border-radius:10px;
    opacity:0;
    pointer-events:none;
    transition:.3s;
    box-shadow:var(--shadow);
}

.toast.show{
    opacity:1;
    pointer-events:auto;
}

/* shortcut button */

#shortcutHelpBtn{
    margin-right:10px;
}