:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --dark: #101b30;
    --dark2: #192840;
    --accent: #3176d5;
    --text: #202c40;
    --muted: #778398;
    --border: #e5eaf1;
    --success: #16865b;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.topbar {
    height: 64px;
    background: var(--dark);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
}

.brand-small {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-user form {
    margin: 0;
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 100px);
}

.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: var(--dark2);
    color: #dbe4f1;
    padding: 24px 16px;
}

.sidebar a,
.nav-placeholder {
    display: block;
    padding: 11px 13px;
    border-radius: 6px;
    color: #dbe4f1;
    margin-bottom: 3px;
}

.sidebar a:hover {
    background: #263b5a;
}

.nav-placeholder {
    color: #8799b2;
}

.sidebar-heading {
    color: #8295b0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    margin: 22px 12px 8px;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 32px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.page-heading h1 {
    margin-bottom: 7px;
    font-size: 26px;
}

.page-heading p,
.welcome-panel p,
.module-card p {
    color: var(--muted);
}

.status-indicator {
    color: var(--success);
    background: #e4f5ec;
    border-radius: 20px;
    padding: 8px 13px;
    font-size: 11px;
    font-weight: 800;
}

.welcome-panel {
    background: var(--surface);
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 25px;
}

.welcome-panel h2 {
    font-size: 18px;
}

.welcome-panel p {
    margin-bottom: 0;
    line-height: 1.7;
}

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

.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 22px;
    min-height: 165px;
}

.module-card > span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.module-card h3 {
    margin-top: 16px;
    margin-bottom: 9px;
}

.module-card p {
    line-height: 1.6;
}

.module-card small {
    color: var(--muted);
}

.button-primary,
.button-secondary {
    border: 0;
    border-radius: 7px;
    padding: 11px 17px;
    cursor: pointer;
    font-weight: 700;
}

.button-primary {
    background: var(--accent);
    color: white;
    width: 100%;
    margin-top: 12px;
}

.button-secondary {
    background: #31435e;
    color: white;
}

.button-primary:hover {
    background: #245da9;
}

.app-footer {
    text-align: center;
    padding: 17px;
    color: var(--muted);
    font-size: 11px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #eaf0f8;
}

.login-card {
    width: 100%;
    max-width: 410px;
    background: white;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 12px 40px rgba(15, 29, 48, .07);
}

.brand {
    text-align: center;
    margin-bottom: 30px;
}

.brand h1 {
    letter-spacing: 2px;
    color: var(--dark);
    margin-bottom: 7px;
}

.brand p,
.footer-note {
    color: var(--muted);
    font-size: 12px;
}

.login-card label {
    display: block;
    font-weight: 700;
    margin: 17px 0 7px;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
}

.login-card input:focus {
    border-color: var(--accent);
}

.alert {
    border-radius: 7px;
    padding: 12px;
    margin-bottom: 18px;
}

.alert-danger {
    color: var(--danger);
    background: #fff0ee;
}

.footer-note {
    text-align: center;
    margin: 25px 0 0;
}

.error-page {
    text-align: center;
    padding: 90px 20px;
}

.error-page h1 {
    font-size: 70px;
    margin-bottom: 5px;
    color: var(--dark);
}

@media (max-width: 1000px) {
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 20px;
    }

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

    .page-heading {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }
}
