/* ============================================
   CONTAINER TALLY MOBILE STYLES
   Tablet/iPad Optimized Interface
   ============================================ */

/* Full-screen mobile layout */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container-tally-mobile-wrapper {
    min-height: 100vh;
    background: #f5f5f5;
}

/* Hide main navigation for mobile experience */
@media (max-width: 768px) {
    #MainNavigation,
    .page-header {
        display: none;
    }
    
    .page-content {
        padding: 0;
        margin: 0;
    }
}

/* Mobile Grid Container */
.container-tally-mobile-grid {
    background: #f5f5f5;
    padding: 0;
    margin: 0;
}

.container-tally-mobile-grid .grid-container,
.container-tally-mobile-grid .s-DataGrid {
    height: auto !important;
    max-height: none !important;
    overflow: visible;
}

/* Hide default Serenity toolbar */
.container-tally-mobile-grid .s-Toolbar {
    display: none !important;
}

/* ============================================
   MOBILE TOOLBAR
   ============================================ */
.mobile-toolbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.search-input {
    flex: 1;
}

.search-bar.search-matched .search-input {
    background: #dcfce7;
    border-color: #22c55e;
    color: #14532d;
}

.search-bar.search-matched .search-input::placeholder {
    color: #166534;
}

.search-clear-btn,
.search-camera-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.barcode-scan-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.barcode-scan-dialog {
    background: #0f172a;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.barcode-scan-preview {
    position: relative;
}

.barcode-scan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.barcode-scan-video {
    width: 100%;
    border-radius: 8px;
    background: #111827;
}

.barcode-scan-focus {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 30%;
    transform: translate(-50%, -50%);
    border: 2px solid #38bdf8;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.35);
    pointer-events: none;
}

.barcode-scan-close {
    align-self: flex-end;
    background: #1f2937;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.barcode-scan-toggle {
    background: #0ea5e9;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.barcode-scan-auto,
.barcode-scan-flash {
    background: #1f2937;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

.barcode-scan-auto.active,
.barcode-scan-flash.active {
    background: #22c55e;
    color: #0f172a;
}

.barcode-scan-hint {
    color: #e2e8f0;
    font-size: 13px;
    text-align: center;
}

.barcode-scan-hint.is-error {
    color: #fca5a5;
}

.barcode-scan-capture {
    background: #22c55e;
    border: none;
    color: #0f172a;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

/* On mobile devices, offset below any mobile browser chrome */
@media (max-width: 768px) {
    .mobile-toolbar {
        top: 60px;
    }

    .container-tally-mobile-grid.prod-mode .mobile-toolbar {
        min-height: calc(100vh - 60px);
        display: flex;
        flex-direction: column;
    }

    .container-tally-mobile-grid.prod-mode .action-buttons-row {
        margin-top: auto;
    }
}

/* ============================================
   DASHBOARD SECTION
   ============================================ */
.dashboard-container {
    margin-bottom: 8px;
}

.progress-section {
    margin-bottom: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.vessel-info {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #0ea5e9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-percentage {
    font-size: 18px;
    font-weight: 700;
    color: #0ea5e9;
    white-space: nowrap;
}

.progress-bar-container {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9 0%, #0284c7 100%);
    transition: width 0.3s ease;
}

/* Stats Grid - Single Horizontal Row */
.stats-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
    scrollbar-width: thin;
    gap: 8px;
}

.stats-grid::-webkit-scrollbar {
    height: 4px;
}

.stats-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
}

.stats-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.stats-grid::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 10px;
    color: #666;
    border-left: 4px solid;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    min-width: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.stat-item b {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.stat-item.verified { 
    border-color: #4caf50;
}

.stat-item.pending { 
    border-color: #ff9800;
}

.stat-item.missing { 
    border-color: #f44336;
}

.stat-item.additional { 
    border-color: #2196f3;
}

.stat-item.empty { 
    border-color: #9e9e9e;
}

.stat-item.damaged { 
    border-color: #e91e63;
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    flex-shrink: 0;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px; /* Touch-friendly */
}

.filter-chip:hover {
    background: #e0e0e0;
}

.filter-chip.active {
    background: #0ea5e9;
    color: #fff;
    border-color: #0ea5e9;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
    position: relative;
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 14px 40px 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    outline: none;
    transition: border-color 0.2s ease;
    min-height: 48px; /* Touch-friendly */
}

.search-input:focus {
    border-color: #0ea5e9;
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
}

/* ============================================
   PROD ENTRY
   ============================================ */
.prod-entry-seal.seal-mismatch {
    background: #fef3c7;
    border-color: #ef4444;
    color: #7c2d12;
}

/* ============================================
   MODE TOGGLE
   ============================================ */
.tally-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tally-mode-toggle button {
    padding: 8px 14px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
}

.tally-mode-toggle button.active {
    background: #0ea5e9;
    color: #fff;
    border-color: #0ea5e9;
}

.tally-mode-toggle button:hover:not(.active) {
    background: #e0e0e0;
}

.show-all-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.show-all-toggle input {
    width: 18px;
    height: 18px;
}

/* Search bar camera button */
.search-camera-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
}

/* ============================================
   SEAL VERIFY DIALOG
   ============================================ */
.seal-verify-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.seal-verify-dialog {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.seal-verify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #0ea5e9;
    color: #fff;
    font-weight: 600;
}

.seal-verify-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
}

.seal-verify-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.seal-verify-info {
    font-weight: 600;
    color: #333;
}

.seal-verify-expected {
    font-size: 13px;
    color: #555;
}

.seal-verify-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.seal-verify-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 14px;
}

.seal-verify-error {
    font-size: 13px;
    color: #b91c1c;
    font-weight: 600;
}

.seal-verify-actions {
    padding: 12px 16px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.seal-verify-actions .btn {
    flex: 1;
    min-width: 120px;
    border-radius: 8px;
    border: none;
    padding: 10px 12px;
    font-weight: 600;
    cursor: pointer;
}

.seal-verify-actions .btn-primary {
    background: #0ea5e9;
    color: #fff;
}

.seal-verify-actions .btn-warning {
    background: #f59e0b;
    color: #fff;
}

.seal-verify-actions .btn-default {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.seal-verify-mismatch .seal-verify-input {
    border-color: #ef4444;
    background: #fef2f2;
}

.seal-verify-shake {
    animation: seal-verify-shake 0.35s;
}

@keyframes seal-verify-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* ============================================
   PROD DETAILS
   ============================================ */
.prod-details {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prod-detail-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #e5e7eb;
}

.prod-detail-title {
    font-size: 13px;
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prod-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.prod-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.prod-detail-item b {
    font-size: 13px;
    color: #333;
    font-weight: 600;
    word-break: break-word;
}

.prod-detail-item.full {
    grid-column: 1 / -1;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-buttons-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons-row button {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px; /* Touch-friendly */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-quick-add {
    background: #0ea5e9;
    color: #fff;
}

.btn-quick-add:hover {
    background: #0284c7;
}

.btn-bulk-select {
    background: #2196f3;
    color: #fff;
}

.btn-bulk-select:hover {
    background: #1976d2;
}

.btn-refresh {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-refresh:hover {
    background: #e0e0e0;
}

.btn-save-next {
    background: #7c3aed;
    color: #fff;
}

.btn-save-next:hover {
    background: #6d28d9;
}

.btn-complete-tally {
    background: #4caf50;
    color: #fff;
}

.btn-complete-tally:hover {
    background: #388e3c;
}

/* ============================================
   BULK ACTION BAR
   ============================================ */
.bulk-action-bar {
    background: #0ea5e9;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-count {
    font-weight: 600;
    font-size: 16px;
}

.btn-bulk-verify,
.btn-bulk-cancel {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-bulk-verify {
    background: #4caf50;
    color: #fff;
}

.btn-bulk-cancel {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ============================================
   CONTAINER CARDS
   ============================================ */
.container-cards {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.container-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 6px solid;
    transition: all 0.2s ease;
    min-height: 64px;
}

.container-card:active {
    transform: scale(0.98);
}

.container-card.pending {
    border-color: #ff9800;
}

.container-card.verified {
    border-color: #4caf50;
}

.container-card.missing {
    border-color: #f44336;
}

.container-card.additional {
    border-color: #2196f3;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.container-number {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.container-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.size-type {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-verified {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-pending {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.status-missing {
    background: #ffebee;
    color: #c62828;
}

.status-badge.status-additional {
    background: #e3f2fd;
    color: #1565c0;
}

/* Card Body */
.card-body {
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.info-row .label {
    color: #666;
    font-weight: 500;
}

.info-row .value {
    color: #333;
    font-weight: 600;
}

.info-row .value.flag-empty {
    color: #9e9e9e;
}

.info-row .value.flag-damaged {
    color: #ff5722;
}

.info-row .value.flag-transshipped {
    color: #ff9800;
}

.info-row .value.flag-shifted {
    color: #2196f3;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-quick-verify,
.btn-detail {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px; /* Touch-friendly */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-quick-verify {
    background: #4caf50;
    color: #fff;
}

.btn-quick-verify:hover:not(:disabled) {
    background: #388e3c;
}

.btn-quick-verify.verified {
    background: #e8f5e9;
    color: #2e7d32;
    cursor: not-allowed;
}

.btn-detail {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-detail:hover {
    background: #e0e0e0;
}

/* Selection Mode */
.selection-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.container-checkbox {
    width: 32px;
    height: 32px;
    cursor: pointer;
}

/* No Containers State */
.no-containers {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-containers i {
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-containers p {
    font-size: 16px;
    margin: 0;
}

/* ============================================
   MOBILE DIALOG STYLES
   ============================================ */
.container-tally-mobile-dialog {
    /* Full-screen on mobile */
}

.mobile-tabs-container {
    margin: 0;
    padding: 0;
}

.mobile-tabs-header {
    background: #0ea5e9;
    color: #fff;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-tab-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tab-nav-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease;
}

.tab-nav-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.3);
}

.tab-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tab-indicator {
    flex: 1;
    text-align: center;
    padding: 0 12px;
}

.current-tab-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tab-position {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}

.tab-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* Tab Content */
.mobile-tabs-content {
    position: relative;
    overflow: hidden;
}

.mobile-tab-pane {
    display: none;
    padding: 20px;
    animation: slideIn 0.3s ease;
}

.mobile-tab-pane.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Quick Actions in Dialog */
.mobile-quick-actions {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.quick-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.quick-action-row:last-child {
    margin-bottom: 0;
}

.quick-action-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    min-width: 100px;
}

.quick-status-select {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    min-height: 44px;
}

.toggle-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
}

.toggle-label input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

.quick-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-mark-missing,
.btn-mark-damaged {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
}

.btn-mark-missing {
    background: #ff9800;
    color: #fff;
}

.btn-mark-damaged {
    background: #ff5722;
    color: #fff;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .mobile-toolbar {
        padding: 12px;
    }
    
    .container-cards {
        padding: 12px;
    }
    
    .container-card {
        padding: 12px;
    }
    
    .container-number {
        font-size: 16px;
    }
    
    .action-buttons-row button {
        font-size: 13px;
        padding: 10px;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .container-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop view (fallback) */
@media (min-width: 1025px) {
    .container-cards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

.container-tally-mobile-grid.prod-mode .container-cards {
    grid-template-columns: 1fr;
}

.container-tally-mobile-grid .btn-save-next {
    display: none;
}

.container-tally-mobile-grid.prod-mode .btn-bulk-select {
    display: none;
}

.container-tally-mobile-grid.prod-mode .btn-save-next {
    display: flex;
}

.prod-entry-panel {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.container-tally-mobile-grid.prod-mode .prod-entry-panel {
    display: block;
}

.prod-entry-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.prod-entry-seal-row {
    align-items: center;
}

.prod-entry-field {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prod-entry-temp-field {
    display: none;
}

.prod-entry-temp-field.show {
    display: flex;
}

.prod-entry-field.full {
    flex: 1 1 100%;
}

.prod-entry-field label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.prod-entry-input {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    min-height: 40px;
}

.prod-entry-camera-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.prod-entry-error {
    color: #b91c1c;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
}

.btn-flag-container {
    width: 100%;
}

.prod-entry-input.seal-mismatch {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.3);
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner-icon {
    font-size: 48px;
    color: #0ea5e9;
    animation: spin 1s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 16px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

.text-success {
    color: #4caf50;
}

.text-warning {
    color: #ff9800;
}

.text-danger {
    color: #f44336;
}

.text-muted {
    color: #999;
}

.quick-verify-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #4caf50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.quick-verify-btn:hover {
    background: #43a047;
    transform: scale(1.1);
}

.quick-verify-btn:active {
    transform: scale(0.95);
}

.card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.card-detail-item {
    font-size: 13px;
}

.detail-label {
    color: #999;
    margin-right: 4px;
}

.detail-value {
    color: #333;
    font-weight: 500;
}

.card-flags {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.flag-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.flag-badge.empty {
    background: #f5f5f5;
    color: #757575;
}

.flag-badge.damaged {
    background: #fce4ec;
    color: #c2185b;
}

.flag-badge.transshipped {
    background: #e1f5fe;
    color: #0277bd;
}

.filter-section {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.filter-button {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-button:hover {
    background: #f5f5f5;
}

.filter-button.active {
    background: #0ea5e9;
    color: #fff;
    border-color: #0ea5e9;
}

.filter-button .badge {
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.1);
    font-size: 11px;
    font-weight: 600;
}

.filter-button.active .badge {
    background: rgba(255,255,255,0.2);
}

.search-section {
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
}

.search-input:focus {
    outline: none;
    border-color: #0ea5e9;
    background: #fff;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.containers-viewport {
    padding: 16px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* ============================================
   CUSTOM CONTAINER DIALOG - MOBILE OPTIMIZED
   ============================================ */

.custom-dialog-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 99999 !important;
    display: none !important;
    backdrop-filter: blur(4px);
}

.custom-dialog-overlay.show {
    display: block !important;
}

.custom-dialog-container {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 600px !important;
    background: #fff !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3) !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s ease-out !important;
    z-index: 100000 !important;
}

.custom-dialog-container.show {
    transform: translateX(0) !important;
}

/* Header */
.custom-dialog-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.custom-dialog-header .btn-back,
.custom-dialog-header .btn-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.custom-dialog-header .btn-back:hover,
.custom-dialog-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.custom-dialog-header .dialog-title {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Body */
.custom-dialog-body {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
    -webkit-overflow-scrolling: touch;
}

.dialog-scroll-content {
    padding: 16px;
}

/* Form Sections */
.form-section {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #0ea5e9;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.form-group .form-control {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group .form-control:focus {
    outline: none;
    border-color: #0ea5e9;
}

.form-group textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-group select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Form Rows */
.form-row {
    display: flex;
    gap: 12px;
    margin: 0 -6px;
}

.form-row .form-group {
    flex: 1;
    margin: 0 6px 16px 6px;
}

.form-row .form-group.half {
    flex: 0 0 calc(50% - 12px);
}

.form-row .form-group.third {
    flex: 0 0 calc(33.333% - 12px);
}

/* Footer */
.custom-dialog-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.custom-dialog-footer .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.custom-dialog-footer .btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #e0e0e0;
    flex: 0 0 auto;
    min-width: 100px;
}

.custom-dialog-footer .btn-cancel:hover {
    background: #e0e0e0;
}

.custom-dialog-footer .btn-save {
    background: #4caf50;
    color: #fff;
}

.custom-dialog-footer .btn-save:hover {
    background: #388e3c;
}

.custom-dialog-footer .btn-save-continue {
    background: #0ea5e9;
    color: #fff;
}

.custom-dialog-footer .btn-save-continue:hover {
    background: #0284c7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .custom-dialog-container {
        max-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group.half,
    .form-row .form-group.third {
        flex: 1;
        margin: 0 6px 16px 6px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .custom-dialog-container {
        max-width: 500px;
    }
}

/* Loading State */
.custom-dialog-body.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-dialog-body.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.form-control.error {
    border-color: #f44336 !important;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Validation Messages */
.form-group .validation-message {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #f44336;
}

/* Touch Optimization */
@media (hover: none) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
