@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Identidade Fluency House (manual "Arco da aliança" + site fluencyhouse.com.br) */
  --terracota: #844B32;
  --terracota-600: #74412B;
  --marrom: #5C3422;
  --cafe: #563624;
  --tinta: #1E0C06;
  --quase-preto: #1E0C06;
  --creme: #F2E5C6;
  --bege: #EAD6B8;
  --areia: #E8D9C1;
  --papel: #F7EFDF;

  --bg: var(--papel);
  --panel: #FFFBF3;
  --panel-2: #F3E8D3;
  --line: rgba(92, 52, 34, .14);
  --line-strong: rgba(92, 52, 34, .26);
  --text: var(--tinta);
  --muted: #7A5C4A;
  --soft: #A88C78;
  --danger: #A8372A;
  --danger-bg: #F8E1DA;
  --ok: #5E7F4E;
  --ok-bg: #E7EEDD;
  --warn: #9A6418;
  --warn-bg: #F6E8CC;
  --bubble-me: var(--creme);
  --bubble-them: #FFFDF8;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 12, 6, .05), 0 6px 18px rgba(92, 52, 34, .06);
  --shadow-lg: 0 18px 50px rgba(30, 12, 6, .2);
  --arcos: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cg fill='none' stroke='%23F2E5C6' stroke-opacity='.16' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M13 55V36a22 22 0 0 1 44 0v19'/%3E%3Cpath d='M20.5 55V36a14.5 14.5 0 0 1 29 0v19'/%3E%3Cpath d='M28 55V36a7 7 0 0 1 14 0v19'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- trilho lateral ---------- */
.rail {
  width: 84px; flex: none; background: var(--terracota) var(--arcos); background-size: 56px; color: var(--creme);
  display: flex; flex-direction: column; align-items: center; padding: 18px 0 14px; gap: 6px;
}
.rail-logo { width: 46px; height: 42px; margin: 2px 0 20px; color: var(--creme); }
.rail-logo svg { width: 100%; height: 100%; }
.rail-btn {
  width: 68px; padding: 10px 0 8px; border: 0; border-radius: 12px; background: transparent; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: .72; transition: .15s;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn span { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.rail-btn:hover { opacity: 1; background: rgba(242, 229, 198, .1); }
.rail-btn.active { opacity: 1; background: var(--creme); color: var(--terracota); }
.rail-spacer { flex: 1; }

/* ---------- topo ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; flex: none; display: flex; align-items: center; gap: 20px; padding: 0 22px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 210px; }
.topbar h1 { font-size: 26px; font-weight: 300; margin: 0; color: var(--marrom); letter-spacing: -.03em; white-space: nowrap; }
.topbar h1 b, h1 b, h2 b, h3 b { font-weight: 800; }
.sync { font-size: 11.5px; color: var(--muted); }
.sync.live::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--ok-bg); }
.search-trigger {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); text-align: left;
}
.search-trigger:hover { border-color: var(--line-strong); }
.search-trigger kbd { margin-left: auto; }
kbd { font: 600 11px 'Montserrat'; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; }
select, .input, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 7px 10px; outline: none;
}
select:focus, .input:focus, textarea:focus { border-color: var(--terracota); box-shadow: 0 0 0 3px rgba(132, 75, 50, .12); }

.view { flex: 1; min-height: 0; }

/* ---------- caixa de entrada ---------- */
.inbox { display: flex; }
.list-pane { width: 360px; flex: none; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: var(--terracota); border-color: var(--terracota); color: var(--creme); }
.chip .count { font-size: 11px; opacity: .8; }
.chip.danger .count { color: var(--danger); opacity: 1; }
.chip.active .count { color: inherit; }
.list { flex: 1; overflow-y: auto; }
.row {
  display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
}
.row:hover { background: var(--panel-2); }
.row.selected { background: #F3E7D4; }
.row.selected::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--terracota); }
.row-body { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: center; gap: 8px; }
.row-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { margin-left: auto; font-size: 11.5px; color: var(--muted); flex: none; }
.row-msg { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row.unread .row-msg { color: var(--text); font-weight: 500; }
.row-meta { display: flex; gap: 6px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.badge-unread { background: var(--terracota); color: var(--creme); font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--creme); letter-spacing: .02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 60px; height: 70px; font-size: 19px; border-radius: 999px 999px 10px 10px; }
.avatar svg { width: 55%; height: 55%; opacity: .9; }

.stage-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--marrom); }
.stage-pill i { width: 7px; height: 7px; border-radius: 50%; }
.wait { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); display: inline-flex; gap: 4px; align-items: center; }
.wait.late { background: var(--danger-bg); color: var(--danger); }
.wait svg { width: 12px; height: 12px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--areia); color: var(--marrom); font-weight: 500; }
.temp { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.temp.quente { background: #F9DCD2; color: #A3361F; }
.temp.morno { background: var(--warn-bg); color: var(--warn); }
.temp.frio { background: #E3E9EE; color: #4F6474; }
.fu { font-size: 11px; font-weight: 600; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; }
.fu.due { color: var(--danger); }
.fu svg { width: 12px; height: 12px; }

.conv-host { flex: 1; min-width: 0; display: flex; }
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 10px; text-align: center; padding: 40px;
}
.empty h3 { font-size: 24px; color: var(--marrom); margin: 0; font-weight: 300; letter-spacing: -.03em; }
.empty .arco-mark { width: 92px; height: 85px; color: var(--terracota); opacity: .55; }

/* ---------- conversa ---------- */
.conv { flex: 1; display: flex; min-width: 0; }
.thread { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.thread-head { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.thread-head .who { min-width: 0; }
.thread-head .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .who small { color: var(--muted); }
.thread-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.messages {
  flex: 1; overflow-y: auto; padding: 22px 8%; display: flex; flex-direction: column; gap: 4px;
  background-image: radial-gradient(rgba(132, 75, 50, .05) 1px, transparent 1px); background-size: 18px 18px;
}
.day { align-self: center; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; margin: 12px 0 8px; }
.bubble {
  max-width: 68%; padding: 8px 12px 6px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
  background: var(--bubble-them); border: 1px solid var(--line); align-self: flex-start; box-shadow: 0 1px 1px rgba(30, 12, 6, .03);
}
.bubble.me { align-self: flex-end; background: var(--bubble-me); border-color: #E6D3AC; }
.bubble time { display: block; text-align: right; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.bubble img.media { max-width: 260px; max-height: 300px; border-radius: 9px; display: block; margin-bottom: 4px; }
.bubble audio { width: 240px; display: block; }
.bubble .media-label { color: var(--muted); font-style: italic; }

.composer { flex: none; border-top: 1px solid var(--line); background: var(--panel); padding: 10px 14px 12px; position: relative; }
.ai-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.ai-strip:empty { display: none; }
.suggestion {
  flex: none; max-width: 340px; text-align: left; border: 1px solid var(--line-strong); background: var(--panel-2); border-radius: 10px; padding: 8px 10px;
}
.suggestion b { display: block; font-size: 11px; color: var(--terracota); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.suggestion span { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.suggestion:hover { border-color: var(--terracota); }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; line-height: 1.45; padding: 10px 12px; }
.compose-tools { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.compose-tools .hint { margin-left: auto; font-size: 11px; color: var(--soft); }

.btn {
  border: 1px solid var(--line-strong); background: var(--panel); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: var(--terracota); color: var(--terracota); }
.btn.primary { background: var(--terracota); border-color: var(--terracota); color: var(--creme); }
.btn.primary:hover { background: var(--marrom); border-color: var(--marrom); color: var(--creme); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--terracota); background: var(--panel-2); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.send { height: 42px; padding: 0 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

.qr-menu {
  position: absolute; bottom: calc(100% - 4px); left: 14px; width: 420px; max-height: 300px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 5;
}
.qr-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.qr-item b { font-size: 12.5px; }
.qr-item p { margin: 2px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-item.active, .qr-item:hover { background: var(--panel-2); }

/* ---------- ficha do lead ---------- */
.details { width: 330px; flex: none; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.lead-head { padding: 22px 20px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.lead-head .avatar { margin: 0 auto 10px; }
.lead-head input.name-edit { border: 1px solid transparent; background: transparent; text-align: center; font-weight: 700; font-size: 16px; width: 100%; border-radius: 8px; padding: 4px; }
.lead-head input.name-edit:hover { border-color: var(--line); }
.lead-head input.name-edit:focus { border-color: var(--terracota); outline: none; background: var(--panel); }
.lead-head small { color: var(--muted); display: block; }
.stage-track { display: flex; gap: 3px; margin-top: 14px; }
.stage-track button { flex: 1; height: 6px; border-radius: 3px; border: 0; background: var(--line); padding: 0; }
.stage-track button.on { background: var(--terracota); }
.stage-track-label { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.section { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.section h4 { margin: 0 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section h4 .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.field { display: grid; grid-template-columns: 98px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.field label { color: var(--muted); }
.field select, .field .input { width: 100%; padding: 6px 8px; font-size: 13px; }
.tags-edit { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-toggle { border: 1px dashed var(--line-strong); background: transparent; border-radius: 6px; font-size: 11.5px; padding: 3px 8px; color: var(--muted); }
.tag-toggle.on { border-style: solid; border-color: var(--areia); background: var(--areia); color: var(--marrom); font-weight: 600; }
.note-form textarea { width: 100%; min-height: 60px; resize: vertical; font-size: 13px; }
.note { padding: 10px 12px; border-radius: 10px; background: #FFF8E8; border: 1px solid #F0E0BC; margin-top: 8px; font-size: 13px; position: relative; white-space: pre-wrap; }
.note small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.note .del { position: absolute; top: 4px; right: 4px; opacity: 0; }
.note:hover .del { opacity: 1; }
.ai-card { background: linear-gradient(180deg, #FBF4E6, #FFFDF9); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; font-size: 13px; }
.ai-card p { margin: 0 0 8px; line-height: 1.5; }
.ai-card dl { display: grid; grid-template-columns: 92px 1fr; gap: 5px 8px; margin: 0; }
.ai-card dt { color: var(--muted); font-size: 12px; }
.ai-card dd { margin: 0; font-size: 12.5px; }
.ai-card .next { margin-top: 10px; padding: 8px 10px; background: var(--terracota); color: var(--creme); border-radius: 8px; font-weight: 600; font-size: 12.5px; }
.muted { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.timeline li { padding: 4px 0 4px 16px; position: relative; color: var(--muted); }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.timeline li b { color: var(--text); font-weight: 600; }

/* ---------- kanban ---------- */
.pipeline { display: flex; flex-direction: column; }
.board-toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.board-toolbar .spacer { flex: 1; }
.board-toolbar .total { font-size: 12.5px; color: var(--muted); }
.board-toolbar .total b { color: var(--text); }
.board { flex: 1; display: flex; gap: 14px; padding: 18px 22px; overflow-x: auto; overflow-y: hidden; }
.col { width: 296px; flex: none; display: flex; flex-direction: column; background: var(--panel-2); border-radius: 14px; border: 1px solid var(--line); max-height: 100%; }
.col-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.col-head .t { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.col-head .t i { width: 10px; height: 10px; border-radius: 3px; }
.col-head .t .n { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel); border-radius: 999px; padding: 1px 8px; }
.col-head .sum { font-size: 12px; color: var(--muted); margin-top: 3px; }
.col-head .bar { height: 3px; border-radius: 2px; margin-top: 8px; }
.col-body { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.col.drag-over { border-color: var(--terracota); background: #F1E2CC; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.card.dragging { opacity: .4; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.card-time { font-size: 11px; color: var(--muted); flex: none; }
.card-msg { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.card-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); }
.card-foot .val { margin-left: auto; font-weight: 700; color: var(--marrom); }
.more { border: 1px dashed var(--line-strong); background: transparent; border-radius: 9px; padding: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- gaveta ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(30, 12, 6, .28); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 92vw); background: var(--panel); z-index: 21; display: flex; box-shadow: var(--shadow-lg); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- painel ---------- */
.dashboard { overflow-y: auto; padding: 22px; }
.dash-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; max-width: 1400px; }
.kpi { grid-column: span 1; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi label { font-size: 11px; text-transform: uppercase; letter-spacing: .2em; color: var(--terracota); font-weight: 600; }
.kpi .v { font-size: 34px; font-weight: 300; margin-top: 6px; color: var(--terracota); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.alert .v { color: var(--danger); }
.kpi.hero { background: var(--terracota) var(--arcos); background-size: 48px; border-color: var(--terracota); color: var(--creme); }
.kpi.hero label, .kpi.hero .s { color: rgba(242, 229, 198, .85); }
.kpi.hero .v { color: #fff; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card-box h3 { margin: 0 0 14px; font-size: 20px; font-weight: 300; letter-spacing: -.03em; color: var(--marrom); }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 70px; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.funnel-bar { height: 26px; border-radius: 7px; background: var(--panel-2); overflow: hidden; }
.funnel-bar div { height: 100%; border-radius: 7px; min-width: 4px; display: flex; align-items: center; padding-left: 8px; color: #fff; font-size: 11.5px; font-weight: 700; }
.funnel-row .pct { text-align: right; color: var(--muted); font-size: 12px; }
.mini-list .row { padding: 10px 4px; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.hours div { flex: 1; background: var(--bege); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.hours div.peak { background: var(--terracota); }
.hours-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ---------- ajustes ---------- */
.settings { overflow-y: auto; padding: 22px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1200px; }
.settings .card-box p.help { color: var(--muted); font-size: 12.5px; margin: -8px 0 14px; }
.edit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.edit-row .input { flex: 1; }
.edit-row input[type=color] { width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); }
.qr-edit { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.qr-edit textarea { width: 100%; min-height: 64px; margin-top: 6px; resize: vertical; }
.status-line { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--soft); }
.dot.ok { background: var(--ok); }
.dot.off { background: var(--danger); }

/* ---------- paleta ⌘K ---------- */
.palette-backdrop { position: fixed; inset: 0; background: rgba(30, 12, 6, .3); z-index: 40; display: flex; justify-content: center; padding-top: 12vh; }
.palette { width: 620px; max-width: 92vw; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; align-self: flex-start; border: 1px solid var(--line-strong); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font-size: 16px; outline: none; background: transparent; }
.palette-results { max-height: 420px; overflow-y: auto; padding: 6px; }
.p-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.p-item.active { background: var(--panel-2); }
.p-item .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-item .grow { flex: 1; min-width: 0; }
.p-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--soft); font-weight: 700; padding: 10px 12px 4px; }

/* ---------- avisos ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--quase-preto); color: var(--creme); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: up .2s; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1280px) {
  .details { width: 290px; }
  .dash-grid { grid-template-columns: repeat(3, 1fr); }
  .span-3, .span-4, .span-6 { grid-column: span 3; }
}
@media (max-width: 960px) {
  .list-pane { width: 290px; }
  .inbox .details { display: none; }
  .topbar-title { min-width: 0; }
  .search-trigger { display: none; }
}

/* ---------- marca: lockup ---------- */
.rotulo { font-size: 11.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--terracota); }
.lockup { display: inline-flex; align-items: center; gap: .55em; color: inherit; font-size: 22px; line-height: 1; }
.lockup svg { height: 1.5em; width: calc(1.5em * 1.0889); flex: none; }
.lockup .nome { display: flex; flex-direction: column; gap: .22em; }
.lockup .fh { font-weight: 600; letter-spacing: -.025em; white-space: nowrap; }
.lockup .by { font-size: .3em; font-weight: 500; letter-spacing: .45em; }
.lockup-lg { font-size: 44px; }

/* ---------- entrada ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-brand {
  background: var(--terracota) var(--arcos); background-size: 70px; color: var(--creme);
  display: flex; flex-direction: column; justify-content: space-between; padding: 56px;
}
.auth-slogan { font-size: clamp(28px, 3.2vw, 44px); font-weight: 300; letter-spacing: -.03em; line-height: 1.12; max-width: 14ch; margin: 0; }
.auth-slogan b { font-weight: 800; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--papel); }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { margin: 4px 0 0; font-size: 36px; font-weight: 300; letter-spacing: -.03em; color: var(--marrom); line-height: 1.08; }
.auth-card p { margin: 0 0 6px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--cafe); }
.auth-card .input { padding: 12px 14px; font-size: 15px; border-radius: 12px; }
.btn.big { justify-content: center; padding: 14px 20px; font-size: 15px; margin-top: 6px; }
.link { border: 0; background: none; color: var(--terracota); font-weight: 600; font-size: 13px; padding: 0; align-self: flex-start; text-decoration: underline; text-underline-offset: 3px; }
.auth-msg { font-size: 13px; min-height: 18px; color: var(--danger); }
.auth-msg.ok { color: var(--ok); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; gap: 28px; }
  .lockup-lg { font-size: 32px; }
}

/* ---------- usuário ---------- */
.user-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 12px 3px 3px; font-weight: 600; font-size: 13px; }
.user-chip:hover { border-color: var(--line-strong); }
.user-chip .avatar { width: 30px; height: 30px; font-size: 11px; }
.level { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--panel-2); color: var(--marrom); }
.level.admin { background: var(--terracota); color: var(--creme); }

/* ---------- janela (modal) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30, 12, 6, .35); z-index: 45; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 460px; max-width: 100%; max-height: 90vh; overflow-y: auto; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px; animation: up .2s; }
.modal h2 { margin: 6px 0 6px; font-size: 26px; font-weight: 300; letter-spacing: -.03em; color: var(--marrom); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--cafe); margin-top: 12px; }
.modal .input, .modal select { padding: 10px 12px; }
.qr-box { margin: 16px auto 4px; width: 280px; height: 280px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 13px; padding: 14px; }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-steps { margin: 12px 0 0; padding-left: 20px; font-size: 13px; color: var(--cafe); line-height: 1.7; }
.qr-done { color: var(--ok); font-weight: 700; font-size: 15px; }

/* ---------- equipe e números ---------- */
.people { display: flex; flex-direction: column; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .grow { flex: 1; min-width: 0; }
.person b { display: block; font-size: 13.5px; }
.person small { color: var(--muted); font-size: 12px; }
.person select { padding: 5px 8px; font-size: 12.5px; }
.wa-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wa-row:last-child { border-bottom: 0; }
.wa-row .grow { flex: 1; min-width: 0; }
.wa-row b { display: block; font-size: 13.5px; }
.wa-row small { color: var(--muted); font-size: 12px; }
.wa-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--panel-2); color: var(--terracota); display: flex; align-items: center; justify-content: center; flex: none; }
.span-2col { grid-column: span 2; }
.help { color: var(--muted); font-size: 12.5px; }
