/* ===================================================================
   IRMS DLM Helper — Global Styles
   =================================================================== */

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    color: #212529;
}

h1:focus { outline: none; }

a, .btn-link { color: #0071c1; }

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.text-muted { color: #6c757d !important; }
.small { font-size: 0.85rem; }

/* ---- Portal Grid Layout ---- */

.portal-layout {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 260px 1fr;
    grid-template-areas:
        "header  header"
        "sidebar main"
        "footer  footer";
    min-height: 100vh;
}

/* ---- Header ---- */

.portal-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: #1a1a2e;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
    z-index: 100;
}

.portal-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-header-brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.portal-header-tagline {
    font-size: 0.85rem;
    opacity: 0.7;
}

.portal-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-header-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.portal-header-user-icon {
    font-size: 1rem;
}

/* ---- Sidebar Navigation ---- */

.portal-sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid #dee2e6;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-item { margin: 0; }

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.25rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
}

.sidebar-nav-link:hover {
    background: #f1f3f5;
    color: #212529;
}

.sidebar-nav-link.active {
    background: #e7f1ff;
    color: #1b6ec2;
    border-left-color: #1b6ec2;
    font-weight: 600;
}

.sidebar-nav-icon { font-size: 1.1rem; }

.sidebar-nav-separator {
    height: 1px;
    background: #dee2e6;
    margin: 0.5rem 1.25rem;
}

/* ---- Main Content ---- */

.portal-main {
    grid-area: main;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    background: #f8f9fa;
}

/* ---- Footer ---- */

.portal-footer {
    grid-area: footer;
    text-align: center;
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    color: #6c757d;
    background: #fff;
    border-top: 1px solid #dee2e6;
}

/* ===================================================================
   Component: PageHeader
   =================================================================== */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header-text {
    flex: 1;
}

.page-header-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.page-header-subtitle {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
}

.page-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===================================================================
   Component: StatusBadge
   =================================================================== */

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.status-badge-success { background: #d4edda; color: #155724; }
.status-badge-warning { background: #fff3cd; color: #856404; }
.status-badge-error   { background: #f8d7da; color: #721c24; }
.status-badge-info    { background: #d1ecf1; color: #0c5460; }
.status-badge-neutral { background: #e2e3e5; color: #383d41; }

/* ===================================================================
   Component: EmptyState
   =================================================================== */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #fff;
    margin-top: 1rem;
}

.empty-state-icon  { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.empty-state-title { font-size: 1.15rem; margin: 0 0 0.4rem; color: #495057; }
.empty-state-message { color: #6c757d; margin: 0; }
.empty-state-action  { margin-top: 1.25rem; }

/* ===================================================================
   Component: Alert Banners
   =================================================================== */

.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 6px;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

.alert-banner-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-banner-close:hover { opacity: 1; }

.alert-banner-content {
    flex: 1;
}

.alert-banner-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.88rem;
    opacity: 0.85;
}

.alert-banner-retry {
    margin-left: 1rem;
    flex-shrink: 0;
}

/* ===================================================================
   Dashboard: Action Cards
   =================================================================== */

/* ---- Loading Panel ---- */

.loading-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    margin: 1rem 0;
}

.loading-panel-spinner {
    flex-shrink: 0;
}

.loading-panel-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.95rem;
}

/* ===================================================================
   Dashboard: Action Cards (continued)
   =================================================================== */

/* ---- Info Callout ---- */

.info-callout {
    padding: 1rem 1.25rem;
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-left: 4px solid #0d6efd;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    color: #1a3a5c;
    font-size: 0.93rem;
    line-height: 1.55;
}

.info-callout-title {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.info-callout-body p {
    margin: 0.3rem 0;
}

.info-callout-body ul {
    margin: 0.3rem 0 0;
    padding-left: 1.25rem;
}

.info-callout-body li {
    margin-bottom: 0.15rem;
}

.dashboard-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #343a40;
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.dashboard-card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.dashboard-card-description {
    font-size: 0.88rem;
    color: #6c757d;
    margin: 0;
    flex: 1;
}

.dashboard-card-btn {
    margin-top: 1rem;
    align-self: flex-start;
}

/* ---- Dashboard: Status Grid ---- */

.dashboard-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
}

.dashboard-activity-list {
    list-style: disc;
    margin: 0;
    padding-left: 1.25rem;
}

.dashboard-activity-list li {
    margin-bottom: 0.25rem;
}

.dashboard-status-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
}

.dashboard-status-description {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.4;
}

.dashboard-status-meta {
    font-size: 0.8rem;
}

.dashboard-status-refresh {
    margin-top: 0.5rem;
    align-self: flex-start;
}

/* ---- Dashboard: Quick Help ---- */

.dashboard-quick-help {
    margin-top: 2.5rem;
}

.dashboard-help-panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}

.dashboard-help-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.8;
    color: #495057;
}

.dashboard-help-list li {
    margin-bottom: 0.25rem;
}

.dashboard-actions {
    margin-bottom: 2.5rem;
}

.dashboard-status {
    margin-bottom: 0;
}

/* ===================================================================
   Downloads Page
   =================================================================== */

.downloads-section {}

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

.download-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.download-item-icon { font-size: 1.8rem; }

/* ===================================================================
   Help Page
   =================================================================== */

.help-section { margin-bottom: 2rem; }

.help-section h3 {
    margin-bottom: 0.75rem;
}

.help-steps li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.help-workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.help-workflow-card {
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.help-workflow-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.help-workflow-card-icon {
    font-size: 1.4rem;
}

.help-workflow-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.help-workflow-card p {
    margin: 0 0 0.4rem;
    color: #495057;
    font-size: 0.92rem;
    line-height: 1.45;
}

.help-workflow-card-link {
    font-size: 0.88rem;
}

.help-validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.help-validation-card {
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.help-validation-card-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.help-validation-card-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.help-validation-card-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.help-validation-card strong {
    display: block;
    margin-bottom: 0.3rem;
}

.help-faq details {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.help-faq summary {
    font-weight: 600;
    cursor: pointer;
}

.help-faq details p {
    margin: 0.5rem 0 0;
    color: #495057;
}

/* ===================================================================
   Wizard Components
   =================================================================== */

.wizard-shell {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    position: relative;
}

.wizard-shell-busy { opacity: 0.85; pointer-events: none; }

.wizard-shell-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
}

.wizard-shell-description {
    color: #6c757d;
    margin: 0 0 1rem;
}

.wizard-shell-progress { margin-bottom: 1.5rem; }

.wizard-shell-body { min-height: 220px; }

.wizard-shell-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.wizard-shell-spinner {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #dee2e6;
    border-top-color: #1b6ec2;
    border-radius: 50%;
    animation: wizard-spin 0.6s linear infinite;
}

@keyframes wizard-spin {
    to { transform: rotate(360deg); }
}

.wizard-btn-spinner {
    width: 0.9rem;
    height: 0.9rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.wizard-shell-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.wizard-shell-actions-right {
    display: flex;
    gap: 0.5rem;
}

.wizard-shell-cancel {
    margin-right: auto;
}

/* ---- Wizard Progress ---- */

.wizard-progress {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.wizard-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

.wizard-progress-step-clickable {
    cursor: pointer;
}

.wizard-progress-step-clickable:hover .wizard-progress-indicator {
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.25);
}

.wizard-progress-indicator {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: #e2e3e5;
    color: #6c757d;
    transition: background-color 0.2s, box-shadow 0.15s;
}

.wizard-progress-step-active .wizard-progress-indicator   { background: #1b6ec2; color: #fff; }
.wizard-progress-step-completed .wizard-progress-indicator { background: #28a745; color: #fff; }
.wizard-progress-step-error .wizard-progress-indicator     { background: #dc3545; color: #fff; }
.wizard-progress-step-skipped .wizard-progress-indicator   { background: #e2e3e5; color: #adb5bd; }

.wizard-progress-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    max-width: 90px;
    word-wrap: break-word;
}

.wizard-progress-step-active .wizard-progress-label {
    color: #1b6ec2;
    font-weight: 600;
}

.wizard-progress-connector {
    flex: 1;
    height: 2px;
    background: #dee2e6;
    min-width: 24px;
    align-self: center;
    margin-bottom: 1.25rem;
    transition: background-color 0.2s;
}

.wizard-progress-connector-done { background: #28a745; }

/* ---- Wizard Step ---- */

.wizard-step-hidden { display: none; }

.wizard-step-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.wizard-step-description {
    color: #6c757d;
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.wizard-step-card {
    padding: 1.25rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* ---- File Upload Card ---- */

.file-upload-card {
    position: relative;
    text-align: center;
    padding: 2rem;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    background: #f8f9fa;
    transition: border-color 0.15s, background-color 0.15s, opacity 0.15s;
    cursor: pointer;
}

.file-upload-card-dragover {
    border-color: #1b6ec2;
    border-style: dashed;
    background: #e7f1ff;
}

.file-upload-card-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.file-upload-card-icon  { font-size: 2.5rem; }
.file-upload-card-title { margin: 0.5rem 0 0.25rem; }
.file-upload-card-hint  { color: #6c757d; margin-bottom: 1rem; }

.file-upload-card-content {
    position: relative;
    pointer-events: none;
}

.file-upload-card-dropzone {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-upload-card-dropzone-hidden {
    pointer-events: none;
}

.file-upload-card-selected {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.file-upload-card-selected p { margin: 0; }
.file-upload-card-size { margin-top: 0.15rem; }

.file-upload-card-accept-hint {
    margin-top: 0.75rem;
}

.file-upload-card-busy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: #6c757d;
}

/* ---- Validation Summary Panel ---- */

.validation-summary-panel { margin-top: 1rem; }

.validation-summary-success {
    padding: 0.75rem 1rem;
    background: #d4edda;
    border-radius: 6px;
    color: #155724;
}

.validation-summary-warning {
    padding: 0.75rem 1rem;
    background: #fff3cd;
    border-radius: 6px;
    color: #856404;
    margin-bottom: 1rem;
}

.validation-summary-error {
    padding: 0.75rem 1rem;
    background: #f8d7da;
    border-radius: 6px;
    color: #721c24;
    margin-bottom: 1rem;
}

.validation-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.validation-summary-table th,
.validation-summary-table td {
    text-align: left;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.validation-summary-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.validation-row-error td:first-child { color: #dc3545; font-weight: 600; }
.validation-row-warning td:first-child { color: #856404; font-weight: 600; }

/* ---- Download Result Panel ---- */

.download-result-panel { margin-top: 1rem; }

.download-result-ready {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #d4edda;
    border-radius: 6px;
}

.download-result-icon { font-size: 2rem; }

.download-result-details { flex: 1; }

.download-result-filename {
    font-weight: 600;
    margin: 0 0 0.15rem;
}

.download-result-meta {
    margin: 0 0 0.5rem;
}

.download-result-warnings {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
    color: #856404;
    font-size: 0.92rem;
}

.download-result-warnings li {
    margin-bottom: 0.25rem;
}

.download-result-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

/* ---- Export Target Selection Grid ---- */

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

.export-target-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.25rem 1rem;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}

.export-target-card:hover:not(:disabled) {
    border-color: #86b7fe;
    box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}

.export-target-card-selected {
    border-color: #0d6efd;
    background: #f0f6ff;
    box-shadow: 0 0 0 3px rgba(13,110,253,.18);
}

.export-target-card:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.export-target-card-unavailable {
    background: #f8f9fa;
    border-style: dashed;
}

.export-target-card-badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6c757d;
    background: #e9ecef;
    border-radius: 9999px;
    letter-spacing: 0.01em;
}

.export-target-card-icon {
    font-size: 1.8rem;
}

.export-target-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
}

.export-target-card-desc {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.35;
}

.export-target-card-check {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    font-size: 0.9rem;
    color: #0d6efd;
    font-weight: 700;
}

/* ---- Export Summary (Review step) ---- */

.export-summary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.export-summary-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.export-summary-label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.export-summary-value {
    color: #212529;
}

/* ===================================================================
   Form Validation (Blazor built-in)
   =================================================================== */

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid red; }
.validation-message { color: red; }

/* ===================================================================
   Blazor Error / Loading UI
   =================================================================== */

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

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===================================================================
   Responsive: collapse sidebar on narrow viewports
   =================================================================== */

@media (max-width: 768px) {
    .portal-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    .portal-sidebar { display: none; }
    .portal-main { padding: 1.25rem; }
}

/* ===================================================================
   Auth: Header auth controls
   =================================================================== */

.portal-header-auth-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
}

.portal-header-user-loading {
    opacity: 0.5;
    font-style: italic;
}

/* ===================================================================
   Auth: Sign-in required panel
   =================================================================== */

.sign-in-required-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 480px;
    margin: 2rem auto;
}

.sign-in-required-icon {
    font-size: 2.5rem;
}

.sign-in-required-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.sign-in-required-message {
    font-size: 0.95rem;
    color: #495057;
    margin: 0;
}

/* ===================================================================
   Auth: Access denied page
   =================================================================== */

.access-denied-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 2rem auto;
}

.access-denied-icon {
    font-size: 2.5rem;
}

.access-denied-message {
    font-size: 0.95rem;
    color: #495057;
    margin: 0;
}

.access-denied-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ===================================================================
   Auth: Auth loading panel (route view)
   =================================================================== */

.auth-loading-panel {
    display: flex;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 0.95rem;
}

/* ===================================================================
   Sidebar: Sign-in hint for anonymous users
   =================================================================== */

.sidebar-nav-hint {
    padding: 0.5rem 1.25rem;
    list-style: none;
}

.sidebar-nav-hint-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}
