:root{
    --bg:#f6f8fb;
    --panel:#ffffff;
    --panel-soft:#fbfcfe;
    --border:#edf0f4;
    --text:#31343b;
    --muted:#9398a3;
    --cyan:#17b8ec;
    --cyan-soft:#e8f9ff;
    --green:#65c95b;
    --green-soft:#eefbea;
    --lime:#a9d938;
    --lime-soft:#f4fae5;
    --blue:#3aa9ed;
    --blue-soft:#eaf6fd;
    --shadow:0 12px 35px rgba(40,55,75,.06);
    --radius:24px;
    --radius-small:16px;
}

*{box-sizing:border-box}

html,body{
    margin:0;
    min-height:100%;
}

body{
    background:
        radial-gradient(circle at 12% 90%, rgba(213,239,247,.35), transparent 25%),
        radial-gradient(circle at 90% 85%, rgba(230,244,229,.42), transparent 25%),
        var(--bg);
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
    color:var(--text);
}

a{color:inherit}

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

.sidebar{padding:22px 18px}

.sidebar-inner{
    height:calc(100vh - 44px);
    min-height:650px;
    background:rgba(255,255,255,.72);
    border:1px solid rgba(255,255,255,.9);
    border-radius:32px;
    padding:26px 20px;
    display:flex;
    flex-direction:column;
    box-shadow:var(--shadow);
    backdrop-filter:blur(16px);
    position:sticky;
    top:22px;
}

.logo{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:38px;
}

.logo-mark{
    width:40px;
    height:40px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(145deg,#21c5ee,#32a4e9);
    color:white;
    font-weight:800;
    font-size:18px;
    box-shadow:0 8px 18px rgba(23,184,236,.25);
}

.logo-title{
    font-size:20px;
    font-weight:700;
}

.logo-title span{color:var(--cyan)}

.menu-title{
    color:var(--cyan);
    font-size:15px;
    font-weight:600;
    margin:0 12px 15px;
}

.menu{
    display:flex;
    flex-direction:column;
    gap:7px;
}

.menu-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:13px 15px;
    border-radius:15px;
    color:#5c6068;
    text-decoration:none;
    font-size:14px;
    font-weight:500;
    transition:.2s;
}

.menu-item:hover{background:#f6fafc}

.menu-item.active{
    background:#fff;
    color:#27aee4;
    box-shadow:0 3px 14px rgba(50,80,100,.06);
}

.icon{
    width:28px;
    height:28px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:9px;
    background:#f7fafc;
    font-size:14px;
}

.menu-item.active .icon{background:var(--cyan-soft)}

.side-bottom{margin-top:auto}

.side-card{
    text-align:center;
    padding:22px 15px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:22px;
}

.server-orb{
    width:66px;
    height:66px;
    margin:0 auto 18px;
    border-radius:50%;
    background:radial-gradient(circle at 35% 30%,#66e4ff,#0ec9ef 55%,#2b9ee7 100%);
    box-shadow:inset 0 0 0 7px #ecfbff,0 10px 22px rgba(25,190,230,.23);
}

.side-card strong{
    display:block;
    margin-bottom:7px;
}

.side-card span{
    color:var(--muted);
    font-size:13px;
    line-height:1.5;
}

.content-wrap{
    padding:22px 22px 22px 0;
}

.content{
    min-height:calc(100vh - 44px);
    background:rgba(255,255,255,.62);
    border-radius:34px;
    box-shadow:var(--shadow);
    overflow:hidden;
}

.topbar{
    height:72px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 32px;
    border-bottom:1px solid #f0f1f3;
}

.server-switch{
    display:flex;
    align-items:center;
    gap:12px;
}

.switch-icon{
    width:38px;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--green-soft);
    color:var(--green);
    border-radius:50%;
}

.switch-name{
    font-weight:600;
    font-size:14px;
}

.switch-tag{
    margin-left:6px;
    padding:4px 8px;
    background:#f5f6f8;
    border:1px solid #e9ebef;
    border-radius:10px;
    color:#777c85;
    font-size:11px;
}

.top-actions{
    display:flex;
    align-items:center;
    gap:15px;
}

.top-icon{
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    color:#62666d;
    background:#fafbfd;
}

.top-link{text-decoration:none}

.top-action-button{
    border:0;
    cursor:pointer;
    font:inherit;
}

.top-action-button:disabled{
    cursor:default;
    opacity:.45;
}

.user{
    display:flex;
    align-items:center;
    gap:10px;
    margin-left:8px;
}

.avatar{
    width:38px;
    height:38px;
    border-radius:50%;
    background:linear-gradient(145deg,#c9f3ff,#65cceb);
    display:flex;
    align-items:center;
    justify-content:center;
    color:white;
    font-weight:700;
}

.user-name{
    font-size:13px;
    font-weight:600;
}

.user-role{
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
    font-weight:500;
}

.logout-form{margin:0 0 0 6px}

.logout-button{
    border:0;
    border-radius:12px;
    padding:8px 11px;
    background:#f3f6f8;
    color:#5f6670;
    font-size:11px;
    font-weight:600;
    cursor:pointer;
    transition:.15s;
}

.logout-button:hover{background:#e9eef2}

.main{
    padding:34px 36px 45px;
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:28px;
}

.page-header h1{
    margin:0 0 6px;
    font-size:28px;
    font-weight:700;
    letter-spacing:-.4px;
}

.breadcrumb{
    color:var(--muted);
    font-size:13px;
}

.quick-btn{
    border:none;
    padding:11px 17px;
    border-radius:16px;
    background:white;
    color:#555a61;
    box-shadow:0 2px 10px rgba(20,40,60,.05);
    font-size:13px;
    cursor:pointer;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:1.7fr .85fr;
    gap:20px;
}

.hero-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    padding:28px;
    min-height:275px;
    position:relative;
    overflow:hidden;
}

.hero-title{
    margin:0 0 12px;
    font-size:20px;
}

.hero-text{
    max-width:560px;
    color:var(--muted);
    line-height:1.6;
    font-size:14px;
}

.hero-actions{
    position:absolute;
    bottom:26px;
    left:28px;
    display:flex;
    gap:10px;
}

.btn-primary,
.btn-light{
    border:none;
    padding:11px 20px;
    border-radius:22px;
    font-size:13px;
    cursor:pointer;
}

.btn-primary{
    background:var(--cyan);
    color:white;
}

.btn-light{
    background:#eef9fd;
    color:#27a6dc;
}

.action-link{text-decoration:none}

.hero-art{
    position:absolute;
    right:34px;
    bottom:28px;
    width:190px;
    height:145px;
}

.server-box{
    position:absolute;
    width:145px;
    height:105px;
    right:10px;
    bottom:12px;
    border-radius:18px;
    background:linear-gradient(145deg,#f9feff,#e8f5fa);
    border:1px solid #d9edf5;
    box-shadow:10px 18px 25px rgba(40,100,130,.10);
    transform:rotate(-4deg);
}

.server-box:before{
    content:"";
    position:absolute;
    width:48px;
    height:48px;
    border-radius:14px;
    background:linear-gradient(145deg,#0fd0e9,#25b7df);
    left:22px;
    top:25px;
    box-shadow:58px 0 0 #18c8e8,0 55px 0 #2cc9e3,58px 55px 0 #14b7df;
}

.server-gear{
    position:absolute;
    right:0;
    top:0;
    width:52px;
    height:52px;
    border-radius:50%;
    background:#1eb6e5;
    border:9px solid #e5f7fc;
    box-shadow:0 4px 12px rgba(30,182,229,.25);
}

.quick-panel-title{
    margin:0 0 12px;
    font-size:15px;
}

.quick-list{
    display:flex;
    flex-direction:column;
    gap:11px;
}

.quick-action{
    background:#fff;
    border:1px solid var(--border);
    border-radius:20px;
    padding:15px;
    display:flex;
    align-items:center;
    gap:14px;
    transition:.15s;
}

.quick-action:hover{
    transform:translateY(-1px);
    box-shadow:0 8px 20px rgba(40,55,75,.06);
}

.quick-action-icon{
    width:48px;
    height:48px;
    flex:0 0 48px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    font-size:18px;
}

.quick-action:nth-child(1) .quick-action-icon{
    color:#24b1e8;
    background:#edfaff;
}

.quick-action:nth-child(2) .quick-action-icon{
    color:#11badb;
    background:#e7fbff;
}

.quick-action:nth-child(3) .quick-action-icon{
    color:#58c95a;
    background:#effbee;
}

.quick-action:nth-child(4) .quick-action-icon{
    color:#8dc43c;
    background:#f4f9e9;
}

.quick-action strong{
    display:block;
    font-size:14px;
    margin-bottom:4px;
}

.quick-action span{
    display:block;
    color:var(--muted);
    font-size:12px;
}

.section-title{
    margin:28px 0 14px;
    font-size:15px;
}

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

.stat-card{
    background:white;
    border:1px solid var(--border);
    border-radius:22px;
    padding:20px;
    min-height:145px;
}

.stat-label{
    color:var(--muted);
    font-size:12px;
    margin-bottom:7px;
}

.stat-value{
    font-size:20px;
    font-weight:700;
}

.stat-sub{
    margin-top:6px;
    color:#69c85f;
    font-size:11px;
}

.progress{
    margin-top:22px;
    width:100%;
    height:7px;
    background:#edf2f5;
    border-radius:10px;
    overflow:hidden;
}

.progress span{
    display:block;
    height:100%;
    border-radius:10px;
    background:linear-gradient(90deg,#1fc2e5,#46a7e9);
}

.system-panel{
    margin-top:20px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    padding:24px;
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:18px;
}

.system-row{
    padding:16px;
    background:#fafbfd;
    border-radius:15px;
}

.system-row small{
    display:block;
    color:var(--muted);
    margin-bottom:7px;
}

.system-row strong{
    font-size:14px;
    word-break:break-word;
}

.module-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    overflow:hidden;
}

.module-card-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:24px 26px;
    border-bottom:1px solid var(--border);
}

.module-card-header h2{
    margin:0 0 6px;
    font-size:19px;
}

.module-card-header p{
    margin:0;
    color:var(--muted);
    font-size:13px;
}

.empty-state{
    padding:70px 30px;
    text-align:center;
}

.empty-icon{
    width:66px;
    height:66px;
    margin:0 auto 18px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:20px;
    background:var(--cyan-soft);
    color:var(--cyan);
    font-size:28px;
}

.empty-state h3{
    margin:0 0 8px;
    font-size:18px;
}

.empty-state p{
    margin:0 auto;
    max-width:520px;
    color:var(--muted);
    font-size:13px;
    line-height:1.6;
}

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

/* Login */

.login-body{
    margin:0;
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:
        radial-gradient(circle at 15% 18%, rgba(23,184,236,.13), transparent 28%),
        radial-gradient(circle at 86% 82%, rgba(101,201,91,.12), transparent 28%),
        #f6f8fb;
}

.login-shell{
    width:100%;
    max-width:490px;
}

.login-brand{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    margin-bottom:20px;
}

.login-brand-title{
    font-size:21px;
    font-weight:700;
}

.login-brand-title span{color:var(--cyan)}

.login-brand-sub{
    margin-top:3px;
    color:var(--muted);
    font-size:12px;
}

.login-card{
    background:#fff;
    border:1px solid var(--border);
    border-radius:28px;
    padding:32px;
    box-shadow:0 18px 55px rgba(40,55,75,.08);
}

.login-card-head h1{
    margin:0 0 7px;
    font-size:23px;
}

.login-card-head p{
    margin:0 0 22px;
    color:var(--muted);
    font-size:13px;
    line-height:1.5;
}

.form-label{
    display:block;
    margin:16px 0 7px;
    font-size:13px;
    font-weight:600;
}

.form-input{
    width:100%;
    padding:12px 13px;
    border:1px solid #dfe4ea;
    border-radius:12px;
    font:inherit;
    outline:none;
}

.form-input:focus{
    border-color:var(--cyan);
    box-shadow:0 0 0 3px rgba(23,184,236,.10);
}

.login-button{
    width:100%;
    margin-top:22px;
    padding:13px 16px;
    border:0;
    border-radius:14px;
    background:var(--cyan);
    color:#fff;
    font-weight:700;
    cursor:pointer;
}

.login-alert{
    margin:0 0 16px;
    padding:12px 13px;
    border-radius:12px;
    background:#fff1f2;
    border:1px solid #fecdd3;
    color:#9f1239;
    font-size:13px;
}

.login-foot{
    margin-top:22px;
    text-align:center;
    color:var(--muted);
    font-size:11px;
}

/* Dark mode */

html[data-theme="dark"]{
    --bg:#10151d;
    --panel:#171d27;
    --panel-soft:#1d2430;
    --border:#293241;
    --text:#e7edf5;
    --muted:#929dad;
    --cyan:#2fc7f2;
    --cyan-soft:#123442;
    --green:#7bd56d;
    --green-soft:#1e3624;
    --lime:#b8df4f;
    --lime-soft:#2b321b;
    --blue:#4cb5ef;
    --blue-soft:#173040;
    --shadow:0 14px 38px rgba(0,0,0,.28);
}

html[data-theme="dark"] body{
    background:
        radial-gradient(circle at 12% 90%, rgba(24,91,110,.25), transparent 25%),
        radial-gradient(circle at 90% 85%, rgba(61,92,56,.18), transparent 25%),
        var(--bg);
}

html[data-theme="dark"] .sidebar-inner,
html[data-theme="dark"] .content{
    background:rgba(23,29,39,.92);
    border-color:#242d3a;
}

html[data-theme="dark"] .topbar{border-bottom-color:#293241}
html[data-theme="dark"] .menu-item{color:#b8c0cc}
html[data-theme="dark"] .menu-item:hover{background:#1b2430}

html[data-theme="dark"] .menu-item.active{
    background:#202a37;
    color:#42c7ef;
}

html[data-theme="dark"] .icon,
html[data-theme="dark"] .top-icon,
html[data-theme="dark"] .quick-btn,
html[data-theme="dark"] .side-card,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .system-panel,
html[data-theme="dark"] .module-card,
html[data-theme="dark"] .login-card{
    background:#171d27;
    border-color:#293241;
    color:var(--text);
}

html[data-theme="dark"] .system-row{background:#1d2430}

html[data-theme="dark"] .switch-tag{
    background:#1d2430;
    border-color:#293241;
    color:#aeb7c4;
}

html[data-theme="dark"] .logout-button{
    background:#202936;
    color:#d7dee7;
}

html[data-theme="dark"] .logout-button:hover{background:#293545}

html[data-theme="dark"] .form-input{
    background:#111822;
    border-color:#303a49;
    color:#edf2f7;
}

html[data-theme="dark"] .progress{background:#28313e}

@media(max-width:1100px){
    .app{grid-template-columns:220px 1fr}
    .sidebar{padding-right:10px}
    .dashboard-grid{grid-template-columns:1fr}
    .stats{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:760px){
    .app{display:block}
    .sidebar{display:none}
    .content-wrap{padding:0}
    .content{min-height:100vh;border-radius:0}
    .topbar{padding:0 18px}
    .main{padding:24px 18px}
    .stats{grid-template-columns:1fr}
    .hero-card{min-height:390px}
    .hero-art{right:22px;bottom:80px}
    .system-panel{grid-template-columns:1fr}
    .module-card-header{align-items:flex-start;flex-direction:column}
}
