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

/* Light theme (default) - Cyan accent matching dark mode */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-accent: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-accent: #0891b2;
    --accent-primary: #0891b2;
    --accent-hover: #4a9eff;
    --accent-light: rgba(8, 145, 178, 0.1);
    --accent-text: #0e7490;
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: #334155;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --border-accent: #818cf8;
    --accent-primary: #3b82f6;
    --accent-light: #1e1b4b;
    --accent-text: #60a5fa;
    --header-bg: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
    --input-bg: #374151;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 16px;
}

/* Theme toggle button */
.theme-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.25);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.header-banner {
    background: var(--header-bg);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.05);
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: #4a9eff;
    filter: drop-shadow(0 2px 4px rgba(6, 182, 212, 0.3));
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-freight {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-deck {
    font-size: 1.9rem;
    font-weight: 700;
    color: #4a9eff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-tagline {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 500;
}

.header-logo {
    max-height: 45px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-user {
    position: absolute;
    top: 12px;
    right: 16px;
    display: none; /* Hidden by default, shown by JS when logged in */
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    z-index: 10;
}

.header-user .btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.9);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.header-user .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

header h1 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

.start-fresh-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
}

.start-fresh-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* Collapsible Section */
.collapsible {
    padding: 0;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: var(--border-color);
}

.collapsible-header .collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.collapsible.open .collapse-icon {
    transform: rotate(90deg);
}

.collapsible-header .hint {
    margin-left: auto;
    font-weight: normal;
}

.collapsible-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Section Header with inline units */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.unit-selectors-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.unit-selectors-inline select {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    background: var(--bg-accent);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.input-mode-toggle .mode-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}
.input-mode-toggle .mode-btn:hover {
    color: var(--text-primary);
}
.input-mode-toggle .mode-btn.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Ft+In inputs in table cells */
.dim-ft-in {
    display: flex;
    align-items: center;
    gap: 2px;
}
.dim-ft-in input {
    width: 38px;
    padding: 6px 4px;
    text-align: center;
}
.dim-ft-in .dim-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Add Piece Button */
.btn-add-piece {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #f0f7ff;
    border: 2px dashed #3498db;
    border-radius: 6px;
    color: #3498db;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-piece:hover {
    background: #e0f0ff;
    border-color: #2980b9;
    color: #2980b9;
}

/* Upload Section */
.upload-section {
    margin-bottom: 20px;
}

.upload-section:not(.collapsible) {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Paste Target Box */
.paste-target-container {
    margin-bottom: 15px;
}

.paste-target {
    border: 3px dashed var(--accent-primary);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-accent);
    outline: none;
}

.paste-target:hover,
.paste-target:focus {
    border-color: var(--border-accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.paste-target:focus {
    border-style: solid;
}

.paste-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.paste-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.paste-text kbd {
    background: #34495e;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    margin: 0 2px;
}

.paste-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-types-inline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.paste-target.drag-over {
    border-color: #27ae60;
    background: linear-gradient(135deg, #e8f8f0 0%, #d4f5e4 100%);
}

.paste-target-container.hidden {
    display: none;
}

/* File upload option */
.upload-file-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.upload-file-option .divider-text {
    color: #95a5a6;
    font-size: 0.9rem;
}

.upload-file-option .file-types {
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Excel preview */
.excel-preview {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.excel-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.excel-icon {
    font-size: 2.5rem;
}

.excel-filename {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32;
}

.upload-zone {
    flex: 1;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}

.upload-zone:hover {
    border-color: #3498db;
    background: #f8fafc;
}

.upload-zone.drag-over {
    border-color: #3498db;
    background: #ebf5fb;
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

.upload-area {
    flex: 1;
}

.upload-tips {
    margin-top: 12px;
    padding: 12px 15px;
    background: var(--bg-accent);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upload-tips .tips-header {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-tips ul {
    margin: 0;
    padding-left: 18px;
}

.upload-tips li {
    margin: 3px 0;
}

.upload-tips strong {
    color: var(--text-primary);
}

.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.upload-zone.has-image {
    padding: 15px;
}

.ocr-status {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.ocr-status.loading {
    background: #ebf5fb;
    color: #2980b9;
}

.ocr-status.success {
    background: #e8f8f5;
    color: #27ae60;
}

.ocr-status.error {
    background: #fdedec;
    color: #e74c3c;
}

/* OCR Preview */
.ocr-preview pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* Lane Section */
.lane-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.lane-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.lane-field {
    flex: 1;
    min-width: 180px;
}

.lane-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.lane-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.lane-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.lane-arrow {
    font-size: 1.5rem;
    color: #999;
    padding-bottom: 26px; /* Align with input boxes accounting for validation span */
    align-self: flex-end;
}

.lane-field-btn {
    display: flex;
    align-items: flex-end;
}

.lane-field-btn .btn {
    height: 42px;
    white-space: nowrap;
}

/* Location Input Validation */
.lane-field {
    position: relative;
}

.lane-field input.input-error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.lane-field input.input-valid {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.input-feedback {
    font-size: 0.75rem;
    position: absolute;
    bottom: -18px;
    left: 0;
    min-height: 18px;
}

.input-feedback.error {
    color: #e74c3c;
}

.input-feedback.valid {
    color: #27ae60;
}

.lane-validation {
    font-size: 0.75rem;
    display: block;
    min-height: 18px;
    margin-top: 2px;
}

.lane-validation.valid {
    color: #27ae60;
}

.lane-validation.error {
    color: #e74c3c;
}

.lane-validation.loading {
    color: #666;
    font-style: italic;
}

.lane-validation.suggestion {
    color: #2980b9;
}

.suggestion-text {
    color: #666;
}

.suggestion-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    margin: 0 4px;
    transition: background 0.2s;
}

.suggestion-btn:hover {
    background: #2980b9;
}

.suggestion-hint {
    color: #999;
    font-size: 0.7rem;
}

/* Add padding to lane-inputs for feedback space */
.mapper-inputs {
    padding-bottom: 20px;
}

/* Output lane info */
.output-lane-info {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.output-lane-info .lane-item {
    display: flex;
    gap: 6px;
}

.output-lane-info .lane-label {
    color: #666;
    font-weight: 500;
}

.output-lane-info .lane-value {
    color: #2c3e50;
    font-weight: 600;
}

.output-lane-info .lane-arrow {
    color: #3498db;
    font-size: 1.1rem;
    padding: 0;
}

/* Sections */
section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-accent);
    transition: all 0.2s ease;
}

section:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

section h2 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hint {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Unit Selectors */
.unit-selectors {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.unit-selectors label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-accent);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input[type="text"]:hover,
input[type="number"]:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

select:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

/* Input widths */
td:nth-child(1) input { min-width: 120px; } /* Description */
td:nth-child(2) input,
td:nth-child(3) input,
td:nth-child(4) input { width: 80px; } /* L, W, H */
td:nth-child(6) input { width: 100px; min-width: 100px; } /* Weight - wider */
td:nth-child(8) input { width: 60px; } /* Qty */

/* Delete button */
.delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.delete-btn:hover {
    opacity: 1;
}

/* Output table */
#outputTable td {
    font-weight: 500;
}

.checkbox-col {
    width: 40px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#outputTable tbody tr {
    transition: background-color 0.2s;
}

#outputTable tbody tr.selected {
    background-color: #e8f4fd;
}

#outputTable tbody tr:not(.selected) {
    opacity: 0.6;
}

#outputTable td:nth-child(2),
#outputTable td:nth-child(3),
#outputTable td:nth-child(4),
#outputTable td:nth-child(5),
#outputTable td:nth-child(6) {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: #2c3e50;
}

/* Over-dimensional value highlighting */
#outputTable td.od-value,
td.od-value {
    color: #e74c3c !important;
    font-weight: 600 !important;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.action-buttons,
.export-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: center;
}

/* Force Build Loads button to far left */
#sendToLoadBuilderBtn {
    order: -100 !important;
}

.export-buttons {
    flex-direction: row !important;
}

.export-buttons .btn-secondary {
    order: 10;
}

.convert-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.convert-options select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin-top: 30px;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid rgba(51, 65, 85, 0.6);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
    z-index: 1100;
}

@keyframes toastIn {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.tab-content {
    display: none;
}

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

/* Subtabs (for Load Planning module) */
.subtab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-accent);
    padding: 4px;
    border-radius: 10px;
}

.subtab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.subtab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.subtab-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.subtab-content {
    display: none;
}

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

/* Oversize CTA Banner */
.oversize-cta {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
}

.oversize-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.oversize-cta-icon {
    font-size: 1.5rem;
}

.oversize-cta-text {
    flex: 1;
    min-width: 200px;
    color: #92400e;
}

.oversize-cta-text strong {
    color: #78350f;
}

.oversize-cta .btn {
    white-space: nowrap;
}

/* Maybe-Oversize Warning */
.maybe-oversize-warning {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #60a5fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e40af;
}

.maybe-oversize-warning .warning-icon {
    font-size: 1.2rem;
}

.maybe-oversize-warning .warning-text {
    font-size: 0.9rem;
}

/* Dims & Load Builder Sections */
.dims-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

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

.loadbuild-section h2 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Permit Checker */
.permit-input-section .permit-dims {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.permit-field {
    flex: 1;
    min-width: 150px;
}

.permit-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.input-with-unit {
    display: flex;
    gap: 8px;
}

.input-with-unit input {
    flex: 1;
    min-width: 80px;
}

.input-with-unit select {
    width: 60px;
}

/* Ft + In dual input */
.ft-in-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ft-in-input input {
    width: 60px;
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-primary);
    text-align: center;
}

.ft-in-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Help tooltips */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}
.help-tip:hover {
    background: var(--accent-primary);
}

.ft-in-input .unit-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 20px;
}

/* Trailer Section */
.trailer-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.trailer-section h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 12px;
}

.trailer-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.trailer-selector select {
    flex: 1;
    max-width: 300px;
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.trailer-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.trailer-selector select.recommended {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.trailer-recommendation {
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 600;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: inline;
    margin-left: 6px;
}

.rec-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 6px;
    letter-spacing: 0.3px;
    cursor: help;
}

.trailer-recommendation:empty {
    display: none;
}

.custom-deck-input {
    margin-top: 12px;
    padding: 12px 15px;
    background: #fff8e6;
    border: 1px solid #f0d78c;
    border-radius: 6px;
}

.custom-deck-input label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.custom-deck-input .input-with-unit {
    max-width: 200px;
}

.custom-deck-input .unit-label {
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    color: #666;
}

.trailer-info {
    margin-top: 12px;
    background: var(--bg-accent);
    border-radius: 6px;
    padding: 12px 16px;
}

.trailer-specs {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-specs .spec {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.trailer-specs .spec strong {
    color: var(--text-primary);
}

#totalHeight {
    color: #2980b9;
    font-weight: 600;
}

.height-warning {
    color: #e74c3c !important;
}

.height-ok {
    color: #27ae60 !important;
}

/* Trailer specs summary */
.trailer-specs-summary {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.trailer-specs-summary .spec {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.trailer-specs-summary .spec strong {
    color: var(--text-primary);
}

.btn-link {
    background: none;
    border: none;
    color: #2980b9;
    cursor: pointer;
    padding: 8px 0 0 0;
    font-size: 0.85rem;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Expanded Trailer Specs Panel */
.trailer-specs-expanded {
    margin-top: 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.specs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.specs-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.specs-header .hint {
    font-size: 0.8rem;
    color: #888;
}

.specs-grid {
    display: grid;
    gap: 12px;
}

.specs-zone {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.specs-zone-header {
    font-weight: 600;
    color: #2c4a6a;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.specs-zone-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.spec-item label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.spec-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.spec-value:hover {
    border-color: #2980b9;
    background: #f0f7ff;
}

.spec-value.editing {
    border-color: #2980b9;
    background: #fff;
    outline: none;
}

.spec-value.modified {
    background: #fff3e0;
    border-color: #f39c12;
}

.specs-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.specs-modified-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3e0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #e67e22;
}

/* Overall trailer specs row (single zone trailers) */
.specs-overall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

/* Custom trailer save modal */
.save-trailer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1001;
    width: 90%;
    max-width: 400px;
}

.save-trailer-modal h3 {
    margin: 0 0 16px 0;
}

.save-trailer-modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 16px;
}

.save-trailer-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* State Selector */
.state-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.state-selector select {
    flex: 1;
    max-width: 300px;
}

.selected-states {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 40px;
}

.state-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f4fd;
    color: #2980b9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.state-tag .remove-state {
    background: none;
    border: none;
    color: #2980b9;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.state-tag .remove-state:hover {
    opacity: 1;
}

.state-tag.canadian {
    background: #fef3e8;
    color: #c41e3a;
    border: 1px solid #f5d0c0;
}

.state-tag.canadian .remove-state {
    color: #c41e3a;
}

.canada-note {
    color: #c41e3a;
    font-weight: 500;
}

.permit-table tr.canadian-row {
    background: rgba(196, 30, 58, 0.06);
}
[data-theme="dark"] .permit-table tr.canadian-row {
    background: rgba(196, 30, 58, 0.12);
}

.permit-table tr.canadian-row:hover {
    background: rgba(196, 30, 58, 0.1);
}
[data-theme="dark"] .permit-table tr.canadian-row:hover {
    background: rgba(196, 30, 58, 0.18);
}

/* Permit Results */
.permit-results {
    margin-top: 20px;
}

.permit-state-result {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #ccc;
}

.permit-state-result.permit-required {
    border-left-color: #e74c3c;
    background: #fef5f5;
}

.permit-state-result.no-permit {
    border-left-color: #27ae60;
    background: #f0fdf4;
}

.permit-state-result h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.permit-state-result .permit-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.permit-status.required {
    background: #e74c3c;
    color: #fff;
}

.permit-status.not-required {
    background: #27ae60;
    color: #fff;
}

.permit-status.escort {
    background: #f39c12;
    color: #fff;
    margin-left: 8px;
}

.permit-reasons {
    margin: 10px 0;
}

.permit-reasons li {
    color: #e74c3c;
    margin-left: 20px;
    font-size: 0.9rem;
}

.escort-reasons li {
    color: #f39c12;
}

.permit-notes {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.permit-notes strong {
    color: #555;
}

/* Cost Summary Box */
/* Trailer Summary in Results */
.trailer-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.trailer-summary h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 12px;
}

.trailer-summary-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

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

.trailer-summary-item .label {
    color: #666;
    font-size: 0.9rem;
}

.trailer-summary-item .value {
    font-weight: 600;
    color: #2c3e50;
}

.trailer-summary-item.highlight {
    background: #e8f4fd;
    padding: 6px 12px;
    border-radius: 6px;
}

.trailer-summary-item.highlight .value.height-ok {
    color: #27ae60;
}

.trailer-summary-item.highlight .value.height-warning {
    color: #e74c3c;
}

.cost-summary {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.cost-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cost-item {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px 15px;
}

.cost-item.total {
    background: rgba(255,255,255,0.25);
    grid-column: 1 / -1;
}

.cost-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.survey-likely-tag {
    display: inline-block;
    background: #f39c12;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
}

.cost-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.cost-item.total .cost-value {
    font-size: 1.5rem;
}

.cost-note {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 15px;
    font-style: italic;
}

/* Permit Table */
.permit-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.permit-table th,
.permit-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.permit-table th {
    background: var(--bg-accent);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.permit-table tr.permit-row {
    background: rgba(231, 76, 60, 0.08);
}
[data-theme="dark"] .permit-table tr.permit-row {
    background: rgba(231, 76, 60, 0.15);
}

.permit-table .status-yes {
    color: #ef4444;
    font-weight: 700;
}

.permit-table .status-no {
    color: #22c55e;
}

.permit-table .status-maybe {
    color: #f59e0b;
    font-weight: 600;
}

.permit-table .notes-cell {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 250px;
}

/* Survey Warning Banner */
.survey-warning {
    background: rgba(243, 156, 18, 0.1);
    border: 2px solid #f39c12;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
[data-theme="dark"] .survey-warning {
    background: rgba(243, 156, 18, 0.15);
}

.survey-warning strong {
    color: #f59e0b;
    white-space: nowrap;
}

.survey-warning span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Travel Restrictions Warning */
.travel-restrictions-warning {
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}
[data-theme="dark"] .travel-restrictions-warning {
    background: rgba(52, 152, 219, 0.15);
}

.travel-restrictions-warning > strong {
    color: #3b82f6;
    display: block;
    margin-bottom: 8px;
}

.travel-restrictions-warning .restriction-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
}

.travel-restrictions-warning .restriction-details > span {
    color: var(--text-secondary);
}

.travel-restrictions-warning .restriction-note {
    width: 100%;
    color: #5a7d9a;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 5px;
}

/* Superload Warning */
.superload-warning {
    background: linear-gradient(135deg, #fef2f2 0%, #fde8e8 100%);
    border: 2px solid #e53e3e;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.superload-warning > strong {
    color: #c53030;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.superload-warning .superload-details p {
    margin: 0 0 10px 0;
    color: #742a2a;
    font-size: 0.9rem;
}

.superload-warning .superload-details ul {
    margin: 0 0 10px 20px;
    padding: 0;
    color: #742a2a;
    font-size: 0.9rem;
}

.superload-warning .superload-details li {
    margin-bottom: 4px;
}

.superload-warning .superload-note {
    display: block;
    color: #9b2c2c;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #feb2b2;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.export-actions .btn {
    font-size: 0.85rem;
}

/* Pieces Queue Section */
.pieces-queue-section {
    background: #fff;
    border: 2px solid #3498db;
    border-radius: 8px;
}

.pieces-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.pieces-queue-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pieces-queue {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.piece-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.piece-chip:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.piece-chip.active {
    border-color: #3498db;
    background: #e8f4fd;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.piece-chip.checked {
    border-color: #27ae60;
    background: #f0fdf4;
}

.piece-chip.checked::after {
    content: '✓';
    color: #27ae60;
    font-weight: bold;
}

.piece-chip .piece-name {
    font-weight: 500;
    color: #2c3e50;
}

.piece-chip .piece-dims {
    font-size: 0.8rem;
    color: #666;
}

.piece-chip.tall-piece {
    border-color: #f39c12;
    background: #fff8e6;
}

.pieces-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.pieces-counter {
    font-weight: 600;
    color: #2c3e50;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Current piece label in header */
.current-piece-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #3498db;
    background: #e8f4fd;
    padding: 4px 12px;
    border-radius: 12px;
    margin-left: 10px;
}

/* BETA Tab Styles */
.beta-tab {
    position: relative;
}

.beta-badge {
    font-size: 0.65rem;
    background: #f39c12;
    color: #fff;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 4px;
}

.beta-badge-large {
    font-size: 0.8rem;
    background: #f39c12;
    color: #fff;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 8px;
}

.btn-outline-beta {
    background: transparent;
    border: 2px solid #f39c12;
    color: #f39c12;
    font-weight: 600;
}

.btn-outline-beta:hover {
    background: #fff8e6;
    border-color: #e67e22;
    color: #e67e22;
}

/* BETA Banner */
.beta-banner {
    background: linear-gradient(135deg, #fff8e6 0%, #fef5e6 100%);
    border: 2px solid #f39c12;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.beta-banner h2 {
    color: #b7791f;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.beta-banner > p {
    color: #7c5c00;
    margin-bottom: 15px;
}

.beta-warnings {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    color: #7c5c00;
}

.beta-warnings ul {
    margin: 10px 0;
    padding-left: 20px;
}

.beta-warnings li {
    margin: 5px 0;
}

.beta-warnings strong {
    color: #e67e22;
}

/* Load Builder Header */
.loadbuilder-header {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4ecfa 100%);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.loadbuilder-header h2 {
    color: #2980b9;
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.loadbuilder-header > p {
    color: #34495e;
    margin-bottom: 15px;
}

.loadbuilder-warning {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9rem;
    color: #7c5c00;
    border-left: 4px solid #f39c12;
}

.loadbuilder-warning strong {
    color: #e67e22;
}

/* State Regulations Styles */
.state-regs-section {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.state-regs-section h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.state-regs-section > p {
    color: #666;
    margin-bottom: 25px;
}

.state-selector {
    margin-bottom: 25px;
}

.state-selector label {
    font-weight: 600;
    margin-right: 10px;
}

.state-selector select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    min-width: 250px;
    cursor: pointer;
}

.state-selector select:focus {
    border-color: #3498db;
    outline: none;
}

.state-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.info-card {
    background: #f8fafc;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.info-card h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    font-weight: 600;
    color: #2c3e50;
}

.notes-row {
    flex-direction: column;
    gap: 5px;
}

.notes-row .info-value {
    font-weight: 400;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Disclaimer Banner */
.disclaimer-banner {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #856404;
}

.disclaimer-banner strong {
    color: #664d03;
}

/* Full-width info card */
.info-card.full-width {
    grid-column: 1 / -1;
}

/* Load Builder Styles - Drag & Drop */
.loadbuilder-pool {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.piece-pool {
    min-height: 80px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: all 0.2s;
}

.piece-pool.drag-over {
    border-color: #3498db;
    background: #f0f7ff;
}

.piece-pool .empty-state {
    width: 100%;
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Draggable Piece */
.draggable-piece {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s;
    font-size: 12px;
    user-select: none;
    color: #e2e8f0;
}

.draggable-piece:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.draggable-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.draggable-piece.tall {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.draggable-piece .piece-name {
    font-weight: 600;
    color: #2c3e50;
}

/* Piece number badge in Load Builder */
.piece-num-badge {
    display: inline-block;
    background: #3498db;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 6px;
}

/* Piece number column in results table */
.piece-num-col {
    width: 40px;
    text-align: center;
}

.piece-number {
    display: inline-block;
    background: #3498db;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
}

.draggable-piece .piece-dims {
    color: #666;
    font-size: 0.85rem;
}

.draggable-piece .piece-weight {
    color: #888;
    font-size: 0.8rem;
}

.draggable-piece.stackable {
    border-left: 3px solid #27ae60;
}

.stackable-badge {
    margin-left: 6px;
    font-size: 0.75rem;
    color: #27ae60;
}

/* Stackable checkbox column in output table */
.stackable-col {
    text-align: center;
    width: 80px;
}

.stackable-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Route Info Panel */
.route-info-panel {
    background: linear-gradient(135deg, #1a2a3a 0%, #2c4a6a 100%);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #fff;
}

.route-info-panel > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.route-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.route-value {
    font-weight: 600;
    font-size: 1rem;
}

.route-note {
    font-size: 0.8rem;
    opacity: 0.7;
    font-style: italic;
}

.permit-warning {
    color: #f39c12;
}

.escort-warning {
    color: #e74c3c;
}

.night-warning {
    color: #9b59b6;
}

/* AI Recommendations */
.ai-recommendations {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-recommendations h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
}

.recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recommendation-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 14px;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:hover {
    background: #e8f4f8;
    border-color: #3498db;
}

.recommendation-card.legal {
    border-left: 3px solid #27ae60;
}

.recommendation-card.permit-needed {
    border-left: 3px solid #f39c12;
}

.recommendation-card .trailer-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.recommendation-card .trailer-height {
    font-size: 0.85rem;
    color: #666;
}

.recommendation-card .trailer-status {
    font-size: 0.8rem;
    margin-top: 4px;
}

.recommendation-card .trailer-status.legal {
    color: #27ae60;
}

.recommendation-card .trailer-status.permit {
    color: #f39c12;
}

.recommendation-card .accept-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.recommendation-card .accept-btn:hover {
    background: #219a52;
}

.recommendation-card .view-specs-btn {
    width: 100%;
    padding: 4px 8px;
    margin-top: 6px;
    font-size: 0.8rem;
    background: transparent;
    color: #2980b9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card .view-specs-btn:hover {
    background: #f0f7ff;
    border-color: #2980b9;
}

.recommendation-specs {
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
}

.recommendation-specs .spec-row {
    margin-bottom: 4px;
    color: #555;
}

.recommendation-specs .zones-header {
    margin-top: 8px;
    margin-bottom: 4px;
    color: #333;
}

.recommendation-specs .zone-spec {
    padding-left: 10px;
    color: #666;
    font-size: 0.75rem;
}

/* Accepted Load Plan */
.accepted-plan {
    background: #f0fff4;
    border: 2px solid #27ae60;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.accepted-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.accepted-plan-header h4 {
    margin: 0;
    color: #27ae60;
}

.plan-header-actions {
    display: flex;
    gap: 8px;
}

.accepted-plan-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #27ae60;
    display: flex;
    align-items: center;
    gap: 15px;
}

.accepted-plan-actions .btn {
    min-width: 200px;
}

.action-hint {
    font-size: 12px;
    color: #666;
}

.recommendations-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.recommendations-actions .btn {
    min-width: 160px;
}

.accepted-plan-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.plan-truck {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    min-width: 200px;
    flex: 1;
}

.plan-truck-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.plan-truck-pieces {
    font-size: 0.85rem;
    color: #666;
}

.plan-truck-pieces li {
    margin: 4px 0;
}

.plan-truck-stats {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.overweight-warning {
    color: #e74c3c;
    font-weight: 700;
    animation: pulse 1s ease-in-out infinite;
}

.od-warning {
    color: #e67e22;
    font-weight: 700;
    animation: pulse 1s ease-in-out infinite;
}

.truck-warnings {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Super-heavy and warning alerts */
.super-heavy-alert {
    background: #e74c3c;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.super-heavy-alert strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.plan-warnings {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 12px;
}

.warning-item {
    color: #856404;
    margin: 4px 0;
}

/* OD Truck styling */
.plan-truck.od-truck {
    border-left: 4px solid #e74c3c;
    background: #fff5f5;
}

.plan-truck.legal-truck {
    border-left: 4px solid #27ae60;
    background: #f0fff4;
}

.plan-truck-header .od-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    width: auto;
    height: auto;
}

.plan-truck-header .legal-badge {
    display: inline-block;
    background: #27ae60;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 600;
    width: auto;
    height: auto;
}

.od-truck-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

.permit-check-actions {
    width: 100%;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.permit-check-actions .btn {
    min-width: 280px;
}

.permit-check-note {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Trailer breakdown in recommendations */
.trailer-breakdown {
    margin: 8px 0;
    padding: 8px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
}

.trailer-breakdown-item {
    font-size: 12px;
    color: #555;
    padding: 2px 0;
}

/* Birds-Eye Trailer Visualization */
.trailer-viz-container {
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.trailer-viz-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.trailer-viz {
    position: relative;
    background: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.trailer-outline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px dashed #ccc;
    pointer-events: none;
}

.trailer-front,
.trailer-rear {
    position: absolute;
    font-size: 9px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
}

.trailer-front {
    left: 4px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
}

.trailer-rear {
    right: 4px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
}

.trailer-piece {
    position: absolute;
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.trailer-piece:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.piece-label {
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
}

.piece-dims {
    font-size: 8px;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.trailer-dims-label {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-top: 6px;
}

.trailer-viz-placeholder {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #ddd;
}

.trailer-piece.oversize-piece {
    box-shadow: 0 0 0 2px #e74c3c;
}

.recommendation-card.has-warnings {
    border-color: #ffc107;
    background: #fffef5;
}

/* Truck Groups */
.loadbuilder-trucks {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.trucks-header h3 {
    margin: 0;
}

.truck-groups {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Truck */
.truck-group {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.truck-group.drag-over {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.truck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #2c3e50;
    color: #fff;
}

.truck-header h4 {
    margin: 0;
    font-size: 1rem;
}

.truck-remove {
    background: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    opacity: 0.7;
}

.truck-remove:hover {
    opacity: 1;
}

.truck-drop-zone {
    min-height: 70px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    background: #fff;
}

.truck-drop-zone .empty-hint {
    width: 100%;
    text-align: center;
    color: #bbb;
    padding: 20px;
    font-size: 0.9rem;
    font-style: italic;
}

.truck-footer {
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.truck-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.truck-stat .label {
    color: #666;
}

.truck-stat .value {
    font-weight: 600;
    color: #2c3e50;
}

.truck-stat .value.weight-ok {
    color: #27ae60;
}

.truck-stat .value.weight-warning {
    color: #e74c3c;
    font-weight: 700;
}

.truck-stat .value.height-ok {
    color: #27ae60;
}

.truck-stat .value.height-warning {
    color: #e74c3c;
}

.truck-trailer-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.truck-trailer-select select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.trailer-recommended {
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 500;
}

/* No trucks message */
.no-trucks-msg {
    text-align: center;
    padding: 30px;
    color: #999;
}

/* Trucks permit action */
.trucks-permit-action {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background: #f0f7ff;
    border-radius: 8px;
}

/* Truck visualization (birds-eye) */
.truck-viz {
    padding: 10px 15px;
    background: #fafafa;
    border-top: 1px dashed #ddd;
}

.viz-trailer {
    position: relative;
    background: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
    border: 2px solid #999;
    border-radius: 4px;
    margin: 0 auto;
    overflow: visible;
}

.viz-label-front, .viz-label-rear {
    position: absolute;
    font-size: 9px;
    color: #888;
    font-weight: 600;
    top: 50%;
    transform: translateY(-50%);
}

.viz-label-front {
    left: -45px;
}

.viz-label-rear {
    right: -45px;
}

.viz-piece {
    position: absolute;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    overflow: hidden;
    box-sizing: border-box;
}

.viz-piece.viz-od {
    border: 2px solid #e74c3c;
    box-shadow: 0 0 4px rgba(231,76,60,0.5);
}

.viz-dims {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .upload-section:not(.collapsible) {
        flex-direction: column;
    }

    .collapsible-header {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .collapsible-header .hint {
        display: none;
    }

    .collapsible-content {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .unit-selectors-inline {
        width: 100%;
    }

    .unit-selectors-inline select {
        flex: 1;
    }

    .unit-selectors {
        flex-direction: column;
        gap: 10px;
    }

    .lane-inputs {
        flex-direction: column;
    }

    .lane-arrow {
        display: none;
    }

    .permit-dims {
        flex-direction: column;
    }

    .permit-field {
        min-width: 100%;
    }

    .state-selector {
        flex-direction: column;
    }

    .state-selector select {
        max-width: 100%;
    }

    .action-buttons,
    .export-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Make table scroll horizontally on mobile */
    .table-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 4px;
    }

    /* Reduce input sizes on mobile */
    td input[type="number"],
    td input[type="text"] {
        padding: 6px;
        font-size: 0.85rem;
    }

    td select {
        padding: 6px;
        font-size: 0.8rem;
    }

    /* Permit results on mobile */
    .permit-state-result {
        padding: 12px;
    }

    .permit-status {
        display: block;
        margin-bottom: 5px;
    }

    .permit-status.escort {
        margin-left: 0;
    }
}

/* Floating Feedback Button (bottom-right corner) */
.floating-feedback-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transition: all 0.2s;
    z-index: 100;
}

.floating-feedback-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.feedback-field {
    margin-bottom: 15px;
}

.feedback-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.feedback-field input[type="text"],
.feedback-field textarea,
.feedback-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.feedback-field textarea {
    resize: vertical;
    min-height: 100px;
}

.feedback-field input[type="checkbox"] {
    margin-right: 8px;
}

.feedback-field label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: normal;
    color: #666;
}

/* Customer Quote Modal */
.quote-modal {
    max-width: 1100px;
    width: 95%;
}

.quote-modal .modal-body {
    max-height: 70vh;
}

.quote-route {
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.quote-route .route-label {
    font-weight: 600;
    color: #555;
    margin-right: 8px;
}

.quote-route-states {
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #666;
}

.quote-disclaimer {
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #856404;
}

.quote-table-wrapper {
    overflow-x: auto;
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.quote-table th {
    background: #333;
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.quote-table td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.quote-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.quote-table tbody tr:hover {
    background: #f0f7ff;
}

.quote-table tbody tr.od-row {
    background: #fff8e6;
}

.quote-table tbody tr.od-row:hover {
    background: #fff3cc;
}

.quote-table .pieces-cell {
    font-size: 0.8rem;
    max-width: 150px;
}

.quote-table .linehaul-input {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: right;
}

.quote-table .linehaul-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.quote-table tfoot .totals-row {
    background: #2c3e50;
    color: white;
}

.quote-table tfoot .totals-row td {
    border-color: #2c3e50;
    padding: 12px 8px;
}

.quote-truck-total {
    font-weight: 600;
    color: #2c3e50;
}

.quote-od-badge {
    display: inline-block;
    background: #e67e22;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

.quote-legal-badge {
    display: inline-block;
    background: #27ae60;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* Generate Quote Button */
.generate-quote-action {
    margin-top: 15px;
    text-align: center;
}

.generate-quote-action .btn {
    font-size: 1rem;
    padding: 12px 24px;
}

/* Lane Mapper Styles */
.lane-mapper-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.voice-input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.mic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #3498db;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

.mic-btn.listening {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fef5f5 0%, #fdedec 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.mic-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.mic-text {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.mic-btn.listening .mic-text {
    color: #e74c3c;
}

.voice-status {
    font-size: 0.95rem;
    color: #666;
    text-align: center;
    min-height: 24px;
}

.voice-status.error {
    color: #e74c3c;
}

.voice-status.success {
    color: #27ae60;
}

.voice-status.processing {
    color: #3498db;
}

.voice-status.listening {
    color: #9b59b6;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mapper-inputs {
    margin-bottom: 20px;
}

/* Miles Display */
.miles-display {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

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

.miles-value.truck-miles {
    background: rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.miles-value.car-miles {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.miles-value.drive-time {
    background: rgba(241, 196, 15, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.miles-value {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 10px;
}

.miles-label {
    font-size: 1rem;
    opacity: 0.9;
}

.miles-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.route-info {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Map Section */
.map-section {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.route-map {
    width: 100%;
    height: 450px;
    background: #e8e8e8;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
}

/* Mobile responsive for Lane Mapper */
@media (max-width: 768px) {
    .mic-btn {
        width: 100px;
        height: 100px;
    }

    .mic-icon {
        font-size: 2rem;
    }

    .miles-number {
        font-size: 2rem;
    }

    .route-map {
        height: 350px;
    }
}

/* Permit Checker Mini Map */
.permit-map-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.permit-route-map {
    width: 100%;
    height: 200px;
    background: #e8e8e8;
}

@media (max-width: 768px) {
    .permit-route-map {
        height: 150px;
    }
}

/* ============================
   RATE CHECK TAB STYLES
   ============================ */

.ratecheck-header {
    margin-bottom: 20px;
}

.ratecheck-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.ratecheck-header p {
    color: #666;
    margin: 0;
}

/* Upload Section */
.ratecheck-upload-section {
    margin-bottom: 20px;
}

.ratecheck-upload-section .paste-target {
    min-height: 150px;
}

.ratecheck-image-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.ratecheck-image-preview .image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.ratecheck-image-preview .preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Info Section */
.ratecheck-info-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.ratecheck-info-section h3 {
    margin: 0 0 3px 0;
    font-size: 1rem;
}

.ratecheck-info-section .hint {
    margin-bottom: 8px;
    font-size: 0.8rem;
}

/* Lane + Map Side-by-Side Layout */
.lane-map-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.lane-inputs-col {
    min-width: 0;
}

.lane-map-col {
    min-height: 300px;
}

.lane-map-col .ratecheck-map {
    height: 280px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.lane-map-col .map-info {
    text-align: center;
    padding: 8px;
    background: #2c3e50;
    color: white;
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

@media (max-width: 900px) {
    .lane-map-layout {
        grid-template-columns: 1fr;
    }
    .lane-map-col {
        order: -1;
    }
}

/* Results Container (no map, just rates) */
.results-rates-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Multi-Stop Styles */
.multistop-toggle {
    margin-bottom: 15px;
}

.multistop-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.multistop-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.multistop-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.stops-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.stop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.stop-number {
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

.stop-location {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.95rem;
}

.stop-location:focus {
    outline: none;
    border-color: #3498db;
}

.stop-type {
    width: 50px;
    padding: 8px 4px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.stop-remove-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #e74c3c;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stop-remove-btn:hover {
    background: #c0392b;
}

.stop-remove-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.stop-reorder-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stop-move-btn {
    width: 24px;
    height: 16px;
    border: 1px solid #bdc3c7;
    background: #f8f9fa;
    color: #555;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.stop-move-btn:hover:not(:disabled) {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.stop-move-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.stop-days-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.stop-days-row label {
    font-weight: 500;
    color: #555;
}

.stop-days-row input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
}

.stop-days-calc {
    color: #666;
}

.stop-days-calc strong {
    color: #e67e22;
}

.stop-charge-line {
    color: #e67e22;
    font-weight: 500;
}

/* Leg Miles Breakdown */
.leg-miles-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.leg-miles-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 10px;
}

.leg-miles-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leg-miles-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    font-size: 0.85rem;
}

.leg-miles-route {
    color: #555;
}

.leg-miles-route .leg-arrow {
    color: #3498db;
    margin: 0 6px;
}

.leg-miles-value {
    font-weight: 600;
    color: #333;
}

.leg-miles-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
    font-size: 0.95rem;
}

.leg-miles-total strong {
    color: #3498db;
}

/* Trip Time Estimate */
.trip-estimate-section {
    margin-top: 15px;
    padding: 15px;
    background: #fff8e1;
    border: 1px solid #ffcc80;
    border-radius: 8px;
}

.trip-estimate-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e65100;
    margin-bottom: 12px;
}

.trip-estimate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.85rem;
    color: #666;
}

.trip-days-row {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px dashed #ffcc80;
}

.trip-days-row strong {
    font-size: 1.1rem;
    color: #e65100;
}

.trip-estimate-rates {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ffcc80;
}

.rate-compare {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.rate-compare-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rate-compare-item .rate-label {
    font-weight: 500;
    color: #555;
    min-width: 100px;
}

.rate-compare-item span:not(.rate-label):not(.rate-formula) {
    font-weight: 600;
    font-size: 1rem;
}

.rate-formula {
    font-size: 0.8rem;
    color: #888;
}

.rate-formula input {
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.recommended-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #27ae60;
    color: white;
    border-radius: 6px;
}

.recommended-rate span {
    font-weight: 500;
}

.recommended-rate strong {
    font-size: 1.2rem;
}

.rate-indicator-hint {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

/* Screen Capture Actions */
.capture-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.capture-hint {
    font-size: 0.85rem;
    color: #888;
}

#screenCaptureBtn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.ratecheck-inputs {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ratecheck-field {
    flex: 1;
    min-width: 120px;
}

.ratecheck-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 2px;
}

.ratecheck-field input,
.ratecheck-field select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.ratecheck-field input:focus,
.ratecheck-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ratecheck-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* Results Section */
.ratecheck-results {
    margin-top: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 15px;
}

@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* Map Column */
.results-map-col {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    order: 2; /* Move map to right side */
}

/* Note: results-rates-col main styles are below after map-info */

.ratecheck-map {
    width: 100%;
    height: 180px;
    background: #e8e8e8;
}

.map-info {
    padding: 12px 15px;
    background: white;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.map-info .miles-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Rates Column */
.results-rates-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    order: 1; /* Display rates on left */
}

/* Dual Rate Cards Grid */
.dual-rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .dual-rates-grid {
        grid-template-columns: 1fr;
    }
}

.rates-card,
.margin-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
}

.rates-card.market-rates {
    border-top: 3px solid #3498db;
}

.rates-card.network-rates {
    border-top: 3px solid #9b59b6;
}

.rates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.rates-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

.rates-source {
    font-size: 0.75rem;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.market-rates .rates-source {
    background: #ebf5fb;
    color: #2980b9;
}

.network-rates .rates-source {
    background: #f5eef8;
    color: #8e44ad;
}

/* AI Rates Card - Freight-Tools Prediction (BETA) */
.rates-card.ai-rates {
    border-top: 3px solid #e67e22;
    background: linear-gradient(to bottom, #fff9f5 0%, #ffffff 100%);
}

.ai-rates .rates-source.beta-tag {
    background: #ffeaa7;
    color: #d35400;
    font-weight: 600;
    animation: pulse-beta 2s ease-in-out infinite;
}

@keyframes pulse-beta {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ai-rates .rates-header h4 {
    color: #d35400;
}

.rate-row.rate-ai-prediction {
    background: #fef5e7;
    border-radius: 6px;
    padding: 8px 10px;
    margin: -2px -4px;
}

.rate-value.ai-rate {
    color: #d35400;
    font-size: 1.25rem;
    font-weight: 700;
}

.ai-reasoning {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
}

.ai-reasoning small {
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.3;
}

.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    color: #666;
    font-size: 0.85rem;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #e67e22;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.rates-confidence {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.rates-confidence .conf-label {
    color: #666;
}

.rates-confidence .conf-value {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f0f0f0;
}

.rates-confidence .conf-value.high {
    background: #d4edda;
    color: #155724;
}

.rates-confidence .conf-value.medium {
    background: #fff3cd;
    color: #856404;
}

/* Public Mode - Two equal cards: FreightDeck Rate + Log Truck Rate */
.ratecheck-results-section.public-mode .rates-row-layout {
    grid-template-columns: 1fr 1fr;
}

.ratecheck-results-section.public-mode .rates-card.ai-rates,
.ratecheck-results-section.public-mode .rates-card.truck-rate-card {
    flex: 1;
}

.ratecheck-results-section.public-mode .rate-actions-row {
    display: none;
}

/* Truck Rate Card */
.rates-card.truck-rate-card {
    border-top: 3px solid #27ae60;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.truck-rate-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
}

.truck-rate-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.truck-rate-input input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    max-width: 120px;
}

.truck-rate-thanks {
    color: #27ae60;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Bottom actions row */
.rate-bottom-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.rate-bottom-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* Market Intelligence Modal */
#marketIntelModal {
    z-index: 9999;
}

.market-intel-modal {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    position: relative;
}

.market-intel-modal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px;
}

.market-intel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

.intel-stale-warning {
    color: #d68910;
    font-weight: 500;
}

.market-intel-signals {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.intel-signal {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.intel-signal.tight {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
}

.intel-signal.normal {
    background: rgba(34,197,94,0.15);
    color: #86efac;
}

.intel-signal.loose {
    background: rgba(56,189,248,0.15);
    color: #7dd3fc;
}

.intel-signal.rising {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
}

.intel-signal.stable {
    background: rgba(234,179,8,0.15);
    color: #fde047;
}

.intel-signal.falling {
    background: rgba(34,197,94,0.15);
    color: #86efac;
}

.market-intel-summary {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #cbd5e1;
    max-height: none;
    overflow-y: visible;
}

.market-intel-summary h1, .market-intel-summary h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 20px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(71,85,105,0.3);
}

.market-intel-summary h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 16px 0 6px;
}

.market-intel-summary strong {
    color: #f8fafc;
    font-weight: 600;
}

.market-intel-summary hr {
    border: none;
    border-top: 1px solid rgba(71,85,105,0.3);
    margin: 16px 0;
}

/* Lane reminder for permits */
.lane-reminder {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Linehaul field in permit dims */
.permit-field.linehaul-field input {
    max-width: 100px;
}

/* Next Truck Section */
.next-truck-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
    padding: 16px;
    background: #e8f5e9;
    border-radius: 8px;
}

.next-truck-section .btn-lg {
    padding: 12px 32px;
    font-size: 1.1rem;
}

.next-truck-status {
    color: #2e7d32;
    font-weight: 500;
}

/* Truck selector with prev/next */
.truck-selector-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.truck-selector-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.truck-selector-label {
    font-weight: 600;
    font-size: 1.1rem;
}

.truck-selector-info {
    text-align: center;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Linehaul section */
.linehaul-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.linehaul-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.linehaul-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.linehaul-input .currency {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.linehaul-input input {
    width: 150px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.linehaul-input .linehaul-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Export All Trucks Section */
.export-all-trucks-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0891b2;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

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

.export-all-header h3 {
    margin: 0;
    color: #0e7490;
    font-size: 1.1rem;
}

.export-all-status {
    background: #0891b2;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.export-all-status.complete {
    background: #059669;
}

.export-all-note {
    color: #0e7490;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.export-all-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.export-all-actions .btn {
    flex: 1;
    min-width: 120px;
}

[data-theme="dark"] .export-all-trucks-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #0891b2;
}

[data-theme="dark"] .export-all-header h3,
[data-theme="dark"] .export-all-note {
    color: #67e8f9;
}

.rates-confidence .conf-value.low {
    background: #f8d7da;
    color: #721c24;
}

.rates-card h4,
.margin-card h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Collapsible Section Toggle */
.collapsible-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.section-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.section-toggle:hover {
    background: #e9ecef;
}

.section-toggle .toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
}

.section-content {
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

/* Floating Voice Button */
.floating-voice-btn {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.floating-voice-btn:active {
    transform: scale(0.95);
}

.floating-voice-btn .mic-icon {
    font-size: 1.3rem;
}

.floating-voice-btn.listening {
    animation: pulse-voice 1.5s infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7); }
}

/* Fuel Backout Section */
.fuel-backout-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.fuel-backout-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.fuel-backout-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.custom-fuel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-left: 26px;
}

.custom-fuel-row label {
    font-size: 0.85rem;
    color: #666;
}

.custom-fuel-row input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.fuel-hint {
    font-size: 0.8rem;
    color: #888;
}

.fuel-line {
    color: #e74c3c;
}

.fuel-line span:last-child {
    color: #e74c3c;
}

.margin-line {
    border-top: 1px dashed #ddd;
    padding-top: 8px;
    margin-top: 4px;
}

/* Carriers Card */
.carriers-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.carriers-card h4 {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carrier-source {
    font-size: 0.75rem;
    color: #888;
    font-weight: normal;
}

.carriers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.carrier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
}

.carrier-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.carrier-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.carrier-mc {
    font-size: 0.8rem;
    color: #666;
}

.carrier-rate {
    text-align: right;
}

.carrier-rate-value {
    font-weight: 700;
    color: #27ae60;
    font-size: 1rem;
}

.carrier-rate-pm {
    font-size: 0.75rem;
    color: #888;
}

.carrier-link-gs {
    display: inline-block;
    padding: 4px 10px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    margin-top: 4px;
}

.carrier-link-gs:hover {
    background: #2980b9;
}

.no-carriers {
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    padding: 15px;
}

/* Accessorials Card */
.accessorials-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.accessorials-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.accessorials-toggle:hover {
    background: #e9ecef;
}

.accessorials-toggle .toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
}

.accessorials-content {
    padding: 12px 16px;
    border-top: 1px solid #dee2e6;
}

.accessorial-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.accessorial-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

.accessorial-item:hover {
    background: #e9ecef;
}

.accessorial-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.accessorial-item .acc-label {
    flex: 1;
    font-size: 0.9rem;
}

.accessorial-item .acc-amount {
    font-weight: 600;
    color: #e67e22;
    font-size: 0.9rem;
}

.accessorials-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff3cd;
    border-radius: 6px;
    font-weight: 600;
}

.accessorials-total span:last-child {
    color: #e67e22;
}

/* Quote Builder */
.quote-breakdown {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #dee2e6;
}

.quote-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}

.quote-line span:first-child {
    color: #666;
}

.quote-line span:last-child {
    font-weight: 500;
}

/* Rate Breakdown Card */
.rate-breakdown-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
}

.breakdown-row {
    display: flex;
    gap: 6px;
}

.breakdown-row span:first-child {
    color: #666;
}

.breakdown-row span:last-child {
    font-weight: 600;
    color: #333;
}

/* Rate Range Display */
.rate-range {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rate-row {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    background: #f8f9fa;
}

.rate-row .rate-label {
    width: 45px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
}

.rate-row .rate-value {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.rate-row .rate-per-mile {
    width: 70px;
    text-align: right;
    font-size: 0.8rem;
    color: #666;
}

.rate-low {
    border-left: 4px solid #27ae60;
}

.rate-low .rate-value {
    color: #27ae60;
}

.rate-avg {
    border-left: 4px solid #3498db;
    background: #ebf5fb;
}

.rate-avg .rate-value {
    color: #2980b9;
}

.rate-high {
    border-left: 4px solid #e74c3c;
}

.rate-high .rate-value {
    color: #e74c3c;
}

/* Margin Calculator */
.margin-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.margin-input-row label {
    font-weight: 500;
    color: #555;
}

.margin-input-row input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1.1rem;
    text-align: center;
}

.margin-result {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 8px;
    padding: 15px;
    color: white;
}

.sell-rate {
    text-align: center;
    margin-bottom: 10px;
}

.sell-rate .sell-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.sell-rate .sell-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.sell-rate .sell-per-mile {
    font-size: 0.95rem;
    opacity: 0.9;
}

.margin-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.9;
    border-top: 1px solid rgba(255,255,255,0.3);
    padding-top: 10px;
    margin-top: 5px;
}

/* Voice Input for Rate Check */
.ratecheck-voice-section {
    margin: 15px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.voice-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-voice {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-voice:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.btn-voice.listening {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse-voice 1s infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.voice-hint {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

#rateCheckVoiceStatus {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

#rateCheckVoiceStatus.listening {
    background: #fff3e0;
    color: #e65100;
}

#rateCheckVoiceStatus.success {
    background: #e8f5e9;
    color: #2e7d32;
}

#rateCheckVoiceStatus.error {
    background: #ffebee;
    color: #c62828;
}

/* Confidence Card */
.confidence-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 10px;
}

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

.confidence-label {
    font-size: 0.85rem;
    color: #666;
}

.confidence-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #3498db;
}

.confidence-value.high { color: #27ae60; }
.confidence-value.medium { color: #f39c12; }
.confidence-value.low { color: #e74c3c; }

.rate-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

/* Carrier Links Card */
.carrier-links-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 10px;
}

.carrier-links-card h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #555;
}

.carrier-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carrier-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.carrier-link:hover {
    transform: translateX(5px);
}

.carrier-icon {
    font-size: 1.2rem;
}

.highway-link {
    background: #e8f4fd;
    color: #0066cc;
    border: 1px solid #b8daff;
}

.highway-link:hover {
    background: #d0e9fc;
}

.dat-link {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.dat-link:hover {
    background: #ffe0b2;
}

.truckstop-link {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.truckstop-link:hover {
    background: #c8e6c9;
}

/* Mobile adjustments for Rate Check */
@media (max-width: 768px) {
    .ratecheck-inputs {
        flex-direction: column;
    }

    .ratecheck-field {
        min-width: 100%;
    }

    .ratecheck-inputs .lane-arrow {
        display: none;
    }

    .ratecheck-map {
        height: 250px;
    }

    .rate-row .rate-value {
        font-size: 1.1rem;
    }

    .sell-rate .sell-value {
        font-size: 1.6rem;
    }
}

/* User Identification Modal */
.user-id-modal {
    max-width: 400px;
    text-align: center;
}

.user-id-modal .modal-header {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

.user-id-modal .modal-header h3 {
    font-size: 1.5rem;
}

.user-id-modal .modal-body {
    padding: 20px 30px;
}

.user-id-modal .modal-body p {
    color: #666;
    margin-bottom: 20px;
}

.user-id-field {
    text-align: left;
}

.user-id-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.user-id-field input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.user-id-field input:focus {
    outline: none;
    border-color: #3498db;
}

.user-id-modal .modal-actions {
    padding: 20px 30px 30px;
    border-top: none;
}

.user-id-modal .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}


/* Site Footer */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-secondary);
}

.footer-disclaimer {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-disclaimer strong {
    color: #d97706;
}

.footer-contact {
    margin-bottom: 12px;
}

.footer-contact a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Auth Modal */
.auth-modal {
    max-width: 400px;
    text-align: center;
}

.auth-modal .modal-header {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

.auth-modal .modal-header h3 {
    font-size: 1.5rem;
}

.auth-modal .modal-body {
    padding: 20px 30px 30px;
}

.auth-notice {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #dc2626;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.auth-field {
    text-align: left;
    margin-bottom: 15px;
}

.auth-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 0.9rem;
}

.auth-field input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: #3498db;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.auth-switch {
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   NEW COMPACT RATE CHECK LAYOUT
   ============================================ */

/* Details row (commodity/weight/trailer/pickup) */
.ratecheck-details-row {
    margin-top: 15px;
}

/* Row 1: Map + Competitor Intel (50/50) */
.top-row-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    align-items: stretch;
}

.top-row-layout .competitor-rate-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Row 2: Rate Cards (3 equal) */
.rates-row-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    align-items: stretch;
}

/* Legacy fallback */
.map-rates-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    align-items: stretch;
}

.map-col {
    position: relative;
}

.map-col .ratecheck-map {
    height: 100%;
    min-height: 220px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Miles badge - prominent color */
.map-miles-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 1000;
}

/* Compact rate cards for 3-col */
.rates-card.compact {
    padding: 10px 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rates-card.compact .rates-header {
    margin-bottom: 6px;
}

.rates-card.compact .rates-header h4 {
    font-size: 0.9rem;
    margin: 0;
}

.rates-card.compact .rates-source {
    font-size: 0.7rem;
}

.rates-card.compact .rates-confidence {
    margin-bottom: 6px;
}

.rates-card.compact .rate-range {
    gap: 3px;
    flex: 1;
}

.rates-card.compact .rate-row {
    padding: 5px 6px;
}

.rates-card.compact .rate-label {
    font-size: 0.8rem;
}

.rates-card.compact .rate-value {
    font-size: 1rem;
}

.rates-card.compact .rate-per-mile {
    font-size: 0.75rem;
}

/* Per-card feedback buttons */
.card-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    justify-content: center;
}

.card-feedback-label {
    font-size: 0.7rem;
    color: #888;
}

.card-fb-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.card-fb-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.card-fb-btn.voted {
    opacity: 0.5;
    cursor: default;
}

.card-fb-btn[data-vote="high"].selected {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.card-fb-btn[data-vote="right"].selected {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.card-fb-btn[data-vote="low"].selected {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.card-feedback.submitted .card-feedback-label {
    color: #28a745;
}

.card-feedback.submitted .card-feedback-label::after {
    content: ' ✓';
}

[data-theme="dark"] .card-feedback {
    border-color: #444;
}

[data-theme="dark"] .card-fb-btn {
    border-color: #555;
    color: #ddd;
}

[data-theme="dark"] .card-fb-btn:hover {
    background: #444;
}

@media (max-width: 1000px) {
    .top-row-layout {
        grid-template-columns: 1fr;
    }
    .rates-row-layout {
        grid-template-columns: 1fr 1fr;
    }
    .map-rates-layout {
        grid-template-columns: 1fr 1fr;
    }
    .map-col {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .top-row-layout {
        grid-template-columns: 1fr;
    }
    .rates-row-layout {
        grid-template-columns: 1fr;
    }
    .map-rates-layout {
        grid-template-columns: 1fr;
    }
    .map-col {
        grid-column: span 1;
    }
}

/* Voice recording indicator */
.voice-btn.recording {
    background: #e74c3c !important;
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.voice-status.recording {
    color: #e74c3c;
    font-weight: 600;
}

/* OD badges for Load Builder pieces */
.od-indicators {
    display: inline-flex;
    gap: 3px;
    margin-left: 6px;
}

.od-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    cursor: help;
}

.od-badge.od-width {
    background: #e74c3c;
}

.od-badge.od-height {
    background: #f39c12;
}

.od-badge.od-weight {
    background: #9b59b6;
}

.draggable-piece.od-piece {
    border-left: 3px solid #e74c3c;
}

/* Truck fit warning */
.truck-fit-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.truck-fit-warning.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.truck-fit-warning .warning-icon {
    font-size: 16px;
}

/* Truck Selector for Permits */
.truck-selector-section {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.truck-selector-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.truck-selector-label {
    font-weight: 600;
    color: #004085;
}

.truck-selector-dropdown {
    padding: 8px 12px;
    border: 1px solid #b8daff;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
    background: white;
}

.truck-selector-count {
    color: #666;
    font-size: 13px;
}

/* State Regulations in Permits */
.state-regs-collapsible {
    margin-top: 24px;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.state-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.state-selector label {
    font-weight: 500;
}

.state-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 200px;
}

.state-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.info-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

.info-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.info-label {
    color: #666;
}

.info-value {
    font-weight: 500;
    color: #333;
}

/* Export Plan Action */
.export-plan-action {
    margin-top: 16px;
    text-align: center;
}

/* PermitCalc CTA Banner */
.permitcalc-cta {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 2px solid #93c5fd;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.permitcalc-cta::before {
    content: '📋';
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.15;
}
.permitcalc-cta .cta-text {
    flex: 1;
}
.permitcalc-cta .cta-text strong {
    color: #1e40af;
    font-size: 1rem;
}
.permitcalc-cta .cta-text p {
    color: #3b82f6;
    font-size: 0.85rem;
    margin: 4px 0 0 0;
}
.permitcalc-cta .btn {
    white-space: nowrap;
    background: #1e40af;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}
.permitcalc-cta .btn:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
}

/* PermitCalc Header */
.permitcalc-header {
    background: url('permitcalc-bg.png') center center / cover no-repeat !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
    border: none !important;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5) !important;
    overflow: hidden;
}
.permitcalc-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 48px 32px;
    background: linear-gradient(90deg, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.4) 50%, rgba(15,23,42,0.7) 100%);
}
.permitcalc-icon {
    flex-shrink: 0;
}
.permitcalc-icon svg {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 4px 12px rgba(20, 184, 166, 0.4));
}
.permitcalc-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.permitcalc-text p {
    font-size: 1.1rem;
    color: rgba(203, 213, 225, 0.95);
    margin: 6px 0 0 0;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.permitcalc-header .theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.1rem;
}
.permitcalc-header .theme-toggle:hover {
    background: rgba(0,0,0,0.7);
    border-color: rgba(255,255,255,0.3);
}
@media (max-width: 600px) {
    .permitcalc-hero {
        padding: 32px 20px;
        gap: 20px;
    }
    .permitcalc-icon svg {
        width: 56px;
        height: 56px;
    }
    .permitcalc-text h1 {
        font-size: 2rem;
    }
    .permitcalc-text p {
        font-size: 1rem;
    }
    .permitcalc-header .theme-toggle {
        top: 12px;
        right: 12px;
    }
}

/* Legacy small logo styles - kept for backwards compat */
.permitcalc-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.permitcalc-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
[data-theme="dark"] .permitcalc-cta {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.6) 0%, rgba(30, 27, 75, 0.6) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    backdrop-filter: blur(8px);
}
[data-theme="dark"] .permitcalc-cta .cta-text strong {
    color: #93c5fd;
}
[data-theme="dark"] .permitcalc-cta .cta-text p {
    color: #94a3b8;
}
[data-theme="dark"] .permitcalc-cta .btn {
    background: #3b82f6;
}
[data-theme="dark"] .permitcalc-cta .btn:hover {
    background: #2563eb;
}

/* ============================================
   MAP EXPAND MODAL
   ============================================ */

/* Expand button on maps */
.map-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.map-expand-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: scale(1.1);
}

/* Container positioning for expand button */
.permit-map-container,
.map-section,
.map-col {
    position: relative;
}

/* Expanded map modal */
.map-expand-modal {
    width: 95vw !important;
    max-width: 1400px !important;
    height: 85vh;
    max-height: none !important;
}

.map-expand-modal .modal-body {
    padding: 0;
    height: calc(100% - 60px);
    max-height: none;
}

.expanded-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    background: #e8e8e8;
}

/* Dark theme support */
[data-theme="dark"] .map-expand-btn {
    background: rgba(30, 30, 30, 0.95);
    border-color: #444;
    color: #eee;
}

[data-theme="dark"] .map-expand-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

[data-theme="dark"] .map-expand-modal {
    background: #1e1e1e;
}

[data-theme="dark"] .map-expand-modal .modal-header {
    background: #252525;
    border-color: #333;
}

[data-theme="dark"] .map-expand-modal .modal-header h3 {
    color: #eee;
}

/* ============================================
   AUTH REQUIRED - LOCK SCREEN
   ============================================ */

body.auth-required .container {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

body.auth-required #authModal {
    display: flex;
}

body.auth-required #authModal .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

/* ============================================
   RATE FEEDBACK CARD
   ============================================ */

.rate-feedback-card {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
}

.feedback-question {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

.feedback-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.feedback-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
}

.feedback-btn:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.feedback-btn.selected {
    border-color: #27ae60;
    background: #e8f5e9;
}

.feedback-btn[data-feedback="too_low"]:hover,
.feedback-btn[data-feedback="too_low"].selected {
    border-color: #e74c3c;
    background: #fdecea;
}

.feedback-btn[data-feedback="too_high"]:hover,
.feedback-btn[data-feedback="too_high"].selected {
    border-color: #f39c12;
    background: #fef9e7;
}

.feedback-icon {
    font-size: 20px;
}

.feedback-label {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.feedback-actual {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.feedback-actual label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.feedback-actual small {
    color: #999;
}

.actual-rate-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.actual-rate-input span {
    font-size: 16px;
    color: #666;
}

.actual-rate-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    max-width: 120px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.feedback-thanks {
    text-align: center;
    color: #27ae60;
    font-weight: 500;
    padding: 12px;
    background: #e8f5e9;
    border-radius: 6px;
    margin-top: 8px;
}

/* Dark theme */
[data-theme="dark"] .rate-feedback-card {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .feedback-question {
    color: #aaa;
}

[data-theme="dark"] .feedback-btn {
    background: #333;
    border-color: #555;
}

[data-theme="dark"] .feedback-btn:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .feedback-label {
    color: #ddd;
}

[data-theme="dark"] .feedback-actual {
    border-color: #444;
}

[data-theme="dark"] .actual-rate-input input {
    background: #333;
    border-color: #555;
    color: #eee;
}

/* ============================================
   LOG ACTUAL RATE CARD (Results Section)
   ============================================ */

.actual-rate-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 2px solid #81c784;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.actual-rate-card h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #2e7d32;
}

.actual-rate-hint {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px 0;
}

.actual-rate-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.actual-rate-row .dollar-sign {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.actual-rate-row input {
    width: 120px;
    padding: 8px 12px;
    font-size: 16px;
    border: 2px solid #ccc;
    border-radius: 6px;
    text-align: center;
}

.actual-rate-row input:focus {
    border-color: #4caf50;
    outline: none;
}

.actual-rate-thanks {
    color: #2e7d32;
    font-weight: 500;
    margin-top: 10px;
    padding: 8px;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 6px;
}

[data-theme="dark"] .actual-rate-card {
    background: linear-gradient(135deg, #1b3d1f 0%, #2a3d25 100%);
    border-color: #4caf50;
}

[data-theme="dark"] .actual-rate-card h4 {
    color: #81c784;
}

[data-theme="dark"] .actual-rate-hint {
    color: #aaa;
}

[data-theme="dark"] .actual-rate-row .dollar-sign {
    color: #eee;
}

[data-theme="dark"] .actual-rate-row input {
    background: #333;
    border-color: #555;
    color: #eee;
}

[data-theme="dark"] .actual-rate-thanks {
    background: rgba(76, 175, 80, 0.25);
    color: #a5d6a7;
}

/* ============================================
   LOG COMPETITOR RATE CARD
   ============================================ */

.competitor-rate-card {
    border-color: #ff9800 !important;
}

.competitor-rate-card .rates-header {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.competitor-rate-card .rates-header h4 {
    color: #e65100;
}

.competitor-rate-card .rates-source {
    background: #ff9800;
    color: white;
}

/* Screenshot dropzone */
.competitor-screenshot {
    margin-bottom: 10px;
}

.screenshot-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px;
    border: 2px dashed #ffcc80;
    border-radius: 6px;
    background: #fffaf5;
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-dropzone:hover {
    border-color: #ff9800;
    background: #fff3e0;
}

.screenshot-dropzone.drag-over {
    border-color: #e65100;
    background: #ffe0b2;
}

.dropzone-icon {
    font-size: 18px;
}

.dropzone-text {
    font-size: 10px;
    color: #888;
}

.screenshot-preview {
    position: relative;
    max-height: 60px;
    overflow: hidden;
    border-radius: 6px;
}

.screenshot-preview img {
    width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.preview-clear {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

.screenshot-parsing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    color: #e65100;
    font-size: 11px;
}

.competitor-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.competitor-row {
    display: flex;
    gap: 12px;
}

.competitor-field {
    flex: 1;
}

.competitor-field.full-width {
    flex: 1 1 100%;
}

.competitor-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

.competitor-field label small {
    font-weight: normal;
    color: #888;
}

.rate-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rate-input-wrap span {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.competitor-field input,
.competitor-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.competitor-field input:focus,
.competitor-field select:focus {
    border-color: #ff9800;
    outline: none;
}

.competitor-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.competitor-thanks {
    color: #e65100;
    font-weight: 500;
    margin-top: 12px;
    padding: 8px;
    background: rgba(255, 152, 0, 0.15);
    border-radius: 6px;
    text-align: center;
}

.competitor-history {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #ffe0b2;
}

.history-header {
    font-size: 12px;
    font-weight: 600;
    color: #e65100;
    margin-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
}

.history-rate {
    font-weight: 600;
    color: #333;
}

.history-meta {
    color: #888;
    font-size: 11px;
}

/* Dark mode */
[data-theme="dark"] .competitor-rate-card {
    border-color: #b36800 !important;
}

[data-theme="dark"] .competitor-rate-card .rates-header {
    background: linear-gradient(135deg, #3d2e1f 0%, #4a3520 100%);
}

[data-theme="dark"] .competitor-rate-card .rates-header h4 {
    color: #ffb74d;
}

[data-theme="dark"] .screenshot-dropzone {
    border-color: #6d4c1d;
    background: #2a2a2a;
}

[data-theme="dark"] .screenshot-dropzone:hover {
    border-color: #b36800;
    background: #3d2e1f;
}

[data-theme="dark"] .dropzone-text {
    color: #888;
}

[data-theme="dark"] .competitor-field label {
    color: #ccc;
}

[data-theme="dark"] .competitor-field input,
[data-theme="dark"] .competitor-field select {
    background: #333;
    border-color: #555;
    color: #eee;
}

[data-theme="dark"] .rate-input-wrap span {
    color: #eee;
}

[data-theme="dark"] .competitor-thanks {
    background: rgba(255, 152, 0, 0.2);
    color: #ffcc80;
}

[data-theme="dark"] .competitor-history {
    border-color: #4a3520;
}

[data-theme="dark"] .history-header {
    color: #ffb74d;
}

[data-theme="dark"] .history-item {
    background: #333;
}

[data-theme="dark"] .history-rate {
    color: #eee;
}

/* Dark Mode - Accessorials */
[data-theme="dark"] .accessorials-card {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .accessorials-toggle {
    background: #333;
    color: #eee;
}

[data-theme="dark"] .accessorials-toggle:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .accessorials-toggle .toggle-icon {
    color: #aaa;
}

[data-theme="dark"] .accessorials-content {
    border-color: #444;
    background: #2a2a2a;
    color: #eee;
}

[data-theme="dark"] .accessorial-item {
    background: #3a3a3a !important;
    color: #eee !important;
}

[data-theme="dark"] .accessorial-item:hover {
    background: #444 !important;
}

[data-theme="dark"] .accessorial-item .acc-label,
[data-theme="dark"] .accessorial-item span {
    color: #eee !important;
}

[data-theme="dark"] .accessorial-item .acc-amount {
    color: #f5a623 !important;
}

[data-theme="dark"] .accessorial-group {
    color: #eee;
}

[data-theme="dark"] .accessorials-total {
    background: #3d3520;
    color: #ddd;
}

/* Dark Mode - Quote Builder */
[data-theme="dark"] .quote-builder-card {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .quote-builder-card h4 {
    color: #ddd;
    border-color: #444;
}

[data-theme="dark"] .quote-line {
    color: #ccc;
}

[data-theme="dark"] .quote-breakdown {
    border-color: #444;
}

/* Responsive */
@media (max-width: 600px) {
    .rate-feedback-card {
        grid-column: span 1;
    }
    .feedback-buttons {
        flex-direction: column;
    }
    .feedback-btn {
        flex-direction: row;
        justify-content: center;
    }
}


/* ==================== PERMIT FEEDBACK STYLES ==================== */
.permit-feedback-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}
.permit-feedback-header h3 { margin: 0 0 4px 0; color: #1a365d; font-size: 1.1rem; }
.permit-feedback-note { color: #718096; font-size: 0.85rem; margin: 0 0 16px 0; }
.permit-feedback-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.permit-feedback-item { background: white; border: 1px solid #e2e8f0; border-radius: 6px; padding: 12px; }
.permit-feedback-item label { display: block; font-weight: 600; color: #2d3748; margin-bottom: 8px; font-size: 0.9rem; }
.permit-feedback-btns { display: flex; gap: 6px; }
.permit-feedback-btns .feedback-btn { flex: 1; padding: 6px 8px; font-size: 0.75rem; }
.permit-feedback-actual { border-top: 1px solid #e2e8f0; padding-top: 16px; }
.permit-feedback-actual > label { display: block; font-weight: 500; color: #4a5568; margin-bottom: 10px; font-size: 0.9rem; }
.permit-actual-inputs { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.permit-actual-field { display: flex; align-items: center; gap: 6px; }
.permit-actual-field span { color: #718096; font-size: 0.85rem; white-space: nowrap; }
.permit-actual-field input { width: 100px; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 0.9rem; }
.permit-feedback-thanks { background: #c6f6d5; border: 1px solid #68d391; color: #276749; padding: 10px 14px; border-radius: 6px; margin-top: 12px; text-align: center; font-size: 0.9rem; }
[data-theme="dark"] .permit-feedback-section { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .permit-feedback-header h3 { color: #f3f4f6; }
[data-theme="dark"] .permit-feedback-note { color: #9ca3af; }
[data-theme="dark"] .permit-feedback-item { background: #111827; border-color: #374151; }
[data-theme="dark"] .permit-feedback-item label { color: #e5e7eb; }
[data-theme="dark"] .permit-feedback-actual { border-color: #374151; }
[data-theme="dark"] .permit-feedback-actual > label { color: #d1d5db; }
[data-theme="dark"] .permit-actual-field input { background: #111827; border-color: #374151; color: #f3f4f6; }
@media (max-width: 600px) { .permit-feedback-grid { grid-template-columns: 1fr; } .permit-actual-inputs { flex-direction: column; align-items: stretch; } .permit-actual-field { width: 100%; } .permit-actual-field input { flex: 1; } }
/* ==================== UPDATED DARK MODE + WIDER LAYOUT ==================== */

/* Wider container for desktop */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Updated Dark theme - modern slate palette with blue accent */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-accent: #3b82f6;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #1e3a5f;
    --accent-text: #60a5fa;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --header-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --input-bg: #1e293b;
    --input-border: #475569;
}

/* Dark mode specific overrides */
[data-theme="dark"] .container {
    background: transparent;
}

[data-theme="dark"] .tab-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .tabs {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

[data-theme="dark"] .tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
}

[data-theme="dark"] .tab-btn:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Inputs - cleaner dark styling */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-primary);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 10px 12px;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted);
}

/* Cards - cleaner borders, subtle glow */
[data-theme="dark"] .rates-card,
[data-theme="dark"] .competitor-rate-card,
[data-theme="dark"] .margin-card,
[data-theme="dark"] .accessorials-card,
[data-theme="dark"] .carriers-card,
[data-theme="dark"] .actual-rate-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .rates-card h4,
[data-theme="dark"] .competitor-rate-card h4 {
    color: var(--text-primary);
    font-weight: 600;
}

[data-theme="dark"] .rates-source {
    color: var(--accent-text);
    background: var(--accent-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Rate rows - better contrast */
[data-theme="dark"] .rate-row {
    background: var(--bg-primary);
    border-radius: 6px;
    margin: 4px 0;
}

[data-theme="dark"] .rate-row.rate-avg {
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
}

[data-theme="dark"] .rate-value {
    color: var(--text-primary);
    font-weight: 700;
}

[data-theme="dark"] .rate-per-mile {
    color: var(--text-muted);
}

/* Buttons - clean blue */
[data-theme="dark"] .btn-primary {
    background: var(--accent-primary);
    color: white;
    border: none;
    font-weight: 600;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--accent-hover);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--input-border);
}

/* Collapsible sections */
[data-theme="dark"] .collapsible-section,
[data-theme="dark"] .ratecheck-upload-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 16px;
}

[data-theme="dark"] .section-toggle,
[data-theme="dark"] .collapsible-header {
    background: transparent;
    color: var(--text-primary);
    border: none;
    padding: 14px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

[data-theme="dark"] .toggle-icon {
    color: var(--accent-text);
}

/* Paste target - cleaner */
[data-theme="dark"] .paste-target {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
}

[data-theme="dark"] .paste-target:hover,
[data-theme="dark"] .paste-target:focus {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* Map styling */
[data-theme="dark"] .map-col {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .map-miles-badge {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

/* Competitor card - cleaner */
[data-theme="dark"] .competitor-rate-card {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .competitor-rate-card .rates-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

[data-theme="dark"] .screenshot-dropzone {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

[data-theme="dark"] .screenshot-dropzone:hover {
    border-color: var(--accent-primary);
}

/* Info section */
[data-theme="dark"] .ratecheck-info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

[data-theme="dark"] .ratecheck-info-section h3 {
    color: var(--text-primary);
    margin-bottom: 4px;
}

[data-theme="dark"] .ratecheck-info-section .hint {
    color: var(--text-muted);
}

/* Labels */
[data-theme="dark"] label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Lane validation checkmarks */
[data-theme="dark"] .lane-validation {
    color: var(--success);
}

/* Card feedback buttons */
[data-theme="dark"] .card-feedback {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

[data-theme="dark"] .card-fb-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

[data-theme="dark"] .card-fb-btn:hover {
    background: var(--bg-accent);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .card-fb-btn.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Quote builder section */
[data-theme="dark"] .quote-breakdown {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 12px;
}

[data-theme="dark"] .quote-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .quote-line:last-child {
    border-bottom: none;
}

[data-theme="dark"] .sell-rate {
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-top: 12px;
}

[data-theme="dark"] .sell-value {
    color: var(--success);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Accessorials */
[data-theme="dark"] .accessorials-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

[data-theme="dark"] .accessorial-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

[data-theme="dark"] .accessorial-item:hover {
    border-color: var(--accent-primary);
}

[data-theme="dark"] .acc-label {
    flex: 1;
    color: var(--text-primary);
}

[data-theme="dark"] .acc-amount {
    color: var(--accent-text);
    font-weight: 500;
}

/* Header */
[data-theme="dark"] .header-banner {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

/* Footer */
[data-theme="dark"] .site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Subtab navigation */
[data-theme="dark"] .subtab-nav {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
}

[data-theme="dark"] .subtab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

[data-theme="dark"] .subtab-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Mobile - keep stacked */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 12px;
    }
    
    .top-row-layout,
    .rates-row-layout {
        grid-template-columns: 1fr;
    }
}

/* ==================== NEW RATE CHECK LAYOUT (Map-First) ==================== */

/* Main two-column layout */
.ratecheck-main-layout {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 24px;
    min-height: 500px;
}

/* Map Panel - Right Side */
.ratecheck-map-panel {
    position: relative;
}

.ratecheck-map-panel .map-container {
    position: relative;
    height: 100%;
    min-height: 480px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ratecheck-map-panel .ratecheck-map {
    height: 100%;
    width: 100%;
}

.ratecheck-map-panel .map-miles-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: var(--accent-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
}

.ratecheck-map-panel .map-expand-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary);
}

/* Form Panel - Left Side */
.ratecheck-form-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ratecheck-form-panel .form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.ratecheck-form-panel .form-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.ratecheck-form-panel .field-icon {
    margin-right: 4px;
}

/* Lane Row - Origin/Dest side by side */
.ratecheck-form-panel .lane-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.ratecheck-form-panel .lane-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ratecheck-form-panel .lane-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ratecheck-form-panel .lane-validation {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--success, #22c55e);
}

/* Route Type Toggle (Interstate / Non-Interstate) */
.route-type-toggle {
    display: flex;
    gap: 16px;
    padding-top: 4px;
}

.route-type-toggle .toggle-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.route-type-toggle .toggle-option input {
    accent-color: var(--accent-primary);
}

.route-type-toggle .toggle-option input:checked + span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Equipment Select */
.equipment-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.equipment-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Collapsible Dimensions */
.collapsible-dims {
    padding: 0 !important;
    overflow: hidden;
}

.dims-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
}

.dims-toggle:hover {
    background: var(--bg-accent);
}

.dims-toggle .toggle-arrow {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.dims-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.dims-content {
    padding: 0 16px 16px 16px;
}

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

.dim-field label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dim-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

/* Form Row (date + commodity) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 16px !important;
}

.form-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Full-width button */
.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
}

/* OCR Hint (collapsed) */
.ocr-hint {
    text-align: center;
    margin-top: 8px;
}

.ocr-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px;
}

.ocr-toggle-btn:hover {
    color: var(--accent-text);
}

.ocr-content {
    margin-top: 12px;
}

.paste-target-mini {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.paste-target-mini:hover,
.paste-target-mini:focus {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* Results Section */
.ratecheck-results-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Mobile responsive */
@media (max-width: 900px) {
    .ratecheck-main-layout {
        grid-template-columns: 1fr;
    }
    
    .ratecheck-map-panel .map-container {
        min-height: 300px;
    }
    
    .dims-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .lane-row {
        grid-template-columns: 1fr;
    }
}

/* Dark mode refinements for new layout */
[data-theme="dark"] .ratecheck-form-panel .form-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .ratecheck-map-panel .map-container {
    border-color: var(--border-color);
}

[data-theme="dark"] .dims-toggle:hover {
    background: rgba(255,255,255,0.05);
}

[data-theme="dark"] .paste-target-mini {
    background: var(--bg-primary);
}


/* ==================== SHARP DARK MODE V2 ==================== */

/* Modern dark palette with cyan/teal accent */
[data-theme="dark"] {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-accent: #1f2937;
    --bg-card: #151d2e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
    --border-hover: #334155;
    --accent-primary: #4a9eff;
    --accent-hover: #22d3ee;
    --accent-light: rgba(6, 182, 212, 0.1);
    --accent-text: #67e8f9;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --input-bg: #0f172a;
    --input-border: #1e293b;
}

/* Cleaner dark body */
[data-theme="dark"] body {
    background: var(--bg-primary);
}

/* Header - sleek gradient */
[data-theme="dark"] .header-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .header-banner h1 {
    color: #f8fafc;
}

/* Tab nav - minimal */
[data-theme="dark"] .tabs {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

[data-theme="dark"] .tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s;
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-accent);
}

[data-theme="dark"] .tab-btn.active {
    background: var(--accent-primary);
    color: #0f172a;
    font-weight: 600;
}

/* Form sections */
[data-theme="dark"] .ratecheck-form-panel .form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Inputs - cleaner */
[data-theme="dark"] input,
[data-theme="dark"] select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
    outline: none;
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
[data-theme="dark"] .btn-primary {
    background: var(--accent-primary);
    color: #0f172a;
    border: none;
    font-weight: 600;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--accent-hover);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-accent);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--border-hover);
    border-color: var(--border-hover);
}

/* Map container */
[data-theme="dark"] .ratecheck-map-panel .map-container {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

[data-theme="dark"] .map-miles-badge {
    background: var(--accent-primary);
    color: #0f172a;
    font-weight: 700;
}

/* Route type toggle */
[data-theme="dark"] .route-type-toggle .toggle-option {
    color: var(--text-muted);
}

[data-theme="dark"] .route-type-toggle .toggle-option input:checked + span {
    color: var(--accent-text);
}

/* Equipment dropdown */
[data-theme="dark"] .equipment-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .equipment-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Dims toggle */
[data-theme="dark"] .dims-toggle {
    color: var(--text-primary);
}

[data-theme="dark"] .dims-toggle:hover {
    background: var(--bg-accent);
}

/* OCR hint */
[data-theme="dark"] .ocr-toggle-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .ocr-toggle-btn:hover {
    color: var(--accent-text);
}

[data-theme="dark"] .paste-target-mini {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-muted);
}

[data-theme="dark"] .paste-target-mini:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

/* Rate cards */
[data-theme="dark"] .rates-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .rates-card h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .rates-source {
    background: var(--accent-light);
    color: var(--accent-text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

[data-theme="dark"] .rate-row {
    background: var(--bg-accent);
}

[data-theme="dark"] .rate-row.rate-avg {
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
}

[data-theme="dark"] .rate-value {
    color: var(--text-primary);
}

[data-theme="dark"] .sell-value {
    color: var(--success);
}

/* Subtab nav */
[data-theme="dark"] .subtab-nav {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .subtab-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .subtab-btn.active {
    background: var(--accent-primary);
    color: #0f172a;
}

/* Lane validation checkmark */
[data-theme="dark"] .lane-validation {
    color: var(--success);
}

/* Footer */
[data-theme="dark"] .site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-accent);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}


/* ==================== EQUIPMENT RECOMMENDATION ==================== */
.equipment-recommendation {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--accent-light);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
}

.equipment-recommendation:hover {
    background: rgba(8, 145, 178, 0.15);
    border-color: var(--accent-hover);
}

.equipment-recommendation .rec-icon {
    margin-right: 4px;
}

.equipment-recommendation strong {
    color: var(--accent-text);
}

.equipment-recommendation .rec-reason {
    color: var(--text-muted);
    font-size: 0.85em;
}

[data-theme="dark"] .equipment-recommendation {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .equipment-recommendation:hover {
    background: rgba(6, 182, 212, 0.2);
}

[data-theme="dark"] .equipment-recommendation strong {
    color: var(--accent-text);
}

/* Equipment select optgroup styling */
.equipment-select optgroup {
    font-weight: 600;
    color: var(--text-secondary);
}

.equipment-select option {
    padding: 8px;
}

/* ==================== LOG ACTUAL RATE COMPACT ==================== */
.actual-rate-card.compact {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
}

.actual-rate-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.actual-rate-label {
    font-weight: 500;
    color: var(--text-primary);
}

.actual-rate-inline .dollar-sign {
    color: var(--text-muted);
}

.actual-rate-inline input {
    width: 120px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* ==================== RATE ACTIONS ROW (Recommended + Log) ==================== */
.rate-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.recommended-rate-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0e7490 100%);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    flex-wrap: wrap;
}

.rec-label {
    font-weight: 500;
    font-size: 0.85rem;
    opacity: 0.9;
}

.rec-amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.rec-permile {
    font-size: 0.85rem;
    opacity: 0.8;
}

.rec-note {
    font-size: 0.75rem;
    opacity: 0.75;
    width: 100%;
    margin-top: 2px;
}

.rate-actions-row .actual-rate-card.compact {
    margin-top: 0;
    flex: 1;
    min-width: 200px;
}

/* TAI Integration Button */
.tai-integration {
    margin-top: 16px;
}

.tai-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.tai-btn .coming-soon {
    font-size: 0.85em;
    opacity: 0.7;
    font-style: italic;
}

.tai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== SUGGESTED START RATE CARD ==================== */
.start-rate-card {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #0e7490 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
    margin-top: 16px;
}

.start-rate-header {
    margin-bottom: 8px;
}

.start-rate-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-rate-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.start-rate-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.start-rate-permile {
    font-size: 1.1rem;
    opacity: 0.85;
}

.start-rate-note {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 8px;
}

/* Highway Link Card */
.highway-link-card {
    margin-top: 12px;
}

.highway-link-card .carrier-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
}

.highway-link-card .carrier-link:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .start-rate-card {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

/* Quote Builder */
.quote-builder.compact { min-width: 180px; }
.qb-inputs { padding: 10px; border-bottom: 1px solid var(--border-color); }
.qb-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.qb-row:last-child { margin-bottom: 0; }
.qb-row label { font-size: 12px; color: var(--text-secondary); }
.qb-row input { width: 70px; padding: 4px 6px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-primary); font-size: 13px; }
.qb-result { padding: 10px; }
.qb-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.qb-divider { height: 1px; background: var(--border-color); margin: 8px 0; }
.qb-line.qb-total { font-size: 15px; font-weight: 600; color: var(--success-color); }
.qb-line.qb-total span:last-child { font-size: 18px; }
.qb-line.qb-rpm { font-size: 11px; color: var(--text-muted); }

/* Simplify rate cards - single rate display */
.rate-row.rate-low, .rate-row.rate-high { display: none !important; }
.rates-confidence { display: none; }

/* Hide Network Rates card completely */
#networkRatesCard { display: none !important; }

/* Hide Greenscreens subtitle */
.rates-card.market-rates .rates-source { display: none !important; }

/* FreightDeck Rate card - hide Market Rate row and reasoning */
#aiRatesCard .rate-row:first-child { display: none !important; }
#aiRatesCard .ai-reasoning { display: none !important; }
#aiRatesCard .use-rate-row { display: none !important; }

/* Force cards to stay in a row */
.rates-row-layout {
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    align-items: flex-start;
}

.rates-row-layout > .rates-card {
    flex: 1;
    min-width: 0;
}

/* Quote Builder should not wrap below */
#quoteBuilderCard {
    flex: 0 0 220px !important;
}

/* Rate cards layout - stacked rates on left, quote builder on right */
.rates-row-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 12px !important;
}

#marketRatesCard {
    grid-column: 1;
    grid-row: 1;
}

#aiRatesCard {
    grid-column: 1;
    grid-row: 2;
}

#quoteBuilderCard {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

#quoteBuilderCard .qb-result {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#quoteBuilderCard .qb-line.qb-total {
    font-size: 20px;
}

#quoteBuilderCard .qb-line.qb-total span:last-child {
    font-size: 28px;
}

/* Quote Builder better styling */
#quoteBuilderCard {
    background: var(--card-bg) !important;
}

#quoteBuilderCard .rates-header {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

#quoteBuilderCard .qb-inputs {
    padding: 12px 16px;
    background: rgba(0,0,0,0.2);
}

#quoteBuilderCard .qb-row label {
    color: var(--text-primary);
    font-weight: 500;
}

#quoteBuilderCard .qb-result {
    padding: 16px;
}

#quoteBuilderCard .qb-line {
    color: var(--text-primary);
}

/* Accessorials section */
.qb-accessorials {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.acc-toggle {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.acc-toggle:hover {
    background: rgba(255,255,255,0.05);
}

.acc-content {
    padding: 8px 16px 12px;
    background: rgba(0,0,0,0.15);
}

.acc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
}

.acc-item input {
    margin: 0;
}

.acc-item span:last-child {
    margin-left: auto;
    color: var(--success-color);
    font-weight: 500;
}

.acc-item:has(input:checked) {
    color: var(--text-primary);
}

/* Permit Results Grid Layout */
.permit-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.permit-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.permit-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
    display: inline-block;
}

.permit-card h4 small {
    font-weight: normal;
    color: var(--text-secondary);
}

/* Dims grid inside permit card */
.permit-card .dims-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.permit-card .dim-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.permit-card .dim-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.permit-card .dim-value {
    font-weight: 600;
    color: var(--text-primary);
}

.permit-card .dim-value.height-warning {
    color: var(--warning-color);
}

.permit-card .dim-value.height-caution {
    color: #f59e0b;
}

/* State costs mini */
.state-costs-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.state-cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.state-cost-row.survey {
    color: #f59e0b;
}

.state-cost-row.subtotal {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Quote breakdown */
.quote-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quote-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.quote-row.total {
    border-top: 2px solid var(--accent-color);
    padding-top: 10px;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
}

.quote-rpm {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Warnings row */
.warnings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.warning-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.warning-badge.survey {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.warning-badge.daylight {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.warning-badge.weekend {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* State details collapsible */
.state-details {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.state-details summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.state-details[open] summary {
    border-bottom: 1px solid var(--border-color);
}

/* Permit disclaimers */
.permit-disclaimers {
    font-size: 11px;
    color: var(--text-muted);
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.permit-disclaimers p {
    margin: 4px 0;
}

/* Compact permit table */
.permit-table.compact {
    font-size: 12px;
}

.permit-table.compact th,
.permit-table.compact td {
    padding: 6px 10px;
}

.permit-table td.yes {
    color: var(--success-color);
    font-weight: 600;
}

.permit-table td.maybe {
    color: #f59e0b;
}

/* Fix Quote Builder text visibility */
#quoteBuilderCard .qb-row label,
#quoteBuilderCard .qb-line span {
    color: var(--text-primary) !important;
}

#quoteBuilderCard .qb-line span:first-child {
    color: var(--text-secondary) !important;
}

.acc-toggle {
    color: var(--text-primary) !important;
}

/* Permit results - 2/3 state breakdown, 1/3 quote summary */
.permit-results-grid {
    grid-template-columns: auto 2fr 1fr !important;
}

/* Overall dims card - make compact */
.permit-card.dims-card {
    padding: 12px;
}

.permit-card.dims-card h4 {
    font-size: 12px;
    margin-bottom: 8px;
}

.permit-card.dims-card .dims-grid {
    gap: 4px;
}

.permit-card.dims-card .dim-item {
    padding: 3px 0;
    font-size: 12px;
}

/* State card full details */
.permit-card.state-card {
    min-width: 0;
}

/* Permit results row - 2/3 state, 1/3 quote */
.permit-results-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* State details card with table */
.state-details-card {
    overflow-x: auto;
}

.state-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.state-table th,
.state-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.state-table th {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}

.state-table td.yes {
    color: var(--success-color);
}

.state-table td.warn {
    color: #f59e0b;
}

.state-table tfoot td {
    background: rgba(0,0,0,0.3);
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

/* Quote summary card */
.quote-summary-card {
    display: flex;
    flex-direction: column;
}

.quote-rows {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.q-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.q-row .q-sub {
    color: var(--text-muted);
    font-size: 11px;
}

.q-row.survey {
    color: #f59e0b;
}

.q-row.total {
    border-top: 2px solid var(--accent-color);
    border-bottom: none;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
}

.q-rpm {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* Overall dims in trailer section */
#trailerDeckInfo {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Overall dims display under trailer */
.overall-dims-mini {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.overall-dims-mini strong {
    color: var(--text-primary);
}

/* Workflow Helper - Permit Page */
.workflow-helper {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.workflow-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #94a3b8;
}
.workflow-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.workflow-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 220px;
}
.workflow-option:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}
.workflow-icon {
    font-size: 24px;
}
.workflow-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.workflow-text strong {
    color: #e2e8f0;
    font-size: 14px;
}
.workflow-text span {
    color: #94a3b8;
    font-size: 12px;
}

/* ==================== DIMS CONVERTER TWO-CARD LAYOUT ==================== */
.dims-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}
.dims-card {
    border-radius: 8px;
    padding: 16px;
}
.dims-card.input-card {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-left: 4px solid #3b82f6;
}
.dims-card.results-card {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid #10b981;
}
.dims-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.dims-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}
.unit-toggle {
    display: flex;
    gap: 4px;
}
.unit-toggle .mode-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    background: transparent;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.unit-toggle .mode-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}
/* Base dims table styles - overridden by unified block below */
.input-card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}
.btn-link {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 13px;
}
.btn-link:hover {
    text-decoration: underline;
}
.unit-select, .format-select {
    padding: 4px 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    color: #e2e8f0;
    font-size: 12px;
}
.dims-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
    text-align: center;
}
.placeholder-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}
.results-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}
.checkbox-col { width: 30px; text-align: center; }
.stackable-col { width: 50px; text-align: center; }

/* Upload section compact */
.upload-section-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    flex-wrap: wrap;
}
.paste-target-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.paste-target-compact:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}
.paste-target-compact .paste-icon { font-size: 18px; }
.paste-target-compact .paste-text { color: #e2e8f0; font-size: 13px; }
.paste-target-compact .paste-hint { color: #64748b; font-size: 11px; }
.paste-target-compact .paste-hint kbd {
    background: rgba(100, 116, 139, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
}
.upload-preview-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}
.image-preview-small {
    max-height: 40px;
    max-width: 80px;
    border-radius: 4px;
}
.ocr-status-inline {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: #94a3b8;
}

/* Lane section compact */
.lane-section-compact {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 8px;
}
.lane-inputs-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.lane-inputs-compact input {
    flex: 1;
    min-width: 150px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}
.lane-inputs-compact .lane-arrow {
    color: #64748b;
}

/* Oversize CTA */
.oversize-cta {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}
.oversize-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.oversize-cta-icon { font-size: 20px; }
.oversize-cta-text { flex: 1; color: #e2e8f0; }
.maybe-oversize-warning {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .dims-cards-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== DARK THEME OVERRIDES ==================== */

/* 2-column truck layout */
body #truckGroups {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Truck cards - lighter gray tinted background */
body .truck-group {
    background: rgba(60, 60, 65, 0.9) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
}

/* AI Recommendations / FreightDeck Intelligence panel */
body .ai-recommendations {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-left: 4px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .ai-recommendations h3 {
    color: #e2e8f0 !important;
    margin-bottom: 12px !important;
}

/* Warning banner - match OD card style (orange tint) */
body .loadbuilder-warning,
body .od-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    border-left: 4px solid #f59e0b !important;
    border-radius: 8px !important;
    color: #e2e8f0 !important;
}

/* State Regulations page dark theme */
body #stateregs {
    background: transparent !important;
}

body .state-regs-container,
body .regs-content {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

body .regs-table th {
    background: rgba(30, 41, 59, 0.6) !important;
    color: #94a3b8 !important;
}

body .regs-table td {
    background: transparent !important;
    color: #e2e8f0 !important;
    border-color: rgba(100, 116, 139, 0.2) !important;
}

body .regs-table tr:hover td {
    background: rgba(59, 130, 246, 0.08) !important;
}

/* Unassigned pieces pool */
body .unassigned-pool {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

body .piece-card {
    background: rgba(45, 50, 60, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

body .piece-card:hover {
    border-color: #3b82f6 !important;
}

/* Remove all white backgrounds */
body .card,
body .panel,
body .section,
body .box {
    background: rgba(30, 41, 59, 0.4) !important;
}

/* Permit results styling */
body .permit-results,
body #permitResults {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

body .cost-summary {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
}

body .trailer-summary {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-left: 4px solid #3b82f6 !important;
}

/* Mobile responsive for truck grid */
@media (max-width: 900px) {
    body #truckGroups {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== RATE CHECK DARK THEME ==================== */

/* Rate cards row - 3 columns */
body .rates-row-layout {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* Base rate card - dark theme */
body .rates-card,
body .margin-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    color: #e2e8f0 !important;
}

/* Market Rates - Blue tint */
body .rates-card.market-rates {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-left: 4px solid #3b82f6 !important;
    border-top: none !important;
}

/* Network Rates - Purple tint */
body .rates-card.network-rates {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-left: 4px solid #3b82f6 !important;
    border-top: none !important;
}

/* AI/FreightDeck Rates - Orange tint */
body .rates-card.ai-rates {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    border-left: 4px solid #f59e0b !important;
    border-top: none !important;
}

/* Lane History - Gray tint */
body .rates-card.lane-history {
    background: rgba(60, 60, 65, 0.9) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-left: 4px solid #64748b !important;
}

/* Truck Rate Card - Green tint */
body .rates-card.truck-rate-card {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
}

/* Rate card headers */
body .rates-card .rates-header {
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .rates-card .rates-header h4 {
    color: #e2e8f0 !important;
}

body .rates-card.market-rates .rates-header h4 { color: #60a5fa !important; }
body .rates-card.network-rates .rates-header h4 { color: #60a5fa !important; }
body .rates-card.ai-rates .rates-header h4 { color: #fbbf24 !important; }

/* Source badges */
body .rates-source {
    background: rgba(100, 116, 139, 0.3) !important;
    color: #94a3b8 !important;
}

body .market-rates .rates-source {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

body .network-rates .rates-source {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

body .ai-rates .rates-source.beta-tag {
    background: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

/* Rate values */
body .rate-row {
    color: #e2e8f0 !important;
}

body .rate-label {
    color: #94a3b8 !important;
}

body .rate-value {
    color: #e2e8f0 !important;
}

body .rate-per-mile {
    color: #64748b !important;
}

/* Target/avg row highlight */
body .rate-row.rate-avg {
    background: rgba(16, 185, 129, 0.1) !important;
    border-radius: 6px !important;
    padding: 8px !important;
    margin: 4px -4px !important;
}

body .rate-row.rate-avg .rate-value {
    color: #10b981 !important;
    font-weight: 700 !important;
}

/* AI prediction row */
body .rate-row.rate-ai-prediction {
    background: rgba(245, 158, 11, 0.15) !important;
    border-radius: 6px !important;
}

body .rate-row.rate-ai-prediction .rate-value {
    color: #fbbf24 !important;
}

/* Confidence display */
body .rates-confidence {
    color: #94a3b8 !important;
}

body .rates-confidence .conf-value {
    color: #e2e8f0 !important;
}

/* AI reasoning box */
body .ai-reasoning {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #94a3b8 !important;
}

/* Feedback buttons */
body .card-feedback {
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
    padding-top: 8px !important;
    margin-top: 8px !important;
}

body .card-feedback-label {
    color: #64748b !important;
}

body .card-fb-btn {
    background: rgba(100, 116, 139, 0.2) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #94a3b8 !important;
}

body .card-fb-btn:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
    color: #e2e8f0 !important;
}

/* Lane stats */
body .lane-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
}

body .lane-stat {
    text-align: center !important;
}

body .lane-stat .stat-label {
    color: #64748b !important;
    font-size: 11px !important;
}

body .lane-stat .stat-value {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

/* Rate bottom actions */
body .rate-bottom-actions {
    display: flex;
    gap: 16px !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
}

/* Quote Builder Card - Green tint */
body .rates-card.quote-builder,
body .quote-builder-card {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
}

/* Mobile: stack rate cards */
@media (max-width: 1024px) {
    body .rates-row-layout {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 768px) {
    body .rates-row-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== RATE CHECK FORM DARK THEME ==================== */

/* Form panels */
body .ratecheck-form-panel,
body .permit-form-panel {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

/* Form sections */
body .form-section {
    margin-bottom: 12px !important;
}

body .form-section label {
    color: #94a3b8 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body .form-section .field-icon {
    margin-right: 4px !important;
}

/* Inputs */
body .ratecheck-form-panel input,
body .ratecheck-form-panel select,
body .permit-form-panel input,
body .permit-form-panel select {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
}

body .ratecheck-form-panel input:focus,
body .ratecheck-form-panel select:focus,
body .permit-form-panel input:focus,
body .permit-form-panel select:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

body .ratecheck-form-panel input::placeholder,
body .permit-form-panel input::placeholder {
    color: #64748b !important;
}

/* Equipment select */
body .equipment-select {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
}

body .equipment-select optgroup {
    background: #1e293b !important;
    color: #94a3b8 !important;
}

body .equipment-select option {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Lane validation */
body .lane-validation {
    font-size: 11px !important;
    margin-top: 4px !important;
}

/* OCR hint section */
body .ocr-hint {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .ocr-toggle-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

body .ocr-toggle-btn:hover {
    color: #3b82f6 !important;
}

body .paste-target-mini {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px dashed rgba(59, 130, 246, 0.4) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    text-align: center !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    margin-top: 8px !important;
}

body .paste-target-mini:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: #3b82f6 !important;
}

/* Map panels */
body .ratecheck-map-panel,
body .permit-map-panel {
    background: rgba(30, 41, 59, 0.3) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

body .map-placeholder {
    background: rgba(30, 41, 59, 0.6) !important;
    color: #64748b !important;
}

body .map-placeholder-icon {
    font-size: 48px !important;
    opacity: 0.5 !important;
}

body .map-miles-badge {
    background: rgba(16, 185, 129, 0.9) !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}

/* Primary button */
body .btn-primary.btn-large {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border: none !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

body .btn-primary.btn-large:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4) !important;
}

/* ==================== PERMIT RESULTS - 2 CARD LAYOUT ==================== */

/* Results section container */
body .permit-results-section {
    margin-top: 20px !important;
}

/* Two-card row: State Breakdown (2/3) + Quote Summary (1/3) */
body .permit-cards-row {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* Base permit card */
body .permit-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .permit-card h4 {
    color: #e2e8f0 !important;
    margin: 0 0 12px 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* State Breakdown Card - Blue tint */
body .permit-card.state-breakdown {
    background: rgba(59, 130, 246, 0.06) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-left: 4px solid #3b82f6 !important;
}

/* Quote Summary Card - Green tint */
body .permit-card.quote-summary-card {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
}

/* State breakdown table */
body .state-breakdown-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
}

body .state-breakdown-table th {
    text-align: left !important;
    padding: 8px 10px !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.3) !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
}

body .state-breakdown-table td {
    padding: 8px 10px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
    color: #e2e8f0 !important;
}

body .state-breakdown-table td.yes {
    color: #10b981 !important;
    font-weight: 500 !important;
}

body .state-breakdown-table td.no {
    color: #64748b !important;
}

body .state-breakdown-table tr:hover td {
    background: rgba(59, 130, 246, 0.08) !important;
}

/* Quote summary line items */
body .quote-line-item {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
}

body .quote-line-item .label {
    color: #94a3b8 !important;
    font-size: 13px !important;
}

body .quote-line-item .value {
    color: #e2e8f0 !important;
    font-weight: 500 !important;
}

body .quote-line-item.total {
    border-top: 2px solid rgba(16, 185, 129, 0.4) !important;
    border-bottom: none !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}

body .quote-line-item.total .label {
    color: #10b981 !important;
    font-weight: 600 !important;
}

body .quote-line-item.total .value {
    color: #10b981 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Warnings row */
body .warnings-row {
    display: flex;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin-bottom: 16px !important;
}

body .warning-badge {
    padding: 8px 14px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body .warning-badge.survey {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
}

body .warning-badge.daylight {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

body .warning-badge.weekend {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #f87171 !important;
}

/* Permit disclaimers */
body .permit-disclaimers {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 12px 16px !important;
    font-size: 11px !important;
    color: #64748b !important;
}

body .permit-disclaimers strong {
    color: #94a3b8 !important;
}

body .permit-disclaimers ul {
    margin: 8px 0 0 16px !important;
    padding: 0 !important;
}

body .permit-disclaimers li {
    margin: 4px 0 !important;
}

/* Old permit table styling (fallback) */
body .permit-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

body .permit-table th {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #94a3b8 !important;
    padding: 10px 12px !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
}

body .permit-table td {
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
    color: #e2e8f0 !important;
}

body .permit-table .permit-row {
    background: rgba(245, 158, 11, 0.05) !important;
}

body .permit-table .status-yes {
    color: #10b981 !important;
    font-weight: 600 !important;
}

body .permit-table .status-no {
    color: #64748b !important;
}

body .permit-table .status-maybe {
    color: #f59e0b !important;
}

/* Cost summary box */
body .cost-summary {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

body .cost-summary h3 {
    color: #10b981 !important;
    margin: 0 0 12px 0 !important;
}

body .cost-grid {
    display: grid !important;
    gap: 8px !important;
}

body .cost-item {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
}

body .cost-item .cost-label {
    color: #94a3b8 !important;
}

body .cost-item .cost-value {
    color: #e2e8f0 !important;
    font-weight: 500 !important;
}

body .cost-item.total {
    border-top: 2px solid rgba(16, 185, 129, 0.4) !important;
    border-bottom: none !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}

body .cost-item.total .cost-label,
body .cost-item.total .cost-value {
    color: #10b981 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Trailer summary box */
body .trailer-summary {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-left: 4px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

body .trailer-summary h3 {
    color: #3b82f6 !important;
    margin: 0 0 12px 0 !important;
}

body .trailer-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

body .trailer-summary-item {
    display: flex;
    justify-content: space-between !important;
}

body .trailer-summary-item .label {
    color: #94a3b8 !important;
}

body .trailer-summary-item .value {
    color: #e2e8f0 !important;
    font-weight: 500 !important;
}

body .trailer-summary-item.highlight .value {
    color: #10b981 !important;
}

body .trailer-summary-item.highlight .value.height-warning {
    color: #f59e0b !important;
}

/* Survey & travel warnings */
body .survey-warning,
body .travel-restrictions-warning,
body .superload-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    border-left: 4px solid #f59e0b !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    margin-bottom: 12px !important;
    color: #e2e8f0 !important;
}

body .survey-warning strong,
body .travel-restrictions-warning strong,
body .superload-warning strong {
    color: #fbbf24 !important;
}

/* Mobile responsive */
@media (max-width: 900px) {
    body .permit-cards-row {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== STATE REGULATIONS DARK THEME ==================== */

body .state-regs-section {
    padding: 10px 12px !important;
}

/* Header row: title + selector + disclaimer inline */
.sr-header {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin-bottom: 8px !important;
    flex-wrap: wrap !important;
}
.sr-header h2 {
    color: #e2e8f0 !important;
    font-size: 16px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}
.sr-selector select {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    min-width: 180px !important;
}
.sr-disclaimer {
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-style: italic !important;
    margin-left: auto !important;
}

/* 3-column grid */
.sr-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}

/* Compact card */
.sr-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    border-left: 3px solid #475569 !important;
}
.sr-card h4 {
    color: #e2e8f0 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    margin: 0 0 6px 0 !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Card color variants */
.sr-card.sr-blue { background: rgba(59, 130, 246, 0.06) !important; border-left-color: #3b82f6 !important; }
.sr-card.sr-blue h4 { color: #60a5fa !important; }
.sr-card.sr-green { background: rgba(16, 185, 129, 0.06) !important; border-left-color: #10b981 !important; }
.sr-card.sr-green h4 { color: #34d399 !important; }
.sr-card.sr-orange { background: rgba(245, 158, 11, 0.06) !important; border-left-color: #f59e0b !important; }
.sr-card.sr-orange h4 { color: #fbbf24 !important; }
.sr-card.sr-amber { background: rgba(245, 158, 11, 0.04) !important; border-left-color: #f59e0b !important; }
.sr-card.sr-amber h4 { color: #fbbf24 !important; }
.sr-card.sr-purple { background: rgba(139, 92, 246, 0.06) !important; border-left-color: #8b5cf6 !important; }
.sr-card.sr-purple h4 { color: #a78bfa !important; }
.sr-card.sr-slate { background: rgba(51, 65, 85, 0.4) !important; border-left-color: #64748b !important; }
.sr-card.sr-slate h4 { color: #94a3b8 !important; }
.sr-card.sr-red { background: rgba(239, 68, 68, 0.06) !important; border-left-color: #ef4444 !important; }
.sr-card.sr-red h4 { color: #f87171 !important; }

/* Compact rows */
.sr-row {
    display: flex !important;
    justify-content: space-between !important;
    padding: 3px 0 !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.08) !important;
    font-size: 12px !important;
}
.sr-row:last-of-type { border-bottom: none !important; }
.sr-row span:first-child { color: #94a3b8 !important; }
.sr-row span:last-child { color: #e2e8f0 !important; font-weight: 500 !important; text-align: right !important; }

/* Notes text */
.sr-notes {
    font-size: 11px !important;
    color: #94a3b8 !important;
    line-height: 1.3 !important;
    margin-top: 4px !important;
    font-style: italic !important;
}

/* Cost reference bar */
.sr-cost-bar {
    display: flex !important;
    gap: 0 !important;
    margin-top: 8px !important;
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px solid rgba(71, 85, 105, 0.25) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    font-size: 11px !important;
    color: #94a3b8 !important;
}
.sr-cost-bar > div {
    flex: 1 !important;
    padding: 6px 10px !important;
    border-right: 1px solid rgba(71, 85, 105, 0.25) !important;
    line-height: 1.3 !important;
}
.sr-cost-bar > div:last-child { border-right: none !important; }
.sr-cost-bar strong { color: #cbd5e1 !important; font-size: 11px !important; }

/* Mobile */
@media (max-width: 900px) {
    .sr-grid-3 { grid-template-columns: 1fr 1fr !important; }
    .sr-cost-bar { flex-wrap: wrap !important; }
    .sr-cost-bar > div { flex: 1 1 45% !important; }
}
@media (max-width: 600px) {
    .sr-grid-3 { grid-template-columns: 1fr !important; }
    .sr-cost-bar > div { flex: 1 1 100% !important; }
}

/* Keep old classes working for any other references */
body .info-card { display: none !important; }
body .state-info-grid { display: none !important; }

/* Mobile */
@media (max-width: 768px) {
    body .state-info-grid {
        grid-template-columns: 1fr !important;
    }
    
    body .info-card.full-width {
        grid-column: span 1 !important;
    }
}

/* ==================== LOAD BUILDER DARK THEME ==================== */

/* Load builder container */
body #loadbuild {
    padding: 16px !important;
}

/* Top row: Intelligence + Unassigned Pool side by side */
body .loadbuilder-top-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
}

/* FreightDeck Intelligence panel */
body .ai-recommendations {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-left: 4px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .ai-recommendations h4 {
    color: #60a5fa !important;
    margin: 0 0 8px 0 !important;
    font-size: 15px !important;
}

body .ai-recommendations .hint {
    color: #64748b !important;
    font-size: 12px !important;
    margin-bottom: 12px !important;
}

body .recommendations-list {
    display: flex;
    flex-direction: column !important;
    gap: 8px !important;
}

body .recommendation-item {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    cursor: pointer !important;
    transition: all 0.15s !important;
}

body .recommendation-item:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #3b82f6 !important;
}

body .recommendation-item.selected {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
}

/* Unassigned pieces pool */
body .loadbuilder-pool {
    background: rgba(60, 60, 65, 0.6) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
    padding: 16px !important;
}

body .loadbuilder-pool h3 {
    color: #e2e8f0 !important;
    font-size: 15px !important;
    margin: 0 0 8px 0 !important;
}

body .loadbuilder-pool .hint {
    color: #64748b !important;
    font-size: 12px !important;
    margin-bottom: 12px !important;
}

body .piece-pool {
    min-height: 80px !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 2px dashed rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 12px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

body .piece-pool .empty-state {
    color: #64748b !important;
    font-size: 13px !important;
    width: 100% !important;
    text-align: center !important;
    padding: 20px !important;
}

/* Piece cards */
body .piece-card {
    background: rgba(45, 50, 60, 0.95) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    cursor: grab !important;
    transition: all 0.15s !important;
    min-width: 140px !important;
}

body .piece-card:hover {
    border-color: #3b82f6 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body .piece-card.dragging {
    opacity: 0.5 !important;
}

body .piece-card .piece-name {
    color: #e2e8f0 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    margin-bottom: 4px !important;
}

body .piece-card .piece-dims {
    color: #94a3b8 !important;
    font-size: 11px !important;
}

body .piece-card .piece-weight {
    color: #64748b !important;
    font-size: 11px !important;
}

/* Accepted plan banner */
body .accepted-plan {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

body .accepted-plan-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
}

body .accepted-plan-header h4 {
    color: #10b981 !important;
    margin: 0 !important;
}

body .plan-header-actions {
    display: flex;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

body .accepted-plan-details {
    color: #e2e8f0 !important;
}

body .accepted-plan-actions {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(16, 185, 129, 0.2) !important;
    display: flex;
    align-items: center !important;
    gap: 12px !important;
}

body .action-hint {
    color: #64748b !important;
    font-size: 12px !important;
}

/* Trucks section */
body .loadbuilder-trucks {
    margin-top: 16px !important;
}

body .trucks-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
}

body .trucks-header h3 {
    color: #e2e8f0 !important;
    margin: 0 !important;
}

/* Truck groups - 2 column grid (already defined but reinforcing) */
body .truck-groups,
body #truckGroups {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Individual truck card */
body .truck-group {
    background: rgba(60, 60, 65, 0.9) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
    padding: 14px !important;
}

body .truck-group.od-truck {
    border-left: 4px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.05) !important;
}

body .truck-group .truck-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .truck-group .truck-name {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

body .truck-group .truck-type {
    color: #94a3b8 !important;
    font-size: 12px !important;
}

body .truck-group .truck-pieces {
    min-height: 60px !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 2px dashed rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 8px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

body .truck-group .truck-summary {
    margin-top: 10px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
}

body .truck-group .truck-summary strong {
    color: #e2e8f0 !important;
}

/* OD warning in truck */
body .truck-od-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    margin-top: 8px !important;
    font-size: 11px !important;
    color: #fbbf24 !important;
}

/* Permit action button row */
body .trucks-permit-action,
body .export-plan-action,
body .generate-quote-action {
    margin-top: 16px !important;
    text-align: center !important;
}

/* Mobile */
@media (max-width: 900px) {
    body .loadbuilder-top-row {
        grid-template-columns: 1fr !important;
    }
    
    body .truck-groups,
    body #truckGroups {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== GLOBAL DARK THEME POLISH ==================== */

/* All buttons base */
body .btn {
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all 0.15s !important;
}

body .btn-primary {
    background: #3b82f6 !important;
    border: none !important;
    color: white !important;
}

body .btn-primary:hover {
    background: #2563eb !important;
}

body .btn-secondary {
    background: rgba(100, 116, 139, 0.2) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
}

body .btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3) !important;
    border-color: rgba(100, 116, 139, 0.5) !important;
}

body .btn-success {
    background: #10b981 !important;
    border: none !important;
    color: white !important;
}

body .btn-success:hover {
    background: #059669 !important;
}

body .btn-outline {
    background: transparent !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
    color: #94a3b8 !important;
}

body .btn-outline:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
}

body .btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

/* Hint text */
body .hint {
    color: #64748b !important;
    font-size: 12px !important;
}

/* Section titles */
body h2, body h3 {
    color: #e2e8f0 !important;
}

/* All selects */
body select {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
}

body select:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
}

body select option {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* All text inputs */
body input[type=text],
body input[type=number],
body input[type=date],
body input[type=email],
body textarea {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
    border-radius: 6px !important;
}

body input::placeholder {
    color: #64748b !important;
}

body input:focus,
body textarea:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* Tables general */
body table {
    color: #e2e8f0 !important;
}

body th {
    color: #94a3b8 !important;
}

body td {
    color: #e2e8f0 !important;
}

/* Links */
body a {
    color: #60a5fa !important;
}

body a:hover {
    color: #93c5fd !important;
}

/* Scrollbar styling */
body ::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

body ::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.4) !important;
}

body ::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4) !important;
    border-radius: 4px !important;
}

body ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6) !important;
}

/* OCR status */
body .ocr-status {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    color: #94a3b8 !important;
}

/* Loading spinner */
body .spinner-small,
body .loading-spinner {
    border-color: rgba(59, 130, 246, 0.2) !important;
    border-top-color: #3b82f6 !important;
}

/* Modals */
body .modal,
body .modal-content {
    background: #1e293b !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
}

body .modal-header {
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .modal-footer {
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

/* Tooltips */
body [title]:hover::after {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

/* Focus visible for accessibility */
body *:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* Badge/tag styling */
body .badge,
body .tag {
    background: rgba(100, 116, 139, 0.2) !important;
    color: #94a3b8 !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
}

/* Empty states */
body .empty-state {
    color: #64748b !important;
    text-align: center !important;
    padding: 24px !important;
}

/* Dividers */
body hr {
    border: none !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

/* ==================== DIMS CONVERTER COMPACT LAYOUT ==================== */

/* Dims lane inputs - show inline above cards */
body #dims .lane-section-compact.dims-lane {
    margin: 8px 0 12px 0 !important;
    padding: 8px 12px !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
}

/* Dims cards row - tighter spacing */
body .dims-cards-row {
    gap: 12px !important;
    margin-top: 12px !important;
}

/* Smaller input fields */
body .dims-card {
    padding: 12px !important;
}

body .dims-input-table input {
    padding: 4px 6px !important;
    font-size: 12px !important;
    min-width: 40px !important;
}

body .dims-input-table th {
    padding: 4px 6px !important;
    font-size: 10px !important;
}

body .dims-input-table td {
    padding: 3px 4px !important;
}

/* Compact card headers */
body .dims-card-header {
    margin-bottom: 8px !important;
    padding-bottom: 8px !important;
}

body .dims-card-header h4 {
    font-size: 13px !important;
}

/* Upload section - hidden, replaced by dims-toolbar */
body .upload-section-compact {
    display: none !important;
}

/* Flashing extract button */
@keyframes pulse-extract {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

body #extractBtn.extracting,
body .btn.extracting {
    animation: pulse-extract 1.5s infinite !important;
    background: linear-gradient(135deg, #3b82f6 0%, #3b82f6 100%) !important;
}

/* OCR status while extracting */
body .ocr-status.loading {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #60a5fa !important;
    animation: pulse-extract 1.5s infinite !important;
}

/* Reorder dims page layout */
body #dims.active, body #dims[style*="display: block"] {
    display: flex;
    flex-direction: column !important;
}

body #dims.tab-content > .dims-cards-row {
    order: 1 !important;
}

body #dims.tab-content > .dims-toolbar {
    order: 2 !important;
}

body #dims .ocr-preview {
    order: 3 !important;
}

body #dims .oversize-cta,
body #dims .maybe-oversize-warning {
    order: 4 !important;
}

/* ==================== QUOTE BUILDER CARD ==================== */

body .rates-card.quote-builder {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    border-left: 4px solid #10b981 !important;
    display: block !important;
}

body .rates-card.quote-builder .rates-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
}

body .rates-card.quote-builder .rates-header h4 {
    color: #10b981 !important;
}

body .quote-builder-inputs {
    margin-bottom: 10px !important;
}

body .quote-input-row {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

body .quote-input-row label {
    color: #94a3b8 !important;
    font-size: 12px !important;
}

body .quote-input-row input {
    width: 80px !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    text-align: right !important;
}

body .input-with-unit {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
}

body .unit-prefix,
body .unit-suffix {
    color: #64748b !important;
    font-size: 12px !important;
}

/* Accessorials section */
body .accessorials-section {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 10px !important;
    margin: 10px 0 !important;
}

body .accessorial-row {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 6px !important;
}

body .accessorial-row:last-child {
    margin-bottom: 0 !important;
}

body .accessorial-row label {
    color: #94a3b8 !important;
    font-size: 11px !important;
}

body .accessorial-row input {
    width: 70px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    text-align: right !important;
}

body .fsc-row {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
}

body .fsc-auto {
    font-size: 10px !important;
    color: #64748b !important;
    background: rgba(59, 130, 246, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

body .btn-xs {
    padding: 2px 6px !important;
    font-size: 10px !important;
}

/* Quote result */
body .quote-result {
    padding-top: 8px !important;
}

body .quote-line {
    display: flex;
    justify-content: space-between !important;
    padding: 4px 0 !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
}

body .quote-divider {
    height: 1px !important;
    background: rgba(100, 116, 139, 0.2) !important;
    margin: 8px 0 !important;
}

body .quote-line.quote-total {
    font-size: 16px !important;
    font-weight: 700 !important;
}

body .quote-line.quote-total span:first-child {
    color: #10b981 !important;
}

body .quote-line.quote-total span:last-child {
    color: #10b981 !important;
}

body .quote-line.quote-rpm {
    font-size: 11px !important;
    color: #64748b !important;
}

/* Toggle accessorials button */
body #toggleAccessorials {
    font-size: 11px !important;
    color: #64748b !important;
}

body #toggleAccessorials:hover {
    color: #10b981 !important;
}

/* Convert Button - prominent action */
body #convertBtn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
    transition: all 0.2s ease !important;
}
body #convertBtn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5) !important;
}

/* =============================================
   CRISP UI FIXES - CLEAN VERSION
   ============================================= */

/* === TAB VISIBILITY === */
.tab-content {
    display: none !important;
}
.tab-content.active {
    display: block !important;
}

/* === DIMS TAB SPECIFIC === */
#dims.tab-content.active {
    display: flex;
    flex-direction: column !important;
}

/* === INFO CARDS (State Regs) === */
.info-card {
    background: #1e2337 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-left: 3px solid #0891b2 !important;
    border-radius: 8px !important;
    padding: 20px !important;
}
.info-card:nth-child(1) h3 { color: #fbbf24 !important; }
.info-card:nth-child(2) h3 { color: #22c55e !important; }
.info-card:nth-child(3) h3 { color: #f87171 !important; }
.info-card:nth-child(4) h3 { color: #60a5fa !important; }
.info-row {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    border-bottom: none !important;
}
.info-label { color: #9ca3af !important; }
.info-value { color: #f9fafb !important; font-weight: 500 !important; }

/* === DIMS EXTRACT AREA (replaced by dims-toolbar) === */
#dims .upload-section-compact {
    display: none !important;
    gap: 30px !important;
    padding: 24px !important;
    background: rgba(30, 41, 59, 0.3) !important;
    border-radius: 12px !important;
    margin-bottom: 20px !important;
}

/* Lane inputs inside upload section */
#dims .upload-section-compact .lane-inputs-compact {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 6px 0 0 0 !important;
    margin-top: 0 !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
    padding-top: 10px !important;
}
#dims .upload-section-compact .lane-inputs-compact input {
    flex: 1 !important;
    padding: 5px 8px !important;
    font-size: 13px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #e2e8f0 !important;
    min-width: 100px !important;
}
#dims .upload-section-compact .lane-inputs-compact .lane-arrow {
    color: #64748b !important;
    flex-shrink: 0 !important;
}
#dims .upload-section-compact .lane-validation {
    font-size: 11px !important;
}

/* Hide old standalone dims-lane section (now inside upload) */
body #dims .lane-section-compact.dims-lane {
    display: none !important;
}
#dims .upload-section-compact.has-image .paste-target-compact {
    display: none !important;
}
#dims .upload-preview-compact {
    display: flex;
    align-items: center !important;
    gap: 24px !important;
}
#dims .image-preview-small {
    max-width: 250px !important;
    max-height: 200px !important;
    border-radius: 8px !important;
}
#dims .preview-actions {
    display: flex;
    flex-direction: column !important;
    gap: 10px !important;
}
#dims #extractBtn {
    padding: 14px 32px !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    font-weight: 600 !important;
}
#dims .ocr-status-inline {
    padding: 12px 24px !important;
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    border-radius: 8px !important;
    color: #4ade80 !important;
}

/* ==============================================
   DIMS CONVERTER - UNIFIED DESIGN (replaces all prior dims table CSS)
   Both cards and both tables share identical visual rules
   ============================================== */

/* --- CARD CONTAINERS: identical styling --- */
#dims .dims-card.input-card,
#dims .dims-card.results-card {
    background: #1e2337 !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-left: 3px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 14px !important;
    overflow: visible !important;
    max-height: none !important;
}

/* Card headers: identical */
#dims .dims-card-header {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15) !important;
}
#dims .dims-card-header h4 {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    margin: 0 !important;
}
/* Remove green color from results header - match input */
#dims .results-card .dims-card-header h4 {
    color: #e2e8f0 !important;
}

/* --- TABLE CONTAINERS --- */
#dims .dims-input-table,
#dims .dims-output-table {
    width: 100% !important;
    overflow-x: auto !important;
}

/* --- TABLE ELEMENT --- */
#dims #inputTable,
#dims #outputTable {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 2px 2px !important;
    table-layout: fixed !important;
}

/* --- COLUMN WIDTHS: input table --- */
/* Cols: desc | L | W | H | weight | unit-select | delete */
#dims #inputTable th:nth-child(1),
#dims #inputTable td:nth-child(1) { width: 48px !important; }  /* desc */
#dims #inputTable th:nth-child(2),
#dims #inputTable td:nth-child(2) { width: auto !important; }  /* L */
#dims #inputTable th:nth-child(3),
#dims #inputTable td:nth-child(3) { width: auto !important; }  /* W */
#dims #inputTable th:nth-child(4),
#dims #inputTable td:nth-child(4) { width: auto !important; }  /* H */
#dims #inputTable th:nth-child(5),
#dims #inputTable td:nth-child(5) { width: 60px !important; }  /* weight */
#dims #inputTable th:nth-child(6),
#dims #inputTable td:nth-child(6) { width: 36px !important; }  /* unit select */
#dims #inputTable th:nth-child(7),
#dims #inputTable td:nth-child(7) { width: 28px !important; }  /* delete */

/* --- COLUMN WIDTHS: output table --- */
/* Cols: checkbox | desc | L | W | H | wt | stackable */
#dims #outputTable th:nth-child(1),
#dims #outputTable td:nth-child(1) { width: 28px !important; }   /* checkbox */
#dims #outputTable th:nth-child(2),
#dims #outputTable td:nth-child(2) { width: 36px !important; }   /* desc */
#dims #outputTable th:nth-child(3),
#dims #outputTable td:nth-child(3) { width: auto !important; }   /* L */
#dims #outputTable th:nth-child(4),
#dims #outputTable td:nth-child(4) { width: auto !important; }   /* W */
#dims #outputTable th:nth-child(5),
#dims #outputTable td:nth-child(5) { width: auto !important; }   /* H */
#dims #outputTable th:nth-child(6),
#dims #outputTable td:nth-child(6) { width: 72px !important; }   /* wt */
#dims #outputTable th:nth-child(7),
#dims #outputTable td:nth-child(7) { width: 28px !important; }   /* stackable */

/* --- HEADER CELLS: identical for both --- */
#dims #inputTable th,
#dims #outputTable th {
    padding: 4px 3px !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    text-align: center !important;
    background: transparent !important;
    line-height: 1.2 !important;
    border: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

/* --- DATA CELLS: identical for both --- */
#dims #inputTable td,
#dims #outputTable td {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-radius: 4px !important;
    padding: 3px 4px !important;
    font-size: 12px !important;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace !important;
    line-height: 20px !important;
    height: 26px !important;
    color: #e2e8f0 !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    font-weight: 400 !important;
}

/* --- INPUT FIELDS inside input table: invisible, inherit cell look --- */
#dims #inputTable input,
#dims #inputTable select {
    background: transparent !important;
    border: none !important;
    color: #e2e8f0 !important;
    font-size: 12px !important;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace !important;
    line-height: 20px !important;
    height: 20px !important;
    text-align: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
#dims #inputTable select {
    height: 20px !important;
}
#dims #inputTable input:focus {
    outline: none !important;
}

/* --- dim-ft-in containers: seamless inside cells --- */
#dims .dim-ft-in {
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    height: 20px !important;
    width: 100% !important;
}
#dims .dim-ft-in input {
    width: 28px !important;
    min-width: 20px !important;
    flex: 1 !important;
    padding: 0 !important;
    text-align: center !important;
}
#dims .dim-ft-in .dim-label {
    font-size: 10px !important;
    color: #64748b !important;
    flex-shrink: 0 !important;
    line-height: 20px !important;
}

/* --- Hide number spinners --- */
#dims input[type="number"]::-webkit-inner-spin-button,
#dims input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
#dims input[type="number"] {
    -moz-appearance: textfield !important;
}

/* --- ROW BACKGROUNDS: transparent, no zebra, no selection highlight --- */
#dims #inputTable tbody tr,
#dims #outputTable tbody tr,
#dims #outputTable tbody tr:nth-child(odd),
#dims #outputTable tbody tr:nth-child(even),
#dims #outputTable tbody tr.selected,
#dims #outputTable tbody tr:not(.selected) {
    background: transparent !important;
    height: auto !important;
    opacity: 1 !important;
}
/* Deselected output rows: dim slightly */
#dims #outputTable tbody tr:not(.selected) {
    opacity: 0.5 !important;
}

/* --- CHECKBOX & STACKABLE cols: no cell bg/border --- */
#dims #outputTable th:nth-child(1),
#dims #outputTable td:nth-child(1),
#dims #outputTable th:nth-child(7),
#dims #outputTable td:nth-child(7) {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    font-family: inherit !important;
}
#dims #outputTable input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
    accent-color: #3b82f6 !important;
    cursor: pointer !important;
}

/* --- DELETE BUTTON col: no cell bg/border --- */
#dims #inputTable th:nth-child(7),
#dims #inputTable td:nth-child(7) {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    width: 28px !important;
    font-family: inherit !important;
}
#dims #inputTable .delete-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    opacity: 0.5 !important;
    padding: 0 !important;
}
#dims #inputTable .delete-btn:hover {
    opacity: 1 !important;
}

/* --- UNIT SELECT col: no cell bg/border --- */
#dims #inputTable th:nth-child(6),
#dims #inputTable td:nth-child(6) {
    background: transparent !important;
    border: none !important;
    padding: 2px !important;
    font-family: inherit !important;
}
#dims #inputTable .row-weight-unit,
#dims #inputTable .row-length-unit {
    font-size: 10px !important;
    color: #64748b !important;
    background: transparent !important;
    border: none !important;
    text-align: center !important;
    cursor: pointer !important;
    height: 20px !important;
}

/* --- OD VALUES: red highlight --- */
#dims #outputTable td.od-value {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #ef4444 !important;
    font-weight: 600 !important;
}

/* --- Override old output table CSS (from ~line 930) --- */
#outputTable td {
    font-weight: 400 !important;
}
#outputTable td:nth-child(2),
#outputTable td:nth-child(3),
#outputTable td:nth-child(4),
#outputTable td:nth-child(5),
#outputTable td:nth-child(6) {
    font-family: inherit !important;
    color: inherit !important;
}
#outputTable tbody tr.selected {
    background-color: transparent !important;
}

/* --- INPUT CARD ACTIONS --- */
#dims .input-card-actions {
    display: flex;
    align-items: center !important;
    gap: 10px !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
}
#dims .input-card-actions .unit-select,
#dims #weightUnit,
#dims #defaultLengthUnit {
    display: none !important;
}
#dims #convertBtn {
    padding: 8px 20px !important;
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
    font-size: 13px !important;
    cursor: pointer !important;
}
#dims #addRowBtn {
    font-size: 12px !important;
}

/* --- FORMAT SELECT (output card header) --- */
#dims .format-select {
    padding: 4px 8px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #e2e8f0 !important;
    font-size: 12px !important;
}

/* --- PLACEHOLDER --- */
#dims .dims-results-placeholder { 
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 60px 20px !important;
    color: #64748b !important;
}
#dims #outputSection[style*="block"] ~ .dims-results-placeholder,
#dims .dims-output-table:not(:empty) ~ .dims-results-placeholder {
    display: none !important;
}
#dims #outputSection:not([style*="none"]) ~ #resultsPlaceholder,
#dims #outputSection[style*="block"] ~ #resultsPlaceholder {
    display: none !important;
}

/* --- RESULTS ACTION BUTTONS --- */
#dims .results-card-actions {
    display: flex;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
}
#dims .results-card-actions .btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}
#dims .results-card-actions .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: none !important;
    color: white !important;
}
#dims .results-card-actions .btn-secondary {
    background: rgba(100, 116, 139, 0.2) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: #94a3b8 !important;
}
#dims .results-card-actions .btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3) !important;
    color: #e2e8f0 !important;
}


/* =============================================
   DIMS TOOLBAR (Lane + Upload in one compact row)
   ============================================= */
#dims .dims-toolbar {
    display: flex;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    margin-top: 8px !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    flex-wrap: wrap !important;
}
#dims .dims-toolbar-lane {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 !important;
    min-width: 0 !important;
}
#dims .dims-toolbar-lane input {
    flex: 1 !important;
    padding: 5px 8px !important;
    font-size: 13px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #e2e8f0 !important;
    min-width: 80px !important;
}
#dims .dims-toolbar-lane input.commodity-input {
    max-width: 120px !important;
}
#dims .dims-toolbar-lane input:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
}
#dims .dims-toolbar-lane .lane-arrow {
    color: #64748b !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}
#dims .dims-toolbar-upload {
    display: flex;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}
#dims .paste-target-mini {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px dashed rgba(59, 130, 246, 0.4) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    transition: border-color 0.2s !important;
}
#dims .paste-target-mini:hover,
#dims .paste-target-mini:focus {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.15) !important;
    color: #e2e8f0 !important;
}
#dims .paste-target-mini .paste-icon {
    font-size: 14px !important;
}
#dims .paste-target-mini .paste-text {
    font-size: 12px !important;
}
#dims .dims-toolbar .lane-validation {
    display: none !important;
}
#dims .dims-toolbar .upload-preview-compact {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
}
#dims .dims-toolbar .image-preview-small {
    max-height: 40px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
}

/* =============================================
   LOAD BUILDER - DARK THEME STYLING
   ============================================= */

/* Main section */
#loadbuild {
    padding: 16px !important;
}

#loadbuild h2 {
    color: #e2e8f0 !important;
    font-size: 1.3rem !important;
    margin-bottom: 8px !important;
}

#loadbuild > p {
    color: #94a3b8 !important;
    font-size: 13px !important;
    margin-bottom: 12px !important;
}

/* Warning banner - dark style */
#loadbuild .loadbuilder-warning {
    background: rgba(251, 191, 36, 0.1) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    border-left: 3px solid #fbbf24 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    font-size: 13px !important;
    color: #fcd34d !important;
}

#loadbuild .loadbuilder-warning strong {
    color: #fbbf24 !important;
}

/* Unassigned Pieces Pool */
#loadbuild .loadbuilder-pool {
    background: #1e2337 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-left: 3px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    margin-bottom: 16px !important;
}

#loadbuild .loadbuilder-pool h3 {
    color: #60a5fa !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

#loadbuild .loadbuilder-pool .hint {
    color: #64748b !important;
    font-size: 12px !important;
}

#loadbuild .pool-header {
    display: flex;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 4px !important;
}
#loadbuild .pool-header h3 {
    margin: 0 !important;
}
#loadbuild .piece-pool {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px dashed rgba(100, 116, 139, 0.25) !important;
    border-radius: 6px !important;
    min-height: 40px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    padding: 6px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

#loadbuild .piece-pool .empty-state {
    color: #64748b !important;
    font-size: 13px !important;
}

/* Piece Cards - DARK & compact */
#loadbuild .piece-card,
#loadbuild .draggable-piece {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-radius: 5px !important;
    padding: 4px 8px !important;
    cursor: grab !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    color: #cbd5e1 !important;
    transition: all 0.15s !important;
}

#loadbuild .piece-card:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

#loadbuild .piece-card.dragging {
    opacity: 0.5 !important;
}

#loadbuild .piece-card .piece-name {
    background: #3b82f6 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    font-size: 11px !important;
}

#loadbuild .piece-card .piece-dims {
    color: #94a3b8 !important;
    font-size: 11px !important;
}

#loadbuild .piece-card .piece-weight {
    color: #64748b !important;
    font-size: 11px !important;
}

/* OD badges */
#loadbuild .piece-card .od-badge {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
}

/* =============================================
   TRUCKS SECTION - HORIZONTAL LAYOUT
   ============================================= */

#loadbuild .loadbuilder-trucks {
    background: #1e2337 !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-left: 3px solid #10b981 !important;
    border-radius: 8px !important;
    padding: 12px !important;
}

#loadbuild .loadbuilder-trucks h3 {
    color: #34d399 !important;
    font-size: 14px !important;
    margin-bottom: 10px !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Trucks container - HORIZONTAL grid */
#loadbuild .trucks-container,
#loadbuild #trucksContainer {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)) !important;
    gap: 12px !important;
}

/* Individual Truck Card - DARK */
#loadbuild .truck-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

#loadbuild .truck-card .truck-header {
    background: rgba(16, 185, 129, 0.15) !important;
    padding: 8px 12px !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

#loadbuild .truck-card .truck-header span {
    color: #34d399 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

#loadbuild .truck-card .truck-header button {
    background: transparent !important;
    border: none !important;
    color: #ef4444 !important;
    cursor: pointer !important;
    font-size: 16px !important;
}

/* Truck drop zone - DARK */
#loadbuild .truck-card .truck-pieces,
#loadbuild .truck-card .piece-drop-zone {
    background: rgba(20, 30, 45, 0.5) !important;
    min-height: 50px !important;
    padding: 8px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 4px !important;
    border: 1px dashed rgba(100, 116, 139, 0.2) !important;
    margin: 8px !important;
    border-radius: 4px !important;
}

#loadbuild .truck-card .truck-pieces .empty-hint {
    color: #64748b !important;
    font-size: 12px !important;
    width: 100% !important;
    text-align: center !important;
}

/* Truck stats */
#loadbuild .truck-card .truck-stats {
    padding: 8px 12px !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
    display: flex;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

#loadbuild .truck-card .truck-stats strong {
    color: #e2e8f0 !important;
}

/* Trailer select */
#loadbuild .truck-card select {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    color: #e2e8f0 !important;
    font-size: 12px !important;
    margin: 0 8px 8px 8px !important;
    width: calc(100% - 16px) !important;
}

#loadbuild .truck-card .recommended {
    color: #10b981 !important;
    font-size: 11px !important;
}

/* Add Truck button */
#loadbuild .add-truck-btn,
#loadbuild [id*="addTruck"] {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px dashed rgba(16, 185, 129, 0.4) !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    color: #34d399 !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

#loadbuild .add-truck-btn:hover {
    background: rgba(16, 185, 129, 0.25) !important;
}

/* AI Auto-Build button */
#loadbuild .ai-build-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

#loadbuild .ai-build-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}

/* Fix truck groups container */
#loadbuild #truckGroups,
#loadbuild .truck-groups {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 12px !important;
}

/* Trucks header with buttons */
#loadbuild .trucks-header {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

#loadbuild .trucks-header h3 {
    margin: 0 !important;
    color: #34d399 !important;
}

#loadbuild .trucks-header .btn {
    margin-left: 8px !important;
}

/* Compact layout for trucks */
#loadbuild .truck-group {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

#loadbuild .truck-group-header {
    background: rgba(16, 185, 129, 0.15) !important;
    padding: 8px 12px !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

#loadbuild .truck-group-header .truck-name {
    color: #34d399 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
}

#loadbuild .truck-group-pieces {
    min-height: 40px !important;
    padding: 8px !important;
    background: rgba(20, 30, 45, 0.5) !important;
}

#loadbuild .truck-group-stats {
    padding: 8px 12px !important;
    font-size: 11px !important;
    color: #94a3b8 !important;
    background: rgba(30, 41, 59, 0.4) !important;
}

/* Action buttons at bottom */
#loadbuild .trucks-permit-action,
#loadbuild .export-plan-action,
#loadbuild .generate-quote-action {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(100, 116, 139, 0.2) !important;
}

/* Dark theme for truck visualizations */
.truck-viz {
    background: #1a1f2e !important;
    border-top: 1px dashed rgba(100, 116, 139, 0.3) !important;
}

.viz-trailer {
    background: linear-gradient(to bottom, #2d3748 0%, #1a202c 100%) !important;
    border: 2px solid #4a5568 !important;
}

.viz-label-front, .viz-label-rear {
    color: #64748b !important;
}

.trailer-viz {
    background: #1a1f2e !important;
    border: 2px solid #4a5568 !important;
}

.trailer-front, .trailer-rear {
    color: #64748b !important;
}

/* OD/Legal badges for truck headers */
.truck-od-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.truck-legal-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* AI Build preview panel */
.ai-build-preview {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
}

.ai-build-preview.active {
    display: block;
}

.ai-build-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ai-build-stat {
    background: rgba(30, 41, 59, 0.6);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.ai-build-stat .count {
    font-weight: 700;
    color: #3b82f6;
    font-size: 18px;
}

.ai-build-stat .label {
    color: #94a3b8;
    font-size: 12px;
}

.ai-build-actions {
    display: flex;
    gap: 12px;
}

/* Improved AI Build Preview */
.ai-build-preview {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 8px 0 0 !important;
    margin-bottom: 0 !important;
    text-align: center !important;
}

.ai-build-preview .ai-build-summary {
    justify-content: center !important;
    gap: 24px !important;
}

.ai-build-preview .ai-build-stat {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    min-width: 120px !important;
}

.ai-build-preview .ai-build-actions {
    justify-content: center !important;
    margin-top: 16px !important;
}

/* Truck Navigation for Permits Page */
.truck-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    margin-bottom: 16px;
}
.truck-nav-label {
    font-size: 16px;
    color: #e2e8f0;
}
.truck-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Overall Dims Display for Permits */
.permit-overall-dims {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}
.permit-overall-dims .dim-item {
    text-align: center;
}
.permit-overall-dims .dim-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
}
.permit-overall-dims .dim-value {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
}
.permit-overall-dims .dim-value.warning {
    color: #f87171;
}

/* Two-Card Permit Results Layout */
.permit-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 900px) {
    .permit-results-grid {
        grid-template-columns: 1fr;
    }
}
.permit-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    padding: 16px;
}
.permit-card h4 {
    margin: 0 0 12px 0;
    color: #60a5fa;
    font-size: 14px;
}
.state-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    font-size: 13px;
}
.state-row:last-child {
    border-bottom: none;
}
.state-name {
    color: #e2e8f0;
    font-weight: 500;
}
.state-cost {
    color: #4ade80;
}
.cost-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}
.cost-label {
    color: #94a3b8;
}
.cost-value {
    color: #e2e8f0;
    font-weight: 500;
}
.cost-row.total {
    border-top: 2px solid rgba(59, 130, 246, 0.5);
    margin-top: 8px;
    padding-top: 12px;
}
.cost-row.total .cost-label,
.cost-row.total .cost-value {
    color: #60a5fa;
    font-weight: 700;
    font-size: 16px;
}

/* Travel Restrictions Compact */
.travel-restrictions-compact {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    margin-top: 12px;
}
.travel-restrictions-compact h5 {
    margin: 0 0 6px 0;
    color: #f59e0b;
    font-size: 12px;
}
.travel-restrictions-compact p {
    margin: 0;
    color: #fcd34d;
    line-height: 1.4;
}

/* More compact cost summary */
body .cost-summary {
    padding: 14px !important;
    margin-bottom: 12px !important;
}
body .cost-summary h3 {
    font-size: 14px !important;
    margin-bottom: 10px !important;
}
body .cost-grid {
    display: flex;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
body .cost-item {
    flex: 1 1 150px !important;
    padding: 8px 12px !important;
    background: rgba(0,0,0,0.2) !important;
    border-radius: 6px !important;
}
body .cost-item.total {
    flex: 1 1 100% !important;
    margin-top: 4px !important;
}
body .cost-label {
    font-size: 11px !important;
}
body .cost-value {
    font-size: 16px !important;
}
body .cost-note {
    font-size: 10px !important;
    margin-top: 8px !important;
    opacity: 0.7;
}

/* Compact permit table */
body .permit-table {
    font-size: 12px !important;
    margin-top: 12px !important;
}
body .permit-table th,
body .permit-table td {
    padding: 6px 8px !important;
}

/* Hide the separate load configuration since we have Overall Dims */
body .trailer-summary {
    display: none !important;
}

/* Two-card permit results layout */
#permitResults .cost-summary,
#permitResultsContent .cost-summary {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    padding: 16px !important;
}

#permitResults .cost-grid,
#permitResultsContent .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 8px !important;
}

#permitResults .cost-item,
#permitResultsContent .cost-item {
    display: flex;
    justify-content: space-between !important;
    padding: 8px 12px !important;
    background: rgba(0,0,0,0.15) !important;
    border-radius: 6px !important;
    flex: none !important;
}

#permitResults .cost-item.total,
#permitResultsContent .cost-item.total {
    background: rgba(59, 130, 246, 0.2) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    margin-top: 8px !important;
}

/* State table more compact */
#permitResults .permit-table,
#permitResultsContent .permit-table {
    font-size: 11px !important;
}

#permitResults .permit-table th,
#permitResults .permit-table td,
#permitResultsContent .permit-table th,
#permitResultsContent .permit-table td {
    padding: 5px 8px !important;
}

/* Responsive */
@media (max-width: 768px) {
    #permitResults .cost-summary,
    #permitResultsContent .cost-summary {
        grid-template-columns: 1fr !important;
    }
}

/* Compact travel restrictions */
#permitResults .travel-restrictions-compact,
#permitResultsContent .travel-restrictions-compact {
    font-size: 11px !important;
    padding: 8px 12px !important;
}

/* Fix permit cost layout - remove grid, make compact */
#permitResults .cost-summary,
#permitResultsContent .cost-summary {
    display: block !important;
    grid-template-columns: none !important;
    padding: 12px !important;
}

#permitResults .cost-grid,
#permitResultsContent .cost-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

#permitResults .cost-item,
#permitResultsContent .cost-item {
    flex: none !important;
    padding: 6px 10px !important;
}

#permitResults .cost-item.total,
#permitResultsContent .cost-item.total {
    grid-column: span 2 !important;
}

/* Even more compact permit table */
#permitResults .permit-table,
#permitResultsContent .permit-table {
    font-size: 10px !important;
    margin-top: 8px !important;
}

#permitResults .permit-table th,
#permitResults .permit-table td {
    padding: 4px 6px !important;
}

/* Compact overall dims */
.permit-overall-dims {
    padding: 8px 12px !important;
    gap: 16px !important;
    margin-bottom: 8px !important;
}

.permit-overall-dims .dim-value {
    font-size: 16px !important;
}

/* Truck nav compact */
.truck-nav {
    padding: 8px 16px !important;
    margin-bottom: 8px !important;
}

/* Permit results section compact */
#permitResultsSection h3 {
    margin-bottom: 8px !important;
    font-size: 16px !important;
}

/* Hide the Estimated Costs h3 */
#permitResults .cost-summary h3,
#permitResultsContent .cost-summary h3 {
    display: none !important;
}

/* Two-column permit layout: State table LEFT, Cost summary RIGHT */
#permitResults {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

#permitResults .permit-overall-dims {
    width: 100%;
    order: 1;
}

#permitResults .permit-left-card {
    flex: 1 1 55%;
    min-width: 400px;
    order: 2;
}

#permitResults .permit-right-card {
    flex: 1 1 40%;
    min-width: 300px;
    order: 3;
}

#permitResults .travel-restrictions-compact,
#permitResults .survey-warning,
#permitResults .superload-warning {
    width: 100%;
    order: 4;
}

#permitResults .permit-export-buttons {
    width: 100%;
    order: 5;
}

#permitResults .truck-nav {
    width: 100%;
    order: 6;
}

/* Make state table more compact */
#permitResults .permit-table {
    font-size: 12px;
}

#permitResults .permit-table th,
#permitResults .permit-table td {
    padding: 6px 8px;
}

/* Responsive - stack on mobile */
@media (max-width: 900px) {
    #permitResults .permit-left-card,
    #permitResults .permit-right-card {
        flex: 1 1 100%;
        min-width: 100%;
    }
    #permitResults .permit-right-card {
        order: 3;
    }
    #permitResults .permit-left-card {
        order: 2;
    }
}

/* FORCE two-column layout: State table LEFT, Cost summary RIGHT */
body #permitResults,
body #permitResultsContent {
    display: flex;
    flex-wrap: wrap !important;
    gap: 16px !important;
}

body #permitResults > .permit-overall-dims,
body #permitResultsContent > .permit-overall-dims {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 1 !important;
}

body #permitResults > .permit-left-card,
body #permitResultsContent > .permit-left-card {
    flex: 1 1 55% !important;
    min-width: 450px !important;
    order: 2 !important;
}

body #permitResults > .permit-right-card,
body #permitResults > .cost-summary,
body #permitResultsContent > .permit-right-card,
body #permitResultsContent > .cost-summary {
    flex: 1 1 40% !important;
    min-width: 320px !important;
    order: 3 !important;
}

body #permitResults > .travel-restrictions-compact,
body #permitResults > .survey-warning,
body #permitResults > .superload-warning,
body #permitResultsContent > .travel-restrictions-compact {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 4 !important;
}

body #permitResults > .permit-export-actions,
body #permitResultsContent > .permit-export-actions {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 5 !important;
}

body #permitResults > .truck-nav,
body #permitResultsContent > .truck-nav {
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 6 !important;
}

/* Clean cost summary layout */
.cost-summary-clean {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid #10b981;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.cost-summary-clean .cost-line {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.cost-summary-clean .cost-line:last-child {
    border-bottom: none;
}

.cost-summary-clean .cost-line.total {
    border-top: 2px solid rgba(16, 185, 129, 0.4);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: bold;
    font-size: 1.1em;
}

.cost-summary-clean .cost-label {
    flex: 1;
    color: #94a3b8;
}

.cost-summary-clean .cost-value {
    font-weight: 600;
    color: #f1f5f9;
    min-width: 120px;
    text-align: right;
}

.cost-summary-clean .cost-line.total .cost-value {
    color: #10b981;
}

.cost-summary-clean .details-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 12px;
}

.cost-summary-clean .details-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Details popup panel */
.permit-details-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1e293b;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.permit-details-panel .details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

.permit-details-panel h4 {
    margin: 0;
    color: #f1f5f9;
}

.permit-details-panel .close-details {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
}

.permit-details-panel .close-details:hover {
    color: #f1f5f9;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.details-table th,
.details-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.details-table th {
    background: rgba(0,0,0,0.2);
    color: #94a3b8;
    font-weight: 500;
}

.details-table .yes {
    color: #10b981;
    font-weight: 600;
}

.details-note {
    font-size: 11px;
    color: #64748b;
    margin-top: 12px;
    font-style: italic;
}

/* Backdrop when panel is open */
.permit-details-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

/* Editable cost inputs */
.cost-summary-clean .cost-input-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #f1f5f9;
    font-weight: 600;
}

.cost-summary-clean .cost-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    color: #f1f5f9;
    font-weight: 600;
    padding: 4px 8px;
    width: 100px;
    text-align: right;
    font-size: 14px;
}

.cost-summary-clean .cost-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.cost-summary-clean .markup-input {
    width: 60px;
}

.cost-summary-clean .cost-line.editable .cost-label {
    color: #94a3b8;
}

.cost-summary-clean .cost-line.truck-total {
    border-top: 1px solid rgba(100, 116, 139, 0.3);
    margin-top: 8px;
    padding-top: 10px;
}

.cost-summary-clean .cost-line.truck-total .cost-label {
    font-weight: 600;
    color: #94a3b8;
}

.cost-summary-clean .cost-line.truck-total .cost-value {
    color: #f1f5f9;
}

.cost-summary-clean .cost-line.markup {
    background: rgba(59, 130, 246, 0.05);
    margin: 8px -16px;
    padding: 10px 16px;
}

.cost-summary-clean .cost-line.customer {
    background: rgba(16, 185, 129, 0.1);
    margin: 0 -16px -16px -16px;
    padding: 14px 16px;
    border-radius: 0 0 8px 8px;
}

.cost-summary-clean .cost-line.customer .cost-label {
    font-weight: 700;
    color: #10b981;
    font-size: 1.05em;
}

.cost-summary-clean .cost-line.customer .cost-value {
    color: #10b981;
    font-size: 1.15em;
    font-weight: 700;
}

/* Improved Overall Dimensions Display */
.permit-overall-dims-v2 {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.permit-overall-dims-v2 .dims-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.permit-overall-dims-v2 .dims-title {
    font-weight: 600;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.permit-overall-dims-v2 .trailer-badge {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.permit-overall-dims-v2 .dims-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.permit-overall-dims-v2 .dim-box {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 2px solid transparent;
}

.permit-overall-dims-v2 .dim-box.legal {
    border-color: rgba(16, 185, 129, 0.3);
}

.permit-overall-dims-v2 .dim-box.warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.permit-overall-dims-v2 .dim-box.od {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.permit-overall-dims-v2 .dim-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.permit-overall-dims-v2 .dim-value {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 4px;
}

.permit-overall-dims-v2 .dim-box.od .dim-value {
    color: #ef4444;
}

.permit-overall-dims-v2 .dim-box.warning .dim-value {
    color: #f59e0b;
}

.permit-overall-dims-v2 .dim-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.permit-overall-dims-v2 .dim-box.legal .dim-status {
    color: #10b981;
}

.permit-overall-dims-v2 .dim-box.warning .dim-status {
    color: #f59e0b;
}

.permit-overall-dims-v2 .dim-box.od .dim-status {
    color: #ef4444;
}

/* Responsive */
@media (max-width: 700px) {
    .permit-overall-dims-v2 .dims-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Collapsed warnings section */
.warnings-collapsed {
    margin: 12px 0;
}

.warnings-collapsed .warnings-toggle {
    width: 100%;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}

.warnings-collapsed .warnings-toggle:hover {
    background: rgba(245, 158, 11, 0.15);
}

.warnings-collapsed .toggle-icon {
    transition: transform 0.2s;
}

.warnings-collapsed.expanded .toggle-icon {
    transform: rotate(180deg);
}

.warnings-collapsed .warnings-content {
    display: none;
    padding: 12px 0;
}

.warnings-collapsed.expanded .warnings-content {
    display: block;
}

/* Make warnings more compact */
.warnings-content .survey-warning,
.warnings-content .travel-restrictions-compact,
.warnings-content .superload-warning {
    margin-bottom: 8px;
    padding: 10px 12px;
    font-size: 12px;
}

/* Hide state table completely */
.permit-state-table-hidden {
    display: none !important;
}

/* Details button inline */
.cost-line .details-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.cost-line .details-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Details button in cost-summary cost-item */
.cost-summary .details-btn,
.cost-grid .details-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.cost-summary .details-btn:hover,
.cost-grid .details-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Permit rate inputs */
.rate-input {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
    text-align: right;
}
.rate-input:focus {
    outline: none;
    border-color: #3b82f6;
}
.markup-row .cost-value {
    display: flex;
    align-items: center;
    gap: 4px;
}
.markup-row .rate-input {
    width: 50px;
}
.cost-item.truck-cost {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.cost-item.customer-price {
    background: rgba(34, 197, 94, 0.15) !important;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.cost-item.customer-price .cost-value {
    color: #22c55e;
    font-weight: 700;
}

/* Compact dims bar */
.permit-dims-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    align-items: center;
    font-size: 13px;
}
.permit-dims-compact .trailer-tag {
    background: #3b82f6;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}
.permit-dims-compact .dim-tag {
    color: #94a3b8;
    padding: 4px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}
.permit-dims-compact .dim-tag.od {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    font-weight: 600;
}

/* Financial statement style - vertical stacked */
.cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
}
.cost-item {
    display: flex;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    background: transparent !important;
    border-radius: 0 !important;
}
.cost-item:last-child {
    border-bottom: none !important;
}
.cost-item.markup-row {
    background: rgba(0,0,0,0.1) !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}
.cost-item.total {
    border-top: 2px solid rgba(255,255,255,0.2) !important;
    margin-top: 8px !important;
    padding-top: 12px !important;
}
.cost-item.truck-cost {
    background: transparent !important;
    border: none !important;
}
.cost-item.customer-price {
    background: rgba(34, 197, 94, 0.1) !important;
    border-radius: 6px !important;
    margin-top: 4px !important;
}

/* Details button in cost items */
.cost-item .details-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
}
.cost-item .details-btn:hover {
    background: rgba(59, 130, 246, 0.4);
    color: #fff;
}

/* Ensure details panel shows above everything */
.permit-details-panel {
    z-index: 9999 !important;
}

/* Force financial statement single column layout */
.financial-statement {
    display: block !important;
    max-width: 500px !important;
    margin: 0 auto !important;
}
.financial-statement .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
}
.financial-statement .cost-item {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.financial-statement .cost-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.financial-statement .cost-value {
    text-align: right;
    font-weight: 600;
}

/* FINAL FIX: Force single column financial statement */
body #permitResults .cost-summary.financial-statement,
body #permitResultsContent .cost-summary.financial-statement {
    display: block !important;
    grid-template-columns: unset !important;
    max-width: 480px !important;
    margin: 0 auto 16px auto !important;
    padding: 0 !important;
    background: rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}
body #permitResults .cost-summary.financial-statement h3,
body #permitResultsContent .cost-summary.financial-statement h3 {
    padding: 12px 16px !important;
    margin: 0 !important;
    background: rgba(0,0,0,0.2) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}
body #permitResults .cost-summary.financial-statement .cost-grid,
body #permitResultsContent .cost-summary.financial-statement .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
    grid-template-columns: unset !important;
}
body #permitResults .cost-summary.financial-statement .cost-item,
body #permitResultsContent .cost-summary.financial-statement .cost-item {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    background: transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
body .cost-summary.financial-statement .cost-item.truck-cost {
    background: rgba(59, 130, 246, 0.1) !important;
    border-top: 2px solid rgba(255,255,255,0.15) !important;
    margin-top: 8px !important;
}
body .cost-summary.financial-statement .cost-item.customer-price {
    background: rgba(34, 197, 94, 0.15) !important;
}

/* Fix $ placement - inline with input */
.cost-value {
    display: flex;
    align-items: center !important;
    gap: 4px !important;
}
.cost-value .dollar {
    font-weight: 600;
    color: #94a3b8;
}
.cost-value .rate-input {
    width: 80px !important;
}

/* Center the dims bar */
.permit-dims-compact {
    justify-content: center !important;
    margin: 0 auto 16px auto !important;
    max-width: fit-content !important;
}

/* Move warnings below - ensure it comes after cost summary */
.warnings-collapsed {
    order: 99 !important;
    margin-top: 16px !important;
}

/* Make permit results a flex column to control order */
#permitResultsContent {
    display: flex;
    flex-direction: column !important;
}
#permitResultsContent > .permit-dims-compact { order: 1; }
#permitResultsContent > .cost-summary { order: 2; }
#permitResultsContent > .warnings-collapsed { order: 3; }
#permitResultsContent > .permit-export-actions { order: 4; }
#permitResultsContent > #permitDetailsPanel { order: 5; }

/* Wider markup input */
.markup-row .rate-input {
    width: 60px !important;
}

/* RESET - Remove all the conflicting layout rules */
#permitResultsContent {
    display: block !important;
    max-width: 600px !important;
    margin: 0 auto !important;
}

/* Dims bar - full width, centered content */
.permit-dims-compact {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    background: rgba(0,0,0,0.2) !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Cost summary - full width */
body .cost-summary.financial-statement,
body #permitResults .cost-summary.financial-statement,
body #permitResultsContent .cost-summary.financial-statement {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    background: rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(100,116,139,0.3) !important;
}

/* Cost grid - single column */
body .cost-summary.financial-statement .cost-grid {
    display: flex;
    flex-direction: column !important;
    gap: 0 !important;
}

/* Cost items - full width rows */
body .cost-summary.financial-statement .cost-item {
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    background: transparent !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Warnings - full width below */
.warnings-collapsed {
    width: 100% !important;
    margin-top: 0 !important;
}

/* Details popup - make sure it shows */
.permit-details-panel {
    display: none;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #1e293b !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    min-width: 400px !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    z-index: 10000 !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.7) !important;
}
.permit-details-panel[style*="display: block"],
.permit-details-panel[style*="display:block"] {
    display: block !important;
}

/* Backdrop */
body.details-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}

/* MASTER OVERRIDE - Single column stacked layout */
#permitResults,
#permitResultsContent {
    display: block !important;
}

#permitResults > *,
#permitResultsContent > * {
    width: 100% !important;
    max-width: 600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#permitResults .cost-summary,
#permitResultsContent .cost-summary,
#permitResults .cost-summary.financial-statement,
#permitResultsContent .cost-summary.financial-statement {
    display: block !important;
    grid-template-columns: unset !important;
    width: 100% !important;
    max-width: 600px !important;
}

#permitResults .permit-dims-compact,
#permitResultsContent .permit-dims-compact {
    max-width: 600px !important;
    justify-content: center !important;
}

#permitResults .warnings-collapsed,
#permitResultsContent .warnings-collapsed {
    max-width: 600px !important;
}

/* ========== FINAL OVERRIDE - PERMIT RESULTS ========== */
/* Force single column for entire permit results section */
.permit-results-section,
#permitResultsSection,
#permitResults,
#permitResultsContent,
.permit-results-section > *,
#permitResultsSection > *,
#permitResults > *,
#permitResultsContent > * {
    display: block !important;
    grid-template-columns: unset !important;
    flex-direction: column !important;
}

/* Center everything in permit results */
#permitResults {
    max-width: 650px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

/* Dims bar - centered */
#permitResults .permit-dims-compact {
    display: flex;
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin: 0 auto 20px auto !important;
    width: fit-content !important;
}

/* Cost summary - full width, single column */
#permitResults .cost-summary,
#permitResults .cost-summary.financial-statement {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

#permitResults .cost-grid {
    display: flex;
    flex-direction: column !important;
}

/* Warnings - full width */
#permitResults .warnings-collapsed {
    width: 100% !important;
}

/* ========== FIX DETAILS POPUP ========== */
#permitDetailsPanel {
    display: none !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 100000 !important;
    background: #1e293b !important;
    border: 2px solid #3b82f6 !important;
    border-radius: 12px !important;
    padding: 24px !important;
    min-width: 450px !important;
    max-width: 600px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8) !important;
}
#permitDetailsPanel.visible {
    display: block !important;
}
#permitDetailsOverlay {
    display: none !important;
}
#permitDetailsOverlay.visible {
    display: block !important;
}

/* Clickable overlay behind details panel */
.permit-details-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 99999 !important;
    cursor: pointer;
}

/* Beta tag */
.beta-tag {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 6px;
}
.beta-tag:hover {
    background: rgba(245, 158, 11, 0.3);
}

/* Beta info popup */
.beta-info-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}
.beta-popup-content {
    background: #1e293b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    padding: 24px;
    max-width: 450px;
    position: relative;
}
.beta-popup-content h4 {
    color: #f59e0b;
    margin: 0 0 12px 0;
}
.beta-popup-content p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}
.beta-popup-content ul {
    color: #94a3b8;
    font-size: 13px;
    margin: 0 0 12px 0;
    padding-left: 20px;
}
.beta-popup-content li {
    margin-bottom: 6px;
}
.beta-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
}
.close-beta {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}
.close-beta:hover {
    color: #fff;
}

/* Compact superload note */
.superload-note-compact {
    color: #f59e0b;
    font-size: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin: 12px 0;
}

/* Better warnings section */
.warnings-content {
    font-size: 13px;
}
.survey-warning {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
    color: #94a3b8;
}
.survey-warning strong {
    color: #3b82f6;
}
.travel-restrictions-compact {
    background: rgba(100, 116, 139, 0.1);
    border-left: 3px solid #64748b;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    color: #94a3b8;
}
.travel-restrictions-compact strong {
    color: #e2e8f0;
}
.restriction-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.restriction-note {
    font-size: 11px;
    opacity: 0.7;
    font-style: italic;
}


/* Rate Check page - Market Rates and Quote Builder side by side */
.rates-row-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Stack rate cards on left, quote builder takes right */
#marketRatesCard, #aiRatesCard {
    grid-column: 1 !important;
}

#quoteBuilderCard {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
}

@media (max-width: 900px) {
    .rates-row-layout {
        grid-template-columns: 1fr !important;
    }
    #marketRatesCard, #aiRatesCard, #quoteBuilderCard {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* ==================== RATE CHECK TWO-COLUMN LAYOUT ==================== */
/* Rate cards stacked on left, quote builder on right */
.rates-row-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Market rates card - top left */
#marketRatesCard {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

/* AI/FreightDeck rates card - bottom left (stacked under market) */
#aiRatesCard {
    grid-column: 1 !important;
    grid-row: 2 !important;
}

/* Network rates (if shown) - also left column */
#networkRatesCard {
    grid-column: 1 !important;
}

/* Quote Builder - spans full right column */
#quoteBuilderCard {
    grid-column: 2 !important;
    grid-row: 1 / span 3 !important;
    height: fit-content !important;
}

/* Mobile: stack everything */
@media (max-width: 900px) {
    .rates-row-layout {
        grid-template-columns: 1fr !important;
    }
    #marketRatesCard, #aiRatesCard, #networkRatesCard, #quoteBuilderCard {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* Quote Builder - stretch to fill full height */
#quoteBuilderCard {
    height: 100% !important;
    display: flex;
    flex-direction: column !important;
}

#quoteBuilderCard .quote-builder-inputs {
    flex: 1 !important;
}

#quoteBuilderCard .quote-summary {
    margin-top: auto !important;
}

/* Make the grid rows stretch */
.rates-row-layout {
    align-items: stretch !important;
}

/* ==================== STRONGSOLO FEEDBACK BUTTONS ==================== */
.message-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.feedback-btn {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 6px !important;
    padding: 6px 12px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #e2e8f0 !important;
}

.feedback-btn:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: scale(1.05);
}

.report-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    font-size: 11px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    margin-left: auto !important;
    opacity: 0.7;
    transition: all 0.2s ease !important;
}

.report-btn:hover {
    color: #94a3b8 !important;
    opacity: 1;
}

/* ==================== LOAD BUILDER REDESIGN ==================== */

/* Hero row - AI Build as primary CTA */
#loadbuild .loadbuilder-hero {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    padding: 20px !important;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 8px !important;
}

#loadbuild .loadbuilder-hero .ai-build-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    font-size: 16px !important;
    padding: 14px 36px !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    cursor: pointer !important;
}

#loadbuild .loadbuilder-hero .ai-build-preview {
    width: 100% !important;
}

#loadbuild .loadbuilder-hero #addTruckBtn {
    font-size: 13px !important;
    padding: 6px 16px !important;
}

/* Top permit action */
#loadbuild .trucks-permit-action-top {
    margin-bottom: 12px !important;
    text-align: center !important;
}

#loadbuild .trucks-permit-action-top .btn {
    width: 100% !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
}

/* Lane inputs on load builder */
#loadbuild .loadbuilder-lane {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    margin-top: 16px !important;
}

#loadbuild .loadbuilder-lane .lane-label {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-right: 4px !important;
}

#loadbuild .loadbuilder-lane .lane-inputs-compact {
    display: flex;
    align-items: center !important;
    gap: 10px !important;
}

#loadbuild .loadbuilder-lane input {
    flex: 1 !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    color: #e2e8f0 !important;
    font-size: 13px !important;
}

#loadbuild .loadbuilder-lane .lane-arrow {
    color: #64748b !important;
}

/* Bottom disclaimer */
#loadbuild .loadbuilder-disclaimer {
    background: rgba(251, 191, 36, 0.08) !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
    border-radius: 6px !important;
    padding: 8px 14px !important;
    margin-top: 16px !important;
    font-size: 12px !important;
    color: #fbbf24 !important;
}

#loadbuild .loadbuilder-disclaimer strong {
    margin-right: 4px !important;
}

/* ==================== LOAD BUILDER UI OVERHAUL ==================== */

/* Remove old hero section styling */
#loadbuild .loadbuilder-hero {
    display: none !important;
}

/* Pool actions row - below pieces, above trucks */
#loadbuild .pool-actions-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0 4px;
    margin-top: 12px;
    border-top: 1px solid rgba(100, 116, 139, 0.15);
    flex-wrap: wrap;
    justify-content: center;
}

/* Prominent drag instruction */
#loadbuild .pool-instruction {
    color: #94a3b8 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 !important;
    letter-spacing: 0.01em;
}

/* "or" divider */
#loadbuild .pool-or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
}
#loadbuild .pool-or-divider .divider-line {
    width: 24px;
    height: 1px;
    background: rgba(100, 116, 139, 0.3);
}
#loadbuild .pool-or-divider .divider-text {
    color: #64748b;
    font-size: 12px;
    font-style: italic;
}

/* AI Build inline CTA */
#loadbuild .ai-build-cta {
    display: flex;
    align-items: center;
    gap: 12px;
}
#loadbuild .ai-build-cta .ai-build-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    font-size: 14px !important;
    padding: 10px 24px !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #fff !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    white-space: nowrap;
}
#loadbuild .ai-build-cta .ai-build-btn:hover {
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-1px);
}
#loadbuild .ai-build-subtitle {
    color: #3b82f6;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

/* AI Build Preview - cleaned up */
#loadbuild .ai-build-preview {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 8px 0 0 !important;
    margin: 0 !important;
    display: none;
}
#loadbuild .ai-build-preview.active {
    display: flex !important;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
#loadbuild .ai-build-preview .ai-build-summary {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
}
#loadbuild .ai-build-preview .ai-build-stat {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
#loadbuild .ai-build-preview .ai-build-stat .count {
    font-weight: 700 !important;
    color: #60a5fa !important;
    font-size: 18px !important;
}
#loadbuild .ai-build-preview .ai-build-stat .label {
    color: #94a3b8 !important;
    font-size: 12px !important;
}

/* + Add Truck row - below trucks */
#loadbuild .add-truck-row {
    margin-top: 12px;
    text-align: center;
}
#loadbuild .add-truck-row .btn {
    padding: 8px 20px !important;
    font-size: 13px !important;
    background: rgba(100, 116, 139, 0.15) !important;
    border: 1px dashed rgba(100, 116, 139, 0.4) !important;
    border-radius: 6px !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
}
#loadbuild .add-truck-row .btn:hover {
    background: rgba(100, 116, 139, 0.25) !important;
    border-color: #3b82f6 !important;
    color: #e2e8f0 !important;
}

/* Hide old hint class in pool, replaced by pool-instruction */
#loadbuild .loadbuilder-pool > .hint {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #loadbuild .pool-actions-row {
        flex-direction: column;
        gap: 10px;
    }
    #loadbuild .ai-build-cta {
        flex-direction: column;
        gap: 6px;
    }
}

/* ==================== DIMS INPUT TABLE - COMPACT CELLS ==================== */
/* Make input table cells smaller to match output */
#dims #inputTable td {
    height: 22px !important;
    padding: 1px 3px !important;
    line-height: 18px !important;
    font-size: 11px !important;
}
#dims #inputTable input,
#dims #inputTable select {
    font-size: 11px !important;
    line-height: 16px !important;
    height: 16px !important;
}
#dims #inputTable select {
    height: 16px !important;
}
#dims .dim-ft-in {
    height: 16px !important;
}
#dims .dim-ft-in input {
    font-size: 11px !important;
    height: 16px !important;
    line-height: 16px !important;
}
#dims .dim-ft-in .dim-label {
    font-size: 9px !important;
    line-height: 16px !important;
}
#dims #inputTable th {
    padding: 2px 2px !important;
    font-size: 9px !important;
}
/* Output table also compact to match */
#dims #outputTable td {
    height: 22px !important;
    padding: 1px 3px !important;
    line-height: 18px !important;
    font-size: 11px !important;
}
#dims #outputTable th {
    padding: 2px 2px !important;
    font-size: 9px !important;
}

/* ==================== DIMS TOOLBAR - COMMODITY REMOVED ==================== */
/* Hide commodity validation */
#dims .dims-toolbar .lane-validation[id="commodityValidation"] {
    display: none !important;
}
/* Screenshot preview stacked to right of extract */
#dims .dims-toolbar .upload-preview-compact {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-direction: row !important;
}
#dims .dims-toolbar .image-preview-small {
    max-height: 32px !important;
    max-width: 48px !important;
    border-radius: 3px !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    object-fit: cover !important;
}

/* ==================== LOAD BUILDER - AI BUILD HERO ON TOP ==================== */
/* Remove old hero and pool-actions-row styles */
#loadbuild .loadbuilder-hero,
#loadbuild .pool-actions-row,
#loadbuild .pool-or-divider,
#loadbuild .ai-build-cta {
    display: none !important;
}

/* New AI Build Hero - prominent at top */
#loadbuild .ai-build-hero {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08)) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 10px !important;
    padding: 20px !important;
    margin-bottom: 16px !important;
    text-align: center !important;
}
#loadbuild .ai-build-hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
#loadbuild .ai-build-hero .ai-build-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    font-size: 16px !important;
    padding: 14px 36px !important;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.4) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    transition: all 0.2s;
}
#loadbuild .ai-build-hero .ai-build-btn:hover {
    box-shadow: 0 0 32px rgba(59, 130, 246, 0.6) !important;
    transform: translateY(-2px);
}
#loadbuild .ai-build-hero-subtitle {
    color: #60a5fa;
    font-size: 13px;
    font-weight: 400;
}

/* AI Build Preview inside hero */
#loadbuild .ai-build-hero .ai-build-preview {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 0 0 !important;
    margin: 0 !important;
}
#loadbuild .ai-build-hero .ai-build-preview.active {
    display: block !important;
}
#loadbuild .ai-build-hero .ai-build-preview .ai-build-summary {
    display: flex !important;
    gap: 16px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
}
#loadbuild .ai-build-hero .ai-build-preview .ai-build-stat {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}
#loadbuild .ai-build-hero .ai-build-stat .count {
    font-weight: 700 !important;
    color: #93c5fd !important;
    font-size: 22px !important;
}
#loadbuild .ai-build-hero .ai-build-stat .label {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

/* Pool instruction - more prominent */
#loadbuild .pool-instruction {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin: 0 0 8px 0 !important;
    text-align: center !important;
}

/* Mobile */
@media (max-width: 600px) {
    #loadbuild .ai-build-hero .ai-build-btn {
        font-size: 14px !important;
        padding: 12px 24px !important;
    }
}

/* ==================== AI BUILD HERO - COMPACT + BLUE ==================== */
/* Override: fit-content width, centered, blue instead of purple */
#loadbuild .ai-build-hero {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.06)) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 10px !important;
    padding: 16px 28px !important;
    margin: 0 auto 16px !important;
    text-align: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-width: 300px !important;
}
#loadbuild .ai-build-hero .ai-build-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.35) !important;
}
#loadbuild .ai-build-hero .ai-build-btn:hover {
    box-shadow: 0 0 28px rgba(59, 130, 246, 0.55) !important;
}
#loadbuild .ai-build-hero-subtitle {
    color: #60a5fa !important;
}

/* AI Build Preview stat cards - blue tint */
#loadbuild .ai-build-hero .ai-build-preview .ai-build-stat,
#loadbuild .ai-build-preview .ai-build-stat {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
}
#loadbuild .ai-build-hero .ai-build-stat .count,
#loadbuild .ai-build-preview .ai-build-stat .count {
    color: #60a5fa !important;
}

/* Screenshot popup hint on small preview */
#dims .dims-toolbar .image-preview-small {
    cursor: pointer !important;
    transition: opacity 0.15s !important;
}
#dims .dims-toolbar .image-preview-small:hover {
    opacity: 0.8 !important;
}

/* ==================== QUOTE BUILDER - FINANCIAL STATEMENT LAYOUT ==================== */
/* Single column, reads top to bottom like a P&L */

/* Override 2-column grid to single column */
#permitResults .cost-grid,
#permitResultsContent .cost-grid,
body .cost-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

/* Each cost item is a single row, full width */
#permitResults .cost-item,
#permitResultsContent .cost-item,
body .cost-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.12) !important;
    border-radius: 0 !important;
    flex: none !important;
    grid-column: unset !important;
}

/* Labels - clean, left aligned */
#permitResults .cost-item .cost-label,
#permitResultsContent .cost-item .cost-label,
body .cost-item .cost-label {
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

/* Values - right aligned */
#permitResults .cost-item .cost-value,
#permitResultsContent .cost-item .cost-value,
body .cost-item .cost-value {
    color: #e2e8f0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: right !important;
}

/* Markup row - subtle divider above */
.cost-item.markup-row {
    border-top: 1px dashed rgba(100, 116, 139, 0.2) !important;
    margin-top: 4px !important;
    padding-top: 10px !important;
}

/* Total rows - TRUCK COST and CUSTOMER PRICE */
#permitResults .cost-item.total,
#permitResultsContent .cost-item.total,
body .cost-item.total {
    grid-column: unset !important;
    border-bottom: none !important;
    margin-top: 4px !important;
    padding: 10px 12px !important;
    border-radius: 6px !important;
}

/* Truck cost row - blue accent */
.cost-item.truck-cost {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.25) !important;
}
.cost-item.truck-cost .cost-label {
    color: #60a5fa !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}
.cost-item.truck-cost .cost-value {
    color: #60a5fa !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Customer price row - green accent */
.cost-item.customer-price {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.25) !important;
    border-bottom: 1px solid rgba(34, 197, 94, 0.25) !important;
}
.cost-item.customer-price .cost-label {
    color: #22c55e !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}
.cost-item.customer-price .cost-value {
    color: #22c55e !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Rate input fields - cleaner */
.rate-input {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 4px !important;
    color: #e2e8f0 !important;
    font-size: 14px !important;
    padding: 4px 8px !important;
    text-align: right !important;
    width: 80px !important;
}
.rate-input:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
}

/* Beta tag - keep purple as accent */
.beta-tag {
    background: #3b82f6 !important;
    color: #fff !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    vertical-align: middle;
}

/* Details button - keep purple accent */
.cost-item .details-btn,
.cost-grid .details-btn,
.cost-summary .details-btn {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
    font-size: 10px !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
}
.cost-item .details-btn:hover,
.cost-grid .details-btn:hover {
    background: rgba(59, 130, 246, 0.25) !important;
}

/* Trailer tag in dims bar - blue instead of purple */
.permit-dims-compact .trailer-tag {
    background: #3b82f6 !important;
}

/* Cost summary container - cleaner border */
body .cost-summary,
.cost-summary.financial-statement {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    border-left: 3px solid #3b82f6 !important;
    border-radius: 8px !important;
    padding: 14px !important;
}
body .cost-summary h3,
.cost-summary.financial-statement h3 {
    color: #e2e8f0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 0 10px 0 !important;
}

/* Cost note */
.cost-note {
    font-size: 10px !important;
    color: #64748b !important;
    margin-top: 10px !important;
    line-height: 1.4 !important;
}

/* Warnings section - amber accent (consistent with site warnings) */
.warnings-collapsed {
    background: rgba(245, 158, 11, 0.06) !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
    border-radius: 8px !important;
}
.warnings-collapsed .warnings-toggle {
    color: #fbbf24 !important;
}

/* ==================== PURPLE ACCENTS - BETA & DETAILS ONLY ==================== */
/* These elements intentionally stay purple to stand out */
.beta-tag,
.beta-badge,
.nav-item-badge {
    background: #8b5cf6 !important;
    color: #fff !important;
}
.beta-badge {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
}
.cost-item .details-btn,
.cost-grid .details-btn,
.cost-summary .details-btn {
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: #a78bfa !important;
}
.cost-item .details-btn:hover,
.cost-grid .details-btn:hover {
    background: rgba(139, 92, 246, 0.25) !important;
}
/* Survey likely tag - amber/warning color */
.survey-likely-tag {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* Overall Dims label */
.permit-dims-compact .overall-dims-label {
    color: #64748b !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    margin-right: 4px;
}


/* ========== TRUCK CARDS DARK THEME ========== */
body .truck-groups,
body #truckGroups {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 16px !important;
}

body .truck-group {
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

body .truck-group .truck-header {
    background: rgba(30, 41, 59, 0.9) !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2) !important;
}

body .truck-group .truck-header h4 {
    color: #e2e8f0 !important;
    font-size: 14px !important;
    margin: 0 !important;
}

body .truck-group .truck-remove {
    color: rgba(239, 68, 68, 0.7) !important;
    font-size: 18px !important;
}

body .truck-group .truck-remove:hover {
    color: #ef4444 !important;
}

body .truck-group .truck-drop-zone {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px dashed rgba(100, 116, 139, 0.2) !important;
    border-radius: 6px !important;
    margin: 8px !important;
    padding: 6px !important;
    min-height: 50px !important;
    gap: 4px !important;
}

body .truck-group .truck-drop-zone .empty-hint {
    color: #475569 !important;
    font-size: 12px !important;
}

/* Pieces inside truck - compact */
body .truck-group .draggable-piece {
    padding: 4px 8px !important;
    font-size: 11px !important;
    gap: 6px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
}

body .truck-group .draggable-piece .piece-name,
body .truck-group .draggable-piece .piece-num-badge {
    color: #e2e8f0 !important;
}

body .truck-group .draggable-piece .piece-dims {
    color: #94a3b8 !important;
    font-size: 11px !important;
}

body .truck-group .draggable-piece .piece-weight {
    color: #64748b !important;
    font-size: 11px !important;
}

/* Truck footer / stats - compact */
body .truck-group .truck-footer {
    background: transparent !important;
    border-top: 1px solid rgba(100, 116, 139, 0.15) !important;
    padding: 8px 14px !important;
    gap: 8px 16px !important;
    font-size: 12px !important;
}

body .truck-group .truck-stat {
    font-size: 12px !important;
    gap: 4px !important;
}

body .truck-group .truck-stat .label {
    color: #64748b !important;
    font-size: 11px !important;
}

body .truck-group .truck-stat .value {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

body .truck-group .truck-stat .value.weight-ok,
body .truck-group .truck-stat .value.height-ok {
    color: #34d399 !important;
}

body .truck-group .truck-stat .value.weight-warning,
body .truck-group .truck-stat .value.height-warning {
    color: #f87171 !important;
}

/* Overall dims - compact single line */
body .truck-group .truck-overall-dims {
    width: 100% !important;
    font-size: 11px !important;
}

body .truck-group .truck-overall-dims .value {
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: -0.02em !important;
}

/* Trailer select in truck */
body .truck-group .truck-trailer-select {
    width: 100% !important;
    margin-top: 4px !important;
}

body .truck-group .truck-trailer-select select {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    border-radius: 6px !important;
    color: #e2e8f0 !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
}

body .truck-group .trailer-recommended {
    color: #34d399 !important;
    font-size: 11px !important;
}

/* OD badge */
body .truck-group .od-badge {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    margin-left: 8px !important;
}

/* W and H flag badges */
body .truck-group .flag-badge,
body .truck-group .dim-flag {
    font-size: 9px !important;
    padding: 1px 4px !important;
    border-radius: 2px !important;
    font-weight: 700 !important;
}

/* Truck visualization - compact */
body .truck-group .truck-viz {
    margin: 4px 8px !important;
    max-height: 60px !important;
}

/* Fit warning */
body .truck-group .fit-warning {
    color: #fbbf24 !important;
    font-size: 11px !important;
    padding: 4px 14px 8px !important;
}


/* ========== GLOBAL NUMBER INPUT SPINNER REMOVAL ========== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
input[type="number"] {
    -moz-appearance: textfield !important;
}

/* ========== WIDER DIM INPUTS ========== */
.ft-in-input input[type="number"] {
    min-width: 50px !important;
    width: 50px !important;
}
.weight-input input[type="number"] {
    min-width: 90px !important;
}

/* ========== HIDE PIECE LABEL WHEN EMPTY ========== */
.current-piece-label:empty {
    display: none !important;
}
.current-piece-label {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
    border-radius: 8px !important;
}

/* ========== PERMIT RESULTS - NO DUPLICATE HEADER ========== */
.permit-results-section > h3 {
    display: none !important;
}


/* ========== FIX: Lane field overflow ========== */
.lane-row {
    overflow: hidden !important;
}
.lane-field {
    overflow: hidden !important;
    min-width: 0 !important;
}
.lane-field input {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

/* ==================== HOME PAGE ==================== */

.home-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

.home-header {
    text-align: center;
    margin-bottom: 48px;
}

.home-logo-icon {
    display: inline-block;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 20px rgba(74, 158, 255, 0.3));
}

.home-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.6;
    max-width: 550px;
    margin: 0 auto;
}

/* Feature Cards Grid */
.home-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.home-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.home-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.home-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(30, 41, 59, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(6, 182, 212, 0.1);
}

.home-card:hover::before {
    opacity: 1;
}

.home-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: #06b6d4;
    transition: background 0.25s ease;
}

.home-card:hover .home-card-icon {
    background: rgba(6, 182, 212, 0.2);
}

.home-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0 0 8px;
}

.home-card p {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0;
}

.home-card-tag {
    display: inline-block;
    margin-top: 12px;
    padding: 3px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 20px;
}

/* Footer Note */
.home-footer-note {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 10px;
    padding: 20px 24px;
    border-left: 3px solid rgba(6, 182, 212, 0.4);
}

.home-footer-note p {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0;
}

.home-footer-note strong {
    color: #e2e8f0;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .home-page {
        padding: 32px 16px 24px;
    }
    .home-title {
        font-size: 1.75rem;
    }
    .home-subtitle {
        font-size: 1rem;
    }
    .home-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .home-card {
        padding: 20px;
    }
}

/* ==================== PERMIT DIMS COMPACT (one-line layout) ==================== */

.permit-dims-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 10px;
    margin-bottom: 16px;
}

.overall-dims-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-right: 4px;
}

.trailer-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4a9eff, #2563eb);
    border-radius: 20px;
    white-space: nowrap;
}

.dim-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 6px;
    white-space: nowrap;
}

.dim-tag.od {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
    font-weight: 600;
}

/* ==================== SUPERLOAD WARNING BANNER ==================== */

.superload-banner {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(251, 146, 60, 0.1));
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.superload-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #fca5a5;
    margin-bottom: 8px;
}

.superload-banner-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.superload-banner-item {
    font-size: 0.85rem;
    color: #fca5a5;
    line-height: 1.4;
    padding-left: 4px;
}

.superload-banner-item strong {
    color: #fbbf24;
}

.superload-banner-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(220, 38, 38, 0.2);
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
}

/* ==================== CITY AUTOCOMPLETE DROPDOWN ==================== */

.location-input-wrapper {
    position: relative;
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #1e293b;
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.city-suggestions.active {
    display: block;
}

.city-suggestion-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #e2e8f0;
    cursor: pointer;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    transition: background 0.15s;
}

.city-suggestion-item:hover,
.city-suggestion-item.highlighted {
    background: rgba(6, 182, 212, 0.1);
    color: #fff;
}

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

.city-suggestion-state {
    color: #64748b;
    font-size: 0.75rem;
    margin-left: 4px;
}

@media (max-width: 640px) {
    .permit-dims-compact {
        gap: 6px;
        padding: 12px 14px;
    }
    .dim-tag, .trailer-tag {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

/* ==================== MY QUOTES TAB ==================== */
.quotes-container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.quotes-title { font-size: 1.4rem; font-weight: 600; color: #f1f5f9; margin: 0 0 16px; }

.nav-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.quotes-nav-tab { padding: 10px 20px; background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; color: #94a3b8; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.quotes-nav-tab.active { background: rgba(6, 182, 212, 0.15); color: #06b6d4; border-color: rgba(6, 182, 212, 0.4); }
.quotes-nav-tab:hover:not(.active) { background: rgba(30, 41, 59, 0.85); color: #e2e8f0; }

.quotes-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 20px; }
.quotes-stat-card { background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 10px; padding: 14px; text-align: center; }
.quotes-stat-value { font-size: 1.4rem; font-weight: 700; color: #f1f5f9; }
.quotes-stat-value.quotes-won { color: #34d399; }
.quotes-stat-value.quotes-lost { color: #f87171; }
.quotes-stat-label { font-size: 0.65rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

.quotes-search-section { background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.quotes-search-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.quotes-search-group { display: flex; flex-direction: column; gap: 4px; }
.quotes-search-group label { font-size: 0.7rem; color: #64748b; font-weight: 500; }
.quotes-search-group input, .quotes-search-group select { padding: 9px 12px; border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; min-width: 170px; background: rgba(15, 23, 42, 0.8); color: #e2e8f0; font-size: 0.85rem; }
.quotes-search-group input::placeholder { color: #475569; }
.quotes-search-btn { padding: 9px 18px; background: rgba(6, 182, 212, 0.15); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.4); border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
.quotes-search-btn:hover { background: rgba(6, 182, 212, 0.25); }
.quotes-clear-btn { padding: 9px 14px; background: transparent; border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; cursor: pointer; color: #94a3b8; transition: all 0.2s; }
.quotes-clear-btn:hover { border-color: #94a3b8; }

.quotes-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.quotes-filter-group { display: flex; flex-direction: column; gap: 4px; }
.quotes-filter-group label { font-size: 0.7rem; color: #64748b; font-weight: 500; }
.quotes-filter-group select, .quotes-filter-group input { padding: 8px 10px; border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; min-width: 110px; background: rgba(15, 23, 42, 0.8); color: #e2e8f0; font-size: 0.8rem; }
.quotes-filter-group input::placeholder { color: #475569; }

.quotes-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid rgba(51, 65, 85, 0.5); }
.quotes-table { width: 100%; border-collapse: collapse; min-width: 1100px; }
.quotes-table th { background: rgba(15, 23, 42, 0.8); padding: 10px 8px; text-align: left; font-weight: 600; font-size: 0.75rem; color: #94a3b8; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.quotes-table th.sortable { cursor: pointer; user-select: none; }
.quotes-table th.sortable:hover { background: rgba(30, 41, 59, 0.8); color: #e2e8f0; }
.quotes-table th .sort-icon { margin-left: 3px; opacity: 0.4; font-size: 10px; }
.quotes-table th.sorted .sort-icon { opacity: 1; color: #06b6d4; }
.quotes-table td { padding: 8px; border-bottom: 1px solid rgba(51, 65, 85, 0.3); font-size: 0.82rem; color: #e2e8f0; }
.quotes-table tr:hover { background: rgba(30, 41, 59, 0.5); }
.quotes-table .empty-state { text-align: center; padding: 40px; color: #64748b; }

.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.status-badge.pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-badge.won { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-badge.lost { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

.action-btn { width: 26px; height: 26px; border: none; border-radius: 6px; cursor: pointer; margin-right: 3px; font-size: 11px; transition: all 0.2s; }
.action-btn.win { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.action-btn.win:hover { background: rgba(52, 211, 153, 0.3); }
.action-btn.lose { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.action-btn.lose:hover { background: rgba(248, 113, 113, 0.3); }
.action-btn.edit { background: rgba(96, 165, 250, 0.15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.action-btn.edit:hover { background: rgba(96, 165, 250, 0.3); }
.action-btn.delete { background: rgba(100, 116, 139, 0.15); color: #64748b; border: 1px solid rgba(100, 116, 139, 0.3); }
.action-btn.delete:hover { background: rgba(248, 113, 113, 0.2); color: #f87171; border-color: rgba(248, 113, 113, 0.3); }

.user-name { font-size: 0.7rem; color: #64748b; }
.distance-badge { font-size: 0.65rem; color: #06b6d4; margin-left: 4px; }

/* Quotes Modals */
.quotes-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.quotes-modal-box { background: #1e293b; border: 1px solid rgba(51, 65, 85, 0.8); border-radius: 14px; padding: 24px; width: 90%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.quotes-modal-box h3 { margin: 0 0 12px; color: #f1f5f9; font-size: 1.1rem; }
.quotes-modal-box p { margin: 0 0 12px; color: #94a3b8; font-size: 0.85rem; }
.quotes-modal-box label { display: block; font-size: 0.75rem; color: #64748b; margin: 14px 0 6px; font-weight: 500; }
.quotes-modal-box input, .quotes-modal-box select { width: 100%; padding: 10px 12px; border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; font-size: 0.85rem; background: rgba(15, 23, 42, 0.8); color: #e2e8f0; box-sizing: border-box; }
.quotes-modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.quotes-modal-cancel { padding: 8px 16px; background: transparent; border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; color: #94a3b8; cursor: pointer; }
.quotes-modal-cancel:hover { border-color: #94a3b8; }
.quotes-modal-confirm { padding: 8px 16px; background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.4); border-radius: 8px; color: #06b6d4; cursor: pointer; font-weight: 500; }
.quotes-modal-confirm:hover { background: rgba(6, 182, 212, 0.25); }
.quotes-modal-danger { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.4); color: #f87171; }
.quotes-modal-danger:hover { background: rgba(248, 113, 113, 0.25); }
.quotes-warning-text { color: #f87171 !important; font-weight: 500; }

@media (max-width: 640px) {
    .quotes-stats { grid-template-columns: repeat(3, 1fr); }
    .quotes-search-row { flex-direction: column; }
    .quotes-search-group input { min-width: auto; width: 100%; }
    .quotes-filters { flex-direction: column; }
}

/* ==================== DIMENSION WARNINGS v2 ==================== */
.dim-warnings { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dim-warnings:empty { display: none; }

.dim-warning {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    font-size: 0.82rem; cursor: pointer;
    animation: dimWarnIn 0.25s ease;
    transition: background 0.15s;
}
@keyframes dimWarnIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.dim-warning.warn {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fbbf24;
}
.dim-warning.warn:hover { background: rgba(251, 191, 36, 0.14); }
.dim-warning.block {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}
.dim-warning.block:hover { background: rgba(248, 113, 113, 0.16); }
.dim-warning.caution {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: #fb923c;
}
.dim-warning.caution:hover { background: rgba(249, 115, 22, 0.14); }

.dim-caution-banner {
    margin-top: 12px; padding: 14px 16px;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 10px;
    text-align: center; color: #fb923c;
    font-size: 0.85rem; line-height: 1.55;
}
.dim-caution-banner strong { display: block; margin-bottom: 4px; font-size: 0.9rem; color: #f97316; }

.dim-warning-icon { flex-shrink: 0; color: inherit; }
.dim-warning-label { flex: 1; font-weight: 600; }

.dim-blocked-banner {
    margin-top: 12px; padding: 14px 16px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 10px;
    text-align: center; color: #fca5a5;
    font-size: 0.85rem; line-height: 1.55;
}
.dim-blocked-banner strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }

/* Warning detail popout */
.dim-warning-popout {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1100;
    animation: dimWarnIn 0.2s ease;
}
.dim-warning-popout-box {
    background: #1e293b; border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 14px; padding: 24px 28px;
    width: 90%; max-width: 520px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-height: 80vh; overflow-y: auto;
}
.dim-warning-popout-box h3 { color: #f1f5f9; margin: 0 0 14px; font-size: 1.1rem; }
.dim-warning-popout-box p { color: #94a3b8; font-size: 0.85rem; line-height: 1.65; margin: 0 0 12px; }
.dim-warning-popout-box ul { color: #94a3b8; font-size: 0.85rem; line-height: 1.65; margin: 0 0 12px; padding-left: 20px; }
.dim-warning-popout-box li { margin-bottom: 6px; }
.dim-warning-popout-box .hl-warn { color: #fbbf24; font-weight: 600; }
.dim-warning-popout-box .hl-block { color: #f87171; font-weight: 600; }
.dim-warning-popout-close {
    display: block; margin: 18px auto 0; padding: 8px 24px;
    background: rgba(51, 65, 85, 0.5); border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 8px; color: #e2e8f0; cursor: pointer; font-size: 0.85rem;
}
.dim-warning-popout-close:hover { background: rgba(51, 65, 85, 0.8); }

/* Field validation error state */
.permit-field-error {
    border-color: rgba(248, 113, 113, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15) !important;
}
.permit-field-error:focus {
    border-color: rgba(248, 113, 113, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}

/* One-line dims layout */
.permit-dims-oneline {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 10px 14px !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 600px !important;
}
.permit-dims-oneline .trailer-tag {
    font-size: 0.72rem;
    padding: 3px 10px;
}
.permit-dims-oneline .dim-tag {
    font-size: 0.78rem;
    padding: 3px 8px;
    min-width: 0;
}
@media (max-width: 640px) {
    .permit-dims-oneline .trailer-tag {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    .permit-dims-oneline .dim-tag {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* Dims preview under trailer type */
.dims-preview {
    display: inline;
    white-space: nowrap;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0;
    letter-spacing: 0.3px;
}
.dims-preview:empty { display: none; }
.dims-preview .dim-od {
    color: #fbbf24;
    font-weight: 600;
}
#deckHeight {
    cursor: pointer;
    border-bottom: 1px dashed rgba(100, 116, 139, 0.5);
    padding-bottom: 1px;
}
#deckHeight:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Deck height edit icon - show on hover */
.deck-edit-icon {
    opacity: 0;
    margin-left: 3px;
    vertical-align: middle;
    transition: opacity 0.15s;
}
#deckHeight:hover .deck-edit-icon {
    opacity: 0.6;
}

/* Escort cost breakdown */
.escort-cost-breakdown { margin-top: 4px; }
.escort-cost-line {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid rgba(51,65,85,0.3);
    font-size: 0.82rem;
}
.escort-cost-label { color: #e2e8f0; font-weight: 600; min-width: 100px; }
.escort-cost-calc { color: #64748b; flex: 1; font-size: 0.78rem; }
.escort-cost-amt { color: #06b6d4; font-weight: 600; font-size: 0.85rem; }
.escort-cost-note {
    font-size: 0.75rem; color: #64748b; font-style: italic;
    padding: 6px 0;
}
.escort-cost-total {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0 4px; margin-top: 4px;
    border-top: 1px solid rgba(51,65,85,0.6);
    font-weight: 700; font-size: 0.9rem;
    color: #e2e8f0;
}
.escort-cost-total span:last-child { color: #06b6d4; font-size: 1rem; }

/* City autocomplete dropdown items */
.ac-item:hover {
    background: #334155 !important;
}

/* ==================== PERMIT TYPE TAGS (OS/OW) ==================== */
.permit-type-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}
.os-tag {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
}
.ow-tag {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

/* ==================== PERMIT LANE VALIDATION ==================== */
.permit-lane-validation {
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 16px;
    transition: color 0.2s;
}
.permit-lane-validation.valid {
    color: #22c55e;
}
.permit-lane-validation.error {
    color: #ef4444;
}

/* Load Builder 3D View Link */
.truck-3d-link {
    padding: 6px 15px;
    text-align: center;
    border-top: 1px dashed #ddd;
}
.truck-3d-link a {
    color: #06b6d4;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 14px;
    border: 1px solid #06b6d4;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-block;
}
.truck-3d-link a:hover {
    background: #06b6d4;
    color: #fff;
}


/* ==================== TRUCK BUILDER ==================== */
.tb-section { padding: 20px; max-width: 1100px; margin: 0 auto; }

/* Stepper */
.tb-stepper {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-bottom: 28px; padding: 16px 0;
}
.tb-step-indicator {
    display: flex; align-items: center; gap: 8px; opacity: 0.4;
    transition: opacity 0.3s;
}
.tb-step-indicator.active { opacity: 1; }
.tb-step-indicator.completed { opacity: 0.7; }
.tb-step-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-tertiary, #334155); color: var(--text-secondary, #94a3b8);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.tb-step-indicator.active .tb-step-num {
    background: #3b82f6; color: #fff;
}
.tb-step-indicator.completed .tb-step-num {
    background: #22c55e; color: #fff;
}
.tb-step-label { font-size: 13px; color: var(--text-secondary, #94a3b8); white-space: nowrap; }
.tb-step-indicator.active .tb-step-label { color: var(--text-primary, #e2e8f0); font-weight: 500; }
.tb-step-connector {
    width: 40px; height: 2px; background: var(--border-primary, #334155);
    margin: 0 8px; flex-shrink: 0;
}

/* Steps */
.tb-step { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Upload Area */
.tb-upload-area {
    margin-bottom: 20px; border: 2px dashed var(--border-primary, #334155);
    border-radius: 10px; overflow: hidden;
}
.tb-paste-target {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 28px; cursor: pointer; color: var(--text-secondary, #94a3b8);
    transition: background 0.2s, border-color 0.2s;
}
.tb-paste-target:hover { background: var(--bg-secondary, #1e293b); }
.tb-paste-target.drag-over { background: rgba(59,130,246,0.1); border-color: #3b82f6; }
.tb-paste-target span { font-size: 14px; }
.tb-upload-hint { font-size: 11px; opacity: 0.5; }
.tb-upload-preview { padding: 16px; text-align: center; }
.tb-upload-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; margin-bottom: 12px; }
.tb-upload-actions { display: flex; gap: 8px; justify-content: center; }
.tb-ocr-status {
    margin-top: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
}
.tb-ocr-status.loading { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tb-ocr-status.success { background: rgba(34,197,94,0.15); color: #4ade80; }
.tb-ocr-status.error { background: rgba(239,68,68,0.15); color: #f87171; }

/* Manual Entry */
.tb-manual-entry { margin-bottom: 20px; }
.tb-manual-entry h4 { margin: 0 0 10px; font-size: 15px; color: var(--text-primary, #e2e8f0); }
.tb-add-row {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tb-add-row input[type="number"] { width: 64px; }
.tb-add-row input[type="text"] { width: 120px; }
.tb-name-input { flex: 0 0 120px; }
.tb-weight-input { width: 80px !important; }
.tb-qty-input { width: 48px !important; }
.tb-x { color: var(--text-secondary, #94a3b8); font-size: 12px; }
.tb-stack-check { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary, #94a3b8); white-space: nowrap; cursor: pointer; }
.tb-stack-check input { margin: 0; }
.tb-input-hint { font-size: 11px; color: var(--text-secondary, #64748b); margin-top: 6px; }

.tb-add-row input {
    background: var(--bg-secondary, #1e293b); border: 1px solid var(--border-primary, #334155);
    color: var(--text-primary, #e2e8f0); padding: 7px 8px; border-radius: 6px; font-size: 13px;
}
.tb-add-row input:focus { border-color: #3b82f6; outline: none; }

/* Items Table */
.tb-items-section { margin-bottom: 20px; }
.tb-items-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.tb-items-header span { font-size: 14px; font-weight: 500; color: var(--text-primary, #e2e8f0); }
.tb-clear-btn {
    background: none; border: none; color: #f87171; font-size: 12px; cursor: pointer;
    padding: 2px 8px; border-radius: 4px;
}
.tb-clear-btn:hover { background: rgba(239,68,68,0.1); }
.tb-items-scroll { max-height: 300px; overflow-y: auto; }
.tb-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.tb-table th {
    text-align: left; padding: 6px 8px; font-size: 11px; text-transform: uppercase;
    color: var(--text-secondary, #64748b); border-bottom: 1px solid var(--border-primary, #334155);
    position: sticky; top: 0; background: var(--bg-primary, #0f172a); z-index: 1;
}
.tb-table td {
    padding: 6px 8px; border-bottom: 1px solid var(--border-primary, #1e293b);
    color: var(--text-primary, #e2e8f0);
}
.tb-table td.tb-empty {
    text-align: center; padding: 24px; color: var(--text-secondary, #64748b); font-style: italic;
}
.tb-table .tb-edit-cell input {
    width: 56px; background: transparent; border: 1px solid transparent; color: inherit;
    padding: 2px 4px; border-radius: 3px; font-size: 13px;
}
.tb-table .tb-edit-cell input:hover { border-color: var(--border-primary, #334155); }
.tb-table .tb-edit-cell input:focus { border-color: #3b82f6; outline: none; background: var(--bg-secondary, #1e293b); }
.tb-remove-item {
    background: none; border: none; color: #f87171; cursor: pointer; font-size: 16px;
    padding: 0 4px; opacity: 0.5;
}
.tb-remove-item:hover { opacity: 1; }

/* Step Actions */
.tb-step-actions {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 20px; border-top: 1px solid var(--border-primary, #334155);
    margin-top: 20px;
}

/* Step 2: Build Trucks */
.tb-partial-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: 8px;
    background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.3);
    color: #fbbf24; font-size: 13px; margin-bottom: 16px;
}
.tb-lane-section {
    display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.tb-lane-label { font-size: 13px; color: var(--text-secondary, #94a3b8); font-weight: 500; }
.tb-lane-section input {
    flex: 1; min-width: 160px; padding: 8px 10px; border-radius: 6px; font-size: 13px;
    background: var(--bg-secondary, #1e293b); border: 1px solid var(--border-primary, #334155);
    color: var(--text-primary, #e2e8f0);
}
.tb-lane-section input:focus { border-color: #3b82f6; outline: none; }
.tb-lane-arrow { color: var(--text-secondary, #64748b); }

.tb-build-hero {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
    padding: 16px; background: var(--bg-secondary, #1e293b); border-radius: 10px;
}
.tb-build-subtitle { font-size: 13px; color: var(--text-secondary, #94a3b8); }

.tb-trucks-container {
    margin-bottom: 16px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.tb-trucks-container .tb-no-trucks { grid-column: 1 / -1; }
.tb-no-trucks { color: var(--text-secondary, #64748b); font-style: italic; font-size: 13px; padding: 20px; text-align: center; }

.tb-add-truck-row { margin-bottom: 16px; }

/* Truck Cards */
.tb-truck-card {
    background: var(--bg-secondary, #1e293b); border: 1px solid var(--border-primary, #334155);
    border-radius: 10px; margin-bottom: 12px; overflow: hidden;
}
.tb-truck-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border-primary, #334155);
}
.tb-truck-header h4 { margin: 0; font-size: 15px; color: var(--text-primary, #e2e8f0); display: flex; align-items: center; gap: 8px; }
.tb-truck-header-actions { display: flex; align-items: center; gap: 8px; }
.tb-truck-remove {
    background: none; border: none; color: #f87171; cursor: pointer; font-size: 18px;
    opacity: 0.5; padding: 0 4px;
}
.tb-truck-remove:hover { opacity: 1; }

.tb-truck-body { padding: 12px 16px; }

.tb-truck-pieces {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 36px;
    padding: 8px; border: 2px dashed var(--border-primary, #334155); border-radius: 6px;
}
.tb-truck-pieces.drag-over { border-color: #3b82f6; background: rgba(59,130,246,0.05); }
.tb-truck-pieces .tb-piece-chip {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 4px; font-size: 12px;
    background: var(--bg-tertiary, #334155); color: var(--text-primary, #e2e8f0);
    cursor: grab; white-space: nowrap;
}
.tb-truck-pieces .tb-piece-chip:active { cursor: grabbing; }
.tb-piece-chip .tb-piece-dims { opacity: 0.5; font-size: 11px; }
.tb-piece-chip.od-piece { border-left: 3px solid #f87171; }

.tb-truck-stats {
    display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; margin-bottom: 8px;
}
.tb-truck-stat { display: flex; align-items: center; gap: 4px; }
.tb-truck-stat .label { color: var(--text-secondary, #64748b); }
.tb-truck-stat .value { color: var(--text-primary, #e2e8f0); font-weight: 500; }
.tb-truck-stat .value.od-value { color: #f87171; }
.tb-truck-stat .value.legal-value { color: #4ade80; }

.tb-truck-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.tb-truck-badge.od { background: rgba(239,68,68,0.2); color: #f87171; }
.tb-truck-badge.legal { background: rgba(74,222,128,0.2); color: #4ade80; }

.tb-truck-trailer-select {
    display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.tb-truck-trailer-select .label { color: var(--text-secondary, #64748b); }
.tb-truck-trailer-select select {
    padding: 4px 8px; border-radius: 4px; font-size: 12px;
    background: var(--bg-tertiary, #334155); border: 1px solid var(--border-primary, #475569);
    color: var(--text-primary, #e2e8f0);
}

.tb-truck-viz { margin: 10px 0; }
.tb-truck-viz canvas { width: 100%; border-radius: 4px; }

.tb-truck-actions {
    display: flex; gap: 8px; margin-top: 8px;
}
.tb-truck-actions a, .tb-truck-actions button {
    font-size: 12px; color: #60a5fa; text-decoration: none; cursor: pointer;
    background: none; border: none; padding: 2px 0;
}
.tb-truck-actions a:hover, .tb-truck-actions button:hover { text-decoration: underline; }

/* Details Expander */
.tb-details-toggle {
    background: none; border: none; color: #60a5fa; font-size: 12px;
    cursor: pointer; padding: 2px 0; display: flex; align-items: center; gap: 4px;
}
.tb-details-toggle:hover { text-decoration: underline; }
.tb-truck-details {
    padding: 12px 0; border-top: 1px solid var(--border-primary, #334155);
    margin-top: 8px; display: none;
}
.tb-truck-details.open { display: block; }

/* Utilization Bars (reused from Partial TL) */
.tb-util-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px;
}
.tb-util-label { width: 50px; color: var(--text-secondary, #64748b); text-align: right; }
.tb-util-bar-wrap {
    flex: 1; height: 14px; background: var(--bg-tertiary, #334155);
    border-radius: 7px; overflow: hidden;
}
.tb-util-bar {
    height: 100%; border-radius: 7px; transition: width 0.4s;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.tb-util-bar.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.tb-util-bar.danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.tb-util-text { width: 80px; font-size: 11px; color: var(--text-secondary, #94a3b8); }

/* Axle weights inside details */
.tb-axle-section { margin-top: 8px; }
.tb-axle-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px;
}
.tb-axle-label { width: 55px; color: var(--text-secondary, #64748b); text-align: right; }
.tb-axle-bar-wrap {
    flex: 1; height: 10px; background: var(--bg-tertiary, #334155);
    border-radius: 5px; overflow: hidden;
}
.tb-axle-bar { height: 100%; border-radius: 5px; background: #3b82f6; transition: width 0.3s; }
.tb-axle-bar.warning { background: #f59e0b; }
.tb-axle-bar.danger { background: #ef4444; }
.tb-axle-val { width: 40px; font-size: 11px; color: var(--text-primary, #e2e8f0); }
.tb-axle-limit { font-size: 11px; color: var(--text-secondary, #64748b); width: 40px; }

/* Editable specs row inside details */
.tb-specs-row {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.tb-spec-item {
    display: flex; align-items: center; gap: 4px; font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}
.tb-spec-item input {
    width: 48px; background: transparent; border: 1px solid transparent;
    color: var(--text-primary, #e2e8f0); padding: 2px 4px; border-radius: 3px;
    font-size: 12px; text-align: right;
}
.tb-spec-item input:hover { border-color: var(--border-primary, #334155); }
.tb-spec-item input:focus { border-color: #3b82f6; outline: none; background: var(--bg-secondary, #1e293b); }

/* Step 3: Results */
.tb-summary {
    background: var(--bg-secondary, #1e293b); border-radius: 10px;
    padding: 20px; margin-bottom: 20px;
}
.tb-summary h3 { margin: 0 0 16px; font-size: 17px; color: var(--text-primary, #e2e8f0); }
.tb-summary-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
    margin-bottom: 16px;
}
.tb-summary-stat {
    background: var(--bg-tertiary, #334155); padding: 12px; border-radius: 8px;
}
.tb-summary-stat .stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.tb-summary-stat .stat-label { font-size: 12px; color: var(--text-secondary, #94a3b8); margin-top: 2px; }

.tb-summary-trucks {
    margin-top: 16px;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.tb-summary-truck-row {
    flex-wrap: wrap;
    display: flex; align-items: center; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--border-primary, #334155); font-size: 13px;
}
.tb-summary-truck-row:last-child { border-bottom: none; }
.tb-summary-truck-row { border: 1px solid rgba(100,116,139,0.15); border-radius: 8px; padding: 10px 14px; border-bottom: none; }

.tb-results-actions { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 768px) {
    .tb-stepper { gap: 0; }
    .tb-step-label { display: none; }
    .tb-step-connector { width: 24px; }
    .tb-add-row { flex-wrap: wrap; }
    .tb-add-row input[type="number"] { width: 52px; }
    .tb-name-input { flex: 1 1 100% !important; }
    .tb-lane-section { flex-direction: column; align-items: stretch; }
    .tb-lane-arrow { text-align: center; }
    .tb-build-hero { flex-direction: column; text-align: center; }
    .tb-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .tb-truck-stats { flex-direction: column; gap: 4px; }
}

/* Unit Detection Banner */
.tb-unit-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
    background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3);
    flex-wrap: wrap;
}
.tb-unit-banner-text {
    display: flex; align-items: center; gap: 8px;
    color: #60a5fa; font-size: 13px;
}
.tb-unit-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-stack-toggle { cursor: pointer; user-select: none; }
.tb-stack-toggle:hover { text-decoration: underline; }
.tb-ftin-val { cursor: pointer; }
.tb-ftin-val:hover { text-decoration: underline; color: #60a5fa; }

/* Entry Options — Upload OR Manual */
.tb-entry-options {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 16px; justify-content: center;
}
.tb-entry-option {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 24px; border-radius: 10px; cursor: pointer;
    transition: all 0.15s ease; text-align: center;
    border: 1px solid transparent;
}
.tb-entry-option:hover {
    background: rgba(59,130,246,0.06);
    border-color: rgba(59,130,246,0.15);
}
.tb-entry-option.active {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.25);
}
.tb-entry-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}
.tb-entry-label svg { color: #60a5fa; }
.tb-entry-desc {
    font-size: 12px; color: var(--text-secondary, #64748b);
    margin: 4px 0 0; line-height: 1.3;
}
.tb-entry-divider {
    font-size: 12px; color: var(--text-secondary, #475569);
    padding: 0 12px; text-transform: uppercase; letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .tb-entry-options { gap: 0; }
    .tb-entry-option { padding: 10px 14px; }
    .tb-entry-label { font-size: 13px; }
}

/* Unassigned Pieces Queue */
.tb-queue {
    margin-bottom: 16px; border-radius: 8px;
    border: 1px solid rgba(100,116,139,0.2);
    background: rgba(30,41,59,0.4);
    overflow: hidden;
}
.tb-queue-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: rgba(30,41,59,0.6);
    border-bottom: 1px solid rgba(100,116,139,0.15);
}
.tb-queue-title {
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-secondary, #94a3b8);
}
.tb-queue-count {
    font-size: 11px; font-weight: 700; padding: 2px 8px;
    border-radius: 10px; background: rgba(59,130,246,0.15);
    color: #60a5fa; min-width: 20px; text-align: center;
}
.tb-queue-count.empty { background: rgba(74,222,128,0.15); color: #4ade80; }
.tb-queue-list {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 10px 14px; min-height: 20px;
}
.tb-queue-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 6px; font-size: 12px;
    background: rgba(51,65,85,0.6); border: 1px solid rgba(100,116,139,0.2);
    color: var(--text-primary, #e2e8f0);
    transition: all 0.3s ease;
}
.tb-queue-item .tb-qi-dims {
    font-size: 11px; color: var(--text-secondary, #64748b);
}
.tb-queue-item.assigned {
    opacity: 0; transform: scale(0.8); pointer-events: none;
}
.tb-queue-empty {
    font-size: 12px; color: var(--text-secondary, #64748b);
    font-style: italic; padding: 2px 0;
}

/* Compact 2-col layout adjustments */
.tb-truck-stats {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
}
.tb-truck-stat { font-size: 12px; }
.tb-truck-stat .label { font-size: 11px; }

/* Pieces queue — inline horizontal to save space */
.tb-queue-list { max-height: 80px; overflow-y: auto; }

/* Mobile: back to single column */
@media (max-width: 900px) {
    .tb-trucks-container { grid-template-columns: 1fr; }
    .tb-summary-trucks { grid-template-columns: 1fr; }
}

/* Known/Variable cost sections (OD audit Feb 2026) */
.cost-section-known { border-left: 3px solid #22c55e; padding-left: 12px; margin: 12px 0 8px; }
.cost-section-known h4 { color: #22c55e; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.cost-section-variable { border-left: 3px solid #f59e0b; padding-left: 12px; margin: 12px 0 8px; }
.cost-section-variable h4 { color: #f59e0b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.variable-tag { background: rgba(245,158,11,0.2); color: #f59e0b; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.cost-state-line { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12px; color: #94a3b8; }
.cost-state-line .state-code { font-weight: 600; color: #cbd5e1; min-width: 28px; }
.cost-state-line .state-info { flex: 1; margin: 0 8px; font-size: 11px; }
.cost-state-line .state-range { text-align: right; color: #f59e0b; white-space: nowrap; }
.cost-state-line.unknown .state-info { font-style: italic; color: #64748b; }
.quote-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin: 8px 0 4px; padding-top: 8px; border-top: 1px solid rgba(100,116,139,0.3); }
.cost-known-subtotal { display: flex; justify-content: space-between; padding: 4px 0; margin-top: 4px; border-top: 1px dashed rgba(100,116,139,0.3); font-size: 12px; color: #22c55e; font-weight: 600; }
.cost-variable-range { display: flex; justify-content: space-between; padding: 4px 0; margin-top: 4px; border-top: 1px dashed rgba(100,116,139,0.3); font-size: 12px; color: #f59e0b; font-weight: 600; }
