:root{
    --bg:#0f1115;
    --surface:#161a20;
    --surface-2:#1d232c;
    --border:#2b3440;
    --text:#f5f7fb;
    --muted:#aab4c3;
    --blue:#1cbafc;
    --red:#e5484d;
    --green:#28c76f;
    --shadow:0 10px 30px rgba(0,0,0,.28);
    --radius:18px;
}

*{box-sizing:border-box}
body{
    margin:0;
    background:linear-gradient(180deg,#0c0f13,#11151b);
    color:var(--text);
    font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;
}

a{color:inherit;text-decoration:none}

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

.sidebar{
    background:rgba(18,22,28,.96);
    border-right:1px solid var(--border);
    padding:24px 18px;
}

.brand{
    display:flex;
    gap:14px;
    align-items:center;
    margin-bottom:28px;
}

.brand-mark{
    width:48px;
    height:48px;
    border-radius:14px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg, rgba(28,186,252,.25), rgba(229,72,77,.18));
    border:1px solid rgba(28,186,252,.45);
    box-shadow:0 0 20px rgba(28,186,252,.15);
    font-weight:800;
    font-size:20px;
}

.brand h1{
    margin:0;
    font-size:18px;
}
.brand p{
    margin:4px 0 0;
    color:var(--muted);
    font-size:12px;
}

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

.nav a{
    padding:12px 14px;
    border-radius:14px;
    color:var(--muted);
    border:1px solid transparent;
    transition:.18s ease;
}

.nav a:hover{
    color:var(--text);
    border-color:rgba(28,186,252,.28);
    background:rgba(255,255,255,.02);
}

.danger-link:hover{
    border-color:rgba(229,72,77,.35)!important;
}

.main-content{
    padding:24px;
}

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

.topbar h2{
    margin:0;
    font-size:28px;
}

.muted{
    color:var(--muted);
    margin-top:6px;
}

.user-chip{
    padding:10px 14px;
    border-radius:999px;
    border:1px solid var(--border);
    background:var(--surface);
    color:var(--text);
}

.flash{
    margin-bottom:18px;
    padding:14px 16px;
    border-radius:14px;
    border:1px solid var(--border);
}
.flash-success{border-color:rgba(40,199,111,.35)}
.flash-error{border-color:rgba(229,72,77,.35)}

.card-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0,1fr));
    gap:18px;
}

.card{
    background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:18px;
    box-shadow:var(--shadow);
}

.metric{
    font-size:32px;
    font-weight:800;
    margin:8px 0 0;
}

.card-label{
    color:var(--muted);
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.section{
    margin-top:22px;
}

.table-wrap{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    overflow:hidden;
}

table{
    width:100%;
    border-collapse:collapse;
}

th, td{
    padding:14px 16px;
    border-bottom:1px solid var(--border);
    text-align:left;
}

th{
    color:var(--muted);
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.status-chip{
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    border:1px solid transparent;
}

.status-blue{
    background:rgba(28,186,252,.12);
    color:#79d8ff;
    border-color:rgba(28,186,252,.28);
}

.status-red{
    background:rgba(229,72,77,.12);
    color:#ff9a9d;
    border-color:rgba(229,72,77,.28);
}

.status-green{
    background:rgba(40,199,111,.12);
    color:#7ce4a3;
    border-color:rgba(40,199,111,.28);
}

.auth-wrap{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:30px;
}

.auth-card{
    width:min(100%, 440px);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:24px;
    padding:28px;
    box-shadow:var(--shadow);
}

.form-group{
    margin-bottom:16px;
}

label{
    display:block;
    margin-bottom:8px;
    color:var(--muted);
    font-size:14px;
}

input, select, textarea{
    width:100%;
    padding:13px 14px;
    border-radius:14px;
    border:1px solid var(--border);
    background:var(--surface-2);
    color:var(--text);
    outline:none;
}

input:focus, select:focus, textarea:focus{
    border-color:rgba(28,186,252,.45);
    box-shadow:0 0 0 3px rgba(28,186,252,.12);
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:12px 16px;
    border:none;
    border-radius:14px;
    cursor:pointer;
    font-weight:700;
}

.btn-primary{
    background:linear-gradient(135deg, rgba(28,186,252,.95), rgba(229,72,77,.95));
    color:#fff;
}

.btn-secondary{
    background:var(--surface-2);
    color:var(--text);
    border:1px solid var(--border);
}

.placeholder-note {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(28,186,252,.08);
    border: 1px solid rgba(28,186,252,.18);
    color: var(--muted);
}

@media (max-width: 1100px){
    .card-grid{grid-template-columns:repeat(2, minmax(0,1fr))}
}
@media (max-width: 860px){
    .app-shell{grid-template-columns:1fr}
    .sidebar{display:none}
}
@media (max-width: 640px){
    .card-grid{grid-template-columns:1fr}
}
