/* IDMIX Tech 2.4.0 — aviso seguro, gabarito visual e novas verticais. */
:root{
  --platform-notice-h:0px;
  --tech-brand:#168bd2;
  --tech-brand-strong:#0d6fb5;
  --tech-icon-control:42px;
  --tech-icon-glyph:19px;
}

/* A faixa vive entre o topo fixo e o menu, reservando espaço no layout. */
html body .platform-notice-slot{
  position:fixed!important;
  top:var(--bp-topbar-h,64px)!important;
  right:0!important;
  left:0!important;
  z-index:650!important;
  display:grid!important;
  width:auto!important;
  min-width:0!important;
  pointer-events:none!important;
}
html body .platform-notice-slot:empty{display:none!important}
html body .platform-notice-slot .platform-notice{
  width:100%!important;
  min-height:42px!important;
  padding:6px clamp(12px,2vw,24px)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
  border:0!important;
  border-bottom:1px solid #a9c8ec!important;
  background:#eaf3ff!important;
  color:#163c6b!important;
  box-shadow:none!important;
  pointer-events:auto!important;
}
html body .platform-notice-slot .platform-notice.billing{background:#fff7da!important;border-color:#e6c866!important;color:#523d08!important}
html body .platform-notice-slot .platform-notice.billing:is(.overdue,.danger){background:#fff0f1!important;border-color:#e4a1aa!important;color:#711d2a!important}
html body .platform-notice-slot .platform-notice>div{min-width:0!important;display:flex!important;align-items:center!important;gap:9px!important}
html body .platform-notice-slot .platform-notice span{min-width:0!important;display:flex!important;flex-direction:row!important;align-items:baseline!important;gap:7px!important}
html body .platform-notice-slot .platform-notice b{flex:0 0 auto;font-size:12px!important;line-height:1.25!important}
html body .platform-notice-slot .platform-notice small{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:11px!important;line-height:1.25!important;color:inherit!important;opacity:.84!important}
html body .platform-notice-slot .platform-notice>.btn{margin-left:auto!important;min-height:32px!important;height:32px!important;padding:5px 10px!important;flex:0 0 auto!important}

@media(min-width:901px){
  html body .shell.menu-pos-top .app-menu{top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
  html body .shell.menu-pos-top>.main{padding-top:calc(var(--bp-topbar-h) + var(--platform-notice-h) + var(--bp-menu-h))!important}
  html body .shell.menu-pos-bottom>.main{padding-top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
  html body :is(.shell.menu-pos-left,.shell.menu-pos-right) .app-menu{
    top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important;
    height:calc(100dvh - var(--bp-topbar-h) - var(--platform-notice-h))!important;
  }
  html body .shell.menu-pos-left>.main{padding-top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
  html body .shell.menu-pos-right>.main{padding-top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
  html body:has(.platform-notice-slot:not(:empty)) #modal-root .modal-wrap{top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
}
@media(max-width:900px){
  html body :is(.shell.menu-pos-top,.shell.menu-pos-bottom,.shell.menu-pos-left,.shell.menu-pos-right)>.main{
    padding-top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important;
  }
  html body .shell.mobile-menu-top>.main{padding-top:calc(var(--bp-topbar-h) + var(--platform-notice-h) + 68px)!important}
  html body .shell.mobile-menu-top .mobile-nav{top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
  html body:has(.platform-notice-slot:not(:empty)) #modal-root .modal-wrap{top:calc(var(--bp-topbar-h) + var(--platform-notice-h))!important}
}
html body:has(.platform-notice-slot:not(:empty)) #toast-root{top:calc(var(--bp-topbar-h,64px) + var(--platform-notice-h) + 10px)!important}
html[data-menu-position="top"] body:has(.platform-notice-slot:not(:empty)) #toast-root{top:calc(var(--bp-topbar-h,64px) + var(--platform-notice-h) + var(--bp-menu-h,54px) + 10px)!important}
html body:has(.platform-notice-slot:not(:empty)){--bp-pdv-sticky-top:calc(var(--bp-topbar-h,64px) + var(--platform-notice-h) + 10px)}
html[data-menu-position="top"] body:has(.platform-notice-slot:not(:empty)){--bp-pdv-sticky-top:calc(var(--bp-topbar-h,64px) + var(--platform-notice-h) + var(--bp-menu-h,54px) + 10px)}

/* Controles nunca extrapolam o card; o JS recolhe apenas o rótulo sem perder acessibilidade. */
html body .btn{max-width:100%!important;min-width:0;box-sizing:border-box!important}
html body .btn>span{min-width:0;overflow:hidden;text-overflow:ellipsis}
html body :is(.actions,.page-actions,.card-head,.page-head,.master-control-actions){min-width:0}
html body :is(.actions,.page-actions,.master-control-actions){flex-wrap:wrap!important}
html body :is(.card-head,.page-head)>*{min-width:0}
html body .adaptive-icon-only{
  width:var(--tech-icon-control)!important;
  min-width:var(--tech-icon-control)!important;
  max-width:var(--tech-icon-control)!important;
  height:var(--tech-icon-control)!important;
  min-height:var(--tech-icon-control)!important;
  padding:0!important;
  gap:0!important;
  flex:0 0 var(--tech-icon-control)!important;
}
html body .adaptive-icon-only>span:not(.option-icon){display:none!important}
html body .adaptive-icon-only>.ui-icon{width:var(--tech-icon-glyph)!important;height:var(--tech-icon-glyph)!important;margin:0!important}
html body .table-wrap td .actions{width:max-content;max-width:280px}
html body .table-wrap td .actions .btn{flex:0 1 auto}
html body :is(.finance-period,.master-finance-filters,.finance-filters,.report-filter){min-width:0;grid-template-columns:repeat(auto-fit,minmax(145px,1fr))!important}
html body :is(.finance-period,.master-finance-filters,.finance-filters,.report-filter)>.btn{width:100%!important}
html body :is(.icon-btn,.icon-only,.top-btn,.top-user){min-width:42px!important;min-height:42px!important}

/* Datas mantêm leitura/digitação da esquerda para a direita em todos os módulos. */
html body input:is([type="date"],[type="datetime-local"],[type="time"]){direction:ltr!important;text-align:left!important;font-variant-numeric:tabular-nums!important}

/* Gabarito dos módulos verticais. */
html body .vertical-page{min-width:0}
html body .vertical-tabs{
  display:flex;
  gap:6px;
  width:100%;
  min-width:0;
  padding:6px;
  overflow-x:auto;
  border:1px solid var(--border,var(--tech-line));
  background:var(--surface,#fff);
  scrollbar-width:thin;
}
html body .vertical-tabs button{
  appearance:none;
  min-width:max-content;
  min-height:42px;
  padding:8px 14px;
  border:1px solid transparent;
  background:transparent;
  color:var(--muted,var(--tech-muted));
  font:inherit;
  font-size:12px;
  font-weight:750;
  cursor:pointer;
}
html body .vertical-tabs button:is(:hover,.active){border-color:color-mix(in srgb,var(--primary,#168bd2) 28%,var(--border));background:color-mix(in srgb,var(--primary,#168bd2) 9%,var(--surface));color:var(--primary,#168bd2)}
html body .vertical-kpis{align-items:stretch}
html body .vertical-kpis>.stat-card{min-height:128px}
html body .section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin:6px 0 12px}
html body .section-heading h2{margin:3px 0 0;font-size:21px}
html body .vertical-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
html body .vertical-record-card{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:16px;
  border:1px solid var(--border,var(--tech-line));
  background:var(--surface,#fff);
}
html body .vertical-record-card h3{margin:0;overflow-wrap:anywhere}
html body .vertical-record-card p{margin:0;color:var(--muted,var(--tech-muted));font-size:12px}
html body .vertical-record-card>.btn{margin-top:auto}
html body .vertical-metric-list{display:grid;gap:0;min-width:0}
html body .vertical-metric-list>div{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--border,var(--tech-line))}
html body .vertical-metric-list>div:last-child{border-bottom:0}
html body .vertical-metric-list span{min-width:0;color:var(--muted,var(--tech-muted));font-size:12px}
html body .vertical-metric-list span b,html body .vertical-metric-list span small{display:block}
html body .vertical-metric-list>div>b{text-align:right;overflow-wrap:anywhere}
html body .vertical-timeline{display:grid;gap:0}
html body .vertical-timeline>div{display:grid;grid-template-columns:12px minmax(0,1fr);gap:10px;padding:10px 0}
html body .vertical-timeline i{width:9px;height:9px;margin-top:5px;border-radius:50%;background:var(--primary,#168bd2)}
html body .vertical-timeline span{min-width:0;display:grid;gap:2px}
html body .vertical-timeline small{color:var(--muted,var(--tech-muted));overflow-wrap:anywhere}
html body .vertical-add-card{display:grid;gap:12px;padding:13px;border:1px dashed color-mix(in srgb,var(--primary,#168bd2) 45%,var(--border));background:color-mix(in srgb,var(--primary,#168bd2) 3%,var(--surface))}
html body .distribution-product-add{display:grid;grid-template-columns:minmax(190px,1fr) 120px 140px auto;align-items:end;gap:10px}
html body .vertical-total{display:flex;align-items:center;justify-content:flex-end;gap:12px;font-size:17px}
html body .vertical-total b{font-size:22px;color:var(--primary,#168bd2)}
html body .vertical-price{font-size:22px;color:var(--primary,#168bd2)}
html body .gym-plan-grid{grid-template-columns:repeat(auto-fill,minmax(245px,1fr))}

/* Central Master de manutenção. */
html body .maintenance-window-list{display:grid;gap:10px}
html body .maintenance-window-card{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  padding:17px;
  border:1px solid var(--border,var(--tech-line));
  border-left:4px solid #8ea6c0;
  background:var(--surface,#fff);
}
html body .maintenance-window-card.is-active{border-left-color:#dc3545;background:color-mix(in srgb,#dc3545 3%,var(--surface))}
html body .maintenance-window-main{min-width:0}
html body .maintenance-window-main h3{margin:8px 0 4px;overflow-wrap:anywhere}
html body .maintenance-window-main p{margin:0;color:var(--muted,var(--tech-muted));overflow-wrap:anywhere}
html body .maintenance-window-meta{display:flex;flex-wrap:wrap;gap:7px 16px;margin-top:11px;color:var(--muted,var(--tech-muted));font-size:11px}
html body .maintenance-window-meta span{display:inline-flex;align-items:center;gap:5px;min-width:0}
html body .maintenance-window-meta .ui-icon{width:15px;height:15px}
html body .maintenance-window-actions{justify-content:flex-end}
html body .maintenance-auto-extend{display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:start!important;gap:10px!important;padding:13px;border:1px solid var(--border,var(--tech-line));background:color-mix(in srgb,var(--primary,#168bd2) 4%,var(--surface))}
html body .maintenance-auto-extend span{display:grid;gap:3px}
html body .maintenance-auto-extend small{color:var(--muted,var(--tech-muted));font-size:11px}

/* Configuração do cliente: mesma malha e hierarquia do Master. */
html body .settings-page>.settings-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;align-items:start!important}
html body .settings-page>.settings-grid>.settings-group{grid-column:1/-1!important}
html body .settings-page .settings-group-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
html body .settings-page .settings-group-grid>*{min-width:0}

@media(max-width:900px){
  html body .platform-notice-slot .platform-notice{padding:6px 10px!important}
  html body .platform-notice-slot .platform-notice span{display:grid!important;gap:1px!important}
  html body .platform-notice-slot .platform-notice b{font-size:11px!important}
  html body .platform-notice-slot .platform-notice small{font-size:10px!important}
  html body .distribution-product-add{grid-template-columns:1fr 1fr!important}
  html body .distribution-product-add>div:first-child{grid-column:1/-1}
  html body .distribution-product-add>.btn{width:100%}
  html body .settings-page>.settings-grid,html body .settings-page .settings-group-grid{grid-template-columns:1fr!important}
}
@media(max-width:620px){
  html body .platform-notice-slot .platform-notice>.btn{width:32px!important;min-width:32px!important;max-width:32px!important;padding:0!important;font-size:0!important}
  html body .platform-notice-slot .platform-notice>.btn>span{display:none!important}
  html body .platform-notice-slot .platform-notice small{max-width:calc(100vw - 88px)}
  html body .maintenance-window-card{grid-template-columns:1fr}
  html body .maintenance-window-actions{width:100%;justify-content:flex-start}
  html body .vertical-card-grid{grid-template-columns:1fr}
  html body .distribution-product-add{grid-template-columns:1fr!important}
  html body .distribution-product-add>div:first-child{grid-column:auto}
  html body .vertical-total{justify-content:space-between}
}

@media(prefers-reduced-motion:reduce){html body .platform-notice-slot,html body .vertical-tabs button{transition:none!important}}
