.add-collaborator-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.btn-add-collaborator {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-primary);
    color: white;
    border: none;
    border-radius: var(--ds-radius);
    padding: var(--ds-spacing-6) var(--ds-spacing-8);
    font-size: var(--ds-text-base);
    font-weight: var(--ds-font-medium);
    font-family: var(--ds-font-family);
    width: 100%;
    cursor: pointer;
    transition: var(--ds-transition-base);
    min-height: 44px;
    box-shadow: var(--ds-shadow-sm);
}

.btn-add-collaborator:hover {
    background: var(--ds-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-primary);
}

.btn-add-collaborator i {
    margin-right: var(--ds-spacing-4);
    color: white !important;
}
/* Hide redundant headers when universal header is active */
.view .page-header,
.view .form-header,
.view .back-button-container,
.view .inline-header {
    display: none !important;
}

/* Mobile Reports Styles */
.mobile-report-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--card-shadow);
    margin: 0; /* Remove margin to reduce spacing */
}

/* Reduce top spacing for all views when universal header is present */
.view {
    padding: 8px !important;
}

.view > h2:first-child,
.view > .page-title:first-child {
    display: none !important; /* Hide redundant page titles */
}

/* Specific report spacing reductions */
#reports .card {
    margin-bottom: 8px !important;
}

#reports .filter-toggle-btn {
    margin: 8px 0 !important;
}

#reports .filter-container {
    margin-bottom: 8px !important;
    padding: 12px !important;
}

/* Report items specific styling */
.report-item {
    margin-bottom: 8px !important;
    padding: 12px !important;
}

.report-summary-card {
    margin-bottom: 8px !important;
    padding: 12px !important;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 1.1em;
}

.form-group select,
.form-group input {
    height: 48px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: all 0.3s ease;
}

.form-group select:focus,
.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}

.form-group select:disabled,
.form-group input:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.time-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-input-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
    position: relative;
}

/* Add a small double-tap hint */
.time-input-group label::after {
    content: '••';
    position: absolute;
    right: 0;
    font-size: 0.7rem;
    opacity: 0.4;
    letter-spacing: -2px;
}

.time-input-group label i {
    color: var(--primary-color);
}

.time-input-group input[type="time"] {
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--input-text);
    cursor: pointer;
    position: relative;
}

.time-input-group input[type="time"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Visual hint for double-tap functionality */
.time-input-group input[type="time"]::placeholder {
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Tooltip hint on hover */
.time-input-group {
    position: relative;
}

.time-input-group::after {
    content: 'Doble clic para hora predeterminada';
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.time-input-group:hover::after {
    opacity: 0.7;
}

/* Hide tooltip on mobile */
@media (max-width: 768px) {
    .time-input-group::after {
        display: none;
    }
}

.time-buttons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 4px;
}

.time-btn {
    padding: 6px 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 32px;
}

.time-btn.subtract {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.time-btn.subtract:hover {
    background: rgba(239, 68, 68, 0.25);
}

.time-btn.subtract:active {
    background: rgba(239, 68, 68, 0.35);
    transform: scale(0.95);
}

.time-btn.add {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.time-btn.add:hover {
    background: rgba(34, 197, 94, 0.25);
}

.time-btn.add:active {
    background: rgba(34, 197, 94, 0.35);
    transform: scale(0.95);
}


#mobileReportActivitiesContainer {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
    border: 2px solid var(--border-color);
}

#mobileReportActivities {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Custom scrollbar for activities container */
#mobileReportActivities::-webkit-scrollbar {
    width: 6px;
}

#mobileReportActivities::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

#mobileReportActivities::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#mobileReportActivities::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.activity-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    font-size: 0.9rem;
    margin-bottom: 6px;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    user-select: none; /* Prevent text selection */
}

.activity-checkbox-label i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--icon-color);
    transition: color 0.2s ease;
}

.activity-checkbox-label:has(input:checked) {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    border-width: 2px;
    font-weight: 500;
    padding: 9px 11px; /* Ajuste para compensar el borde más grueso */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.activity-checkbox-label:has(input:checked) i {
    color: white;
}

.activity-checkbox-label:has(input:checked) span {
    color: white;
}

.activity-checkbox-label:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-light);
}

.activity-checkbox-label:hover i {
    color: var(--primary-light);
}

.activity-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.activities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.activities-count {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}

.activities-count #selectedActivitiesCount {
    font-weight: 700;
}


.max-cantidad-info {
    display: none;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
    font-style: italic;
}

/* Quantity input with icon */
.cantidad-input-wrapper {
    position: relative;
    width: 100%;
}

.cantidad-status-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    pointer-events: none;
    z-index: 1;
}

#mobileReportCantidad {
    padding-right: 36px; /* Space for the icon */
}

.submit-container {
    margin-top: 20px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.submit-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.submit-btn i {
    font-size: 1.2em;
}

/* Loader for submit button */
.submit-btn .loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.submitting .submit-btn .loader {
    display: inline-block;
}

.submitting .submit-btn span {
    display: none;
}

/* Break time slider */
.break-slider-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.break-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
}

.break-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.break-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.break-value {
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
}

.break-time-presets {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.break-preset-btn {
    padding: 4px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-size: 12px;
}

/* Process colors */
.process-prep { color: #0ea5e9; }
.process-corte { color: #f59e0b; }
.process-armado { color: #10b981; }
.process-soldadura { color: #ef4444; }
.process-acabado { color: #8b5cf6; }
.process-despacho { color: #ec4899; }
.process-reparacion { color: #6366f1; }
.process-calidad { color: #14b8a6; }
.process-montaje { color: #f97316; }

/* Section titles */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(37, 99, 235, 0.2);
    color: var(--primary-color);
}

/* Tips section */
.tips-section {
    background-color: var(--icon-bg);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.tips-section h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-section ul {
    padding-left: 25px;
}

.tips-section li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* View header styling to ensure it's above other elements */
.view-header {
    position: relative;
    z-index: 1001;
}

/* Back button styling */
.view-header .back-button {
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.1em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1002; /* Ensure button is above header */
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* Optimize touch handling */
}

.view-header .back-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.view-header .back-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Report Mode Toggle */
.report-mode-toggle {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

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

.toggle-option {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.toggle-option i {
    font-size: 1.2em;
}

.toggle-option span {
    font-size: 0.9em;
}

.report-mode-toggle input[type="radio"]:checked + .toggle-option {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.report-mode-toggle input[type="radio"]:checked + .toggle-option i {
    color: white;
}

.report-mode-toggle input[type="radio"]:checked + .toggle-option span {
    color: white;
}

/* Mobile Parts Container */
.parts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.parts-actions {
    display: flex;
    gap: 8px;
}

.btn-select-all, .btn-details {
    padding: 6px 8px;
    border: none;
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select-all:hover, .btn-details:hover {
    background: var(--primary-color);
    color: white;
}

.mobile-parts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.mobile-part-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-part-item:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.3);
}

.mobile-part-item.selected {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    padding: 11px; /* Compensate for thicker border */
    position: relative;
}

.mobile-part-item.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Adjust check mark for temporal parts */
.mobile-part-item.temporal.selected::before {
    background: #2196F3;
}

.mobile-part-item.validated {
    background: rgba(46, 125, 50, 0.1);
    border-color: #2e7d32;
}

.mobile-part-item.warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: #ff9800;
}

/* Checkbox styles removed - using click selection instead */

/* Waiting Times Section */
#waitingTimesSection {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

#waitingTimesSection .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#waitingTimesSection .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#waitingTimesSection .card-body {
    padding: 16px;
}

.waiting-time-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background: var(--bg-surface);
    position: relative;
}

.waiting-time-item:last-child {
    margin-bottom: 0;
}

.waiting-time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.waiting-time-type {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.waiting-time-duration {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.waiting-time-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.waiting-time-minutes {
    width: 60px;
    height: 36px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--input-text);
}

.waiting-time-minutes:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.waiting-time-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.time-btn-waiting {
    padding: 6px 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
}

.time-btn-waiting.subtract {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.time-btn-waiting.subtract:hover {
    background: rgba(239, 68, 68, 0.25);
}

.time-btn-waiting.subtract:active {
    background: rgba(239, 68, 68, 0.35);
    transform: scale(0.95);
}

.time-btn-waiting.add {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.time-btn-waiting.add:hover {
    background: rgba(34, 197, 94, 0.25);
}

.time-btn-waiting.add:active {
    background: rgba(34, 197, 94, 0.35);
    transform: scale(0.95);
}

.waiting-time-description {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: none; /* Disable manual resize since we auto-resize */
    min-height: 80px;
    line-height: 1.4;
    transition: all 0.2s ease;
    overflow: hidden; /* Hide scrollbars */
    font-family: inherit;
}

.waiting-time-description:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Visual hint for double-click */
.waiting-time-description[placeholder]:not([placeholder=""]):hover {
    cursor: pointer;
    background: var(--hover-bg);
}

/* Add a subtle animation when text is auto-filled */
.waiting-time-description.auto-filled {
    animation: autoFillPulse 0.3s ease;
}

@keyframes autoFillPulse {
    0% {
        background-color: rgba(33, 150, 243, 0.1);
    }
    100% {
        background-color: var(--bg-surface);
    }
}

.remove-waiting-time {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-waiting-time:hover {
    background: rgba(220, 53, 69, 0.1);
}

#waitingTimesEmpty {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#addWaitingTimeBtn {
    font-size: 0.875rem;
    padding: 4px 12px;
    border-radius: 6px;
}

/* Waiting time optgroups */
.waiting-time-type optgroup {
    font-weight: 600;
    color: var(--text-primary);
}

.waiting-time-type option {
    padding: 4px 8px;
}


/* Waiting reason search modal styles */
.mobile-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.mobile-search-modal[style*="display: flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    /* Ensure the modal content is visible */
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    /* Add explicit height */
    height: auto;
    /* High z-index to ensure visibility */
    z-index: 10000;
}

.search-modal-header {
    padding: 16px;
    background: var(--bg-primary, #f5f5f5);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.search-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input-container {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-surface);
    color: var(--text-primary);
}

.search-icon {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.category-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.search-category-section {
    margin-bottom: 16px;
}

.search-category-section:last-child {
    margin-bottom: 0;
}

.search-category-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-category-header i {
    font-size: 0.75rem;
}


/* Waiting time search input wrapper */
.waiting-time-header .search-input-wrapper {
    margin-bottom: 0;
}

.waiting-time-header .search-btn {
    padding: 6px 10px;
    font-size: 0.875rem;
}

/* Search results styles */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    max-height: 400px;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: var(--hover-bg);
}

.search-result-item:active {
    background: rgba(33, 150, 243, 0.1);
}

.result-main-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333333;
    margin-bottom: 4px;
}

.result-sub-text {
    font-size: 0.8rem;
    color: #666666;
    line-height: 1.3;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.search-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.search-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Force modal visibility */
#waitingReasonSearchModal .search-modal-content {
    background: #ffffff !important;
    color: #333333 !important;
}


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

.part-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1em;
}

.part-details {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.part-quantity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.part-quantity-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    background: var(--input-bg);
    transition: all 0.2s ease;
}

.part-quantity-input:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    opacity: 0.6;
}

.part-quantity-input:enabled {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.mobile-part-item.selected .part-quantity-input {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.part-max-quantity {
    font-size: 0.75em;
    color: var(--text-secondary);
    background: var(--bg-light);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Time Rows */
.time-row {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color);
    position: relative;
}

.main-time-row,
.time-row {
    border: 2px solid var(--primary-color);
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.main-time-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

/* Additional time row styling */
.additional-time-row {
    border: 1px solid var(--border-color);
    background: var(--bg-light);
}


.time-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.time-row-header span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-time-row .time-row-header span,
.time-row .time-row-header span {
    color: var(--primary-color);
}

/* Collapsible functionality */
.time-row-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
}

.time-row-header:hover {
    background: var(--hover-bg);
}

/* Header main row - title and actions */
.time-row-header-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.time-row-header .collapse-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--primary-color);
    font-size: 14px;
}

.time-row.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

/* Summary info when collapsed - shown on a separate line */
.time-row-summary {
    display: none;
    flex-direction: row;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    opacity: 0.8;
    width: 100%;
}

.time-row.collapsed .time-row-summary {
    display: flex;
}

.time-row-summary-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-row-summary-item i {
    width: 12px;
    font-size: 10px;
    opacity: 0.6;
}

.time-row-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
}

.time-row.collapsed .time-row-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.time-row-actions {
    display: flex;
    gap: 8px;
}

.btn-add-time, .btn-remove-time {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-time {
    background: var(--primary-color);
    color: white;
}

.btn-add-time:active {
    transform: scale(0.95);
}

.btn-remove-time {
    background: var(--danger-color);
    color: white;
}

.btn-remove-time:active {
    transform: scale(0.95);
}

/* Enhanced Break Time */
.break-time-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 4px;
}

.break-time-input {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.break-time-input input {
    width: 60px;
    height: 36px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--input-text);
}

.break-time-input input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.time-unit {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.break-time-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.time-btn-break {
    padding: 6px 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
}

.time-btn-break.subtract {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.time-btn-break.subtract:hover {
    background: rgba(239, 68, 68, 0.25);
}

.time-btn-break.subtract:active {
    background: rgba(239, 68, 68, 0.35);
    transform: scale(0.95);
}

.time-btn-break.add {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.time-btn-break.add:hover {
    background: rgba(34, 197, 94, 0.25);
}

.time-btn-break.add:active {
    background: rgba(34, 197, 94, 0.35);
    transform: scale(0.95);
}

.break-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.preset-btn {
    padding: 6px 4px;
    border: none;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 32px;
}

.preset-btn:hover {
    background: rgba(37, 99, 235, 0.2);
}

.preset-btn:active {
    background: rgba(37, 99, 235, 0.3);
    transform: scale(0.95);
}

.preset-btn.active {
    background: #2563eb;
    color: white;
}


/* Mobile responsiveness for time inputs */
@media (max-width: 380px) {
    .time-container {
        grid-template-columns: 1fr;
    }
    
    .time-buttons-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
    }
    
    .break-time-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
    }
    
    .break-presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .time-btn, .time-btn-break, .preset-btn {
        padding: 5px 3px;
        font-size: 0.7rem;
        min-height: 28px;
    }
}

/* Mobile Collaborator Select */
.mobile-collaborator-select {
    width: 100%;
    height: 48px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 16px;
}

.mobile-collaborator-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 16px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.details-table th,
.details-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.details-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.details-table tr:hover {
    background: var(--bg-light);
}

.totals-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    color: var(--text-color);
}

.totals-summary strong {
    color: var(--primary-color);
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

/* Enhanced Time Buttons */
.time-row .time-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.time-row .time-input-group {
    width: 100%;
}

.time-row .time-input-group label {
    margin-bottom: 8px;
}

.time-row .break-time-container {
    margin-top: 16px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
}


/* Adjust time buttons in time rows */
.time-row .time-buttons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 4px;
}

/* Time button styles already defined above - removed duplicate */

/* Conjunto and temporal elements */
.conjunto-selection {
    display: flex;
    gap: 8px;
    align-items: center;
}

.conjunto-selection select {
    flex: 1;
}

.btn-add-temporal {
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1em;
    min-width: 40px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-temporal:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-add-temporal:active {
    transform: translateY(0);
}

/* Modal form styles */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Temporal parts styling */
.mobile-part-item.temporal {
    border: 2px dashed #2196F3;
    background: rgba(33, 150, 243, 0.05);
    position: relative;
}

.mobile-part-item.temporal:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: #1976D2;
}

.mobile-part-item.temporal.selected {
    border-width: 3px;
    border-style: dashed;
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.15);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.mobile-part-item.temporal .part-name::after {
    content: " (Temporal)";
    font-size: 0.8em;
    color: #2196F3;
    font-style: italic;
}

/* Temporal badge */
.mobile-part-item.temporal::after {
    content: "TEMPORAL";
    position: absolute;
    top: -8px;
    right: 12px;
    background: #2196F3;
    color: white;
    font-size: 0.65em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Enhanced parts actions */
.parts-actions .btn-add-temporal {
    background: #2196F3;
    font-size: 1em;
    padding: 6px 8px;
    height: auto;
    min-width: 32px;
}

.parts-actions .btn-add-temporal:hover {
    background: #1976D2;
}

/* Temporal button in labels */
label .btn-add-temporal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 2px 6px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s ease;
}

label .btn-add-temporal:hover {
    background: #1976D2;
    transform: scale(1.05);
}

label .btn-add-temporal:active {
    transform: scale(0.95);
}

/* Temporal conjunto in display */
input[value*="[TEMPORAL]"] {
    color: #2196F3 !important;
    font-style: italic;
}

.selected-info {
    transition: color 0.2s ease;
}

.selected-info.temporal {
    color: #2196F3;
    font-style: italic;
}

/* Modal overlay animation */
.modal {
    animation: fadeIn 0.2s ease-out;
}

.modal.closing {
    animation: fadeOut 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.modal-content {
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced form styling */
.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-body label i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .time-container {
        flex-direction: column;
    }
    
    .time-input-group {
        width: 100%;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .details-table {
        font-size: 0.8em;
    }
    
    .details-table th,
    .details-table td {
        padding: 6px 4px;
    }
    
    .break-presets {
        gap: 3px;
    }
    
    .preset-btn {
        padding: 4px 8px;
        font-size: 0.75em;
    }
    
    .totals-summary {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .conjunto-selection {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-add-temporal {
        height: 40px;
        font-size: 1em;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}
