*{box-sizing:border-box}
:root{
    --bg:#f4f6f8;
    --surface:#ffffff;
    --surface-2:#f8fafc;
    --text:#111827;
    --muted:#6b7280;
    --border:#dbe3ea;
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --danger:#dc2626;
    --success:#16a34a;
    --warning:#ea580c;
    --sidebar:#0f172a;
    --sidebar-link:#cbd5e1;
    --shadow:0 10px 30px rgba(15,23,42,.06);
    --radius:5px;
}
body{
    margin:0;
    font-family:Inter,Arial,sans-serif;
    background:var(--bg);
    color:var(--text);
}
a{text-decoration:none;color:inherit}
.app-shell{display:flex;min-height:100vh}
.sidebar{
    width:250px;
    background:var(--sidebar);
    color:white;
    padding:20px;
    position:sticky;
    top:0;
    height:100vh;
    overflow-y:auto;
    z-index:50;
}
.logo-block{display:flex;gap:12px;align-items:center;margin-bottom:24px}
.logo-circle{
    width:40px;height:40px;border-radius:var(--radius);
    display:grid;place-items:center;
    background:rgba(255,255,255,.12);
    font-weight:700
}
.logo-title{font-weight:700}
.logo-sub{font-size:12px;color:#94a3b8}
.nav-menu{display:flex;flex-direction:column;gap:6px}
.nav-menu a{
    padding:11px 12px;
    border-radius:var(--radius);
    color:var(--sidebar-link);
    transition:.2s ease;
}
.nav-menu a:hover{
    background:rgba(255,255,255,.08);
    color:#fff;
}
.content{flex:1;padding:24px;min-width:0}
.page-top{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:18px 20px;
    box-shadow:var(--shadow);
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}
.page-top h2{margin:0 0 4px}
.page-top p{margin:0;color:var(--muted)}
.user-badge{
    background:var(--surface-2);
    border:1px solid var(--border);
    padding:10px 14px;
    border-radius:var(--radius);
}
.panel{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:20px;
    margin-bottom:16px;
}
.panel h1,.panel h2,.panel h3{margin-top:0}
.grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
}
.stat-card h3{
    color:var(--muted);
    font-size:14px;
    margin-bottom:8px;
}
.stat-card strong{
    font-size:28px;
}
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    border:0;
    background:var(--primary);
    color:#fff;
    padding:10px 14px;
    border-radius:var(--radius);
    cursor:pointer;
    font-size:14px;
}
.btn:hover{background:var(--primary-dark)}
.btn.secondary{
    background:var(--surface-2);
    color:var(--text);
    border:1px solid var(--border);
}
.btn.danger{background:var(--danger)}
.btn.success{background:var(--success)}
.icon-btn{
    border:1px solid var(--border);
    background:#fff;
    padding:8px 10px;
    border-radius:var(--radius);
    cursor:pointer;
}
input,select,textarea{
    width:100%;
    padding:11px 12px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    margin-top:6px;
    background:#fff;
}
label{
    display:block;
    margin-bottom:14px;
    font-weight:600;
}
label small{
    display:block;
    margin-top:6px;
    color:var(--muted);
    font-weight:400;
}
.check-row{
    display:flex;
    align-items:center;
    gap:8px;
    font-weight:500;
}
.check-row input{width:auto;margin:0}
.form-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
}
.table-wrap{overflow-x:auto}
table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
}
th,td{
    padding:12px;
    border-bottom:1px solid var(--border);
    text-align:left;
    white-space:nowrap;
}
th{
    background:var(--surface-2);
    color:#475569;
    font-size:13px;
}
.actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.badge{
    display:inline-block;
    padding:5px 8px;
    border-radius:999px;
    font-size:12px;
    background:var(--surface-2);
    border:1px solid var(--border);
}
.badge.ok{color:var(--success)}
.badge.warn{color:var(--warning)}
.badge.admin{color:var(--primary)}
.alert{
    padding:12px;
    border-radius:var(--radius);
    margin-bottom:14px;
}
.alert.error{background:#fee2e2;color:#991b1b}
.alert.success{background:#dcfce7;color:#166534}
.mobile-topbar{display:none}
.sidebar-overlay{display:none}
.center-page{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:20px;
}
.small-panel{
    width:100%;
    max-width:420px;
}
.permission-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
}
.permission-item{
    display:flex;
    gap:10px;
    align-items:center;
    background:var(--surface-2);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:12px;
}
.permission-item input{width:auto;margin:0}
@media (max-width: 1100px){
    .grid{grid-template-columns:repeat(2,1fr)}
    .permission-grid{grid-template-columns:1fr}
}
@media (max-width: 900px){
    .mobile-topbar{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        position:sticky;
        top:0;
        z-index:40;
        padding:12px 16px;
        background:#fff;
        border-bottom:1px solid var(--border);
    }
    .app-shell{display:block}
    .sidebar{
        position:fixed;
        left:-270px;
        top:0;
        transition:.25s ease;
        box-shadow:0 18px 40px rgba(0,0,0,.22);
    }
    .sidebar.open{left:0}
    .sidebar-overlay.open{
        display:block;
        position:fixed;
        inset:0;
        background:rgba(15,23,42,.45);
        z-index:45;
    }
    .content{padding:16px}
    .page-top{display:none}
    .grid,.form-grid{grid-template-columns:1fr}
    .actions{flex-direction:column}
    .actions .btn{text-align:center}
}