:root {
    --navy: #0f172a;
    --blue: #0056b3;
    --red: #d71920;
    --bg: #f4f7fb;
    --line: #dde5ee;
    --muted: #667085;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: #172033;
}

/* Top Bar */
.topbar {
    height: 72px;
    padding: 0 3vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--navy);
}

.brand > span {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
}

.topbar nav {
    display: flex;
    gap: 14px;
}

.topbar nav a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

/* Main Layout */
.shell {
    width: min(1400px, 94%);
    margin: 24px auto 50px;
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 22px;
}

/* Sidebar */
.sidebar {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px;
    height: max-content;
    position: sticky;
    top: 94px;
}

.sidebar-logo {
    text-align: center;
    padding: 10px 8px 18px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.sidebar-logo h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    color: var(--navy);
}

.sidebar-logo small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.5px;
}

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

.sidebar-menu hr {
    width: 100%;
    margin: 8px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.sidebar a,
.sidebar span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-radius: 9px;
    text-decoration: none;
    color: #425066;
    font-size: 13px;
    font-weight: 700;
}

.sidebar a:hover {
    background: #edf4fb;
    color: var(--blue);
}

.sidebar em {
    margin-left: auto;
    font-size: 9px;
    font-style: normal;
    color: var(--muted);
    white-space: nowrap;
}

.sidebar a.disabled {
    pointer-events: none;
    opacity: 0.45;
    cursor: default;
}

.sidebar a.disabled:hover {
    background: transparent;
    color: #425066;
}

.sidebar a.disabled em {
    font-size: 9px;
    font-style: normal;
    color: var(--muted);
}

/* Main Content */
main {
    min-width: 0;
}

.hero {
    margin-bottom: 20px;
}

.hero h1 {
    margin: 0;
    color: var(--navy);
    font-size: 38px;
}

.hero p {
    color: var(--muted);
    line-height: 1.6;
}

/* Cards and Modules */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.module {
    display: block;
    text-decoration: none;
    color: inherit;
}

.module h3 {
    margin: 0 0 8px;
}

.badge {
    display: inline-block;
    padding: 5px 8px;
    border-radius: 999px;
    background: #edf4fb;
    color: var(--blue);
    font-size: 10px;
    font-weight: 800;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.full {
    grid-column: 1 / -1;
}

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

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px;
    font: inherit;
}

textarea {
    min-height: 100px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    border: 0;
    border-radius: 9px;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
}

.primary {
    background: var(--navy);
    color: #fff;
}

.secondary {
    background: #fff;
    border: 1px solid var(--line);
}

/* Notices */
.notice {
    padding: 12px 14px;
    border-radius: 9px;
    margin-bottom: 16px;
    background: #ecfdf3;
    color: #16794b;
}

.error {
    background: #fff1f0;
    color: #b42318;
}

/* Login */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(430px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

.login-card h1 {
    margin-top: 0;
}

.login-card .field {
    margin: 15px 0;
}

/* Footer */
footer {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    padding: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: block;
        overflow: visible;
    }

    .sidebar-logo {
        text-align: left;
    }

    .sidebar-menu {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 4px;
    }

    .sidebar-menu hr {
        display: none;
    }

    .sidebar a,
    .sidebar span {
        min-width: max-content;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {
    .grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .full {
        grid-column: auto;
    }

    .topbar nav a:first-child {
        display: none;
    }

    .hero h1 {
        font-size: 30px;
    }
}

