/* Modal de Estado de Parte */
#parte-estado-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#parte-estado-modal.show {
    opacity: 1;
}

#parte-estado-modal .modal-content {
    background-color: var(--mobile-surface);
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#parte-estado-modal.show .modal-content {
    transform: translateY(0);
}

#parte-estado-modal .mobile-modal-header {
    padding: 16px;
    background-color: var(--mobile-surface);
    border-bottom: 1px solid var(--mobile-border);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

#parte-estado-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 40px;
}

/* Sección de información de parte */
.parte-info-section {
    margin-bottom: 24px;
}

.parte-info-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--mobile-text-primary);
    margin-bottom: 12px;
}

.parte-details {
    background-color: var(--mobile-background);
    border-radius: 12px;
    padding: 16px;
}

.parte-details .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.parte-details .info-row:not(:last-child) {
    border-bottom: 1px solid var(--mobile-border);
}

.parte-details .label {
    font-size: 14px;
    color: var(--mobile-text-secondary);
}

.parte-details .info-row > span:last-child {
    font-size: 14px;
    font-weight: 500;
    color: var(--mobile-text-primary);
}

/* Estados badge */
.estado-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.estado-badge.estado-pendiente-corte {
    background-color: #FFF3CD;
    color: #856404;
}

.estado-badge.estado-cortada {
    background-color: #CCE5FF;
    color: #004085;
}

.estado-badge.estado-devuelta-material {
    background-color: #F8D7DA;
    color: #721C24;
}

.estado-badge.estado-entregada {
    background-color: #D4EDDA;
    color: #155724;
}

.estado-badge.estado-anulada {
    background-color: #E2E3E5;
    color: #383D41;
}

/* Sección de selección de estado */
.estado-selection-section {
    margin-bottom: 24px;
}

.estado-selection-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--mobile-text-primary);
    margin-bottom: 12px;
}

.estado-options {
    display: grid;
    gap: 12px;
}

.estado-option {
    cursor: pointer;
}

.estado-option input[type="radio"] {
    display: none;
}

.estado-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--mobile-background);
    border: 2px solid var(--mobile-border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.estado-option input[type="radio"]:checked + .estado-card {
    background-color: var(--mobile-primary);
    border-color: var(--mobile-primary);
    color: white;
}

.estado-card i {
    font-size: 24px;
    color: var(--mobile-text-secondary);
}

.estado-option input[type="radio"]:checked + .estado-card i {
    color: white;
}

.estado-card span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* Sección de observaciones */
.observaciones-section {
    margin-bottom: 24px;
}

.observaciones-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--mobile-text-primary);
    margin-bottom: 8px;
}

#estado-observaciones {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--mobile-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background-color: var(--mobile-background);
    color: var(--mobile-text-primary);
    resize: vertical;
}

#estado-observaciones:focus {
    outline: none;
    border-color: var(--mobile-primary);
}

/* Sección de validación */
.validacion-section {
    margin-bottom: 16px;
}

.warning-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: #FFF3CD;
    border: 1px solid #FFEAA7;
    border-radius: 8px;
    color: #856404;
}

.warning-message i {
    font-size: 20px;
}

.warning-message span {
    flex: 1;
    font-size: 14px;
}

/* Toast de éxito */
.success-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.success-toast i {
    font-size: 20px;
}

/* Animación de rotación */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 1s linear infinite;
}

/* Tema oscuro */
[data-theme="dark"] #parte-estado-modal {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .estado-badge.estado-pendiente-corte {
    background-color: #3B3000;
    color: #FFE082;
}

[data-theme="dark"] .estado-badge.estado-cortada {
    background-color: #0D47A1;
    color: #BBDEFB;
}

[data-theme="dark"] .estado-badge.estado-devuelta-material {
    background-color: #4A0E0E;
    color: #FFCDD2;
}

[data-theme="dark"] .estado-badge.estado-entregada {
    background-color: #1B5E20;
    color: #C8E6C9;
}

[data-theme="dark"] .estado-badge.estado-anulada {
    background-color: #424242;
    color: #E0E0E0;
}

[data-theme="dark"] .warning-message {
    background-color: #3B3000;
    border-color: #5A4600;
    color: #FFE082;
}