/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f8f9fa;
    line-height: 1.5;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Dark Blue Bar on Far Left - Removed for unified gray background */
.app-container::before {
    display: none;
}

/* Header - Removed, controls moved to step-header */

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: 600;
    color: #000;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

#control-name {
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: #e0e0e0;
    color: #666;
}

.status-badge.draft {
    background: #e0e0e0;
    color: #666;
}

.status-badge.approved {
    background: #00AA44;
    color: white;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    margin-top: 0;
}

/* Left Panel - Stepper */
.left-panel {
    width: 320px; /* Increased from 280px to fit trash cans */
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    position: relative;
    margin-left: 8px; /* Reduced from 24px to save space */
    overflow-y: auto;
}

/* Platform Header */
.side-panel-header {
    padding: 20px 8px; /* Reduced horizontal padding from 16px to 8px */
    background: #f8f9fa;
    border-bottom: none;
}

.platform-logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
}

.platform-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.platform-title-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platform-name {
    font-size: 18px;
    font-weight: 700;
    color: #131D61;
    line-height: 1.2;
}

.platform-subtitle {
    font-size: 12px;
    color: #666;
    text-transform: none;
    line-height: 1.2;
}

/* Current Session Card */
.current-session-card {
    padding: 12px; /* Reduced from 16px */
    margin: 0 8px 16px 8px; /* Reduced horizontal margins from 16px to 8px */
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    border-top: none;
    box-shadow: none;
}

/* Divider below Current Session Card */
.current-session-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0 8px 16px 8px; /* Reduced margins to match */
    width: calc(100% - 16px); /* Updated to match new margins */
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.session-status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: #00AA44;
    color: white;
}

.session-status-badge.inactive {
    background: #999;
}

.session-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.session-name:hover {
    background: #f5f5f5;
}

.session-run-id {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    word-break: break-all;
}

.session-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
}

/* Workflow Progress Section */
.workflow-progress-section {
    padding: 0 8px 0 20px; /* More left padding to accommodate blue bar */
    margin-bottom: 16px;
    position: relative;
    overflow: visible; /* Ensure nothing is clipped */
}

.workflow-progress-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 600;
    margin-bottom: 16px;
    margin-left: -12px; /* Align title to the left */
}

.stepper {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-left: 0; /* Remove margin, will use padding on items instead */
    position: relative;
    overflow: visible;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0 16px 12px; /* Add left padding to all steps */
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    background: transparent;
}

/* Vertical connector line between steps */
.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 27px; /* Adjusted for the new padding (12px + 15px center) */
    top: 48px;
    width: 1px;
    height: calc(100% - 16px);
    background: #CCC;
    z-index: 0;
}

.step-item:hover {
    background: transparent;
}

.step-item.active {
    background: transparent;
    border-radius: 0;
    margin: 0;
    padding: 16px 0 16px 12px; /* Same padding as inactive */
    position: relative;
}

/* Light blue background for active step with blue bar on the left */
.step-item.active::before {
    content: '';
    position: absolute;
    left: 0; /* Start from the actual left edge */
    right: -16px;
    top: 0;
    bottom: 0;
    background: #E4EBF6;
    z-index: 0; /* Same level as connector lines, behind content */
    border-left: 4px solid #131D61; /* Dark blue vertical bar */
}

/* Active step connector line (continues below) */
.step-item.active:not(:last-child)::after {
    background: #131D61; /* Dark blue connector */
    left: 27px; /* Same as inactive steps */
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: #ffffff;
    color: #888;
    border: 2px solid #CCC;
    flex-shrink: 0;
    z-index: 2; /* Above the blue highlight */
    position: relative;
    box-sizing: border-box; /* Ensure border is included in size calculation */
}

.step-item.active .step-number {
    background: #1A2C59;
    color: white;
    border: 2px solid #1A2C59; /* Explicitly set border width to match inactive state */
    width: 32px; /* Explicitly maintain size */
    height: 32px; /* Explicitly maintain size */
}

.step-item.complete .step-number {
    background: #00AA44;
    color: white;
    border-color: #00AA44;
}

.stepper .step-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 0;
    position: relative;
    z-index: 2; /* Above the blue highlight */
}

.stepper .step-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    font-weight: 600;
}

.stepper .step-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    white-space: normal;
}

.step-item.active .stepper .step-label {
    color: #888;
}

.step-item.active .stepper .step-name {
    color: #1A2C59;
    font-weight: 600;
}

/* Recent Sessions Section */
.recent-sessions-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.recent-sessions-section {
    padding: 0 8px; /* Reduced from 16px */
    margin-top: auto;
    padding-bottom: 16px;
}

.recent-sessions-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 600;
    margin-bottom: 12px;
}

.recent-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-session-item {
    padding: 8px; /* Reduced from 10px 12px */
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px; /* Reduced from 12px */
}

.recent-session-item:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

.recent-session-item.active {
    background: #f5f5f5;
    border-color: #ddd;
}

.recent-session-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.recent-session-date {
    font-size: 11px;
    color: #666;
}

.recent-session-status {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.recent-session-status.completed {
    background: #e8f5e9;
    color: #00AA44;
}

.recent-session-status.in-progress {
    background: #e3f2fd;
    color: #131D61;
}

/* Center Panel - Work Area */
.center-panel {
    flex: 1;
    background: #f8f9fa;
    overflow-y: auto;
    padding: 0 24px 24px 24px;
}

/* Persistent first line: page title (left) + run info, control name, status, user (right) */
.global-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 16px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 16px;
}
.global-header-bar .page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    flex-shrink: 0;
}
.global-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.global-header-controls #run-info,
.global-header-controls #control-name {
    white-space: nowrap;
}
.global-run-info {
    font-size: 12px;
    color: #666;
}

/* Center panel step content (work area) */
.center-panel .step-content {
    display: none;
}

.center-panel .step-content.active {
    display: block;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 0;
}

.step-header .header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Step title is in global header bar; hide the duplicate main step header (first child of each step) */
.center-panel .step-content > .step-header {
    display: none;
}

/* Next button at bottom right of each step */
.step-next-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
}
.step-next-footer .step-next-btn {
    background: #131D61;
    border-color: #131D61;
    padding: 10px 24px;
}
.step-next-footer .step-next-btn:hover {
    background: #0f1849;
    border-color: #0f1849;
}
.step-next-footer-last {
    display: none;
}

/* Forms */
/* TestPlan Accordion Styles */
.testplan-accordion-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.testplan-accordion-header {
    padding: 16px 20px;
    background: #fafafa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
}

.testplan-accordion-header:hover {
    background: #f0f0f0;
}

.testplan-accordion-header.active {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.testplan-accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 18px;
    color: #333;
}

.testplan-accordion-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.testplan-accordion-chevron {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 4px;
}

.testplan-accordion-item.open .testplan-accordion-chevron {
    transform: rotate(180deg);
}

.testplan-accordion-content {
    padding: 20px;
    display: none;
    background: white;
}

.testplan-accordion-item.open .testplan-accordion-content {
    display: block;
}

.testplan-field-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: none;
}

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

.testplan-field-label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.testplan-field-value {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.testplan-field-editable {
    cursor: default;
    position: relative;
}

.testplan-field-editable.editing-mode {
    cursor: text;
}

.testplan-field-editable .testplan-field-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    min-height: 20px;
}

.testplan-field-editable.editing-mode:hover .testplan-field-text {
    color: #131D61;
}

.testplan-edit-icon {
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.testplan-field-input,
.testplan-field-textarea,
.testplan-field-select {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.testplan-field-input:focus,
.testplan-field-textarea:focus,
.testplan-field-select:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.testplan-field-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

.testplan-field-select {
    cursor: pointer;
}

.testplan-evidence-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.testplan-evidence-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.testplan-evidence-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.testplan-evidence-icon {
    font-size: 18px;
    display: none;
}

.testplan-evidence-text {
    flex: 1;
    font-size: 13px;
    color: #333;
}

.testplan-evidence-badge {
    display: none;
}

.testplan-assertion-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #0066CC;
    margin-bottom: 8px;
}

.testplan-assertion-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.testplan-assertion-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Detailed Assertion Card Styles */
.testplan-assertion-detail-card {
    padding: 0;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #131D61;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.assertion-header {
    transition: background-color 0.2s;
}

.assertion-header:hover {
    background-color: #f8f9fa;
}

.assertion-chevron {
    transition: transform 0.2s;
    user-select: none;
}

/* Delete buttons - red × with transparent background */
.btn-delete-evidence,
.btn-delete-assertion {
    background: transparent !important;
    color: #CC3300 !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    font-size: 18px !important;
    font-weight: bold !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: opacity 0.2s;
}

.btn-delete-evidence:hover,
.btn-delete-assertion:hover {
    opacity: 0.7;
}

.btn-delete-evidence:active,
.btn-delete-assertion:active {
    opacity: 0.5;
}

.assertion-name-input {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    border: none;
    padding: 0;
    background: transparent;
}

.assertion-name-input[readonly] {
    cursor: default;
}

.assertion-name-input:not([readonly]) {
    cursor: text;
}

.assertion-name-input:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.assertion-field-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    display: block;
    margin-bottom: 2px;
}

.assertion-textarea {
    font-size: 13px;
    min-height: 40px;
    border: none;
    padding: 4px 0;
    resize: vertical;
    background: transparent;
    width: 100%;
}

.assertion-textarea[readonly] {
    cursor: default;
}

.assertion-textarea:not([readonly]) {
    cursor: text;
}

.assertion-textarea:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.assertion-list-textarea {
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    border: none;
    padding: 4px 0;
    resize: vertical;
    line-height: 1.4;
    background: transparent;
    width: 100%;
}

.assertion-list-textarea[readonly] {
    cursor: default;
}

.assertion-list-textarea:not([readonly]) {
    cursor: text;
}

.assertion-list-textarea:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.assertion-info-box {
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.assertion-info-label {
    font-size: 11px;
    font-weight: 500;
    color: #666;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.assertion-select {
    font-size: 13px;
    border: none;
    background: transparent;
    padding: 4px 0;
    width: 100%;
    font-weight: 500;
}

.assertion-select[disabled] {
    cursor: default;
    opacity: 1;
    color: inherit;
}

.assertion-select:not([disabled]) {
    cursor: pointer;
}

.assertion-select:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

.assertion-section-header {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.assertion-testing-method {
    margin-bottom: 8px;
    padding: 8px;
    background: #e8f4f8;
    border-radius: 4px;
    border-left: 3px solid #131D61;
}

.form-section {
    margin-bottom: 32px;
    padding: 24px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 0;
    padding: 16px 20px;
    background: #fafafa;
    color: #000;
    border-radius: 8px 8px 0 0;
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
}

/* Form Section Headers (matching accordion style) */
.form-section-header {
    padding: 16px 20px;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -24px -24px 20px -24px;
    border-radius: 8px 8px 0 0;
    user-select: none;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 18px;
    color: #000;
}

.form-section-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.form-section-chevron {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

/* Collapsible sections on Sampling & Population page */
.collapsible-section .form-section-header {
    cursor: pointer;
}
.collapsible-section.collapsed .form-section-chevron {
    transform: rotate(-90deg); /* ▼ → ▶ when collapsed */
}

/* When any form-section is collapsed: no white space below header */
.form-section.collapsed {
    padding-bottom: 0;
}
.form-section.collapsed .form-section-header {
    margin-bottom: 0;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
}

label.required::after {
    content: " *";
    color: #cc0000;
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.char-count {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

.multi-select {
    position: relative;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #0066CC;
    border-radius: 16px;
    font-size: 12px;
    gap: 6px;
}

.tag .remove {
    cursor: pointer;
    font-weight: bold;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #0052a3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #131D61;
    border-bottom-color: #131D61;
}

.tab-content {
    display: none;
}

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

/* Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
}

.upload-area:hover {
    border-color: #ddd;
    background: #f5f5f5;
}

/* Modern Minimalist Upload Area */
.upload-area-modern {
    border: 2px dashed #131D61;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area-modern:hover {
    background: #f5f7fa;
    border-color: #0f1849;
}

.upload-area-modern.dragover {
    background: #f0f4ff;
    border-color: #131D61;
    border-style: solid;
}

.upload-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Approval Gate */
.approval-gate {
    margin-top: 32px;
    padding: 24px;
    background: #fff3cd;
    border-radius: 8px;
    text-align: center;
}

/* Right Panel - Context */
.right-panel {
    width: 320px;
    background: #fafafa;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.right-panel.collapsed {
    width: 0;
    overflow: hidden;
}

.context-header {
    padding: 16px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.context-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.context-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.context-section {
    margin-bottom: 24px;
}

.context-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #666;
}

/* Procedure Versions */
.procedure-version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
}

.procedure-version-item:hover {
    background: #eeeeee;
}

.procedure-version-info {
    flex: 1;
}

.procedure-version-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.procedure-version-meta {
    font-size: 12px;
    color: #666;
}

.procedure-version-status {
    color: #00AA44;
    font-size: 12px;
    font-weight: 500;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f5f5f5;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
}

.data-table tbody td:hover {
    background: #f5f5f5;
}

/* Upload Areas */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #ddd;
    background: #f5f5f5;
}

/* Responsive */
@media (max-width: 1200px) {
    .right-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    
    .right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
    }
}

/* Results Page Layout */
.results-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.results-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.results-side-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 480px;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Overlay Mode - Large centered view */
.results-side-panel.overlay-mode {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1400px;
    top: 5%;
    height: 90%;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* Backdrop for overlay mode */
.results-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
}

.results-overlay-backdrop.active {
    display: block;
}

.side-panel-header {
    padding: 20px 24px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    flex-shrink: 0;
}

.side-panel-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.side-panel-edit-btn {
    background: white;
    border: 1px solid #ddd;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 8px;
}
.side-panel-edit-btn:hover {
    background: #f5f5f5;
    border-color: #131D61;
    color: #131D61;
}

.panel-view-toggle {
    background: white;
    border: 1px solid #ddd;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.panel-view-toggle:hover {
    background: #f5f5f5;
    border-color: #131D61;
    color: #131D61;
}

.side-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.side-panel-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.side-panel-close:hover {
    background: #e0e0e0;
    color: #000;
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Two-column layout for overlay mode */
.results-side-panel.overlay-mode .side-panel-content {
    padding: 0;
}

.overlay-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.overlay-left-column {
    padding: 32px;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
}

.overlay-right-column {
    padding: 32px;
    overflow-y: auto;
    background: #fafafa;
}

/* Compact mode uses single column */
.results-side-panel:not(.overlay-mode) .overlay-content-wrapper {
    display: block;
}

.results-side-panel:not(.overlay-mode) .overlay-left-column,
.results-side-panel:not(.overlay-mode) .overlay-right-column {
    padding: 0;
    border: none;
    background: transparent;
}

.results-side-panel:not(.overlay-mode) .overlay-right-column {
    margin-top: 20px;
}

.side-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    background: #fafafa;
}

.side-panel-footer-nav {
    display: flex;
    gap: 12px;
    flex: 1;
}

.side-panel-footer-edit {
    display: flex;
    gap: 12px;
    flex: 1;
}

.side-panel-footer-edit .nav-btn.btn-primary {
    background: #131D61;
    border-color: #131D61;
    color: white;
}

.side-panel-footer-edit .nav-btn.btn-primary:hover {
    background: #1a2570;
    border-color: #1a2570;
}

.nav-btn {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #131D61;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn-next {
    background: #131D61;
    color: white;
    border-color: #131D61;
}

.nav-btn-next:hover:not(:disabled) {
    background: #0f1849;
    border-color: #0f1849;
}

/* Table cell highlighting */
.result-cell-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.result-cell-clickable:hover {
    background-color: #f5f5f5 !important;
}

.result-cell-selected {
    background-color: #f5f5f5 !important;
    border-left: 3px solid #131D61 !important;
}

/* Individual Result Display in Side Panel */
.individual-result {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Larger font sizes for overlay mode */
.results-side-panel.overlay-mode .result-assertion-name {
    font-size: 22px;
}

.results-side-panel.overlay-mode .result-details-section h5 {
    font-size: 16px;
}

.results-side-panel.overlay-mode .result-details-content {
    font-size: 15px;
}

.result-sample-info {
    padding: 16px;
    background: #f5f5f5;
    border-radius: 6px;
}

.result-sample-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.result-sample-id {
    font-size: 12px;
    color: #666;
}

.result-assertion-section {
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.result-assertion-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #000;
}

.result-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.result-status-badge.pass {
    background: #e8f5e9;
    color: #00AA44;
}

.result-status-badge.fail {
    background: #ffebee;
    color: #CC3300;
}

.result-status-badge.suggest-pass {
    background: #e8f5e9;
    color: #00AA44;
}

.result-status-badge.suggest-fail {
    background: #ffebee;
    color: #CC3300;
}

.result-status-badge.needs-review {
    background: #fff8e1;
    color: #FF9900;
}

.result-status-badge.not-applicable {
    background: #f3e8ff;
    color: #7c3aed;
}

.result-status-badge.insufficient {
    background: #e0e7ff;
    color: #4338ca;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.result-action-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.result-action-btn.pass {
    background: #00AA44;
    color: white;
}

.result-action-btn.pass:hover {
    background: #008833;
}

.result-action-btn.fail {
    background: #CC3300;
    color: white;
}

.result-action-btn.fail:hover {
    background: #aa2200;
}

.result-action-btn.na {
    background: #999;
    color: white;
}

.result-action-btn.na:hover {
    background: #777;
}

.result-details-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.result-details-section h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-details-content {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}

.result-evidence-file {
    margin-top: 16px;
    padding: 12px;
    background: #fff8e1;
    border-left: 3px solid #FF9900;
    border-radius: 4px;
}

/* Evidence styling in overlay mode right column */
.overlay-right-column .result-evidence-file {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #FF9900;
    padding: 16px;
}

.result-evidence-file-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.result-evidence-preview {
    margin-top: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    padding: 8px;
    min-height: 200px;
    position: relative;
    overflow: auto;
}

/* Larger evidence preview in overlay mode */
.results-side-panel.overlay-mode .result-evidence-preview {
    min-height: 400px;
}
