/* Global student portal page styles (not scoped — applies to all @Body content) */

:root {
    --sp-header-height: 56px;
    --sp-nav-width: 280px;
    --sp-surface: #ffffff;
    --sp-surface-alt: #f4f7fa;
    --sp-primary: #042c54;
    --sp-primary-text: #ffffff;
    --sp-accent: #0daaea;
    --sp-border: #e2e8f0;
    --sp-text: #1a2332;
    --sp-text-muted: #64748b;
    --sp-radius: 12px;
    --sp-radius-sm: 8px;
    --sp-shadow: 0 1px 3px rgba(4, 44, 84, 0.06), 0 4px 12px rgba(4, 44, 84, 0.04);
    --sp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
    margin: 0;
    font-family: var(--sp-font);
    color: var(--sp-text);
    -webkit-font-smoothing: antialiased;
}

/* ── Page shell ───────────────────────────────────────────── */

.sp-page {
    max-width: 56rem;
    margin: 0 auto;
}

.sp-page-header {
    margin-bottom: 1.75rem;
}

.sp-page > h1,
.sp-page-title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sp-primary);
    line-height: 1.2;
}

.sp-page-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--sp-text-muted);
    line-height: 1.5;
}

.sp-section {
    margin-top: 2rem;
}

.sp-section-title,
.sp-page h2 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--sp-text);
}

/* ── Stat cards ───────────────────────────────────────────── */

.sp-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.sp-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.35rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
}

.sp-stat-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--sp-text-muted);
    line-height: 1.3;
}

.sp-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--sp-primary);
    line-height: 1.1;
}

.sp-stat-card.ok {
    border-left: 4px solid #10b981;
}

.sp-stat-card.warn {
    border-left: 4px solid #f59e0b;
}

/* ── Dashboard ────────────────────────────────────────────── */

.sp-dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}

.sp-dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 280px;
    min-width: min(100%, 280px);
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.15rem 1.25rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    text-decoration: none;
    color: inherit;
    border-left: 4px solid var(--sp-accent);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sp-dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(4, 44, 84, 0.1);
    transform: translateY(-1px);
}

.sp-dashboard-card-ok {
    border-left-color: #10b981;
}

.sp-dashboard-card-warn {
    border-left-color: #f59e0b;
}

.sp-dashboard-card-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-text-muted);
}

.sp-dashboard-highlight {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--sp-primary);
    line-height: 1.3;
}

.sp-dashboard-stat {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--sp-primary);
    line-height: 1.1;
}

.sp-dashboard-muted {
    margin: 0;
    font-size: 0.875rem;
    color: var(--sp-text-muted);
    line-height: 1.45;
}

.sp-dashboard-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.sp-dashboard-metric-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sp-text-muted);
    margin-bottom: 0.15rem;
}

.sp-dashboard-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-primary);
}

.sp-dashboard-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sp-dashboard-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--sp-border);
}

.sp-dashboard-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sp-dashboard-list-primary {
    display: block;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-dashboard-list-secondary {
    display: block;
    font-size: 0.85rem;
    color: var(--sp-text-muted);
    margin-top: 0.15rem;
}

.sp-dashboard-link {
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sp-accent);
}

/* ── Cards & lists ────────────────────────────────────────── */

.sp-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sp-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--sp-shadow);
}

.sp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sp-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-card p {
    margin: 0;
    color: var(--sp-text-muted);
    font-size: 0.9rem;
}

/* ── Tables ───────────────────────────────────────────────── */

.sp-table-wrap {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
}

.sp-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--sp-surface);
    font-size: 0.9rem;
}

.sp-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-text-muted);
    background: var(--sp-surface-alt);
    border-bottom: 1px solid var(--sp-border);
}

.sp-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--sp-border);
    color: var(--sp-text);
    vertical-align: top;
}

.sp-table tbody tr:last-child td {
    border-bottom: none;
}

.sp-table tbody tr:hover td {
    background: rgba(4, 44, 84, 0.02);
}

.diary-entry-date {
    margin: 0;
    font-size: 0.85rem;
    color: var(--sp-text-muted);
}

.diary-entry-notes {
    margin: 0.75rem 0 0;
    white-space: pre-wrap;
    color: var(--sp-text);
    line-height: 1.5;
}

.diary-entry-files {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--sp-border);
}

.diary-entry-files-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-text-muted);
}

.diary-entry-file-list {
    margin: 0;
    padding-left: 1.1rem;
}

.diary-entry-file-list li {
    margin: 0.2rem 0;
}

/* ── Badges & misc ────────────────────────────────────────── */

.sp-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--sp-surface-alt);
    letter-spacing: 0.02em;
}

.sp-badge-current { background: #d1fae5; color: #065f46; }
.sp-badge-future { background: #cffafe; color: #0e7490; }
.sp-badge-past { background: #f1f5f9; color: #475569; }

.sp-error {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: var(--sp-radius-sm);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.9rem;
}

.sp-empty {
    margin: 0;
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--sp-text-muted);
    font-size: 0.95rem;
    background: var(--sp-surface);
    border: 1px dashed var(--sp-border);
    border-radius: var(--sp-radius);
}

.sp-muted {
    color: var(--sp-text-muted);
    font-weight: 400;
    font-size: 0.9em;
}

.sp-btn-link {
    background: none;
    border: none;
    color: var(--sp-accent);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    font-size: inherit;
    font-weight: 500;
}

.sp-btn-link:hover {
    text-decoration: underline;
}

.sp-page-intro {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    color: var(--sp-text-muted);
    line-height: 1.5;
}

/* ── Academic summary & history ───────────────────────────── */

.sp-highlight-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: 0.85rem 1.25rem;
    box-shadow: var(--sp-shadow);
    margin-bottom: 1rem;
}

.sp-highlight-card-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.sp-highlight-stat-end {
    margin-left: auto;
    text-align: right;
}

.sp-highlight-value {
    font-weight: 600;
    color: var(--sp-text);
    line-height: 1.3;
}

.sp-highlight-value-lg {
    font-size: 1.35rem;
    color: var(--sp-primary);
}

.sp-accordion-card,
.sp-summary-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.sp-accordion-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    width: 100%;
    padding: 0.75rem 1.15rem;
    border: none;
    background: var(--sp-surface-alt);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.sp-accordion-header:hover {
    background: rgba(4, 44, 84, 0.04);
}

.sp-accordion-title,
.sp-summary-card-title {
    font-weight: 600;
    color: var(--sp-text);
}

.sp-accordion-badge {
    margin-left: 0.35rem;
    vertical-align: middle;
}

.sp-accordion-dates,
.sp-summary-card-dates {
    font-size: 0.85rem;
    white-space: nowrap;
}

.sp-accordion-body,
.sp-summary-card-body {
    padding: 0.85rem 1.15rem 1rem;
}

.sp-accordion-empty {
    margin: 0;
}

.sp-summary-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1.15rem;
    background: var(--sp-surface-alt);
    border-bottom: 1px solid var(--sp-border);
}

.sp-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.65rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.sp-meta-label {
    display: block;
    font-size: 0.75rem;
    color: var(--sp-text-muted);
    margin-bottom: 0.15rem;
}

.sp-table-compact th,
.sp-table-compact td {
    padding: 0.6rem 0.85rem;
}

.sp-table-strong {
    font-weight: 600;
}

.sp-table-nowrap {
    white-space: nowrap;
}

.sp-result-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--sp-radius-sm);
    background: var(--sp-surface-alt);
    border: 1px solid var(--sp-border);
    color: var(--sp-text);
}

.sp-result-badge-primary {
    background: rgba(4, 44, 84, 0.1);
    border-color: rgba(4, 44, 84, 0.15);
    color: var(--sp-primary);
    margin-right: 0.35rem;
}

.sp-result-skills-note {
    font-size: 0.8rem;
}

.sp-breakdown-toggle {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.sp-exam-detail-panel {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: var(--sp-surface-alt);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
}

.sp-exam-block {
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--sp-border);
}

.sp-exam-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sp-exam-block-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.5rem;
}

.sp-exam-name {
    font-weight: 600;
}

.sp-exam-date {
    font-size: 0.85rem;
}

.sp-exam-single-score {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--sp-primary);
}

.sp-exam-download {
    margin-top: 0.65rem;
    font-size: 0.85rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.85rem;
}

.sp-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.sp-skill-cell {
    padding: 0.5rem 0.65rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    text-align: center;
}

.sp-skill-name {
    display: block;
    font-size: 0.7rem;
    color: var(--sp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sp-skill-val {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--sp-primary);
}

.sp-skill-item {
    display: flex;
    justify-content: space-between;
    background: var(--sp-surface-alt);
    padding: 0.5rem 0.75rem;
    border-radius: var(--sp-radius-sm);
    font-size: 0.85rem;
}

/* ── Form runtime (FormRuntime / IQ.Blazor.FormsRuntime) ─── */

.form-page {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.form-page .form-error {
    margin-bottom: 1rem;
}

.form-page .sp-btn-link {
    display: inline-block;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.forms-runtime {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2.5rem);
    box-shadow: var(--sp-shadow);
}

.forms-runtime h2 {
    margin: 0 0 1.5rem;
    padding-bottom: 0.85rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sp-primary);
    line-height: 1.25;
    border-bottom: 1px solid var(--sp-border);
}

.forms-runtime-brand {
    margin-bottom: 1.25rem;
}

.forms-runtime-logo {
    max-height: 4rem;
    max-width: min(100%, 16rem);
}

.form-description,
.form-submit-message {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--sp-text-muted);
}

.forms-runtime-submit-status {
    background: var(--sp-surface-alt);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    padding: 1rem;
}

/* Bootstrap-compat utilities used by FormRuntime / RecordLookupPicker */
.forms-runtime .mb-2 { margin-bottom: 0.5rem !important; }
.forms-runtime .mb-3 { margin-bottom: 1rem !important; }
.forms-runtime .mt-1 { margin-top: 0.25rem !important; }
.forms-runtime .mt-2 { margin-top: 0.5rem !important; }
.forms-runtime .mt-3 { margin-top: 1rem !important; }
.forms-runtime .me-1 { margin-right: 0.25rem !important; }
.forms-runtime .ms-1 { margin-left: 0.25rem !important; }
.forms-runtime .px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.forms-runtime .py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.forms-runtime .p-2 { padding: 0.5rem !important; }
.forms-runtime .p-3 { padding: 1rem !important; }
.forms-runtime .small { font-size: 0.875rem; }
.forms-runtime .text-muted { color: var(--sp-text-muted) !important; }
.forms-runtime .text-danger { color: #b91c1c !important; }
.forms-runtime .fw-semibold { font-weight: 600; }
.forms-runtime .border { border: 1px solid var(--sp-border) !important; }
.forms-runtime .border-bottom { border-bottom: 1px solid var(--sp-border) !important; }
.forms-runtime .rounded { border-radius: var(--sp-radius-sm) !important; }
.forms-runtime .bg-light,
.forms-runtime .bg-white { background: var(--sp-surface) !important; }
.forms-runtime .d-flex { display: flex !important; }
.forms-runtime .align-items-center { align-items: center !important; }
.forms-runtime .justify-content-between { justify-content: space-between !important; }
.forms-runtime .gap-2 { gap: 0.5rem !important; }
.forms-runtime .flex-shrink-0 { flex-shrink: 0; }
.forms-runtime .min-w-0 { min-width: 0; }
.forms-runtime .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forms-runtime .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.5;
    border-radius: var(--sp-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.forms-runtime .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.forms-runtime .btn-primary {
    background: var(--sp-primary);
    border-color: var(--sp-primary);
    color: var(--sp-primary-text);
}

.forms-runtime .btn-primary:hover:not(:disabled) {
    opacity: 0.92;
}

.forms-runtime .btn-link,
.forms-runtime .btn-link.btn-sm {
    min-height: auto;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--sp-accent);
    font-weight: 500;
}

.forms-runtime .btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

.forms-runtime .btn-sm {
    min-height: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.forms-runtime .form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sp-text);
}

.forms-runtime .form-text {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--sp-text-muted);
}

.forms-runtime .form-control,
.forms-runtime .form-select,
.forms-runtime input.form-control,
.forms-runtime select.form-select,
.forms-runtime textarea.form-control {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    line-height: 1.5;
    font-family: inherit;
    color: var(--sp-text);
    background-color: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.forms-runtime textarea.form-control {
    min-height: 5.5rem;
    resize: vertical;
}

.forms-runtime .form-control:focus,
.forms-runtime .form-select:focus {
    outline: 0;
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(4, 44, 84, 0.12);
}

.forms-runtime .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.2rem;
    accent-color: var(--sp-primary);
}

.forms-runtime .input-group {
    display: flex;
    width: 100%;
}

.forms-runtime .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.forms-runtime .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    color: var(--sp-text-muted);
    background: var(--sp-surface-alt);
    border: 1px solid var(--sp-border);
    border-left: none;
    border-radius: 0 var(--sp-radius-sm) var(--sp-radius-sm) 0;
}

.forms-runtime .alert {
    padding: 0.85rem 1rem;
    border-radius: var(--sp-radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
    line-height: 1.45;
}

.forms-runtime .alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.forms-runtime .alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.forms-runtime .alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.forms-runtime .spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: sp-form-spinner 0.75s linear infinite;
    vertical-align: -0.125em;
}

.forms-runtime .spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.12em;
}

@keyframes sp-form-spinner {
    to { transform: rotate(360deg); }
}

.forms-runtime .record-lookup-results {
    max-height: 16rem;
    overflow-y: auto;
}

.forms-runtime .record-lookup-result:hover {
    background: var(--sp-surface-alt);
}

.forms-runtime .record-lookup-picker .border.rounded.p-2 {
    padding: 1rem !important;
}

@media (min-width: 640px) {
    .forms-runtime-fields {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.15rem 1.5rem;
    }
}

@media (max-width: 767px) {
    .form-page {
        padding-left: 0;
        padding-right: 0;
    }

    .forms-runtime {
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 1.25rem 1rem;
    }
}

/* ── Portal profile / holiday forms ───────────────────────── */

.sp-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sp-text);
}

.form-control,
input.form-control,
select.form-control,
textarea.form-control {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    line-height: 1.5;
    font-family: inherit;
    color: var(--sp-text);
    background-color: var(--sp-surface);
    background-clip: padding-box;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    box-sizing: border-box;
    appearance: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

textarea.form-control {
    min-height: 5rem;
    resize: vertical;
}

input.form-control[type="date"],
input.form-control[type="time"],
input.form-control[type="datetime-local"] {
    min-height: 2.75rem;
}

.form-control:focus,
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    outline: 0;
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 3px rgba(4, 44, 84, 0.12);
}

.form-control::placeholder {
    color: var(--sp-text-muted);
    opacity: 1;
}

.form-control:disabled {
    background-color: var(--sp-surface-alt);
    opacity: 0.75;
    cursor: not-allowed;
}

.validation-message {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: #b91c1c;
}

.sp-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--sp-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.sp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sp-btn-primary {
    background: var(--sp-primary);
    color: var(--sp-primary-text);
    border-color: var(--sp-primary);
}

.sp-btn-primary:hover:not(:disabled) {
    opacity: 0.92;
}

.sp-btn-secondary {
    background: var(--sp-surface);
    color: var(--sp-text);
    border-color: var(--sp-border);
}

.sp-btn-secondary:hover:not(:disabled) {
    background: var(--sp-surface-alt);
}

/* ── Tile grid (documents, forms) ─────────────────────────── */

.sp-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 1rem;
}

.sp-tile-grid.is-busy {
    pointer-events: none;
}

.sp-tile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 7rem;
    padding: 1rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    color: var(--sp-text);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

a.sp-tile-card:hover,
button.sp-tile-card:hover:not(:disabled) {
    background: var(--sp-surface-alt);
    border-color: var(--sp-primary);
    color: var(--sp-text);
    text-decoration: none;
}

button.sp-tile-card {
    font: inherit;
    width: 100%;
}

button.sp-tile-card:disabled {
    cursor: default;
    opacity: 0.85;
}

button.sp-tile-card.is-opening {
    border-color: var(--sp-primary);
}

.sp-tile-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.sp-tile-icon-image {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

.sp-tile-title {
    font-size: 0.9rem;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.35;
}

/* ── Mobile (app-like density) ────────────────────────────── */

@media (max-width: 767px) {
    .sp-page-header {
        padding: 0.85rem 1rem 0;
        margin-bottom: 1rem;
    }

    .sp-page > .sp-tile-grid,
    .sp-page > .sp-dashboard-grid,
    .sp-page > .sp-stats-row {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .sp-page > .sp-error,
    .sp-page > .sp-empty,
    .sp-page > .activities-error,
    .sp-page > .activities-empty,
    .sp-page > .activities-success,
    .sp-page > .form-error {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .sp-dashboard-card {
        border-radius: var(--sp-radius-sm);
    }

    .sp-stat-card {
        border-radius: var(--sp-radius-sm);
    }
}

/* ── Holding page (form / survey / message) ─────────────── */

.holding-page {
    padding: 1.5rem 1rem 2.5rem;
}

.holding-message-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100dvh;
    min-height: 100vh;
    padding: 2rem 1rem 3rem;
    background: var(--sp-surface-alt);
}

.holding-message-card {
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius, 12px);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.holding-message-body {
    padding: 1.75rem 1.5rem 1rem;
    line-height: 1.6;
    color: var(--sp-text);
}

.holding-message-body p:last-child {
    margin-bottom: 0;
}

.holding-message-actions {
    display: flex;
    justify-content: center;
    padding: 0.75rem 1.5rem 1.5rem;
}

.holding-message-ok {
    min-width: 7rem;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
}

.holding-survey-logo {
    margin-bottom: 1.25rem;
    text-align: center;
}

.holding-survey-logo img {
    max-width: 280px;
    max-height: 120px;
    object-fit: contain;
}

.holding-survey-title {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sp-primary);
}

.holding-survey-question {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sp-border);
}

.holding-survey-question-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.holding-survey-label {
    margin: 1rem 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.holding-survey-result {
    padding: 1rem;
    border-radius: var(--sp-radius-sm);
    background: var(--sp-surface-alt);
}

/* ── Staff contacts ───────────────────────────────────────── */

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

.sp-staff-contact-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
}

.sp-staff-contact-photo {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sp-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-staff-contact-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-staff-contact-initial {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--sp-primary);
}

.sp-staff-contact-body {
    flex: 1;
    min-width: 0;
}

.sp-staff-contact-name {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sp-text);
}

.sp-staff-contact-title {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--sp-text-muted);
}

.sp-staff-contact-btn {
    width: 100%;
}

.sp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
}

.sp-modal {
    width: 100%;
    max-width: 32rem;
    padding: 1.5rem;
    background: var(--sp-surface);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.18));
}

.sp-modal-title {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.sp-modal-subtitle {
    margin: 0 0 1rem;
    color: var(--sp-text-muted);
    font-size: 0.9rem;
}

.sp-field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.sp-textarea {
    width: 100%;
    min-height: 8rem;
    padding: 0.75rem;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    font: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.sp-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.sp-success {
    margin: 0;
    color: var(--sp-success, #15803d);
}
