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

:root {
    --primary-color: #1a1a1a;
    --primary-dark: #0a0a0a;
    --primary-light: #2a2a2a;
    --success-color: #1a1a1a;
    --warning-color: #1a1a1a;
    --danger-color: #1a1a1a;
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #8a8a8a;
    --border-color: #e0e0e0;
    --border-color-dark: #d0d0d0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.65;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--bg-primary);
    backdrop-filter: none;
    border-bottom: none;
    padding: 0.75rem 2rem;
    box-shadow: none;
    flex-shrink: 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-right {
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.user-avatar:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-dark);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

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

.user-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.user-profile span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.logo-link {
    text-decoration: none;
    display: inline-block;
}

.logo {
    height: 2.5rem;
    width: auto;
    display: block;
    margin: 0;
    padding: 0;
    object-fit: contain;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tagline.breadcrumb {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow vertical scrolling */
    min-height: calc(100vh - 80px); /* Full height minus header */
    overflow-x: hidden;
    min-height: 0;
}

/* Order Header Section Above Panes */
.order-header-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.order-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.order-header-fields {
    display: flex;
    gap: 2.5rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.order-header-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.order-header-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

.order-header-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

.order-header-value.empty-placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
    opacity: 0.6;
}

.order-header-value.order-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.order-header-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-width: 150px;
}

.order-header-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.order-header-actions {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-edit-order-header {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-edit-order-header:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
}

#resetPageBtn:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.order-header-edit-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.order-header-actions .pane-controls-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-primary);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color-dark);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2rem;
}

/* Paste Area */
.paste-area {
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3.5rem 2.5rem;
    text-align: center;
    background: rgba(240, 248, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
    outline: none;
}

.paste-area:focus,
.paste-area:hover {
    border-color: var(--border-color-dark);
    border-style: dashed; /* Keep dashed border on hover */
    background: #f5f5f5;
    box-shadow: var(--shadow-sm);
}

.paste-area.drag-over {
    border-color: var(--text-secondary);
    background: #f0f0f0;
    border-style: dashed; /* Keep dashed border when dragging over */
    box-shadow: var(--shadow-md);
}

.paste-area.has-content {
    border-color: var(--border-color-dark);
    background: var(--bg-secondary);
    border-style: solid;
}

.paste-content svg {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.paste-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.paste-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

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

kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', Monaco, monospace;
    font-size: 0.8125rem;
    box-shadow: var(--shadow-sm);
    margin: 0 0.125rem;
    font-weight: 500;
}

.pasted-content-wrapper {
    margin-top: 1.5rem;
    position: relative;
}

.pasted-content {
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.btn-clear-paste {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-clear-paste:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.pasted-content img {
    max-width: 100%;
    border-radius: 0;
}

.pasted-content pre {
    margin: 0;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.file-name {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.upload-option {
    flex: 1;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: none;
    background: var(--bg-secondary);
    text-align: center;
}

.upload-label:hover {
    border-color: var(--border-color);
    background: var(--bg-secondary);
    transform: none;
}

.upload-label svg {
    color: var(--text-primary);
}

.upload-label span {
    font-weight: 500;
    color: var(--text-primary);
}

.file-input {
    display: none;
}

.upload-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 0.875rem;
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    margin: 0 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    background: var(--bg-primary);
}

.extracted-items-list {
    margin-bottom: 1rem;
}

.extracted-items-container {
    min-height: 200px;
    max-height: none;
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.extracted-items-empty {
    color: var(--text-tertiary);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

.extracted-items-content {
    padding: 0.5rem 0;
}

.extracted-header-info {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.extracted-section-header {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.9375rem;
}

.extracted-item-line {
    padding: 0.25rem 0;
    padding-left: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    transition: all 0.2s ease;
}

.extracted-item-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.extracted-item-line:hover {
    background-color: rgba(0, 191, 255, 0.08);
    color: var(--text-primary);
    transform: translateX(2px);
}

.extracted-item-line.extracted-item-clicked {
    background-color: rgba(0, 191, 255, 0.12);
    color: var(--text-primary);
    font-weight: 600;
    border-top: 2px solid #00BFFF;
    border-bottom: 2px solid #00BFFF;
    animation: highlightPulse 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-row-highlighted {
    background-color: rgba(0, 191, 255, 0.08) !important;
    border-top: 2px solid #00BFFF;
    border-bottom: 2px solid #00BFFF;
    animation: highlightPulse 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes highlightPulse {
    0% {
        border-top-color: rgba(0, 191, 255, 0.3);
        border-bottom-color: rgba(0, 191, 255, 0.3);
    }
    50% {
        border-top-color: rgba(0, 191, 255, 0.8);
        border-bottom-color: rgba(0, 191, 255, 0.8);
    }
    100% {
        border-top-color: #00BFFF;
        border-bottom-color: #00BFFF;
    }
}

.step-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-icon {
    font-size: 1.125rem;
}

.btn-sm .btn-icon {
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color-dark);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--bg-primary);
    border-color: var(--text-secondary);
}

.btn-blue {
    position: relative;
    background: linear-gradient(135deg, #00BFFF 0%, #0099FF 50%, #0066FF 100%);
    background-size: 200% 200%;
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.btn-blue:hover:not(:disabled) {
    background: linear-gradient(135deg, #0099CC 0%, #0080FF 50%, #0052CC 100%);
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.7);
}

.btn-blue:hover:not(:disabled)::before {
    left: 100%;
}

.btn-blue:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 191, 255, 0.4);
}

.btn-blue:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #b3d9ff;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-blue:disabled:hover {
    background: #b3d9ff;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-blue:disabled:hover::before {
    left: -100%;
}

.btn-blue .btn-icon {
    transition: transform 0.3s ease;
}

.btn-blue:hover:not(:disabled) .btn-icon {
    transform: translateX(4px);
}

.btn-blue:disabled:hover .btn-icon {
    transform: none;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-dark);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: #dc3545;
    color: #ffffff;
    border: 1px solid #dc3545;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #dc3545;
    transform: none;
}

.btn-danger:disabled:hover {
    background: #dc3545;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-success {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-success:hover {
    background: var(--bg-secondary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-color-dark);
    box-shadow: var(--shadow-sm);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-tertiary);
    border-color: var(--border-color);
}

.btn-outline:disabled:hover {
    background: transparent;
    border-color: var(--border-color);
    box-shadow: none;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Loading Section */
.loading-section {
    margin-bottom: 2rem;
}

.loading-content {
    text-align: center;
    padding: 3rem 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 0 auto 1.5rem;
}

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

.loading-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.loading-content p {
    color: var(--text-secondary);
}

/* Results Section */
.results-section {
    margin-bottom: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Pane Controls Bar - Small, Subtle */
.pane-controls-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
    gap: 0.25rem;
}

.pane-control-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: auto;
    opacity: 0.6;
}

.pane-control-btn:hover {
    opacity: 1;
    color: var(--text-secondary);
    border-color: var(--border-color-dark);
}

.pane-control-btn.active {
    opacity: 1;
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Two-Pane Layout */
.two-pane-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.two-pane-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
    overflow: visible;
    transition: grid-template-columns 0.3s ease;
    align-items: start;
    position: relative;
}

/* Spacer for fixed left pane */
.two-pane-layout::before {
    content: '';
    grid-column: 1;
    height: 400px; /* Minimum spacer height, will adjust with pane */
    min-height: 300px;
}

.two-pane-layout.split-pane {
    grid-template-columns: 1fr 2fr;
}

.two-pane-layout.mostly-right {
    grid-template-columns: 0fr 1fr;
    gap: 0;
    width: calc(100% + 4rem);
    margin-left: -2rem;
    margin-right: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.two-pane-layout.mostly-right .pane-right {
    width: 100%;
    max-width: 100%;
}

.two-pane-layout.mostly-right .pane-left .pane-content {
    display: none;
}

.two-pane-layout.mostly-right .pane-left {
    min-width: 0;
    overflow: hidden;
}

.two-pane-layout.mostly-right .pane-left .pane-header {
    padding: 1.25rem 0.5rem;
    min-height: 60px;
    height: 60px;
    align-items: center;
    overflow: hidden;
}

.two-pane-layout.mostly-right .pane-left .pane-header h2 {
    display: none;
}

.two-pane-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.pane {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
    min-height: 0;
}

.pane-left {
    position: fixed;
    /* Height will be set dynamically by JavaScript based on viewport */
    box-shadow: var(--shadow-md); /* Enhanced shadow for floating effect */
    z-index: 100;
    /* Position and width will be set dynamically by JavaScript */
    /* Will stay visible in viewport while scrolling */
}

@media (max-width: 1400px) {
    .pane-left {
        left: 2rem;
        width: calc(33.33% - 1rem);
    }
}

.pane:hover {
    box-shadow: var(--shadow-md);
}


.pane-header {
    padding: 1.25rem 1.75rem;
    border-bottom: none;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    box-sizing: border-box;
    flex-shrink: 0;
    gap: 1.5rem;
}

.pane-left .pane-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: transparent;
    border-bottom: none;
}

.pane-footer {
    padding: 1.5rem 2rem;
    border-top: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 80px;
    gap: 0.75rem;
}

.pane-right .pane-header {
    flex-wrap: wrap;
    align-items: center;
}

.pane-right .pane-header .cart-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pane-control-btn svg {
    width: 16px;
    height: 16px;
}

.pane-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

.cart-actions {
    display: flex;
    gap: 0.5rem;
}

.pane-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.item-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.pane-left .pane-content {
    /* Height will be set dynamically by JavaScript */
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 200px; /* Minimum height for content area */
}

.pane-right {
    /* Make right pane fill available viewport height */
    min-height: calc(100vh - 200px); /* Subtract header and margins */
    height: auto;
}

.pane-right .pane-content {
    /* Ensure right pane content takes full height for bottom alignment */
    min-height: 400px;
    flex: 1;
}

.pane-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

.pane-subhead {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1.25rem 0;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

/* Match to SKUs Button - In pane footer */
.btn-match-skus {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 999px; /* Pill-shaped, almost half circles */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease, opacity 0.5s ease-out, visibility 0.5s ease-out;
    background: linear-gradient(135deg, #00BFFF 0%, #0099FF 50%, #0066FF 100%); /* Electric blue gradient */
    background-size: 200% 200%;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.5);
    position: relative;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
}

.btn-match-skus.fade-out {
    opacity: 0;
    visibility: hidden;
}

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

.btn-match-skus:hover {
    background: linear-gradient(135deg, #0099CC 0%, #0080FF 50%, #0052CC 100%); /* Darker electric blue gradient on hover */
    background-position: 100% 0; /* Animate gradient */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.7);
}

.btn-match-skus:hover::before {
    left: 100%;
}

.btn-match-skus:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 191, 255, 0.4);
}

.btn-match-skus:disabled {
    background: #b3d9ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-match-skus:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-match-skus:disabled:hover::before {
    left: -100%;
}

.btn-match-skus .btn-icon {
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.btn-match-skus:hover .btn-icon {
    transform: translateX(4px);
}

.btn-match-skus:disabled:hover .btn-icon {
    transform: none;
}

/* Export Button - Matches btn-outline btn-sm style */
.btn-export {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    background: transparent;
    box-shadow: none;
}

.btn-export:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-color-dark);
    box-shadow: var(--shadow-sm);
}

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
}

.btn-export:disabled:hover {
    background: transparent;
    border-color: var(--border-color);
    box-shadow: none;
}

.export-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.export-dropdown {
    position: relative;
}

.export-dropdown.open .export-arrow {
    transform: rotate(180deg);
}

.export-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.export-menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

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

.export-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pane-content .table-container {
    margin: 0;
    border: none;
    border-radius: 0;
}

.pane-content .data-table {
    font-size: 0.875rem;
}

.pane-content .data-table th,
.pane-content .data-table td {
    padding: 0.5rem 0.75rem;
}

/* Parsed Items Section */
.parsed-items-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.section-header-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.section-header-small h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Cart Styles */
.cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    margin-top: auto; /* Push to bottom */
    padding-bottom: 2rem; /* Add some bottom spacing */
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.empty-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.cart-items {
    height: 100%;
}

.cart-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--text-primary);
}


.cart-table .quantity-input {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.cart-table .quantity-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-md);
}

.arrow-with-replace {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.replace-link,
.choose-link {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.replace-link:hover,
.choose-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Options Accordion Styling */
.options-accordion-content {
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* Legacy options-accordion styles - now handled in the product group section below */

.delete-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.delete-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.delete-btn-selected {
    background: var(--bg-primary);
    border: 1px solid var(--border-color-dark);
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.delete-btn-selected:hover {
    background: #fee;
    border-color: #f44336;
    color: #d32f2f;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: 1px solid var(--border-color);
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: 300;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color-dark);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.modal-body .search-results {
    margin-top: 1rem;
    max-height: calc(80vh - 200px);
    overflow-y: auto;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.search-results {
    display: block;
    max-height: 400px;
    overflow-y: auto;
}

.search-results table {
    width: 100%;
}

/* Search results table styling (matching choice dropdown) */
.search-results-table {
    border: none;
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.search-results-table tbody tr.search-result-row {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.search-results-table tbody tr.search-result-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.search-results-table tbody tr.search-result-row:last-child {
    border-bottom: none;
}

.search-results-table tbody tr.search-result-row:hover {
    background-color: rgba(0, 191, 255, 0.05) !important;
    box-shadow: 0 2px 4px rgba(0, 191, 255, 0.1);
}

/* Legacy search-result-item styles (kept for backward compatibility) */
.search-result-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color-dark);
    box-shadow: var(--shadow-sm);
}

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

.search-result-sku {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.search-result-price {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.search-result-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.search-result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.search-result-brand,
.search-result-category {
    font-weight: 500;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

/* Order Info Section in Header */
.order-info-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.order-info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.order-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.order-info-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Cart Actions Bar Below Header */
.cart-actions-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.btn-edit-order-info {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-edit-order-info:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
}

.order-info-fields {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.order-info-section-header .order-info-fields {
    margin-bottom: 0;
}

.order-info-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.order-info-section-header .order-info-field {
    flex: 0 0 auto;
}

.order-info-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.order-info-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.order-info-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.order-info-input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.order-info-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.order-info-section-header .order-info-actions {
    padding-top: 0;
    border-top: none;
    margin-left: auto;
    flex-shrink: 0;
}

/* Status Indicators */
.status-indicator {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1.25rem 0;
    margin-bottom: 1rem;
    box-shadow: none;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    flex-shrink: 0;
}

.status-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.status-message {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.matching-status {
    margin-top: 1rem;
    padding: 1.25rem;
    background: transparent;
    border-radius: 0;
    border: none;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    opacity: 1;
    visibility: visible;
}

.matching-status.fade-out {
    opacity: 0;
    visibility: hidden;
    box-shadow: none;
}

.progress-bar-small {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill-small {
    height: 100%;
    background: var(--text-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-sm);
}

.matching-status-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Item Cards */
.item-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.item-card:hover {
    border-color: var(--border-color);
    box-shadow: none;
    transform: none;
}

.item-card.selected {
    border-color: var(--border-color);
    background: var(--bg-secondary);
}

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

.item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    flex: 1;
}

.confidence-badge {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid;
    display: inline-block;
    letter-spacing: 0.05em;
}

.confidence-high {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.confidence-medium {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.confidence-low {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.confidence-none {
    background: #e2e3e5;
    color: #383d41;
    border-color: #6c757d;
}

.confidence-manual {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

.unmatched-row {
    background-color: #f8f9fa;
    opacity: 0.8;
}

.unmatched-row td {
    color: #6c757d;
}

/* Cart row hover effects */
.cart-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Product group hover - left accent bar on entire group */
.cart-table tbody.product-group tr {
    transition: background-color 0.2s ease;
}

.cart-table tbody.product-group tr td:first-child {
    position: relative;
}

/* Left accent border appears on entire group when hovering anywhere in the group */
.cart-table tbody.product-group tr td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #00BFFF;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cart-table tbody.product-group:hover tr td:first-child::before {
    opacity: 1;
}

/* Top shadow effect on product header when group is hovered */
.cart-table tbody.product-group:hover tr.product-header-row td {
    box-shadow: 0 -4px 8px -2px rgba(0, 0, 0, 0.1);
}

/* Bottom shadow effect on last row when group is hovered */
.cart-table tbody.product-group:hover tr:last-child:not(.product-header-row) td {
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.15);
}

/* When product header IS the last row (single item) */
.cart-table tbody.product-group:hover tr.product-header-row:last-child td {
    box-shadow: 0 -4px 8px -2px rgba(0, 0, 0, 0.1), 0 4px 8px -2px rgba(0, 0, 0, 0.15);
}

/* Individual row highlight - only the hovered row gets background change */
.cart-table tbody.product-group tr:hover {
    background-color: rgba(0, 191, 255, 0.08);
}

.cart-table tbody.product-group tr.product-header-row:hover {
    background-color: rgba(0, 191, 255, 0.12);
}

/* Options accordion clean styling - no extra shadows or borders */
.options-accordion-row {
    background: var(--bg-primary) !important;
}

.options-accordion-row:hover {
    background: var(--bg-primary) !important;
    transform: none;
    box-shadow: none;
}

/* Remove shadows and borders from accordion row */
.options-accordion-row td {
    box-shadow: none !important;
    border: none !important;
}

/* Hide the left accent bar on the accordion row itself (prevent double bar) */
.cart-table tbody.product-group tr.options-accordion-row td:first-child::before {
    display: none !important;
}

.options-accordion-content .cart-table {
    background: transparent;
    border: none;
    border-collapse: collapse;
}

.options-accordion-content .cart-table tbody {
    background: transparent;
}

.options-accordion-content .option-row {
    transition: background-color 0.15s ease;
    background: var(--bg-primary);
    border-bottom: none;
    position: relative;
}

/* Separator line that starts after the blue bar */
.options-accordion-content .option-row::after {
    content: '';
    position: absolute;
    left: 4px; /* Start after the blue bar */
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--border-color);
}

.options-accordion-content .option-row:last-child::after {
    display: none;
}

/* Remove all borders and shadows from option row cells */
.options-accordion-content .option-row td {
    box-shadow: none !important;
    border: none !important;
    background: transparent;
}

.options-accordion-content .option-row:hover {
    background-color: rgba(0, 191, 255, 0.06) !important;
    transform: none;
}

.options-accordion-content .option-row.option-selected {
    background-color: #fff8e1 !important;
}

/* Left accent bar on option rows - positioned at the very left edge */
.options-accordion-content .option-row {
    position: relative;
}

.options-accordion-content .option-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #00BFFF;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.cart-table tbody.product-group:hover .options-accordion-content .option-row::before {
    opacity: 1;
}

.cart-table tbody tr:hover td {
    position: relative;
}

/* Section header rows */
.section-header-row {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color-dark);
}

.section-header-row td {
    font-weight: 600;
    padding: 1rem 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Product header rows */
.product-header-row {
    background: var(--bg-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-header-row td {
    font-weight: 600;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.product-header-row.cart-row-highlighted {
    background-color: rgba(0, 191, 255, 0.2) !important;
    border-top: 3px solid #00BFFF !important;
    border-bottom: 3px solid #00BFFF !important;
    box-shadow: 0 2px 12px rgba(0, 191, 255, 0.3), inset 0 0 0 1px rgba(0, 191, 255, 0.2);
    animation: highlightPulse 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-header-row.cart-row-highlighted td {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

/* Exploded item rows - use visual indentation instead of color */
.exploded-row {
    background-color: transparent;
}

.exploded-row.exploded-first {
    border-top: 1px solid rgba(0, 191, 255, 0.2);
    border-bottom: 1px solid rgba(0, 191, 255, 0.2);
}

.exploded-row.exploded-sub {
    background-color: transparent;
}

.exploded-row.exploded-sub td:first-child {
    padding-left: 3rem;
    position: relative;
}

.exploded-row.exploded-sub td:nth-child(2) {
    padding-left: 3.5rem;
    position: relative;
}

.exploded-row.exploded-sub td:first-child::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    width: 1rem;
    height: 1px;
    background-color: rgba(0, 191, 255, 0.4);
    transform: translateY(-50%);
}

.exploded-row.exploded-sub:hover {
    background-color: rgba(0, 191, 255, 0.05);
}

/* Chevron styling for explosion groups */
.explosion-chevron {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    vertical-align: middle;
}

.explosion-chevron:hover {
    color: #00BFFF;
    transform: scale(1.2);
}

/* Arrow column styling */
.cart-table td:has(> [style*="→"]) {
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    padding: 0.75rem 0.5rem;
}

.cart-table th:nth-child(5) {
    text-align: center;
}

.item-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.match-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0 0.5rem;
}

/* Unmatched Items */
.unmatched-item {
    border-color: var(--border-color);
    background: var(--bg-secondary);
}

.order-direct-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: none;
}

.order-direct-btn:hover {
    background: var(--bg-secondary);
}

/* Review Section */
.review-section {
    margin-top: 2rem;
}

.review-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 0.5rem;
    box-shadow: none;
}

/* Modal - Duplicate removed, using main modal styles at line 1304 */

/* Home Page Styles */
.home-content {
    min-height: calc(100vh - 8rem);
    padding: 2rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 2rem;
}

.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.tool-card:hover {
    border-color: var(--border-color-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    background: var(--bg-primary);
}

.tool-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.tool-content {
    flex: 1;
}

.tool-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.tool-badge {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.tool-arrow {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Step Sections */
.step-section {
    margin-bottom: 2rem;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

/* Product Thumbnails */
.product-thumbnail {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.image-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.image-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zoomIn 0.2s ease-out;
}

.lightbox-image {
    width: 400px;
    height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10002;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

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

.matching-table td.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.status-pending {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.status-matching {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.status-matched {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.status-error {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Progress Bar */
.matching-progress {
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--text-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-sm);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Results Table Specific Styles */
.results-table .confidence-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Responsive Design */
@media (max-width: 768px) {
    .two-pane-container,
    .two-pane-results,
    .two-pane-layout {
        grid-template-columns: 1fr;
    }

    .two-pane-layout {
        height: auto;
    }

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

    .upload-divider {
        margin: 1rem 0;
    }

    .upload-divider::before,
    .upload-divider::after {
        display: none;
    }

    .form-actions {
        flex-direction: column;
    }

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

    .main-content {
        padding: 1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        padding-top: 1rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .results-actions {
        width: 100%;
        flex-direction: column;
    }

    .table-container {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* Login Page Styles */
.login-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    height: 3rem;
    width: auto;
    display: block;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    text-align: center;
    margin: 0 0 2rem 0;
}

.login-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.login-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0;
}

