/* KualoFlow - interface. GotWork Labs. */
:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --muted: #475569;
  --primary: #4F46E5;
  --primary-ink: #FFFFFF;
  --primary-soft: #EEF2FF;
  --primary-text: #3730A3;
  --sidebar: #0F172A;
  --sidebar-text: #CBD5E1;
  --sidebar-active: #1E293B;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --success: #15803D;
  --success-soft: #DCFCE7;
  --warning: #9A3412;
  --warning-soft: #FFEDD5;
  /* cores de temperatura do lead */
  --cold-bg: #FEF9C3; --cold-text: #713F12; --cold-dot: #CA8A04;
  --warm-bg: #FFEDD5; --warm-text: #7C2D12; --warm-dot: #EA580C;
  --hot-bg: #DCFCE7;  --hot-text: #14532D;  --hot-dot: #16A34A;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--primary-text); }
a:hover { color: #312E81; }
h1 { font-size: 24px; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- estrutura ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar {
  flex: 1 1 240px; max-width: 100%;
  background: var(--sidebar); color: var(--sidebar-text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; color: #fff; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand img { max-height: 32px; max-width: 160px; }
.brand-name { font-weight: 700; font-size: 18px; }
.brand .brand-logo { width: 34px; height: 34px; max-width: none; flex: none; }
.brand-word { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; color: #fff; }
.brand-word b { font-weight: 800; }
.nav-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #E2E8F0; padding: 16px 12px 4px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.nav-link { color: var(--sidebar-text); font-weight: 400; text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
.nav-link .nav-text { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 6px; min-width: 0; }
.nav-icon { flex: none; opacity: .85; }
.nav-link:hover { background: var(--sidebar-active); color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 400; }
.nav-soon { font-size: 10.5px; color: #94A3B8; border: 1px solid #334155; border-radius: 999px; padding: 0 6px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; font-size: 12px; color: #94A3B8; }
.sidebar-foot a { color: #C7D2FE; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.content { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.impersonation { background: #7C2D12; color: #fff; padding: 8px 28px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.impersonation button { background: #fff; color: #7C2D12; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.btn, button {
  font: inherit; font-weight: 600; font-size: 14px;
  min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:hover, button:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #4338CA; color: #fff; }
.btn-danger { color: var(--danger); border-color: #FCA5A5; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--primary-text); font-weight: 500; text-decoration: underline; }
.btn-link:hover { background: none; }
form.inline { display: inline; }

label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; }
.field small { color: var(--muted); margin-top: 4px; font-size: 12px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=week], input[type=tel], input[type=url], select, textarea {
  font: inherit; font-size: 14px; width: 100%;
  min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
input[disabled] { background: var(--surface-2); color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; }
.check input { width: 18px; height: 18px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.span-all { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 10px 14px; background: var(--surface-2); white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid #F1F5F9; vertical-align: middle; }
tr:hover td { background: #FCFCFE; }
td.num, th.num { text-align: right; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: #F1F5F9; color: #334155; white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-cold { background: var(--cold-bg); color: var(--cold-text); }
.badge-warm { background: var(--warm-bg); color: var(--warm-text); }
.badge-hot { background: var(--hot-bg); color: var(--hot-text); }

.alert { border-radius: 10px; padding: 12px 16px; border: 1px solid; }
.alert-success { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }
.alert-error { background: #FEF2F2; border-color: #FECACA; color: #7F1D1D; }
.alert-info { background: var(--primary-soft); border-color: #C7D2FE; color: var(--primary-text); }
.alert-warning { background: #FFF7ED; border-color: #FED7AA; color: #7C2D12; }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: #C7D2FE; color: var(--primary-text); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 22px; }
.user-menu { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: #334155; font-size: 13px; }
.tab.active { background: var(--text); color: #fff; border-color: var(--text); font-weight: 600; }

/* matriz de permissões */
.perm-matrix td, .perm-matrix th { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.perm-matrix select { min-height: 32px; padding: 2px 8px; font-size: 12.5px; width: auto; }
.perm-fns { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.perm-fns label { font-weight: 500; display: flex; gap: 6px; align-items: center; margin: 0; font-size: 13px; }

/* ---------- autenticação ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; background: var(--sidebar); }
.auth-hero { flex: 1 1 420px; padding: 56px; color: #E2E8F0; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-hero h1 { color: #fff; font-size: 38px; line-height: 1.15; max-width: 520px; }
.auth-hero .temps { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.auth-hero a { color: #C7D2FE; }
.auth-panel { flex: 1 1 460px; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h2 { font-size: 22px; margin: 0; }
.code-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-inputs input { text-align: center; font-size: 22px; font-weight: 600; min-height: 52px; padding: 0; }
.progress { height: 6px; background: #F1F5F9; border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); transition: width 1s linear; }
.qr { width: 196px; height: 196px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.qr canvas, .qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--surface-2); border-radius: 8px; padding: 14px; }
.secret { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; }

.footer-credit { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

@media (max-width: 720px) {
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 12px 16px; }
  .auth-hero { padding: 32px 20px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-card { padding: 24px; }
}

/* Prévia do logo/ícone na tela de Marca, com o X para remover */
.brand-preview { position: relative; display: inline-flex; align-items: center; margin-top: 8px; padding: 6px; border: 1px solid var(--border, #E2E8F0); border-radius: 8px; background: #fff; width: fit-content; }
.brand-preview img { max-height: 40px; max-width: 220px; display: block; }
.brand-preview-x { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: #DC2626; color: #fff; font-size: 15px; line-height: 22px; text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.brand-preview-x:hover { background: #B91C1C; }

/* ---------- fase 2: busca e leads ---------- */
.map { height: 420px; width: 100%; border-radius: var(--radius); z-index: 0; }
.map.sm { height: 260px; }
.map-center-pin { background: #4F46E5; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 6px rgba(0,0,0,.45); cursor: grab; }
.map-center-pin:active { cursor: grabbing; }
.prospect-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.score { display: inline-grid; place-items: center; min-width: 38px; height: 28px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #F1F5F9; color: #334155; }
.score.hot { background: var(--hot-bg); color: var(--hot-text); }
.score.warm { background: var(--warm-bg); color: var(--warm-text); }
.score.cold { background: var(--cold-bg); color: var(--cold-text); }
.score.lg { min-width: 64px; height: 44px; font-size: 20px; }
.dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; word-break: break-word; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.filters > * { flex: 1 1 150px; }
.filters button, .filters .btn { flex: 0 0 auto; }
.stat-link { text-decoration: none; color: inherit; transition: border-color .15s; }
.stat-link:hover { border-color: var(--primary); }

/* ---------- fase 3: página do lead, funil, propostas ---------- */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .lead-grid { grid-template-columns: 1fr; } }
.reasons { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.plain legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; padding: 0; }
.span-all { grid-column: 1 / -1; }
.timeline { max-height: 520px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: 88%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 9px 12px; align-self: flex-start; }
.msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: #EEF2FF; border-color: #C7D2FE; }
.msg.system { align-self: center; background: transparent; border-style: dashed; font-size: 13px; max-width: 100%; }
.msg.pinned { box-shadow: inset 3px 0 0 var(--primary); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.msg-body { white-space: normal; word-break: break-word; font-size: 14px; }
.msg-actions { display: flex; gap: 10px; margin-top: 6px; align-items: flex-start; }
.composer { display: grid; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.composer textarea { min-height: 64px; }
.spacer { flex: 1 1 auto; }
.inline-details { display: inline-block; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
details > summary.btn { list-style: none; display: inline-flex; }
details > summary.btn::-webkit-details-marker { display: none; }
.reminder { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.reminder.late { border-color: #FCA5A5; background: #FEF2F2; }
.reminder.done { opacity: .6; }
.deal-line { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; }
.deal-line:hover { border-color: var(--primary); }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col { flex: 0 0 272px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.board-col.drop { border-color: var(--primary); background: #EEF2FF; }
.board-head { padding: 10px 12px; border-bottom: 1px solid var(--border); border-top: 4px solid var(--stage, #64748B); border-radius: var(--radius) var(--radius) 0 0; }
.board-head strong { display: block; }
.board-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; display: grid; gap: 4px; font-size: 13px; }
.deal-card[draggable="true"]:active { cursor: grabbing; }
.deal-card.dragging { opacity: .5; }
.deal-card a { font-weight: 600; text-decoration: none; color: var(--text); }
.deal-card .move { display: flex; gap: 4px; }
.deal-card .move select { min-height: 28px; padding: 2px 6px; font-size: 12px; }

.items-table input { min-height: 34px; padding: 4px 8px; }
.items-table td { vertical-align: top; }
.totals { display: grid; grid-template-columns: auto auto; gap: 4px 18px; justify-content: end; font-size: 14px; }
.totals .grand { font-size: 18px; font-weight: 700; }

/* ---------- notificações ---------- */
.bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #334155; text-decoration: none; border: 1px solid var(--border); background: var(--surface); }
.bell:hover, .bell.active { border-color: var(--primary); color: var(--primary); }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.notif.unread { background: #EEF2FF; }
.notif:hover { background: var(--surface-2); }

/* ---------- fase 4: WhatsApp e automações ---------- */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; min-height: 560px; }
@media (max-width: 900px) { .inbox { grid-template-columns: 1fr; } }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: calc(100vh - 220px); }
.inbox-item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.inbox-item.active, .inbox-item:hover { background: var(--surface-2); }
.inbox-item .preview { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; }
.chat .timeline { flex: 1 1 auto; max-height: calc(100vh - 330px); min-height: 320px; }
.msg.bot { background: #F0FDF4; border-color: #BBF7D0; }
.action-row { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.action-row [data-for] { display: none; }
.action-row [data-for].show { display: grid; }
pre.code { background: #0F172A; color: #E2E8F0; padding: 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }

/* Histórico de notas do lead */
.score-history > summary { list-style: none; display: inline-flex; width: auto; cursor: pointer; }
.score-history > summary::-webkit-details-marker { display: none; }
.score-history[open] > summary { margin-bottom: 10px; }
.score-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: grid; gap: 12px; }
.score-timeline > li { position: relative; }
.score-timeline > li::before { content: ""; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface, #fff); border: 2px solid var(--primary, #4F46E5); }
.score-timeline details { margin-top: 4px; }
.text-success { color: var(--success); font-weight: 600; }
.text-danger { color: var(--danger, #DC2626); font-weight: 600; }
.api-health ul { margin: 6px 0 4px; padding-left: 18px; }
.api-health li + li { margin-top: 6px; }
[data-live-target] { transition: opacity .15s; }
[data-live-target].is-loading { opacity: .5; }
.list-summary { padding: 0 2px; margin: 4px 0 8px; }

/* ---------- menu: sanfona e menu recolhido ---------- */
button.nav-label { display: flex; width: 100%; align-items: center; justify-content: space-between; background: none; border: 0; min-height: 0; cursor: pointer; text-align: left; font-family: inherit; border-radius: 6px; }
button.nav-label:hover { color: #fff; }
button.nav-label .nav-icon { width: 14px; height: 14px; transition: transform .15s; opacity: .7; }
.navc-main [data-section=main] .nav-items, .navc-platform [data-section=platform] .nav-items, .navc-reseller [data-section=reseller] .nav-items,
.navc-sales [data-section=sales] .nav-items, .navc-team [data-section=team] .nav-items, .navc-settings [data-section=settings] .nav-items,
.navc-help [data-section=help] .nav-items { display: none; }
.navc-platform [data-section=platform] .nav-label .nav-icon, .navc-reseller [data-section=reseller] .nav-label .nav-icon, .navc-sales [data-section=sales] .nav-label .nav-icon,
.navc-team [data-section=team] .nav-label .nav-icon, .navc-settings [data-section=settings] .nav-label .nav-icon, .navc-help [data-section=help] .nav-label .nav-icon { transform: rotate(-90deg); }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
/* nada no menu encolhe quando ele rola (o botão de recolher ficava achatado) */
.sidebar > * { flex-shrink: 0; }
.sidebar-toggle { position: absolute; top: 22px; right: 12px; margin: 0; width: 28px; height: 28px; min-height: 0; min-width: 0; padding: 0; box-sizing: border-box; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: transparent; color: var(--sidebar-text); cursor: pointer; line-height: 1; }
.sidebar-toggle .nav-icon { width: 16px; height: 16px; opacity: 1; }
.sidebar .brand { padding-right: 40px; }
.sidebar-toggle:hover { background: var(--sidebar-active); color: #fff; }
.sidebar-toggle .nav-icon { transition: transform .15s; }
.sidebar-collapsed .sidebar-toggle .nav-icon { transform: rotate(180deg); }
@media (min-width: 721px) {
  .sidebar-collapsed .sidebar { flex: 0 0 68px; width: 68px; padding: 16px 10px; }
  .sidebar-collapsed .sidebar .nav-text, .sidebar-collapsed .sidebar .brand-name, .sidebar-collapsed .sidebar .brand-word,
  .sidebar-collapsed .sidebar .sidebar-foot, .sidebar-collapsed .sidebar button.nav-label { display: none; }
  .sidebar-collapsed .sidebar .brand { padding: 0 0 14px; justify-content: center; }
  .sidebar-collapsed .sidebar .brand img { max-width: 40px; }
  .sidebar-collapsed .sidebar-toggle { position: static; align-self: center; margin: 0 0 10px; }
  .sidebar-collapsed .sidebar .brand { padding-right: 0; }
  .sidebar-collapsed .nav-section .nav-items { display: flex !important; }
  .sidebar-collapsed .nav-section + .nav-section { border-top: 1px solid rgba(255,255,255,.12); margin-top: 6px; padding-top: 6px; }
  .sidebar-collapsed .nav-link { justify-content: center; padding: 10px 0; position: relative; }
  .sidebar-collapsed .nav-link:hover::after, .sidebar-collapsed .nav-link:focus-visible::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    background: #0F172A; color: #fff; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 12.5px; font-weight: 500;
    box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 60; pointer-events: none;
  }
}
@media (max-width: 720px) {
  .sidebar-collapsed .sidebar .nav-section { display: none; }
  .sidebar-toggle { position: absolute; right: 16px; top: 18px; margin: 0; }
  .sidebar { position: relative; }
  .sidebar-collapsed .sidebar-toggle .nav-icon { transform: rotate(-90deg); }
}

/* ---------- ajuda ---------- */
.help-search input { font-size: 15px; min-height: 44px; }
.help-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.help-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.help-toc ul { list-style: none; margin: 4px 0 12px; padding: 0; }
.help-toc li a { display: block; padding: 3px 0; font-size: 13px; text-decoration: none; }
.help-content { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.help-section h2 { margin-bottom: 8px; }
.help-body { line-height: 1.6; }
.help-body dt { font-weight: 600; margin-top: 8px; }
.help-body dd { margin: 2px 0 0; }
.help-body mark, .help-section h2 mark { background: #FDE68A; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; max-height: none; } }
.row-selected { background: var(--surface-2); }

/* ---------- relatórios (painéis) ---------- */
.report-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-panel.wide { grid-column: 1 / -1; }
.report-panel h2 { font-size: 15px; }
.rbars { width: 100%; border-collapse: collapse; }
.rbars td { padding: 4px 6px; font-size: 13px; vertical-align: middle; border: 0; }
.rbars td.lbl { width: 40%; }
.rbars td.bar { width: 45%; }
.rbars .fill { height: 12px; border-radius: 4px; background: var(--primary); min-width: 2px; }
.rbars-head th { font-size: 11.5px; padding: 2px 6px; background: none; }
.tone-hot { background: #16A34A !important; } .tone-warm { background: #EA580C !important; } .tone-cold { background: #CA8A04 !important; } .tone-none { background: #94A3B8 !important; }
.rcols { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rcols td { text-align: center; vertical-align: bottom; padding: 0 2px; border: 0; }
.rcols-col { background: var(--primary); border-radius: 3px 3px 0 0; width: 70%; max-width: 34px; margin: 0 auto; }
.rcols-val { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.rcols-labels td { font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }

/* ---------- relatório DINÂMICO ---------- */
.dyn-config { display: flex; flex-direction: column; gap: 12px; }
.dyn-board { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 14px; }
.dyn-palette, .dyn-zones > div { border: 1px dashed var(--border); border-radius: 10px; padding: 10px; }
.dyn-zones { display: flex; flex-direction: column; gap: 10px; }
.dyn-board h3 { margin: 0 0 6px; font-size: 13px; }
.dyn-chips, .dyn-zone { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; align-items: center; }
.dyn-zone { background: var(--surface-2); border-radius: 8px; padding: 6px; }
.dyn-zone.over, .dyn-chips.over { outline: 2px solid var(--primary); }
.dyn-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #EEF2FF; color: #3730A3; font-size: 12.5px; cursor: grab; user-select: none; border: 1px solid #C7D2FE; }
.dyn-chip.in-zone { background: var(--primary); color: #fff; border-color: transparent; }
.dyn-chip.dragging { opacity: .5; }
.dyn-x { background: none; border: 0; color: inherit; min-height: 0; padding: 0 0 0 2px; font-size: 15px; line-height: 1; cursor: pointer; }
.dyn-placeholder { color: var(--muted); font-size: 12.5px; }
.dyn-measures { display: flex; flex-wrap: wrap; gap: 6px 16px; }
[data-dyn-result].is-loading { opacity: .5; }
@media (max-width: 900px) { .dyn-board { grid-template-columns: 1fr; } }

/* ---------- rodapé do menu sempre visível ("Powered by GotWork Labs", quando ativo) ---------- */
@media (min-width: 721px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0; }
  .sidebar-foot { position: sticky; bottom: 0; margin: auto -14px 0; padding: 12px 22px 14px; background: var(--sidebar); border-top: 1px solid rgba(255,255,255,.08); z-index: 2; }
  .sidebar-collapsed .sidebar { padding-bottom: 56px; }
  .sidebar-collapsed .sidebar { overflow: visible; }
  .sidebar-collapsed .sidebar .sidebar-foot { display: block; position: fixed; bottom: 0; left: 0; width: 68px; margin: 0; padding: 8px 4px 10px; text-align: center; font-size: 9.5px; line-height: 1.25; }
  .sidebar-collapsed .sidebar .sidebar-foot .sidebar-foot-by { display: block; }
}

/* Aviso de desconexão por tempo sem uso */
.idle-warning { position: fixed; right: 16px; bottom: 16px; z-index: 1000; max-width: 360px; background: var(--surface, #fff); color: inherit; border: 1px solid var(--border, #e5e7eb); border-left: 4px solid #d97706; border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 8px; }
.idle-warning p { margin: 0; }
.idle-warning button { align-self: flex-start; }
.idle-warning-urgent { border-left-color: #dc2626; }
@media (max-width: 480px) { .idle-warning { left: 16px; right: 16px; max-width: none; } }

/* ===================== Tela principal (dashboard) ===================== */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding: 28px 28px 24px; border-radius: 18px; color: #fff; margin-bottom: 22px;
  background: radial-gradient(1200px 300px at 100% -40%, rgba(255,255,255,.22), transparent 60%), linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #0F172A)); 
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--primary) 80%, transparent); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.hero h1 { margin: 2px 0 6px; font-size: 28px; letter-spacing: -.02em; color: #fff; }
.hero-date { margin: 0; opacity: .8; font-size: 13px; }
.hero-sub { margin: 0; opacity: .95; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-badge { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.hero-badge-warn { background: rgba(251,191,36,.3); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-action { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 600; font-size: 13px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px); transition: background .15s, transform .15s; }
.hero-action:hover { background: rgba(255,255,255,.26); transform: translateY(-1px); }

.dash-section { margin-bottom: 26px; animation: dashIn .45s ease both; }
.dash-section:nth-of-type(2) { animation-delay: .05s; } .dash-section:nth-of-type(3) { animation-delay: .1s; } .dash-section:nth-of-type(4) { animation-delay: .15s; }
@keyframes dashIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dash-section { animation: none; } .hero-action, .kpi { transition: none; } }
.dash-title { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 12px; color: var(--text); }
.dash-title .nav-icon { color: var(--primary); }
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(15,23,42,.45); border-color: color-mix(in srgb, var(--kpi) 45%, var(--border)); }
.kpi { --kpi: var(--primary); }
.kpi-success { --kpi: #16A34A; } .kpi-warning { --kpi: #EA580C; } .kpi-danger { --kpi: #DC2626; } .kpi-info { --kpi: #0EA5E9; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--kpi); opacity: .85; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--kpi); background: color-mix(in srgb, var(--kpi) 12%, transparent); flex-shrink: 0; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.kpi-hint { color: var(--muted); font-size: 12px; }
.kpi-spark { margin: 2px -4px -6px; }
.delta { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.delta-up { color: var(--success); background: var(--success-soft); } .delta-down { color: var(--danger); background: var(--danger-soft); }
.delta-flat { color: var(--muted); background: var(--surface-2); } .delta-new { color: var(--primary-text); background: var(--primary-soft); }

.dash-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: stretch; margin-bottom: 14px; }
.dash-grid-3 { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .dash-grid-3 { grid-template-columns: 1fr; } }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.dash-card + .dash-card { margin-top: 0; }
.dash-section > .dash-card { margin-bottom: 14px; }
.dash-wide { margin-bottom: 26px; }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-card-head h2, .dash-card-head h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.dash-sub { margin: 14px 0 6px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-empty { text-align: center; padding: 40px 20px; }
.dash-empty .nav-icon { width: 34px; height: 34px; color: var(--muted); }
.all-good { display: flex; align-items: center; gap: 8px; color: var(--success); background: var(--success-soft); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend i, .legend-list i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }

.chart-cols { display: block; }
.chart-cols rect { transition: opacity .15s; } .chart-cols rect:hover { opacity: .8; }
.chart-val { font-size: 10px; fill: var(--muted); font-weight: 600; }
.chart-lbl { font-size: 11px; fill: var(--muted); }
.spark { display: block; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.donut-val { font-size: 18px; font-weight: 700; fill: var(--text); }
.donut-lbl { font-size: 8.5px; fill: var(--muted); }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.legend-list i { margin: 0 8px 0 0; }
.legend-list strong { margin-left: 6px; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rows li:last-child { border-bottom: 0; }
.rows .grow, .ranking .grow { flex: 1; min-width: 0; }
.rows .grow a { font-weight: 600; text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--primary-text); background: var(--primary-soft); }
.avatar .nav-icon { width: 16px; height: 16px; }
.avatar-danger { color: var(--danger); background: var(--danger-soft); } .avatar-warning { color: var(--warning); background: var(--warning-soft); }
.text-danger { color: var(--danger); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.chip-danger { color: var(--danger); background: var(--danger-soft); } .chip-warning { color: var(--warning); background: var(--warning-soft); } .chip-info { color: var(--primary-text); background: var(--primary-soft); }
.score-pill { min-width: 34px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--hot-text); background: var(--hot-bg); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(110px, 1.2fr) 3fr auto; align-items: center; gap: 12px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-label a { text-decoration: none; }
.bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #38BDF8)); }
.bar-num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) { .bars li { grid-template-columns: 1fr auto; } .bar-track { grid-column: 1 / -1; grid-row: 2; } }

.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.funnel-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-track { background: var(--surface-2); border-radius: 10px; height: 30px; overflow: hidden; }
.funnel-bar { display: flex; align-items: center; height: 100%; padding: 0 10px; color: #fff; font-weight: 700; font-size: 12.5px; border-radius: 10px; transition: filter .15s; }
.funnel-row:hover .funnel-bar { filter: brightness(1.08); }
.funnel-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { .funnel-row { grid-template-columns: 1fr auto; } .funnel-track { grid-column: 1 / -1; grid-row: 2; } }

.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; }
.ranking li.is-me { background: var(--primary-soft); }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-2); color: var(--muted); flex-shrink: 0; }
.medal-1 { background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; }
.medal-2 { background: linear-gradient(135deg, #E5E7EB, #9CA3AF); color: #1F2937; }
.medal-3 { background: linear-gradient(135deg, #FED7AA, #C2410C); color: #fff; }

.act-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.act-timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 8px 0; position: relative; }
.act-timeline li::before { content: ""; position: absolute; left: 6px; top: 22px; bottom: -8px; width: 2px; background: var(--border); }
.act-timeline li:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--surface); border: 3px solid var(--primary); }
.tl-body { min-width: 0; }
@media (max-width: 560px) { .act-timeline li { grid-template-columns: 14px 1fr; } .act-timeline time { grid-column: 2; } .hero { padding: 22px 18px; } .hero h1 { font-size: 23px; } }
.funnel-zero { display: flex; align-items: center; height: 100%; padding: 0 10px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.radar-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; } @media (max-width: 980px) { .radar-layout { grid-template-columns: 1fr; } } .rows li.is-selected { background: var(--primary-soft); border-radius: 10px; padding-left: 8px; }
.map-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; } @media (max-width: 900px) { .map-wrap { grid-template-columns: 1fr; } } .route-stops { list-style: none; margin: 0; padding: 0; } .route-stops li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .rows-check { display: grid; gap: 6px; max-height: 360px; overflow: auto; }
.goal-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0 2px; } .goal-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16A34A, #22C55E); } .badge-medal { font-size: 18px; margin-right: 2px; } .badge-legend { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } tr.is-me { background: var(--primary-soft); }
.risk-low { background: var(--success-soft); color: var(--success); } .risk-medium { background: var(--warning-soft); color: var(--warning); } .risk-high { background: var(--danger-soft); color: var(--danger); } .risk-card-high { border-color: var(--danger); }
.public-page { background: var(--bg); } .public-head { display: flex; align-items: center; justify-content: center; padding: 18px; background: var(--surface); border-bottom: 1px solid var(--border); } .public-main { max-width: 860px; margin: 24px auto; padding: 0 16px; display: grid; gap: 16px; } .public-foot { text-align: center; padding: 24px; } .doc-table td, .doc-table th { padding: 8px; } .accept-box { border: 2px solid var(--primary); } .card-profile { text-align: center; } .card-profile .avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-size: 36px; font-weight: 700; } .card-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; } .qr-box { display: grid; place-items: center; } .qr-box svg, .qr-box img { width: 180px; height: 180px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.store-grid .store-item { gap: 8px; } .store-item button { align-self: flex-start; margin-top: 6px; }
.growth-strip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; } .growth-strip .spacer { flex: 1; } .growth-strip details ul { margin: 6px 0; padding-left: 18px; }
.inline-details { position: relative; display: inline-block; } .inline-details > summary { list-style: none; } .inline-details > summary::-webkit-details-marker { display: none; } .inline-details .popover { position: absolute; right: 0; top: 110%; z-index: 30; width: 320px; box-shadow: 0 14px 30px -12px rgba(15,23,42,.35); }

/* botão ocupado (AGUARDE) */
button.is-busy, .btn.is-busy { background: #F59E0B !important; border-color: #D97706 !important; color: #fff !important; cursor: progress; opacity: 1; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: kfspin .8s linear infinite; vertical-align: -1px; }
@keyframes kfspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
/* anotações: ações alinhadas e edição com espaço */
.msg-actions { align-items: center; flex-wrap: wrap; }
.msg-actions form.inline, .msg-actions .note-edit > summary { display: inline-flex; align-items: center; line-height: 1.4; }
.msg-actions .btn-link { line-height: 1.4; }
.note-edit > summary { cursor: pointer; list-style: none; }
.note-edit > summary::-webkit-details-marker { display: none; }
.note-edit[open] { flex-basis: 100%; width: 100%; }
.note-edit[open] textarea { width: 100%; min-height: 140px; resize: vertical; }
.msg:has(.note-edit[open]) { max-width: 100%; width: 100%; }
.lead-audit { margin-top: 18px; } .lead-audit .nav-icon { width: 15px; height: 15px; color: var(--muted); }

/* auditoria: interação marcada como excluída (só administradores veem) */
tr.audit-hidden td { color: var(--muted); background: var(--surface-2); }
tr.audit-hidden td:not(.audit-actions) > *:not(.audit-hidden-note), tr.audit-hidden td:not(.audit-actions) { text-decoration: line-through; text-decoration-color: rgba(100,116,139,.8); }
tr.audit-hidden .audit-hidden-note { text-decoration: none; display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--danger); background: var(--danger-soft); border-radius: 6px; padding: 1px 6px; }

/* gêmeos: lista de clientes-modelo maior e ajustável (arraste o canto de baixo) */
.seed-picker { height: 360px; min-height: 180px; max-height: 80vh; overflow: auto; resize: vertical; border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px 10px; background: var(--surface); }
.seed-picker .seed-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.seed-picker .seed-item:last-child { border-bottom: 0; }
.seed-picker .seed-item:hover { background: var(--surface-2); }
.seed-picker .seed-item[hidden] { display: none; }
.visit-removed .grow > a { text-decoration: line-through; color: var(--muted); } .checkout-box { display: inline-block; flex-basis: auto !important; width: auto !important; } .checkout-box[open] { flex-basis: 100% !important; width: 100% !important; }
.hero-clock { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .02em; opacity: 1; }
.manual-reminder > summary { cursor: pointer; list-style: none; } .manual-reminder > summary::-webkit-details-marker { display: none; } .manual-reminder > summary::before { content: '+ '; font-weight: 700; color: var(--primary); } .manual-reminder[open] > summary::before { content: '− '; }

/* aviso de lembrete vencido (popup) */
.rpop-stack { position: fixed; right: 16px; top: 76px; z-index: 1200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.rpop { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px; padding: 14px 16px; box-shadow: 0 18px 40px -16px rgba(15,23,42,.45); animation: rpopIn .25s ease; }
@keyframes rpopIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rpop { animation: none; } }
.rpop-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--primary-text); text-transform: uppercase; letter-spacing: .04em; }
.rpop-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; min-height: 0; }
.rpop-title { font-size: 16px; font-weight: 700; margin: 6px 0 2px; }
.rpop-meta { color: var(--muted); font-size: 12.5px; }
.rpop-notes { margin-top: 6px; font-size: 13px; white-space: pre-line; }
.rpop-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rpop-actions select { width: auto; min-height: 32px; padding: 4px 8px; }
.rpop-enable { margin-top: 8px; }
