/* ─── Base ──────────────────────────────────────────────────────────────── */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: #f5f6f8;
    color: #1f2532;
}

a, .btn-link {
    color: #2c5cc5;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1:focus {
    outline: none;
}

/* ─── App shell (sidebar + main) ────────────────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #1a2540 0%, #2b1842 100%);
    color: #e9ecf3;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #ffffff14;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    border: 1px solid #ffffff22;
}

.sidebar .brand-title {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    line-height: 1;
}

.sidebar .brand-sub {
    font-size: 12px;
    color: #c9cee0;
    margin-top: 4px;
}

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

.nav-list .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #d8def0 !important;
    font-size: 14px;
    transition: background 0.15s;
}

.nav-list .nav-link:hover {
    background: #ffffff14;
    text-decoration: none;
}

.nav-list .nav-link.active {
    background: #ffffff22;
    color: #fff !important;
    font-weight: 600;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e3e6ed;
    padding: 12px 32px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    min-height: 56px;
}

.topbar .user {
    color: #5b6478;
}

.content {
    padding: 32px;
    flex: 1;
}

/* ─── Login / Access-Denied ─────────────────────────────────────────────── */
.empty-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2540 0%, #2b1842 100%);
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(420px, 92vw);
}

.login-card {
    background: #fff;
    padding: 36px 32px 28px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: 24px;
    color: #1f2532;
}

.login-card .muted {
    margin: 0 0 24px;
    color: #6c768d;
    font-size: 14px;
}

.login-card label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #3b4258;
}

.login-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cdd2dd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.login-card input:focus {
    outline: 2px solid #2c5cc580;
    border-color: #2c5cc5;
}

.login-card .alert {
    background: #ffe5e5;
    color: #962323;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.login-card .btn-primary {
    margin-top: 20px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #2c5cc5;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: block;
    text-align: center;
}

.login-card .btn-primary:hover {
    background: #234aa3;
    text-decoration: none;
}

/* ─── Validation states (Blazor EditForm defaults) ──────────────────────── */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

/* ─── Blazor error UI ───────────────────────────────────────────────────── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ─── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        padding: 16px;
    }
    .content {
        padding: 20px 16px;
    }
    .topbar {
        padding: 12px 16px;
    }
}
