/* ==========================================================================
   TINA - Estilos para Notificações e Fila de Chamados Urgentes
   Entidades Prioritárias de Saúde (UPAs e Hospitais de Mossoró)
   ========================================================================== */



/* ─── 2. Botão no Header Superior ───────────────────────────────────────── */
.urgent-header-btn {
    position: relative;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    transition: all 0.2s ease;
}

.urgent-header-btn:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    transform: scale(1.05);
}

.urgent-header-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid #0f172a;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* ─── 3. Painel Lateral (Drawer) de Chamados Urgentes ────────────────────── */
.urgent-panel {
    background: #ffffff !important;
    color: #1e293b !important;
    width: 440px !important;
    border-left: 2px solid rgba(239, 68, 68, 0.4) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
}

@media (max-width: 480px) {
    .urgent-panel {
        width: 100vw !important;
        right: -100vw !important;
    }
}

.urgent-panel .panel-content,
.urgent-panel-content {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.urgent-drawer-header {
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-bottom: 1px solid #fca5a5 !important;
    padding: 1.1rem 1.4rem !important;
}

.urgent-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.urgent-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ef4444;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.urgent-icon-badge i {
    width: 20px;
    height: 20px;
}

.urgent-title-group h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0;
    line-height: 1.2;
}

.urgent-subtitle {
    font-size: 0.76rem;
    color: #b91c1c;
    font-weight: 500;
}

.urgent-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.urgent-action-btn {
    background: #ffffff;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.urgent-action-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.urgent-action-btn.active {
    background: #fee2e2;
    color: #991b1b;
}

/* ─── Toolbar do Drawer ─────────────────────────────────────────────────── */
.urgent-toolbar {
    flex-shrink: 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.urgent-stats-pills {
    display: flex;
    align-items: center;
    gap: 8px;
}

.urgent-stat-badge {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.active-stat {
    background: #e2e8f0;
    color: #334155;
}

.stat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 6px #10b981;
}

.unread-stat {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-mark-all-read {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-mark-all-read:hover {
    background: #e0f2fe;
}

/* ─── Filtro por Entidades (Chips) ───────────────────────────────────────── */
.urgent-filter-chips {
    flex-shrink: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.urgent-filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex-shrink: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    min-height: 32px;
    height: 32px;
    box-sizing: border-box;
    border-radius: 16px;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.filter-chip.active {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

/* ─── Lista de Cards de Chamados Urgentes ───────────────────────────────── */
.urgent-tickets-list {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.urgent-tickets-list::-webkit-scrollbar {
    width: 6px;
}

.urgent-tickets-list::-webkit-scrollbar-track {
    background: transparent;
}

.urgent-tickets-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.urgent-tickets-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.urgent-ticket-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.urgent-ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    border-left-color: #dc2626;
}

.urgent-ticket-card.unread {
    background: #fffafa;
    border-left: 4px solid #dc2626;
}

.urgent-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.urgent-entity-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #991b1b;
    background: #fee2e2;
    padding: 3px 8px;
    border-radius: 6px;
}

.urgent-status-tag {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.urgent-status-tag.novo {
    background: #eff6ff;
    color: #1d4ed8;
}

.urgent-status-tag.andamento {
    background: #fef3c7;
    color: #b45309;
}

.urgent-status-tag.pendente {
    background: #f1f5f9;
    color: #475569;
}

.urgent-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.35;
}

.urgent-card-meta {
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.urgent-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.urgent-meta-row i {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.urgent-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.btn-urgent-open-chat {
    flex: 1;
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-urgent-open-chat:hover {
    background: #1d4ed8;
}

.btn-urgent-open-glpi {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-urgent-open-glpi:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.urgent-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.urgent-empty-state i {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* ─── 4. Card / Toast Flutuante em Tempo Real ────────────────────────────── */
.urgent-alerts-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100002;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100vw - 48px);
    pointer-events: none;
}

.urgent-toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(239, 68, 68, 0.6);
    border-left: 6px solid #ef4444;
    border-radius: 12px;
    padding: 16px;
    color: #ffffff;
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.6), 0 0 24px rgba(239, 68, 68, 0.25);
    animation: urgentToastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    position: relative;
}

.urgent-toast.dismissing {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
}

@keyframes urgentToastSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.92);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.urgent-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.urgent-toast-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid #ef4444;
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.urgent-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.urgent-toast-close:hover {
    color: #ffffff;
}

.urgent-toast-entity {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.urgent-toast-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.35;
    margin-bottom: 12px;
}

.urgent-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-urgent-toast-action {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, transform 0.15s;
}

.btn-urgent-toast-action:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-urgent-toast-dismiss {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-urgent-toast-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Barra de progresso para auto-dismiss */
.urgent-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #ef4444;
    width: 100%;
    animation: urgentToastProgress 15s linear forwards;
}

@keyframes urgentToastProgress {
    from { width: 100%; }
    to { width: 0%; }
}
