/* ============================================================================
   POLISH UI ELEMENTS - Forms, Lists, Dashboard, Navbar, Sidebar
   ========================================================================= */

/* BASE ENHANCEMENTS */
:root {
    --bs-border-radius: 0.375rem;
    --bs-form-check-input-border: 1px solid #d0d0d0;
    --bs-transition-duration: 0.2s;
    --sidebar-bg-top: #f8fbff;
    --sidebar-bg-bottom: #edf3f7;
    --sidebar-border: #dfe7ee;
    --sidebar-text: #253746;
    --sidebar-muted: #5d6f82;
    --sidebar-hover-bg: rgba(89, 131, 155, 0.12);
    --sidebar-hover-text: #234a63;
    --sidebar-active-bg: rgba(95, 165, 188, 0.14);
    --sidebar-active-border: #6eaec0;
    --content-bg: #ffffff;
    --content-text: #1f2937;
    --content-muted: #5b6473;
    --header-bg: linear-gradient(90deg, #ffffff 0%, #fafbfc 100%);
    --panel-bg: #ffffff;
    --panel-border: #e8edf3;
    --panel-shadow: rgba(15, 23, 42, 0.05);
}

html[data-bs-theme="dark"] {
    --sidebar-bg-top: #1d2a37;
    --sidebar-bg-bottom: #162230;
    --sidebar-border: #2d3d4f;
    --sidebar-text: #edf3f9;
    --sidebar-muted: #bac7d3;
    --sidebar-hover-bg: rgba(122, 171, 194, 0.14);
    --sidebar-hover-text: #edf8ff;
    --sidebar-active-bg: rgba(122, 171, 194, 0.2);
    --sidebar-active-border: #8ec5d7;
    --content-bg: #101b2a;
    --content-text: #edf3f9;
    --content-muted: #bfd1e6;
    --header-bg: linear-gradient(90deg, #161f2d 0%, #0f1723 100%);
    --panel-bg: #132131;
    --panel-border: rgba(148, 163, 184, 0.2);
    --panel-shadow: rgba(2, 6, 23, 0.38);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--content-bg);
    color: var(--content-text);
}

/* Typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--content-text);
    line-height: 1.2;
    margin-bottom: 0.625rem;
}

h1 { font-size: 2rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.625rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.375rem; margin-bottom: 1rem; }
h4 { font-size: 1.125rem; margin-bottom: 0.875rem; }
h5 { font-size: 1rem; margin-bottom: 0.75rem; }
h6 { font-size: 0.9375rem; margin-bottom: 0.625rem; }

p { line-height: 1.6; color: var(--content-text); }
small { font-size: 0.8125rem; }

a {
    /* color: #0d6efd; */
    text-decoration: none;
    transition: color 0.15s ease;
}

/* a:hover {
    color: #0b5cf7;
    text-decoration: underline;
} */

/* ============================================================================
   SIDEBAR ENHANCEMENTS
   ========================================================================= */

.app-shell {
    height: 100vh;
    display: flex;
    overflow: hidden;
    background: var(--content-bg);
}

.app-shell > main,
.content-area {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
}

.app-sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.03);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    color: var(--sidebar-text);
}

.sidebar-branding {
    background-image: var(--app-logo);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    padding: 1rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo img {
    max-width: 100%;
    height: auto;
    max-height: 45px;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}

.sidebar-logo:hover img {
    transform: scale(1.03);
}

.sidebar-logo-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sidebar-text);
    line-height: 1.2;
}

.sidebar-link {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    padding: 0.5rem 0.625rem;
    margin-bottom: 0.25rem;
    color: var(--sidebar-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
    border-left-color: var(--sidebar-active-border);
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-hover-text);
    border-left-color: var(--sidebar-active-border);
    font-weight: 500;
}

/* Sidebar branding text */
.sidebar-branding > div {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
    color: var(--sidebar-text);
}

.sidebar-section {
    padding: 0.75rem 0;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-title {
    padding: 0.75rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    line-height: 1.2;
}

/* Sidebar navigation */
.app-sidebar > nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.app-sidebar > nav::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar > nav::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar > nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.app-sidebar > nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* Main content area */
main {
    flex: 1;
    overflow-y: auto;
    background: var(--content-bg);
    color: var(--content-text);
}

/* ============================================================================
   NAVBAR & HEADER ENHANCEMENTS
   ========================================================================= */

header.border-bottom {
    background: var(--header-bg);
    box-shadow: 0 1px 3px var(--panel-shadow);
    /* padding: 0.75rem 1.5rem !important; */
}

header strong {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--content-text);
}

/* User avatar enhancement */
.user-avatar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-avatar img {
    border: 2px solid rgba(255, 255, 255, 0.8);
}

/* Dropdown menu enhancements */
.dropdown-toggle::after {
    transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    color: #495057;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
    padding-left: 1.25rem;
}

.dropdown-item.text-danger:hover {
    background: #fff5f5;
    color: #dc3545;
}

.dropdown-divider {
    margin: 0.375rem 0;
    opacity: 0.5;
}

/* ============================================================================
   FORM ENHANCEMENTS
   ========================================================================= */

.form-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.625rem;
    letter-spacing: 0.2px;
}

.form-control,
.form-select {
    font-size: 0.9375rem;
    border: 1px solid #d0d0d0;
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    transition: all 0.15s ease;
    background-color: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
    background-color: #ffffff;
}

.form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Form groups */
.mb-3 {
    margin-bottom: 1.25rem !important;
}

.row.g-3 > * {
    padding-bottom: 0.5rem;
}

/* Form validation */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.1);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #198754;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.1);
}

.invalid-feedback,
.valid-feedback {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.375rem;
    display: block;
}

/* Form cards */
.card.shadow-sm {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 0.5rem;
}

.card-body {
    padding: 2rem;
}

.card-body .row.g-3 {
    margin-bottom: 1rem;
}

/* Textarea enhancements */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* File input styling */
input[type="file"].form-control {
    padding: 0.5rem 0.75rem;
}

input[type="file"].form-control::file-selector-button {
    padding: 0.375rem 0.75rem;
    margin-right: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #d0d0d0;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

input[type="file"].form-control::file-selector-button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Form hints */
small.text-muted {
    font-size: 0.8125rem;
    color: #6c757d !important;
    display: inline-block;
    margin-top: 0.375rem;
}

/* ============================================================================
   BUTTON ENHANCEMENTS
   ========================================================================= */

.btn {
    font-weight: 600;
    padding: 0.625rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Primary buttons */
.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0b5cf7);
    border: none;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0b5cf7, #0a58ca);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

/* Secondary buttons */
.btn-secondary {
    background-color: #6c757d;
    border: none;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

/* Warning buttons */
.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
    font-weight: 600;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
    color: #212529;
}

/* Danger buttons */
.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333, #bb2d3b);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    transform: translateY(-1px);
}

/* Outline buttons */
.btn-outline-secondary {
    color: #6c757d;
    border: 1px solid #d0d0d0;
    background-color: #ffffff;
}

.btn-outline-secondary:hover:not(:disabled) {
    color: #495057;
    border-color: #adb5bd;
    background-color: #f8f9fa;
}

/* Small buttons */
.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

/* Button groups in forms */
.d-grid {
    display: grid;
    gap: 0.75rem;
}

.d-grid.gap-2 {
    gap: 0.75rem;
}

form .d-grid.gap-2 .btn {
    width: 100%;
}

/* Button containers */
.d-flex.gap-2 .btn {
    flex: 1;
    min-width: 0;
}

/* ============================================================================
   TABLE & LIST ENHANCEMENTS
   ========================================================================= */

.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    font-size: 0.9375rem;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(90deg, #f8f9fa 0%, #f5f7fa 100%);
    border-bottom: 2px solid #dee2e6;
}

.table thead th {
    font-weight: 700;
    color: #212529;
    padding: 0.875rem;
    border-bottom: 2px solid #dee2e6;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.table tbody tr {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #e9ecef;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 0.875rem;
    vertical-align: middle;
    color: #495057;
}

.table tbody td:first-child {
    color: #212529;
    font-weight: 500;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.01);
}

.table-bordered {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.table-bordered td,
.table-bordered th {
    border: 1px solid #e9ecef;
}

.table-sm {
    font-size: 0.875rem;
}

.table-sm thead th {
    padding: 0.5rem 0.75rem;
}

.table-sm tbody td {
    padding: 0.5rem 0.75rem;
}

/* Action buttons in tables */
.table td .d-flex.gap-1,
.table td .d-flex.gap-2 {
    flex-wrap: wrap;
}

.table .btn {
    white-space: nowrap;
}

/* Align middle helper */
.align-middle {
    vertical-align: middle;
}

/* ============================================================================
   LIST HEADER & ACTION BUTTONS
   ========================================================================= */

.d-flex.justify-content-between.align-items-center.mb-3 {
    margin-bottom: 2rem !important;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.d-flex.justify-content-between.align-items-center.mb-3 h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    letter-spacing: 0.3px;
    margin: 0;
}

.d-flex.justify-content-between.align-items-center.mb-3 .d-flex {
    gap: 0.75rem;
}

.d-flex.justify-content-between.align-items-center.mb-3 .btn {
    white-space: nowrap;
}

/* ============================================================================
   FORM CARD STYLING
   ========================================================================= */

.card.card-body {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 2rem;
}

.card.card-body .row.g-3 {
    margin-bottom: 1.5rem;
}

/* ============================================================================
   CARD ENHANCEMENTS (Dashboard & Content)
   ========================================================================= */

.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease-in-out, transform 0.25s ease-in-out;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.card-body {
    padding: 1.75rem;
}

.card-body h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.75rem;
    letter-spacing: 0.2px;
}

.card-body p {
    font-size: 0.9375rem;
    color: #6c757d;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.card-body .btn {
    width: 100%;
    font-weight: 600;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

.card h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.625rem;
    letter-spacing: 0.3px;
}

.card-body > p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    color: #6c757d;
    line-height: 1.5;
}

.card-body .btn {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.card.h-100 {
    display: flex;
    flex-direction: column;
}

.card.h-100 .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card.h-100 .btn {
    margin-top: auto;
}

.card.h-100 .card-body > .btn:last-of-type {
    margin-top: 0.5rem;
}

/* Dashboard grid spacing */
.row.g-3 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

/* ============================================================================
   ALIGNMENT & SPACING HELPERS
   ========================================================================= */

.d-flex.gap-1 {
    gap: 0.25rem;
}

.d-flex.gap-2 {
    gap: 0.5rem;
}

.d-flex.gap-3 {
    gap: 1rem;
}

.d-flex.flex-wrap {
    flex-wrap: wrap;
}

.d-flex.flex-fill {
    flex: 1;
}

.flex-fill {
    flex: 1;
}

/* ============================================================================
   VALIDATION & FEEDBACK STYLING
   ========================================================================= */

.was-validated .form-control:valid {
    border-color: #198754;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5h-.6z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ============================================================================
   SEARCH & FILTER BARS
   ========================================================================= */

.search-bar,
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar input,
.filter-bar select {
    flex: 1;
    min-width: 150px;
}

/* ============================================================================
   PAGINATION STYLING
   ========================================================================= */

.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border: 1px solid #dee2e6;
    color: #0d6efd;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #0d6efd;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    z-index: 3;
}

.pagination .page-link:disabled {
    color: #6c757d;
    cursor: not-allowed;
}

/* ============================================================================
   NAVIGATION & BREADCRUMBS
   ========================================================================= */

.breadcrumb {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    font-size: 0.9375rem;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 600;
}

.breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-item a:hover {
    color: #0b5cf7;
    text-decoration: underline;
}

/* ============================================================================
   PROGRESS INDICATORS & EVALUATION UI
   ========================================================================= */

.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #0d6efd, #0b5cf7);
    transition: width 0.3s ease;
}

/* Evaluation specific header and progress */
.eval-header {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.eval-progress {
    height: 6px; /* moved from inline */
    border-radius: 6px;
    overflow: hidden;
}

.eval-progress .progress-bar {
    transition: width 0.3s ease;
    width: 0%;
}

/* Single-question layout */
.eval-question { display: none; }
.eval-question.active { display: block; }

/* Option cards (large selectable areas) */
.option-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(33,37,41,0.06);
    background: transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.option-card:hover {
    background: rgba(13,110,253,0.03);
}

.option-card input[type="radio"] {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

/* Active/selected state */
.option-card.active {
    border-left: 4px solid var(--sidebar-active-border, #34d399);
    background-color: rgba(110,174,192,0.04);
}

/* Navigation button sizing for evaluation */
.evaluation-footer { display:flex; justify-content:space-between; align-items:center; gap:0.75rem; }
.evaluation-nav { display:flex; gap:0.6rem; }
.evaluation-nav .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
    min-width: 140px;
}

#prevBtn {
    padding: 0.4rem 0.7rem;
    min-width: 100px;
}

#nextBtn, #submitBtn { min-width: 140px; }

/* Mobile: stack buttons vertically on very small viewports */
@media (max-width: 576px) {
    .evaluation-footer { flex-direction: column; align-items: stretch; }
    .evaluation-nav { justify-content: space-between; }
    .evaluation-nav .btn { flex: 1; min-width: 0; }
    #prevBtn { width: 100%; }
}

.evaluation-nav .btn.btn-primary {
    background: linear-gradient(135deg, #36c1ff, #0ea5d3);
    border: none;
    box-shadow: 0 2px 6px rgba(14,165,211,0.18);
}

.evaluation-nav .btn.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0ea5d3, #28a6c6);
}

.evaluation-nav .btn.btn-outline-secondary {
    color: #0d6efd;
}

.submit-hidden { display: none; }

/* Preview graphic moved from inline styles */

/* make these theme aware */
html[data-bs-theme="dark"] .option-card:hover {
    background: rgba(255,255,255,0.02);
}
html[data-bs-theme="dark"] .option-card.active {
    background-color: rgba(142,197,215,0.06);
}

/* ============================================================================
   EMPTY STATES
   ========================================================================= */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* ============================================================================
   ERROR & SUCCESS MESSAGES
   ========================================================================= */

.alert {
    border-radius: 0.375rem;
    border: 1px solid transparent;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-color: #ffecb5;
}

.alert-info {
    background-color: #cfe2ff;
    color: #084298;
    border-color: #b6d4fe;
}

.alert-heading {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.alert .alert-link {
    font-weight: 700;
    text-decoration: underline;
}

.alert-close {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.25rem;
    margin-left: auto;
}

.alert-close:hover {
    opacity: 1;
}

/* ============================================================================
   COMPACT CARD ENHANCEMENTS (Mobile Lists)
   ========================================================================= */

.compact-card {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.compact-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.compact-card .label {
    font-weight: 700;
    display: inline-block;
    min-width: 90px;
    color: #212529;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.compact-card .value {
    color: #495057;
    font-size: 0.9375rem;
    font-weight: 500;
}

.compact-card .d-flex.justify-content-between.mb-2 {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.compact-card .mb-1,
.compact-card .mb-2 {
    margin-bottom: 0.625rem !important;
}

.compact-card .d-grid {
    margin-top: 1rem;
}

.compact-card .d-grid.gap-2 {
    gap: 0.5rem;
}

/* ============================================================================
   RESPONSIVE HELPERS
   ========================================================================= */

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 100%;
        min-height: auto;
    }

    header.border-bottom {
        padding: 0.625rem 1rem !important;
    }

    .offcanvas {
        width: 220px;
        background: var(--content-bg);
        color: var(--content-text);
    }

    .offcanvas-header {
        padding: 0.75rem;
        background: linear-gradient(90deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
        border-bottom: 1px solid var(--sidebar-border);
    }

    .offcanvas-title {
        font-weight: 700;
        color: var(--sidebar-text);
        font-size: 0.9rem;
    }

    .offcanvas-body {
        padding: 0.5rem 0;
    }

    .offcanvas-body .sidebar-link {
        padding: 0.55rem 0.75rem;
        margin-bottom: 0.3rem;
        font-size: 0.875rem;
        color: var(--sidebar-muted);
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1.25rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .form-label {
        font-size: 0.875rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9375rem;
        padding: 0.55rem 0.75rem;
    }

    .row.g-3 {
        --bs-gutter-y: 1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-3 h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar-branding {
        padding: 1rem;
    }

    .sidebar-logo-text {
        font-size: 0.85rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .compact-card {
        padding: 0.875rem;
    }

    .btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.875rem;
    }

    .d-grid.gap-2 {
        gap: 0.5rem;
    }

    .table-responsive {
        font-size: 0.8125rem;
    }

    .table thead th {
        padding: 0.625rem 0.5rem;
    }

    .table tbody td {
        padding: 0.625rem 0.5rem;
    }
}

/* ============================================================================
   DARK MODE ENHANCEMENTS
   ========================================================================= */

html[data-bs-theme="dark"] .app-sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
    border-right-color: var(--sidebar-border);
}

html[data-bs-theme="dark"] .sidebar-branding {
    background: rgba(255, 255, 255, 0.02);
}

html[data-bs-theme="dark"] header.border-bottom {
    background: var(--header-bg);
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
    background-color: #162230;
    border-color: #344a60;
    color: #edf3f9;
}

html[data-bs-theme="dark"] .table thead {
    background: rgba(255, 255, 255, 0.04);
}

html[data-bs-theme="dark"] .compact-card {
    background: var(--panel-bg);
    border-color: var(--panel-border);
}

html[data-bs-theme="dark"] .dropdown-menu {
    background-color: #162230;
    border-color: #334a5d;
}

html[data-bs-theme="dark"] .dropdown-item {
    color: #edf3f9;
}

html[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(122, 171, 194, 0.14);
    color: #edf8ff;
}

@media (prefers-color-scheme: dark) {
    html:not([data-bs-theme="light"]) .app-sidebar {
        background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
    }

    html:not([data-bs-theme="light"]) .sidebar-branding {
        background: rgba(255, 255, 255, 0.02);
    }
}

/* ============================================================================
   ACCESSIBILITY & FOCUS STATES
   ========================================================================= */

:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0d6efd;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* ============================================================================
   STEP NAVIGATION & FORM FLOWS
   ========================================================================= */

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 120px;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-group .btn.active {
    background: linear-gradient(135deg, #0d6efd, #0b5cf7);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.step-pane {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form card with stepper */
.card[data-stepper] {
    border-radius: 0.5rem;
    overflow: hidden;
}

.card[data-stepper] .card-body {
    padding: 2rem;
}

/* Mobile sticky actions */
.mobile-sticky-space {
    padding-bottom: 5rem;
}

.mobile-sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 30%);
    border-top: 1px solid #e9ecef;
    z-index: 50;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.mobile-sticky-actions .btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.mobile-sticky-actions .flex-fill {
    flex: 1;
}

/* Form control improvements */
.form-control.is-long-text {
    max-height: 300px;
    resize: vertical;
}

/* ============================================================================
   LOADING & STATE INDICATORS
   ========================================================================= */

.spinner-border {
    border-width: 0.25em;
    opacity: 0.8;
}

.badge {
    font-weight: 600;
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-indicator.draft {
    background: #e7e9ec;
    color: #495057;
}

.status-indicator.in_progress {
    background: #cfe2ff;
    color: #0c63e4;
}

.status-indicator.finished {
    background: #d1e7dd;
    color: #0f5132;
}

/* ============================================================================
   UTILITY ADJUSTMENTS
   ========================================================================= */

.text-muted {
    color: #6c757d !important;
}

.bg-body {
    background-color: var(--bs-body-bg);
}

.border-end {
    border-right: 1px solid #e9ecef !important;
}

.border-bottom {
    border-bottom: 1px solid #e9ecef !important;
}

.sticky-top {
    top: 0;
    z-index: 99;
}

/* Improve print styles */
@media print {
    .app-shell,
    .app-sidebar,
    header,
    .d-print-none {
        display: none !important;
    }

    body {
        min-height: auto;
    }
}
