/* Meu Portal · 17 — calendário: painel redesenhado
   Cabeçalho, abas, visões, equipe e convites, configurações e bloqueios no layout novo. */

.cal-eyebrow {
  margin: 0;
  color: var(--np-faint);
  font-family: var(--np-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.cal-mono {
  font-family: var(--np-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.calendar-overlay-panel {
  width: min(96vw, 1640px);
  min-width: 0;
  height: min(94vh, 1040px);
  min-height: min(760px, calc(100vh - 36px));
  background: var(--np-bg);
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--np-line-soft);
  background: var(--np-paper);
}
.cal-head-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cal-head-tile {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(155deg, var(--np-brand), var(--np-brand-dark));
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.cal-head-title {
  margin: 0;
  color: var(--np-ink);
  font-family: var(--np-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}
.cal-head-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cal-head-meta .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--np-brand);
  margin-right: 5px;
}
.cal-icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
}
.cal-tabbar {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border: 0;
  border-bottom: 1px solid var(--np-line);
  border-radius: 0;
  background: var(--np-paper);
}
.cal-tab {
  position: relative;
  padding: 12px 18px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--np-muted);
  cursor: pointer;
  font-family: var(--np-sans);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.cal-tab.on,
.cal-tab.active.on {
  background: transparent;
  color: var(--np-ink);
}
.cal-tab.on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--np-ink);
}
.cal-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--np-line-soft);
  background: var(--np-paper-warm);
}
.cal-period-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-period-label {
  margin-left: 6px;
  color: var(--np-ink);
  font-family: var(--np-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
  min-width: 0;
}
.cal-period-label small {
  display: block;
  margin-top: 2px;
  color: var(--np-faint);
  font-family: var(--np-mono);
  font-size: 11px;
  font-weight: 800;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--np-line);
  border-radius: 999px;
  background: var(--np-line-soft);
  flex-shrink: 0;
}
.seg > button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--np-muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
}
.seg > button.on {
  background: var(--np-paper);
  color: var(--np-ink);
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
.seg > button[disabled] { opacity: .45; cursor: not-allowed; }
.cal-appt-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cal-appt-filter .filter-label {
  color: var(--np-faint);
  font-size: 11px;
  margin-right: 4px;
  white-space: nowrap;
}
.cal-appt-filter .chip {
  border: 0;
  border-radius: 999px;
  background: #eceee9;
  color: var(--np-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  white-space: nowrap;
}
.cal-appt-filter .chip.on { background: var(--np-brand-tint); color: var(--np-brand-dark); }
.cal-appt-filter .chip[data-filter="pending"].on { background: var(--np-accent-soft); color: #8a5410; }
.cal-appt-filter .chip[data-filter="cancelled"].on { background: var(--np-danger-soft); color: var(--np-danger); }
.cal-pane {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cal-pane.hidden,
.cal-view.hidden,
.cal-config-section.hidden { display: none !important; }
.cal-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 340px);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cal-board-shell {
  order: 1;
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--np-line-soft);
  border-bottom: 0;
  background: var(--np-paper);
}
.cal-side {
  order: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fbfaf7;
}
.cal-week-grid {
  --cal-row-height: 54px;
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(82px, 1fr));
  min-width: 0;
  width: 100%;
}
.cal-grid-head { min-height: 54px; padding: 8px; }
.cal-time-cell,
.cal-slot { min-height: 54px; padding: 6px; }
.cal-event { min-height: 38px; padding: 5px 6px; }
.cal-list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.cal-list-view .cal-notif { max-width: 720px; }
.cal-side-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 10px;
}
.cal-side-headline {
  margin: 5px 0 0;
  color: var(--np-ink);
  font-family: var(--np-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}
.cal-side-headline .muted { color: var(--np-muted); font-family: var(--np-sans); font-size: 12px; font-weight: 800; }
.cal-side-filters {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  padding: 0 16px 12px;
  align-items: end;
}
.cal-side-filters[hidden] { display: none !important; }
/* Equipe (multi-profissional) */
.cal-pro-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600; background: #eef2ff; color: #3730a3; vertical-align: middle; }
.cal-team-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cal-team-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; background: #fff; }
.cal-team-card h5 { margin: 0 0 4px; font-size: .95rem; }
.cal-team-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #f1f5f9; font-size: .86rem; }
.cal-team-row:first-of-type { border-top: 0; }
.cal-team-row .muted { font-size: .78rem; }
.cal-team-row.inactive { opacity: .55; }
.cal-team-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cal-svc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.cal-svc-chip { cursor: pointer; padding: 4px 10px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; font: inherit; font-size: .78rem; }
.cal-svc-chip.on { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.cal-scope-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; font-size: .84rem; }
.cal-scope-row select { max-width: 320px; }
.cal-lock-hint { font-size: .8rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
/* Equipe › acesso ao app AgendaAI (convite por e-mail/link, vínculo da conta do profissional) */
.cal-team-row.cal-pro-row { flex-wrap: wrap; }
.cal-pro-row > .cal-pro-info { flex: 1 1 220px; min-width: 0; }
.cal-msg-sources { display: grid; gap: 6px; }
.cal-msg-sources ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cal-msg-sources li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 8px; align-items: start; padding: 8px 10px; border: 1px solid var(--np-line-soft); border-radius: 10px; background: var(--np-paper-warm); font-size: .84rem; line-height: 1.4; }
.cal-msg-sources li > span:first-child { grid-row: span 2; font-size: .95rem; line-height: 1.3; }
.cal-msg-sources li b { font-weight: 700; color: var(--np-ink, inherit); }
.cal-msg-sources li small { color: var(--np-muted); font-size: .78rem; overflow-wrap: anywhere; }
.cal-msg-sources .cal-msg-warn { margin: 2px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--np-accent-soft); color: #8a5410; font-size: .8rem; line-height: 1.4; }
.cal-msg-sources .cal-msg-note { margin: 0; color: var(--np-muted); font-size: .78rem; line-height: 1.4; }
.cal-access-notify { flex: 1 1 100%; margin: 0; color: var(--np-muted); font-size: .76rem; line-height: 1.4; }
.cal-access { flex: 1 1 100%; display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--np-line-soft); border-radius: 10px; background: var(--np-paper-warm); }
.cal-access-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border: 1px solid var(--np-line); border-radius: 999px; background: var(--np-paper); color: var(--np-muted); font-size: .74rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.cal-access-chip::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--np-faint); }
.cal-access-chip.is-invited { border-color: rgba(224, 138, 30, .4); background: var(--np-accent-soft); color: #8a5410; }
.cal-access-chip.is-invited::before { background: var(--np-accent); }
.cal-access-chip.is-expired { border-color: rgba(154, 58, 44, .28); background: var(--np-danger-soft); color: var(--np-danger); }
.cal-access-chip.is-expired::before { background: var(--np-danger); }
.cal-access-chip.is-linked { border-color: rgba(15, 118, 110, .28); background: var(--np-brand-tint); color: var(--np-brand-dark); }
.cal-access-chip.is-linked::before { background: var(--np-brand); }
.cal-access-detail { color: var(--np-faint); font-size: .74rem; overflow-wrap: anywhere; }
.cal-access-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.cal-access-actions .cta:disabled { opacity: .55; cursor: progress; }
.cal-access-intro { margin: 10px 0 4px; padding: 8px 10px; border-radius: 10px; background: var(--np-brand-tint); color: var(--np-brand-dark); font-size: .8rem; line-height: 1.5; }
.cal-notif-actor { margin-top: 3px; color: var(--np-faint); font-size: .72rem; line-height: 1.35; word-break: break-word; }
/* Modal do convite: acima do calendário (z 140) e abaixo dos diálogos de confirmação (z 220). */
.cal-invite-modal { z-index: 200; }
.cal-invite-modal .modal-box.cal-invite-box { max-width: 500px; margin: auto 0; border: 1px solid var(--np-line); border-radius: 18px; background: var(--np-paper); box-shadow: 0 24px 70px rgba(15, 23, 42, .26); }
.cal-invite-box .modal-header { margin-bottom: .9rem; }
.cal-invite-box .modal-header h3 { color: var(--np-ink); font-size: 1.08rem; font-weight: 800; }
.cal-invite-lead { margin: 0 0 1rem; color: var(--np-muted); font-size: .88rem; line-height: 1.55; }
.cal-invite-lead strong { color: var(--np-ink); }
.cal-invite-check { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin: 0 0 .5rem; color: var(--np-ink); font-size: .9rem; font-weight: 600; cursor: pointer; }
.cal-invite-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--np-brand); }
.cal-invite-self { display: inline-flex; align-items: center; min-height: 36px; margin: -.35rem 0 .35rem; padding: 0; border: 0; background: none; color: var(--np-brand-dark); font: inherit; font-size: .84rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; text-align: left; }
.cal-invite-help { margin: 0; padding: .65rem .8rem; border: 1px solid var(--np-line-soft); border-radius: 10px; background: var(--np-paper-warm); color: var(--np-muted); font-size: .8rem; line-height: 1.5; }
.cal-invite-done-msg { margin: 0 0 .9rem; color: var(--np-ink); font-size: .9rem; line-height: 1.55; }
.cal-invite-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-invite-link-row input { flex: 1 1 240px; min-width: 0; background: var(--np-bg); color: var(--np-ink); font-family: var(--np-mono); font-size: .76rem; }
.cal-invite-status { min-height: 1.2em; margin: .4rem 0 0; color: var(--np-brand-dark); font-size: .8rem; }
.cal-invite-box .kb-modal-actions .cta { font-size: .86rem; }
.cal-invite-box .cta:disabled { opacity: .55; cursor: progress; }
a.cta.cal-invite-wa { border-color: transparent; background: var(--zap, #128a4c); color: #fff; }
a.cta.cal-invite-wa:hover { filter: brightness(1.06); }
@media (max-width: 640px) {
  .cal-access-actions { width: 100%; margin-left: 0; }
  .cal-access-actions .cta { flex: 1 1 auto; min-height: 40px; }
  #calInviteModal { padding: 0; }
  .cal-invite-modal .modal-box.cal-invite-box { min-height: 100dvh; max-width: none; margin: 0; border: 0; border-radius: 0; }
  .cal-invite-box .kb-modal-actions .cta,
  .cal-invite-link-row .cta { flex: 1 1 100%; min-height: 44px; }
}
.cal-notifs {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.cal-config-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--np-paper);
}
.cal-config-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  border-right: 1px solid var(--np-line-soft);
  background: var(--np-paper-warm);
}
.cal-config-nav .cal-eyebrow { margin: 0 0 6px 2px; }
.cal-config-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-family: var(--np-sans);
  text-align: left;
}
.cal-config-item.on {
  border-color: var(--np-line);
  background: var(--np-paper);
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.cal-config-item b {
  display: block;
  color: var(--np-ink);
  font-size: 12px;
  font-weight: 800;
}
.cal-config-item i {
  display: block;
  color: var(--np-faint);
  font-family: var(--np-mono);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}
.cal-config-ic {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--np-line-soft);
  color: var(--np-muted);
  font-family: var(--np-mono);
  font-size: 13px;
  font-weight: 800;
}
.cal-config-item.on .cal-config-ic { background: var(--np-brand-tint); color: var(--np-brand-dark); }
.cal-config-body {
  overflow: auto;
  padding: 22px 28px;
  border-top: 0;
}
.cal-config-section header { margin-bottom: 18px; }
.cal-config-section h4,
.cal-blocks-shell header h4 {
  margin: 0;
  color: var(--np-ink);
  font-family: var(--np-serif);
  font-size: 22px;
  font-weight: 600;
}
.cal-config-section .muted,
.cal-blocks-shell .muted {
  max-width: 520px;
  margin: 4px 0 0;
  color: var(--np-muted);
  font-size: 13px;
  line-height: 1.5;
}
.cal-config-shortcuts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.cal-toggle-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--np-line);
  border-radius: 14px;
  background: var(--np-paper);
  cursor: pointer;
}
.cal-toggle-row input { accent-color: var(--np-brand); margin-top: 2px; }
.cal-toggle-row b { display: block; color: var(--np-ink); font-size: 13px; font-weight: 800; }
.cal-toggle-row i { display: block; margin-top: 2px; color: var(--np-muted); font-size: 12px; font-style: normal; line-height: 1.45; }
.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border-top: 1px solid var(--np-line);
  background: var(--np-paper);
}
.cal-foot .cal-mono { color: var(--np-faint); }
.cal-foot > div { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cal-blocks-shell {
  flex: 1;
  overflow: auto;
  padding: 22px 28px;
  background: var(--np-paper);
}
.cal-block-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0 24px;
  padding: 14px;
  border: 1px solid var(--np-line);
  border-radius: 16px;
  background: var(--np-paper-warm);
}
.cal-block-form .cal-field,
.cal-block-form .cal-field.wide {
  min-width: 0;
  width: auto;
}
.cal-fab {
  position: absolute;
  right: 16px;
  bottom: 70px;
  display: none;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  box-shadow: 0 12px 24px -8px rgba(11,95,88,.6);
  font-size: 20px;
  justify-content: center;
  padding: 0;
  z-index: 5;
}
