/* Agenda centrale: griglia e colori GreenTech della scheda appuntamento. */
.appointment-dialog{
  width:min(900px,calc(100vw - 28px));
  max-height:calc(100dvh - 28px);
  overflow:auto;
  color:#173f31;
}
.appointment-dialog [hidden]{display:none!important}
.appointment-dialog .appointment-form{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px 20px;
  padding:26px 30px 30px;
  align-items:start;
}
.appointment-dialog .appointment-dialog-head{
  align-items:center;
  padding:0 0 18px;
  border-bottom:1px solid #dce8e0;
}
.appointment-dialog .appointment-dialog-head h2{margin:2px 0 0;line-height:1.2}
.appointment-dialog .appointment-form label{
  min-width:0;
  margin:0;
  align-content:start;
  gap:8px;
  color:#204937;
  font-size:.85rem;
  font-weight:750;
}
.appointment-dialog .appointment-form input,
.appointment-dialog .appointment-form select,
.appointment-dialog .appointment-form textarea{
  min-width:0;
  min-height:48px;
  margin:0;
  border:1px solid #cbded2;
  border-radius:12px;
  padding:11px 14px;
  background:#fff;
  color:#173f31;
  font:inherit;
  line-height:1.45;
}
.appointment-dialog .appointment-form textarea{resize:vertical;min-height:90px}
.appointment-dialog .appointment-form input:focus-visible,
.appointment-dialog .appointment-form select:focus-visible,
.appointment-dialog .appointment-form textarea:focus-visible{
  outline:3px solid rgba(175,229,42,.38);
  outline-offset:2px;
  border-color:#55936c;
}
.appointment-dialog .appointment-email-tools{gap:10px;align-items:stretch}
.appointment-dialog #appointment-owner-save-status{
  grid-column:1/-1;
  margin:-8px 0 0;
  padding:10px 13px;
  border:1px solid #cfe3d5;
  border-radius:10px;
  background:#f2faf5;
  color:#214e36;
  font-size:.83rem;
  font-weight:700;
}
.appointment-dialog #appointment-owner-save-status[data-state=failed]{border-color:#e9b791;background:#fff4ed;color:#713c1c}
.appointment-dialog .appointment-email-tools .appointment-email-status{
  display:flex;
  align-items:center;
  min-width:0;
  margin:0;
  padding:12px 16px;
  border:1px solid #cfe3d5;
  border-radius:12px;
  background:#f2faf5;
  color:#214e36;
  font-size:.86rem;
  line-height:1.45;
}
.appointment-dialog .appointment-email-tools .appointment-email-status[data-state=failed]{background:#fff4ed;border-color:#e9b791;color:#713c1c}
.appointment-dialog .appointment-email-tools button{min-height:44px;white-space:normal}
.appointment-dialog .appointment-address{
  margin:4px 0 0;
  padding:18px;
  border:1px solid #d6e7db;
  border-radius:14px;
  background:#f8fbf9;
  gap:12px;
}
.appointment-dialog .appointment-address legend{color:#204937;font-size:.84rem}
.appointment-dialog .appointment-address-quick{gap:10px}
.appointment-dialog .appointment-address-quick label{min-width:0}
.appointment-dialog .appointment-outcome-section{
  padding:18px;
  border-color:#d6e7db;
  background:#f8fbf9;
  gap:14px;
}
.appointment-dialog .appointment-outcome-section h3{color:#174836;font-size:1.15rem}
.appointment-dialog .appointment-contact-actions a,
.appointment-dialog .appointment-map-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:fit-content;
  min-height:40px;
  padding:8px 13px;
  border:1px solid #cfe5d5;
  border-radius:10px;
  background:#eaf6ed;
  color:#185c3a;
  text-decoration:none;
  font-size:.83rem;
  font-weight:800;
}
.appointment-dialog .appointment-contact-actions a:hover,
.appointment-dialog .appointment-map-link:hover{text-decoration:underline;background:#daf0df}
.appointment-dialog .appointment-form .secondary{
  background:#eaf3ed;
  border-color:#d1e3d6;
  color:#174d35;
}
.appointment-dialog .appointment-form .quiet{color:#315847}
.appointment-dialog .appointment-form .appointment-actions{
  gap:8px;
  margin:2px 0 0;
  padding-top:18px;
  border-top:1px solid #dce8e0;
}
.appointment-dialog .appointment-form .appointment-actions button{
  min-height:42px;
  padding:9px 15px;
  font-size:.83rem;
  box-shadow:none;
}
.appointment-dialog .appointment-form .appointment-actions #appointment-reschedule{
  background:#eaf3ed;
  border-color:#d1e3d6;
  color:#174d35;
}
.appointment-dialog .appointment-form .appointment-actions #appointment-download-ics{background:#edf7dc;color:#244a2c}
@media(max-width:720px){
  .appointment-dialog{width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
  .appointment-dialog .appointment-form{grid-template-columns:minmax(0,1fr);gap:16px;padding:18px}
  .appointment-dialog .appointment-form>.wide,
  .appointment-dialog .appointment-form>label{grid-column:1}
  .appointment-dialog .appointment-email-tools{flex-wrap:wrap}
  .appointment-dialog .appointment-email-tools button{width:100%}
  .appointment-dialog .appointment-address{grid-template-columns:repeat(2,minmax(0,1fr));padding:14px}
  .appointment-dialog .appointment-address-quick{grid-template-columns:repeat(2,minmax(0,1fr))}
  .appointment-dialog .appointment-address-quick label{grid-column:1/-1}
  .appointment-dialog .appointment-form .appointment-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .appointment-dialog .appointment-form .appointment-actions button{width:100%;min-width:0;white-space:normal}
  .appointment-dialog .appointment-form .appointment-actions #appointment-download-ics{grid-column:1/-1}
}

/* Agenda controls and sync audit */
.agenda-sync-history{margin:14px 0;padding:12px 16px;border:1px solid #cce0d5;border-radius:14px;background:#f6fbf8;color:#193e32}
.agenda-sync-history summary{cursor:pointer;font-weight:700}
.agenda-sync-history p{margin:9px 0 0;font-size:.9rem;line-height:1.5}
.appointment-dialog .appointment-actions #appointment-delete{color:#8b3636;border:1px solid #dfb9b9;background:#fff;box-shadow:none}
.appointment-dialog .appointment-actions #appointment-delete:hover{background:#fff4f4}

/* A single search field finds clients across the authorized Agenda history. */
#agenda-view .agenda-search{margin:0 0 18px}
#agenda-view .agenda-search form{display:flex;align-items:center;gap:10px;padding:0;border:0;background:none;box-shadow:none}
#agenda-view .agenda-search input{flex:1;min-width:0;margin:0;min-height:44px;background:#fff}
#agenda-view .agenda-search button{margin:0;white-space:nowrap}
#agenda-view .agenda-search-results:not([hidden]){margin-top:10px;padding:14px 16px;background:#fff;border:1px solid #dbe5da;border-radius:12px}
#agenda-view .agenda-search-summary{margin:0 0 10px;font-size:.8rem;color:#637367}
#agenda-view .agenda-search-list{max-height:420px;overflow-y:auto}
#app-view.app-shell #agenda-view .agenda-search-result{display:flex;align-items:center;justify-content:space-between;width:100%;gap:16px;padding:12px 4px;border:0;border-bottom:1px solid #edf0e9;border-radius:0;background:#fff;box-shadow:none;text-align:left}
#agenda-view .agenda-search-result:last-child{border-bottom:0}
#agenda-view .agenda-search-result>span{display:grid;gap:4px;min-width:0}
#agenda-view .agenda-search-result strong{font-size:.86rem;overflow-wrap:anywhere}
#agenda-view .agenda-search-result small{font-size:.76rem;color:#637367}
#agenda-view .agenda-search-when{text-align:right;flex-shrink:0}
#agenda-view .agenda-search-result:hover{background:#f7faf2}
@media(max-width:600px){#agenda-view .agenda-search form{flex-wrap:wrap}#agenda-view .agenda-search input{flex-basis:70%}#agenda-view .agenda-search-result{align-items:flex-start;flex-direction:column;gap:6px}#agenda-view .agenda-search-when{text-align:left;flex-shrink:1}}

/* Keep the recall card compact and its controls aligned with the Agenda header. */
#agenda-view #agenda-customer-recalls{
 margin:clamp(18px,2vw,24px) 0;
 padding:clamp(16px,2vw,24px);
}
#agenda-view .agenda-recalls-heading{
 display:flex;
 align-items:center;
 justify-content:space-between;
 flex-wrap:wrap;
 gap:12px 20px;
}
#agenda-view .agenda-recalls-heading h2{
 margin:0;
 font-size:clamp(1.15rem,1.7vw,1.45rem);
}
#agenda-view .agenda-recalls-filters{
 display:flex;
 flex-wrap:wrap;
 gap:8px;
}
#agenda-view .agenda-recalls-filters button{
 min-height:44px;
 margin:0;
 padding:8px 14px;
}
#agenda-view .agenda-recalls-empty{
 margin:12px 0 0;
 color:var(--muted,#53675e);
}
#agenda-view .agenda-recalls-heading + details{margin-top:14px}
@media(max-width:600px){
 #agenda-view .agenda-recalls-filters{width:100%}
}
