html, body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body.rtl {
    direction: rtl;
}

body.ltr {
    direction: ltr;
}

a, .btn-link {
    color: #0f4c81;
}

.btn-primary {
    color: #fff;
    background-color: #0f4c81;
    border-color: #0c406d;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(15, 76, 129, 0.25);
}

.page {
    min-height: 100vh;
}

.content {
    padding-top: 1.1rem;
}

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.5rem;
    border-bottom: 1px solid #d7dde5;
    background: #fff;
}

.title-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.app-title {
    color: #16324f;
    font-weight: 700;
    text-decoration: none;
}

.app-subtitle {
    color: #5d6b7c;
    font-size: 0.9rem;
}

.culture-switcher {
    display: flex;
    gap: 0.5rem;
}

.culture-link {
    color: #16324f;
    text-decoration: none;
    font-weight: 600;
}

.culture-link.active {
    text-decoration: underline;
}

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

.placeholder-card,
.page-panel {
    padding: 1rem 1.25rem;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.table-actions,
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.branch-name-cell {
    white-space: nowrap;
}

.form-text {
    color: #5d6b7c;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.5rem 1rem;
}

.page-actions {
    margin-top: 1rem;
}

.compact-dl dt,
.compact-dl dd {
    margin-bottom: 0.5rem;
}

.placeholder-card h2 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.placeholder-card p,
.page-panel p,
.lead {
    margin-bottom: 0;
    color: #4d5a6a;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

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

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    display: block;
    padding: 1rem;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(22, 50, 79, 0.12);
}

.stat-card-label { font-size: 0.85rem; color: #5d6b7c; }
.stat-card-value { font-size: 1.75rem; font-weight: 700; color: #16324f; }
.stat-card-subtitle { font-size: 0.8rem; color: #5d6b7c; }
.stat-success .stat-card-value { color: #198754; }
.stat-warning .stat-card-value { color: #b58105; }
.stat-danger .stat-card-value { color: #b42318; }
.stat-muted .stat-card-value { color: #6c757d; }

.quick-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.top-row-actions { display: flex; align-items: center; gap: 1rem; }
.user-menu { display: flex; align-items: center; gap: 0.75rem; }
.user-menu-name { font-weight: 600; color: #16324f; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.pagination-bar { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.empty-state { color: #5d6b7c; font-style: italic; }
.admin-loading { display: flex; align-items: center; padding: 1rem 0; }
.audit-json { max-height: 200px; overflow: auto; font-size: 0.8rem; background: #f8f9fa; padding: 0.5rem; border-radius: 4px; }
.audit-detail-row td { background: #f8f9fa; }
.permission-group-title { font-size: 1rem; font-weight: 600; border-bottom: 1px solid #e9ecef; padding-bottom: 0.25rem; }
.permission-sensitive { border-inline-start: 3px solid #ffc107; padding-inline-start: 0.5rem; }
.auth-result { padding: 1rem; border-radius: 8px; }
.auth-allow { background: #d1e7dd; border: 1px solid #a3cfbb; }
.auth-deny { background: #f8d7da; border: 1px solid #f1aeb5; }

.authenticator-qr img {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}
.access-summary-block { padding: 0.75rem 0; border-bottom: 1px solid #e9ecef; }
