/* Marketing StarNails — Fase 6.3 UX Premium
   Calibrado para uso padrão do Chrome em 100%.
   Os prints de validação da fase anterior estavam em 90%; por isso esta camada
   reduz densidade e alturas também no zoom real de produção, sem usar zoom/scale. */

:root {
  --st-page-gap: 14px;
  --st-section-gap: 12px;
  --st-topbar-height: 64px;
  --st-sidebar-width: 232px;
  --st-control-height-md: 38px;
  --st-control-height-sm: 32px;
}

/* Estrutura global: mais conteúdo útil a 100% */
.app { grid-template-columns: var(--st-sidebar-width) minmax(0,1fr); }
.sidebar { padding: 12px 12px 10px; }
.brand-block { padding: 7px 7px 14px; }
.brand-logo-wrap { height: 91px; margin-bottom: 4px; }
.brand-logo { width: 158px; height: 88px; }
.brand-name { font-size: 19px; }
.brand-sub { font-size: 11px; }
.nav { gap: 2px; padding-top: 12px; }
.nav-button { min-height: 39px; padding: 9px 11px; gap: 9px; border-radius: 9px; font-size: 14px; }
.nav-icon { width: 18px; min-width: 18px; font-size: 15px; }
.sidebar-footer { padding: 10px 10px 2px; font-size: 10px; }
.topbar { height: var(--st-topbar-height); padding: 0 24px; }
.page-title { font-size: 18px; }
.page-subtitle { font-size: 11px; }
.phase-badge { padding: 7px 10px; font-size: 11px; }
.main { max-width: 1680px; padding: 20px 24px 28px; }
.page.active { gap: var(--st-page-gap); }
.section-heading { min-height: 60px; margin: 0; padding: 0 2px 12px; align-items: center; }
.section-heading h1 { font-size: 24px; }
.section-heading p { font-size: 14px; margin-top: 4px; }

/* Menos contorno decorativo; dourado fica reservado a ações e estados */
.hero,.card,.panel,.mini,.health-card,.optout-kpi,.sync,.opportunity,
.campaign-row,.template-card,.preview-box,.whatsapp-box,.metric {
  border-color: #e5e1d9 !important;
  box-shadow: 0 3px 12px rgba(31,35,41,.045);
}
.hero { padding: 17px 18px; background: #fff; }
.hero h1 { font-size: 25px; }
.hero .grid { margin-top: 13px; }
.panel { padding: 16px; }
.card { padding: 14px 15px; }
.panel h2,.section-title { font-size: 17px; }
.muted { line-height: 1.35; }

/* KPIs executivos: compactos, números dominantes */
.grid,.crm-grid,.health-grid,.optout-kpis { gap: 10px; }
.card,.mini,.health-card,.optout-kpi,.metric {
  min-height: 80px;
  justify-content: center;
}
.label,.mini span,.health-card span,.optout-kpi span,.metric small {
  font-size: 10px;
  letter-spacing: .065em;
}
.value,.mini strong,.health-card strong,.optout-kpi strong {
  margin-top: 5px;
  font-size: 22px;
}
.executive-grid { gap: 8px; margin-top: 10px; }
.executive-grid .mini { min-height: 72px; padding: 11px 12px; }
.executive-grid .mini strong { font-size: 17px; }
.readiness { margin-top: 10px; padding: 10px 12px; }

/* Dashboard: agrupa sem grandes vazios */
#dashboard-page .hero { margin-bottom: 0; }
#dashboard-page .crm { margin-top: 12px; }
#dashboard-page .crm-head { margin-bottom: 10px; align-items: center; }
#dashboard-page .crm-grid { margin-top: 10px; }
#dashboard-page .panel { padding: 16px 18px; }

/* Botões, filtros e formulários */
button,.button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
button.secondary,button.danger { min-height: 36px; }
input:not([type="checkbox"]):not([type="radio"]),select,textarea {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}
.search,.template-toolbar { margin: 10px 0; gap: 7px; }
.campaign-form,.template-form,.protection-form { gap: 8px; }
.campaign-form label,.template-form label,.protection-form label { gap: 4px; }
.actions { margin-top: 11px; gap: 7px; }

/* Clientes: leitura mais densa sem apertar demais */
#customers-page .panel { padding: 14px 16px; }
.customers th,.customers td,.optout-table th,.optout-table td,
.health-table th,.health-table td,.table-wrap th,.table-wrap td {
  padding: 8px 10px;
  font-size: 12px;
}
.customers th,.optout-table th,.health-table th,.table-wrap th { font-size: 10px; }
.pill,.template-meta-chip,.classification-badge,.rfm-badge { padding: 4px 7px; font-size: 10px; }

/* Oportunidades: mais cards visíveis por tela */
.opportunities { gap: 10px; }
.opportunity { min-height: 170px; padding: 13px 14px; display:flex; flex-direction:column; }
.opportunity h3 { margin: 4px 0; font-size: 15px; }
.opportunity p { margin: 2px 0 4px; font-size: 13px; line-height: 1.35; }
.opportunity-count { margin: 8px 0; font-size: 25px; }
.opportunity button { min-height: 34px; padding: 6px 10px; margin-top:auto; align-self:flex-start; }
.priority { font-size: 9px; }

/* Templates: reduz rolagem e mantém editor útil */
.template-layout { grid-template-columns:minmax(0,1.12fr) minmax(360px,.88fr); gap:12px; }
.template-list-panel,.template-editor-panel { padding: 12px; }
.template-editor-panel { top: calc(var(--st-topbar-height) + 12px); max-height:calc(100vh - var(--st-topbar-height) - 24px); }
.template-toolbar { grid-template-columns:minmax(190px,1fr) 180px 140px auto; }
.template-card { padding: 10px 11px; }
.template-card + .template-card { margin-top: 7px; }
.template-card h3 { font-size: 15px; margin-bottom: 2px; }
.template-card p { margin: 5px 0; font-size: 12px; }
.template-card .muted { font-size: 11px; }
.template-status { padding: 4px 7px; font-size: 10px; }
.template-actions button { min-height: 31px; padding: 5px 8px; font-size: 11px; }
.template-form textarea { min-height: 118px; }
.variable-buttons button { padding: 4px 6px; font-size: 10px; }
.template-preview { min-height: 74px; padding: 9px 11px; font-size: 12px; }

/* Campanhas: conexão compacta e QR integrado */
.whatsapp-box { min-height: 150px; padding: 14px 16px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:18px; }
.whatsapp-qr { width: 158px; height: 158px; padding: 8px; }
.whatsapp-status { font-size: 16px; }
.campaign-layout { grid-template-columns:minmax(0,1.08fr) minmax(350px,.92fr); gap:12px; }
.campaign-row { padding: 11px 12px; }
.campaign-row h3 { font-size: 15px; }
.campaign-meta { margin-top: 7px; }
.campaign-actions { margin-top: 9px; }
.campaign-form textarea { min-height: 112px; }

/* Saúde do WhatsApp */
.risk-banner { padding: 11px 14px; margin-bottom: 0; }
.health-grid { margin: 0; }
.health-card { min-height: 78px; padding: 13px 14px; }
.health-card strong { font-size: 21px; }
#whatsapp-health-page .panels { gap: 12px; }
#whatsapp-health-page .status-line { padding: 9px 0; }

/* Configurações: grupos mais claros e sem altura artificial */
#settings-page .protection-layout { gap: 12px; }
#settings-page .panel { min-height: 0; }
#settings-page .status-line { padding: 9px 0; }
#settings-page textarea { min-height: 108px; }
#settings-page input[type="checkbox"] { width: 18px; height: 18px; }

/* Listas e linhas gerais */
.list-row,.status-line,.diagnostic-check { min-height: 38px; padding: 8px 0; }
.sync { padding: 10px 11px; }
.sync-grid { gap: 8px; margin-top: 10px; }
.notice,.risk-banner,.readiness,.modal-message { padding: 10px 12px; }

/* 100% em notebook/desktop estreito: preserva densidade sem hacks de escala */
@media (max-width: 1440px) {
  :root { --st-sidebar-width: 220px; }
  .main { padding-inline: 20px; }
  .nav-button { font-size: 13px; }
  .grid,.crm-grid,.health-grid { gap: 8px; }
  .campaign-layout,.template-layout { grid-template-columns:minmax(0,1fr) minmax(340px,.82fr); }
}

@media (max-width: 1180px) {
  .opportunities { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .campaign-layout,.template-layout,.audience-layout { grid-template-columns:1fr; }
  .template-editor-panel { position:static; max-height:none; }
  .whatsapp-box { grid-template-columns:1fr auto; }
}

@media (max-width: 860px) {
  :root { --st-topbar-height:60px; }
  .main { padding:16px 14px 24px; }
  .section-heading { min-height:0; }
}

@media (max-width: 620px) {
  .opportunities { grid-template-columns:1fr; }
  .whatsapp-box { grid-template-columns:1fr; }
  .whatsapp-qr { width:145px; height:145px; }
  .card,.mini,.health-card,.optout-kpi { min-height:72px; }
}
