/* ==========================================================================
   TELA DE NOTIFICAÇÕES POR TEMPLATE OFICIAL DA META
   ========================================================================== */
.template-notificacao-container {
    padding: 20px 24px;
    background-color: #f8fafc;
    min-height: 88vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 1. Header Bar */
.tn-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    background-color: #ffffff;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tn-badge-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #e7f7ed;
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #a7f3d0;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.tn-header-title h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.tn-header-title p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.tn-header-actions {
    display: flex;
    gap: 10px;
}

.tn-btn-sync {
    border-radius: 6px !important;
    font-weight: 600;
    font-size: 12.5px;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tn-btn-nova {
    background-color: #00a884 !important;
    border-color: #008069 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    font-weight: 700;
    font-size: 12.5px;
    padding: 7px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

    .tn-btn-nova:hover {
        background-color: #008069 !important;
    }

/* 2. Barra de Filtros */
.tn-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 16px;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.tn-filter-item {
    width: 260px;
}

    .tn-filter-item label {
        font-size: 12px;
        font-weight: 700;
        color: #475569;
        margin-bottom: 4px;
    }

.tn-filter-search {
    flex: 1;
}

/* 3. Tabela de Regras */
.tn-table-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.tn-table {
    margin-bottom: 0;
}

    .tn-table th {
        background-color: #f8fafc;
        color: #475569;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        padding: 12px 14px;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .tn-table td {
        padding: 12px 14px;
        vertical-align: middle !important;
        font-size: 13px;
        color: #1e293b;
        border-top: 1px solid #f1f5f9;
    }

.tn-status-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}

    .tn-status-pill.ativo {
        background-color: #dcfce7;
        color: #15803d;
    }

    .tn-status-pill.inativo {
        background-color: #f1f5f9;
        color: #64748b;
    }

    .tn-status-pill:hover {
        opacity: 0.8;
    }

.tn-gatilho-badge {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}

.tn-template-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tn-cat-badge {
    font-size: 9.5px;
    font-weight: 800;
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.tn-prazo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
    font-weight: 500;
}

.tn-badge-vars {
    background-color: #64748b;
    font-size: 11px;
}

.tn-btn-action {
    border-radius: 5px !important;
    margin-left: 4px;
}

.tn-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}

    .tn-empty-state h4 {
        margin: 12px 0 6px 0;
        color: #475569;
        font-weight: 700;
    }

/* 4. Modal de Configuração */
.tn-modal {
    border-radius: 12px !important;
    border: none;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.tn-modal-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
}

    .tn-modal-header .modal-title {
        font-size: 16px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
    }

.tn-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px 14px 16px;
    margin-bottom: 8px;
}

    .tn-fieldset legend {
        width: auto;
        border: none;
        font-size: 12.5px;
        font-weight: 700;
        color: #334155;
        padding: 0 8px;
        margin-bottom: 4px;
    }

.tn-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 5px;
}

.tn-help-text {
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 8px;
}

.tn-badge-var-idx {
    background-color: #00a884;
    font-family: monospace;
    font-size: 11.5px;
    padding: 4px 6px;
}

/* 5. Simulador WhatsApp (Preview à Direita) */
.tn-preview-panel {
    background-color: #efeae2; /* Fundo oficial do WhatsApp */
    border: 1px solid #d1d7db;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 380px;
}

.tn-preview-header {
    background-color: #008069;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tn-preview-screen {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tn-wa-bubble {
    background-color: #ffffff;
    border-radius: 8px 8px 8px 0;
    padding: 8px 12px 6px 12px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.13);
    max-width: 95%;
    position: relative;
}

.tn-wa-text {
    font-size: 13px;
    line-height: 1.45;
    color: #111b21;
}

.tn-wa-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10px;
    color: #667781;
    margin-top: 4px;
}

.tn-preview-placeholder {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
}

    .tn-preview-placeholder p {
        font-size: 12px;
        margin-top: 8px;
    }

.tn-preview-footer {
    background-color: #ffffff;
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #64748b;
}

.tn-modal-footer {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 12px 20px;
}

.tn-btn-salvar {
    background-color: #00a884 !important;
    border-color: #008069 !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 13px;
    padding: 7px 20px;
    border-radius: 6px !important;
}
