/**
 * Agendamento Plugin — alinhamento global de ícones Font Awesome
 *
 * Corrige deslocamento vertical/horizontal em botões, badges e blocos de ícone.
 * Carregado por último nas páginas do plugin (após admin.css e public-agendamentos.css).
 */

/* ---- Escopo: superfícies de UI do plugin ---- */
.react-app-container :is(i, span)[class*="fa-"],
.page-agendamentos :is(i, span)[class*="fa-"],
.gerencia-page :is(i, span)[class*="fa-"],
.agendamento-form-container :is(i, span)[class*="fa-"],
.calendario-agendamento-container :is(i, span)[class*="fa-"],
.buytobuyadmin-flow :is(i, span)[class*="fa-"],
body[class*="_page_agendamento"] #wpbody-content :is(i, span)[class*="fa-"],
body.toplevel_page_agendamento-admin #wpbody-content :is(i, span)[class*="fa-"] {
    margin: 0;
    padding: 0;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
    text-align: center;
    position: relative;
}

.react-app-container :is(i, span)[class*="fa-"]::before,
.page-agendamentos :is(i, span)[class*="fa-"]::before,
.gerencia-page :is(i, span)[class*="fa-"]::before,
.agendamento-form-container :is(i, span)[class*="fa-"]::before,
.calendario-agendamento-container :is(i, span)[class*="fa-"]::before,
.buytobuyadmin-flow :is(i, span)[class*="fa-"]::before,
body[class*="_page_agendamento"] #wpbody-content :is(i, span)[class*="fa-"]::before,
body.toplevel_page_agendamento-admin #wpbody-content :is(i, span)[class*="fa-"]::before {
    display: block;
    line-height: 1;
}

/* Ícones dentro de botões (não inclui links de navegação do menu lateral) */
.react-app-container :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label, .filters-sidebar-btn, .servicos-btn-edit, .servicos-btn-delete, .locais-btn-edit, .locais-btn-delete, .btn-edit-servico, .btn-delete-servico) > :is(i, span)[class*="fa-"],
.page-agendamentos :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label, .filters-sidebar-btn, .servicos-btn-edit, .servicos-btn-delete, .locais-btn-edit, .locais-btn-delete, .btn-edit-servico, .btn-delete-servico) > :is(i, span)[class*="fa-"],
.gerencia-page :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label, .filters-sidebar-btn, .servicos-btn-edit, .servicos-btn-delete, .locais-btn-edit, .locais-btn-delete, .btn-edit-servico, .btn-delete-servico) > :is(i, span)[class*="fa-"],
.agendamento-form-container :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn) > :is(i, span)[class*="fa-"],
.calendario-agendamento-container :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn) > :is(i, span)[class*="fa-"],
.buytobuyadmin-flow :is(button, [role="button"], .agendamento-report__btn) > :is(i, span)[class*="fa-"],
body[class*="_page_agendamento"] #wpbody-content :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn) > :is(i, span)[class*="fa-"],
body.toplevel_page_agendamento-admin #wpbody-content :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn) > :is(i, span)[class*="fa-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    font-size: inherit;
}

/* Controles com ícone: flex + gap (exceto menu lateral) */
.react-app-container :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label, .filters-sidebar-btn):has(> :is(i, span)[class*="fa-"]),
.page-agendamentos :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label, .filters-sidebar-btn):has(> :is(i, span)[class*="fa-"]),
.gerencia-page :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label, .filters-sidebar-btn):has(> :is(i, span)[class*="fa-"]),
.agendamento-form-container :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn, label.agendamento-report__btn):has(> :is(i, span)[class*="fa-"]),
.calendario-agendamento-container :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn):has(> :is(i, span)[class*="fa-"]),
.buytobuyadmin-flow :is(button, [role="button"], .agendamento-report__btn):has(> :is(i, span)[class*="fa-"]),
body[class*="_page_agendamento"] #wpbody-content :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn):has(> :is(i, span)[class*="fa-"]),
body.toplevel_page_agendamento-admin #wpbody-content :is(button, [role="button"], .agendamento-report__btn, .gerencia-pagination-btn, a.agendamento-report__btn, label.agendamento-report__btn):has(> :is(i, span)[class*="fa-"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

/* Só ícone — classes explícitas (texto solto após <i> não conta como filho para :only-child) */
.react-app-container :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .emails-help-tip, .emails-queue-cancel-btn, .emails-preview-modal__close, .btn-filter-toggle, .btn-add-agendamento, .btn-clear-filters-fixed, .btn-refresh-icon, .view-mode-btn, .sidebar-settings-btn),
.page-agendamentos :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .emails-help-tip, .emails-queue-cancel-btn, .emails-preview-modal__close, .btn-filter-toggle, .btn-add-agendamento, .btn-clear-filters-fixed, .btn-refresh-icon, .view-mode-btn, .sidebar-settings-btn),
.gerencia-page :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .emails-help-tip, .emails-queue-cancel-btn, .emails-preview-modal__close, .btn-filter-toggle, .btn-add-agendamento, .btn-clear-filters-fixed, .btn-refresh-icon, .view-mode-btn, .sidebar-settings-btn),
.agendamento-form-container :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .btn-filter-toggle, .btn-add-agendamento),
.calendario-agendamento-container :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .btn-filter-toggle, .btn-add-agendamento),
.buytobuyadmin-flow :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only),
body[class*="_page_agendamento"] #wpbody-content :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .emails-help-tip, .emails-queue-cancel-btn),
body.toplevel_page_agendamento-admin #wpbody-content :is(.emails-externo-icon-btn, .agendamento-report__btn--icon-only, .emails-help-tip, .emails-queue-cancel-btn),
.emails-externo-modal .emails-externo-icon-btn,
.emails-externo-modal .emails-preview-modal__close {
    gap: 0;
}

/* Blocos / badges dedicados a ícone */
.react-app-container :is(.stat-icon, .metric-icon, .dashboard-title-icon, .emails-empty-state-icon, .emails-help-tip, .sidebar-settings-btn, .view-mode-btn, .btn-filter-toggle, .btn-add-agendamento, .btn-clear-filters-fixed, .btn-refresh-icon, .emails-externo-icon-btn, .emails-queue-cancel-btn, .emails-preview-modal__close, [class*="__icon"], [class*="-icon-btn"], [class*="-icon-only"]),
.page-agendamentos :is(.stat-icon, .metric-icon, .dashboard-title-icon, .emails-empty-state-icon, .emails-help-tip, .sidebar-settings-btn, .view-mode-btn, .btn-filter-toggle, .btn-add-agendamento, .btn-clear-filters-fixed, .btn-refresh-icon, .emails-externo-icon-btn, .emails-queue-cancel-btn, .emails-preview-modal__close, [class*="__icon"], [class*="-icon-btn"], [class*="-icon-only"]),
.gerencia-page :is(.stat-icon, .metric-icon, .dashboard-title-icon, .emails-empty-state-icon, .emails-help-tip, .emails-externo-icon-btn, .emails-queue-cancel-btn, .emails-preview-modal__close, [class*="__icon"], [class*="-icon-btn"], [class*="-icon-only"]),
.calendario-agendamento-container :is(.stat-icon, .metric-icon, .dashboard-title-icon, [class*="__icon"], [class*="-icon-btn"]),
.buytobuyadmin-flow :is([class*="__icon"], [class*="-icon-btn"], [class*="-icon-only"]),
body[class*="_page_agendamento"] #wpbody-content :is(.stat-icon, .metric-icon, .emails-empty-state-icon, [class*="__icon"], [class*="-icon-btn"]),
body.toplevel_page_agendamento-admin #wpbody-content :is(.stat-icon, .metric-icon, [class*="__icon"], [class*="-icon-btn"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.react-app-container :is(.stat-icon, .metric-icon, .dashboard-title-icon, .emails-empty-state-icon, [class*="__icon"]) :is(i, span)[class*="fa-"],
.page-agendamentos :is(.stat-icon, .metric-icon, .dashboard-title-icon, .emails-empty-state-icon, [class*="__icon"]) :is(i, span)[class*="fa-"],
.gerencia-page :is(.stat-icon, .metric-icon, .dashboard-title-icon, .emails-empty-state-icon, [class*="__icon"]) :is(i, span)[class*="fa-"],
body[class*="_page_agendamento"] #wpbody-content :is(.stat-icon, .metric-icon, .emails-empty-state-icon, [class*="__icon"]) :is(i, span)[class*="fa-"],
body.toplevel_page_agendamento-admin #wpbody-content :is(.stat-icon, .metric-icon, [class*="__icon"]) :is(i, span)[class*="fa-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* Títulos e parágrafos: espaço só quando há texto após o ícone */
.react-app-container :is(h1, h2, h3, h4, h5, h6, p, label) > :is(i, span)[class*="fa-"]:first-child:not(:only-child),
.page-agendamentos :is(h1, h2, h3, h4, h5, h6, p, label) > :is(i, span)[class*="fa-"]:first-child:not(:only-child),
.gerencia-page :is(h1, h2, h3, h4, h5, h6, p, label) > :is(i, span)[class*="fa-"]:first-child:not(:only-child),
body[class*="_page_agendamento"] #wpbody-content :is(h1, h2, h3, h4, h5, h6, p, label) > :is(i, span)[class*="fa-"]:first-child:not(:only-child),
body.toplevel_page_agendamento-admin #wpbody-content :is(h1, h2, h3, h4, h5, h6, p, label) > :is(i, span)[class*="fa-"]:first-child:not(:only-child) {
    margin-right: 0.35em;
}

/* E-mails — título e ajuda da renovação (sem margem extra; gap do flex) */
.gerencia-page .emails-campaign-group-title > :is(i, span)[class*="fa-"],
.page-agendamentos .emails-campaign-group-title > :is(i, span)[class*="fa-"] {
    margin: 0;
}

.gerencia-page .emails-help-tip > :is(i, span)[class*="fa-"],
.page-agendamentos .emails-help-tip > :is(i, span)[class*="fa-"],
.gerencia-page .emails-externo-icon-btn > :is(i, span)[class*="fa-"],
.page-agendamentos .emails-externo-icon-btn > :is(i, span)[class*="fa-"] {
    margin: 0;
    width: 1em;
    height: 1em;
}

/* Menu lateral — ícones alinhados à esquerda (não centralizar o link inteiro) */
.react-app-container .sidebar-menu .sidebar-menu-link,
.page-agendamentos .sidebar-menu .sidebar-menu-link,
.gerencia-page .sidebar-menu .sidebar-menu-link {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: var(--spacing-sm, 0.5rem) !important;
}

.react-app-container .sidebar-menu .sidebar-menu-link > :is(i, span)[class*="fa-"],
.page-agendamentos .sidebar-menu .sidebar-menu-link > :is(i, span)[class*="fa-"],
.gerencia-page .sidebar-menu .sidebar-menu-link > :is(i, span)[class*="fa-"] {
    display: inline-block !important;
    width: 20px !important;
    min-width: 20px !important;
    height: auto !important;
    text-align: center;
    flex-shrink: 0;
}

.react-app-container .sidebar-menu-top-action .sidebar-menu-link > :is(i, span)[class*="fa-"],
.page-agendamentos .sidebar-menu-top-action .sidebar-menu-link > :is(i, span)[class*="fa-"] {
    width: 20px !important;
    min-width: 20px !important;
}

/* Página /agendamento/emails/ — mais espaço entre ícone e texto */
.react-app-container .page-agendamentos.emails-page :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label):not(.emails-externo-icon-btn):has(> :is(i, span)[class*="fa-"]),
.page-agendamentos.emails-page :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label):not(.emails-externo-icon-btn):has(> :is(i, span)[class*="fa-"]),
.gerencia-page.emails-page :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label):not(.emails-externo-icon-btn):has(> :is(i, span)[class*="fa-"]) {
    gap: 0.8rem;
}

.react-app-container .page-agendamentos.emails-page .gerencia-pagination-btn:has(> :is(i, span)[class*="fa-"]),
.page-agendamentos.emails-page .gerencia-pagination-btn:has(> :is(i, span)[class*="fa-"]),
.gerencia-page.emails-page .gerencia-pagination-btn:has(> :is(i, span)[class*="fa-"]) {
    gap: 0.65rem;
}

.react-app-container .page-agendamentos.emails-page .emails-campaign-group-title,
.page-agendamentos.emails-page .emails-campaign-group-title,
.gerencia-page.emails-page .emails-campaign-group-title {
    gap: 0.65rem;
}

.emails-externo-modal :is(button, [role="button"], .agendamento-report__btn, a.agendamento-report__btn, label.agendamento-report__btn, label.emails-externo-upload-label):not(.emails-externo-icon-btn):has(> :is(i, span)[class*="fa-"]) {
    gap: 0.8rem;
}
