/* =============================================================================
   COOKER.CSS - Страница варщика (светлая тема)
   Стиль консистентен с остальным приложением (base.css)
   ============================================================================= */

/* =============================================================================
   Page shell
   ============================================================================= */

.cooker-page {
    padding: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f7fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a202c;
}

.cooker-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

/* Empty state */
.cooker-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 1.1rem;
    font-weight: 600;
}

.cooker-empty::before {
    content: '\2699';
    display: block;
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* =============================================================================
   Orders list
   ============================================================================= */

.cooker-orders-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cooker-order-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.cooker-order-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.cooker-order-card:active {
    background: #f1f5f9;
    transform: scale(0.99);
}

.cooker-order-product {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.cooker-order-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    gap: 12px;
}

.cooker-order-progress .badge {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

/* =============================================================================
   Order detail - header
   ============================================================================= */

.cooker-order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.cooker-back-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.cooker-back-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.cooker-back-btn:active {
    background: #e2e8f0;
}

.cooker-order-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cooker-order-info strong {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cooker-order-info span {
    font-size: 0.78rem;
    color: #64748b;
}

/* =============================================================================
   Session controls (start/finish/resume)
   ============================================================================= */

.cooker-session-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.cooker-session-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cooker-session-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.cooker-session-status.active {
    color: #d97706;
}

.cooker-session-status.completed {
    color: #16a34a;
}

.cooker-session-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.cooker-session-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.cooker-start-btn {
    background: #16a34a;
    color: white;
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    font-size: 1rem;
}

.cooker-start-btn:hover {
    background: #15803d;
}

.cooker-start-btn:active {
    background: #166534;
    transform: scale(0.98);
}

.cooker-finish-btn {
    background: #dc2626;
    color: white;
}

.cooker-finish-btn:hover {
    background: #b91c1c;
}

.cooker-finish-btn:active {
    background: #991b1b;
    transform: scale(0.98);
}

.cooker-resume-btn {
    background: #3b82f6;
    color: white;
}

.cooker-resume-btn:hover {
    background: #2563eb;
}

.cooker-resume-btn:active {
    background: #1d4ed8;
    transform: scale(0.98);
}

/* =============================================================================
   Scan section
   ============================================================================= */

.cooker-scan-section {
    display: flex;
    gap: 10px;
    margin: 12px 0;
}

.cooker-barcode-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 1.05rem;
    font-weight: 500;
    background: white;
    color: #1e293b;
    border: 2px solid #667eea;
    border-radius: 8px;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.cooker-barcode-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.cooker-barcode-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.cooker-water-btn {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
}

.cooker-water-btn:hover {
    background: #2563eb;
}

.cooker-water-btn:active {
    background: #1d4ed8;
    transform: scale(0.97);
}

/* =============================================================================
   Materials checklist
   ============================================================================= */

.cooker-materials-section {
    margin-bottom: 16px;
}

.cooker-section-title {
    font-weight: 600;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-left: 2px;
}

.cooker-material {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #e2e8f0;
    min-height: 48px;
    transition: background 0.15s;
}

.cooker-material.added {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.cooker-material.added .cooker-material-name {
    color: #16a34a;
}

.cooker-material.partial {
    background: #fffbeb;
    border-color: #fde68a;
}

.cooker-material.partial .cooker-material-name {
    color: #d97706;
}

.cooker-material.over {
    background: #fef2f2;
    border-color: #fca5a5;
}

.cooker-material.over .cooker-material-name {
    color: #dc2626;
}

.cooker-material-check {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
    line-height: 1;
}

.cooker-material-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.3;
}

.cooker-material-qty {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
    line-height: 1.3;
}

.cooker-material-qty .added-amount {
    display: block;
    font-weight: 600;
    color: #16a34a;
}

.cooker-material-qty .planned-amount {
    display: block;
    color: #94a3b8;
    font-size: 0.72rem;
}

/* =============================================================================
   History
   ============================================================================= */

.cooker-history-section {
    margin-bottom: 20px;
}

.cooker-history-section .text-muted {
    color: #94a3b8 !important;
    font-size: 0.85rem;
    padding: 8px 2px;
}

.cooker-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #e2e8f0;
    min-height: 48px;
}

.cooker-history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cooker-history-batch {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

.cooker-history-info strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cooker-history-info span {
    font-size: 0.75rem;
    color: #64748b;
}

.cooker-delete-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #ef4444;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.cooker-delete-btn:hover {
    background: #fee2e2;
}

.cooker-delete-btn:active {
    background: #fecaca;
    transform: scale(0.95);
}

/* =============================================================================
   Amount modal
   ============================================================================= */

#cookerAmountModal .modal-content {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

#cookerAmountModal .modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 18px;
}

#cookerAmountModal .modal-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1e293b;
}

#cookerAmountModal .modal-body {
    padding: 20px 18px;
}

#cookerAmountModal .modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 12px 18px;
}

#cookerAmountModal .btn-group .cooker-unit-btn {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 24px;
}

#cookerAmountModal #cookerAmountInput {
    font-size: 1.8rem !important;
    font-weight: 600;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

#cookerAmountModal #cookerAmountInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

#cookerAmountModal #cookerAmountInput.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

#cookerAmountModal .btn-primary {
    background: #16a34a;
    border-color: #16a34a;
    font-weight: 600;
    padding: 8px 24px;
}

#cookerAmountModal .btn-primary:hover {
    background: #15803d;
    border-color: #15803d;
}

#cookerAmountModal .btn-primary:active {
    background: #166534;
    transform: scale(0.98);
}

/* =============================================================================
   Utility - hide number input spinners
   ============================================================================= */

.cooker-page input[type="number"]::-webkit-inner-spin-button,
.cooker-page input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cooker-page input[type="number"] {
    -moz-appearance: textfield;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 480px) {
    .cooker-content {
        padding: 8px;
    }

    .cooker-order-card {
        padding: 12px 10px;
    }

    .cooker-barcode-input {
        padding: 12px;
        font-size: 0.95rem;
    }

    .cooker-water-btn {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .cooker-scan-section {
        flex-direction: column;
    }

    .cooker-water-btn {
        text-align: center;
    }
}
