/* =============================================== */
/* 🎨 ESTILOS CUSTOMIZADOS - REQUISIÇÕES FARMÁCIA */
/* =============================================== */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dark theme scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #334155;
}

.dark ::-webkit-scrollbar-thumb {
    background: #64748b;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* Divergências badge alert */
@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.35);
    }
}

.badge-alert {
    animation: badgePulse 1.2s ease-in-out infinite;
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Menu Divergências alerta */
@keyframes menuPulse {
    0%, 100% {
        box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: inset 0 0 0 6px rgba(239, 68, 68, 0.25);
    }
}

.menu-alert {
    animation: menuPulse 1.4s ease-in-out infinite;
    background: linear-gradient(90deg, #1d4ed8 0%, #ef4444 80%) !important;
    color: #ffffff !important;
}
.menu-alert i {
    color: #fee2e2 !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badge input styling */
.badge-input:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* QR Scanner overlay */
.scanner-overlay {
    position: relative;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    overflow: hidden;
}

.scanner-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 2px solid #ef4444;
    border-radius: 8px;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.scanner-overlay::after {
    content: 'Posicione o código aqui';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-aguardando {
    background-color: #fef3c7;
    color: #92400e;
}

.status-em_processo {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-finalizado {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelado {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Priority badges */
.priority-urgente {
    background-color: #fee2e2;
    color: #991b1b;
    animation: urgentPulse 2s infinite;
}

@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.priority-normal {
    background-color: #f3f4f6;
    color: #374151;
}

.priority-baixa {
    background-color: #ecfdf5;
    color: #065f46;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Sector color indicators */
.sector-indicator {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 2px;
}

/* Progress bars */
.progress-container {
    background-color: #e5e7eb;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
}

/* Time indicators */
.time-indicator {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.875rem;
}

.time-warning {
    color: #f59e0b;
}

.time-danger {
    color: #ef4444;
    animation: timePulse 2s infinite;
}

@keyframes timePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .badge-input {
        font-size: 1.5rem;
        padding: 0.8rem;
    }
    
    .metric-card {
        padding: 1rem;
    }
    
    .requisicao-card {
        padding: 0.75rem;
    }
    
    .scanner-overlay::before {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 640px) {
    .monitor-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .chart-container {
        height: 150px;
    }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1024px) {
    .badge-input {
        font-size: 2.5rem;
        padding: 1.5rem;
    }
    
    .scanner-overlay::before {
        width: 250px;
        height: 250px;
    }
}

/* Large screen optimizations */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .metric-card {
        padding: 2rem;
    }
    
    .badge-input {
        font-size: 3rem;
        padding: 2rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .monitor-card {
        border: 1px solid #ccc !important;
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .status-badge {
        border: 2px solid currentColor;
    }
    
    .card-hover:hover {
        border: 2px solid #3b82f6;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.focus-ring:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    ring-offset: 2px;
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #6b7280;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Error states */
.error-state {
    border: 2px solid #ef4444;
    background-color: #fee2e2;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success states */
.success-state {
    border: 2px solid #10b981;
    background-color: #d1fae5;
}

.success-message {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-text {
    margin-left: 0.5rem;
    color: #6b7280;
    font-weight: 500;
}