/* Visual alinhado ao Chatwoot (paleta slate + azul da marca, Inter, cantos 8/12px). */

:root {
  --bg: #fcfcfd;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --surface-3: #f0f0f3;
  --hover: #f0f0f3;
  --text: #1c2024;
  --text-muted: #60646c;
  --text-subtle: #8b8d98;
  --border: #e8e8ec;
  --border-strong: #d9d9e0;
  --brand: #2781f6;
  --brand-hover: #1f6fd8;
  --brand-soft: #edf5ff;
  --brand-text: #0d74ce;
  --danger: #dc3e42;
  --danger-soft: #fff0ee;
  --c-scheduled: #2781f6;
  --c-confirmed: #30a46c;
  --c-done: #8b8d98;
  --c-no_show: #ef5f00;
  --c-canceled: #e5484d;
  --overlay: rgba(12, 14, 20, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --surface: #18191b;
    --surface-2: #1c1d20;
    --surface-3: #212225;
    --hover: #272a2d;
    --text: #edeef0;
    --text-muted: #b0b4ba;
    --text-subtle: #777b84;
    --border: #272a2d;
    --border-strong: #363a3f;
    --brand-soft: #0d2847;
    --brand-text: #70b8ff;
    --danger: #ff6369;
    --danger-soft: #3b1219;
    --c-done: #777b84;
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111113;
  --surface: #18191b;
  --surface-2: #1c1d20;
  --surface-3: #212225;
  --hover: #272a2d;
  --text: #edeef0;
  --text-muted: #b0b4ba;
  --text-subtle: #777b84;
  --border: #272a2d;
  --border-strong: #363a3f;
  --brand-soft: #0d2847;
  --brand-text: #70b8ff;
  --danger: #ff6369;
  --danger-soft: #3b1219;
  --c-done: #777b84;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }

.i {
  width: 16px; height: 16px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.i--xs { width: 12px; height: 12px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; font-weight: 500; font-size: 14px; white-space: nowrap;
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn--outline { border-color: var(--border-strong); background: var(--surface); }
.btn--outline:hover:not(:disabled) { background: var(--hover); }
.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn--danger-ghost { color: var(--danger); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn--danger-ghost[data-confirm="1"] { background: var(--danger); color: #fff; }
.btn--icon { width: 32px; padding: 0; }
.btn--sm { height: 28px; font-size: 13px; padding: 0 10px; }
.btn--sm.btn--icon { width: 28px; padding: 0; }
.btn--block { width: 100%; height: 40px; }
.btn-pair { display: inline-flex; }
.link { background: none; border: 0; color: var(--brand-text); cursor: pointer; padding: 4px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- inputs ---------- */
.input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.input:disabled { background: var(--surface-2); color: var(--text-muted); }
.input--sm { height: 32px; font-size: 13px; width: auto; padding: 0 8px; }
select.input { cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text); }
.field small { font-weight: 400; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: 1.4fr 1fr 1fr; }
.form-error {
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--danger-soft); color: var(--danger); font-size: 13px;
}

.switch {
  appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 34px; height: 20px; border-radius: 999px; margin: 0;
  background: var(--border-strong); position: relative; cursor: pointer;
  transition: background-color .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(14px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- layout ---------- */
.app { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar__title { font-size: 18px; font-weight: 600; line-height: 1.3; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Aba da conversa (Dashboard App): só o calendário. */
.app--tab .topbar,
.app--tab .side { display: none; }
.app--tab .layout { grid-template-columns: minmax(0, 1fr); }
.app--tab .toolbar { padding-top: 12px; }

/* Agendamento rápido (botão no painel do contato): só o formulário, sobre a tela do atendimento. */
html.quick, html.quick body { background: transparent; }
html.quick .screen { background: var(--overlay); }
html.quick .empty {
  padding: 24px 28px; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-lg);
}

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  padding: 10px 16px;
}
.toolbar__nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cal-title { font-size: 16px; font-weight: 600; margin-left: 4px; white-space: nowrap; }
.toolbar__filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.search {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--text-subtle);
}
.search:focus-within { border-color: var(--brand); }
.search input { border: 0; outline: 0; background: transparent; width: 270px; font-size: 13px; color: var(--text); }

.segmented { display: inline-flex; padding: 2px; border-radius: var(--radius); background: var(--surface-3); }
.segmented button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.layout {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr);
  gap: 12px; padding: 0 16px 16px;
}
.calendar-card, .side {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 0;
}
.calendar-card { overflow: hidden; position: relative; }
.calendar-card.is-loading::after {
  content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 40%;
  background: var(--brand); animation: loading 1s ease-in-out infinite;
}
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
#calendar { height: 100%; }

.side { display: flex; flex-direction: column; overflow: hidden; }
.side__title { font-size: 13px; font-weight: 600; padding: 14px 14px 8px; }
.side__list { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; flex: 1; }
.side__empty { padding: 8px; font-size: 13px; color: var(--text-muted); }

.up {
  display: flex; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--radius);
  background: transparent; text-align: left; cursor: pointer;
}
.up:hover { background: var(--hover); }
.up__date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 44px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--ev) 12%, transparent); color: var(--ev);
}
.up__date b { font-size: 16px; line-height: 1; }
.up__date small { font-size: 10px; font-weight: 600; text-transform: uppercase; margin-top: 2px; }
.up__body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.up__title { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up__meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .topbar, .toolbar { padding-left: 12px; padding-right: 12px; }
  .layout { padding: 0 8px 8px; }
  .search input { width: 140px; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- telas (carregando / aviso / login) ---------- */
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.empty { max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h2 { font-size: 16px; font-weight: 600; margin-top: 6px; }
.empty p { color: var(--text-muted); }
.empty .btn { margin-top: 10px; }
.empty__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--surface-3); color: var(--text-muted);
}
.empty__icon .i { width: 22px; height: 22px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- modais ---------- */
.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.modal[open] { display: flex; flex-direction: column; }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal--wide { width: min(1080px, calc(100vw - 24px)); }
.modal::backdrop { background: var(--overlay); }
.modal__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 12px;
}
.modal__header h3 { font-size: 16px; font-weight: 600; }
.modal__header p { font-size: 13px; margin-top: 2px; }
.modal__body { display: flex; flex-direction: column; gap: 14px; padding: 4px 20px 16px; overflow-y: auto; }
.modal__footer {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small { color: var(--text-muted); font-size: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.perm-table th {
  background: var(--surface-2); font-weight: 500; font-size: 12px; color: var(--text-muted);
  white-space: nowrap; position: sticky; top: 0; cursor: help;
}
.perm-table th:first-child, .perm-table td:first-child { text-align: left; min-width: 220px; }
.perm-table tr:last-child td { border-bottom: 0; }
.perm-table .row--defaults td { background: var(--brand-soft); }
.perm-table .row--defaults small { display: block; color: var(--text-muted); font-size: 11px; }
.perm-table tr.is-inactive td { opacity: .55; }
.perm-table td:last-child { white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; }
.person__info { display: flex; flex-direction: column; min-width: 0; }
.person__info small { color: var(--text-muted); font-size: 12px; }
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 6px; background: var(--surface-3); color: var(--text-muted);
  font-size: 11px; font-weight: 500; vertical-align: middle;
}
.badge--brand { background: var(--brand-soft); color: var(--brand-text); }

.chip-contact { display: inline-flex; align-items: center; gap: 6px; }

.client-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.client-card__info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.client-card__info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card__info span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-hint:empty { display: none; }

/* Compromisso em modo leitura */
.form-fields { display: flex; flex-direction: column; gap: 14px; }
.appt-view { display: flex; flex-direction: column; gap: 14px; }
.appt-view__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.appt-view__title { font-size: 16px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.status-badge {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: color-mix(in srgb, var(--ev) 14%, transparent); color: var(--ev);
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ev); }
.status-badge--btn { border: 0; cursor: pointer; font-family: inherit; }
.status-badge--btn:hover { background: color-mix(in srgb, var(--ev) 24%, transparent); }
.status-menu { position: relative; flex-shrink: 0; }
.status-menu__list {
  position: fixed; z-index: 20; min-width: 190px; /* top/left definidos pelo app.js */
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.status-menu__list button {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.status-menu__list button:hover { background: var(--hover); }
.status-menu__list button[aria-current] { font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ev); flex-shrink: 0; }
.appt-view__list { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 12px; margin: 0; font-size: 13px; }
.appt-view__list dt { color: var(--text-muted); }
.appt-view__list dd { margin: 0; word-break: break-word; }
.appt-view__list .pre { white-space: pre-wrap; }
.appt-view__list a { color: var(--brand-text); }

/* Campos personalizados */
#custom-fields:empty { display: none; }
.field__label { display: inline-flex; align-items: center; gap: 4px; }
.help-tip {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 16px; height: 16px; margin-left: 2px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-muted); font-size: 11px; font-weight: 600; line-height: 1; cursor: help;
}
.help-tip:hover, .help-tip:focus-visible { background: var(--brand-soft); color: var(--brand-text); outline: none; }
.tip {
  position: fixed; z-index: 30; max-width: 260px; padding: 8px 10px; border-radius: var(--radius);
  background: var(--text); color: var(--surface); font-size: 12px; font-weight: 400; line-height: 1.4;
  box-shadow: var(--shadow-lg); pointer-events: none; white-space: pre-wrap;
}
.req { color: var(--danger); }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.input-prefix { display: flex; align-items: center; }
.input-prefix span {
  height: 40px; display: inline-flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface-2); color: var(--text-muted); font-size: 13px;
}
.input-prefix .input { border-radius: 0 var(--radius) var(--radius) 0; }
.upload { display: flex; flex-direction: column; gap: 8px; }
.upload__preview:empty { display: none; }
.upload__img { display: block; max-width: 100%; max-height: 180px; border-radius: var(--radius); border: 1px solid var(--border); }
.upload__video { display: block; width: 100%; max-height: 240px; border-radius: var(--radius); background: #000; }
.upload__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload__pick { cursor: pointer; }
.file-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-text); word-break: break-all; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.section-head .section-title { margin-top: 0; }
.fields-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.fields-list__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.fields-list__item:last-child { border-bottom: 0; }
.fields-list__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fields-list__info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fields-list__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.fields-list__empty { padding: 14px; color: var(--text-muted); font-size: 13px; }
.fields-list__item { justify-content: flex-start; }
.fields-list__info { flex: 1; }

/* Arrastar e soltar */
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 24px; height: 28px; border-radius: 6px; color: var(--text-subtle); cursor: grab;
}
.drag-handle:hover { background: var(--hover); color: var(--text); }
.drag-handle:active { cursor: grabbing; }
[data-sort-item].is-dragging { opacity: .45; background: var(--brand-soft); }

/* Status dos compromissos */
.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.status-row--removing { background: var(--danger-soft); }
.status-row__color {
  width: 32px; height: 32px; padding: 0; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: none;
}
.status-row__color::-webkit-color-swatch-wrapper { padding: 3px; }
.status-row__color::-webkit-color-swatch { border: 0; border-radius: 5px; }
.status-row__color::-moz-color-swatch { border: 0; border-radius: 5px; }
.status-row__label { flex: 1; min-width: 160px; width: auto; }
.status-row__meta { min-width: 120px; display: inline-flex; align-items: center; gap: 6px; }
.status-actions { display: flex; justify-content: flex-end; }

/* Integrações */
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 220px; width: auto; }
.api-base { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.api-base code, .fields-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text);
}
.secret-box {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--c-confirmed) 45%, transparent);
  background: color-mix(in srgb, var(--c-confirmed) 8%, transparent);
}
.secret-box__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret-box__row .input { flex: 1; min-width: 200px; width: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.webhook-row { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.webhook-row:last-child { border-bottom: 0; }
.webhook-row__head { display: flex; align-items: center; gap: 10px; }
.webhook-row__url { font-size: 13px; word-break: break-all; }
.webhook-row__actions { display: flex; gap: 4px; flex-shrink: 0; }
.text-danger { color: var(--danger); }
.fc .ev--closed .fc-event-title { opacity: .75; }

/* Configurações da agenda */
.settings-page { min-height: 100vh; display: flex; flex-direction: column; }
.settings-page__body { width: 100%; max-width: 1120px; padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 14px; }
.section-title { font-size: 14px; font-weight: 600; margin-top: 6px; }

/* ---------- toasts (snackbar do Chatwoot) ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius); background: #1c2024; color: #fff;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease-out; transition: opacity .3s, transform .3s;
}
:root[data-theme="dark"] .toast { background: #edeef0; color: #1c2024; }
.toast--error { background: var(--danger); color: #fff !important; }
.toast.is-out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- FullCalendar no tema do Chatwoot ---------- */
.fc {
  --fc-border-color: var(--border);
  --fc-page-bg-color: var(--surface);
  --fc-neutral-bg-color: var(--surface-2);
  --fc-neutral-text-color: var(--text-muted);
  --fc-today-bg-color: color-mix(in srgb, var(--brand) 5%, transparent);
  --fc-now-indicator-color: var(--c-canceled);
  --fc-list-event-hover-bg-color: var(--hover);
  --fc-highlight-color: color-mix(in srgb, var(--brand) 12%, transparent);
  --fc-non-business-color: color-mix(in srgb, var(--surface-3) 45%, transparent);
  height: 100%;
  font-size: 13px;
}
.fc a { color: inherit; text-decoration: none; }
.fc-theme-standard .fc-scrollgrid { border: 0; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border); }
.fc .fc-col-header-cell { background: var(--surface-2); }
.fc .fc-col-header-cell-cushion {
  padding: 8px 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: capitalize;
}
.fc .fc-daygrid-day-top { flex-direction: row; }
.fc .fc-daygrid-day-number { font-size: 12px; font-weight: 500; color: var(--text-muted); padding: 6px 8px; }
.fc .fc-day-other .fc-daygrid-day-number { color: var(--text-subtle); opacity: .6; }
.fc .fc-day-today .fc-daygrid-day-number {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; margin: 4px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff;
}
.fc .fc-timegrid-slot { height: 2.4em; }
.fc .fc-timegrid-slot-label-cushion, .fc .fc-timegrid-axis-cushion { font-size: 11px; color: var(--text-subtle); }
.fc .fc-daygrid-more-link { font-size: 12px; font-weight: 500; color: var(--brand-text); padding: 0 4px; }
.fc .fc-popover { background: var(--surface); border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.fc .fc-popover-header { background: var(--surface-2); color: var(--text); padding: 6px 8px; }

.fc .ev { --ev: var(--c-scheduled); }
.fc .ev--confirmed { --ev: var(--c-confirmed); }
.fc .ev--done { --ev: var(--c-done); }
.fc .ev--no_show { --ev: var(--c-no_show); }
.fc .ev--canceled { --ev: var(--c-canceled); }

.fc .fc-daygrid-event.ev, .fc .fc-timegrid-event.ev {
  background: color-mix(in srgb, var(--ev) 14%, var(--surface));
  border: 0; border-left: 3px solid var(--ev); border-radius: 6px;
  box-shadow: none; cursor: pointer;
}
.fc .fc-daygrid-event.ev { margin: 1px 4px; padding: 1px 4px; }
.fc .ev .fc-event-main, .fc .ev .fc-event-title, .fc .ev .fc-event-time { color: var(--text); font-weight: 500; }
.fc .ev .fc-event-time { color: var(--text-muted); font-weight: 400; }
.fc .fc-timegrid-event.ev .fc-event-main { padding: 2px 4px; }
.fc .ev--canceled .fc-event-title { text-decoration: line-through; opacity: .75; }
.fc .ev--done .fc-event-title { opacity: .8; }
.fc .fc-event-mirror { opacity: .8; }

.fc .fc-list { border: 0; }
.fc .fc-list-day-cushion { background: var(--surface-2); font-size: 12px; font-weight: 600; }
.fc .fc-list-event { cursor: pointer; }
.fc .fc-list-event td { border-color: var(--border); }
.fc .fc-list-event .fc-list-event-dot { border-color: var(--ev); }
.fc .fc-list-event-time { color: var(--text-muted); }
.fc .fc-list-empty { background: var(--surface); color: var(--text-muted); }
