/* ================================================================
   UCSF Myocardial Perfusion Tool - Modernized Stylesheet
   ================================================================ */

/* CSS Variables - Heathered Blue-Gray Palette */
:root {
    /* Heathered text colors - gray with blue undertones */
    --primary-text: #3d4f6b;
    --secondary-text: #7a8399;

    /* UCSF accent colors */
    --ucsf-navy: #052049;
    --ucsf-teal: #18A3AC;
    --ucsf-teal-light: #5BC0C7;
    --ucsf-teal-hover: #159CA4;

    /* Heathered surfaces - white/gray with blue tints (not teal) */
    --background: #f8f9fc;
    --surface: #eff2f7;
    --surface-hover: #e3e8f0;
    --border: #ccd3e0;
    --border-light: #dee4ed;
    --white: #ffffff;

    --shadow-light: 0 2px 8px rgba(5, 32, 73, 0.06);
    --shadow-medium: 0 4px 16px rgba(5, 32, 73, 0.12);
    --font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --transition-speed: 0.3s;
}

/* ================================================================
   Global Styles
   ================================================================ */

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    background-color: var(--background);
    color: var(--primary-text);
    line-height: 1.47059;
}

header {
    background-color: var(--ucsf-navy);
    padding: 1.5rem 0;
    color: var(--white);
    margin-bottom: 32px;
    text-align: center;
    box-shadow: var(--shadow-light);
    border: none;
    border-radius: 0;
}

header h1 {
    color: var(--white) !important;
    font-size: 1.8rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

header h1 .highlight {
    color: var(--ucsf-teal);
    font-weight: 400;
}

h1, h2, h3, h4 {
    color: var(--primary-text);
    font-weight: 600;
}

h1 {
    font-size: 2em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.75em;
    margin-bottom: 0.75em;
}

h3 {
    font-size: 1.5em;
    margin-bottom: 0.75em;
}

h4 {
    font-size: 1.25em;
    margin-bottom: 0.75em;
}

/* ================================================================
   Tab Navigation
   ================================================================ */

.tab-container {
    width: 100%;
    margin-bottom: 20px;
}

.tab-header {
    display: flex;
    background-color: var(--white);
    border: 1px solid #E0E0E0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.tab-btn {
    padding: 16px 24px;
    background-color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    transition: all var(--transition-speed) ease;
    color: var(--secondary-text);
    border-right: 1px solid var(--border);
    position: relative;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background-color: var(--surface);
    color: var(--primary-text);
}

.tab-btn.active {
    background-color: var(--primary-text);
    color: var(--white);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--ucsf-teal);
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #E0E0E0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background-color: var(--white);
    box-shadow: var(--shadow-light);
}

.tab-content.active {
    display: block;
}

/* ================================================================
   Common UI Elements
   ================================================================ */

.box-container {
    background: var(--white);
    border: 1px solid #E0E0E0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
}

button {
    background-color: var(--ucsf-teal);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 10px 0;
    transition: all var(--transition-speed) ease;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
}

button:hover {
    background-color: var(--ucsf-teal-hover);
    transform: none;
    box-shadow: none;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: var(--border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.copy-btn {
    background-color: var(--ucsf-teal);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    margin: 5px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    font-weight: 600;
    box-shadow: var(--shadow-light);
}

.copy-btn:hover {
    background-color: #159BA3;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* ================================================================
   TAB 1 - Muse Text Input Styles
   ================================================================ */

textarea {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: var(--font-family);
    font-size: 14px;
    transition: all var(--transition-speed) ease;
}

textarea:focus {
    outline: none;
    border-color: var(--ucsf-teal);
    box-shadow: 0 0 0 3px rgba(24, 163, 172, 0.1);
}

.hemodynamic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hemodynamic-container {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
    box-shadow: var(--shadow-light);
}

.hemodynamic-title {
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary-text);
    font-size: 1.1em;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-text);
    font-weight: 500;
    font-size: 14px;
}

input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    box-sizing: border-box;
    transition: all var(--transition-speed) ease;
    font-family: var(--font-family);
    font-size: 14px;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--ucsf-teal);
    box-shadow: 0 0 0 3px rgba(24, 163, 172, 0.1);
}

/* RPP Display Styles */
.rpp-value {
    font-weight: 600;
    color: var(--ucsf-teal);
}

.muse-text-container {
    max-height: 150px;
    overflow-y: auto;
    background: var(--surface);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-text);
    font-size: 0.9em;
    margin-top: 10px;
}

.rpp-summary {
    margin-top: 10px;
    padding: 10px;
    background-color: #E8F5F6;
    border-radius: 6px;
    font-weight: 600;
    border-left: 3px solid var(--ucsf-teal);
}

.hemodynamic-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #E0E0E0;
}

.hemodynamic-label {
    font-weight: 600;
    flex: 1;
    color: var(--primary-text);
}

.hemodynamic-value {
    flex: 1;
    text-align: center;
    color: var(--secondary-text);
}

.hemodynamic-table {
    background: var(--surface);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

/* ================================================================
   PowerScribe-style Report Styles
   ================================================================ */

.powerscribe-report {
    background: var(--white);
    padding: 25px;
    border: 2px solid var(--primary-text);
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    margin-top: 20px;
}

.powerscribe-instructions {
    background: #E8F5F6;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid var(--ucsf-teal);
}

.powerscribe-instructions p {
    margin: 0;
    font-size: 0.95em;
    color: var(--secondary-text);
}

.report-content {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: var(--primary-text);
    background: var(--surface);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.report-content h4 {
    color: var(--primary-text);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    text-decoration: underline;
}

.report-content p {
    margin: 10px 0;
}

.editable-field {
    background: #FFF9C4;
    padding: 2px 6px;
    border: 1px solid #FBC02D;
    border-radius: 3px;
    cursor: pointer;
    display: inline-block;
    min-width: 30px;
    text-align: center;
    transition: all 0.2s ease;
    outline: none;
}

.editable-field:hover {
    background: #FFF59D;
    border-color: #F9A825;
    box-shadow: 0 0 5px rgba(251, 192, 45, 0.3);
}

.editable-field:focus,
.editable-field.editing {
    background: var(--white);
    border: 2px solid var(--ucsf-teal);
    box-shadow: 0 0 8px rgba(24, 163, 172, 0.4);
    padding: 1px 5px;
}

.editable-field.numeric {
    font-weight: 600;
    color: var(--primary-text);
    min-width: 50px;
}

.editable-field.error {
    background: #FFEBEE;
    border-color: #E53935;
    color: #C62828;
}

.editable-field.dropdown {
    min-width: 100px;
}

.calculated-field {
    background: #E8F5F6;
    padding: 2px 6px;
    border: 1px solid var(--ucsf-teal);
    border-radius: 3px;
    display: inline-block;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-text);
}

.hemodynamics-block {
    background: var(--surface);
    padding: 15px;
    border-left: 3px solid var(--primary-text);
    margin: 15px 0;
    border-radius: 6px;
}

.hemodynamics-block p {
    margin: 8px 0;
    font-size: 13px;
}

.report-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #E0E0E0;
}

.report-actions .copy-btn {
    background: var(--primary-text);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow-medium);
}

.report-actions .copy-btn:hover {
    background: var(--ucsf-teal);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Tab navigation for editable fields */
.editable-field[tabindex]:focus {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Highlighting animation for updated values */
.value-updated {
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% {
        background-color: var(--ucsf-teal);
        color: var(--white);
    }
    100% {
        background-color: #E8F5F6;
        color: var(--primary-text);
    }
}

/* ================================================================
   TAB 2 - MFR Extractor Styles
   ================================================================ */

.upload-area {
    border: 3px dashed var(--primary-text);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: #F8F9FF;
    transition: all var(--transition-speed) ease;
    margin-bottom: 20px;
    position: relative;
}

.upload-area:hover {
    background: var(--surface);
    border-color: var(--ucsf-teal);
}

.upload-area.dragover {
    background: #E8F5F6;
    transform: scale(1.02);
    border-color: var(--ucsf-teal);
}

.upload-icon {
    font-size: 48px;
    color: var(--primary-text);
    margin-bottom: 10px;
}

.upload-text {
    color: var(--secondary-text);
    font-size: 16px;
    margin: 10px 0;
}

.upload-instructions {
    background: #E8F5F6;
    border: 1px solid var(--ucsf-teal);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.upload-instructions h4 {
    margin-top: 0;
    color: var(--primary-text);
}

.upload-instructions ul {
    margin: 10px 0;
    padding-left: 25px;
}

.upload-instructions li {
    margin: 5px 0;
}

.example-image {
    max-width: 100%;
    border: 2px solid var(--primary-text);
    border-radius: 6px;
    margin: 10px 0;
    box-shadow: var(--shadow-light);
}

.file-input {
    display: none;
}

.preview-container {
    display: none;
    margin-top: 20px;
    text-align: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
}

#extractionStatus {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
}

.success {
    background-color: #C8E6C9;
    color: #2E7D32;
    border: 1px solid #81C784;
}

.error {
    background-color: #FFCDD2;
    color: #C62828;
    border: 1px solid #EF5350;
}

.warning {
    background-color: #FFF9C4;
    color: #F57F17;
    border: 1px solid #FBC02D;
}

.progress {
    background-color: #E8F5F6;
    color: var(--primary-text);
    border: 1px solid var(--ucsf-teal);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    border: 1px solid #E0E0E0;
    padding: 10px;
    text-align: left;
}

th {
    background-color: var(--primary-text);
    color: var(--white);
    font-weight: 600;
}

.value-cell {
    position: relative;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    cursor: text;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.value-cell[contenteditable="true"] {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 8px;
    border-radius: 3px;
}

.value-cell[contenteditable="true"]:hover {
    background-color: #E8F5F6;
    transform: scale(1.05);
    box-shadow: var(--shadow-light);
}

.value-cell.editing {
    background-color: #E8F5F6;
    box-shadow: 0 0 0 2px var(--ucsf-teal);
    outline: none;
}

.value-cell[contenteditable="true"]:focus {
    outline: none;
    background-color: #E8F5F6;
    box-shadow: 0 0 0 2px var(--ucsf-teal);
}

.value-cell.clean {
    background: #C8E6C9;
    color: #2E7D32;
}

.value-cell.auto-fixed {
    background: #FFE0B2;
    color: #E65100;
}

.value-cell.needs-review {
    background: #FFCDD2;
    color: #C62828;
    border: 2px solid #E53935;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-text);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    z-index: 1000;
    margin-bottom: 5px;
}

.value-cell:hover .tooltip {
    opacity: 1;
}

.validation-legend {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--white);
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #E0E0E0;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.editing-instructions {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: var(--surface);
    border-left: 3px solid var(--primary-text);
    font-size: 0.9em;
    color: var(--secondary-text);
    border-radius: 0 6px 6px 0;
}

.loader {
    border: 3px solid var(--surface);
    border-top: 3px solid var(--primary-text);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================================================
   TAB 3 - Perfusion Model Styles
   ================================================================ */

.wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.model-container {
    background: var(--white);
    padding: 10px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    max-width: 300px;
    width: 100%;
    text-align: center;
}

.model-container h3 {
    margin-top: 0;
}

.container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.segment {
    cursor: pointer;
    stroke: #000;
    stroke-width: 2;
    fill: #ff6666;
    transition: fill var(--transition-speed) ease, stroke-width 0.2s ease;
}

.segment:hover {
    stroke-width: 3;
    filter: brightness(0.9);
}

text {
    font-size: 16px;
    fill: #000;
    pointer-events: none;
}

.top-section {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.instructions {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.instructions h2 {
    margin-top: 0;
}

.legend-container {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    max-width: 1200px;
    margin: 20px auto;
}

.legend-container h2 {
    margin-top: 0;
}

#legendContainer {
    width: 300px;
    height: 300px;
    float: left;
    margin-right: 20px;
}

.legend-description {
    overflow: hidden;
}

.legend-description table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.legend-description th,
.legend-description td {
    padding: 10px;
    border: 1px solid #ccd3e0;
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

.legend-description th {
    background-color: var(--surface);
    color: var(--primary-text);
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    letter-spacing: 0.3px;
}

.legend-description td {
    line-height: 1.8;
}

.legend-description td strong {
    font-weight: 700;
    color: var(--primary-text);
    font-size: 15px;
}

.legend-segment {
    stroke: #000;
    stroke-width: 2;
    pointer-events: none;
}

.legend-segment:hover {
    stroke-width: 2;
    filter: none;
}

.territory-lad { color: #E53935; }
.territory-lcx { color: #1E88E5; }
.territory-rca { color: #43A047; }

.guidelines-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 0 auto 20px;
    max-width: 1200px;
    flex-wrap: wrap;
}

.guideline-box {
    flex: 1;
    background: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    min-width: 300px;
}

.guideline-box ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
    font-size: 0.95em;
    line-height: 1.4;
}

.guideline-box h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-text);
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 20px;
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.option-group h3 {
    margin-bottom: 10px;
    color: var(--primary-text);
    text-align: center;
}

.option {
    display: inline-block;
    margin: 3px;
    padding: 10px 18px;
    border: 2px solid var(--border);
    background-color: var(--white);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
    color: var(--primary-text);
    font-weight: 500;
}

.option:hover:not(.disabled):not(.selected) {
    background-color: var(--surface-hover);
    border-color: var(--ucsf-teal);
    color: var(--primary-text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.option.selected {
    background-color: var(--ucsf-teal);
    border-color: var(--ucsf-teal);
    color: var(--white);
    box-shadow: var(--shadow-light);
}

.option.selected:hover {
    background-color: var(--ucsf-teal);
    border-color: var(--ucsf-teal);
    color: var(--white);
    transform: none;
}

.option.disabled {
    background-color: #E0E0E0;
    border-color: #CCCCCC;
    color: #999999;
    cursor: not-allowed;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.report-btn {
    padding: 12px 24px;
    background-color: var(--primary-text);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: var(--shadow-light);
}

.report-btn:hover:not(:disabled) {
    background-color: var(--ucsf-teal);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.report-btn:disabled {
    background-color: #CCCCCC;
    cursor: not-allowed;
}

.results {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    line-height: 1.6;
    border: 1px solid #E0E0E0;
}

.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.report-section h3 {
    font-size: 1.2em;
    border-bottom: 2px solid var(--primary-text);
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-align: left;
}

.findings-subsection {
    padding-left: 15px;
    margin-bottom: 10px;
    border-left: 3px solid #E0E0E0;
}

#impressionText {
    margin-top: 10px;
    font-size: 0.95em;
    line-height: 1.4;
}

.copy-success {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--ucsf-teal);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 6px;
    display: none;
    animation: fadeInOut 2s ease-in-out;
    box-shadow: var(--shadow-medium);
    font-weight: 600;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* ================================================================
   Debug Mode Toggle
   ================================================================ */

#debugToggleContainer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #E0E0E0;
    z-index: 1000;
    box-shadow: var(--shadow-light);
}

/* Debug Panel Styles */
.debug-tab-btn {
    padding: 10px 15px;
    background-color: var(--surface);
    border: none;
    cursor: pointer;
    margin-right: 2px;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.debug-tab-btn.active {
    background-color: var(--primary-text);
    color: var(--white);
}

.debug-tab-content {
    display: none;
    padding: 15px;
    border: 1px solid #E0E0E0;
    border-radius: 0 0 6px 6px;
    margin-bottom: 20px;
    background-color: var(--white);
}

.debug-tab-content.active {
    display: block;
}

table.debug-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table.debug-table th, table.debug-table td {
    border: 1px solid #E0E0E0;
    padding: 8px;
    text-align: left;
}

table.debug-table th {
    background-color: var(--primary-text);
    color: var(--white);
    font-weight: 600;
}

.validation-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-left: 3px solid #E53935;
    background-color: var(--surface);
    border-radius: 0 6px 6px 0;
}

.modification-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-text);
    background-color: var(--surface);
    border-radius: 0 6px 6px 0;
}

/* ================================================================
   Responsive Design
   ================================================================ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .tab-btn {
        padding: 10px;
        font-size: 14px;
    }

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

    .wrapper {
        flex-direction: column;
        align-items: center;
    }

    table, th, td {
        font-size: 13px;
        padding: 6px;
    }

    .top-section {
        flex-direction: column;
    }

    .guidelines-row {
        flex-direction: column;
    }

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

    .report-actions {
        flex-direction: column;
        gap: 10px;
    }

    .button-container {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.2em;
    }

    button, .copy-btn {
        width: 100%;
        margin: 5px 0;
    }

    .box-container {
        padding: 15px;
    }
}
