:root {
  --bg: #0f1218;
  --panel: #171b23;
  --panel-2: #1e232d;
  --border: #2a303c;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #a855f7;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin-bottom: 12px; }

/* buttons & inputs */
.btn { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #3a4252; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.success { background: #15803d; border-color: #15803d; color: #fff; }
.btn.danger { background: transparent; border-color: #7f1d1d; color: #fca5a5; }
.btn.danger:hover { background: #7f1d1d; color: #fff; }
.btn.warn { background: #b45309; border-color: #b45309; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
.error-msg { color: #fca5a5; min-height: 18px; font-size: 13px; margin-bottom: 8px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.inline { display: flex; gap: 6px; align-items: center; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.login-card p { margin: 4px 0 20px; }

/* layout */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; padding: 4px 8px 18px; }
.brand.big { font-size: 22px; padding: 0; }
.logo { background: var(--primary); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; cursor: pointer; }
nav a span { flex: 1; }
nav a:hover { background: var(--panel-2); }
nav a.active { background: rgba(59,130,246,.15); color: #93c5fd; }
.pill { background: var(--primary); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.pill:empty { display: none; }
.me { border-top: 1px solid var(--border); padding: 12px 8px 0; display: grid; gap: 2px; }
.me .btn { margin-top: 8px; }
main { flex: 1; min-width: 0; padding: 0 28px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; gap: 12px; }
.topbar h1 { font-size: 22px; }

/* cards */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.stat.red .v { color: #fca5a5; }
.stat.green .v { color: #86efac; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 220px; flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 12.5px; }
.chip.on { background: rgba(59,130,246,.15); border-color: var(--primary); color: #93c5fd; }

/* call list */
.day-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }
.day-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.call { display: grid; grid-template-columns: 92px 1.6fr 1fr 1fr 130px auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 6px; cursor: pointer; }
.call:hover { border-color: #3a4252; }
.call.venda { border-left-color: var(--green); }
.call.suporte { border-left-color: var(--purple); }
.call.overdue { background: linear-gradient(90deg, rgba(239,68,68,.10), var(--panel) 40%); }
.call.soon { background: linear-gradient(90deg, rgba(245,158,11,.12), var(--panel) 40%); }
.call .time { font-weight: 700; font-size: 16px; }
.call .time small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.call .who b { display: block; }
.call .who small, .call .meta small { color: var(--muted); display: block; font-size: 12px; }
.call .note-preview { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.call .actions { display: flex; gap: 6px; justify-content: flex-end; }
.badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; font-weight: 600; border: 1px solid transparent; }
.b-agendada { background: rgba(59,130,246,.15); color: #93c5fd; }
.b-realizada { background: rgba(34,197,94,.15); color: #86efac; }
.b-nao_compareceu { background: rgba(239,68,68,.15); color: #fca5a5; }
.b-remarcada { background: rgba(245,158,11,.15); color: #fcd34d; }
.b-cancelada { background: rgba(139,147,163,.15); color: var(--muted); }
.b-pago { background: #15803d; color: #fff; }
.b-venda { background: rgba(34,197,94,.12); color: #86efac; }
.b-suporte { background: rgba(168,85,247,.15); color: #d8b4fe; }
.b-warn { background: rgba(245,158,11,.15); color: #fcd34d; }
.b-late { background: rgba(239,68,68,.15); color: #fca5a5; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; border: 1px dashed var(--border); border-radius: var(--radius); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
tr.inactive td { opacity: .5; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 620px; padding: 22px; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.seg button { flex: 1; background: transparent; color: var(--muted); border: 0; padding: 8px; cursor: pointer; font: inherit; }
.seg button.on { background: var(--primary); color: #fff; }
.hint { font-size: 12px; color: var(--muted); margin-top: -6px; margin-bottom: 10px; }
.hint.ok { color: #86efac; }
.hint.bad { color: #fca5a5; }

.conflicts { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.conflicts.conflito { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.4); }
.conflicts.simultanea { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.35); }
.conflicts ul { margin: 6px 0 0; padding-left: 18px; }
.conflicts li { margin: 2px 0; }

/* detail */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; margin-bottom: 16px; }
.detail-grid div small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.status-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.paybox { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.paybox input { width: 140px; }
.paybox .grow { flex: 1; }
.notes { display: grid; gap: 8px; margin-top: 10px; }
.note { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
.note header { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.history { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; padding-left: 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 12px; cursor: pointer; font: inherit; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); }
code.token { background: var(--bg); border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; display: block; word-break: break-all; font-size: 12.5px; }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 8px; max-width: 340px; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: in .2s ease; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--amber); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }

.calls-wrap { container-type: inline-size; }
@container (max-width: 760px) {
  .call { grid-template-columns: 80px 1fr 110px auto; }
  .call .meta { display: none; }
}
@container (max-width: 480px) {
  .call { grid-template-columns: 70px 1fr auto; }
  .call .col-status { display: none; }
}
@media (max-width: 1200px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr 1fr; }
}
.more-btn { display: none !important; }
.more-list { display: grid; gap: 6px; }
.more-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 14px; font: inherit; font-size: 15px; cursor: pointer; }
.more-item span { flex: 1; }

/* ---------------- celular ---------------- */
@media (max-width: 720px) {
  #app { flex-direction: column; }
  main { padding: 0 12px calc(84px + env(safe-area-inset-bottom)); }

  /* navegação vira barra fixa embaixo */
  .sidebar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); flex-direction: row; }
  .sidebar .brand, .sidebar .me { display: none; }
  nav { flex-direction: row; gap: 0; }
  nav a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 19px; border-radius: 10px; position: relative; min-width: 0; }
  nav a span { flex: none; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  nav a.secondary { display: none; }
  .more-btn { display: flex !important; }
  nav .pill { position: absolute; top: 2px; left: 50%; margin-left: 6px; font-size: 10px; padding: 0 5px; }
  nav .dot { display: none; }

  .topbar { padding: 14px 0 10px; }
  .topbar h1 { font-size: 20px; }

  /* cartões de números: 2 por linha */
  .grid-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: 22px; }
  .panel { padding: 12px; }

  /* filtros */
  .filters input, .filters select { min-width: 0; flex: 1 1 45%; }
  .filters input[type=search] { flex-basis: 100%; }

  /* tabelas viram cartões */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; margin-bottom: 8px; }
  td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 5px 0; text-align: right !important; word-break: break-word; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0; }
  td[data-label=""]::before { display: none; }
  td[data-label=""] { justify-content: flex-end; }
  td:empty { display: none; }

  /* modal em tela cheia e detalhe da call */
  .modal-head h2 { font-size: 17px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .paybox { flex-wrap: wrap; }
  .paybox .grow { flex-basis: 100%; }
  .paybox input { flex: 1; width: auto; }
  .status-bar .btn { flex: 1 1 auto; }
  .modal-foot { flex-wrap: wrap; }

  /* iPhone não dá zoom em campos com fonte >= 16px */
  input, select, textarea { font-size: 16px; }

  #toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .cols { gap: 0; }
}

/* adição rápida */
.topbar-actions { display: flex; gap: 8px; align-items: center; flex: 1; justify-content: flex-end; }
.quick-add { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 0 0 0 10px; flex: 1; max-width: 460px; }
.quick-add:focus-within { border-color: var(--primary); }
.quick-add input { border: 0; background: transparent; padding: 8px 10px 8px 0; }
.quick-add input:focus { border: 0; }
.parse-box { background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.35); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.parse-box .btn { margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--green); }
.dot.err { background: var(--red); }
.dot:empty { display: inline-block; }
.b-bot { background: rgba(59,130,246,.15); color: #93c5fd; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; }
.parse-result { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin-top: 10px; font-size: 13px; }
.parse-result b { font-weight: 600; }
@media (max-width: 720px) { .topbar { flex-wrap: wrap; } .quick-add { max-width: none; order: 2; flex-basis: 100%; } }

/* formulário simplificado: bolhas de conta, dia e horário */
.field { margin-bottom: 14px; }
.flabel { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip.pick { padding: 8px 14px; font-size: 13.5px; color: var(--text); background: var(--panel-2); }
.chip.pick small { color: var(--muted); font-size: 11.5px; margin-left: 2px; }
.chip.pick.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.pick.on small { color: rgba(255,255,255,.8); }
.period-chips { margin-bottom: 12px; }
.date-input, .time-input { width: auto; min-width: 130px; padding: 7px 10px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; }
.slot { position: relative; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 99px; padding: 8px 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.slot:hover { border-color: #3a4252; }
.slot.past { opacity: .4; }
.slot.busy1 { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.7); color: #fcd34d; }
.slot.busy2 { background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.75); color: #fca5a5; }
.slot.on { background: var(--primary); border-color: var(--primary); color: #fff; opacity: 1; }
.slot b { position: absolute; top: -6px; right: -4px; min-width: 17px; height: 17px; border-radius: 9px; font-size: 10.5px; line-height: 17px; color: #111; background: var(--amber); }
.slot.busy2 b { background: var(--red); color: #fff; }
.legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.lg.y { background: var(--amber); } .lg.r { background: var(--red); margin-left: 6px; }
@media (max-width: 720px) {
  .overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; max-width: none; padding: 18px 16px 28px; }
  .slots { grid-template-columns: repeat(4, 1fr); max-height: none; }
  .chip.pick { padding: 10px 14px; }
  .row { flex-direction: row; gap: 10px; }
}
@media (max-width: 720px) {
  .topbar-actions { flex-wrap: wrap; flex-basis: 100%; }
  .topbar-actions .quick-add { order: 2; flex-basis: 100%; }
  .topbar-actions #new-call-btn { flex: 1; }
}
/* linhas de call em espaço estreito (celular / painel) */
.call .who { min-width: 0; }
@container (max-width: 480px) {
  .call { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  .call .time { font-size: 15px; }
  .call .note-preview { max-width: 100%; }
  .call .actions > span { display: none; }
}
@media (max-width: 720px) { .paybox input { flex: 1 1 0; min-width: 0; width: auto; } }

/* alternar lista / blocos */
.list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.list-head .period-chips { margin-bottom: 0; }
.mode-toggle { margin: 0; flex-shrink: 0; }
.mode-toggle button { padding: 7px 12px; font-size: 13px; white-space: nowrap; }

/* modo blocos: 4-5 por linha no computador */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.tile:hover { border-color: #3a4252; }
.tile.venda { border-top-color: var(--green); }
.tile.suporte { border-top-color: var(--purple); }
.tile.overdue { background: linear-gradient(180deg, rgba(239,68,68,.10), var(--panel) 60%); }
.tile.soon { background: linear-gradient(180deg, rgba(245,158,11,.12), var(--panel) 60%); }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile-time { font-size: 17px; font-weight: 700; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; min-height: 28px; }
@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tile { padding: 8px 10px; }
  .tile-time { font-size: 15px; }
  .list-head { flex-direction: column-reverse; align-items: stretch; }
  .mode-toggle { align-self: flex-end; }
}
.tile-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; word-break: break-word; }

/* barras de rolagem e seletores de data/hora nativos no tema escuro */
:root { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: #3a4252 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a4252; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* horários: todos visíveis, sem rolagem própria (era o que gerava a barra branca) */
.slots { max-height: none !important; overflow: visible; padding: 7px 6px 0 0; }

/* modal acompanha o tamanho/zoom da janela; botões de salvar sempre visíveis */
.overlay { padding: clamp(8px, 4vh, 40px) 12px; }
.modal { width: 100%; }
.modal-foot { position: sticky; bottom: 0; background: var(--panel); padding: 10px 0 2px; margin-top: 8px; z-index: 2; }

/* ações rápidas: anotação, remarcar, realizada, aguardando, pago */
.qa { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.qa-btn { position: relative; display: inline-grid; place-items: center; width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.qa-btn:hover { border-color: var(--primary); }
.qa-btn.on { background: rgba(245,158,11,.2); border-color: var(--amber); }
.qa-btn i { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--primary); color: #fff; font-style: normal; font-size: 10px; line-height: 16px; padding: 0 3px; }
.qa-pay { height: 30px; white-space: nowrap; }
.tile-foot .qa { width: 100%; }
.tile-foot .qa-pay { margin-left: auto; padding: 4px 8px; }
.b-await { background: rgba(245,158,11,.18); color: #fcd34d; }
.pill.warn { background: var(--amber); color: #111; }
.call .actions .qa { justify-content: flex-end; }
@container (max-width: 640px) {
  .call { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .call .actions { grid-column: 1 / -1; }
  .call .actions .qa { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .modal-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .qa-btn { width: 36px; height: 34px; }
  .qa-pay { height: 34px; }
  .tile .qa-btn { width: 30px; height: 30px; font-size: 13px; }
  .tile .qa-pay { height: 30px; padding: 2px 7px; font-size: 12px; }
}
@media (max-width: 720px) { nav a span { font-size: 10px; letter-spacing: -.2px; } nav a { padding: 6px 0; } }

/* filtro de tipo na aba Calls: vendas verde, suporte roxo */
.type-chips { margin-bottom: 10px; }
.chip.pick.t-venda.on { background: #15803d; border-color: #15803d; }
.chip.pick.t-suporte.on { background: #7e22ce; border-color: #7e22ce; }
.chip.pick.t-venda:not(.on) { border-color: rgba(34,197,94,.45); }
.chip.pick.t-suporte:not(.on) { border-color: rgba(168,85,247,.5); }

/* última anotação dentro do bloco (até 3 linhas) */
.tile-note { font-size: 12px; color: #c9ced8; background: var(--panel-2); border-radius: 6px; padding: 5px 7px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }

/* sugestão de nomes do formulário de call */
.suggest-wrap { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% - 8px); z-index: 30; max-height: 240px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.suggest-item { display: block; width: 100%; padding: 8px 12px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.suggest-item small { display: block; font-size: 11.5px; }
.suggest-item:hover, .suggest-item.on { background: rgba(59,130,246,.18); }
#name-link:empty { display: none; }

/* histórico (Passadas): faixas, período personalizado e ordem */
.past-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; padding: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.past-bar .chips { flex: 1 1 auto; }
.past-custom { display: flex; gap: 8px; }
.past-custom label { margin: 0; }
.past-custom input { width: auto; }
#list-more { margin: 12px 0 4px; }
@media (max-width: 720px) {
  .past-custom { flex-basis: 100%; }
  .past-custom label { flex: 1; }
  .past-custom input { width: 100%; }
  #past-order { flex-basis: 100%; }
}

/* destaque da call recém-agendada */
@keyframes cd-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } 25%, 60% { box-shadow: 0 0 0 3px rgba(59,130,246,.85); } }
.call.flash, .tile.flash { animation: cd-flash 1.3s ease 2; }
.btn:disabled { cursor: progress; }

/* lembrete de call */
.rem { font-size: 12px; font-weight: 500; margin-left: 2px; cursor: help; }
.rem.muted { opacity: .55; }
.rem.bad { filter: saturate(1.6); }
.rembox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; font-size: 13.5px; }
.rembox .grow { flex: 1 1 220px; }
.rembox.ok { border-color: rgba(34,197,94,.45); }
.rembox.bad { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.08); }
.rembox.warn { border-color: rgba(245,158,11,.5); }
.rembox code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0 14px 0 0; color: var(--text); font-size: 14px; cursor: pointer; }
.switch input { width: 18px; height: 18px; margin: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
