:root {
  --ink: #14172b;
  --ink-2: #1d2140;
  --paper: #faf9f6;
  --surface: #ffffff;
  --line: #e8e6df;
  --line-soft: #f1efe9;
  --coral: #d97706;
  --coral-dark: #b45309;
  --coral-tint: #fff7ed;
  --trust: #2563eb;
  --trust-tint: #eff6ff;
  --muted: #5b5f7a;
  --soft: #9296ad;
  --green: #15803d;
  --green-tint: #eafbf0;
  --danger: #d93025;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Open Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Poppins", sans-serif; margin: 0; }
a { color: inherit; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 18px; color: #fff; }

/* App shell */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar {
  background: var(--ink); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px;
  overflow-y: auto;
}
.sidebar .brand { padding: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a, .tab-button, .side-logout {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: #aeb2cc; font-family: "Open Sans", sans-serif;
}
.side-nav a:hover, .tab-button:hover, .side-logout:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-logout:focus-visible, .tab-button:focus-visible, .side-nav a:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.tab-button.active { background: rgba(255,255,255,.08); color: #fff; }
.tab-button svg, .side-nav a svg, .side-logout svg { flex-shrink: 0; }
.side-spacer { flex: 1; }
.side-foot { display: flex; flex-direction: column; gap: 6px; }
.side-legal { text-align: center; font-size: 12px; color: #6a6f8f; text-decoration: none; padding: 4px; }
.side-legal:hover { color: #aeb2cc; text-decoration: underline; }
.side-biz { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--ink-2); border-radius: 12px; }
.side-biz .avatar {
  width: 34px; height: 34px; border-radius: 999px; background: var(--coral); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px;
}
.side-biz b { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-biz small { font-size: 12px; color: #8b90ad; }
.side-biz > div { overflow: hidden; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  height: 76px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; border-bottom: 1px solid var(--line);
}
.topbar h1 { font-weight: 700; font-size: 20px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; background: var(--green-tint);
  border: 1px solid #b9efcb; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--green);
}
.status-pill i { width: 8px; height: 8px; border-radius: 999px; background: #22c55e; display: inline-block; }
button.status-pill { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.status-pill.off { background: #fff4d6; border-color: #f3dc9c; color: #8a5a00; }
.status-pill.off i { background: #e0a100; }
.wa-connect { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin: 18px 0 4px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); }
.wa-qr-box { width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--soft); font-size: 13px; text-align: center; }
.wa-qr-box img { width: 240px; height: 240px; display: block; }
.wa-steps { flex: 1; min-width: 220px; margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.wa-note { margin-top: 14px; }
.content { flex: 1; overflow: auto; padding: 32px; }
.content-narrow { max-width: 760px; }

/* Cards & forms */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px;
}
.card h2 { font-size: 15px; margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat small { display: block; font-size: 13px; color: var(--soft); font-weight: 600; }
.stat b { display: block; font-family: "Poppins", sans-serif; font-weight: 800; font-size: 28px; margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col .card { margin: 0; }

button {
  font: inherit; cursor: pointer; border: none; border-radius: 999px;
  padding: 10px 20px; background: var(--coral); color: #fff; font-weight: 700; font-size: 14px;
}
button:hover { background: var(--coral-dark); }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
button.secondary:hover { background: var(--line-soft); }
button:disabled { opacity: .5; cursor: not-allowed; }
.tab-button, .tab-button:hover { border-radius: 10px; }

input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="number"], textarea, select {
  font: inherit; font-size: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--coral); outline-offset: -1px; border-color: transparent; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Lists */
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 10px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--paper); }
.list-item .name { font-weight: 600; font-size: 14px; }
.list-item .preview { font-size: 13px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .when { font-size: 12px; color: var(--soft); white-space: nowrap; }
.empty-state { color: var(--soft); font-size: 14px; padding: 20px 0; text-align: center; }
.hidden { display: none !important; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 10px; font-size: 12px; text-transform: uppercase; color: var(--soft); border-bottom: 1px solid var(--line-soft); }
td { padding: 14px 10px; border-bottom: 1px solid #f7f6f2; }
td a { color: var(--coral); font-weight: 600; }

.day-row { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.repeater-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; position: relative; }
.repeater-item .remove-btn { position: absolute; top: 10px; right: 10px; padding: 6px 12px; font-size: 12px; }
.status-line { font-size: 13px; color: var(--soft); margin-top: 8px; min-height: 18px; }
.status-line.success { color: var(--green); }
.status-line.error { color: var(--danger); }

/* Chat (admin transcript + simulator) */
.chat-log {
  overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px;
  background: #ece5dd;
}
.bubble-row { display: flex; }
.bubble-row.out { justify-content: flex-end; }
.bubble {
  max-width: 72%; padding: 9px 13px; border-radius: 10px; font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.bubble-row.in .bubble { background: #fff; border-top-left-radius: 2px; }
.bubble-row.out .bubble { background: #dcf8c6; border-top-right-radius: 2px; }
.bubble.error { border: 1px solid var(--danger); }
.bubble .meta { display: block; margin-top: 4px; font-size: 11px; color: var(--soft); }
.bubble.typing { color: var(--soft); font-style: italic; }

/* Conversas: lista | conversa | contato */
.convo3 { display: grid; grid-template-columns: 320px minmax(0, 1fr) 270px; gap: 16px; height: calc(100vh - 76px - 64px); }
.pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pane-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.pane-head h2, .chat-head h2 { font-size: 15px; margin: 0; }
.pane .scroll { overflow-y: auto; flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { white-space: nowrap; background: var(--paper); color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.chip:hover { background: var(--line-soft); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.conv-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.conv-item:hover { background: var(--paper); }
.conv-item.selected { background: var(--coral-tint); }
.conv-avatar, .info-avatar {
  width: 38px; height: 38px; border-radius: 999px; background: var(--line-soft); color: var(--muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 13px;
}
.conv-main { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-top .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-top .when { font-size: 12px; color: var(--soft); flex-shrink: 0; }
.conv-main .preview { font-size: 13px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.badge-human { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--coral-dark); background: var(--coral-tint); border: 1px solid #fed7aa; padding: 2px 8px; border-radius: 999px; }
.conv-item.selected .badge-human { background: #fff; }

.chat-pane .chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.chat-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.mode-pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.mode-pill.ai { background: var(--green-tint); color: var(--green); }
.mode-pill.human { background: var(--coral-tint); color: var(--coral-dark); }
.chat-pane .chat-log { flex: 1; min-height: 0; }
.bubble-row.out .bubble.human { background: var(--coral-tint); border: 1px solid #fed7aa; }
.composer { display: flex; gap: 10px; padding: 12px 16px 6px; border-top: 1px solid var(--line-soft); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; }
.composer-hint { padding: 6px 16px 12px; font-size: 12px; color: var(--soft); }
.composer-hint.error { color: var(--danger); }
.chat-pane > .composer.hidden + .composer-hint { border-top: 1px solid var(--line-soft); padding-top: 10px; }

.info-pane { padding: 22px 18px; align-items: stretch; overflow-y: auto; }
.info-avatar { width: 56px; height: 56px; font-size: 18px; margin: 0 auto 10px; }
.info-pane h3 { text-align: center; font-size: 16px; margin-bottom: 16px; word-break: break-word; }
.info-pane dl { margin: 0; display: grid; gap: 12px; }
.info-pane dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
.info-pane dd { margin: 2px 0 0; font-size: 14px; word-break: break-word; }
.info-note { margin: 16px 0 0; font-size: 12px; color: var(--muted); background: var(--paper); border-radius: 10px; padding: 10px 12px; }

/* Simulator */
.sim { display: flex; flex-direction: column; height: 100vh; }
.sim-head {
  background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.sim-head nav a { color: #aeb2cc; text-decoration: none; margin-left: 20px; font-size: 14px; font-weight: 600; }
.sim-head nav a.active { color: #fff; }
.sim-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sim-shell { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sim .chat-log { flex: 1; }
.chat-input-bar { display: flex; gap: 8px; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.chat-input-bar input { flex: 1; }

/* Login gate */
.gate-overlay { position: fixed; inset: 0; background: var(--ink); display: flex; align-items: center; justify-content: center; z-index: 50; }
.gate-box { background: #fff; border-radius: 20px; padding: 32px; width: 340px; }
.gate-box h2 { font-size: 18px; margin-bottom: 6px; }
.gate-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 8px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-spacer, .side-biz { display: none; }
  .side-foot { display: contents; }
  .main { height: auto; }
  .stat-grid, .two-col, .convo3 { grid-template-columns: 1fr; }
  .convo3 { height: auto; }
  .convo3 .pane { min-height: 320px; max-height: 70vh; }
  .day-row { grid-template-columns: 70px 1fr 1fr; }
}

@media (max-width: 1250px) and (min-width: 901px) {
  .convo3 { grid-template-columns: 300px minmax(0, 1fr); }
  .info-pane { display: none; }
}

/* Aviso de escalada (IA passou a conversa para a equipe) */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-actions button { padding: 8px 14px; font-size: 13px; }
.chip-attention b { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 11px; line-height: 16px; }
.chip-attention b:empty { display: none; }
.chip-attention.active b { background: #fff; color: var(--ink); }
.conv-item.attention { background: #fff7f4; }
.conv-item.attention.selected { background: var(--coral-tint); }
.conv-item.attention .name { color: var(--coral-dark); }
.badge-attention { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; color: #fff; background: var(--coral); padding: 2px 8px; border-radius: 999px; }
.attention-reason { margin-top: 4px; font-size: 12px; color: var(--coral-dark); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--coral-tint); border-bottom: 1px solid #fed7aa; font-size: 13px; color: var(--ink); }
.attention-banner.hidden { display: none !important; }
.attention-banner button { flex-shrink: 0; padding: 6px 16px; font-size: 13px; }
.attention-banner b { color: var(--coral-dark); }

/* Avisos por webhook */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sub-title { font-size: 13px; margin: 20px 0 8px; color: var(--muted); }
.log-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.log-item:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; background: #22c55e; }
.log-item.fail .log-dot { background: var(--danger); }
.log-item .log-what { flex: 1; min-width: 0; }
.log-item .log-err { display: block; color: var(--danger); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-item .log-when { color: var(--soft); font-size: 12px; white-space: nowrap; }

/* Configuração: WhatsApp da IA e agenda */
.inline-status { display: flex; align-items: center; gap: 10px; }
.inline-status input { flex: 1; }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; background: var(--line-soft); color: var(--muted); }
.pill:empty { display: none; }
.pill.ok { background: #e3f6e9; color: #167a3a; }
.pill.warn { background: #fff4d6; color: #8a5a00; }
.usage-bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin-top: 12px; }
.usage-bar > span { display: block; height: 100%; width: 0; background: var(--coral); border-radius: 999px; }
.cal-connected { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #e3f6e9; border: 1px solid #bfe6cb; }
.cal-connected strong { font-size: 14px; color: #167a3a; }
.cal-connected span { font-size: 13px; color: var(--muted); }
.cal-connected.warn { background: #fff4d6; border-color: #f1dc9c; }
.cal-connected.warn strong { color: #8a5a00; }

/* Painel da plataforma (operador) */
.pf-toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-toolbar input { flex: 1; min-width: 220px; }
.pf-toolbar select { width: auto; }
.pf-table-wrap { overflow-x: auto; }
.pf-table { width: 100%; border-collapse: collapse; }
.pf-table td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 14px; }
.pf-table th.num, .pf-table td.num { text-align: right; }
.pf-row { cursor: pointer; }
.pf-row:hover, .pf-row:focus-visible { background: var(--line-soft); outline: none; }
.pf-sub { font-size: 12px; color: var(--soft); margin-top: 2px; }
.pf-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.pill.bad { background: #fde7e5; color: #b3261e; }
.pf-hint { margin-top: 4px; font-weight: 500; }
.pf-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.pf-bar { flex: 1; background: var(--coral); border-radius: 3px 3px 0 0; min-width: 3px; }
.pf-bar.empty { background: var(--line); }
.pf-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--soft); margin-top: 6px; }
.pf-check { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.pf-check:last-child { border-bottom: none; }
.pf-check > div { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.pf-check span { color: var(--muted); font-size: 13px; }
.pf-check .pill { flex-shrink: 0; min-width: 64px; text-align: center; }
.pf-error { color: var(--danger); }
.pf-backdrop { position: fixed; inset: 0; background: rgba(20, 23, 43, .4); z-index: 30; }
.pf-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 31; padding: 24px; overflow-y: auto; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); }
.pf-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pf-drawer-head h2 { font-size: 20px; margin-bottom: 2px; }
.pf-section { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.pf-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); margin-bottom: 10px; }
.pf-kv { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14px; }
.pf-kv span { color: var(--muted); }
.pf-kv b { font-weight: 600; text-align: right; word-break: break-word; }
.pf-channel { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.pf-details { margin-top: 12px; }
.pf-details summary { cursor: pointer; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.pf-details input { margin-top: 8px; }
.pf-modal-back { display: flex; align-items: center; justify-content: center; z-index: 40; }
.pf-modal { background: #fff; border-radius: 20px; padding: 28px; width: min(480px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; }
.pf-modal h2 { font-size: 18px; margin-bottom: 8px; }
.pf-secret { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.pf-secret code { flex: 1; overflow-x: auto; white-space: nowrap; padding: 10px 12px; background: var(--line-soft); border-radius: 10px; font-size: 13px; }
.support-banner { background: #fff4d6; color: #8a5a00; padding: 10px 32px; font-size: 13px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border-bottom: 1px solid #f1dc9c; }
.support-banner a { color: inherit; font-weight: 700; white-space: nowrap; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .stat-grid.cols-3 { grid-template-columns: 1fr; } }
.pf-actions { white-space: nowrap; }
.pf-actions button { padding: 6px 12px; font-size: 12px; margin-left: 6px; }

/* Planos e assinatura */
.usage-bar.warn > span { background: #d99a00; }
.usage-bar.bad > span { background: var(--danger); }
.pf-usage { margin-bottom: 10px; }
.pf-usage .usage-bar { margin-top: 2px; height: 6px; }
.pf-override { margin-bottom: 8px; }
.pf-override label { margin-top: 8px; }
.pf-inline { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-top: 6px; }
.pf-inline input[type="checkbox"] { width: auto; }
.pc-accept { align-items: flex-start; font-size: 13px; font-weight: 400; color: var(--soft); margin-top: 12px; }
.pc-accept input[type="checkbox"] { margin-top: 2px; }
.pc-accept a { color: var(--coral); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.plan-head small { color: var(--soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.plan-head h2 { margin: 2px 0 0; font-size: 20px; }
.plan-usage { margin-top: 14px; }
.plan-alert { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.plan-alert.warn { background: #fff4d6; color: #8a5a00; border: 1px solid #f1dc9c; }
.plan-alert.bad { background: #fde7e5; color: #b3261e; border: 1px solid #f5c2bd; }
.plan-price { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-price:empty { display: none; }
.plan-hint { display: block; margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--soft); }
.plan-hint:empty { display: none; }
.plan-cta, .plan-option-link {
  display: inline-block; text-align: center; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; background: var(--coral); color: #fff;
}
.plan-cta:hover, .plan-option-link:hover { background: var(--coral-dark); }
.plan-cta { margin-top: 14px; }
.plan-list { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.plan-list summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.plan-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.plan-option:last-of-type { border-bottom: none; }
.plan-option b { display: block; font-size: 14px; }
.plan-option small { display: block; margin-top: 2px; font-size: 12px; color: var(--soft); }
.plan-option.current b { color: var(--ink); }
.plan-option-link { padding: 7px 14px; font-size: 13px; background: transparent; color: var(--coral); border: 1px solid var(--coral); }
.plan-option-link:hover { background: var(--coral); color: #fff; }
.plan-actions { align-items: center; }
.plan-actions .plan-cta { margin-top: 14px; }
.plan-actions .secondary { margin-top: 14px; }
.plan-checkout { margin-top: 14px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; }
.plan-checkout b { display: block; font-size: 14px; margin-bottom: 4px; }
.pc-method { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.plan-qr { margin-top: 14px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; text-align: center; }
.plan-qr img { display: block; margin: 10px auto; border-radius: 8px; }
.plan-qr label { display: block; text-align: left; }
.plan-qr textarea { width: 100%; margin-top: 6px; font-family: monospace; font-size: 12px; resize: vertical; }
@media (max-width: 640px) {
  .plan-option { flex-direction: column; align-items: flex-start; }
}
.status-line.warn { color: #8a5a00; }

/* Login do painel do cliente */
.login-page { min-height: 100vh; background: var(--ink); background-image: radial-gradient(circle, #252a4a 1.5px, transparent 1.5px); background-size: 26px 26px; }
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 16px; }
.login-brand .brand-name { color: #fff; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 32px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-card h1 { font-family: "Poppins", sans-serif; font-size: 22px; margin: 0 0 6px; }
.login-sub { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; }
.login-card label { display: block; margin-top: 14px; font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; margin-top: 6px; font-size: 16px; } /* 16px evita o zoom automático do iPhone ao digitar */
.pw-field { position: relative; }
.pw-field input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 3px; background: transparent; color: var(--coral); border: none; padding: 6px 10px; font-size: 13px; font-weight: 700; border-radius: 8px; }
.pw-toggle:hover { background: var(--line-soft); }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; line-height: 1.4; }
.login-success { color: var(--green); font-size: 13px; margin: 0 0 16px; line-height: 1.4; padding: 10px 12px; background: var(--green-tint); border-radius: 10px; }
.login-btn { width: 100%; margin-top: 6px; padding: 13px 20px; font-size: 15px; }
.login-help { margin: 18px 0 0; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.login-help a, .login-links a { color: var(--coral); font-weight: 700; text-decoration: underline; }
.login-hint { margin: 6px 0 0; font-size: 12px; color: var(--soft); }
.login-links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; font-size: 13px; }
.login-links a { color: #aeb2cc; font-weight: 600; text-decoration: none; }
.login-links a:hover { color: #fff; }
.acc-pw { margin-top: 14px; }
.acc-pw summary { cursor: pointer; font-weight: 700; font-size: 14px; }

/* Agenda mês a mês (Agendamentos) */
.cal-card { padding: 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h2 { margin: 0; min-width: 200px; text-align: center; font-size: 18px; }
.cal-arrow { width: 36px; height: 36px; padding: 0; font-size: 22px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.cal-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays { margin-top: 6px; }
.cal-weekdays span { text-align: center; font-size: 11px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; padding: 6px 0; }
.cal-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px 0 0 0; }
.cal-cell {
  font: inherit; font-weight: 500; text-align: left; cursor: pointer; color: var(--ink); background: #fff;
  border: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 6px; min-height: 112px; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-cell:hover { background: var(--paper); }
.cal-cell:focus-visible { outline: 2px solid var(--coral); outline-offset: -2px; z-index: 2; }
.cal-cell.out { background: #fbfaf7; color: var(--soft); }
.cal-cell.selected { outline: 2px solid var(--coral); outline-offset: -2px; z-index: 1; background: var(--coral-tint); }
.cal-daynum { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border-radius: 999px; flex-shrink: 0; }
.cal-cell.today .cal-daynum { background: var(--coral); color: #fff; }
.cal-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; gap: 4px; align-items: baseline; font-size: 11px; line-height: 1.35; padding: 2px 5px; border-radius: 6px; background: #eceef7; color: #2c3150; overflow: hidden; white-space: nowrap; min-width: 0; }
.cal-time { font-weight: 700; flex-shrink: 0; }
.cal-chip-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-chip.ai { background: var(--coral-tint); color: #9a361b; box-shadow: inset 3px 0 0 var(--coral); }
.cal-chip.allday { background: #e3ecf9; color: #1f4b8f; font-weight: 600; }
.cal-chip.private { background: repeating-linear-gradient(135deg, #f1efe9, #f1efe9 5px, #e8e6df 5px, #e8e6df 10px); color: var(--muted); }
.cal-more { font-size: 11px; font-weight: 700; color: var(--muted); padding-left: 4px; }
.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 12px; height: 12px; border-radius: 4px; background: #eceef7; display: inline-block; }
.cal-dot.ai { background: var(--coral); }
.cal-dot.private { background: repeating-linear-gradient(135deg, #f1efe9, #f1efe9 3px, #d8d5cb 3px, #d8d5cb 6px); border: 1px solid var(--line); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-day-head h2 { margin: 0; }
.cal-event { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid #a9aec8; border-radius: 10px; background: #fff; margin-bottom: 8px; }
.cal-event.ai { border-left-color: var(--coral); }
.cal-event.private { border-left-color: #cfcbbe; background: #fbfaf7; color: var(--muted); }
.cal-event-when { font-weight: 700; font-size: 13px; color: var(--muted); }
.cal-event-title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.cal-event-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cal-event-link { color: var(--coral); font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; }
.cal-event-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .cal-nav h2 { min-width: 0; font-size: 16px; }
  .cal-card { padding: 14px; }
  .cal-cell { min-height: 54px; padding: 4px 2px; align-items: center; gap: 3px; }
  .cal-events { width: 100%; padding: 0 3px; }
  .cal-chip { height: 4px; padding: 0; font-size: 0; border-radius: 2px; box-shadow: none; }
  .cal-chip > * { display: none; }
  .cal-more { display: none; }
  .cal-event { grid-template-columns: 1fr; gap: 6px; }
}

/* Reservas */
.rv-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.rv-warning { background: #fff4d6; border: 1px solid #f3dc9c; color: #8a5a00; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.rv-form { border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; margin: 8px 0 14px; }
.rv-form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rv-form-grid .rv-wide { grid-column: span 2; }
.rv-item { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.rv-item:last-child { border-bottom: none; }
.rv-item .rv-time { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15px; }
.rv-item .rv-time small { display: block; font-family: inherit; font-weight: 500; font-size: 12px; color: var(--soft); }
.rv-item .rv-who b { font-size: 14px; }
.rv-item .rv-who small { display: block; font-size: 12px; color: var(--soft); overflow-wrap: anywhere; }
.rv-item .rv-party { font-weight: 700; white-space: nowrap; }
.rv-item .rv-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rv-item .rv-actions button { padding: 6px 12px; font-size: 12px; }
.rv-item.closed .rv-who b, .rv-item.closed .rv-time, .rv-item.closed .rv-party { text-decoration: line-through; color: var(--soft); }
.rv-shift-day { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: start; margin-bottom: 10px; }
.rv-shift-day > strong { padding-top: 8px; }
.rv-shift-list { display: flex; flex-direction: column; gap: 6px; }
.rv-shift { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-shift input[type="time"] { width: 120px; }
.rv-shift button, .rv-shift-list > button { padding: 6px 12px; font-size: 12px; width: fit-content; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rv-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.rv-chip button { padding: 2px 8px; font-size: 12px; }
@media (max-width: 760px) {
  .rv-form-grid { grid-template-columns: 1fr 1fr; }
  .rv-item { grid-template-columns: 76px 1fr; }
  .rv-item .rv-party, .rv-item .rv-actions { grid-column: 2; justify-content: flex-start; }
  .rv-shift-day { grid-template-columns: 1fr; }
}

.pf-check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.pf-check input { width: auto; margin: 0; }

/* Impressão da lista de reservas do dia: só existe na tela de impressão, o resto do painel some. */
#rv-print { display: none; }
.rv-print-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 12px; }
.rv-print-head h1 { font-size: 18px; margin: 0; }
.rv-print-head h2 { font-size: 14px; font-weight: 600; margin: 4px 0 0; text-transform: capitalize; }
.rv-print-head p { margin: 0; font-size: 12px; text-align: right; }
.rv-print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rv-print-table th, .rv-print-table td { border: 1px solid #999; padding: 6px 7px; text-align: left; vertical-align: top; }
.rv-print-table th { background: #eee; font-weight: 700; }
.rv-print-table td.num, .rv-print-table th.num { text-align: center; white-space: nowrap; }
.rv-print-table .box { display: inline-block; width: 14px; height: 14px; border: 1px solid #333; vertical-align: middle; }
.rv-print-foot { margin-top: 10px; font-size: 11px; color: #555; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.print-rv { background: #fff !important; }
  body.print-rv > .app { display: none !important; }
  body.print-rv #rv-print { display: block !important; color: #111; font-family: system-ui, sans-serif; }
  .rv-print-table tr { page-break-inside: avoid; }
  .rv-print-table thead { display: table-header-group; }
}

/* Mesas e junções */
.rv-table-row { display: grid; grid-template-columns: 1fr 100px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.rv-combo-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.rv-combo-head { display: grid; grid-template-columns: 1fr 100px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.rv-combo-members { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rv-combo-members label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; }
.rv-combo-members input { width: auto; margin: 0; }
.rv-table-row button, .rv-combo-head button { padding: 6px 12px; font-size: 12px; }
@media (max-width: 760px) { .rv-table-row, .rv-combo-head { grid-template-columns: 1fr 84px; } .rv-table-row button, .rv-combo-head button { grid-column: span 2; width: fit-content; } }
