/**
 * Ar-Control - Tema customizado
 * Overrides Bootstrap 5 com paleta moderna e refinamentos visuais
 * Google Fonts (DM Sans) carregado via header.php
 */

/* --- Variáveis CSS (paleta teal/slate) --- */
/* Contraste WCAG AA: text-muted e badges */
.text-muted {
  color: #475569 !important; /* slate-600, contraste 4.5:1+ em #f8fafc */
}
.badge.bg-secondary {
  background-color: #475569 !important;
  color: #fff !important;
}
.badge.bg-info {
  background-color: #0369a1 !important; /* sky-700 para contraste adequado */
  color: #fff !important;
}

:root {
  --bs-primary: #0284c7;
  --bs-primary-rgb: 2, 132, 199;
  --bs-primary-hover: #0369a1;
  --bs-body-font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bs-body-bg: #f8fafc;
  --bs-body-color: #1e293b;
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-border-radius-lg: 0.75rem;
  --bs-box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --bs-box-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}

/* --- Overrides Bootstrap --- */
body {
  font-family: var(--bs-body-font-family);
  background-color: var(--bs-body-bg);
}

/* Skip link para navegação por teclado */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--bs-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--bs-border-radius);
  font-weight: 500;
}
.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: all 0.2s ease;
  }
  .btn:hover {
    transform: translateY(-1px);
  }
  .card {
    transition: box-shadow 0.2s ease;
  }
  .list-group-item {
    transition: background-color 0.15s ease;
  }
  .nav-link {
    transition: opacity 0.15s ease;
  }
  .form-control,
  .form-select {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .dropdown-item {
    transition: background-color 0.15s ease;
  }
  .nav-bottom-item {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn,
  .card,
  .list-group-item,
  .nav-link,
  .form-control,
  .form-select,
  .dropdown-item,
  .nav-bottom-item,
  .alert,
  .modal,
  .collapse {
    transition: none !important;
  }
  .btn:hover {
    transform: none;
  }
  .nav-link:hover {
    opacity: 1;
  }
}

.btn-primary:hover {
  background-color: var(--bs-primary-hover);
  border-color: var(--bs-primary-hover);
}

.card {
  border-radius: var(--bs-border-radius-lg);
  border: none;
  box-shadow: var(--bs-box-shadow);
}
.card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
}

.list-group-item-action:hover {
  background-color: #f1f5f9;
}

.nav-link:hover {
  opacity: 0.9;
}

/* Ícones na navegação */
.nav-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.35rem;
  vertical-align: -0.2em;
}

/* Navbar */
.navbar {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  padding-top: env(safe-area-inset-top, 0);
}

/* Inputs */
.form-control,
.form-select {
  border-radius: var(--bs-border-radius);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(2, 132, 199, 0.25);
}

/* Alerts */
.alert {
  border-radius: var(--bs-border-radius);
  border: none;
}

/* Dropdown */
.dropdown-item {
  transition: background-color 0.15s ease;
}

/* Busca global no header */
.global-search-wrap {
  min-width: 0;
}
@media (min-width: 992px) {
  .global-search-wrap {
    flex: 1;
  }
}
.global-search-wrap input {
  min-width: 0;
  width: 100%;
  max-width: 280px;
}
#globalSearchDropdown {
  width: 100%;
  min-width: min(300px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
}
#globalSearchDropdown a:hover,
#globalSearchDropdownMobile a:hover {
  background-color: #f1f5f9;
}
#globalSearchModal .modal-header .form-control {
  box-shadow: none;
}

/* --- Lista responsiva: cards no mobile, tabela no desktop --- */
.lista-cards {
  display: block;
}

.lista-card-item {
  border-radius: var(--bs-border-radius-lg);
  border: 1px solid #e2e8f0;
}

.lista-card-item .card-body {
  padding: 0.875rem 1rem;
}

.lista-card-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lista-card-valor {
  font-weight: 500;
}

/* Dropdown de ações: botão submit como dropdown-item */
.dropdown-menu form {
  margin: 0;
}

.dropdown-menu .dropdown-item[type="submit"] {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

/* Table-responsive: scroll suave em mobile (fallback para tablet) */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Agenda: botões rápidos — substituído por .ac-filter-bar */

/* Agenda: filtros sempre visíveis em desktop — regra movida para seção Agenda abaixo */

/* Atendimentos: itens em cards no mobile */
@media (max-width: 991.98px) {
  .itens-tabela-desktop #tabelaItens thead {
    display: none;
  }
  .itens-tabela-desktop #tabelaItens tbody tr {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: var(--bs-border-radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fff;
  }
  .itens-tabela-desktop #tabelaItens tbody td {
    display: block;
    border: none;
    padding: 0.25rem 0;
  }
  .itens-tabela-desktop #tabelaItens tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    margin-bottom: 0.25rem;
  }
  .itens-tabela-desktop #tabelaItens tbody tr:has(.btn-remove-item) td:last-child {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
  }
}

/* --- Bottom navigation (mobile only) --- */
.nav-bottom {
  display: none;
}

@media (max-width: 991.98px) {
  .nav-bottom {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--bs-primary);
    box-shadow: 0 -2px 10px rgb(0 0 0 / 0.1);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .nav-bottom-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    min-height: 56px;
    padding: 0.25rem 0.5rem;
  }

  .nav-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 52px;
    min-height: 44px;
    border-radius: var(--bs-border-radius);
    border: none;
    background: none;
    cursor: pointer;
  }

  .nav-bottom-item:hover,
  .nav-bottom-item:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
  }

  .nav-bottom-item--primary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
  }

  .nav-bottom-item--primary:hover,
  .nav-bottom-item--primary:focus {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
  }

  .nav-bottom-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 0.15rem;
  }

  .nav-bottom-item--primary .nav-bottom-icon {
    width: 26px;
    height: 26px;
  }

  .nav-bottom-label {
    line-height: 1.1;
  }

  /* Espaço para a bottom nav não cobrir o conteúdo */
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
  }

  .offcanvas-more.offcanvas-bottom {
    max-height: 70vh;
    border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0;
  }
}

/* --- Touch targets: mínimo 44×44px em mobile (WCAG) --- */
@media (max-width: 991.98px) {
  .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0.75rem;
  }

  .btn-close {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    margin: -0.5rem;
  }

  .form-check {
    min-height: 44px;
    padding: 0.5rem 0;
  }

  .form-check-label {
    padding: 0.5rem 0.5rem 0.5rem 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: 44px;
    line-height: 1.5;
  }

  .navbar .nav-link {
    min-height: 44px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
  }

  .dropdown-item {
    min-height: 44px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
  }

  .form-control-sm,
  .form-select-sm {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
  }
}

/* --- Wizard atendimentos: layout mobile (evitar overflow horizontal) --- */
@media (max-width: 991.98px) {
  html, body {
    overflow-x: hidden;
  }
  main.container {
    max-width: 100%;
    padding-left: max(1rem, env(safe-area-inset-left, 0));
    padding-right: max(1rem, env(safe-area-inset-right, 0));
  }
}
main.container {
  max-width: 100%;
}
#formAtendimento {
  min-width: 0;
  max-width: 100%;
}
#formAtendimento .form-check {
  min-width: 0;
}
#formAtendimento .form-check-label {
  padding-left: 1.5em;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
#formAtendimento .card-body,
#formAtendimento .border.rounded.p-3 {
  min-width: 0;
  overflow-wrap: break-word;
}
/* Tipo de pagamento (À vista / À prazo): lado a lado em mobile com padding */
@media (max-width: 991.98px) {
  #formAtendimento #step3 .d-flex.flex-wrap.gap-3 {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 100%;
    padding-left: max(1rem, env(safe-area-inset-left, 0));
  }
  #formAtendimento #step3 .d-flex.flex-wrap.gap-3 .form-check {
    flex: 0 1 auto;
    min-width: 0;
    padding-left: 0.5rem;
  }
  /* Checklist (step4): padding para facilitar marcação em mobile */
  #formAtendimento #step4 .border.rounded.p-3 {
    padding-left: max(1.25rem, calc(env(safe-area-inset-left, 0) + 0.5rem));
  }
  #formAtendimento #step4 .border.rounded.p-3 .form-check {
    padding-left: 0.75rem;
  }
}
#formAtendimento .card,
#formAtendimento .card-body {
  max-width: 100%;
}
/* Mobile: label em block para texto quebrar (display:flex impede wrap) */
@media (max-width: 991.98px) {
  #formAtendimento .form-check-label {
    display: block !important;
  }
  [aria-label="Etapas do formulário"] .text-muted {
    min-width: 0;
    flex: 1 1 auto;
  }
}
@media (max-width: 576px) {
  [aria-label="Etapas do formulário"] {
    flex-wrap: wrap;
  }
  [aria-label="Etapas do formulário"] .text-muted {
    width: 100%;
    font-size: 0.8rem;
  }
}

/* --- Telas muito estreitas (xs) --- */
@media (max-width: 576px) {
  .btn,
  .btn-sm {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    min-height: 44px;
  }

  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .list-group-item strong {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Dashboard: botões empilhados em mobile */
  .alertas-acoes,
  .pendentes-acoes {
    flex-direction: column;
  }

  .alertas-acoes .btn,
  .alertas-acoes form,
  .pendentes-acoes .btn {
    width: 100%;
  }
}

/* =============================================
   Mobile-first UI/UX — melhorias de navegação
   ============================================= */

/* Título da seção no navbar (mobile) */
.navbar-brand-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Bottom nav: posição relativa nos itens para ::before funcionar */
@media (max-width: 991.98px) {
  .nav-bottom-item {
    position: relative;
  }

  /* Alinhar ao fundo para acomodar o FAB elevado */
  .nav-bottom-inner {
    align-items: flex-end;
    padding-bottom: 0.5rem;
  }

  /* Estado ativo: fundo levemente iluminado */
  .nav-bottom-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
  }

  .nav-bottom-item.active .nav-bottom-label {
    font-weight: 700;
  }

  /* Indicador superior para item ativo */
  .nav-bottom-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 0 0 3px 3px;
  }

  /* FAB — botão de ação principal elevado */
  .nav-bottom-item--fab {
    background: #fff !important;
    color: var(--bs-primary) !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    margin-top: -14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22), 0 1px 4px rgba(0, 0, 0, 0.12) !important;
    min-width: 52px !important;
    min-height: 52px !important;
    padding: 0 !important;
    flex-shrink: 0;
    align-self: center;
    text-decoration: none;
  }

  .nav-bottom-item--fab::before {
    display: none !important;
  }

  .nav-bottom-item--fab .nav-bottom-icon {
    width: 26px !important;
    height: 26px !important;
    margin-bottom: 0 !important;
  }

  /* Offcanvas "Mais": itens maiores e mais legíveis */
  .offcanvas-more .offcanvas-header {
    border-bottom: 1px solid #e2e8f0;
  }

  .offcanvas-more .list-group-item {
    padding: 0.9rem 1.25rem;
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nav-bottom-item--fab {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .nav-bottom-item--fab:hover,
  .nav-bottom-item--fab:focus {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.14) !important;
  }
}

/* =============================================
   Agenda — redesign mobile-first
   ============================================= */

/* --- Cabeçalho da página --- */
.ac-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ac-page-head__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.ac-page-head__count {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* --- Barra de chips (filtros rápidos + tabs) --- */
.ac-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.ac-filter-bar::-webkit-scrollbar { display: none; }

.ac-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 36px;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ac-chip:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}
.ac-chip--active {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}
.ac-chip--active:hover {
  background: #0369a1;
  border-color: #0369a1;
  color: #fff;
}
.ac-chip--filter-active {
  border-color: #0284c7;
  color: #0284c7;
}
.ac-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.ac-filter-sep {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  flex-shrink: 0;
  margin: 0 0.1rem;
}

/* --- Divisores de data na lista --- */
.ac-date-divider {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.ac-date-divider:first-child { margin-top: 0; }

.ac-date-divider__badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  white-space: nowrap;
}
.ac-date-divider__badge--primary   { background: #dbeafe; color: #1d4ed8; }
.ac-date-divider__badge--info      { background: #e0f2fe; color: #0369a1; }
.ac-date-divider__badge--secondary { background: #f1f5f9; color: #475569; }
.ac-date-divider__badge--danger    { background: #fee2e2; color: #b91c1c; }
.ac-date-divider__badge--success   { background: #dcfce7; color: #15803d; }

.ac-date-divider__date {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
}
.ac-date-divider__line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.ac-date-divider__count {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* --- Cards da agenda --- */
.ac-card {
  background: #fff;
  border-radius: 12px;
  border-left: 3px solid var(--ac-border, #0284c7);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.ac-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.625rem 0 0.75rem;
  gap: 0.5rem;
}

.ac-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.ac-card__more {
  background: none;
  border: none;
  padding: 0.25rem;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.ac-card__more:hover { background: #f1f5f9; color: #475569; }

.ac-card__body {
  padding: 0.375rem 0.75rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.ac-card__service {
  font-size: 0.8125rem;
  color: #475569;
  font-weight: 500;
}

.ac-card__row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.1rem;
}

.ac-card__time {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.ac-card__addr {
  font-size: 0.75rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.ac-card__obs {
  font-size: 0.75rem;
  color: #64748b;
  border-left: 2px solid #e2e8f0;
  padding-left: 0.5rem;
  margin-top: 0.375rem;
  line-height: 1.45;
}

.ac-card__foot {
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.ac-card__cta {
  display: block;
  text-align: center;
  padding: 0.5625rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.ac-card__cta:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.ac-card__cta--primary {
  background: #0284c7;
  color: #fff !important;
  border-color: #0284c7;
}
.ac-card__cta--primary:hover {
  background: #0369a1;
  border-color: #0369a1;
  color: #fff !important;
}

/* --- Badges inline --- */
.ac-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2em 0.55em;
  border-radius: 5px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.ac-badge--primary   { background: #dbeafe; color: #1d4ed8; }
.ac-badge--info      { background: #e0f2fe; color: #0369a1; }
.ac-badge--success   { background: #dcfce7; color: #15803d; }
.ac-badge--warning   { background: #fef3c7; color: #b45309; }
.ac-badge--danger    { background: #fee2e2; color: #b91c1c; }
.ac-badge--secondary { background: #f1f5f9; color: #475569; }

/* Desktop: filtros sempre visíveis (sobrescreve collapse) */
@media (min-width: 992px) {
  .agenda-filtros-collapse {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* =============================================
   Calendário Mobile — week strip + day list
   ============================================= */

.mcal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.mcal-nav__btn {
  background: none;
  border: none;
  padding: 0.5rem;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.mcal-nav__btn:hover { background: #f1f5f9; }

.mcal-nav__label {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #1e293b;
  letter-spacing: -0.01em;
}

/* Strip dos 7 dias */
.mcal-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #fff;
  border-radius: 14px;
  padding: 0.5rem 0.375rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
  margin-bottom: 1.25rem;
}

.mcal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.5rem 0.125rem 0.375rem;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 62px;
}
.mcal-day:hover:not(.mcal-day--active) { background: #f1f5f9; }

.mcal-day__label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  line-height: 1;
}

.mcal-day__num {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.mcal-day__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 0.1rem;
}
.mcal-day__dot--empty {
  background: transparent;
  visibility: hidden;
}

/* Hoje */
.mcal-day--today .mcal-day__label { color: #0284c7; }
.mcal-day--today .mcal-day__num   { color: #0284c7; }

/* Selecionado */
.mcal-day--active {
  background: #0284c7 !important;
}
.mcal-day--active .mcal-day__label { color: rgba(255,255,255,0.75); }
.mcal-day--active .mcal-day__num   { color: #fff; }
.mcal-day--active .mcal-day__dot   { background: rgba(255,255,255,0.35); color: #fff; }
.mcal-day--active .mcal-day__dot--empty { visibility: hidden; }

/* Cabeçalho do dia selecionado */
.mcal-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.mcal-day-header__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  text-transform: capitalize;
}

.mcal-day-header__count {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* Lista de eventos do dia */
.mcal-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mcal-event {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: #fff;
  border-radius: 12px;
  padding: 0.875rem 0.875rem 0.875rem 1rem;
  border-left: 3px solid #0284c7;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.12s;
}
.mcal-event:hover,
.mcal-event:active {
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
  transform: translateY(-1px);
  color: inherit;
}

.mcal-event__time {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0284c7;
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
}

.mcal-event__body {
  flex: 1;
  min-width: 0;
}

.mcal-event__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcal-event__service {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

/* Loading e empty */
.mcal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 2.5rem 1rem;
  color: #64748b;
  font-size: 0.875rem;
}

.mcal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  gap: 0.25rem;
}

/* =============================================
   Formulário — seletor unificado (cliente/serviço)
   ============================================= */

/* Campo-botão clicável unificado */
.ac-selector {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #94a3b8;
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
}
.ac-selector:hover {
  border-color: #0284c7;
}
.ac-selector:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgb(2 132 199 / 0.12);
}
.ac-selector.has-value {
  color: #1e293b;
}
.ac-selector__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lista inline de serviço (sem posicionamento absoluto) */
.ac-select-wrap {
  position: relative;
}
.ac-select-list {
  max-height: 0;
  overflow: hidden;
  border: 1.5px solid transparent;
  border-radius: 0.5rem;
  background: #fff;
  margin-top: 4px;
  transition: max-height 0.25s ease, border-color 0.15s, box-shadow 0.15s;
}
.ac-select-wrap.is-open .ac-select-list {
  max-height: 280px;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
}
.ac-select-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.ac-select-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.875rem;
  font-family: inherit;
  color: #1e293b;
  background: transparent;
  min-width: 0;
}
.ac-select-search-input::placeholder { color: #94a3b8; }
.ac-select-options {
  overflow-y: auto;
  max-height: 220px;
}
.ac-select-option {
  width: 100%;
  display: block;
  padding: 0.625rem 0.875rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  color: #1e293b;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}
.ac-select-option:hover,
.ac-select-option:focus {
  background: #f0f9ff;
  color: #0284c7;
  outline: none;
}
.ac-select-option--active {
  background: #eff6ff;
  color: #0284c7;
  font-weight: 600;
}
.ac-select-empty {
  padding: 0.75rem 0.875rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Botão fechar modal compacto */
.ac-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: none;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ac-modal-close:hover,
.ac-modal-close:focus {
  background: #e2e8f0;
  color: #1e293b;
  outline: none;
}

/* Chevron animado no seletor de serviço */
.ac-selector__caret {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.ac-select-wrap.is-open .ac-selector__caret {
  transform: rotate(180deg);
}
