:root{
    --bg:#0b1020;
    --bg-2:#11172b;
    --panel:#141b31;
    --panel-2:#1a2340;
    --line:rgba(255,255,255,.08);
    --text:#ecf1ff;
    --muted:#9aa7c7;
    --accent:#6c7cff;
    --accent-2:#48d6a8;
    --danger:#ff5c7a;
    --warn:#f5b94b;
    --success:#48d6a8;
    --shadow:0 20px 50px rgba(0,0,0,.35);
    --radius:22px;
    --radius-sm:14px;
}

*{
    box-sizing:border-box;
}

html,body{
    margin:0;
    min-height:100%;
    background:
        radial-gradient(circle at top left, rgba(108,124,255,.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(72,214,168,.12), transparent 28%),
        linear-gradient(180deg, var(--bg), #070b16 100%);
    color:var(--text);
    font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,input{
    font:inherit;
}

button{
    cursor:pointer;
}

.hidden{
    display:none !important;
}

.app-shell{
    min-height:100vh;
    display:grid;
    grid-template-columns:300px 1fr;
}

.sidebar{
    background:rgba(10,14,27,.72);
    border-right:1px solid var(--line);
    backdrop-filter:blur(18px);
    padding:24px;
    display:flex;
    flex-direction:column;
    gap:24px;
}

.brand{
    display:flex;
    align-items:center;
    gap:14px;
    padding:14px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    box-shadow:var(--shadow);
}

.brand-mark{
    width:48px;
    height:48px;
    border-radius:16px;
    display:grid;
    place-items:center;
    font-weight:800;
    font-size:1.3rem;
    background:linear-gradient(135deg, var(--accent), var(--accent-2));
    color:white;
}

.brand-title{
    font-size:1.1rem;
    font-weight:800;
    letter-spacing:.02em;
}

.brand-subtitle{
    font-size:.86rem;
    color:var(--muted);
    margin-top:2px;
}

.nav{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.nav-btn,
.ghost-btn,
.primary-btn,
.danger-btn{
    border:none;
    border-radius:16px;
    padding:13px 16px;
    transition:.2s ease;
    color:var(--text);
}

.nav-btn{
    background:transparent;
    border:1px solid transparent;
    text-align:left;
    color:var(--muted);
}

.nav-btn:hover{
    background:rgba(255,255,255,.04);
    color:var(--text);
}

.nav-btn.active{
    background:linear-gradient(135deg, rgba(108,124,255,.22), rgba(72,214,168,.14));
    border-color:rgba(108,124,255,.25);
    color:var(--text);
}

.sidebar-footer{
    margin-top:auto;
    display:grid;
    gap:10px;
}

.status-pill{
    padding:11px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
    color:var(--muted);
    font-size:.9rem;
}

.status-online{
    color:var(--success);
    border-color:rgba(72,214,168,.22);
    background:rgba(72,214,168,.08);
}

.status-offline{
    color:var(--danger);
    border-color:rgba(255,92,122,.22);
    background:rgba(255,92,122,.08);
}

.status-unknown{
    color:var(--warn);
    border-color:rgba(245,185,75,.22);
    background:rgba(245,185,75,.08);
}

.main{
    padding:28px;
}

.topbar{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:24px;
}

h1{
    margin:0;
    font-size:2rem;
    letter-spacing:-.03em;
}

#pageSubtitle{
    margin:8px 0 0;
    color:var(--muted);
    line-height:1.5;
}

.topbar-actions{
    display:flex;
    gap:10px;
}

.ghost-btn,
.primary-btn,
.danger-btn{
    font-weight:700;
}

.ghost-btn{
    background:rgba(255,255,255,.04);
    border:1px solid var(--line);
}

.ghost-btn:hover{
    background:rgba(255,255,255,.08);
}

.primary-btn{
    background:linear-gradient(135deg, var(--accent), #8d93ff);
    box-shadow:0 10px 24px rgba(108,124,255,.2);
}

.primary-btn:hover{
    transform:translateY(-1px);
    filter:brightness(1.03);
}

.danger-btn{
    background:linear-gradient(135deg, var(--danger), #ff8ba3);
    box-shadow:0 10px 24px rgba(255,92,122,.16);
}

.danger-btn:hover{
    transform:translateY(-1px);
    filter:brightness(1.03);
}

.content{
    display:grid;
    gap:20px;
}

.grid{
    display:grid;
    gap:18px;
}

.grid.two{
    grid-template-columns:repeat(2, minmax(0, 1fr));
}

.grid.three{
    grid-template-columns:repeat(3, minmax(0, 1fr));
}

.card{
    background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.03));
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:22px;
    box-shadow:var(--shadow);
}

.card h2,
.card h3{
    margin:0 0 10px;
    letter-spacing:-.02em;
}

.card p{
    margin:0;
    color:var(--muted);
    line-height:1.6;
}

.hero{
    padding:28px;
    background:
        radial-gradient(circle at top right, rgba(108,124,255,.18), transparent 30%),
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
}

.hero .kicker{
    color:var(--accent-2);
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
    font-size:.8rem;
    margin-bottom:12px;
}

.hero h2{
    font-size:2rem;
    margin-bottom:12px;
}

.hero-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:18px;
}

.form{
    display:grid;
    gap:12px;
    max-width:520px;
}

.input{
    width:100%;
    padding:14px 16px;
    border-radius:16px;
    border:1px solid var(--line);
    background:rgba(8,12,24,.65);
    color:var(--text);
    outline:none;
}

.input:focus{
    border-color:rgba(108,124,255,.6);
    box-shadow:0 0 0 4px rgba(108,124,255,.12);
}

.label{
    font-size:.93rem;
    font-weight:700;
    color:var(--muted);
    margin-bottom:4px;
}

.form-row{
    display:grid;
    gap:8px;
}

.small{
    font-size:.92rem;
    color:var(--muted);
    line-height:1.5;
}

.mono{
    font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size:.92rem;
    word-break:break-all;
    color:#d7dfff;
}

.pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.05);
    border:1px solid var(--line);
    color:var(--muted);
    font-size:.9rem;
}

.status-dot{
    width:9px;
    height:9px;
    border-radius:50%;
    background:var(--warn);
    box-shadow:0 0 0 4px rgba(245,185,75,.1);
}

.status-dot.on{
    background:var(--success);
    box-shadow:0 0 0 4px rgba(72,214,168,.1);
}

.status-dot.off{
    background:var(--danger);
    box-shadow:0 0 0 4px rgba(255,92,122,.1);
}

.notice{
    padding:14px 16px;
    border-radius:16px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.04);
    color:var(--muted);
    line-height:1.5;
}

.notice.ok{
    border-color:rgba(72,214,168,.22);
    background:rgba(72,214,168,.08);
    color:#d7fff2;
}

.notice.err{
    border-color:rgba(255,92,122,.22);
    background:rgba(255,92,122,.08);
    color:#ffd8e0;
}

.kv{
    display:grid;
    gap:10px;
}

.kv-item{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:12px 14px;
    border-radius:14px;
    background:rgba(255,255,255,.03);
    border:1px solid var(--line);
}

.kv-key{
    color:var(--muted);
}

.kv-val{
    font-weight:700;
    text-align:right;
}

@media (max-width: 980px){
    .app-shell{
        grid-template-columns:1fr;
    }

    .sidebar{
        border-right:none;
        border-bottom:1px solid var(--line);
    }

    .grid.two,
    .grid.three{
        grid-template-columns:1fr;
    }

    .topbar{
        flex-direction:column;
    }
}
