/* Contact Sheet Creator Styles v1.0 - Hosted on CloudFlare */
*{box-sizing:border-box}body{margin:0;padding:0}#password-screen,#contact-sheet-app{max-width:1400px;margin:20px auto 40px auto;padding:20px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif}#password-screen{max-width:400px;margin:100px auto;padding:40px;border:1px solid #ddd;border-radius:8px;text-align:center}#password-screen input{width:100%;padding:10px;margin:10px 0;border:1px solid #ddd;border-radius:4px}#password-screen button{width:100%;padding:10px;background:#1e40af;color:white;border:none;border-radius:4px;cursor:pointer}.app-header{color:#111827;padding:5px 20px;margin-bottom:10px}.app-header h1{margin:0;font-size:20px}.hidden{display:none}.tab-navigation{display:flex;gap:0;justify-content:space-between;align-items:center;border-bottom:2px solid #e5e7eb;margin-bottom:20px}.tab-buttons-left{display:flex;gap:0}.reprocess-controls{display:flex;align-items:center;gap:10px;padding-right:20px;padding-bottom:5px}.reprocess-controls label{font-size:14px;font-weight:500;color:#374151}.reprocess-controls input{width:100px;padding:6px 10px;border:1px solid #d1d5db;border-radius:4px;font-size:14px}.reprocess-controls input:focus{outline:none;border-color:#1e40af;box-shadow:0 0 0 3px rgba(30,64,175,0.1)}.reprocess-btn{padding:6px 16px;background:#1e40af;color:white;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:background 0.2s;white-space:nowrap}.reprocess-btn:hover{background:#1e3a8a}.reprocess-btn:disabled{background:#9ca3af;cursor:not-allowed}.tab-button{padding:12px 24px;background:transparent;border:none;border-bottom:3px solid transparent;cursor:pointer;font-size:15px;font-weight:500;color:#6b7280;transition:all 0.2s}.tab-button:hover{color:#1e40af;background:#f9fafb}.tab-button.active{color:#1e40af;border-bottom-color:#1e40af;background:#eff6ff}.tab-content{display:none}.tab-content.active{display:block}.edit-tab-navigation{display:flex;gap:0;border-bottom:2px solid #e5e7eb;margin-bottom:15px}.edit-tab-button{padding:10px 20px;background:transparent;border:none;border-bottom:3px solid transparent;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280;transition:all 0.2s;flex:1}.edit-tab-button:hover{color:#1e40af;background:#f9fafb}.edit-tab-button.active{color:#1e40af;border-bottom-color:#1e40af;background:#eff6ff}.edit-tab-content{display:none}.edit-tab-content.active{display:block}.ai-option-btn{padding:8px 14px;background:#f3f4f6;border:1px solid #d1d5db;border-radius:6px;font-size:13px;font-weight:500;color:#374151;cursor:pointer;transition:all 0.2s}.ai-option-btn:hover{background:#e5e7eb;border-color:#9ca3af}.ai-option-btn.active{background:#1e40af;border-color:#1e40af;color:white}.search-container{background:white;border:1px solid #e5e7eb;border-radius:8px;padding:20px;margin-bottom:20px}.search-container h3{margin:0 0 15px 0;font-size:16px;color:#111827}.search-form{display:grid;grid-template-columns:1fr 1fr 1fr;gap:15px;margin-bottom:15px}.search-field{display:flex;flex-direction:column;gap:5px}.search-field label{font-size:13px;font-weight:500;color:#374151}.search-field input{padding:8px 12px;border:1px solid #d1d5db;border-radius:4px;font-size:14px}.search-field input:focus{outline:none;border-color:#1e40af;box-shadow:0 0 0 3px rgba(30,64,175,0.1)}.search-actions{display:flex;gap:10px;justify-content:flex-start}.search-btn{padding:10px 24px;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer}.search-btn-primary{background:#1e40af;color:white}.search-btn-primary:hover{background:#1e3a8a}.search-btn-secondary{background:#e5e7eb;color:#374151}.search-btn-secondary:hover{background:#d1d5db}.order-list{margin-top:20px;border:1px solid #ddd;border-radius:4px;overflow:hidden}.order-list-header{display:grid;grid-template-columns:50px 150px 1fr auto 120px 130px;gap:15px;padding:6px 15px;background:#f3f4f6;border-bottom:2px solid #ddd;font-weight:600;font-size:14px;color:#374151;align-items:center}.sortable-header{cursor:pointer;user-select:none;display:flex;align-items:center;gap:5px}.sortable-header:hover{color:#1e40af}.sort-icon{font-size:10px;opacity:0.5}.sort-icon.active{opacity:1;color:#1e40af}.order-item{display:grid;grid-template-columns:50px 150px 1fr auto 120px 130px;gap:15px;padding:3px 15px;border-bottom:1px solid #e5e7eb;align-items:center}.order-item:last-child{border-bottom:none}.order-item:hover{background:#f9fafb}.order-item[style*="cursor: pointer"]:hover{background:#eff6ff}.order-checkbox,.fulfilled-order-checkbox{width:28px;height:28px;min-width:28px;min-height:28px;cursor:pointer;justify-self:center;margin:4px}.order-number{font-weight:bold;color:#1e40af}.order-customer{color:#374151}.order-meta{font-size:14px;color:#6b7280}.order-date{font-size:14px;color:#6b7280}.controls-bar{display:flex;align-items:center;gap:15px;margin-bottom:20px;padding:15px;background:#f9fafb;border:1px solid #e5e7eb;border-radius:4px}.controls-bar label{display:flex;align-items:center;gap:8px;font-weight:500;cursor:pointer}.controls-bar input[type="checkbox"]{width:28px;height:28px;cursor:pointer}.load-button{padding:12px 24px;background:#1d9add;color:white;border:none;border-radius:4px;cursor:pointer;font-size:16px;margin-top:20px}.load-button:hover:not(:disabled){background:#1787c7}.load-button:disabled{background:#a0a0a0;color:white;cursor:not-allowed}.status-message{padding:12px;margin:10px 0;border-radius:4px}.status-success{background:#d1fae5;color:#065f46;border:1px solid #6ee7b7}.status-error{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}#editor-view{position:fixed;top:0;left:0;right:0;bottom:0;background:#f3f4f6;z-index:1000;overflow:auto}.editor-header{background:#1e40af;color:white;padding:10px 20px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:15px;box-shadow:0 2px 4px rgba(0,0,0,0.1)}.editor-header-left{justify-self:start}.editor-header-center{text-align:center}.editor-header-right{justify-self:end}.editor-title{font-size:16px;font-weight:600}.editor-progress{font-size:13px;opacity:0.9}.editor-subheader{background:#f3f4f6;padding:10px 20px;border-bottom:1px solid #e5e7eb;text-align:center;font-size:14px;color:#374151}.editor-actions{display:flex;gap:10px}.editor-btn{padding:8px 16px;border:none;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;white-space:nowrap}.btn-back{background:#e5e7eb;color:#374151}.btn-back:hover{background:#d1d5db}.btn-next{background:#10b981;color:white}.btn-next:hover{background:#059669}.btn-next:disabled{background:#9ca3af;cursor:not-allowed;opacity:0.6}.btn-skip{background:#e5e7eb;color:#374151}.btn-skip:hover{background:#d1d5db}.editor-content{max-width:1600px;margin:0 auto;padding:15px 30px 30px 30px}.loading-spinner{text-align:center;padding:60px}.spinner{border:4px solid #f3f3f3;border-top:4px solid #1e40af;border-radius:50%;width:50px;height:50px;animation:spin 1s linear infinite;margin:0 auto}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.loading-notification{position:fixed;bottom:20px;left:20px;background:#d1fae5;border:1px solid #6ee7b7;border-radius:6px;padding:12px 16px;box-shadow:0 4px 12px rgba(0,0,0,0.15);z-index:3000;display:flex;align-items:center;gap:12px;min-width:250px;max-width:400px}.loading-notification.hidden{display:none}.loading-notification-spinner{border:3px solid #a7f3d0;border-top:3px solid #065f46;border-radius:50%;width:20px;height:20px;animation:spin 1s linear infinite;flex-shrink:0}.loading-notification-text{color:#065f46;font-size:14px;font-weight:500}.contact-sheet-preview{background:white;padding:30px;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,0.1);margin-bottom:30px}.preview-header{margin-bottom:20px;padding-bottom:15px;border-bottom:2px solid #e5e7eb}.preview-title{font-size:20px;font-weight:600;color:#111827;margin:0 0 10px 0}.preview-subtitle{font-size:14px;color:#6b7280}.editor-layout{display:grid;grid-template-columns:1fr 350px;gap:20px;margin-top:10px}.editor-left{display:flex;flex-direction:column;gap:15px}.large-image-preview{background:#f9fafb;border:2px solid #e5e7eb;border-radius:8px;padding:15px;display:flex;gap:15px;min-height:500px;max-height:750px}.preview-column{flex:1;display:flex;flex-direction:column;gap:8px}.preview-label{font-size:13px;font-weight:600;color:#374151;text-align:center;position:relative}.copy-paste-buttons{position:absolute;right:0;top:0;display:flex;gap:6px}.copy-paste-buttons button{padding:4px 10px;font-size:12px;border:none;border-radius:3px;cursor:pointer;background:#e5e7eb;color:#374151;font-weight:500}.copy-paste-buttons button:hover{background:#d1d5db}.copy-paste-buttons button:disabled{opacity:0.5;cursor:not-allowed}.replace-original-btn{position:absolute;left:0;top:0;padding:4px 10px;font-size:12px;border:none;border-radius:3px;cursor:pointer;background:#e5e7eb;color:#374151;font-weight:500}.replace-original-btn:hover{background:#d1d5db}.revert-to-original-btn{position:absolute;left:0;top:0;padding:4px 10px;font-size:12px;border:none;border-radius:3px;cursor:pointer;background:#9ca3af;color:white;font-weight:500}.revert-to-original-btn:hover{background:#6b7280}.rotate-btn-editor{position:absolute;bottom:8px;right:8px;width:32px;height:32px;background-color:rgba(255,255,255,0.95);border:1px solid #ddd;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:10;transition:all 0.2s ease;box-shadow:0 2px 4px rgba(0,0,0,0.1)}.rotate-btn-editor:hover{background-color:#fff;border-color:#39f;box-shadow:0 2px 8px rgba(0,0,0,0.15)}.rotate-btn-editor:active{transform:scale(0.95)}.rotate-icon-editor{width:20px;height:20px;stroke:#333;transition:all 0.3s ease}.rotate-btn-editor:hover .rotate-icon-editor{stroke:#39f;transform:rotate(90deg)}.preview-image-container{background:white;border:1px solid #d1d5db;border-radius:4px;display:flex;align-items:center;justify-content:center;flex:1;overflow:hidden;aspect-ratio:1/1}.preview-image-container img{max-width:100%;max-height:100%;object-fit:contain}.image-carousel{display:flex;gap:10px;padding:10px;background:white;border:1px solid #e5e7eb;border-radius:8px;overflow-x:auto}.carousel-item{flex-shrink:0;width:70px;display:flex;flex-direction:column;gap:4px;cursor:pointer;transition:all 0.2s}.carousel-item-wrapper{width:70px;height:70px;border:3px solid transparent;border-radius:4px;overflow:hidden;position:relative}.carousel-item-wrapper.unsaved{border-color:#f97316}.carousel-item-wrapper.saved{border-color:#10b981}.carousel-item:hover .carousel-item-wrapper{box-shadow:0 0 0 2px rgba(147,197,253,0.5)}.carousel-item.selected .carousel-item-wrapper{border-color:#1e40af;box-shadow:0 0 0 2px rgba(30,64,175,0.2)}.carousel-item img{width:100%;height:100%;object-fit:cover}.carousel-item-number{position:absolute;top:2px;left:2px;background:rgba(0,0,0,0.7);color:white;font-size:10px;padding:2px 5px;border-radius:2px}.carousel-item-status{text-align:center;font-size:16px;line-height:1}.status-unsaved{color:#f97316}.status-saved{color:#10b981}.carousel-empty{background:#f3f4f6;display:flex;align-items:center;justify-content:center;color:#9ca3af;font-size:11px;cursor:default}.carousel-empty:hover{border-color:transparent}.editor-panel{background:white;border:1px solid #e5e7eb;border-radius:8px;padding:15px;display:flex;flex-direction:column;gap:6px;max-height:750px;overflow-y:auto}.editor-panel h3{margin:0 0 8px 0;font-size:15px;color:#1f2937;border-bottom:2px solid #1e40af;padding-bottom:6px}.editor-section{display:flex;flex-direction:column;gap:5px}.editor-control{display:flex;flex-direction:row;align-items:center;gap:10px;margin-bottom:5px}.editor-control label{font-size:13px;font-weight:500;color:#374151;min-width:80px;flex-shrink:0}.slider-wrapper{flex:1;display:flex;flex-direction:row;align-items:center;gap:10px}.slider-container{position:relative;flex:1}.slider-center-line{position:absolute;left:50%;top:50%;width:2px;height:12px;background:#991b1b;transform:translate(-50%,-50%);pointer-events:none;z-index:1}.editor-control input[type="range"]{width:100%;height:6px;border-radius:3px;background:#e5e7eb;outline:none;-webkit-appearance:none;position:relative;z-index:2}.editor-control input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:#1e40af;cursor:pointer}.editor-control input[type="range"]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:#1e40af;cursor:pointer;border:none}.slider-value{font-size:12px;color:#6b7280;min-width:30px;text-align:right;flex-shrink:0}.brightness-options{display:flex;flex-direction:row;gap:4px;flex-wrap:nowrap;align-items:center}.brightness-option{display:flex;align-items:center;gap:8px}.brightness-option input[type="radio"]{width:16px;height:16px;cursor:pointer}.brightness-option label{cursor:pointer;font-size:13px}.editor-button{width:100%;padding:10px;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer;transition:all 0.2s}.editor-button.primary{background:#10b981;color:white}.editor-button.primary:hover{background:#059669}.editor-button.primary:disabled{background:#9ca3af;cursor:not-allowed;opacity:0.6}.editor-button.blue{background:#3b82f6;color:white}.editor-button.blue:hover{background:#2563eb}.editor-button.secondary{background:#e5e7eb;color:#374151}.editor-button.secondary:hover{background:#d1d5db}.editor-button.gray{background:#9ca3af;color:white}.editor-button.gray:hover{background:#6b7280}.debug-info{background:#fef3c7;border:1px solid #fbbf24;padding:15px;border-radius:4px;margin-bottom:20px;font-family:monospace;font-size:13px}.debug-info h4{margin:0 0 10px 0;color:#92400e}.debug-info pre{margin:5px 0;white-space:pre-wrap;word-wrap:break-word}.status-box{background:#f3f4f6;border:1px solid #d1d5db;border-radius:4px;padding:10px;margin-bottom:15px;font-family:monospace;font-size:12px;max-height:120px;overflow-y:auto;color:#374151}.status-box.hidden{display:none}.status-line{padding:2px 0}.status-line.success{color:#059669}.status-line.error{color:#dc2626}.crop-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.95);z-index:2000;display:flex;align-items:center;justify-content:center;padding:0}.crop-modal-content{background:white;border-radius:0;width:100vw;height:100vh;max-width:100vw;max-height:100vh;display:flex;flex-direction:column}.crop-modal-header{padding:20px;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center}.crop-modal-header h3{margin:0;font-size:18px;color:#111827}.crop-modal-close{background:none;border:none;font-size:24px;color:#6b7280;cursor:pointer;padding:0;width:30px;height:30px}.crop-modal-close:hover{color:#111827}.crop-modal-body{padding:20px;overflow:auto;flex:1;display:flex;align-items:center;justify-content:center}.crop-container{max-width:100%;max-height:100%;background:#f3f4f6;width:100%;height:100%}.crop-container img{max-width:100%}.crop-modal-footer{padding:20px;border-top:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center;gap:10px}.crop-center-buttons{display:flex;gap:10px;justify-content:center;flex:1}.crop-btn-center{background:#3b82f6;color:white}.crop-btn-center:hover{background:#2563eb}.crop-footer-actions{display:flex;gap:10px}.crop-btn{padding:10px 20px;border:none;border-radius:4px;font-size:14px;font-weight:500;cursor:pointer}.crop-btn-cancel{background:#e5e7eb;color:#374151}.crop-btn-cancel:hover{background:#d1d5db}.crop-btn-apply{background:#1e40af;color:white}.crop-btn-apply:hover{background:#1e3a8a}#print-container{display:none}@media print{body *{visibility:hidden}html,body{width:100%;height:auto;margin:0;padding:0;overflow:hidden}#print-container,#print-container *{visibility:visible}#print-container{position:absolute;left:0;top:0;width:100%;height:auto;display:block !important;margin:0;padding:0;overflow:visible;page-break-after:avoid !important;break-after:avoid !important}.print-contact-sheet{page-break-inside:avoid;break-inside:avoid;width:100%;height:100vh;margin:0;padding:0;position:relative;display:flex !important;align-items:center;justify-content:center;box-sizing:border-box;overflow:hidden;page-break-after:auto;break-after:auto}.print-contact-sheet:not(:last-child){page-break-after:always !important;break-after:always !important}.print-contact-sheet:last-child{page-break-after:avoid !important;break-after:avoid !important}.print-contact-sheet img{display:block !important;width:100% !important;max-width:100% !important;height:auto !important;margin:0;padding:0;object-fit:contain;page-break-inside:avoid;break-inside:avoid}@page{size:letter portrait;margin:0}*{orphans:1;widows:1}}.print-loading-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.8);z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center;color:white}.print-loading-overlay h2{margin:0 0 20px 0;font-size:24px}.print-progress{background:#374151;border-radius:8px;padding:20px;min-width:400px;text-align:center}.print-progress-bar{background:#1f2937;height:30px;border-radius:4px;overflow:hidden;margin:15px 0}.print-progress-fill{background:#10b981;height:100%;transition:width 0.3s ease;display:flex;align-items:center;justify-content:center;color:white;font-weight:500}.print-status{margin-top:10px;font-size:14px;color:#d1d5db}.product-tabs-container{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.product-tabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;flex:1;overflow-x:auto;overflow-y:hidden;min-width:0}.product-tabs::-webkit-scrollbar{height:6px}.product-tabs::-webkit-scrollbar-track{background:#f1f1f1}.product-tabs::-webkit-scrollbar-thumb{background:#888;border-radius:3px}.product-tabs::-webkit-scrollbar-thumb:hover{background:#555}.product-nav-btn{padding:8px 12px;background:#f3f4f6;border:1px solid #d1d5db;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;color:#374151;transition:all 0.2s;flex-shrink:0;height:38px}.product-nav-btn:hover:not(:disabled){background:#e5e7eb;border-color:#9ca3af}.product-nav-btn:disabled{opacity:0.5;cursor:not-allowed}.product-tab{padding:8px 16px;background:transparent;border:none;border-bottom:3px solid transparent;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280;transition:all 0.2s;white-space:nowrap}.product-tab.product-tab-no-sheet{background:#fff7ed}.product-tab.product-tab-has-sheet{background:#f0fdf4}.product-tab:hover{color:#1e40af;background:#f9fafb}.product-tab.active{color:#1e40af;border-bottom-color:#1e40af;background:#eff6ff}.product-tab.active.product-tab-no-sheet{background:#ffedd5}.product-tab.active.product-tab-has-sheet{background:#dcfce7}.order-tabs-container{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center;gap:15px}.order-tabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;flex:1;overflow-x:auto;overflow-y:hidden;min-width:0}.order-tabs::-webkit-scrollbar{height:6px}.order-tabs::-webkit-scrollbar-track{background:#f1f1f1}.order-tabs::-webkit-scrollbar-thumb{background:#888;border-radius:3px}.order-tabs::-webkit-scrollbar-thumb:hover{background:#555}.tab-nav-buttons{display:flex;gap:10px;flex-shrink:0}.tab-nav-btn{padding:8px 16px;background:#f3f4f6;border:1px solid #d1d5db;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;color:#374151;transition:all 0.2s;display:flex;align-items:center;gap:6px}.tab-nav-btn:hover:not(:disabled){background:#e5e7eb;border-color:#9ca3af}.tab-nav-btn:disabled{opacity:0.5;cursor:not-allowed}.order-tab{padding:8px 16px;background:transparent;border:none;border-bottom:3px solid transparent;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280;transition:all 0.2s;white-space:nowrap}.order-tab:hover{color:#1e40af;background:#f9fafb}.order-tab.active{color:#1e40af;border-bottom-color:#1e40af;background:#eff6ff}.reprint-actions{display:flex;gap:10px}.reprint-action-btn{padding:10px 20px;background:#1d9add;color:white;border:none;border-radius:4px;cursor:pointer;font-size:14px;font-weight:500;transition:background 0.2s}.reprint-action-btn:hover:not(:disabled){background:#1787c7}.reprint-action-btn:disabled{background:#a0a0a0;cursor:not-allowed}.reprint-carousel{display:flex;gap:10px;padding:10px;background:white;border:1px solid #e5e7eb;border-radius:8px;overflow-x:auto;min-height:90px;margin-bottom:15px;align-items:center}.reprint-preview-item{width:70px;height:70px;border:2px solid #1e40af;border-radius:4px;overflow:hidden;flex-shrink:0;position:relative;cursor:pointer}.reprint-preview-item img{width:100%;height:100%;object-fit:cover}.reprint-preview-trash{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 0.3s ease}.reprint-preview-item:hover .reprint-preview-trash{opacity:1}.reprint-preview-trash svg{width:20px;height:20px;fill:white}.reprint-image-grid{background:white;border:1px solid #e5e7eb;border-radius:8px;padding:20px;display:grid;grid-template-columns:repeat(6,200px);gap:15px;max-height:600px;overflow-y:auto}.reprint-image-item{width:200px;height:200px;border:2px solid #e5e7eb;border-radius:4px;overflow:hidden;cursor:pointer;transition:all 0.2s;position:relative}.reprint-image-item:hover{border-color:#1e40af;box-shadow:0 2px 8px rgba(30,64,175,0.2)}.reprint-image-item:hover::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:1}.reprint-image-item:hover::after{content:'Click to Add a Reprint';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:white;font-size:14px;font-weight:600;text-align:center;z-index:2;white-space:nowrap}.reprint-image-item.selected{border-color:#1e40af;box-shadow:0 0 0 3px rgba(30,64,175,0.2)}.reprint-image-item img{width:100%;height:100%;object-fit:cover}
