/* Agentes para grupos — painel (mesmo padrão visual do site) */
:root {
  --dark: #0E1714;
  --dark-2: #15231E;
  --dark-3: #1D2E28;
  --dark-line: #24372F;
  --cream: #F4F1E8;
  --card: #FBFAF6;
  --field: #FFFEFA;
  --sand: #ECE8DC;
  --line: #DCD7C7;
  --line-2: #CFC9B8;
  --lime: #B8F25A;
  --teal: #2C7A62;
  --ink: #0E1714;
  --soft: #4A5A53;
  --muted: #5C665F;
  --on-dark: #C9D6D0;
  --on-dark-soft: #A9BDB4;
  --on-dark-muted: #8DA399;
  --danger: #A63A2B;
  --radius: 20px;
  --display: 'Syne', Arial, sans-serif;
  --text: 'DM Sans', Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--text); font-size: 15px; line-height: 1.5; background: var(--cream); color: var(--ink); }
a { color: var(--teal); }
a:hover { color: #1F5A47; }
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.01em; color: var(--ink); }
.h1 { font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.h2 { font-size: 22px; line-height: 1.2; font-weight: 700; }
.h3 { font-size: 18px; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
.p { font-size: 15px; line-height: 1.55; color: var(--soft); }
.small { font-size: 13px; line-height: 1.5; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; color: var(--teal); text-transform: uppercase; }
.strong { color: var(--ink); font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }

/* ---------- Moldura ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 248px; max-width: 100%; background: var(--dark); color: var(--cream); padding: 28px 20px; display: flex; flex-direction: column; gap: 28px; }
.main { flex: 999 1 560px; min-width: 0; padding: 40px 48px 64px; }
.container { max-width: 1080px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--cream); padding: 0 6px; }
.brand:hover { color: var(--cream); }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--lime); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-name { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.2; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--on-dark); min-height: 46px; }
.nav a:hover { background: var(--dark-2); color: var(--cream); }
.nav a.active { background: var(--dark-3); color: var(--lime); font-weight: 700; }
.sidebar-spacer { flex: 1; }
.user-box { background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--teal); color: var(--cream); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.user-name { font-size: 15px; font-weight: 700; color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { font-size: 13px; color: var(--on-dark-muted); }
.logout { display: flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--on-dark); background: none; border: 0; padding: 0; min-height: 44px; cursor: pointer; text-align: left; }
.logout:hover { color: var(--cream); }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 700; border-radius: 999px; padding: 12px 22px; min-height: 46px; cursor: pointer; text-decoration: none; white-space: nowrap; border: 0; background: var(--dark); color: var(--cream); transition: transform .08s ease, background-color .15s ease; }
.btn:hover { background: #1F2E29; color: var(--cream); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-2); padding: 11px 20px; }
.btn.secondary:hover { background: var(--sand); }
.btn.lime { background: var(--lime); color: var(--dark); }
.btn.lime:hover { background: #C6F574; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #E3B9B1; padding: 11px 20px; }
.btn.danger:hover { background: #F8E5E1; }
.btn.sm { padding: 8px 16px; min-height: 40px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--sand); }
.icon-btn.danger { color: var(--danger); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--teal); text-decoration: none; min-height: 44px; }

/* ---------- Cartões e etiquetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card.dark { background: var(--dark); border-color: var(--dark); color: var(--cream); }
.card.dark h2, .card.dark h3 { color: var(--cream); }
.icon-chip { width: 44px; height: 44px; border-radius: 12px; background: var(--dark); color: var(--lime); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon-chip.lg { width: 56px; height: 56px; border-radius: 16px; }
.icon-chip.lime { background: var(--lime); color: var(--dark); }

.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.tag.connected { background: #DDEFD0; color: #1F4A12; }
.tag.awaiting_qr, .tag.disconnected { background: #FCEBC7; color: #6B4A00; }
.tag.pending_payment { background: #E3E6EF; color: #33405E; }
.tag.suspended { background: #F8DDD8; color: #8A2A1C; }
.tag.sent { background: #DDEFD0; color: #1F4A12; }
.tag.failed { background: #F8DDD8; color: #8A2A1C; }
.tag.skipped { background: #FCEBC7; color: #6B4A00; }
.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-btn { border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--soft); padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.row > .seg-btn { background: var(--sand); }
.seg-btn b { font-weight: 700; margin-left: 4px; opacity: .75; }
.seg-btn[aria-pressed="true"] { background: var(--dark) !important; color: var(--lime); }
.seg-btn:focus-visible { outline: 3px solid rgba(44, 122, 98, 0.35); }
.send-row { align-items: flex-start; }
.send-row .tag { margin-top: 2px; }
.send-err { color: #8A2A1C; margin-top: 4px; }
.send-msg { margin-top: 6px; font-size: 14px; }
.send-msg summary { cursor: pointer; color: var(--teal); font-weight: 700; }
.send-msg p { margin-top: 8px; padding: 12px 14px; background: var(--sand); border-radius: 12px; line-height: 1.5; color: var(--soft); }
[aria-busy="true"] { opacity: .6; transition: opacity .15s; }
/* iPad/iPhone: campos de data e hora não estouram a coluna */
.grid-2 > * { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; min-height: 52px; }
input::-webkit-date-and-time-value { text-align: left; }
.chip { font-size: 13px; font-weight: 500; background: var(--sand); color: var(--soft); padding: 5px 10px; border-radius: 999px; }
.chip.on { background: #DDEFD0; color: #1F4A12; font-weight: 700; }

/* ---------- Formulários ---------- */
label, .label { display: block; font-size: 14px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--field); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; min-height: 46px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(44, 122, 98, 0.18); border-color: var(--teal); }
input:disabled { background: var(--sand); color: var(--muted); }
.search { position: relative; flex: 1 1 240px; }
.search input { padding-left: 44px; }
.search svg { position: absolute; left: 14px; top: 13px; color: var(--muted); }

.switch { width: 52px; height: 30px; flex: 0 0 auto; border: 0; border-radius: 15px; padding: 4px; display: flex; align-items: center; justify-content: flex-start; cursor: pointer; background: var(--line-2); transition: background-color .15s ease; }
.switch::after { content: ""; width: 22px; height: 22px; border-radius: 11px; background: var(--field); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--teal); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid rgba(44, 122, 98, 0.35); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--field); border: 1px solid var(--line-2); border-radius: 12px; }

/* ---------- Cabeçalhos de página ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--teal); text-decoration: none; min-height: 44px; }
.agent-head { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: flex-start; margin: 4px 0 24px; }
.agent-title { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 8px; }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; overflow-x: auto; }
.tabs a { display: flex; align-items: center; padding: 14px 4px; margin-bottom: -1px; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--muted); min-height: 44px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { border-color: var(--ink); color: var(--ink); font-weight: 700; }

/* ---------- Meus agentes ---------- */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.agent-card { display: flex; flex-direction: column; gap: 18px; text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.agent-card:hover { border-color: var(--teal); color: var(--ink); transform: translateY(-2px); }
.agent-card .action { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--teal); padding-top: 16px; border-top: 1px solid var(--line); margin-top: auto; }
.new-card { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--ink); min-height: 280px; background: transparent; font: inherit; cursor: pointer; }
.new-card:hover { border-color: var(--teal); background: rgba(44, 122, 98, 0.04); }
.plus-dot { width: 52px; height: 52px; border-radius: 26px; background: var(--lime); color: var(--dark); display: flex; align-items: center; justify-content: center; }

/* ---------- Conexão ---------- */
.qr-frame { background: var(--dark); padding: 16px; border-radius: 24px; }
.qr-frame img, .qr-placeholder { width: 248px; height: 248px; border-radius: 16px; background: var(--field); display: block; }
.qr-placeholder { display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--muted); font-size: 14px; }
.waiting { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #6B4A00; }
.pulse { width: 10px; height: 10px; border-radius: 5px; background: #D99A0B; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.step-n { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 18px; background: var(--dark); color: var(--lime); font-family: var(--display); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.pair { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 18px; background: var(--sand); border-radius: 14px; }
.pair-code { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.next-step { display: flex; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); background: var(--field); }
.next-step:hover { border-color: var(--teal); color: var(--ink); }
.phone-box { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--dark-2); border-radius: 14px; }
.price-big { font-family: var(--display); font-size: 40px; font-weight: 800; color: var(--lime); }
.check-line { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; font-size: 15px; }
.btn.on-dark-danger { background: transparent; color: #F2B8AD; border: 1px solid #5A3A34; padding: 11px 20px; }
.btn.on-dark-danger:hover { background: #24171A; }

/* ---------- Comportamento ---------- */
.behavior { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.behavior-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; }
.behavior-body { padding: 22px 24px 26px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.save-bar { position: sticky; bottom: 16px; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--dark); color: var(--on-dark); border-radius: 18px; padding: 14px 14px 14px 22px; z-index: 5; box-shadow: 0 10px 30px rgba(14, 23, 20, 0.18); }

/* ---------- Grupos ---------- */
.group-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--field); }
.group-row.is-active { background: #EFF6E6; border-color: #9CC98A; }
.group-row.is-active .group-ico { background: var(--dark); color: var(--lime); }
.group-row.selected { box-shadow: 0 0 0 2px var(--teal); }
.group-section { margin-bottom: 28px; }
.section-title { margin-bottom: 12px; align-items: baseline; }
.chip.active { background: var(--dark); color: var(--lime); font-weight: 700; }
.group-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 20px; background: var(--sand); color: var(--soft); display: flex; align-items: center; justify-content: center; }
.tri { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.tri label { margin: 0; font-weight: 500; font-size: 15px; }
.tri select { width: auto; flex: 1 1 210px; max-width: 100%; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.side-panel { flex: 1 1 340px; padding: 24px; align-self: flex-start; position: sticky; top: 24px; }

/* ---------- Listas ---------- */
.kb-item { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--field); display: flex; flex-direction: column; gap: 8px; }
.kb-item.editing { border-color: var(--teal); background: #EFF6E6; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.date-chip { flex: 0 0 auto; min-width: 64px; padding: 8px 10px; border-radius: 12px; background: var(--dark); color: var(--lime); font-family: var(--display); font-weight: 700; font-size: 15px; text-align: center; }
.empty { padding: 20px; border: 1px dashed var(--line-2); border-radius: 14px; text-align: center; }
.sub-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 18px 0; border-top: 1px solid var(--line); }

/* ---------- Modal e avisos ---------- */
.modal { max-height: calc(100vh - 48px); overflow-y: auto; }
.icon-chip.sm { width: 34px; height: 34px; border-radius: 10px; }
.does, .doesnt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.does li { display: flex; gap: 12px; align-items: flex-start; }
.doesnt li { display: flex; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--soft); }
.doesnt li span { font-weight: 700; color: var(--muted); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.modal.wide { max-width: 1080px; margin-top: 3vh; padding: 0; gap: 0; display: flex; flex-direction: column; max-height: calc(100vh - 48px); overflow: hidden; }
.cz-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 28px 32px 20px; border-bottom: 1px solid var(--line); }
.cz-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; padding: 24px 32px; overflow-y: auto; }
.cz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.cz-field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.cz-side { display: flex; flex-direction: column; gap: 16px; padding-left: 28px; border-left: 1px solid var(--line); }
.cz-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 18px 32px; border-top: 1px solid var(--line); }
@media (max-width: 820px) {
  .cz-body { grid-template-columns: 1fr; }
  .cz-side { padding-left: 0; border-left: 0; }
  .cz-head, .cz-body, .cz-foot { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 520px) { .cz-grid { grid-template-columns: 1fr; } }
.notice.warn { background: #FCEBC7; color: #5A3E00; }
.modal-bg { position: fixed; inset: 0; background: rgba(14, 23, 20, 0.62); display: flex; align-items: flex-start; justify-content: center; padding: 24px; z-index: 40; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; margin-top: 6vh; background: var(--cream); border-radius: 24px; padding: 36px; display: flex; flex-direction: column; gap: 22px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--dark); color: var(--cream); padding: 12px 20px; border-radius: 12px; font-size: 15px; font-weight: 500; opacity: 0; transition: all .2s; pointer-events: none; z-index: 50; max-width: 90vw; box-shadow: 0 10px 30px rgba(14, 23, 20, 0.25); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }
.loading { padding: 48px 0; color: var(--muted); }

/* ---------- Login ---------- */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-aside { flex: 1 1 520px; background: var(--dark); color: var(--cream); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-aside h1 { color: var(--cream); font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 20px; }
.auth-main { flex: 1 1 480px; padding: 56px 32px; display: flex; align-items: center; justify-content: center; }
.auth-box { width: 100%; max-width: 440px; }
.auth-tabs { display: flex; gap: 4px; background: #E9E5D8; border-radius: 14px; padding: 4px; margin-bottom: 28px; }
.auth-tabs button { flex: 1; font: inherit; font-size: 15px; font-weight: 500; border: 0; border-radius: 10px; padding: 10px; min-height: 44px; cursor: pointer; background: transparent; color: var(--muted); }
.auth-tabs button.active { background: var(--field); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(14, 23, 20, 0.08); }
.bubble { max-width: 84%; border-radius: 18px; padding: 12px 16px; }
.bubble.in { align-self: flex-start; background: var(--dark-3); }
.bubble.out { align-self: flex-end; background: var(--lime); color: var(--dark); }
.bubble .who { margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--lime); }
.bubble.out .who { color: #2A4A0C; }

@media (max-width: 720px) {
  .main { padding: 24px 18px 48px; }
  .sidebar { padding: 18px; gap: 16px; }
  .sidebar-spacer { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .h1 { font-size: 28px; }
  .auth-aside { padding: 32px 24px; }
  .auth-aside h1 { font-size: 34px; }
  .modal { padding: 24px; }
  .side-panel { position: static; }
  .user-box { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; }
  .agent-head .row { width: 100%; }
}

/* ---------- Ferramentas da lista de grupos ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-bar .seg-btn { background: var(--sand); }
.notice.info { background: #E3EEF3; color: #173B4A; align-items: center; margin-bottom: 14px; }
.notice.suggest { background: #EFF6E6; color: #1F4A12; border: 1px solid #C9E3B5; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.notice.warn { margin-bottom: 14px; }
.modal .notice.warn { margin-bottom: 0; }
.chip.paused { background: #FCEBC7; color: #6B4A00; font-weight: 700; }
.chip.leaving { background: #F8DDD8; color: #8A2A1C; font-weight: 700; }
.chip.admin { display: inline-flex; align-items: center; gap: 4px; background: #E3EEF3; color: #173B4A; font-weight: 700; }
.group-row.is-paused { background: #FBF6EA; border-color: #E8D7A8; }
.group-row.is-paused .group-ico { background: #FCEBC7; color: #6B4A00; }
.group-row.is-leaving { opacity: .6; }
.row-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: #8A2A1C; margin-top: 6px; }
.row-warn svg { flex: none; margin-top: 2px; }
.pop-menu { position: absolute; z-index: 60; min-width: 250px; background: var(--cream); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(14, 23, 20, .18); padding: 6px; }
.pop-menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink, #0E1714); }
.pop-menu button:hover, .pop-menu button:focus-visible { background: var(--sand); outline: none; }
.pop-menu button.danger { color: #8A2A1C; }
.pop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.btn.solid-danger { background: var(--danger); color: #fff; border: 0; }
.btn.solid-danger:hover { background: #8A2A1C; }
.btn.solid-danger:disabled { opacity: .45; cursor: not-allowed; }
.check, label.check { display: inline-flex; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.check input, .idle-row input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.idle-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.idle-row input { margin-top: 2px; }
.switch:disabled, .icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Favoritos e insights ---------- */
.fav-btn { width: 36px; height: 36px; flex: none; border: 0; background: none; border-radius: 10px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-right: -6px; }
.fav-btn:hover { background: var(--sand); color: #B7791F; }
.fav-btn.on { color: #D69E2E; }
.group-row.is-fav:not(.is-active):not(.is-paused) { background: #FFFBEF; border-color: #EBD9A6; }
.chip.watch { display: inline-flex; align-items: center; gap: 4px; background: #EDE7F6; color: #4A2F7A; font-weight: 700; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--lime); color: var(--dark); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge.hot { background: #E5533D; color: #fff; }
.ins-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ins-main { flex: 999 1 520px; min-width: 0; }
.ins-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ins-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.ins-tile { background: var(--field); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.ins-tile b { display: block; font-family: var(--display); font-size: 30px; line-height: 1.1; color: var(--ink); }
.ins-tile.hot b { color: #B4321F; }
.ins-card { position: relative; background: var(--field); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 18px 24px; overflow: hidden; }
.ins-card + .ins-card { margin-top: 12px; }
.ins-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--imp, #C9C3B1); }
.ins-card.imp-urgente { --imp: #D9432F; }
.ins-card.imp-alta { --imp: #E8892B; }
.ins-card.imp-media { --imp: #E5C04B; }
.ins-card.imp-baixa { --imp: #B9B4A6; }
.ins-card.is-new { box-shadow: 0 0 0 2px rgba(44, 122, 98, .18); }
.ins-card.is-closed { opacity: .65; }
.imp { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.imp-urgente .imp { background: #F8DDD8; color: #8A2A1C; }
.imp-alta .imp { background: #FCE3CC; color: #7A3E06; }
.imp-media .imp { background: #FBF0C8; color: #6B5300; }
.imp-baixa .imp { background: #ECEAE3; color: #55524A; }
.new-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); display: inline-block; }
.due { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #173B4A; background: #E3EEF3; padding: 6px 10px; border-radius: 10px; margin-top: 10px; }
.due.soon { background: #F8DDD8; color: #8A2A1C; }
.ins-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.ins-quote { margin-top: 8px; padding: 10px 12px; background: var(--sand); border-radius: 10px; font-size: 14px; line-height: 1.5; color: var(--soft); }
.ins-quote + .ins-quote { margin-top: 6px; }
.ins-set summary { list-style: none; cursor: pointer; }
.ins-set summary::-webkit-details-marker { display: none; }
.ins-set summary::after { content: "▾"; color: var(--muted); font-size: 18px; transition: transform .15s; }
.ins-set[open] summary::after { transform: rotate(180deg); }

/* ---------- Menu lateral recolhível ---------- */
.sidebar { position: relative; transition: flex-basis .2s ease, padding .2s ease; }
.side-toggle { position: absolute; top: 28px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--on-dark); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.side-toggle:hover { background: var(--dark-2); color: var(--cream); }
.side-toggle:focus-visible { outline: 2px solid var(--lime); }
.shell.collapsed .side-toggle .chev { transform: rotate(180deg); transform-origin: 14px 12px; }
.sidebar .brand { padding-right: 44px; }
@media (min-width: 721px) {
  .sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
  .shell.collapsed .sidebar { flex: 0 0 80px; padding: 24px 12px; align-items: center; }
  .shell.collapsed .brand { padding: 0; }
  .shell.collapsed .brand-name { display: none; }
  .shell.collapsed .side-toggle { position: static; }
  .shell.collapsed .nav { width: 100%; }
  .shell.collapsed .nav a { font-size: 0; justify-content: center; padding: 12px 0; position: relative; gap: 0; }
  .shell.collapsed .nav-badge { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .shell.collapsed .user-box { padding: 10px 0; background: none; border: 0; align-items: center; }
  .shell.collapsed .user-box > div > div { display: none; }
  .shell.collapsed .logout { font-size: 0; gap: 0; justify-content: center; width: 44px; }
}
@media (max-width: 720px) {
  .side-toggle { top: 16px; }
  .shell.collapsed .nav, .shell.collapsed .user-box { display: none; }
}

/* ---------- Ajuda: ícone "?" ---------- */
.help-dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 6px; vertical-align: 1px; border-radius: 50%; border: 1.5px solid var(--teal); background: transparent; color: var(--teal); font: 800 12px/1 var(--text); cursor: pointer; padding: 0; }
.help-dot:hover, .help-dot:focus-visible { background: var(--teal); color: var(--cream); outline: none; }
.tip-pop { position: fixed; z-index: 90; max-width: 320px; background: var(--dark); color: var(--cream); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.5; box-shadow: 0 16px 40px rgba(14,23,20,.3); animation: tipIn .15s ease; }
.tip-pop .tip-title { font-weight: 700; color: var(--lime); margin-bottom: 4px; }
.tip-pop b { color: var(--cream); }
.tip-more { margin-top: 10px; background: none; border: 0; padding: 0; color: var(--lime); font: inherit; font-weight: 700; cursor: pointer; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Ajuda: botão flutuante, balão e gaveta ---------- */
.help-fab { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.help-btn { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 26px; background: var(--dark); color: var(--lime); font: 700 15px var(--text); cursor: pointer; box-shadow: 0 10px 30px rgba(14,23,20,.28); }
.help-btn:hover { background: #1B2A24; }
.help-btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.help-fab.attention .help-btn { animation: helpPulse 1.6s ease-in-out infinite; }
@keyframes helpPulse { 0%, 100% { box-shadow: 0 10px 30px rgba(14,23,20,.28), 0 0 0 0 rgba(184,242,90,.55); } 50% { box-shadow: 0 10px 30px rgba(14,23,20,.28), 0 0 0 12px rgba(184,242,90,0); } }
.help-bubble { position: relative; width: 300px; background: var(--cream); border: 1px solid var(--line); border-radius: 18px 18px 6px 18px; padding: 16px 40px 16px 18px; box-shadow: 0 16px 40px rgba(14,23,20,.18); cursor: pointer; animation: bubbleIn .35s cubic-bezier(.2,1.4,.4,1); }
.help-bubble[hidden] { display: none; }
.help-bubble-t { font-weight: 700; font-size: 15px; color: var(--ink); min-height: 22px; }
.help-bubble-t::after { content: "▍"; color: var(--teal); animation: caret 1s steps(1) infinite; }
.help-bubble-s { font-size: 13px; color: var(--soft); margin-top: 4px; }
.help-bubble-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; }
.help-bubble-x:hover { background: var(--sand); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes caret { 50% { opacity: 0; } }
.help-drawer-bg { position: fixed; inset: 0; z-index: 80; background: rgba(14,23,20,0); transition: background .2s; }
.help-drawer-bg.open { background: rgba(14,23,20,.45); }
.help-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--cream); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 40px rgba(14,23,20,.2); }
.help-drawer-bg.open .help-drawer { transform: none; }
.help-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 24px 24px 12px; }
.help-search { padding: 0 24px 12px; border-bottom: 1px solid var(--line); }
.help-body { flex: 1; overflow-y: auto; padding: 16px 24px 24px; }
.help-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.help-intro { font-size: 15px; line-height: 1.55; color: var(--soft); }
.help-h { font-family: var(--text); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); margin: 22px 0 8px; }
.help-item { border-bottom: 1px solid var(--line); }
.help-item summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 15px; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::before { content: "+"; color: var(--teal); font-weight: 800; width: 14px; flex: none; }
.help-item[open] summary::before { content: "−"; }
.help-item p { padding: 0 0 14px 22px; font-size: 14px; line-height: 1.6; color: var(--soft); }
.help-avoid { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.help-avoid li { position: relative; padding: 10px 12px 10px 36px; background: #FCEBC7; color: #5A3E00; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.help-avoid li::before { content: "!"; position: absolute; left: 12px; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: #C98A12; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.help-where { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--teal); background: #E6F0EA; padding: 2px 7px; border-radius: 6px; flex: none; }
.help-count { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.help-empty p { font-size: 14px; color: var(--soft); margin-top: 6px; }
@media (max-width: 720px) { .help-fab { right: 14px; bottom: 14px; } .help-btn span { display: none; } .help-btn { width: 52px; padding: 0; justify-content: center; } .help-bubble { width: min(300px, calc(100vw - 28px)); } }
@media (prefers-reduced-motion: reduce) { .help-fab.attention .help-btn, .help-bubble, .help-bubble-t::after { animation: none; } .help-drawer, .help-drawer-bg { transition: none; } }
.main { padding-bottom: 110px; }

/* ---------- Abas internas (Agenda) ---------- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.subtabs button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--soft); font: 600 15px var(--text); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.subtabs button b { font-size: 12px; background: var(--sand); color: var(--soft); border-radius: 999px; padding: 2px 8px; }
.subtabs button[aria-selected="true"] { background: var(--dark); border-color: var(--dark); color: var(--lime); }
.subtabs button[aria-selected="true"] b { background: var(--lime); color: var(--dark); }

.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.notice.ok-n { background: #EFF6E6; color: #1F4A12; }

.svc-banner { margin: 0 0 24px; align-items: center; flex-wrap: wrap; }


.freq { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; margin: 0; }
.freq legend { font-size: 14px; font-weight: 700; padding: 0 6px; }
.freq:disabled { opacity: .5; }

.label-like { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.rcpt-list { display: flex; flex-direction: column; gap: 8px; }
.rcpt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name del" "phone del"; gap: 6px 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.rcpt-row [data-rname] { grid-area: name; }
.rcpt-row [data-rphone] { grid-area: phone; }
.rcpt-row [data-rdel] { grid-area: del; }
