/* ============================================================================
   over.tv Frontend Kit — Componentes base (porte do React kit p/ CSS plano)
   Depende de tokens.css (carregar antes). Classes namespaced .ovtv-* para não
   colidir com Bootstrap (.btn/.modal/.table) nem com a camada legada .otv-empresa.
   Adoção aditiva: aplique as classes nas telas (mobile-first), uma por PR.
   Origem 1:1 dos arquivos docs/src/components/*/*.module.css.
   ============================================================================ */

/* ===========================================================================
   TIPOGRAFIA  (seção 4 do plano) — escala modular 1.25
   =========================================================================== */
.ovtv-display{font:700 32px/40px var(--ovtv-font);color:var(--ovtv-gray-900);margin:0;}
.ovtv-h1{font:700 24px/32px var(--ovtv-font);color:var(--ovtv-gray-900);margin:0;
  /* barra de marca 4px à esquerda — usar em todo título de página */
  padding-left:var(--ovtv-space-3);border-left:4px solid var(--ovtv-brand-500);}
.ovtv-h2{font:600 20px/28px var(--ovtv-font);color:var(--ovtv-gray-900);margin:0;}
.ovtv-h3{font:600 16px/24px var(--ovtv-font);color:var(--ovtv-gray-900);margin:0;}
.ovtv-body{font:400 14px/22px var(--ovtv-font);color:var(--ovtv-gray-700);}
.ovtv-body-sm{font:400 13px/20px var(--ovtv-font);color:var(--ovtv-gray-600);}
.ovtv-caption{font:500 12px/16px var(--ovtv-font);letter-spacing:.04em;text-transform:uppercase;color:var(--ovtv-gray-500);}
.ovtv-kpi{font:700 28px/34px var(--ovtv-font);color:var(--ovtv-gray-900);font-variant-numeric:tabular-nums;}
.ovtv-mono{font:400 13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums;}
.ovtv-num{font-variant-numeric:tabular-nums;}

/* ===========================================================================
   BUTTON  (6.1) — origem: Button.module.css
   .btn -> .ovtv-btn | variants/sizes -> modificadores BEM
   =========================================================================== */
.ovtv-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:var(--ovtv-space-2);
  font-family:var(--ovtv-font);font-weight:600;border-radius:var(--ovtv-radius-md);
  border:1px solid transparent;cursor:pointer;white-space:nowrap;text-decoration:none;
  transition:background var(--ovtv-dur) var(--ovtv-ease),
             box-shadow var(--ovtv-dur) var(--ovtv-ease),
             border-color var(--ovtv-dur) var(--ovtv-ease);
}
.ovtv-btn:focus-visible{outline:none;box-shadow:var(--ovtv-focus-ring);}
.ovtv-btn:disabled,.ovtv-btn[aria-disabled="true"]{opacity:.5;pointer-events:none;}

/* sizes */
.ovtv-btn--sm{height:32px;padding:0 var(--ovtv-space-3);font-size:13px;}
.ovtv-btn--md{height:40px;padding:0 var(--ovtv-space-4);font-size:14px;}
.ovtv-btn--lg{height:48px;padding:0 var(--ovtv-space-5);font-size:15px;}
.ovtv-btn--icon{padding:0;width:40px;height:40px;}

/* variants */
.ovtv-btn--primary{background:var(--ovtv-brand-500);color:#fff;}
.ovtv-btn--primary:hover{background:var(--ovtv-brand-600);}
.ovtv-btn--primary:active{background:var(--ovtv-brand-700);}
.ovtv-btn--secondary{background:var(--ovtv-gray-0);color:var(--ovtv-gray-700);border-color:var(--ovtv-gray-300);}
.ovtv-btn--secondary:hover{background:var(--ovtv-gray-100);}
.ovtv-btn--ghost{background:transparent;color:var(--ovtv-brand-500);}
.ovtv-btn--ghost:hover{background:var(--ovtv-brand-50);}
.ovtv-btn--danger{background:var(--ovtv-danger-500);color:#fff;}
.ovtv-btn--danger:hover{filter:brightness(.95);}
.ovtv-btn--success{background:var(--ovtv-success-500);color:#06231b;}

.ovtv-btn--block{width:100%;}
.ovtv-btn--loading{position:relative;color:transparent;}
.ovtv-btn__spinner{
  position:absolute;width:16px;height:16px;border-radius:50%;
  border:2px solid currentColor;border-top-color:transparent;
  animation:ovtv-spin .7s linear infinite;color:#fff;
}
@keyframes ovtv-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.ovtv-btn__spinner{animation-duration:1.4s}}

/* mobile: alvo de toque >=44 */
@media (max-width:767.98px){ .ovtv-btn--sm,.ovtv-btn--md{min-height:44px} }

/* ===========================================================================
   MODAL / BOTTOM-SHEET  (6.2) — origem: Modal.module.css
   Toggle via JS (ovtv-ui.js): .ovtv-modal default oculto; .ovtv-modal--open abre.
   =========================================================================== */
.ovtv-modal{
  position:fixed;inset:0;z-index:var(--ovtv-z-modal);
  background:rgba(31,43,58,.45);backdrop-filter:blur(2px);
  display:none;align-items:center;justify-content:center;padding:var(--ovtv-space-4);
}
.ovtv-modal--open{display:flex;}
.ovtv-modal__panel{
  background:var(--ovtv-gray-0);border-radius:var(--ovtv-radius-lg);box-shadow:var(--ovtv-shadow-lg);
  width:100%;max-height:90vh;display:flex;flex-direction:column;
  animation:ovtv-pop var(--ovtv-dur) var(--ovtv-ease);
}
.ovtv-modal__panel.ovtv-modal--sm{max-width:480px}
.ovtv-modal__panel.ovtv-modal--md{max-width:640px}
.ovtv-modal__panel.ovtv-modal--lg{max-width:800px}
.ovtv-modal__header{display:flex;align-items:center;justify-content:space-between;
  padding:var(--ovtv-space-5) var(--ovtv-space-6);border-bottom:1px solid var(--ovtv-gray-200);}
.ovtv-modal__title{font-size:18px;font-weight:600;color:var(--ovtv-gray-900);margin:0;}
.ovtv-modal__close{font-size:24px;line-height:1;background:none;border:none;color:var(--ovtv-gray-500);
  cursor:pointer;width:32px;height:32px;border-radius:var(--ovtv-radius-sm);}
.ovtv-modal__close:hover{background:var(--ovtv-gray-100);}
.ovtv-modal__body{padding:var(--ovtv-space-6);overflow-y:auto;}
.ovtv-modal__footer{display:flex;justify-content:flex-end;gap:var(--ovtv-space-3);
  padding:var(--ovtv-space-4) var(--ovtv-space-6);border-top:1px solid var(--ovtv-gray-200);}

/* alert dialog (variant="alert"): ícone de status no topo do corpo */
.ovtv-modal__panel.ovtv-modal--alert .ovtv-modal__body{display:flex;gap:var(--ovtv-space-3);align-items:flex-start;}

@keyframes ovtv-pop{from{transform:translateY(8px);opacity:0}to{transform:none;opacity:1}}

/* MOBILE -> bottom-sheet */
@media (max-width:767.98px){
  .ovtv-modal{align-items:flex-end;padding:0;}
  .ovtv-modal__panel{max-width:100%!important;max-height:92vh;
    border-radius:var(--ovtv-radius-xl) var(--ovtv-radius-xl) 0 0;
    animation:ovtv-slideUp var(--ovtv-dur-slow) var(--ovtv-ease);}
  .ovtv-modal__footer{position:sticky;bottom:0;background:var(--ovtv-gray-0);
    padding-bottom:max(var(--ovtv-space-4),env(safe-area-inset-bottom));}
  .ovtv-modal__footer .ovtv-btn{flex:1;}
}
@keyframes ovtv-slideUp{from{transform:translateY(100%)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.ovtv-modal__panel{animation:none}}

/* ===========================================================================
   DATATABLE  (6.3) — origem: DataTable.module.css
   Desktop = <table class="ovtv-table">; Mobile (<768) vira cards empilhados.
   Renderize as duas árvores (table + cards) e o CSS alterna por viewport.
   =========================================================================== */
.ovtv-table__wrap{overflow-x:auto;border:1px solid var(--ovtv-gray-200);border-radius:var(--ovtv-radius-lg);}
.ovtv-table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums;margin:0;}
.ovtv-table thead th{position:sticky;top:0;background:var(--ovtv-gray-50);
  text-transform:uppercase;font-size:12px;letter-spacing:.04em;color:var(--ovtv-gray-500);
  padding:var(--ovtv-space-3) var(--ovtv-space-4);border-bottom:1px solid var(--ovtv-gray-200);text-align:left;}
.ovtv-table tbody td{padding:var(--ovtv-space-4);border-bottom:1px solid var(--ovtv-gray-100);color:var(--ovtv-gray-700);}
.ovtv-table tbody tr:hover{background:var(--ovtv-gray-100);}
.ovtv-table--comfortable td{padding:var(--ovtv-space-4);}
.ovtv-table--compact td{padding:var(--ovtv-space-2) var(--ovtv-space-3);}
.ovtv-table__actions{text-align:right;width:48px;}
.ovtv-table__state{padding:var(--ovtv-space-6);}
.ovtv-table__err{color:var(--ovtv-danger-500);margin-bottom:var(--ovtv-space-3);}

/* mobile cards */
.ovtv-cards{display:none;}
@media (max-width:767.98px){
  .ovtv-table__wrap{display:none;}
  .ovtv-cards{display:flex;flex-direction:column;gap:var(--ovtv-space-3);}
  .ovtv-card{border:1px solid var(--ovtv-gray-200);border-radius:var(--ovtv-radius-lg);
    padding:var(--ovtv-space-4);background:var(--ovtv-gray-0);box-shadow:var(--ovtv-shadow-xs);}
  .ovtv-card__row{display:flex;justify-content:space-between;gap:var(--ovtv-space-4);
    padding:var(--ovtv-space-2) 0;border-bottom:1px solid var(--ovtv-gray-100);}
  .ovtv-card__row:last-of-type{border-bottom:none;}
  .ovtv-card__label{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--ovtv-gray-500);}
  .ovtv-card__value{font-size:14px;color:var(--ovtv-gray-900);text-align:right;}
  .ovtv-card__actions{margin-top:var(--ovtv-space-3);display:flex;justify-content:flex-end;}
}

/* ===========================================================================
   EMPTY STATE  — origem: EmptyState.module.css
   =========================================================================== */
.ovtv-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:var(--ovtv-space-12) var(--ovtv-space-6);gap:var(--ovtv-space-3);}
.ovtv-empty__icon{font-size:40px;opacity:.7;}
.ovtv-empty__title{font-size:16px;font-weight:600;color:var(--ovtv-gray-900);margin:0;}
.ovtv-empty__desc{font-size:14px;color:var(--ovtv-gray-500);margin:0;max-width:360px;}
.ovtv-empty__action{margin-top:var(--ovtv-space-2);}

/* ===========================================================================
   SKELETON  — origem: Skeleton.module.css
   <div class="ovtv-skeleton" style="height:48px"></div>
   =========================================================================== */
.ovtv-skeleton{
  background:linear-gradient(90deg,var(--ovtv-gray-100) 25%,var(--ovtv-gray-200) 37%,var(--ovtv-gray-100) 63%);
  background-size:400% 100%;animation:ovtv-shimmer 1.2s ease-in-out infinite;
  border-radius:8px;width:100%;height:16px;
}
.ovtv-skeleton + .ovtv-skeleton{margin-top:var(--ovtv-space-2);}
@keyframes ovtv-shimmer{0%{background-position:100% 0}100%{background-position:0 0}}
@media (prefers-reduced-motion:reduce){.ovtv-skeleton{animation:none}}

/* ===========================================================================
   STATUS BADGE  (6.5) — dot + pill
   =========================================================================== */
.ovtv-badge{display:inline-flex;align-items:center;gap:var(--ovtv-space-2);
  height:24px;padding:0 var(--ovtv-space-3);border-radius:var(--ovtv-radius-pill);
  font-size:12px;font-weight:600;line-height:1;}
.ovtv-badge::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;}
.ovtv-badge--online{background:var(--ovtv-success-50);color:#0c8a68;}
.ovtv-badge--offline{background:var(--ovtv-danger-50);color:var(--ovtv-danger-500);}
.ovtv-badge--pending{background:var(--ovtv-warning-50);color:#9a7400;}
.ovtv-badge--neutral{background:var(--ovtv-gray-100);color:var(--ovtv-gray-600);}

/* ===========================================================================
   KPI / STAT CARD  (6.5)
   =========================================================================== */
.ovtv-kpicard{display:flex;flex-direction:column;gap:var(--ovtv-space-2);
  padding:var(--ovtv-space-5);background:var(--ovtv-gray-0);border:1px solid var(--ovtv-gray-200);
  border-radius:var(--ovtv-radius-lg);box-shadow:var(--ovtv-shadow-xs);}
.ovtv-kpicard__icon{width:40px;height:40px;border-radius:var(--ovtv-radius-md);
  display:flex;align-items:center;justify-content:center;font-size:20px;
  background:var(--ovtv-brand-50);color:var(--ovtv-brand-500);}
.ovtv-kpicard__label{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--ovtv-gray-500);}
.ovtv-kpicard__value{font:700 28px/34px var(--ovtv-font);color:var(--ovtv-gray-900);font-variant-numeric:tabular-nums;}
.ovtv-kpicard__delta{font-size:13px;font-weight:600;display:inline-flex;align-items:center;gap:4px;}
.ovtv-kpicard__delta--up{color:#0c8a68;}
.ovtv-kpicard__delta--down{color:var(--ovtv-danger-500);}

/* ===========================================================================
   DAY CHIPS (tablet/mobile)  — origem: ScheduleGrid.module.css
   =========================================================================== */
.ovtv-chips{display:flex;gap:var(--ovtv-space-2);overflow-x:auto;padding:var(--ovtv-space-3) 0;}
.ovtv-chip{flex:0 0 auto;height:36px;padding:0 var(--ovtv-space-4);border-radius:var(--ovtv-radius-pill);
  font-size:13px;font-weight:600;border:1px solid var(--ovtv-gray-300);background:var(--ovtv-gray-0);color:var(--ovtv-gray-700);cursor:pointer;}
.ovtv-chip--active{background:var(--ovtv-brand-500);border-color:var(--ovtv-brand-500);color:#fff;}

/* ===========================================================================
   SCHEDULE GRID — DESKTOP MATRIX  — origem: ScheduleGrid.module.css
   =========================================================================== */
.ovtv-matrix__wrap{overflow-x:auto;border:1px solid var(--ovtv-gray-200);border-radius:var(--ovtv-radius-lg);}
.ovtv-matrix{--col-w:80px;min-width:calc(var(--col-w) * 24 + 64px);position:relative;}
.ovtv-matrix__head{display:flex;position:sticky;top:0;z-index:var(--ovtv-z-sticky);background:var(--ovtv-gray-50);}
.ovtv-matrix__corner{flex:0 0 64px;position:sticky;left:0;background:var(--ovtv-gray-50);}
.ovtv-matrix__hour{flex:0 0 var(--col-w);font-size:12px;color:var(--ovtv-gray-500);
  text-align:left;padding:var(--ovtv-space-2);border-left:1px solid var(--ovtv-gray-100);}
.ovtv-matrix__row{display:flex;border-top:1px solid var(--ovtv-gray-100);min-height:72px;}
.ovtv-matrix__day{flex:0 0 64px;position:sticky;left:0;background:var(--ovtv-gray-0);z-index:1;
  display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;
  color:var(--ovtv-gray-700);border-right:1px solid var(--ovtv-gray-200);}
.ovtv-matrix__track{position:relative;flex:1;background:repeating-linear-gradient(
  to right,transparent,transparent calc(var(--col-w) - 1px),var(--ovtv-gray-100) var(--col-w));
  cursor:pointer;}
.ovtv-block{position:absolute;top:8px;bottom:8px;display:flex;flex-direction:column;justify-content:center;
  gap:2px;padding:6px 8px;background:var(--ovtv-brand-50);border:1px solid var(--ovtv-gray-200);
  border-left:3px solid var(--ovtv-brand-500);border-radius:var(--ovtv-radius-sm);
  font-size:12px;text-align:left;overflow:hidden;cursor:grab;}
.ovtv-block:hover{box-shadow:var(--ovtv-shadow-sm);}
.ovtv-block__title{font-weight:600;color:var(--ovtv-gray-900);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ovtv-block__time{color:var(--ovtv-gray-500);font-variant-numeric:tabular-nums;}
.ovtv-block[data-conflict="true"]{border-left-color:var(--ovtv-danger-500);background:var(--ovtv-danger-50);}

/* ===========================================================================
   SCHEDULE GRID — MOBILE AGENDA  — origem: ScheduleGrid.module.css
   =========================================================================== */
.ovtv-agenda{position:relative;padding-bottom:80px;}
.ovtv-agenda__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--ovtv-space-3);}
.ovtv-agenda__empty{color:var(--ovtv-gray-500);font-size:14px;padding:var(--ovtv-space-6);text-align:center;}
.ovtv-agenda__card{display:flex;align-items:center;gap:var(--ovtv-space-3);width:100%;
  padding:var(--ovtv-space-3);border:1px solid var(--ovtv-gray-200);border-radius:var(--ovtv-radius-lg);
  background:var(--ovtv-gray-0);box-shadow:var(--ovtv-shadow-xs);text-align:left;cursor:pointer;}
.ovtv-agenda__thumb{flex:0 0 44px;height:44px;border-radius:var(--ovtv-radius-md);background:var(--ovtv-gray-200);}
.ovtv-agenda__info{display:flex;flex-direction:column;}
.ovtv-agenda__info strong{font-size:14px;color:var(--ovtv-gray-900);}
.ovtv-agenda__info small{font-size:12px;color:var(--ovtv-gray-500);font-variant-numeric:tabular-nums;}
.ovtv-fab{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));
  width:56px;height:56px;border-radius:50%;background:var(--ovtv-brand-500);color:#fff;
  font-size:28px;border:none;box-shadow:var(--ovtv-shadow-lg);cursor:pointer;z-index:var(--ovtv-z-sticky);
  display:flex;align-items:center;justify-content:center;}

/* ===========================================================================
   HELPERS de responsividade (espelham os breakpoints React useBreakpoint)
   =========================================================================== */
.ovtv-only-desktop{display:none;}
.ovtv-only-mobile{display:initial;}
@media (min-width:992px){
  .ovtv-only-desktop{display:initial;}
  .ovtv-only-mobile{display:none;}
}

/* ===========================================================================
   UNIFICAÇÃO DE COR — botões legados do tema (DashLite usa coral #e85347).
   Força os botões PRIMÁRIOS legados (.btn-primary / .btn-outline-primary) na cor
   de marca AZUL, nos 3 portais. Carrega depois do tema → vence; !important cobre
   os seletores do tema. NÃO afeta success/danger/warning (mantêm a semântica).
   =========================================================================== */
.btn-primary,
.btn-primary:focus,
.btn-primary.focus{
  background-color:var(--ovtv-brand-500)!important;
  border-color:var(--ovtv-brand-500)!important;
  color:#fff!important;
}
.btn-primary:hover{background-color:var(--ovtv-brand-600)!important;border-color:var(--ovtv-brand-600)!important;color:#fff!important;}
.btn-primary:active,.btn-primary.active,
.show>.btn-primary.dropdown-toggle{background-color:var(--ovtv-brand-700)!important;border-color:var(--ovtv-brand-700)!important;}
.btn-primary:disabled,.btn-primary.disabled{background-color:var(--ovtv-brand-500)!important;border-color:var(--ovtv-brand-500)!important;opacity:.5;}
.btn-outline-primary{border-color:var(--ovtv-brand-500)!important;color:var(--ovtv-brand-500)!important;}
.btn-outline-primary:hover,.btn-outline-primary:active,.btn-outline-primary.active{background-color:var(--ovtv-brand-500)!important;border-color:var(--ovtv-brand-500)!important;color:#fff!important;}

/* O tema tem --bs-primary:#1429ef (azul) MAS --bs-primary-rgb:133,79,255 (roxo) — descasados:
   o sólido fica azul e shadow/variante-clara/.bg-opacity ficam roxo/rosa no MESMO componente.
   Reapontar o -rgb p/ o azul de marca harmoniza tudo (botões, switches, tabs, paginação, links). */
:root{ --bs-primary-rgb:20,41,239; }
/* Itens primários comuns do tema que herdavam o coral/roxo → azul de marca */
.form-check-input:checked{background-color:var(--ovtv-brand-500)!important;border-color:var(--ovtv-brand-500)!important;}
.page-item.active .page-link,.pagination .active>.page-link{background-color:var(--ovtv-brand-500)!important;border-color:var(--ovtv-brand-500)!important;}
.nav-tabs .nav-link.active{color:var(--ovtv-brand-500)!important;border-color:var(--ovtv-brand-500)!important;}
a{color:var(--ovtv-brand-500);}
a:hover{color:var(--ovtv-brand-600);}

/* ===========================================================================
   DARK MODE — overrides globais p/ classes CLARAS recorrentes nas views
   (DashLite .dark-mode cobre seus próprios componentes; estas são classes
   próprias com #fff hardcoded em <style> de view). Só agem sob body.dark-mode.
   Especificidade body.dark-mode .x (0,2,1) vence o `.x{!important}` das views.
   =========================================================================== */
body.dark-mode .bg-white,
body.dark-mode .tableovertv,
body.dark-mode .table-head,
body.dark-mode .filter-container,
body.dark-mode .search,
body.dark-mode .select,
body.dark-mode .dropdown-indicator-device-status,
body.dark-mode .border-table,
body.dark-mode .card-inner,
body.dark-mode .dropdown-label{
  background-color:#172230 !important;
  color:var(--ovtv-gray-700) !important;
  border-color:#27323f !important;
}
body.dark-mode .table-head{ color:var(--ovtv-gray-500) !important; }
body.dark-mode .search::placeholder{ color:#8091a7 !important; }
body.dark-mode .search,
body.dark-mode .select,
body.dark-mode .dropdown-indicator-device-status{ color:var(--ovtv-gray-600) !important; }
/* títulos/rótulos com cor escura fixa nas views */
body.dark-mode .page-title,
body.dark-mode .main-text,
body.dark-mode .title-desc,
body.dark-mode .nk-block-title{ color:var(--ovtv-gray-900) !important; }
/* linhas de tabela escuras */
body.dark-mode .table-tranx tbody td{ color:var(--ovtv-gray-700) !important; border-color:#27323f !important; }
body.dark-mode .table-tranx tbody tr:hover td{ background:#1e2b3b !important; }
/* o kit (ovtv-card/ovtv-table) já flipa pelos --ovtv-gray-* dark */

/* ===========================================================================
   COMPONENTES BESPOKE (Admin/Anunciante) — peças reutilizáveis do kit
   =========================================================================== */

/* ---- SegmentedControl (seletor de período/segmento): pílula de opções ---- */
.ovtv-seg{display:inline-flex;background:var(--ovtv-gray-100);border:1px solid var(--ovtv-gray-200);
  border-radius:var(--ovtv-radius-pill);padding:3px;gap:2px;}
.ovtv-seg__item{appearance:none;border:none;background:transparent;cursor:pointer;
  font:600 13px/1 var(--ovtv-font);color:var(--ovtv-gray-600);padding:7px 14px;border-radius:var(--ovtv-radius-pill);
  white-space:nowrap;transition:background var(--ovtv-dur) var(--ovtv-ease),color var(--ovtv-dur) var(--ovtv-ease);}
.ovtv-seg__item:hover{color:var(--ovtv-gray-900);}
.ovtv-seg__item.is-active,.ovtv-seg__item[aria-selected="true"]{background:var(--ovtv-gray-0);color:var(--ovtv-brand-500);
  box-shadow:var(--ovtv-shadow-xs);}
@media (max-width:575.98px){ .ovtv-seg{overflow-x:auto;max-width:100%;} }

/* ---- BulkActionBar: barra contextual de ações em massa (aparece ao selecionar) ---- */
.ovtv-bulkbar{position:sticky;bottom:0;z-index:var(--ovtv-z-sticky);display:none;
  align-items:center;gap:var(--ovtv-space-3);flex-wrap:wrap;
  background:var(--ovtv-gray-900);color:#fff;border-radius:var(--ovtv-radius-lg);
  padding:var(--ovtv-space-3) var(--ovtv-space-4);box-shadow:var(--ovtv-shadow-lg);margin-top:var(--ovtv-space-3);}
.ovtv-bulkbar.is-visible{display:flex;}
.ovtv-bulkbar__count{font-weight:700;font-size:14px;}
.ovtv-bulkbar__count b{font-variant-numeric:tabular-nums;}
.ovtv-bulkbar__sep{flex:1;}
.ovtv-bulkbar .ovtv-btn--secondary{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.25);color:#fff;}
.ovtv-bulkbar .ovtv-btn--secondary:hover{background:rgba(255,255,255,.2);}
.ovtv-bulkbar__close{background:none;border:none;color:rgba(255,255,255,.7);font-size:20px;cursor:pointer;line-height:1;}
@media (max-width:767.98px){
  .ovtv-bulkbar{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));margin:0;}
  .ovtv-bulkbar__sep{flex-basis:100%;height:0;}
}

/* ---- EditableTable / EditableCell: matriz de inputs com estado dirty/erro/calc ---- */
.ovtv-editable input,.ovtv-editable select,.ovtv-editable .ovtv-cell{
  background:var(--ovtv-gray-0);border:1px solid var(--ovtv-gray-300);border-radius:var(--ovtv-radius-sm);
  padding:6px 8px;font:400 13px/1.2 var(--ovtv-font);color:var(--ovtv-gray-900);width:100%;
  font-variant-numeric:tabular-nums;transition:border-color var(--ovtv-dur) var(--ovtv-ease),box-shadow var(--ovtv-dur) var(--ovtv-ease);}
.ovtv-editable input:focus{outline:none;border-color:var(--ovtv-brand-500);box-shadow:var(--ovtv-focus-ring);}
.ovtv-editable--dirty input,.ovtv-editable input.is-dirty{border-color:var(--ovtv-warning-500);background:var(--ovtv-warning-50);}
.ovtv-editable--error input,.ovtv-editable input.is-error{border-color:var(--ovtv-danger-500);background:var(--ovtv-danger-50);}
.ovtv-cell--calc{background:var(--ovtv-gray-100);color:var(--ovtv-gray-600);border-style:dashed;cursor:not-allowed;
  display:flex;align-items:center;justify-content:flex-end;}
.ovtv-savebar{position:sticky;bottom:0;z-index:var(--ovtv-z-sticky);display:none;align-items:center;gap:var(--ovtv-space-3);
  background:var(--ovtv-warning-50);border:1px solid var(--ovtv-warning-500);border-radius:var(--ovtv-radius-md);
  padding:var(--ovtv-space-3) var(--ovtv-space-4);margin-top:var(--ovtv-space-3);color:#7a5b00;font-weight:600;font-size:13px;}
.ovtv-savebar.is-visible{display:flex;}

/* ---- NeighborhoodPicker: lista agrupada com busca + seleção + contagem ---- */
.ovtv-picker{border:1px solid var(--ovtv-gray-200);border-radius:var(--ovtv-radius-lg);overflow:hidden;background:var(--ovtv-gray-0);}
.ovtv-picker__search{display:flex;align-items:center;gap:var(--ovtv-space-2);padding:var(--ovtv-space-3);border-bottom:1px solid var(--ovtv-gray-200);}
.ovtv-picker__search input{flex:1;height:38px;border:1px solid var(--ovtv-gray-300);border-radius:var(--ovtv-radius-md);
  padding:0 12px;font:400 14px var(--ovtv-font);background:var(--ovtv-gray-0);color:var(--ovtv-gray-900);}
.ovtv-picker__list{max-height:340px;overflow-y:auto;}
.ovtv-picker__group{padding:var(--ovtv-space-2) var(--ovtv-space-3);position:sticky;top:0;background:var(--ovtv-gray-50);
  font:600 11px/1 var(--ovtv-font);text-transform:uppercase;letter-spacing:.04em;color:var(--ovtv-gray-500);
  display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--ovtv-gray-100);}
.ovtv-picker__item{display:flex;align-items:center;gap:var(--ovtv-space-3);padding:var(--ovtv-space-3);cursor:pointer;
  border-bottom:1px solid var(--ovtv-gray-100);}
.ovtv-picker__item:hover{background:var(--ovtv-gray-50);}
.ovtv-picker__item.is-selected{background:var(--ovtv-brand-50);}
.ovtv-picker__meta{margin-left:auto;font-size:12px;color:var(--ovtv-gray-500);font-variant-numeric:tabular-nums;}
.ovtv-picker__foot{padding:var(--ovtv-space-3);border-top:1px solid var(--ovtv-gray-200);font-size:13px;color:var(--ovtv-gray-700);
  display:flex;justify-content:space-between;align-items:center;}

/* ---- TreeNav: árvore de Categorias & Canais ---- */
.ovtv-tree,.ovtv-tree ul{list-style:none;margin:0;padding:0;}
.ovtv-tree ul{padding-left:var(--ovtv-space-5);}
.ovtv-tree__node{display:flex;align-items:center;gap:var(--ovtv-space-2);padding:6px 8px;border-radius:var(--ovtv-radius-sm);
  cursor:pointer;color:var(--ovtv-gray-700);font-size:14px;}
.ovtv-tree__node:hover{background:var(--ovtv-gray-100);}
.ovtv-tree__node.is-active{background:var(--ovtv-brand-50);color:var(--ovtv-brand-700);font-weight:600;}
.ovtv-tree__toggle{width:18px;text-align:center;color:var(--ovtv-gray-400);transition:transform var(--ovtv-dur) var(--ovtv-ease);}
.ovtv-tree__node.is-open .ovtv-tree__toggle{transform:rotate(90deg);}
.ovtv-tree__node[data-leaf="true"] .ovtv-tree__toggle{visibility:hidden;}

/* dark: superfícies dos componentes bespoke */
body.dark-mode .ovtv-seg{background:#0e1620;border-color:#27323f;}
body.dark-mode .ovtv-seg__item.is-active{background:#172230;}
body.dark-mode .ovtv-cell--calc{background:#0e1620;}
body.dark-mode .ovtv-picker__group{background:#0e1620;}

/* Recursos do Canal (Empresa): linha toggle + engrenagem de configurar, alinhada */
.ovtv-recurso-row{display:flex;align-items:center;gap:.5rem;margin-bottom:.625rem;}
.ovtv-recurso-row .custom-control.custom-switch{margin-bottom:0;}
@media (min-width:576px){ .ovtv-recurso-row .custom-control.custom-switch{min-width:270px;} }
.ovtv-cog{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;
  border:1px solid var(--ovtv-gray-200,#e5e7eb);border-radius:8px;background:var(--ovtv-gray-0);color:var(--ovtv-gray-500,#6b7280);
  cursor:pointer;flex:0 0 auto;transition:color .15s,border-color .15s,background .15s;}
.ovtv-cog:hover{color:#1429EF;border-color:#1429EF;background:#eef0ff;}
.ovtv-cog:focus-visible{outline:2px solid #1429EF;outline-offset:1px;}
.ovtv-cog svg{display:block;}
body.dark-mode .ovtv-cog{background:transparent;border-color:rgba(255,255,255,.15);color:#9ca3af;}
body.dark-mode .ovtv-cog:hover{color:#fff;border-color:#1429EF;background:rgba(20,41,239,.22);}
