:root{
    --bg:#f4f7fb;
    --sidebar:#101828;
    --sidebar-soft:#182230;
    --sidebar-border:#263244;
    --card:#ffffff;
    --ink:#172033;
    --muted:#667085;
    --primary:#2563eb;
    --primary-dark:#1d4ed8;
    --primary-soft:#eff4ff;
    --border:#d9e2f2;
    --danger:#b91c1c;
    --success:#047857;
    --shadow:0 18px 45px rgba(15,23,42,.08);
    --radius:18px;
}

*{box-sizing:border-box}

body{
    margin:0;
    background:var(--bg);
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color:var(--ink);
}

.app-layout{
    display:grid;
    grid-template-columns:280px minmax(0,1fr);
    min-height:100vh;
}

.app-sidebar{
    background:linear-gradient(180deg,var(--sidebar) 0%,#0b1220 100%);
    color:#ffffff;
    padding:22px 18px;
    border-right:1px solid var(--sidebar-border);
    position:sticky;
    top:0;
    height:100vh;
    overflow-y:auto;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 8px 24px;
    border-bottom:1px solid rgba(255,255,255,.10);
    margin-bottom:20px;
}

.sidebar-logo{
    min-width:62px;
    height:38px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#ffffff;
    color:#1d4ed8;
    font-weight:900;
    font-size:12px;
    letter-spacing:.08em;
}

.sidebar-title{
    font-weight:900;
    font-size:18px;
    line-height:1.1;
}

.sidebar-subtitle{
    color:#cbd5e1;
    font-size:12px;
    font-weight:700;
    margin-top:4px;
}

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

.nav-section-title{
    margin:18px 10px 7px;
    color:#94a3b8;
    font-size:11px;
    font-weight:900;
    letter-spacing:.11em;
    text-transform:uppercase;
}

.app-nav-link{
    display:flex;
    align-items:center;
    min-height:44px;
    padding:11px 13px;
    border-radius:13px;
    color:#dbeafe;
    text-decoration:none;
    font-weight:800;
    border:1px solid transparent;
    transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease;
}

.app-nav-link:hover{
    background:rgba(255,255,255,.08);
    border-color:rgba(255,255,255,.10);
    color:#ffffff;
    transform:translateX(2px);
}

.app-nav-link.active{
    background:#ffffff;
    color:#1d4ed8;
    border-color:#ffffff;
    box-shadow:0 10px 24px rgba(0,0,0,.20);
    pointer-events:none;
}

.app-main{
    min-width:0;
}

.app-topbar{
    height:78px;
    background:#ffffff;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 30px;
    position:sticky;
    top:0;
    z-index:5;
    box-shadow:0 6px 24px rgba(15,23,42,.04);
}

.page-kicker{
    color:var(--muted);
    font-size:12px;
    font-weight:900;
    letter-spacing:.09em;
    text-transform:uppercase;
}

.page-title{
    font-size:22px;
    font-weight:900;
    margin-top:3px;
}

.user-chip{
    background:#f8fafc;
    border:1px solid var(--border);
    border-radius:999px;
    padding:9px 13px;
    color:#344054;
    font-weight:800;
}

.public-layout{
    min-height:100vh;
}

.container{
    max-width:1180px;
    margin:30px auto;
    padding:0 24px;
}

.card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding:24px;
    margin-bottom:22px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:18px;
}

.field{margin-bottom:16px}

label{
    display:block;
    font-weight:800;
    margin-bottom:7px;
}

input,select,textarea{
    width:100%;
    padding:12px;
    border:1px solid var(--border);
    border-radius:12px;
    font:inherit;
    background:#fff;
}

textarea{min-height:120px}

.btn{
    display:inline-block;
    background:var(--primary);
    color:#fff;
    padding:11px 16px;
    border-radius:12px;
    text-decoration:none;
    border:0;
    font-weight:800;
    cursor:pointer;
}

.btn:hover{background:var(--primary-dark)}
.btn.secondary{background:#475467}
.btn.danger{background:var(--danger)}

.muted{color:var(--muted)}

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

.table th,.table td{
    text-align:left;
    padding:12px;
    border-bottom:1px solid var(--border);
    vertical-align:top;
}

.table th{
    font-size:13px;
    color:#475467;
    background:#f8fafc;
}

.pill{
    display:inline-block;
    padding:4px 9px;
    border-radius:99px;
    background:#eef2ff;
    font-size:12px;
    font-weight:800;
}

.alert{
    padding:12px;
    border-radius:12px;
    background:#eef2ff;
    border:1px solid var(--border);
    margin-bottom:16px;
}

.error{
    background:#fff1f2;
    border-color:#fecdd3;
    color:#9f1239;
}

.success{
    background:#ecfdf5;
    border-color:#bbf7d0;
    color:#065f46;
}

.nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:18px;
}

.nav a{
    background:#fff;
    border:1px solid var(--border);
    padding:9px 12px;
    border-radius:10px;
    text-decoration:none;
    color:var(--ink);
    font-weight:700;
}

.inline-form{display:inline}

.link-button{
    background:none;
    border:0;
    color:#2563eb;
    text-decoration:underline;
    cursor:pointer;
    padding:0;
    font:inherit;
}

.checkbox-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:10px;
    margin-top:8px;
}

.checkbox-item{
    display:flex;
    gap:8px;
    align-items:center;
    background:#fff;
    border:1px solid var(--border);
    border-radius:10px;
    padding:10px;
}

.checkbox-item input{width:auto}

.badge{
    display:inline-block;
    padding:3px 8px;
    border-radius:999px;
    background:#f2f4f7;
    color:#344054;
    font-size:12px;
    font-weight:800;
}

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

    .app-sidebar{
        position:relative;
        height:auto;
        padding:16px;
    }

    .sidebar-brand{
        padding-bottom:14px;
        margin-bottom:12px;
    }

    .app-nav{
        display:grid;
        grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
        gap:8px;
    }

    .nav-section-title{
        grid-column:1/-1;
        margin:12px 4px 2px;
    }

    .app-nav-link{
        background:rgba(255,255,255,.06);
        justify-content:center;
        text-align:center;
    }

    .app-nav-link:hover{
        transform:none;
    }

    .app-topbar{
        position:relative;
        height:auto;
        padding:18px;
        align-items:flex-start;
        gap:12px;
    }

    .container{
        margin:22px auto;
        padding:0 16px;
    }
}

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

    .app-topbar{
        flex-direction:column;
    }

    .user-chip{
        width:100%;
        text-align:center;
    }

    .card{
        padding:18px;
    }
}
