/* Studio CRM 10.37.35 — Painel de detalhes premium aprovado */
.agenda-v31-details.drawer-open .selected-date-content{
  gap:0!important;
  padding:10px 12px 82px!important;
  background:#fff!important;
}

/* Cabeçalho: limpo, fixo e com hierarquia mais forte */
.agenda-v31-details.drawer-open .selected-date-header{
  position:sticky!important;top:0;z-index:12;
  background:rgba(255,255,255,.97)!important;
  backdrop-filter:blur(10px);
  padding:14px 14px 13px!important;
  box-shadow:0 1px 0 #e8edf2;
}
.agenda-v31-details.drawer-open .selected-date-header .eyebrow{font-size:8px!important;letter-spacing:.8px!important;color:#d60000!important}
.agenda-v31-details.drawer-open .selected-date-header h2{font-size:16px!important;line-height:1.28!important;margin-top:6px!important;color:#111827!important}
.agenda-v31-details.drawer-open .selected-date-header p{font-size:8px!important;color:#6b7280!important}
.agenda-v31-details.drawer-open .selected-date-add-button{min-height:36px!important;border-radius:9px!important;padding:0 12px!important}

/* Seletor do dia mais compacto */
.agenda-v31-details.drawer-open .agenda-day-selector-list{margin:0 0 10px!important;gap:5px!important;max-height:118px!important}
.agenda-v31-details.drawer-open .agenda-day-selector-item{min-height:40px!important;padding:7px 9px!important;border-radius:8px!important}

/* ==========================================================
   BLOCO 1 — RESUMO DO COMPROMISSO
   Card do evento + metadados + ações formam um único conjunto.
   ========================================================== */
.agenda-v31-details.drawer-open .premium-appointment-card{
  order:10;
  margin:0!important;
  grid-template-columns:64px minmax(0,1fr)!important;
  border:1px solid #cfe0f2!important;
  border-left:4px solid #72b8eb!important;
  border-radius:14px 14px 0 0!important;
  background:linear-gradient(135deg,#eef7ff 0%,#dfeffc 100%)!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-time{
  background:rgba(255,255,255,.72)!important;
  border-right:1px solid #d7e5f2!important;
  padding:14px 6px!important;
}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-time strong{font-size:14px!important;color:#111827!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-time span{font-size:7px!important;color:#7c8796!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-content{padding:13px 12px 12px!important;background:transparent!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-type{font-size:7px!important;letter-spacing:.75px!important;color:#d60000!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-heading h3{margin-top:5px!important;font-size:12px!important;line-height:1.35!important;color:#111827!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-status{padding:5px 8px!important;font-size:7px!important;background:#eef6ff!important;color:#2463c7!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-information{
  grid-template-columns:1fr 1fr!important;
  gap:9px 8px!important;
  margin-top:12px!important;
  padding-top:10px!important;
  border-top:1px solid #d5e4f1!important;
}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-information div{gap:6px!important;align-items:flex-start!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-information span{white-space:normal!important;font-size:8px!important;line-height:1.35!important;color:#596579!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-information svg{color:#1672da!important;width:14px!important;height:14px!important}
.agenda-v31-details.drawer-open .premium-appointment-card .appointment-description{margin-top:9px!important;background:rgba(255,255,255,.55)!important;border:1px solid #dbe9f4!important}

/* Metadados deixam de parecer um segundo card */
.agenda-v31-details.drawer-open .agenda-compact-info{
  order:11;
  margin:0!important;
  border:1px solid #cfe0f2!important;
  border-top:0!important;
  border-radius:0!important;
  padding:8px 12px 10px!important;
  background:linear-gradient(135deg,#eef7ff 0%,#e6f3fd 100%)!important;
}
.agenda-v31-details.drawer-open .agenda-compact-info>strong{display:none!important}
.agenda-v31-details.drawer-open .agenda-compact-info-grid{
  grid-template-columns:1fr 1fr!important;
  gap:5px 10px!important;
  margin:0!important;
  padding-top:8px!important;
  border-top:1px solid #d5e4f1!important;
}
.agenda-v31-details.drawer-open .agenda-compact-info-grid span{font-size:7.5px!important;color:#6b7788!important;line-height:1.35!important}
.agenda-v31-details.drawer-open .agenda-compact-info-grid b{color:#334155!important;font-weight:800!important}
.agenda-v31-details.drawer-open .agenda-compact-observation{grid-column:1/-1!important;border-top:1px solid #d9e6f0!important;padding-top:6px!important}

/* Ações do compromisso passam a fechar o mesmo conjunto visual */
.agenda-v31-details.drawer-open .agenda-detail-actions-compact{
  order:12;
  margin:0 0 10px!important;
  padding:9px 10px 10px!important;
  border:1px solid #cfe0f2!important;
  border-top:0!important;
  border-radius:0 0 14px 14px!important;
  background:linear-gradient(135deg,#eef7ff 0%,#e6f3fd 100%)!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
}
.agenda-v31-details.drawer-open .agenda-detail-actions-compact .secondary-button,
.agenda-v31-details.drawer-open .agenda-detail-actions-compact a{
  min-height:32px!important;border-radius:8px!important;font-size:8px!important;
  background:#fff!important;border:1px solid #d4dee9!important;color:#344054!important;
  box-shadow:0 1px 2px rgba(16,24,40,.03)!important;
}
.agenda-v31-details.drawer-open .agenda-detail-actions-compact .agenda-action-edit{border-color:#c7d7e8!important}
.agenda-v31-details.drawer-open .agenda-detail-actions-compact .agenda-google-open{grid-column:auto!important;color:#1557a8!important;border-color:#bfd4ea!important}
.agenda-v31-details.drawer-open .agenda-detail-actions-compact .agenda-action-complete{color:#166534!important;border-color:#b9dfc6!important}
.agenda-v31-details.drawer-open .agenda-detail-actions-compact .danger{grid-column:auto!important;color:#b42318!important;border-color:#f0c6c3!important}

/* ==========================================================
   BLOCO 2 — AUTOMAÇÃO WHATSAPP
   ========================================================== */
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-card{
  order:20;
  margin:0 0 10px!important;
  border:1px solid #bfe4cc!important;
  border-radius:14px!important;
  padding:13px!important;
  background:linear-gradient(180deg,#fbfffc 0%,#f6fcf8 100%)!important;
  box-shadow:0 2px 8px rgba(19,122,54,.04)!important;
}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-head{align-items:flex-start!important;gap:8px!important;padding-bottom:9px!important;border-bottom:1px solid #dcece1!important}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-head>div:before{content:"◉";display:inline-block;margin-right:6px;color:#159447;font-size:11px}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-head strong{font-size:12px!important;color:#15251b!important}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-head small{font-size:7.5px!important;margin-top:4px!important;color:#66746b!important}
.agenda-v31-details.drawer-open .agenda-auto-ready,.agenda-v31-details.drawer-open .agenda-auto-review{padding:5px 8px!important;font-size:6.5px!important}

.agenda-v31-details.drawer-open .agenda-whatsapp-classification-slot{margin-top:10px!important}
.agenda-v31-details.drawer-open .agenda-auto-classification{border-top:0!important;padding-top:0!important}
.agenda-v31-details.drawer-open .agenda-auto-classification-label{font-size:8px!important;margin-bottom:7px!important;color:#45564b!important}
.agenda-v31-details.drawer-open .agenda-auto-classification-actions{display:grid!important;grid-template-columns:1.15fr .9fr .75fr!important;gap:6px!important}
.agenda-v31-details.drawer-open .agenda-auto-classification-actions button{
  min-height:31px!important;border-radius:9px!important;padding:5px 7px!important;font-size:8px!important;
}
.agenda-v31-details.drawer-open .agenda-auto-classification-actions button.active-acompanhamento{background:#159447!important;border-color:#159447!important;color:#fff!important}

/* Nome / telefone / contatos / salvar: duas linhas claras */
.agenda-v31-details.drawer-open .agenda-auto-phone-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:6px!important;
  margin-top:9px!important;
}
.agenda-v31-details.drawer-open .agenda-auto-phone-row input{
  min-height:34px!important;padding:7px 9px!important;border-radius:9px!important;background:#fff!important;font-size:9px!important;
}
.agenda-v31-details.drawer-open .agenda-contact-search-btn,
.agenda-v31-details.drawer-open .agenda-auto-phone-row [data-save-contact]{
  min-height:34px!important;border-radius:9px!important;font-size:8px!important;padding:7px 8px!important;
}
.agenda-v31-details.drawer-open .agenda-contact-search-btn{grid-column:1/2!important;background:#fff!important;color:#344054!important;border:1px solid #d7dde5!important}
.agenda-v31-details.drawer-open .agenda-auto-phone-row [data-save-contact]{grid-column:2/3!important;background:#159447!important;color:#fff!important;border:1px solid #159447!important}
.agenda-v31-details.drawer-open .agenda-auto-rule-note{font-size:7px!important;line-height:1.4!important;margin-top:7px!important;color:#7a8492!important}

/* Informações viram lista, não quatro mini-cards */
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-grid{
  display:grid!important;grid-template-columns:1fr!important;gap:0!important;margin-top:10px!important;
  background:#fff!important;border:1px solid #e3ebe6!important;border-radius:10px!important;overflow:hidden!important;
}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-grid span{
  display:grid!important;grid-template-columns:92px minmax(0,1fr)!important;align-items:center!important;
  gap:8px!important;padding:8px 9px!important;border:0!important;border-bottom:1px solid #edf1ee!important;
  border-radius:0!important;background:#fff!important;font-size:7.5px!important;color:#7a8492!important;
}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-grid span:last-child{border-bottom:0!important}
.agenda-v31-details.drawer-open .agenda-whatsapp-automation-grid b{font-size:8px!important;color:#1f2937!important;text-align:left!important;white-space:normal!important}

.agenda-v31-details.drawer-open .agenda-open-whatsapp-automation{
  min-height:38px!important;margin-top:10px!important;border-radius:9px!important;background:#15803d!important;font-size:9px!important;
}
.agenda-v31-details.drawer-open .agenda-auto-help{font-size:7px!important;margin-top:7px!important}

/* Ações rápidas e alertas ficam secundários */
.agenda-v31-details.drawer-open .agenda-quick-actions-compact{order:30;margin:0 0 10px!important;background:#fff!important;padding:10px!important}
.agenda-v31-details.drawer-open .agenda-alerts-compact{order:31;margin:0 0 10px!important}

/* Scroll fino e discreto */
.agenda-v31-details.drawer-open .selected-date-content{scrollbar-width:thin;scrollbar-color:#9ca3af transparent}
.agenda-v31-details.drawer-open .selected-date-content::-webkit-scrollbar{width:7px}
.agenda-v31-details.drawer-open .selected-date-content::-webkit-scrollbar-thumb{background:#9ca3af;border-radius:999px}
.agenda-v31-details.drawer-open .selected-date-content::-webkit-scrollbar-track{background:transparent}

@media(max-width:720px){
  .agenda-v31-details.drawer-open .agenda-auto-classification-actions{grid-template-columns:1fr!important}
  .agenda-v31-details.drawer-open .agenda-auto-phone-row{grid-template-columns:1fr!important}
  .agenda-v31-details.drawer-open .agenda-contact-search-btn,
  .agenda-v31-details.drawer-open .agenda-auto-phone-row [data-save-contact]{grid-column:auto!important}
  .agenda-v31-details.drawer-open .agenda-detail-actions-compact{grid-template-columns:1fr!important}
  .agenda-v31-details.drawer-open .agenda-compact-info-grid{grid-template-columns:1fr!important}
}
