/* CoreDiet global UI layer v100 - admin/config style unificado */
:root{
  --cd-ui-bg:#F5F9FD;
  --cd-ui-surface:#FFFFFF;
  --cd-ui-surface-2:#F8FBFF;
  --cd-ui-border:#DDE8F4;
  --cd-ui-border-2:#E7EEF7;
  --cd-ui-title:#1F334A;
  --cd-ui-text:#263A52;
  --cd-ui-muted:#64748B;
  --cd-ui-soft:#EEF5FF;
  --cd-ui-blue:#0B5ED7;
  --cd-ui-blue-2:#2563EB;
  --cd-ui-success:#059669;
  --cd-ui-danger:#DC2626;
  --cd-ui-warning:#B7791F;
  --cd-ui-radius:16px;
  --cd-ui-radius-sm:12px;
  --cd-ui-font:'Montserrat','DM Sans','Sora',Arial,sans-serif;
}

html.cd-ui-global-v100 body.cd-core-internal{
  background:var(--cd-ui-bg)!important;
  color:var(--cd-ui-text)!important;
  font-family:var(--cd-ui-font)!important;
  font-size:13.25px!important;
  line-height:1.38!important;
  font-weight:600!important;
  letter-spacing:-.01em;
}

html.cd-ui-global-v100 body.cd-core-internal *{
  box-sizing:border-box;
}

html.cd-ui-global-v100 body.cd-core-internal :where(h1,h2,h3,h4,h5,h6,.page-title,.section-title,.card-title,.panel-title,.widget-title,.core-title,.titulo,.titulo-pagina,.cd-title,.mld-title,.hist-title,.modal-title,.modal-title-sm){
  color:var(--cd-ui-title)!important;
  font-family:var(--cd-ui-font)!important;
  font-weight:750!important;
  letter-spacing:-.025em!important;
}

html.cd-ui-global-v100 body.cd-core-internal h1{font-size:1.22rem!important;line-height:1.18!important;}
html.cd-ui-global-v100 body.cd-core-internal h2{font-size:1.08rem!important;line-height:1.20!important;}
html.cd-ui-global-v100 body.cd-core-internal h3{font-size:.98rem!important;line-height:1.22!important;}
html.cd-ui-global-v100 body.cd-core-internal h4{font-size:.90rem!important;line-height:1.24!important;}

html.cd-ui-global-v100 body.cd-core-internal :where(p,small,.subtitle,.subtitulo,.card-subtitle,.section-subtitle,.muted,.text-muted,.descricao,.description){
  color:var(--cd-ui-muted)!important;
  font-weight:600!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.card,.core-card,.cd-card,.cd-card-topo,.mld-card,.admin-card,.dashboard-card,.metric-card,.kpi-card,.stat-card,.info-card,.panel,.box-card,.content-card,.table-container,.assinatura-central-card,.assinatura-info-card,.assinatura-progress,.plan-info-card,.plan-status-modal-item,.billing-card,.billing-box,.settings-card,.config-card,.consulta-card,.feedback-card,.marketing-card,.ticket-card,.equipe-card){
  background:var(--cd-ui-surface)!important;
  border:1px solid var(--cd-ui-border)!important;
  border-radius:var(--cd-ui-radius)!important;
  box-shadow:none!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.card-header,.panel-header,.section-header,.table-header,.box-header,.assinatura-central-top,.billing-card-header){
  border-color:var(--cd-ui-border-2)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.badge,.pill,.chip,.tag,.status-badge,.cd-badge,.badge-unit):not(#diet-meals-container *){
  border-radius:999px!important;
  font-size:.70rem!important;
  font-weight:750!important;
  letter-spacing:-.01em!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.btn,.button,.core-btn,.cd-btn,.mld-btn,.modal-btn,.modal-btn-outline,.btn-primary,.btn-secondary,.btn-outline,.mini-btn,.action-btn,.btn-topbar,.docs-filter-btn,.kit-btn):not(#diet-meals-container *):not(.mld-btn-act){
  min-height:34px;
  border-radius:12px!important;
  font-family:var(--cd-ui-font)!important;
  font-size:.78rem!important;
  font-weight:750!important;
  letter-spacing:-.01em!important;
  box-shadow:none!important;
}

html.cd-ui-global-v100 body.cd-core-internal button{
  font-family:var(--cd-ui-font)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(input,select,textarea):not(#diet-meals-container *):not([type='checkbox']):not([type='radio']){
  border:1px solid var(--cd-ui-border)!important;
  border-radius:12px!important;
  background:#fff!important;
  color:var(--cd-ui-text)!important;
  font-family:var(--cd-ui-font)!important;
  font-size:.82rem!important;
  font-weight:650!important;
  box-shadow:none!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(input,select,textarea):not(#diet-meals-container *):focus{
  border-color:#BFD8FF!important;
  outline:none!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.08)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(table):not(.fc-scrollgrid){
  color:var(--cd-ui-text)!important;
  font-family:var(--cd-ui-font)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(th):not(.fc-col-header-cell){
  color:#5F7188!important;
  background:#F8FBFF!important;
  font-size:.70rem!important;
  font-weight:800!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
  border-color:var(--cd-ui-border-2)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(td):not(.fc-daygrid-day):not(.fc-timegrid-slot){
  color:var(--cd-ui-text)!important;
  font-size:.82rem!important;
  font-weight:600!important;
  border-color:#EDF2F8!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.modal-content,.modal-box,.modal-card,.swal2-popup,.core-modal,.modal-dialog .modal-content){
  background:#fff!important;
  border:1px solid var(--cd-ui-border)!important;
  border-radius:18px!important;
  box-shadow:0 18px 50px rgba(15,44,89,.12)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.modal-backdrop,.core-modal-backdrop){
  backdrop-filter:blur(8px);
}

/* topo padrão das páginas internas */
html.cd-ui-global-v100 body.cd-core-internal :where(.cd-card-topo,.core-topo-card,.topo-card,.page-top-card){
  background:#fff!important;
  border:1px solid var(--cd-ui-border)!important;
  border-radius:18px!important;
  box-shadow:none!important;
}

/* topo do paciente */
html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-header-card{
  background:#fff!important;
  border:1px solid var(--cd-ui-border)!important;
  border-radius:18px!important;
  box-shadow:none!important;
}

html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-name{
  color:#255EC6!important;
  font-size:.94rem!important;
  font-weight:800!important;
  letter-spacing:-.02em!important;
}

html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-actions{
  display:inline-flex!important;
  align-items:center!important;
  gap:11px!important;
  flex-wrap:nowrap!important;
  line-height:1!important;
}

html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-action{
  width:20px!important;
  min-width:20px!important;
  max-width:20px!important;
  height:20px!important;
  min-height:20px!important;
  max-height:20px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#2563EB!important;
}

html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-action i,
html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-action i::before{
  color:#2563EB!important;
  font-size:15px!important;
  line-height:1!important;
  font-weight:400!important;
  transform:none!important;
}

html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-resumo-text,
html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-resumo-caret,
html.cd-ui-global-v100 body.cd-core-internal #cabecalho-container .cd-paciente-action.resumo::after{
  display:none!important;
  content:none!important;
}

/* abas horizontais */
html.cd-ui-global-v100 body.cd-core-internal :where(.tabs,.nav-tabs,.cd-tabs,.mld-tabs){
  border-color:var(--cd-ui-border-2)!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.tab,.nav-link,.cd-tab,.cd-gami-tab):not(.active):not([aria-selected='true']){
  color:#65778D!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.tab.active,.nav-link.active,.cd-tab.active,.cd-gami-tab.active,.tab[aria-selected='true'],.nav-link[aria-selected='true']){
  background:#EEF5FF!important;
  color:#075FCC!important;
  border-color:#D8E8FF!important;
  box-shadow:none!important;
}

/* menus laterais */
html.cd-ui-global-v100 body.cd-core-internal :where(#sidebar,.sidebar,.side-menu,.menu-lateral,.app-sidebar){
  box-shadow:none!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.menu-item,.sidebar-item,.nav-item a,.sidebar a){
  font-family:var(--cd-ui-font)!important;
}

/* cartões/indicadores do admin e configurações */
html.cd-ui-global-v100 body.cd-core-admin-page :where(.kpi,.kpi-card,.metric-card,.decision-card,.retention-card,.summary-card),
html.cd-ui-global-v100 body.cd-core-nutri-page :where(.billing-card,.assinatura-info-card,.plan-info-card,.usage-card){
  min-height:86px;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.kpi-label,.metric-label,.billing-label,.card-label,.label,.field-label){
  color:#60748A!important;
  font-size:.70rem!important;
  font-weight:800!important;
  letter-spacing:.07em!important;
  text-transform:uppercase!important;
}

html.cd-ui-global-v100 body.cd-core-internal :where(.kpi-value,.metric-value,.billing-val,.value,.numero,.number){
  color:#10233B!important;
  font-weight:800!important;
  letter-spacing:-.03em!important;
}

/* planejamento: preservar o layout específico já ajustado */
html.cd-ui-global-v100 body.cd-aba-planejamento #diet-meals-container :where(.mld-food-name,span[id^='fname-']){
  color:#1F334A!important;
}

html.cd-ui-global-v100 body.cd-aba-planejamento #diet-type-selector .cd-diet-btn{
  border-radius:12px!important;
  box-shadow:none!important;
}

/* app webview: escala menor para ficar com cara de app */
html.cd-ui-global-v100 body.cd-core-app-page{
  font-size:13px!important;
}

html.cd-ui-global-v100 body.cd-core-app-page :where(.card,.app-card,.page-card,.panel){
  border-radius:16px!important;
  box-shadow:none!important;
}

@media(max-width:900px){
  html.cd-ui-global-v100 body.cd-core-internal{
    font-size:13px!important;
  }
  html.cd-ui-global-v100 body.cd-core-internal :where(h1){font-size:1.12rem!important;}
  html.cd-ui-global-v100 body.cd-core-internal :where(h2){font-size:1.02rem!important;}
  html.cd-ui-global-v100 body.cd-core-internal :where(.card,.core-card,.cd-card,.mld-card,.admin-card,.dashboard-card,.metric-card,.kpi-card,.stat-card,.info-card,.panel,.table-container){
    border-radius:14px!important;
  }
}

@media(max-width:620px){
  html.cd-ui-global-v100 body.cd-core-internal{
    font-size:12.75px!important;
  }
  html.cd-ui-global-v100 body.cd-core-internal :where(.btn,.button,.core-btn,.cd-btn,.mld-btn,.modal-btn,.mini-btn,.action-btn):not(#diet-meals-container *):not(.mld-btn-act){
    min-height:32px;
    font-size:.75rem!important;
  }
  html.cd-ui-global-v100 body.cd-core-internal :where(input,select,textarea):not(#diet-meals-container *):not([type='checkbox']):not([type='radio']){
    min-height:34px;
    font-size:.78rem!important;
  }
}
