/* =============================================================================
   OKK (Quality Control) - Mobile-first styles
   ============================================================================= */

.okk-content {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Order cards list */
.okk-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.okk-order-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.okk-order-card:active {
    transform: scale(0.98);
    background: #f8fafc;
}

.okk-order-number {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.okk-order-product {
    font-size: 14px;
    color: #475569;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.okk-order-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}

.okk-status-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.okk-status-badge.inspected {
    background: #dcfce7;
    color: #166534;
}

.okk-status-badge.not-inspected {
    background: #fef3c7;
    color: #92400e;
}

/* Inspection form */
.okk-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.okk-order-info {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.okk-order-info-title {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
}

.okk-order-info-batch {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

/* Form fields */
.okk-field {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
}

.okk-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.okk-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.okk-field-input {
    flex: 1;
    font-size: 18px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.okk-field-input:focus {
    border-color: #6366f1;
}

/* Toggle buttons for OK/Not OK */
.okk-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.okk-toggle input[type="radio"] {
    display: none;
}

.okk-toggle label {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #64748b;
    user-select: none;
    -webkit-user-select: none;
}

.okk-toggle input[type="radio"]:checked + label.okk-toggle-ok {
    background: #22c55e;
    color: #fff;
}

.okk-toggle input[type="radio"]:checked + label.okk-toggle-fail {
    background: #ef4444;
    color: #fff;
}

/* Checkbox-only fields (smell, color, stability) */
.okk-check-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    width: 100%;
}

.okk-check-toggle input[type="radio"] {
    display: none;
}

.okk-check-toggle label {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    color: #64748b;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
}

.okk-check-toggle input[type="radio"]:checked + label.okk-toggle-ok {
    background: #22c55e;
    color: #fff;
}

.okk-check-toggle input[type="radio"]:checked + label.okk-toggle-fail {
    background: #ef4444;
    color: #fff;
}

/* Comment field */
.okk-comment {
    font-size: 16px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    width: 100%;
    min-height: 60px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.okk-comment:focus {
    border-color: #6366f1;
}

/* Save button */
.okk-save-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.okk-save-btn:active {
    transform: scale(0.98);
}

.okk-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* History section */
.okk-history {
    margin-top: 1.5rem;
}

.okk-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.okk-history-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 13px;
}

.okk-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    color: #334155;
}

.okk-history-values {
    color: #64748b;
    line-height: 1.6;
}

.okk-history-values .ok {
    color: #16a34a;
}

.okk-history-values .fail {
    color: #dc2626;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .okk-content {
        padding: 0.75rem;
    }

    .okk-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .okk-toggle {
        width: 100%;
    }

    .okk-toggle label {
        flex: 1;
        text-align: center;
    }
}
