* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #F7F7F7;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    font-weight: 400;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #E0E0E0;
    padding: 48px;
    width: 100%;
    text-align: center;
    box-shadow: none;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9em;
    font-weight: 300;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 1.6em;
    font-weight: 400;
    color: #000000;
    margin: 0 0 12px 0;
    letter-spacing: -0.025em;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.login-header p {
    color: #000000;
    font-size: 0.85em;
    margin: 0;
    font-weight: 300;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #E0E0E0;
    border-radius: 3px;
    font-size: 0.95em;
    font-family: inherit;
    background: white;
    transition: all 0.2s ease;
    color: #333333;
}

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

.login-input::placeholder {
    color: #A0A0A0;
}

.login-btn {
    background: #0066CC;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 3px;
    font-size: 1em;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    background: #0052A3;
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: #CC0000;
    font-size: 0.9em;
    margin-top: 10px;
    display: none;
}

.login-error.show {
    display: block;
}

.header {
    text-align: left;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 1.6em;
    font-weight: 400;
    color: #000000;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

/* Navigation Bar Styles */
.nav-container {
    display: flex;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px;
    gap: 20px;
    align-items: flex-start;
}

.nav-sidebar {
    width: 200px !important;
    min-width: 200px !important;
    flex-shrink: 0 !important;
    border-radius: 8px;
    padding: 8px;
    height: fit-content;
    position: sticky;
    top: 0;
    margin-top: 0;
    align-self: flex-start;
}

/* Content wrapper in flex layout */
.content-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

/* Ensure main-content div aligns with navigation sidebar */
.main-content {
    margin-top: 0;
}

/* Ensure the first nav-item (Welcome) aligns with main-content */
.nav-sidebar .nav-item:first-child {
    margin-top: 0;
}

/* Force perfect alignment between navigation sidebar and main-content */
.nav-sidebar {
    align-self: flex-start;
}

/* Ensure content wrapper starts at the same level as navigation sidebar */
.content-wrapper {
    align-self: flex-start;
}

.nav-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    text-decoration: none;
    color: #666;
    font-size: 0.9em;
    font-weight: 400;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: #E8E8E8;
    color: #333;
}

.nav-item.active {
    background: #E8E8E8;
    color: black;
    font-weight: 500;
}

.nav-item.disabled {
    color: #CCC;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-item.completed {
    color: #4CAF50;
}

.nav-item.completed:hover {
    background: #E8F5E8;
    color: #2E7D32;
}

.content-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.main-content {
    background: #C4C8BE;
    border-radius: 10px;
    border: 1px solid #E0E0E0;
    padding: 48px;
    margin-bottom: 20px;
    box-shadow: none;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9em;
    font-weight: 300;
}

/* Increase width of main-content on About page */
#about-view .main-content {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-card {
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 32px;
    background: #F5F5EE;
    transition: all 0.2s ease;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9em;
    font-weight: 300;
}

.upload-card:hover {
    border-color: #0066CC;
}

.upload-card.dragover {
    border-color: #6A9BD1;
    background: #C4C8BE;
}

.upload-card h3 {
    color: #000000;
    margin-bottom: 20px;
    font-size: 1.0em;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

/* Drag and Drop Upload Styles */
.drag-drop-area {
    border: 2px dashed #E0E0E0;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FAFAFA;
    margin-top: 15px;
    position: relative;
}

.drag-drop-area:hover {
    border-color: #0066CC;
    background: #F0F8FF;
}

.drag-drop-area.dragover {
    border-color: #0066CC;
    background: #E6F3FF;
    transform: scale(1.02);
}

.file-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.7;
}

.drag-drop-text {
    color: #666;
}

.main-text {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.sub-text {
    font-size: 0.9em;
    color: #888;
}

.file-info {
    margin-top: 15px;
    padding: 15px;
    background: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E9ECEF;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.file-size {
    font-size: 0.85em;
    color: #666;
}

.file-error {
    color: #DC3545;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.file-input {
    display: none;
}

.upload-btn {
    background: #6A9BD1;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    margin: 10px 0;
    letter-spacing: -0.01em;
}

.upload-btn:hover {
    background: #0052A3;
    transform: translateY(-1px);
}

.clear-btn {
    background: #DC3545;
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    margin: 10px 0;
    letter-spacing: -0.01em;
}

.clear-btn:hover {
    background: #C82333;
    transform: translateY(-1px);
}

.clear-btn:disabled {
    background: #6C757D;
    cursor: not-allowed;
    transform: none;
}

.process-btn {
    background: #0066CC;
    color: white;
    border: 1px solid transparent; /* Prevent hover border from shifting height */
    padding: 0 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    margin: 20px 0;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.process-btn:hover {
    border: 1px solid #0066CC;
    color: #0066CC;
    background: #C4C8BE;
    transform: translateY(-1px);
}

.process-btn:disabled {
    background: #B0B0B0;
    cursor: not-allowed;
    transform: none;
}


.results-section {
    margin-top: 30px;
}

.result-card {
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 3px;
    padding: 32px;
    margin: 20px 0;
}

.result-card h4 {
    color: #000;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.json-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 15px;
    font-family: 'Roboto', 'Courier New', monospace;
    font-size: 0.9em;
    max-height: 300px;
    overflow-y: auto;
}

.required-badge {
    background: #fc8181;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.optional-badge {
    background: #a0aec0;
    color: #f3f3f3;
    padding: 2px 8px;
    border-radius: 4px; 
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.summary-display {
    background: #E6F3FF;
    border: 1px solid #0066CC;
    border-radius: 3px;
    padding: 15px;
    margin: 10px 0;
}

.analysis-display {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9em;
    font-weight: 300;
}

.analysis-content {
    margin-top: 10px;
}

.analysis-content h5 {
    color: #333333;
    margin-bottom: 12px;
    font-size: 1.0em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.analysis-text {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 3px;
    padding: 32px;
    font-family: inherit;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    color: #333333;
}

.analysis-text strong {
    color: #2c3e50;
    font-weight: bold;
}

.analysis-section {
    margin: 25px 0;
    padding: 24px;
    background: #F8F9FA;
    border-radius: 3px;
    border-left: 3px solid #0066CC;
    position: relative;
}

.analysis-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #000, transparent);
    border-radius: 1px;
}

.analysis-section:first-child {
    margin-top: 0;
}

.analysis-section:last-child {
    margin-bottom: 0;
}

.analysis-section h5 {
    color: #000;
    margin: 0 0 15px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.analysis-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E0E0E0;
}

.meta-item {
    font-size: 0.9em;
    color: #666;
    background: #E8E8E8;
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #D0D0D0;
    font-weight: 500;
}

/* Issue Box Styles */
.analysis-complete {
    text-align: left;
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
    border: none;
}

.analysis-complete h2 {
    font-size: 1.8em;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.analysis-complete p {
    font-size: 0.9em;
    font-weight: 300;
    color: #666666;
    margin: 0;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.issue-box {
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    transition: all 0.2s ease;
    position: relative;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 0.9em;
    font-weight: 300;
}

.hospital-name-style {
    font-weight: bold;
    text-transform: capitalize;
}

.issue-box.high-confidence {
    border-left: 4px solid #8B9B7B;
}

.issue-box.low-confidence {
    border-left: 4px solid #f29d80;
    background: #fff8e1;
}

.confidence-indicator {
    margin: 10px 0;
}

.confidence-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.high-confidence-badge {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.low-confidence-badge {
    background: #fff3e0;
    color: #f29d80;
    border: 1px solid #ffcc02;
}

.issue-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overcharge-badge {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.input-form-badge {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

.issue-type-indicator {
    margin: 8px 0;
}

/* .issue-box:hover {
    border-color: #A7C2CC;
} */

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.issue-title {
    font-size: 1.25em;
    font-weight: 400;
    color: #000000;
    margin: 0;
    letter-spacing: -0.01em;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.issue-amount {
    font-size: 1.15em;
    font-weight: 600;
    color: #CC0000;
    letter-spacing: -0.01em;
}

.issue-description {
    color: #000000;
    font-size: 0.95em;
    letter-spacing: .03em;
    line-height: 1.3;
    margin-bottom: 12px;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-weight: 300;
}

.issue-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-details-btn {
    background: white;
    border: 1px solid #E5E5E5;
    color: #000;
    padding: 10px 18px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 400;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.view-details-btn:hover {
    border-color: #0066CC;
}

.issue-status {
    font-size: 0.85em;
    font-weight: 400;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.status-included {
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.status-not-included {
    color: #CC0000;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #F5F5EE;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.09em;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.modal-header {
    text-align: left;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
}

.modal-header h2 {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2em;
    font-weight: 600;
    color: #333333;
    margin: 0;
    letter-spacing: -0.02em;
}

.modal-header .issue-amount {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    color: #CC0000;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    padding: 5px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.expanded-section {
    margin-bottom: 15px;
}

.expanded-section h4 {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    color: #000;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.expanded-section p {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #666;
    line-height: 1.4;
    margin: 0;
    font-size: 0.9em;
}

.evidence-item {
    background: #F7F7F7;
    border: 1px solid #E0E0E0;
    border-radius: 3px;
    padding: 12px;
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.2s ease;
}

.evidence-list {
    flex: 1;
}

.evidence-list ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.evidence-list li {
    margin: 6px 0;
    line-height: 1.3;
    color: #333;
    font-size: 0.9em;
}

.evidence-list li strong {
    color: #555;
    font-weight: 600;
}

.evidence-item:hover {
    background: #EBEBEB;
    border-color: #C4C8BE;
}

.notes-section {
    margin-top: 20px;
}

.notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 16px;
    border: 1px solid #E0E0E0;
    border-radius: 3px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9em;
    font-weight: 400;
    resize: vertical;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    line-height: 1.5;
    background: white;
    transition: all 0.2s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: #C4C8BE;
    box-shadow: 0 0 0 2px rgba(196, 200, 190, 0.2);
}

.notes-textarea::placeholder {
    color: #999;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.notes-help {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.8em;
    color: #999;
    margin-bottom: 15px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.include-btn {
    background: #0066CC;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9em;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.include-btn:hover {
    background: #0052A3;
    transform: translateY(-1px);
}

.remove-btn {
    background: white;
    color: #000;
    border: 1px solid #E5E5E5;
    padding: 12px 24px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9em;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.remove-btn:hover {
    border-color: #CC0000;
    background: #F5F5F5;
    color: #CC0000;
}

/* Page State Management */
.page-view {
    display: none;
}

.page-view.active {
    display: block;
}


.analysis-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E0E0E0;
}

.analysis-header h1 {
    font-size: 2em;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}

.analysis-header p {
    font-size: 1.1em;
    color: #666;
    margin: 0;
}

.back-to-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #000;
    border-width: 1px;
    border: 1px solid #000;
    text-decoration: none;
    font-weight: 400;
    padding: 0 20px;
    border-radius: 3px;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    min-height: 44px;
}


.back-to-upload:hover {
    border-color: #000;
    background: #F5F5F5;
}

.analysis-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

/* Normalize button heights/margins inside bottom nav bars */
.analysis-navigation .process-btn,
.analysis-navigation .back-to-upload,
.intake-navigation .process-btn,
.intake-navigation .back-to-upload,
.upload-navigation .process-btn,
.upload-navigation .back-to-upload {
    margin: 0;
}

#analysis-complete-container {
    margin-bottom: 20px;
    margin-top: 0;
}

/* Grouping Controls */
.main-content-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.grouping-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.0em;
    background: #C4C8BE;
    border-radius: 8px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.grouping-toggle label {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    margin: 0;
}

#grouping-select {
    padding: 6px 12px;
    border: 1px solid black;
    border-radius: 4px;
    background: #C4C8BE;
    font-size: 0.9em;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

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

.editor-button {
    padding: 6px 12px;
    border: 1px solid black;
    border-radius: 4px;
    background: #C4C8BE;
    font-size: 0.9em;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.editor-button:hover {
    color: #0066CC;
    border-color: #0066CC;
}

.editor-button:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Grouped Issue Display */
.issue-group {
    margin-bottom: 24px;
}

.issue-group-header {
    background: #F8F9FA;
    border: 1px solid #E0E0E0;
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
    margin-bottom: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.issue-group-content {
    background: white;
    border: 1px solid #E0E0E0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px;
}

.issue-group-content .issue-box {
    margin-bottom: 16px;
    border-radius: 8px;
}

.issue-group-content .issue-box:last-child {
    margin-bottom: 0;
}

/* Type-specific group styling */
.issue-group.type-overcharge .issue-group-header {
    background: #E3F2FD;
    color: #1976D2;
    border-color: #BBDEFB;
}

.issue-group.type-input_form .issue-group-header {
    background: #F3E5F5;
    color: #7B1FA2;
    border-color: #E1BEE7;
}

/* Confidence-specific group styling */
.issue-group.confidence-high .issue-group-header {
    background: #E8F5E8;
    color: #2E7D32;
    border-color: #C8E6C9;
}

.issue-group.confidence-low .issue-group-header {
    background: #FFF3E0;
    color: #F57C00;
    border-color: #FFE0B2;
}

#pdf-header-container {
    margin-bottom: 20px;
    margin-top: 0;
}

.pdf-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

.pdf-actions {
    display: flex;
    gap: 15px;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #C4C8BE;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 3px;
    margin: 10px 0;
    border-left: 4px solid #c62828;
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 3px;
    margin: 10px 0;
    border-left: 4px solid #2e7d32;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-sidebar {
        width: 100%;
        position: static;
    }
    
    .content-wrapper {
        order: 1;
    }
    
    .nav-item {
        display: inline-block;
        margin-right: 10px;
        margin-bottom: 5px;
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    .upload-section {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 20px;
    }
}

/* Additional styles for inline style extraction */
.intake-description {
    font-size: 1.02em;
    line-height: 1.6;
    color: #8B8589;
    margin-bottom: 10px;
    font-weight: 300;
}

.intake-section {
    background: #F5F5EE;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.intake-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.intake-question {
    font-weight: 500;
    margin-bottom: 10px;
    color: #34495e;
    line-height: 1.4;
}

.intake-options {
    font-weight: 400;
    display: flex;
    gap: 20px;
    margin-left: 20px;
}

.intake-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.intake-option input {
    margin-right: 8px;
}

.intake-details {
    display: none;
    margin-top: 10px;
    margin-left: 20px;
}

.intake-details label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #34495e;
}

.intake-textarea {
    width: 100%;
    max-width: 500px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.intake-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.welcome-content {
    background: #F5F5EE;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-text {
    font-size: 1.0em;
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
}

.welcome-text-large {
    font-size: 1.0em;
    line-height: 1.6;
    font-weight: 400;
    color: #333;
    margin-bottom: 40px;
}

.welcome-text-small {
    font-size: 1.0em;
    line-height: 1.6;
    font-weight: 400;
    color: #333;
    margin-bottom: 40px;
}

.about-section {
    background: #F5F5EE;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

/* Increase width of sections on About page */
#about-view .about-section,
#about-view .faq-section {
    max-width: 1000px;
}

.about-text {
    font-size: 1.0em;
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.about-text:last-child {
    margin-bottom: 0;
}

.faq-section {
    background: #F5F5EE;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    text-align: left;
    max-width: 800px;
    margin: 30px auto 0;
}

.faq-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 20px 0;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 1.0em;
    font-weight: 500;
    color: #333;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: #0066CC;
}

.faq-icon {
    font-size: 1.5em;
    font-weight: 300;
    color: #666;
    transition: transform 0.3s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
    color: #0066CC;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0;
}

.faq-answer.active {
    max-height: 3000px;
    padding: 0 0 20px 0;
}

.faq-answer p {
    font-size: 1.0em;
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    margin: 0;
    font-family: 'Roboto', 'SF Mono', 'JetBrains Mono', 'Monaco', 'Inconsolata', monospace;
}

.faq-answer p b,
.faq-answer p strong,
.faq-answer b,
.faq-answer strong {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
}

.welcome-button-container {
    text-align: center;
    margin-top: 40px;
}

.welcome-button {
    width: auto;
    margin: 0;
}

.upload-spacer {
    margin-bottom: 20px;
}

.upload-file-display {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    background: white;
    color: #333333;
    font-size: 0.95em;
    font-weight: 400;
}

.upload-file-display:focus {
    outline: none;
    border-color: #0066CC;
}

.upload-file-display:blur {
    border-color: #E0E0E0;
}

.upload-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.upload-label {
    color: #8B8589;
    font-size: 1.1em;
    font-weight: 300;
}

.upload-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.upload-process-btn {
    width: auto;
    margin: 0;
}

.upload-spacer-empty {
    margin-bottom: 20px;
}

.intake-form-container {
    max-width: 800px;
    margin: 0 auto;
}

.intake-question-container {
    margin-bottom: 25px;
}

.intake-input {
    width: auto;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
    background: white;
    color: #333;
    transition: all 0.2s ease;
    min-width: 200px;
}

.intake-input[list] {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-clip: padding-box;
}

.intake-input[list]::-webkit-calendar-picker-indicator,
.intake-input[list]::-webkit-list-button,
.intake-input[list]::-webkit-dropdown-arrow {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.intake-input[list]::-moz-list-bullet {
    display: none !important;
}

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

.intake-input::placeholder {
    color: #A0A0A0;
}

.copy-btn {
    width: auto;
    margin: 0;
    background: #666666;
}

/* Dispute Letter Editor Modal Styles */
.dispute-editor-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editor-field label {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.editor-field input,
.editor-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95em;
    background: white;
    color: #333;
    transition: all 0.2s ease;
}

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

.editor-field input::placeholder,
.editor-field textarea::placeholder {
    color: #A0A0A0;
}

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

.editor-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

/* Ensure modal action buttons are the same size */
.dispute-editor-form .editor-actions .process-btn {
    padding: 10px 20px;
    font-size: 1em;
    margin: 0;
    line-height: 1;
}

.dispute-editor-form .editor-actions .back-to-upload {
    padding: 10px 20px; /* reinforce equal size */
    font-size: 1em;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Top actions (Edit + PDF actions) styling */
.top-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.top-actions-buttons button {
    padding: 6px 12px;
    border: 1px solid black;
    border-radius: 4px;
    background: #C4C8BE;
    font-size: 0.9em;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s ease;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Ensure the Download / Copy buttons align icon + text */
.pdf-actions .process-btn,
.pdf-actions .copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-actions-buttons button:hover {
    border-color: #0066CC;
}

.top-actions-buttons button:focus {
    outline: none;
    border-color: #0066CC;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}
