/* Importação de fontes do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* Reset básico e estilos globais */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Estilos do cabeçalho e rodapé */
header, footer {
    background-color: #1a2a47;
    color: #fff;
    text-align: center;
    padding: 30px 0;
}

header {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding-bottom: 0;
}

.header-content {
    padding-bottom: 15px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 600;
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 0 20px 0;
    background-color: rgba(0, 0, 0, 0.15);
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.nav-link.active {
    color: #fff;
    border-bottom-color: #fff;
    font-weight: 600;
}

footer {
    padding: 20px 0;
    margin-top: auto;
}

/* Estilos do contêiner principal */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.section {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 550px;
}

#lancamento-section {
    max-width: 700px;
}

h2 {
    color: #1a2a47;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Estilos do formulário de pedidos */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-weight: 500;
    color: #555;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: #5a77c4;
    box-shadow: 0 0 5px rgba(90, 119, 196, 0.3);
    outline: none;
}

/* Layout de itens do pedido */
.item-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
}

.item-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a2a47;
    background-color: #e0e7ff;
    padding: 2px 10px;
    border-radius: 12px;
}

.item-input-group .remove-item-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    margin: 0;
}

.item-input-group input {
    width: 100%;
}

.item-qty-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.item-qty-row input {
    flex: 1;
}

/* Contador de KG total */
#kg-total-display {
    text-align: right;
    font-size: 1.1rem;
    color: #555;
    padding: 8px 14px;
    background-color: #e8f5e9;
    border-radius: 8px;
    margin-top: -5px;
}

#kg-total-display strong {
    font-size: 1.3rem;
    color: #2e7d32;
}

/* Toggle de urgencia */
.urgencia-toggle-container {
    margin-top: 5px;
}

.urgencia-toggle-container > input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid #ccc;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.toggle-track {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: #ccc;
    border-radius: 14px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-label-on {
    display: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: #dc3545;
    letter-spacing: 1px;
}

.toggle-label-off {
    font-weight: 500;
    font-size: 1rem;
    color: #888;
}

.urgencia-toggle-container > input[type="checkbox"]:checked + .toggle-switch {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.urgencia-toggle-container > input[type="checkbox"]:checked + .toggle-switch .toggle-track {
    background-color: #dc3545;
}

.urgencia-toggle-container > input[type="checkbox"]:checked + .toggle-switch .toggle-track::after {
    transform: translateX(24px);
}

.urgencia-toggle-container > input[type="checkbox"]:checked + .toggle-switch .toggle-label-off {
    display: none;
}

.urgencia-toggle-container > input[type="checkbox"]:checked + .toggle-switch .toggle-label-on {
    display: inline;
}

/* Botao de submit */
.submit-btn {
    font-size: 1.1rem;
    padding: 16px 30px;
}

/* Modal de confirmacao */
#confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#confirm-modal-overlay.active {
    display: flex;
}

#confirm-modal {
    background: #fff;
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease;
}

.confirm-modal-header {
    background-color: #1a2a47;
    color: #fff;
    padding: 18px 25px;
    border-radius: 16px 16px 0 0;
}

.confirm-modal-header h2 {
    color: #fff;
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.3rem;
    text-align: left;
}

#confirm-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.confirm-field {
    margin-bottom: 16px;
}

.confirm-field-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    margin-bottom: 4px;
}

.confirm-field-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a2a47;
}

.confirm-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.confirm-items-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 0.95rem;
    border-bottom: 1px solid #e9ecef;
}

.confirm-items-list li:last-child {
    border-bottom: none;
}

.confirm-items-list li:nth-child(even) {
    background-color: #f8f9fa;
}

.confirm-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2e7d32;
    padding: 10px 0;
}

.confirm-urgente-badge {
    display: inline-block;
    background-color: #dc3545;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.confirm-normal-badge {
    display: inline-block;
    background-color: #e0e0e0;
    color: #555;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.confirm-modal-footer {
    padding: 15px 25px;
    border-top: 2px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Toast de pedido */
#order-toast {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    z-index: 3000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: top 0.4s ease;
    text-align: center;
    min-width: 300px;
}

#order-toast.show {
    top: 30px;
}

#order-toast.success {
    background-color: #28a745;
}

#order-toast.error {
    background-color: #dc3545;
}

/* Estilos dos botões */
button {
    background-color: #2b70e4;
    color: #fff;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #1a5ac9;
    transform: translateY(-2px);
}

.add-item-btn {
    background-color: #28a745;
}

.add-item-btn:hover {
    background-color: #218838;
}

.remove-item-btn {
    background-color: #dc3545;
    font-size: 12px;
    padding: 8px 12px;
    margin: 0;
}

.remove-item-btn:hover {
    background-color: #c82333;
}

/* Estilos para o Painel de Produção */
#admin-main {
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    width: 100%;
    min-height: calc(100vh - 150px);
}

.filter-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
}

.filter-buttons button {
    background-color: #fff;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 24px;
    border: 2px solid #ddd;
    border-radius: 25px;
    transition: all 0.3s;
}

.filter-buttons button:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: none;
    border-color: #ccc;
}

.filter-buttons button.active {
    background-color: #5a77c4;
    color: #fff;
    border-color: #5a77c4;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    max-width: 1600px;
}

/* ========== CARD BASE ========== */
.order-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cardSlideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== STATUS COLORS ========== */
.order-card.status-recebido {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.order-card.status-em-producao {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.order-card.status-pronto {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

/* ========== URGENTE ========== */
.order-card.urgente {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
    animation: cardSlideIn 0.4s ease-out, urgentGlow 2s ease-in-out infinite;
}

@keyframes urgentGlow {
    0%, 100% { box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 8px 40px rgba(239, 68, 68, 0.7), 0 0 20px rgba(239, 68, 68, 0.3); }
}

.urgente-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #fff;
    color: #dc2626;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    animation: urgentPulse 1.5s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ========== CARD HEADER ========== */
.order-header {
    padding: 18px 22px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.order-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.order-header .status-badge {
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    backdrop-filter: blur(4px);
}

/* Recebido badge (fundo claro precisa de texto escuro) */
.order-card.status-recebido .order-header h3 {
    color: rgba(0,0,0,0.7);
}
.order-card.status-recebido .status-badge {
    background-color: rgba(0,0,0,0.15);
    color: rgba(0,0,0,0.75);
}

/* ========== CARD BODY ========== */
.order-details-body {
    padding: 18px 22px;
    flex: 1;
}

.order-details-body p {
    margin-bottom: 6px;
    font-size: 1rem;
    line-height: 1.5;
}

.order-details-body p strong {
    font-weight: 700;
}

/* Nome do cliente - GRANDE e CLARO */
.client-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.order-card.status-recebido .client-name {
    color: #1a1a1a;
    text-shadow: none;
}

/* Tempo decorrido */
.elapsed-time {
    font-size: 0.8rem !important;
    color: rgba(255,255,255,0.6) !important;
    font-style: italic;
    margin-bottom: 12px !important;
}

.order-card.status-recebido .elapsed-time {
    color: rgba(0,0,0,0.45) !important;
}

/* ========== ITEMS LIST - CHECKLIST DE PRODUCAO ========== */
.order-details-body .items-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    background-color: rgba(0,0,0,0.12);
}

.order-details-body .items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.order-details-body .items-list li:last-child {
    border-bottom: none;
}

.order-details-body .items-list li:nth-child(even) {
    background-color: rgba(0,0,0,0.05);
}

.item-name {
    font-weight: 700;
    color: #fff;
    flex: 1;
    margin-right: 12px;
    font-size: 1.05rem;
}

.item-qty {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    font-weight: 700;
    background-color: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Recebido (fundo claro) */
.order-card.status-recebido .items-list {
    background-color: rgba(0,0,0,0.08);
}
.order-card.status-recebido .items-list li {
    border-bottom-color: rgba(0,0,0,0.06);
}
.order-card.status-recebido .item-name {
    color: #1a1a1a;
}
.order-card.status-recebido .item-qty {
    color: #333;
    background-color: rgba(0,0,0,0.1);
}

/* ========== TOTALS ========== */
.totals-section {
    margin: 0 0 10px 0;
    padding: 14px 16px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.totals-section p {
    margin: 0 !important;
    font-size: 1.35rem !important;
    font-weight: 800;
    color: #fff;
}

.totals-section p strong {
    color: #fff !important;
}

.order-card.status-recebido .totals-section {
    background-color: rgba(0,0,0,0.1);
}
.order-card.status-recebido .totals-section p,
.order-card.status-recebido .totals-section p strong {
    color: #1a1a1a !important;
}

/* ========== OBS BOX ========== */
.obs-box {
    margin: 0 0 4px 0;
    padding: 10px 14px;
    background-color: rgba(255,255,255,0.12);
    border-left: 3px solid rgba(255,255,255,0.5);
    border-radius: 0 10px 10px 0;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.5;
}

.obs-box strong {
    color: #fff;
}

.order-card.status-recebido .obs-box {
    background-color: rgba(0,0,0,0.06);
    border-left-color: rgba(0,0,0,0.25);
    color: #333;
}
.order-card.status-recebido .obs-box strong {
    color: #1a1a1a;
}

/* Text color overrides for dark cards */
.order-card.status-em-producao .order-details-body,
.order-card.status-em-producao .order-details-body p strong,
.order-card.status-pronto .order-details-body,
.order-card.status-pronto .order-details-body p strong,
.order-card.urgente .order-details-body,
.order-card.urgente .order-details-body p strong {
    color: #fff;
}

/* ========== BUTTONS ========== */
.admin-buttons {
    display: flex;
    gap: 8px;
    padding: 0 22px 18px;
}

.admin-buttons button {
    flex: 1;
    padding: 14px 10px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-buttons button:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.admin-buttons button.prepare {
    background-color: rgba(255,255,255,0.95);
    color: #0284c7;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.admin-buttons button.prepare:hover {
    background-color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.admin-buttons button.ready {
    background-color: rgba(255,255,255,0.95);
    color: #16a34a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.admin-buttons button.ready:hover {
    background-color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.admin-buttons button.delete {
    background-color: rgba(0,0,0,0.12);
    color: rgba(255,255,255,0.95);
    box-shadow: none;
    flex: 0.5;
    font-size: 0.85rem;
}

.admin-buttons button.delete:hover {
    background-color: rgba(0,0,0,0.25);
}

.order-card.status-recebido .admin-buttons button.delete {
    background-color: rgba(0,0,0,0.12);
    color: #555;
}

.order-card.status-recebido .admin-buttons button.delete:hover {
    background-color: rgba(0,0,0,0.2);
    color: #333;
}

/* ========== BARRA DE RESUMO ========== */
#orders-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.summary-badge {
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    min-width: 170px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.summary-badge.recebidos {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1a1a1a;
}

.summary-badge.em-producao {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.summary-badge.prontos {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.summary-count {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}

/* ========== CONFETTI CANVAS ========== */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ========== ADMIN PAGE THEME ========== */
.admin-page header {
    padding-bottom: 30px;
}

/* Modal de pesagem */
#weight-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#weight-modal-overlay.active {
    display: flex;
}

#weight-modal {
    background: #fff;
    border-radius: 16px;
    width: 95%;
    max-width: 550px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease;
}

.weight-modal-header {
    background-color: #1a2a47;
    color: #fff;
    padding: 20px 25px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weight-modal-header h2 {
    color: #fff;
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.3rem;
    text-align: left;
}

#weight-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    padding: 0 5px;
    cursor: pointer;
}

#weight-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.weight-item-row {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.weight-item-row:last-child {
    border-bottom: none;
}

.weight-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1a2a47;
    margin-bottom: 6px;
}

.weight-item-planned {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.weight-item-row input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.weight-item-row input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.weight-modal-footer {
    padding: 15px 25px;
    border-top: 2px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn-cancel {
    background-color: #6c757d;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.modal-btn-cancel:hover {
    background-color: #5a6268;
}

.modal-btn-save {
    background-color: #4caf50;
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.modal-btn-save:hover {
    background-color: #43a047;
}

/* Animações e Transições */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-card-enter-active, .order-card-leave-active {
    transition: all 0.5s ease;
}

.order-card-enter-from, .order-card-leave-to {
    opacity: 0;
    transform: scale(0.8);
}

.status-change {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Estilos do relatório */
#relatorio-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.report-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    margin-top: 30px;
}

.table-container {
    overflow-x: auto;
}

#auditoria-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#auditoria-table th, #auditoria-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

#auditoria-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

#auditoria-table tbody tr:hover {
    background-color: #f1f1f1;
}

#auditoria-table td:nth-child(4) {
    width: 150px;
}

/* ========== CHAT FLUTUANTE ========== */
#chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #1a2a47;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    z-index: 1000;
    border: 2px solid white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chat-widget-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239,68,68,0.4);
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#chat-popup {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: 90vw;
    height: 480px;
    max-height: 70vh;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    transform: scale(0.5);
    transform-origin: bottom right;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

#chat-popup.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.chat-header {
    background-color: #1a2a47;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.1rem;
    color: white;
    border: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

#chat-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    font-weight: bold;
    padding: 0 5px;
    cursor: pointer;
    transition: color 0.2s;
}

#chat-close-btn:hover {
    color: #fff;
    transform: none;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #e8ecf1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-form {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    background-color: #fff;
}

.chat-form input {
    flex: 1;
    border-radius: 20px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.chat-form button {
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ========== BOLHAS DE CHAT ========== */
.chat-bubble {
    max-width: 80%;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
    animation: bubbleIn 0.2s ease;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble-me {
    align-self: flex-end;
    background-color: #0084ff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble-other {
    align-self: flex-start;
    background-color: #fff;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chat-bubble-sender {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #5a77c4;
}

.chat-bubble-text {
    display: block;
}

.chat-bubble-time {
    display: block;
    font-size: 0.65rem;
    text-align: right;
    margin-top: 4px;
    opacity: 0.6;
}

/* ========== TOAST DE CHAT ========== */
#toast-notification {
    position: fixed;
    bottom: 100px;
    right: 100px;
    background-color: #1a2a47;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}