/* ==========================================================================
   MISSION CONTROL - OPERATOR UI (v3.1 - SPLIT VIEW)
   ========================================================================== */

/* --- 1. HUD & TOOLBAR (Topo) --- */
.operator-hud-container {
    position: sticky;
    top: 60px; /* Ajuste conforme altura da sua navbar */
    z-index: 900;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.operator-hud {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 10px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.hud-stat {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    position: relative; 
    padding: 0 15px;
}
.hud-stat:not(:last-child)::after {
    content: ''; 
    position: absolute; 
    right: 0; 
    top: 10%; 
    height: 80%; 
    width: 1px; 
    background: #e2e8f0;
}

.hud-label { 
    font-size: 0.65rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: #94a3b8; 
    font-weight: 700; 
}
.hud-value { 
    font-size: 1.4rem; 
    font-weight: 800; 
    color: var(--primary-color); 
    line-height: 1; 
}
.hud-value.danger { color: var(--danger-color); }

/* Botão de Rank (Estilo HUD) */
.btn-hud {
    background: white;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 16px;
    width: 60px; /* Quadrado perfeito */
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.5rem;
    color: #f1c40f; /* Dourado */
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.2s;
    cursor: pointer;
}
.btn-hud:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px rgba(241, 196, 15, 0.3); 
    background: #fffbeb; 
}

/* --- 2. LAYOUT DIVIDIDO (SPLIT VIEW) --- */
.mission-grid {
    display: grid;
    /* A Fila (Esquerda) ganha mais espaço (60%), a Mesa (Direita) fica com 40% */
    grid-template-columns: 6fr 4fr; 
    gap: 25px;
    align-items: start;
}

/* Coluna da Direita (Agora é a Minha Mesa) */
.workspace-column {
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 15px;
    border: 1px dashed #cbd5e1;
    min-height: 300px;
}

/* Coluna da Esquerda (Agora é a Fila/Radar) */
.radar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 0.85rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    color: #64748b;
    margin-bottom: 15px; 
    display: flex; 
    align-items: center; 
    gap: 10px;
}
.section-title::after { 
    content: ''; 
    flex-grow: 1; 
    height: 1px; 
    background: #e2e8f0; 
}

/* --- 3. CARD HERO (O Próximo da Fila) --- */
.hero-ticket {
    background: white; 
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.2);
    overflow: hidden; 
    position: relative;
    transition: transform 0.3s;
    margin-bottom: 5px;
}
.hero-ticket:hover { transform: scale(1.01); }

.hero-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    padding: 15px 20px; 
    color: white;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.hero-timer {
    background: rgba(255,255,255,0.2); 
    padding: 5px 12px; 
    border-radius: 50px;
    font-weight: 700; 
    font-size: 0.9rem; 
    backdrop-filter: blur(5px);
    display: flex; align-items: center; gap: 5px;
}
.hero-body { padding: 20px; }

.hero-data-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
}

.data-point label { 
    display: block; 
    font-size: 0.65rem; 
    text-transform: uppercase; 
    color: #94a3b8; 
    font-weight: 700; 
}
.data-point span { 
    font-family: 'Courier New', monospace; 
    font-size: 1rem; 
    font-weight: 700; 
    color: #334155; 
}

.hero-actions { 
    padding: 15px; 
    background: #f8fafc; 
    text-align: center; 
    border-top: 1px solid #f1f5f9;
}
.btn-hero {
    width: 100%; 
    padding: 12px; 
    border-radius: 14px; 
    font-size: 1rem; 
    font-weight: 700;
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border: none; 
    color: white;
    background: var(--success-color); 
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-hero:active { transform: scale(0.97); }

/* --- 4. MEUS TICKETS ATIVOS (Cartão de Trabalho) --- */
.active-ticket-card {
    background: white; 
    border-radius: 16px; 
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
    border-left: 5px solid var(--info-color);
    margin-bottom: 15px;
}
.active-header {
    padding: 12px 15px; 
    background: #f8fafc; 
    border-bottom: 1px solid #e2e8f0;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.status-badge-pulse {
    background: #dbeafe; 
    color: #1e40af; 
    padding: 4px 10px; 
    border-radius: 20px;
    font-size: 0.7rem; 
    font-weight: 700; 
    display: flex; align-items: center; gap: 5px;
}
.status-dot { 
    width: 6px; height: 6px; 
    background: #3b82f6; 
    border-radius: 50%; 
    animation: pulseDot 1.5s infinite; 
}
@keyframes pulseDot {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
.active-body { padding: 15px; }
.active-actions { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px; 
    margin-top: 15px; 
}

/* Botões Internos */
.btn-ticket {
    border-radius: 8px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    padding: 8px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 5px; 
    border: none;
    cursor: pointer;
}
.btn-ticket-primary { background: #e0f2fe; color: #0369a1; }
.btn-ticket-primary:hover { background: #bae6fd; }

.btn-ticket-success { background: #dcfce7; color: #15803d; }
.btn-ticket-success:hover { background: #bbf7d0; }

.btn-ticket-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-ticket-ghost:hover { background: #f1f5f9; color: #334155; }

.btn-ticket-danger-ghost { background: transparent; color: #ef4444; border: 1px solid #fecaca; }
.btn-ticket-danger-ghost:hover { background: #fef2f2; }

/* --- 5. LISTA COMPACTA (Resto da Fila) --- */
.compact-ticket {
    background: white; 
    border-radius: 12px; 
    padding: 12px; 
    margin-bottom: 8px;
    border: 1px solid #f1f5f9; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    cursor: pointer; 
    transition: all 0.2s;
}
.compact-ticket:hover { 
    border-color: var(--accent-color); 
    transform: translateX(3px); 
}
.compact-info h6 { margin: 0; font-weight: 700; font-size: 0.9rem; color: #334155; }
.compact-info small { color: #94a3b8; font-size: 0.75rem; }
.compact-timer { 
    font-weight: 700; 
    color: var(--warning-color); 
    background: #fffbeb; 
    padding: 3px 8px; 
    border-radius: 6px; 
    font-size: 0.75rem; 
}

/* --- MOBILE ADJUSTMENTS (Atualizado) --- */
@media (max-width: 991.98px) {
    .mission-grid { grid-template-columns: 1fr; } /* Empilha uma em cima da outra */
    
    .operator-hud-container { 
        flex-direction: column; 
        gap: 10px; 
    } 
    
    .btn-hud { width: 100%; height: 40px; font-size: 1.2rem; }
    
    /* No mobile, mantemos a Mesa (Workspace) em PRIMEIRO lugar para foco no atendimento */
    .workspace-column { order: 1; margin-bottom: 20px; }
    .radar-column { order: 2; }
}

/* Dark Mode */
body.dark-mode .operator-hud { background: rgba(30, 41, 59, 0.9); border-color: rgba(255,255,255,0.1); }
body.dark-mode .btn-hud { background: #1e293b; border-color: rgba(255,255,255,0.1); }
body.dark-mode .hero-ticket, body.dark-mode .compact-ticket, body.dark-mode .active-ticket-card {
    background: #1e293b; border-color: rgba(255,255,255,0.05);
}
body.dark-mode .workspace-column { background: rgba(30, 41, 59, 0.5); border-color: rgba(255,255,255,0.1); }
body.dark-mode .data-point span, body.dark-mode .compact-info h6 { color: #f1f5f9; }
body.dark-mode .hero-header { background: linear-gradient(135deg, #0f172a, #1e293b); }

/* ==========================================================================
   MODAIS DE DETALHES E VISUALIZAÇÃO (V3.1)
   ========================================================================== */

/* --- Estilo "Cofre" (Restrito) --- */
.locked-modal-content {
    text-align: center;
    padding: 20px;
}
.locked-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}
.locked-warning {
    background: #fffbeb;
    color: #b45309;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #fcd34d;
}

/* --- Estilo "Ficha Técnica" (Completo) --- */
.detail-group {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}
.detail-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid de Informações */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colunas */
    gap: 12px;
}
/* Mobile: 1 coluna */
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-item {
    display: flex;
    flex-direction: column;
}
.detail-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 2px;
}
.detail-value {
    font-size: 0.95rem;
    color: #334155;
    font-weight: 600;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Histórico de Chat no Modal */
.modal-chat-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
}
.chat-bubble-sm {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    max-width: 90%;
}
.chat-bubble-sm.tech { background: #e0f2fe; color: #0369a1; align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-bubble-sm.op { background: #ffffff; border: 1px solid #e2e8f0; color: #334155; align-self: flex-end; border-bottom-right-radius: 2px; margin-left: auto; }

/* ==========================================================================
   ESTILIZAÇÃO DOS MODAIS DE AÇÃO (Concluir, Recusar, Info)
   ========================================================================== */

/* Card de Resumo (Dentro do Modal de Conclusão) */
.modal-summary-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.modal-summary-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.modal-summary-icon.success { background: #dcfce7; color: #15803d; }
.modal-summary-icon.danger { background: #fee2e2; color: #991b1b; }
.modal-summary-icon.info { background: #e0f2fe; color: #0369a1; }

.modal-summary-details h6 { margin: 0; font-weight: 700; color: var(--primary-color); }
.modal-summary-details p { margin: 0; font-size: 0.85rem; color: #64748b; }

/* Textareas mais bonitos */
.form-control-modern {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.form-control-modern:focus {
    background-color: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Labels modernos */
.label-modern {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 5px;
    display: block;
}

/* Cards de Formulário (Entrada/Saída/Movimentação) */
.form-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

.form-card-header {
    padding: 20px 25px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-card-header h5 {
    margin: 0;
    font-weight: 800;
    color: var(--primary-color);
}
.form-card-body {
    padding: 30px;
}

/* Destaque para instruções */
.alert-instruction {
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Melhorias para telas de Operação (Entrada/Saída) */

/* Cards de Coluna (Ex: Origem x Destino) */
.card.border-info, .card.border-success {
    border: 1px solid #e2e8f0 !important; /* Remove bordas coloridas grossas */
    border-top: 4px solid !important; /* Mantém só o topo colorido */
}
.card.border-info { border-top-color: #3498db !important; }
.card.border-success { border-top-color: #2ecc71 !important; }

/* Header interno (ex: "Informações da Filial") */
.card-header.bg-info, .card-header.bg-success {
    background: white !important;
    color: #334155 !important;
    border-bottom: 1px dashed #e2e8f0;
    padding: 15px 20px;
}
.card-header.bg-info h6, .card-header.bg-success h6 {
    color: #334155;
    font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}

/* Ícone do título */
.card-header.bg-info i { color: #3498db; background: #e0f2fe; }
.card-header.bg-success i { color: #2ecc71; background: #dcfce7; }

/* Input Groups (Data, Busca) */
.input-group-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 12px 0 0 12px;
}
.input-group .form-control {
    border-radius: 0 12px 12px 0;
}

/* No style.css */
.hero-ticket.sla-warning {
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    border: 2px solid #f1c40f;
}
.hero-ticket.sla-critical {
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    border: 2px solid #e74c3c;
    animation: pulse-red 2s infinite;
}

.compact-ticket.sla-warning {
    border-left: 4px solid #f1c40f;
}
.compact-ticket.sla-critical {
    border-left: 4px solid #e74c3c;
    background-color: #fff5f5;
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/*================================================*/

