:root {
    --primary-color: #0066cc;
    --secondary-color: #004d99;
    --accent-color: #ff6600;
    --border-color: #dee2e6;
    --bg-light: #f8f9fa;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Enhanced Tab Navbar Styles - Removed (Not Used) */

.form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.form-header {
    background: #ffffff;
    color: #1a1a1a;
    padding: 1.75rem 2rem;
    text-align: left;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.form-header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.3px;
}

.form-header h1 i {
    color: #0066cc;
    font-size: 1.4rem;
}

.form-header .subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.progress-container {
    background: #f8f9fa;
    padding: 1rem 2rem 1rem;
    border-bottom: 3px solid #dee2e6;
    flex-shrink: 0;
    position: relative;
    margin-bottom: 0;
}

.progress {
    height: 6px;
    border-radius: 10px;
    background: #e8ecef;
    overflow: visible;
    position: relative;
}

.progress-bar {
    background: #0066cc;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    background: #004d99;
    border-radius: 0 10px 10px 0;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* SKELETON LOADING STYLES */
.skeleton {
    background: linear-gradient(
        90deg,
        #e0e0e0 0%,
        #f0f0f0 50%,
        #e0e0e0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton element types */
.skeleton-header {
    height: 80px;
    margin-bottom: 0;
}

.skeleton-progress {
    height: 60px;
    margin-bottom: 0;
}

.skeleton-tabs {
    height: 50px;
    margin-bottom: 0;
}

.skeleton-section-title {
    height: 45px;
    margin-bottom: 1rem;
    border-radius: 6px;
}

.skeleton-label {
    height: 20px;
    width: 150px;
    margin-bottom: 0.35rem;
}

.skeleton-input {
    height: 45px;
    margin-bottom: 0.85rem;
    border-radius: 6px;
}

.skeleton-input-small {
    height: 45px;
    border-radius: 6px;
}

.skeleton-textarea {
    height: 100px;
    margin-bottom: 0.85rem;
    border-radius: 6px;
}

.skeleton-select {
    height: 45px;
    margin-bottom: 0.85rem;
    border-radius: 6px;
}

.skeleton-button {
    height: 50px;
    border-radius: 50px;
    min-width: 120px;
}

.skeleton-checkbox {
    height: 25px;
    width: 200px;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-radio {
    height: 25px;
    width: 150px;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-inline-group {
    height: 30px;
    width: 100%;
    margin-bottom: 0.85rem;
}

.skeleton-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.skeleton-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.skeleton-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.skeleton-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.skeleton-field-group {
    margin-bottom: 0.85rem;
}

.skeleton-body-diagram {
    height: 400px;
    border-radius: 8px;
    margin: 1rem 0;
}

.skeleton-special-section {
    height: 150px;
    border-radius: 8px;
    margin: 0.85rem 0 0 0;
}

/* Individual skeleton loading for form elements */
.loading .form-label {
    position: relative;
    min-height: 20px;
    color: transparent !important;
}

.loading .form-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    height: 20px;
    width: 150px;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    z-index: 10;
}

.loading .form-control,
.loading .form-select {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%) !important;
    background-size: 200% 100% !important;
    animation: skeleton-loading 1.5s ease-in-out infinite !important;
    color: transparent !important;
    border-color: #e0e0e0 !important;
    pointer-events: none !important;
    user-select: none !important;
}

.loading .form-control::placeholder {
    color: transparent !important;
}

.loading textarea.form-control {
    resize: none !important;
}

.loading .form-check {
    position: relative;
}

.loading .form-check::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 25px;
    width: 100%;
    max-width: 200px;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    z-index: 10;
}

.loading .form-check-input,
.loading .form-check-label {
    opacity: 0;
}

.loading .section-title {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%) !important;
    background-size: 200% 100% !important;
    animation: skeleton-loading 1.5s ease-in-out infinite !important;
    color: transparent !important;
    border-left-color: #e0e0e0 !important;
}

.loading .section-title i {
    opacity: 0;
}

/* Skeleton loading for buttons - EXCLUDE navigation buttons so they remain usable */
.loading .btn:not(.navigation-buttons .btn) {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%) !important;
    background-size: 200% 100% !important;
    animation: skeleton-loading 1.5s ease-in-out infinite !important;
    color: transparent !important;
    border-color: #e0e0e0 !important;
    pointer-events: none !important;
    user-select: none !important;
}

.loading .btn:not(.navigation-buttons .btn) i {
    opacity: 0;
}

/* Navigation buttons should ALWAYS be visible and functional */
.navigation-buttons .btn {
    color: inherit;
    pointer-events: auto;
}

.navigation-buttons .btn-outline-secondary {
    color: #6c757d !important;
}

.navigation-buttons .btn-outline-primary {
    color: #0066cc !important;
}

.navigation-buttons .btn-primary {
    color: white !important;
}

.navigation-buttons .btn-success {
    color: white !important;
}

.loading .body-diagram-container,
.loading .fast-assessment,
.loading .ob-section {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%) !important;
    background-size: 200% 100% !important;
    animation: skeleton-loading 1.5s ease-in-out infinite !important;
}

.loading .body-diagram-container *,
.loading .fast-assessment *,
.loading .ob-section * {
    opacity: 0 !important;
}

/* Header skeleton */
.loading .form-header h1,
.loading .form-header .subtitle {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    color: transparent !important;
    border-radius: 4px;
}

.loading .form-header h1 i,
.loading .form-header .subtitle i {
    opacity: 0;
}

/* Progress skeleton */
.loading .progress-container > div:not(.skeleton-overlay) {
    opacity: 0;
}

.loading .progress-container {
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Tabs skeleton - Single unified skeleton bar */
.loading .tabs-container {
    position: relative;
}

.loading .tabs-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    z-index: 100;
    border-bottom: 2px solid #e8ecef;
}

.loading .nav-tabs {
    opacity: 0;
}

/* Ensure body stays visible during loading */
body.loading {
    overflow: hidden;
}

/* Add smooth transition when loading completes */
body:not(.loading) .form-label,
body:not(.loading) .form-control,
body:not(.loading) .form-select,
body:not(.loading) .section-title,
body:not(.loading) .btn,
body:not(.loading) .nav-tabs .nav-link {
    transition: all 0.3s ease;
}

/* Skeleton overlay positioning */
.skeleton-overlay {
    display: none;
}

.loading .skeleton-overlay {
    display: none !important;
}

/* Add relative positioning to containers */
.form-header,
.progress-container,
.tabs-container,
.navigation-buttons,
.form-section {
    position: relative;
}

/* Responsive skeleton adjustments */
@media (max-width: 1200px) {
    .skeleton-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .skeleton-grid-2,
    .skeleton-grid-3,
    .skeleton-grid-4 {
        grid-template-columns: 1fr;
    }

    .skeleton-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

.tabs-container {
    background: #ffffff;
    border-bottom: 2px solid #e8ecef;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
    padding-top: 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep scroll functionality */
.tabs-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-container::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.tabs-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.nav-tabs {
    border-bottom: none;
    padding: 0 2rem;
    flex-wrap: nowrap;
    margin-bottom: 0;
    display: flex;
    gap: 0;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    background: transparent;
    padding: 1rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-bottom: 3px solid transparent;
    border-right: 1px solid #e8ecef;
    transition: all 0.2s ease;
    position: relative;
    margin: 0;
}

.nav-tabs .nav-link:first-child {
    border-top-left-radius: 0;
}

.nav-tabs .nav-link:last-child {
    border-right: none;
}

.nav-tabs .nav-link:hover {
    color: #0066cc;
    background: #f8f9fa;
    border-bottom-color: #80b3e6;
}

.nav-tabs .nav-link.active {
    color: #0066cc;
    background: #ffffff;
    border-bottom-color: #0066cc;
    border-right-color: transparent;
    font-weight: 600;
}

.nav-tabs .nav-link.completed {
    color: #198754;
}

.form-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: #fafbfc;
}

.form-section {
    max-width: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.section-title {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 0.65rem 1rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

/* Section Dividers - Subtle visual separators */
.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, #dee2e6, transparent);
    margin: 1.5rem 0;
}

.section-divider-light {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e9ecef 20%, #e9ecef 80%, transparent);
    margin: 1.25rem 0;
}

.section-divider-dashed {
    border: 0;
    height: 0;
    border-top: 1px dashed #dee2e6;
    margin: 1.25rem 0;
}

/* Subsection title - smaller than main section title */
.subsection-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #495057;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subsection-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Field group wrapper with spacing */
.field-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f0f2f5;
}

.field-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* LARGER FORM INPUTS AND LABELS */
.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.form-control, .form-select {
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    height: auto;
    min-height: 45px;
}

.form-select[multiple] {
    min-height: 120px;
    padding: 0.5rem;
}

.form-select[multiple] option {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
}

.form-select[multiple] option:checked {
    background: var(--primary-color);
    color: white;
}

.form-select[multiple] option:hover {
    background: #e3f2fd;
}

.form-select[multiple] option:checked:hover {
    background: var(--secondary-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

textarea.form-control {
    min-height: 100px;
}

/* LARGER CHECKBOXES AND RADIOS */
.form-check-input {
    width: 1.3rem;
    height: 1.3rem;
    margin-top: 0.2rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 1rem;
    margin-left: 0.5rem;
}

/* OPTIMIZED GRID LAYOUTS */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1rem;
}

/* SPECIAL SECTIONS */

/* ========================================
   STROKE ASSESSMENT CARD - Corporate Design
   ======================================== */
.stroke-assessment-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e9f0;
    overflow: hidden;
    margin: 1rem 0;
}

.stroke-assessment-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.stroke-header-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stroke-header-icon i {
    font-size: 1.25rem;
    color: #ffffff;
}

.stroke-header-text h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.stroke-header-text span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

.stroke-assessment-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* F.A.S.T. Section */
.fast-section {
    padding: 1.25rem;
    border-right: 1px solid #e5e9f0;
}

.fast-section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.fast-badge {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.fast-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.fast-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.fast-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.fast-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.fast-item-letter {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.fast-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fast-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

/* Toggle Button Group */
.toggle-group {
    display: flex;
    gap: 0;
    background: #e2e8f0;
    border-radius: 6px;
    padding: 3px;
}

.toggle-input {
    display: none;
}

.toggle-btn {
    padding: 0.35rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.toggle-btn:hover {
    color: #334155;
}

.toggle-input:checked + .toggle-btn.toggle-positive {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.toggle-input:checked + .toggle-btn.toggle-negative {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* S.A.M.P.L.E. Section */
.sample-section {
    padding: 1.25rem;
    background: #fafbfc;
}

.sample-section-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.sample-badge {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sample-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.sample-table-modern {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.sample-row-modern {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
}

.sample-row-modern:last-child {
    border-bottom: none;
}

.sample-letter-modern {
    width: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.sample-input-modern {
    flex: 1;
    padding: 0;
}

.sample-input-modern .form-control {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.5rem 0.75rem;
    min-height: 38px;
    font-size: 0.875rem;
}

.sample-input-modern .form-control:focus {
    border: none;
    box-shadow: none;
    background: #f0f9ff;
}

.sample-input-modern .form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Legacy SAMPLE table styles (for backward compatibility) */
.sample-table {
    border: 2px solid #0066cc;
    border-radius: 6px;
    overflow: hidden;
    background: #dce6f2;
}

.sample-row {
    display: flex;
    border-bottom: 2px solid #0066cc;
}

.sample-row:last-child {
    border-bottom: none;
}

.sample-letter {
    width: 50px;
    min-width: 50px;
    background: #f5c542;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #0066cc;
    padding: 0.5rem;
}

.sample-input {
    flex: 1;
    background: #dce6f2;
    padding: 0.35rem 0.5rem;
}

.sample-input .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0.4rem 0.5rem;
    min-height: 36px;
}

.sample-input .form-control:focus {
    border: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Stroke Assessment */
@media (max-width: 992px) {
    .stroke-assessment-body {
        grid-template-columns: 1fr;
    }

    .fast-section {
        border-right: none;
        border-bottom: 1px solid #e5e9f0;
    }
}

@media (max-width: 576px) {
    .fast-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .fast-item {
        padding: 0.75rem;
    }

    .stroke-assessment-header {
        padding: 0.875rem 1rem;
    }

    .fast-section,
    .sample-section {
        padding: 1rem;
    }
}

.fast-assessment, .ob-section, .waiver-section {
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin: 0.85rem 0 0 0;
    font-size: 0.95rem;
}

.fast-assessment {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
}

.fast-assessment h6 {
    color: #856404;
    font-weight: 600;
    margin-bottom: 0.65rem;
    font-size: 1rem;
}

.ob-section {
    background-color: #d1ecf1;
    border: 2px solid #17a2b8;
}

.ob-section h6 {
    color: #0c5460;
    font-weight: 600;
    margin-bottom: 0.65rem;
    font-size: 1rem;
}

.waiver-section {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
}

.waiver-section h6 {
    color: #721c24;
    font-weight: 600;
    margin-bottom: 0.65rem;
    font-size: 1rem;
}

.waiver-section p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.signature-box {
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: center;
    background-color: #fafafa;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.signature-box i {
    font-size: 2rem;
    color: #ccc;
}

.signature-box p {
    font-size: 0.9rem;
    margin: 0.75rem 0 0 0;
    color: #666;
}

/* BODY DIAGRAM SECTION */
.body-diagram-container {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.body-diagram-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.body-diagram-header h6 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Marker Legend */
.marker-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.legend-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #6c757d;
    font-weight: 500;
}

.legend-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 8px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.body-diagram-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}

.body-views {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: flex-start;
}

.body-view {
    text-align: center;
}

.view-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.body-image-container {
    position: relative;
    display: inline-block;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: crosshair;
}

.body-image {
    display: block;
    width: 220px;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* Injury markers with abbreviations */
.injury-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    animation: markerPop 0.3s ease;
    font-family: 'Courier New', monospace;
}

@keyframes markerPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.injury-marker:hover {
    transform: translate(-50%, -50%) scale(1.25);
}

.injury-marker.laceration { background: #dc3545; }
.injury-marker.fracture { background: #fd7e14; }
.injury-marker.burn { background: #ffc107; color: #333; }
.injury-marker.contusion { background: #6f42c1; }
.injury-marker.abrasion { background: #20c997; }
.injury-marker.other { background: #6c757d; }

/* ========================================
   INJURY SIDEBAR - REDESIGNED
   ======================================== */
.injury-sidebar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-y: auto;
    max-height: 550px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Injury Type Selector */
.injury-type-selector {
    margin-bottom: 1.5rem;
}

.selector-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a4d8f;
    margin-bottom: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selector-header i {
    font-size: 1.1rem;
    color: #0066cc;
}

.injury-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.injury-type-btn {
    padding: 0;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.injury-type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.injury-type-btn:hover::before {
    left: 100%;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
}

.color-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.color-badge i {
    color: white;
    font-size: 0.95rem;
}

.btn-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
    transition: color 0.2s ease;
}

.injury-type-btn:hover {
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.injury-type-btn:hover .color-badge {
    transform: scale(1.1) rotate(5deg);
}

.injury-type-btn:hover .btn-label {
    color: #0066cc;
}

.injury-type-btn.active {
    border-color: #0066cc;
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.injury-type-btn.active .btn-label {
    color: white;
    font-weight: 700;
}

.injury-type-btn.active .color-badge {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Injury List Header */
.injury-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.25rem 0 0.875rem 0;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a4d8f;
}

.header-content i {
    font-size: 1.1rem;
    color: #0066cc;
}

.injury-badge {
    background: #0066cc;
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.injury-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary-color);
    position: relative;
    font-size: 0.85rem;
}

.injury-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.injury-number {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.injury-type-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.injury-type-badge.laceration { background: #dc3545; }
.injury-type-badge.fracture { background: #fd7e14; }
.injury-type-badge.burn { background: #ffc107; color: #333; }
.injury-type-badge.contusion { background: #6f42c1; }
.injury-type-badge.abrasion { background: #20c997; }
.injury-type-badge.other { background: #6c757d; }

.injury-notes {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    resize: vertical;
    min-height: 50px;
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.delete-btn:hover {
    background: #c82333;
}

/* Empty State - Redesigned */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: white;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: #adb5bd;
}

.empty-state-icon i {
    font-size: 3rem;
}

.empty-state-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.empty-state-subtitle {
    font-size: 0.8125rem;
    color: #6c757d;
    margin: 0;
}

/* Action Buttons - Redesigned */
.diagram-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border: 2px solid;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    background: white;
}

.action-btn i {
    font-size: 1rem;
}

.btn-clear {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-clear:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-export {
    border-color: #0066cc;
    color: #0066cc;
}

.btn-export:hover {
    background: #0066cc;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.navigation-buttons {
    background: white;
    padding: 1rem 2rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
}

.btn {
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: 50px;
    font-size: 1rem;
    min-width: 120px;
    border: 2px solid;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

/* Remove underline from all buttons globally */
button,
.btn,
[type="button"],
[type="submit"],
[role="button"],
a,
a:hover,
a:focus,
a:active {
    text-decoration: none !important;
}

/* Specifically target Notiflix buttons and notifications */
#NotiflixConfirmWrap button,
#NotiflixConfirmWrap a,
#NotiflixNotifyWrap button,
#NotiflixNotifyWrap a,
#NotiflixReportWrap button,
#NotiflixReportWrap a,
#NotiflixBlockWrap button,
#NotiflixBlockWrap a,
.notiflix-confirm-button,
.notiflix-report-button,
.nx-button,
[id^="Notiflix"] button,
[id^="Notiflix"] a,
[class*="notiflix"] button,
[class*="notiflix"] a {
    text-decoration: none !important;
}

.btn-primary {
    background-color: #0066cc;
    border-color: #0066cc;
    color: white;
}

.btn-primary:hover {
    background-color: #0052a3;
    border-color: #0052a3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
}

.btn-primary:active {
    background-color: #004080;
    border-color: #004080;
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-primary {
    background-color: white;
    color: #0066cc;
    border-color: #0066cc;
}

.btn-outline-primary:hover {
    background-color: #e6f2ff;
    border-color: #0052a3;
    color: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.15);
}

.btn-outline-primary:active {
    background-color: #cce5ff;
    border-color: #004080;
    color: #004080;
    transform: translateY(0);
    box-shadow: none;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.btn-success:active {
    background-color: #1e7e34;
    border-color: #1e7e34;
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-secondary {
    background-color: white;
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #5a6268;
    color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.15);
}

.btn-outline-secondary:active {
    background-color: #e9ecef;
    border-color: #495057;
    color: #495057;
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline-danger {
    background-color: white;
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #fff5f5;
    border-color: #c82333;
    color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.15);
}

.btn-outline-danger:active {
    background-color: #ffe6e6;
    border-color: #bd2130;
    color: #bd2130;
    transform: translateY(0);
    box-shadow: none;
}

.required-field::after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
}

.mb-section {
    margin-bottom: 0.85rem;
}

.summary-content {
    max-width: none;
    padding: 0;
}

.summary-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-section h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.75rem;
}

.summary-section h7 {
    color: var(--secondary-color);
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    font-size: 1.1rem;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    margin: 0;
}

.summary-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.summary-table td:first-child {
    font-weight: 600;
    color: #333;
    width: 40%;
    background: #f8f9fa;
    border-right: 2px solid #e9ecef;
}

.summary-table td:last-child {
    width: 60%;
    color: #495057;
}

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

.summary-table tr:hover td {
    background: #f8f9fa;
}

.summary-table tr:hover td:first-child {
    background: #e9ecef;
}

.form-body::-webkit-scrollbar {
    width: 10px;
}

.form-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.form-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.form-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.injury-sidebar::-webkit-scrollbar {
    width: 6px;
}

.injury-sidebar::-webkit-scrollbar-track {
    background: #e9ecef;
}

.injury-sidebar::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.inline-group {
    display: flex;
    gap: 1.5rem;
    row-gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-group-compact {
    gap: 0.5rem;
}

.form-group-compact {
    margin-bottom: 0.85rem;
}

/* Vehicle selection modal styles */
.vehicle-option {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vehicle-option:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.vehicle-option.selected {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
}

.vehicle-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.vehicle-details {
    font-size: 0.9rem;
    color: #6c757d;
}

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .body-diagram-content {
        grid-template-columns: 1fr;
    }
    
    .body-views {
        gap: 1.5rem;
    }
    
    .body-image {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .form-body {
        padding: 1rem 1rem 1.5rem 1rem;
        min-height: calc(100vh - 350px) !important;
    }

    .navigation-buttons {
        padding: 1.25rem 1rem !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
    }

    .navigation-buttons .btn {
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.95rem !important;
        min-height: 44px !important;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        padding: 0 1rem;
    }

    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }

    .body-views {
        flex-direction: column;
        gap: 1rem;
    }

    .progress-container {
        padding: 0.85rem 1rem 0.65rem;
    }

    .form-header {
        padding: 1.25rem 1rem;
    }

    .form-header h1 {
        font-size: 1.1rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .form-header h1 i {
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .form-header .subtitle {
        font-size: 0.8rem;
        margin-top: 0.35rem;
        margin-left: 1.7rem !important;
    }
}

/* NARRATIVE REPORT STYLES - CLEAN CORPORATE */
.narrative-report-container {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0;
    margin: 1.5rem 0;
    overflow: hidden;
}

/* Toolbar */
.narrative-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.narrative-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.narrative-format-toggle {
    display: inline-flex;
    gap: 2px;
    background: #e5e7eb;
    border-radius: 4px;
    padding: 3px;
}

.format-btn {
    padding: 0.375rem 0.875rem;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    line-height: 1.4;
}

.format-btn:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.6);
}

.format-btn.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.format-btn i {
    font-size: 0.875rem;
}

.narrative-regenerate-btn {
    padding: 0.375rem 0.875rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background 0.15s ease;
    line-height: 1.4;
}

.narrative-regenerate-btn:hover {
    background: #f3f4f6;
}

/* Narrative Content Area */
.narrative-content {
    padding: 1.5rem 2rem;
    background: #ffffff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    color: #1f2937;
    overflow-x: auto;
}

.narrative-content .narrative-text {
    white-space: pre-wrap;
}

/* Placeholder State */
.narrative-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    text-align: center;
    white-space: normal;
}

.narrative-placeholder i {
    font-size: 1.25rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.narrative-placeholder p {
    margin: 0 0 0.75rem 0;
    font-size: 0.8125rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #9ca3af;
    font-weight: 400;
    line-height: 1.4;
}

.narrative-generate-btn {
    padding: 0.3rem 0.875rem;
    border: 1px solid #374151;
    background: #374151;
    color: #ffffff;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.narrative-generate-btn:hover {
    background: #4b5563;
    border-color: #4b5563;
}

/* Action Bar */
.narrative-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.narrative-action-btn {
    padding: 0.4375rem 0.875rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background 0.15s ease;
    line-height: 1.4;
}

.narrative-action-btn:hover {
    background: #f3f4f6;
}

.narrative-action-btn.narrative-action-primary {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.narrative-action-btn.narrative-action-primary:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.narrative-action-btn i {
    font-size: 0.8125rem;
}

/* Narrative text formatting */
.narrative-text {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.narrative-text .narrative-header {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #e5e7eb;
}

.narrative-text .narrative-section {
    margin-bottom: 1.25rem;
}

.narrative-text .narrative-section-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.375rem;
}

.narrative-text .narrative-list {
    margin-left: 1.25rem;
    margin-top: 0.375rem;
}

.narrative-text .narrative-list-item {
    margin-bottom: 0.25rem;
}

.narrative-text .narrative-footer {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-style: italic;
    color: #6b7280;
    font-size: 0.8125rem;
}

/* Responsive narrative report */
@media (max-width: 992px) {
    .narrative-toolbar {
        padding: 0.75rem 1rem;
    }

    .narrative-content {
        padding: 1.5rem 1.25rem;
        font-size: 0.8125rem;
    }

    .narrative-actions {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    .narrative-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .narrative-toolbar-left {
        width: 100%;
    }

    .narrative-format-toggle {
        width: 100%;
    }

    .format-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.8125rem;
    }

    .narrative-regenerate-btn {
        width: 100%;
        justify-content: center;
    }

    .narrative-content {
        padding: 1.25rem 1rem;
        font-size: 0.8125rem;
        line-height: 1.7;
    }

    .narrative-placeholder {
        min-height: 120px;
    }

    .narrative-actions {
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 0.375rem;
    }

    .narrative-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   DESKTOP/LAPTOP COMPACT FIT - Screen Optimized
   ======================================== */
@media (min-width: 1024px) {
    /* Larger header for desktop */
    .form-header {
        padding: 1.5rem 2rem;
    }

    .form-header h1 {
        font-size: 1.85rem;
    }

    .form-header .subtitle {
        font-size: 1.15rem;
        margin-top: 0.35rem;
    }

    /* Progress bar */
    .progress-container {
        padding: 1rem 2rem;
    }

    .progress {
        height: 8px;
    }

    /* Tabs */
    .tabs-container {
        padding-top: 0.5rem;
    }

    .nav-tabs .nav-link {
        padding: 0.85rem 1.5rem;
        font-size: 1.1rem;
    }

    /* Form body */
    .form-body {
        padding: 1.5rem 2.5rem;
    }

    /* Larger section titles for desktop */
    .section-title {
        padding: 0.75rem 1.25rem;
        margin-bottom: 1rem;
        font-size: 1.35rem;
    }

    /* Larger subsection titles for desktop */
    .subsection-title {
        font-size: 1.25rem;
        margin: 1.5rem 0 1rem 0;
        padding-bottom: 0.5rem;
    }

    .subsection-title i {
        font-size: 1.25rem;
    }

    /* Dividers */
    .section-divider {
        margin: 1.5rem 0;
    }

    .section-divider-light {
        margin: 1.25rem 0;
    }

    .section-divider-dashed {
        margin: 1.25rem 0;
    }

    .field-group {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    /* Larger form labels for desktop */
    .form-label {
        font-size: 1.25rem;
        margin-bottom: 0.4rem;
    }

    /* Larger form inputs for desktop */
    .form-control, .form-select {
        padding: 0.85rem 1rem;
        font-size: 1.2rem;
        min-height: 52px;
    }

    /* Larger checkboxes and radios for desktop */
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
    }

    .form-check-label {
        font-size: 1.2rem;
        margin-left: 0.35rem;
    }

    /* Tighter grid spacing */
    .grid-2, .grid-3, .grid-4 {
        gap: 0.75rem;
    }

    .mb-section {
        margin-bottom: 0.65rem;
    }

    .form-group-compact {
        margin-bottom: 0.65rem;
    }

    .checkbox-grid {
        gap: 0.5rem 0.75rem;
    }

    .inline-group {
        gap: 1.25rem;
    }

    .inline-group-compact {
        gap: 0.75rem;
        flex-wrap: nowrap;
    }

    /* Compact navigation buttons */
    .navigation-buttons {
        padding: 0.875rem 2rem !important;
    }

    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
        min-width: 100px;
    }

    /* Compact special sections */
    .fast-assessment, .ob-section, .waiver-section {
        padding: 0.65rem 0.875rem;
        margin: 0.65rem 0 0 0;
        font-size: 1rem;
    }

    .fast-assessment h6,
    .ob-section h6,
    .waiver-section h6 {
        font-size: 1.05rem;
        margin-bottom: 0.5rem;
    }

    /* Compact SAMPLE table */
    .sample-letter {
        width: 44px;
        min-width: 44px;
        font-size: 1.05rem;
        padding: 0.35rem;
    }

    .sample-input {
        padding: 0.25rem 0.4rem;
    }

    .sample-input .form-control {
        padding: 0.3rem 0.4rem;
        min-height: 36px;
    }

    /* Compact Stroke Assessment Card */
    .stroke-assessment-card {
        margin: 0.75rem 0;
    }

    .stroke-assessment-header {
        padding: 0.75rem 1rem;
    }

    .stroke-header-icon {
        width: 36px;
        height: 36px;
    }

    .stroke-header-icon i {
        font-size: 1.2rem;
    }

    .stroke-header-text h6 {
        font-size: 1.05rem;
    }

    .stroke-header-text span {
        font-size: 0.85rem;
    }

    .fast-section,
    .sample-section {
        padding: 1rem;
    }

    .fast-item {
        padding: 0.5rem 0.75rem;
        gap: 0.625rem;
    }

    .fast-item-letter {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .fast-item-label {
        font-size: 0.95rem;
    }

    .toggle-btn {
        padding: 0.25rem 0.625rem;
        font-size: 0.85rem;
    }

    .sample-letter-modern {
        width: 42px;
        min-width: 42px;
        font-size: 0.95rem;
    }

    .sample-input-modern .form-control {
        padding: 0.4rem 0.625rem;
        min-height: 38px;
        font-size: 0.95rem;
    }

    /* Compact body diagram */
    .body-diagram-container {
        padding: 1rem;
        margin: 0.75rem 0;
    }

    .body-diagram-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .body-diagram-header h6 {
        font-size: 1.15rem;
    }

    .body-image {
        width: 180px;
    }

    .injury-sidebar {
        padding: 1rem;
        max-height: 450px;
    }

    .injury-marker {
        width: 24px;
        height: 24px;
        font-size: 8px;
    }

    /* Compact narrative report */
    .narrative-report-container {
        margin: 1rem 0;
    }

    .narrative-content {
        padding: 1.5rem 1.75rem;
        min-height: 300px;
        font-size: 0.95rem;
    }
}

/* Extra compact for larger desktop screens */
@media (min-width: 1400px) {
    .form-section {
        max-width: 1200px;
    }

    /* Use 4 columns for basic info grids */
    .grid-3 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-2 {
        grid-template-columns: repeat(3, 1fr);
    }

    .checkbox-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    /* Body diagram side by side */
    .body-diagram-content {
        grid-template-columns: 1fr 300px;
        gap: 1rem;
    }

    .body-views {
        gap: 1.5rem;
    }

    .body-image {
        width: 160px;
    }
}

/* Standard laptop screens (1366x768) */
@media (min-width: 1024px) and (max-height: 800px) {
    .form-header {
        padding: 0.75rem 2rem;
    }

    .form-header h1 {
        font-size: 1.15rem;
    }

    .progress-container {
        padding: 0.5rem 2rem;
    }

    .progress {
        height: 4px;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .form-body {
        padding: 0.75rem 1.5rem;
    }

    .section-title {
        padding: 0.4rem 0.75rem;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
    }

    /* Smaller subsection titles for laptop */
    .subsection-title {
        font-size: 0.8rem;
        margin: 1rem 0 0.5rem 0;
        padding-bottom: 0.35rem;
    }

    .subsection-title i {
        font-size: 0.85rem;
    }

    /* Smaller dividers for laptop */
    .section-divider {
        margin: 1rem 0;
    }

    .section-divider-light {
        margin: 0.75rem 0;
    }

    .section-divider-dashed {
        margin: 0.75rem 0;
    }

    .field-group {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .form-label {
        font-size: 0.8rem;
    }

    .form-control, .form-select {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
        min-height: 34px;
    }

    .form-check-input {
        width: 1rem;
        height: 1rem;
    }

    .form-check-label {
        font-size: 0.8rem;
    }

    .grid-2, .grid-3, .grid-4 {
        gap: 0.5rem;
    }

    .mb-section {
        margin-bottom: 0.5rem;
    }

    .navigation-buttons {
        padding: 0.65rem 1.5rem !important;
    }

    .btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.8rem;
    }

    /* Extra compact SAMPLE table */
    .sample-letter {
        width: 35px;
        min-width: 35px;
        font-size: 0.85rem;
        padding: 0.25rem;
    }

    .sample-input {
        padding: 0.2rem 0.35rem;
    }

    .sample-input .form-control {
        padding: 0.25rem 0.35rem;
        min-height: 28px;
        font-size: 0.8rem;
    }

    /* Extra compact Stroke Assessment Card */
    .stroke-assessment-card {
        margin: 0.5rem 0;
    }

    .stroke-assessment-header {
        padding: 0.5rem 0.75rem;
        gap: 0.625rem;
    }

    .stroke-header-icon {
        width: 30px;
        height: 30px;
    }

    .stroke-header-icon i {
        font-size: 0.95rem;
    }

    .stroke-header-text h6 {
        font-size: 0.8rem;
    }

    .stroke-header-text span {
        font-size: 0.7rem;
    }

    .fast-section,
    .sample-section {
        padding: 0.75rem;
    }

    .fast-section-title,
    .sample-section-title {
        margin-bottom: 0.625rem;
    }

    .fast-badge,
    .sample-badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.65rem;
    }

    .fast-subtitle,
    .sample-subtitle {
        font-size: 0.7rem;
    }

    .fast-grid {
        gap: 0.4rem;
    }

    .fast-item {
        padding: 0.4rem 0.5rem;
        gap: 0.5rem;
    }

    .fast-item-letter {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        border-radius: 6px;
    }

    .fast-item-label {
        font-size: 0.75rem;
    }

    .toggle-group {
        padding: 2px;
    }

    .toggle-btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }

    .sample-letter-modern {
        width: 32px;
        min-width: 32px;
        font-size: 0.75rem;
    }

    .sample-input-modern .form-control {
        padding: 0.3rem 0.5rem;
        min-height: 28px;
        font-size: 0.75rem;
    }
}

/* ========================================
   PATIENT DOCUMENTATION - Corporate Design
   ======================================== */
.patient-documentation-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e9f0;
    overflow: hidden;
    margin: 1rem 0;
}

.patient-doc-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.patient-doc-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.patient-doc-icon i {
    font-size: 1.25rem;
    color: #ffffff;
}

.patient-doc-title h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.patient-doc-title span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

.patient-doc-body,
.endorsement-doc-body {
    padding: 1.5rem;
}

/* ========================================
   ENDORSEMENT ATTACHMENT - Corporate Design
   ======================================== */
.endorsement-attachment-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e9f0;
    overflow: hidden;
    margin: 1rem 0;
}

.endorsement-doc-header {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.endorsement-doc-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.endorsement-doc-icon i {
    font-size: 1.25rem;
    color: #ffffff;
}

.endorsement-doc-title h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.endorsement-doc-title span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
}

/* Upload Controls */
.patient-doc-controls,
.endorsement-doc-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.upload-method-btn {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.upload-method-btn:hover {
    background: #f0f7ff;
    border-color: #0066cc;
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.upload-method-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-method-icon.camera {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

.upload-method-icon.file {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.upload-method-icon i {
    font-size: 1.4rem;
    color: #ffffff;
}

.upload-method-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.upload-method-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e3a5f;
}

.upload-method-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.upload-divider {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 0.5rem;
}

.hidden-file-input {
    display: none;
}

/* Camera Container */
.patient-camera-container,
.endorsement-camera-container {
    display: none;
    margin-top: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e9f0;
}

.camera-viewport {
    background: #000;
    position: relative;
}

.camera-viewport video {
    width: 100%;
    max-height: 350px;
    display: block;
    object-fit: cover;
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-top: 1px solid #e5e9f0;
}

.camera-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid;
}

.camera-btn.capture {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border-color: #28a745;
    color: #ffffff;
}

.camera-btn.capture:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.camera-btn.capture i {
    font-size: 1.1rem;
}

.camera-btn.close-cam {
    background: #ffffff;
    border-color: #6c757d;
    color: #6c757d;
}

.camera-btn.close-cam:hover {
    background: #6c757d;
    color: #ffffff;
}

/* Preview Container */
.patient-preview-container,
.endorsement-preview-container {
    display: none;
    margin-top: 1.5rem;
}

.preview-card {
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 320px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.preview-image-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.preview-image-wrapper img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.preview-image-wrapper:hover img {
    transform: scale(1.03);
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-image-wrapper:hover .preview-overlay {
    opacity: 1;
}

.preview-overlay i {
    font-size: 2rem;
    color: #ffffff;
}

.preview-overlay span {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 500;
}

.preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border-top: 1px solid #e5e9f0;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #28a745;
}

.preview-label i {
    font-size: 1rem;
}

.remove-preview-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-preview-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

/* Upload Error */
.patient-upload-error,
.endorsement-upload-error {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc3545;
    font-size: 0.875rem;
    align-items: center;
    gap: 0.5rem;
}

.patient-upload-error i {
    font-size: 1.1rem;
}

/* Image Preview Modal */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    padding: 2rem;
    align-items: center;
    justify-content: center;
}

.image-preview-modal.active {
    display: flex;
}

.modal-content-custom {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content-custom img {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    object-fit: contain;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.modal-close-btn i {
    font-size: 1.25rem;
    color: #1e3a5f;
}

/* Responsive Patient & Endorsement Documentation */
@media (max-width: 768px) {
    .patient-doc-controls,
    .endorsement-doc-controls {
        flex-direction: column;
    }

    .upload-method-btn {
        width: 100%;
        min-width: auto;
    }

    .upload-divider {
        padding: 0.5rem 0;
    }

    .upload-divider::before,
    .upload-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #d1d5db;
        margin: 0 0.75rem;
    }

    .preview-card {
        max-width: 100%;
    }

    .camera-viewport video {
        max-height: 280px;
    }

    .patient-doc-header,
    .endorsement-doc-header {
        padding: 0.875rem 1rem;
    }

    .patient-doc-icon,
    .endorsement-doc-icon {
        width: 36px;
        height: 36px;
    }

    .patient-doc-icon i,
    .endorsement-doc-icon i {
        font-size: 1.1rem;
    }

    .patient-doc-title h6,
    .endorsement-doc-title h6 {
        font-size: 0.9rem;
    }

    .patient-doc-title span,
    .endorsement-doc-title span {
        font-size: 0.75rem;
    }

    .patient-doc-body,
    .endorsement-doc-body {
        padding: 1rem;
    }
}

/* Desktop Compact */
@media (min-width: 1024px) {
    .patient-documentation-card,
    .endorsement-attachment-card {
        margin: 0.75rem 0;
    }

    .patient-doc-header,
    .endorsement-doc-header {
        padding: 0.75rem 1rem;
    }

    .patient-doc-icon,
    .endorsement-doc-icon {
        width: 36px;
        height: 36px;
    }

    .patient-doc-icon i,
    .endorsement-doc-icon i {
        font-size: 1.1rem;
    }

    .patient-doc-title h6,
    .endorsement-doc-title h6 {
        font-size: 0.9rem;
    }

    .patient-doc-title span,
    .endorsement-doc-title span {
        font-size: 0.75rem;
    }

    .patient-doc-body,
    .endorsement-doc-body {
        padding: 1.25rem;
    }

    .upload-method-btn {
        padding: 0.875rem 1rem;
    }

    .upload-method-icon {
        width: 40px;
        height: 40px;
    }

    .upload-method-icon i {
        font-size: 1.2rem;
    }

    .upload-method-title {
        font-size: 0.875rem;
    }

    .upload-method-desc {
        font-size: 0.75rem;
    }

    .preview-card {
        max-width: 280px;
    }

    .preview-image-wrapper img {
        height: 180px;
    }
}

/* Laptop screens */
@media (min-width: 1024px) and (max-height: 800px) {
    .patient-documentation-card,
    .endorsement-attachment-card {
        margin: 0.5rem 0;
    }

    .patient-doc-header,
    .endorsement-doc-header {
        padding: 0.625rem 0.875rem;
        gap: 0.625rem;
    }

    .patient-doc-icon,
    .endorsement-doc-icon {
        width: 32px;
        height: 32px;
    }

    .patient-doc-icon i,
    .endorsement-doc-icon i {
        font-size: 1rem;
    }

    .patient-doc-title h6,
    .endorsement-doc-title h6 {
        font-size: 0.85rem;
    }

    .patient-doc-title span,
    .endorsement-doc-title span {
        font-size: 0.7rem;
    }

    .patient-doc-body,
    .endorsement-doc-body {
        padding: 1rem;
    }

    .upload-method-btn {
        padding: 0.75rem 0.875rem;
        min-width: 180px;
    }

    .upload-method-icon {
        width: 36px;
        height: 36px;
    }

    .upload-method-icon i {
        font-size: 1.1rem;
    }

    .upload-method-title {
        font-size: 0.8rem;
    }

    .upload-method-desc {
        font-size: 0.7rem;
    }

    .camera-viewport video {
        max-height: 280px;
    }

    .preview-card {
        max-width: 240px;
    }

    .preview-image-wrapper img {
        height: 160px;
    }

    .preview-actions {
        padding: 0.625rem 0.875rem;
    }

    .preview-label {
        font-size: 0.8rem;
    }

    .remove-preview-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Section Divider */
.doc-section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-section-divider::before,
.doc-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #e5e9f0, #d1d5db, #e5e9f0);
}

.doc-section-divider.with-icon {
    gap: 0.75rem;
}

.doc-section-divider i {
    font-size: 0.85rem;
    color: #9ca3af;
}

.doc-section-divider span {
    white-space: nowrap;
}

/* Existing Document Display (Edit Page) */
.existing-patient-doc {
    margin-bottom: 0;
    padding-bottom: 0;
}

.existing-doc-label,
.new-photo-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 0.75rem;
}

.existing-doc-label i {
    color: #0066cc;
}

.new-photo-label {
    color: #28a745;
    margin-bottom: 0.75rem;
}

.new-photo-label i {
    color: #28a745;
}

.view-original-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #0066cc;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.view-original-btn:hover {
    background: #0066cc;
    border-color: #0066cc;
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 768px) {
    .existing-patient-doc {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .existing-doc-label,
    .replace-photo-label,
    .new-photo-label {
        font-size: 0.8rem;
    }
}

@media (min-width: 1024px) {
    .existing-doc-label,
    .replace-photo-label,
    .new-photo-label {
        font-size: 0.8rem;
    }

    .view-original-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

@media print {
    body {
        overflow: visible;
        height: auto;
    }
    .form-container {
        height: auto;
    }
    .tabs-container, .navigation-buttons, .progress-container {
        display: none;
    }
    .form-body {
        overflow: visible;
        padding: 1rem;
    }
    .tab-pane {
        display: block !important;
    }

    /* Print narrative report cleanly */
    .narrative-toolbar,
    .narrative-actions {
        display: none !important;
    }

    .narrative-report-container {
        border: none;
        page-break-inside: avoid;
    }

    .narrative-content {
        padding: 0;
        font-size: 11pt;
    }

    /* Print patient documentation */
    .patient-doc-controls,
    .patient-camera-container {
        display: none !important;
    }

    .patient-documentation-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }

    .preview-overlay {
        display: none !important;
    }
}
