/* EzPrint Web Interface Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F5F5F5;
    min-height: 100vh;
    color: #2D3748;
    overflow-x: hidden;
}

/* Landing Page & Xerox Scroll Lock */
body:has(#landingSection:not([style*="display: none"])),
body:has(#xeroxScannerSection:not([style*="display: none"])) {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 0;
    margin-bottom: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.header h2 {
    font-size: 1.5em;
    color: #666;
    font-weight: normal;
}

/* Header Card - Converted to Page Header */
.header-card {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #F7FAFC;
    border: none;
    border-bottom: 1px solid #E2E8F0;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

    /* Full width breakout */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    padding: 10px 20px;
    text-align: center;
}

.header-card h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1A202C;
    margin-bottom: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: -0.5px;
}

.header-logo {
    display: block;
    width: 100%;
    height: 50px;
    margin: 0 0 6px 0;
    max-width: 100%;
    max-height: none;
    box-sizing: border-box;
    padding: 2px 16px;
    object-fit: contain;
    object-position: center;
    background-color: #EEF2FF;
    border: 1px solid #E0E7FF;
    border-radius: 12px;
}

.header-card h2 {
    font-size: 18px;
    color: #4A5568;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: block;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}

.upload-section {
    margin-top: 24px;
    margin-bottom: 30px;
    scroll-margin-top: calc(var(--header-height, 120px) + 20px);
}

.print-section-header {
    display: flex;
    align-items: center;
}

.print-back-btn {
    position: fixed;
    left: 20px;
    top: 75px;
    transform: translateY(-50%);
    z-index: 1100;
    background: #F8FAFF;
    border: 1px solid #E0E7FF;
    border-radius: 6px;
    width: 40px;
    height: 20px;
    font-size: 18px;
    font-weight: 800;
    color: #1A202C;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

/* Invisible tap area to maintain 44px minimum touch target */
.print-back-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 44px;
    transform: translate(-50%, -50%);
}

.print-back-btn:hover {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #000000;
    transform: translateY(-50%) scale(1.05);
}

.print-back-btn:active {
    transform: translateY(-50%) scale(0.95);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 14px;
    color: #666;
}

/* Page Selection Styles */
.page-selection-container {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    background: #f8f9fa;
}

.page-selection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.page-selection-info span {
    font-weight: bold;
    color: #495057;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    margin-left: 5px;
}

.page-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.page-checkbox-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-checkbox-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.page-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.page-checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
}

.page-checkbox-item.selected {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.page-checkbox-item.selected label {
    color: white;
}

.page-selection-hint {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    width: 100%;
    margin: 20px 0;
}

/* Page Navigation Styles */
.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.page-nav-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.page-nav-btn:hover {
    background: #0056b3;
}

.page-nav-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.page-info {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

/* Copies Per Page Styles */
.copies-per-page-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.copies-per-page-panel h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
}

.copies-per-page-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.copies-per-page-info span {
    font-size: 14px;
    color: #6c757d;
}

.copies-per-page-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.copies-per-page-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    transition: all 0.2s ease;
}

.copies-per-page-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.copies-per-page-item .page-label {
    font-weight: bold;
    color: #495057;
    font-size: 14px;
}

.copies-per-page-item .copies-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.copies-per-page-item .copies-input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.copies-per-page-item .copies-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.copies-per-page-item .copies-buttons {
    display: flex;
    gap: 5px;
}

.copies-per-page-item .copies-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ced4da;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.copies-per-page-item .copies-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.copies-per-page-item .copies-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ced4da;
}

/* Layout Preview Styles */
.layout-preview-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.layout-preview-panel h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
}

.layout-preview-info {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.layout-preview-info span {
    font-size: 14px;
    color: #6c757d;
}

.layout-preview-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.layout-grid {
    display: grid;
    gap: 8px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.layout-grid-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: 200px;
    height: 280px;
}

.layout-grid-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    width: 200px;
    height: 140px;
}

.layout-grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 200px;
    height: 200px;
}

.layout-page {
    background: white;
    border: 1px solid #007bff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #007bff;
    position: relative;
    overflow: hidden;
}

.layout-page::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px dashed #007bff;
    border-radius: 2px;
    opacity: 0.5;
}

.layout-page-text {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
}

.layout-preview-hint {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    font-size: 14px;
}


.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Price Information Display */
.price-info {
    margin-top: 20px;
    margin-bottom: 20px;
}

.price-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #374151;
}

.price-row:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.price-row.price-total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px solid #3b82f6;
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.price-row span:first-child {
    font-weight: 500;
}

.price-row span:last-child {
    font-weight: 600;
    color: #1f2937;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Single Preview Window - Professional Printer Driver Style */
.preview-section {
    margin-top: 30px;
    scroll-margin-top: calc(var(--header-height, 120px) + 20px);
}

.preview-window {
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.preview-header {
    background: #f5f5f5;
    border-bottom: 1px solid #d0d0d0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-control-btn {
    background: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    transition: all 0.2s ease;
}

.preview-control-btn:hover {
    background: #e6f3ff;
    border-color: #0078d4;
}

.preview-control-btn:active {
    background: #cce7ff;
}

.zoom-level {
    font-size: 12px;
    color: #666;
    min-width: 40px;
    text-align: center;
}

.preview-content {
    display: flex;
    min-height: 400px;
}

.preview-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafafa;
    border-right: 1px solid #e0e0e0;
    position: relative;
    padding: 20px;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.preview-info {
    width: 200px;
    background: #f9f9f9;
    padding: 16px;
    border-left: 1px solid #e0e0e0;
}

.preview-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.preview-info-row:last-child {
    margin-bottom: 0;
}

.preview-info .info-label {
    font-weight: 600;
    color: #555;
}

.preview-info .info-value {
    color: #333;
    text-align: right;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.preview-loading span {
    font-size: 14px;
    color: #666;
}

.preview-actions {
    background: #f5f5f5;
    border-top: 1px solid #d0d0d0;
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.preview-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-image-container:hover .preview-overlay {
    display: flex;
    opacity: 1;
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.preview-action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.preview-action-btn:hover {
    background: white;
}

.preview-info-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.preview-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.preview-info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: bold;
    color: #495057;
}

.info-value {
    color: #6c757d;
    text-align: right;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

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

.job-details-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.job-details-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(26, 32, 44, 0.06);
    padding: 16px;
}

.job-details-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.job-details-card-title {
    font-weight: 700;
    color: #111827;
    font-size: 16px;
}

.job-details-card-sub {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.job-details-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-details-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.job-details-row-multiline {
    align-items: flex-start;
}

.job-details-label {
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}

.job-details-value {
    color: #111827;
    font-size: 13px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-details-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.job-details-tag {
    font-size: 12px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    border-radius: 9999px;
}

.job-details-amount {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.job-details-status-pill {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.job-details-status-pill.is-pending {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.job-details-status-pill.is-queue {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.job-details-status-pill.is-printing {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}

.job-details-status-pill.is-completed {
    background: #d1fae5;
    color: #065f46;
    border-color: #86efac;
}

.job-details-status-pill.is-failed {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Modern status card */
.status-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    padding: 16px;
}

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

.status-title {
    font-weight: 700;
    color: #111827;
    font-size: 16px;
}

.status-meta {
    color: #6b7280;
    font-size: 12px;
}

.status-file {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-file-icon {
    font-size: 18px;
}

.status-file-name {
    font-weight: 600;
    color: #111827;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-file-type {
    color: #6b7280;
    font-size: 12px;
}

/* Horizontal stepper */
.status-stepper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 10px;
    margin: 10px 0 12px;
}

.status-stepper .step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    flex: 0 0 auto;
}

.status-stepper .step.done {
    background: #d1fae5;
    color: #065f46;
    box-shadow: inset 0 0 0 1px #86efac;
}

.status-stepper .step.current {
    background: #dbeafe;
    color: #1e40af;
    box-shadow: inset 0 0 0 1px #93c5fd;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.status-stepper .step.failed {
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px #fecaca;
}

.status-stepper .step-sep {
    display: none;
}

/* Progress bar */
.status-progress .pro {
    width: 100%;
    height: 20px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.status-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    transition: width 0.4s ease;
}

.status-progress .progress-text {
    mix-blend-mode: normal;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Error card */
.status-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 13px;
}

/* Legacy job list styles removed in favor of single card */

.status-info {
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #d4edda;
}

.status-item .label {
    font-weight: 600;
    color: #155724;
}

.status-item span:last-child {
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #d4edda;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
}



.error-section {
    text-align: center;
    padding: 40px;
}

.error-message {
    font-size: 1.2em;
    color: #dc3545;
    margin: 20px 0;
    padding: 20px;
    background: #f8d7da;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.info-section {
    margin-bottom: 30px;
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-section p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.features {
    margin-bottom: 20px;
}

.features h4 {
    color: #555;
    margin-bottom: 10px;
}

.features ul {
    padding-left: 20px;
}

.features li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
}

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

    .header h1 {
        font-size: 2em;
    }

    .button-group {
        flex-direction: column;
    }

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

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

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Status Colors */
.status-pending {
    color: #ffc107;
    font-weight: bold;
}

.status-processing {
    color: #17a2b8;
    font-weight: bold;
}

.status-printing {
    color: #007bff;
    font-weight: bold;
}

.status-completed {
    color: #28a745;
    font-weight: bold;
}

.status-failed {
    color: #dc3545;
    font-weight: bold;
}

/* Ensure consistent styling for all completion statuses */
.status-stepper .step.done {
    background: #d1fae5;
    color: #065f46;
    box-shadow: inset 0 0 0 1px #86efac;
}

/* ===== Light Minimal Theme Overrides (Customer Upload Page) ===== */

.container {
    max-width: 880px;
    padding: 0 24px 24px 24px;
    margin-top: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 700;
    color: #1A202C;
    font-size: 16px;
}

.form-group input,
.form-group select {
    padding: 12px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
    color: #2D3748;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2B6CB0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.file-info {
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    color: #4A5568;
    padding: 12px;
}

.button-group {
    gap: 12px;
    margin-top: 24px;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: #2B6CB0;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.2);
}

.btn-primary:hover {
    background: #255a94;
}

.btn-primary:active {
    background: #1f4d80;
}

.btn-secondary {
    background: #EDF2F7;
    color: #2D3748;
    border: 1px solid #E2E8F0;
}

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

.btn-secondary:active {
    background: #CBD5E0;
}

.preview-window {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(26, 32, 44, 0.06);
}

.preview-header {
    background: #F7FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.preview-image-container {
    background: #FAFAFA;
    border-right: 1px solid #E2E8F0;
}

.preview-info {
    background: #F7FAFC;
    border-left: 1px solid #E2E8F0;
}

.status-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(26, 32, 44, 0.06);
}

.status-stepper .step.current {
    background: #EBF8FF;
    color: #2B6CB0;
    box-shadow: inset 0 0 0 1px #BEE3F8;
}

.status-progress .pro {
    background: #EDF2F7;
    border: 1px solid #E2E8F0;
}

.status-progress .progress-fill {
    background: linear-gradient(90deg, #2B6CB0, #4299E1);
}

/* Drag-and-drop upload area */
.dropzone {
    position: relative;
    border: 2px dashed #CBD5E0;
    background: #F7FAFC;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone .dropzone-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    color: #4A5568;
}

.dropzone .dropzone-icon {
    font-size: 22px;
}

.dropzone .muted {
    color: #718096;
    font-size: 14px;
}

.dropzone:hover {
    background: #F0F7FF;
    border-color: #2B6CB0;
}

.dropzone.dragover {
    background: #EBF8FF;
    border-color: #2B6CB0;
}

/* ===== Mobile-first redesigned preview ===== */
.preview-section.redesigned {
    margin-top: 20px;
    scroll-margin-top: calc(var(--header-height, 120px) + 20px);
}

.preview-window.big-mobile {
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 8px 24px rgba(26, 32, 44, 0.06);
    padding: 12px;
    background: #FFFFFF;
}

.preview-viewport {
    width: 100%;
    aspect-ratio: unset;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: visible;
}

.preview-viewport img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.preview-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 10px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    width: 100%;
}

.preview-view-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6eaf0;
    /* visual partition */
}

.preview-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding-top: 6px;
}

@media (max-width: 480px) {
    .preview-toolbar {
        gap: 8px;
        padding: 10px 6px;
    }

    .preview-view-controls,
    .preview-pagination-controls {
        gap: 6px;
    }
}

.preview-toolbar .toolbar-btn {
    background: white;
    border: 1px solid #CBD5E0;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .preview-toolbar .toolbar-btn {
        padding: 6px 6px;
        font-size: 13px;
    }
}

.preview-toolbar .toolbar-btn:hover:not(:disabled) {
    background: #EDF2F7;
    border-color: #A0AEC0;
}

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

.preview-toolbar .toolbar-btn.right {
    margin-left: 0;
}

.preview-toolbar .zoom-text {
    font-weight: 600;
    color: #2D3748;
}

.preview-toolbar .page-indicator {
    font-weight: 600;
    color: #2D3748;
    padding: 0 4px;
    min-width: 100px;
    text-align: center;
}

@media (max-width: 480px) {
    .preview-toolbar .page-indicator {
        min-width: 70px;
        font-size: 12px;
    }

    .preview-toolbar .zoom-text {
        font-size: 12px;
    }
}

/* Landing Page Styles - Minimalist Design */
.landing-section {
    height: calc(100vh - var(--header-height, 120px) - 32px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 32px 0 0 0 !important;
}

.landing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    max-height: 100%;
    padding: 10px;
}

.landing-card {
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(26, 32, 44, 0.04);
}

.landing-card:hover {
    box-shadow: 0 4px 12px rgba(26, 32, 44, 0.08);
    transform: translateY(-2px);
}

.card-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
}

.card-icon {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    object-fit: contain;
}

.scribble-annotation {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 100px;
    height: 100px;
    z-index: 1;
    pointer-events: none;
}

.xerox-icon {
    filter: drop-shadow(0 2px 4px rgba(183, 148, 244, 0.3));
}

.print-icon {
    filter: drop-shadow(0 2px 4px rgba(252, 211, 77, 0.3));
}

.landing-card h3 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 800;
    color: #1A202C;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: -0.5px;
}

.landing-card p {
    font-size: 16px;
    margin-bottom: 0;
    color: #4A5568;
    font-weight: 400;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Cropper Modal - Mobile-first, fullscreen design */
.cropper-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.cropper-modal.open {
    opacity: 1;
}

.cropper-modal-backdrop {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.cropper-modal.open .cropper-modal-backdrop {
    opacity: 1;
}

.cropper-modal-content {
    position: relative;
    z-index: 10000;
    background: #000;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Desktop: centered modal */
    max-width: 1200px;
    margin: auto;
    border-radius: 0;
    /* Full screen feel */
    box-shadow: none;
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
}

.cropper-modal.open .cropper-modal-content {
    transform: translateY(0);
}

.cropper-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    overflow: hidden;
    gap: 10px;
    padding: 12px;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.cropper-canvas-wrap,
.crop-container {
    position: relative;
    flex: 1;
    width: 100%;
    max-width: 100vw;
    min-height: 300px;
    height: auto;
    max-height: 75vh;
    /* Increased for better visibility */
    overflow: hidden;
    /* Prevents layout expansion while allowing internal cropper to adapt */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    contain: layout;
    /* Optimize rendering performance on mobile */
    /* Ensure centered alignment after rotation */
    transform-origin: center center;
}

#cropperImage {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* 
   IMPORTANT: DO NOT apply generic scaling or !important rules to images inside 
   .cropper-container. The library manages these dimensions dynamically.
   Applying width:auto or max-width:100% breaks image alignment.
*/
.cropper-container img {
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    box-shadow: none !important;
    /* width/height managed by library inline styles */
}

#cropCanvas {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    background: #000;
}

.cropper-canvas-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: #000;
    overflow: hidden;
}

.crop-frame {
    position: absolute;
    border: 3px solid #3b82f6;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    cursor: move;
    z-index: 100;
    box-sizing: border-box;
    pointer-events: auto;
}

.crop-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #3b82f6;
    border: 3px solid #fff;
    border-radius: 50%;
    z-index: 101;
    touch-action: none;
}

.crop-handle.nw {
    top: -12px;
    left: -12px;
    cursor: nw-resize;
}

.crop-handle.ne {
    top: -12px;
    right: -12px;
    cursor: ne-resize;
}

.crop-handle.sw {
    bottom: -12px;
    left: -12px;
    cursor: sw-resize;
}

.crop-handle.se {
    bottom: -12px;
    right: -12px;
    cursor: se-resize;
}

.cropper-canvas-wrap.rotated,
.crop-container.rotated {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure the Cropper.js container also scales correctly within our flex wrap */
.cropper-container {
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 auto;
    /* Center alignment safety - prevent layout shift during rotation */
    position: relative;
    /* Prevent overflow-based clipping on mobile viewport */
    contain: layout style paint;
}

/* 
   TRANSFORM SYNC GUARANTEE:
   Ensure the SAME transform matrix and origin apply to:
   - Active crop view-box image (visible)
   - Blue crop frame (crop-box)
   
   This prevents double transform stacking and ensures unified rotation.
*/
.cropper-container,
.cropper-view-box,
.cropper-view-box img,
.cropper-crop-box {
    transform-origin: center center !important;
}

/* Prevent nested transform inheritance that causes offset during rotation */
.cropper-container {
    transform: none !important;
}

.cropper-wrap-box {
    transform-origin: center center !important;
}

/* Mobile GPU stability for visible layers only */
.cropper-view-box,
.cropper-view-box img,
.cropper-crop-box {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

/* Note: View-box transforms are managed by Cropper.js for rotation */
/* We only ensure transform-origin is centered (set above) */

/* 
   SINGLE IMAGE VISUAL SOURCE ENFORCEMENT:
   Hide ALL duplicate image layers to prevent ghosting/overlapping during rotation.
   Only the image inside .cropper-view-box remains visible.
   
   Using visibility: hidden instead of opacity: 0 ensures:
   - Layer remains in DOM for Cropper.js calculations
   - Layer is completely invisible (no transparency artifacts)
   - No GPU compositing overhead for hidden layer
*/
/* Hide background canvas image layer */
.cropper-canvas,
.cropper-canvas img,
.cropper-wrap-box img,
.cropper-wrap-box canvas {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Hide any nested image elements in canvas/wrap containers */
.cropper-container>img:not(.cropper-view-box img),
.cropper-container .cropper-wrap-box>img,
.cropper-container .cropper-wrap-box>canvas,
.cropper-container .cropper-wrap-box img,
.cropper-container .cropper-canvas img {
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    position: absolute !important;
    z-index: -1 !important;
}

/* Ensure wrap-box doesn't create visual artifacts */
.cropper-wrap-box {
    visibility: visible !important;
    /* Keep visible for layout, but hide its image children */
}

/* Note: View-box image visibility is handled by the rule at line 1983 */

/* Hide duplicated preview box as requested */
.cropper-preview-wrap {
    display: none !important;
    visibility: hidden !important;
}


/* Cropper.js custom styling for handles and frame */
.cropper-bg {
    background-image: none !important;
    background-color: #000 !important;
}

.cropper-modal {
    background-color: #000 !important;
    opacity: 1 !important;
    /* Ensure solid black isolation */
    /* Solid black backdrop for everything outside crop box */
}

/* 
   ACTIVE IMAGE LAYER (ONLY VISIBLE SOURCE):
   Ensure the view-box image is the ONLY visible image during rotation.
   This is the single source of truth for the visual representation.
*/
.cropper-view-box img {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-origin: center center !important;
    /* Ensure image stays centered during rotation */
    margin: 0 auto;
    position: relative;
    z-index: 10 !important;
    /* Highest z-index to ensure it's above all hidden layers */
}

/* Ensure view-box container centers its content */
.cropper-view-box {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
}

.cropper-container .cropper-crop-box {
    border: none !important;
}

.cropper-view-box {
    outline: 2px solid #3b82f6 !important;
    outline-offset: -1px;
}

.cropper-line {
    background-color: #3b82f6 !important;
}

.cropper-point {
    width: 12px !important;
    height: 12px !important;
    background-color: #3b82f6 !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    opacity: 1 !important;
}

.cropper-container .cropper-point.point-se {
    cursor: se-resize;
}

.cropper-container .cropper-point.point-sw {
    cursor: sw-resize;
}

.cropper-container .cropper-point.point-nw {
    cursor: nw-resize;
}

.cropper-container .cropper-point.point-ne {
    cursor: ne-resize;
}

.cropper-container .cropper-point.point-n,
.cropper-container .cropper-point.point-s {
    cursor: ns-resize;
}

.cropper-container .cropper-point.point-e,
.cropper-container .cropper-point.point-w {
    cursor: ew-resize;
}

.cropper-preview-wrap {
    flex-shrink: 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
}

.cropper-preview-label {
    font-weight: 600;
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.cropper-preview-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cropperPreview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transform-origin: center center;
}

/* Fixed bottom toolbar - prevents overlap */
.cropper-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
    /* Desktop: constrain to modal width */
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px 12px 0 0;
}

.cropper-modal.open .cropper-toolbar {
    transform: none;
}

.cropper-toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
    min-width: 60px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    /* Updated to 12px as requested */
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.cropper-toolbar-btn:hover,
.cropper-toolbar-btn:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.cropper-toolbar-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

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

/* Button-style Retake (Secondary) */
.cropper-btn-retake {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    min-width: 90px !important;
    flex-direction: row !important;
    gap: 8px !important;
}

.cropper-btn-retake:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Button-style Continue (Primary) */
.cropper-btn-continue {
    background: #0ea5e9 !important;
    /* Standard Xerox blue */
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 10px 24px !important;
    min-width: 120px !important;
    border-radius: 12px !important;
    flex-direction: row !important;
    gap: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.cropper-btn-continue:hover {
    background: #0284c7 !important;
}

.cropper-btn-icon {
    font-size: 20px;
    line-height: 1;
}

.cropper-btn-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cropper-btn-continue:disabled {
    background: #64748b;
    opacity: 0.6;
}

/* Doc Name Modal */
.cropper-doc-name-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2020;
    background: rgba(0, 0, 0, 0.7);
}

.cropper-doc-name-content {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cropper-doc-name-content label {
    font-weight: 600;
    color: #1A202C;
}

.cropper-doc-name-content input {
    padding: 10px 12px;
    border: 1px solid #CBD5E0;
    border-radius: 6px;
    font-size: 14px;
}

.cropper-doc-name-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* XEROX Scanner Styles - Native Full Screen UI */
.xerox-scanner-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: hidden;
}

.scanner-native-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: #000;
    z-index: 10001;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.scanner-native-back {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    font-family: serif;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.scanner-native-back:active {
    transform: scale(0.9);
}

/* XEROX Settings Section */
.xerox-settings-section {
    margin-top: 24px;
    margin-bottom: 30px;
    scroll-margin-top: calc(var(--header-height, 120px) + 20px);
}

.xerox-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.xerox-settings-header h3 {
    font-size: 1.8em;
    color: #667eea;
    margin: 0;
}

.xerox-document-info {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.xerox-document-info .file-info {
    color: #333;
    font-size: 14px;
    line-height: 1.8;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.xerox-scanner-section {
    scroll-margin-top: calc(var(--header-height, 120px) + 20px);
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* Remove legacy scanner items */
.scanner-header,
.scanner-content {
    display: contents;
}

.camera-preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    /* Scanner header height */
    padding-bottom: 160px;
    /* Scanner footer height */
    box-sizing: border-box;
}

.camera-preview-container video {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1.414;
    /* Optimized A4 ratio for document capture */
    object-fit: cover;
    border: none;
    /* Clean edges as requested */
    border-radius: 0 !important;
    /* Strictly sharp corners as per reference */
    background: #000;
    box-shadow: none;
}

.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    color: white;
    text-align: center;
}

.camera-placeholder .placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.camera-placeholder p {
    margin: 10px 0;
    font-size: 1.1em;
}

.camera-placeholder .fallback-text {
    margin-top: 30px;
    font-size: 0.9em;
    opacity: 0.8;
}

.scanner-native-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: #000;
    display: flex;
    align-items: center;
    /* Vertically align all items on same baseline */
    justify-content: center;
    gap: 16px;
    padding: 0 40px 20px 40px;
    z-index: 10001;
}

.native-thumb-preview {
    width: 56px;
    height: 56px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-12px);
    /* Shifted slightly left for visual balance */
}

.native-thumb-box {
    width: 56px;
    height: 56px;
    background: #1e1e1e;
    /* Darker grey as seen in references */
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}



#thumbnailsGrid {
    width: 100%;
    height: 100%;
    display: flex !important;
    overflow: hidden;
}

.native-thumb-box .thumbnail-item {
    display: none !important;
    position: absolute;
    inset: 0;
    border: none !important;
    border-radius: 10px !important;
    /* Slightly smaller than container to fit inside border */
    padding: 0 !important;
    margin: 0 !important;
}

.native-thumb-box .thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.native-thumb-box .thumbnail-item:last-child {
    display: block !important;
}

.native-thumb-box .thumbnail-item .thumbnail-actions,
.native-thumb-box .thumbnail-item .page-number {
    display: none !important;
}

.native-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #3b82f6;
    /* SaaS blue */
    color: white;
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 20000;
    /* Above thumbnail */
}

/* Ensure badge is visible even if count is 0 */
#scannedPageCount {
    display: flex !important;
}

.native-capture-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 6px solid #fff;
    background: transparent;
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
    outline: none;
}

.native-capture-btn::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: #fff;
    border-radius: 50%;
}

.native-capture-btn:active {
    transform: scale(0.92);
}

.native-done-wrapper {
    width: 60px;
    /* Balanced with thumbnail width */
    display: flex;
    justify-content: center;
}

.native-done-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    outline: none;
}

.native-done-btn:active {
    transform: scale(0.8);
}

/* Legacy bits cleanup */
.scanner-controls,
.scanned-pages-container,
.scanner-actions {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .landing-cards {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 0;
        padding: 5px;
    }

    .landing-card {
        padding: 20px 16px;
    }

    .scribble-annotation {
        width: 100px;
        height: 100px;
        top: -8px;
        left: -8px;
    }

    .landing-card h3 {
        font-size: 28px;
    }

    .header-card {
        margin: 0;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        width: 100vw;
        padding: 8px 20px;
    }

    .header-card h1 {
        font-size: 32px;
    }

    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

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

    .scanner-actions .btn {
        width: 100%;
    }
}

.preview-file-details {
    margin-top: 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F7FAFC;
    padding: 10px;
}

.preview-file-details .row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.preview-file-details .row span:first-child {
    flex: 0 0 auto;
}

.preview-file-details .row span:last-child {
    flex: 1 1 auto;
    text-align: right;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.preview-actions.compact {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.preview-actions.compact .btn {
    padding: 10px 14px;
}

/* XEROX Auto-Preview Error and Toast Styles */
.xerox-preview-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    text-align: center;
}

.xerox-preview-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Desktop cropper modal adjustments */
@media (min-width: 769px) {
    .cropper-modal-content {
        max-height: 90vh;
        height: auto;
    }

    .cropper-body {
        max-height: calc(90vh - 100px);
        flex: 1 1 auto;
    }

    .cropper-canvas-wrap {
        max-height: calc(90vh - 220px);
    }

    .cropper-toolbar {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        max-width: 100%;
        border-radius: 0 0 12px 12px;
        margin-top: 0;
        transform: none;
    }

    .cropper-modal.open .cropper-toolbar {
        transform: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .preview-window.big-mobile {
        padding: 10px;
    }

    .preview-viewport {
        aspect-ratio: unset;
        max-height: none;
    }

    .preview-actions.compact {
        flex-direction: column;
    }

    .xerox-preview-toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    /* Fullscreen cropper modal on mobile */
    .cropper-modal-content {
        width: 100vw;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
    }

    .cropper-body {
        padding: 8px;
        padding-bottom: 0;
        gap: 8px;
        max-height: none;
        flex: 1;
    }

    .cropper-canvas-wrap {
        /* Stabilized height to prevent collapse on mobile browser UI shifts */
        min-height: 300px;
        max-height: calc(100dvh - 220px);
        width: 100%;
        margin: 0 auto;
    }

    .cropper-preview-wrap {
        max-height: 100px;
        padding: 6px;
    }

    .cropper-preview-box {
        aspect-ratio: 3 / 4;
        max-height: 80px;
    }

    .cropper-preview-label {
        font-size: 11px;
    }

    /* Relative toolbar for mobile to match desktop flow */
    .cropper-toolbar {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        max-width: 100vw;
        border-radius: 0;
        padding: 10px 4px;
        gap: 4px;
        transform: none !important;
    }

    .cropper-toolbar-btn {
        min-width: 50px;
        padding: 8px 6px;
        font-size: 11px;
    }

    .cropper-btn-icon {
        font-size: 18px;
    }

    .cropper-btn-label {
        font-size: 10px;
    }

    .cropper-btn-continue {
        min-width: 100px !important;
        /* Slightly smaller for mobile */
        padding: 8px 16px !important;
        font-size: 12px !important;
    }

    /* Mobile-only Rotation Preview Reflow Fixes */
    .scan-preview-container,
    .crop-preview-container,
    .cropper-canvas-wrap,
    .crop-container {
        width: 100% !important;
        min-height: 300px;
        max-height: 60dvh !important;
        height: auto;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        background: #000;
        /* Safe Repaint Trigger (UI-Only) */
        will-change: transform;
        contain: layout paint;
    }

    .scan-preview-container img,
    .scan-preview-container canvas,
    .crop-preview-container img,
    .crop-preview-container canvas,
    .cropper-canvas-wrap img,
    .cropper-canvas-wrap canvas,
    #cropperPreview {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        transform-origin: center center;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    /* Safety: DO NOT force height:auto on lib-managed canvas as it breaks calculations */
    .cropper-container,
    .cropper-wrap-box,
    .cropper-canvas {
        max-width: 100vw !important;
        max-height: 70dvh !important;
    }

    .cropper-btn-retake {
        min-width: 80px !important;
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}

/* Preview state management styles */
.preview-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.preview-in-progress {
    opacity: 0.8;
    position: relative;
}

.preview-failed {
    opacity: 0.7;
    border-color: #e53e3e;
}

.preview-in-progress .preview-spinner {
    display: inline-block;
}

/* Orientation Select UI - Native with Suffix Icon */
.orientation-select-container {
    position: relative;
    width: 100%;
}

.orientation-select-container select {
    padding-right: 45px !important;
    /* Ensure space for the suffix icon */
}

.orientation-suffix-icon {
    position: absolute;
    right: 30px;
    /* Positioned to the left of the native dropdown arrow */
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.orientation-suffix-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Scanned Pages Review Screen UI */
.scanned-review-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f8fafc;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
    /* Space for FAB */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.scanned-review-header {
    background: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.scanned-review-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.scanned-review-count {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 999px;
}

.scanned-review-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scanned-item-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.scanned-item-card:hover {
    background-color: #f8fafc;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.scanned-item-card:active {
    transform: translateY(0) scale(0.98);
}

.scanned-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.scanned-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanned-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scanned-item-serial {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.scanned-item-time,
.scanned-item-size {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.scanned-item-menu {
    padding: 8px;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.scanned-item-menu:hover {
    color: #ef4444;
    background: #fef2f2;
}

.scanned-item-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Floating Action Bar */
.review-floating-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #008be5;
    /* Blue theme */
    border-radius: 999px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 0;
    box-shadow: 0 10px 25px -5px rgba(0, 139, 229, 0.5);
    z-index: 10000;
}

.review-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.review-fab-btn:active {
    transform: scale(0.9);
}

.review-fab-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}

.review-fab-camera svg,
.review-fab-done svg {
    stroke: white;
}

@media (max-width: 480px) {
    .scanned-item-thumb {
        width: 70px;
        height: 70px;
    }

    .scanned-review-header h3 {
        font-size: 16px;
    }
}

/* UI Refinement: Xerox Customization Page */
#xeroxUploadBtn {
    display: none !important;
}

#xeroxPreviewBtn {
    background: #2B6CB0 !important;
    color: #FFFFFF !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(43, 108, 176, 0.2) !important;
}

#xeroxPreviewBtn:hover {
    background: #255a94 !important;
}

#xeroxPreviewBtn:active {
    background: #1f4d80 !important;
}