:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --text: #1f2a37;
    --muted: #5f6b7a;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border: #dbe3ee;
    --danger: #dc2626;
    --success: #0f9f67;
    --shadow: 0 10px 28px rgba(31, 42, 55, 0.08);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1:focus {
    outline: none;
}

h1 {
    margin: 0 0 0.8rem;
    font-size: 2rem;
}

p {
    margin: 0;
}

.page {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.65rem 0;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    padding: 0.4rem 0.55rem;
    border-radius: 0.55rem;
}

.brand.active,
.brand:hover {
    background: #eef4ff;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--muted);
    padding: 0.45rem 0.7rem;
    border-radius: 0.55rem;
    font-weight: 600;
}

.nav-link.active,
.nav-link:hover {
    color: #0f172a;
    background: #eef4ff;
    text-decoration: none;
}

.account-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.logout-form {
    margin: 0;
}

.main-content {
    width: min(1200px, calc(100% - 2rem));
    margin: 1.4rem auto 2rem;
}

.hero {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.hero-content,
.stat-card,
.table,
.edit-form,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.hero-content {
    padding: 1.6rem;
}

.hero-content p {
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-stats {
    display: grid;
    gap: 0.8rem;
}

.stat-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-card strong {
    font-size: 0.95rem;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn {
    border: 1px solid transparent;
    border-radius: 0.6rem;
    padding: 0.55rem 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: #eff4ff;
    border-color: #cbdafc;
    color: #1e3a8a;
}

.btn-ghost:hover {
    background: #e2ebff;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark {
    background: #fff;
    border-color: #c7d2e5;
    color: #334155;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-dark:hover {
    background: #f3f7ff;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.form-control,
input[type="date"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid #c9d5e7;
    border-radius: 0.55rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #bfd5ff;
    border-color: #89adf8;
}

label,
.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #243041;
}

.form-text {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.table thead th {
    text-align: left;
    padding: 0.75rem;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid #edf1f7;
    vertical-align: top;
    font-size: 0.92rem;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.text-danger {
    color: var(--danger);
    margin-bottom: 0.8rem;
}

.text-success {
    color: var(--success);
    margin-bottom: 0.8rem;
}

.validation-message {
    color: var(--danger);
    margin-top: 0.2rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.request-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.request-image-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.9rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.col-12 {
    width: 100%;
}

.w-100 {
    width: 100%;
}

.btn-lg {
    padding: 0.7rem 1rem;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .col-md-4 {
        width: 33.3333%;
    }

    .col-md-6 {
        width: 50%;
    }

    .col-md-12 {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .col-lg-3 {
        width: 25%;
    }

    .col-lg-4 {
        width: 33.3333%;
    }

    .col-lg-6 {
        width: 50%;
    }

    .col-lg-9 {
        width: 75%;
    }

    .col-lg-offset-2 {
        margin-left: 16.6667%;
    }
}

@media (min-width: 1200px) {
    .col-xl-6 {
        width: 50%;
    }
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .topbar-inner {
        width: calc(100% - 1rem);
    }

    .main-content {
        width: calc(100% - 1rem);
        margin-top: 1rem;
    }

    .account-actions {
        width: 100%;
        margin-left: 0;
    }
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 0.5rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 0.35rem;
}

.nav-pills .nav-link {
    display: block;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    color: #334155;
    font-weight: 600;
}

.nav-pills .nav-link.active,
.nav-pills .nav-link:hover {
    background: #eaf1ff;
    color: #1e3a8a;
    text-decoration: none;
}

.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    min-height: 3.4rem;
    padding-top: 1.35rem;
    padding-bottom: 0.45rem;
}

.form-floating > .form-label,
.form-floating > label {
    position: absolute;
    left: 0.65rem;
    top: 0.45rem;
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
    pointer-events: none;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}