/* Layout and components. Colors come only from tokens.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs-md); color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --- shell --------------------------------------------------------------- */
.shell { display: flex; height: 100vh; }
.side {
  width: 244px; flex: 0 0 244px; background: var(--dark); color: var(--on-dark);
  display: flex; flex-direction: column; padding: 30px 14px 16px;
}
.brand { display: block; padding: 0 12px 34px; text-decoration: none; }
.wordmark { font-weight: 700; letter-spacing: 0.42em; font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 26px; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title {
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600;
  color: rgba(246,243,239,.38); padding: 0 12px 8px;
}
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; font-size: var(--fs-md); font-weight: 500; color: rgba(246,243,239,.66);
  transition: background .15s ease, color .15s ease;
}
.nav a .ico { flex: 0 0 18px; opacity: .8; }
.nav a span:first-of-type { flex: 1; }
.nav a:hover { background: rgba(255,255,255,.06); color: var(--on-dark); }
.nav a.on { background: rgba(245,231,214,.12); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--terracota); }
.nav a.on .ico { opacity: 1; }
.nav .count { font-size: 11px; background: var(--terracota); color: #fff; border-radius: 10px;
  padding: 1px 8px; font-weight: 700; flex: 0 0 auto; }

/* profile: Netflix-style square avatar with a menu that opens upward */
.profile { position: relative; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.profile-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--on-dark); cursor: pointer; text-align: left; transition: background .15s;
}
.profile-btn:hover, .profile.open .profile-btn { background: rgba(255,255,255,.06); }
.profile-btn .ico { opacity: .6; transition: transform .2s; }
.profile.open .profile-btn .ico { transform: rotate(180deg); }
.profile-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.profile-who strong { font-size: var(--fs-md); font-weight: 600; }
.profile-who span { font-size: 12px; color: rgba(246,243,239,.5); }
.avatar { width: 34px; height: 34px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff; flex: 0 0 34px; }
.avatar.big { width: 44px; height: 44px; flex-basis: 44px; font-size: 19px; }
.av-0 { background: #B34F00; } .av-1 { background: #3D5A73; } .av-2 { background: #5B6B3A; }
.av-3 { background: #7A3E48; } .av-4 { background: #4D4D4D; }
.profile-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); background: #141211; color: var(--on-dark);
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .15s ease, transform .15s ease; z-index: 20;
}
.profile.open .profile-menu { opacity: 1; transform: none; pointer-events: auto; }
.profile-head { display: flex; gap: 12px; align-items: center; padding: 8px 8px 14px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.profile-head div { min-width: 0; display: flex; flex-direction: column; }
.profile-head strong { font-size: var(--fs-md); }
.profile-head span { font-size: 12px; color: rgba(246,243,239,.5); overflow: hidden; text-overflow: ellipsis; }
.profile-menu a, .profile-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; border: 0; border-radius: 6px;
  background: none; color: rgba(246,243,239,.8); font-size: var(--fs-sm); text-decoration: none; cursor: pointer; text-align: left;
}
.profile-menu a:hover, .profile-menu button:hover { background: rgba(255,255,255,.08); color: #fff; }
.profile-menu form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }
.profile-exit { font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { padding: 40px 48px 72px; overflow-y: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 12px; }
.label {
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* --- flash --------------------------------------------------------------- */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: var(--fs-sm);
  border: 1px solid var(--line); background: var(--surface); word-break: break-word; }
.flash.ok { background: var(--ok-soft); border-color: transparent; }
.flash.erro { background: var(--danger-soft); border-color: transparent; }
.flash.aviso { background: var(--warn-soft); border-color: transparent; }

/* --- controls ------------------------------------------------------------ */
/* Buttons: solid, bold, obvious to click. Primary = black, secondary = warm
   grey fill, ghost = text. Pressed state shrinks a hair, like a real key. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 18px; border: 0; border-radius: 6px; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  background: var(--btn-2); color: var(--ink);
  transition: background .15s ease, transform .08s ease, box-shadow .15s ease, opacity .15s;
}
.btn:hover { background: var(--btn-2-hover); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.btn.primary { background: var(--confirm); color: #fff; }
.btn.primary:hover { background: var(--confirm-hover); box-shadow: 0 6px 18px rgba(65,70,47,.25); }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); box-shadow: 0 6px 18px rgba(198,95,58,.25); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 46px; padding: 0 26px; font-size: var(--fs-md); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius);
  padding: 8px 10px; font-size: var(--fs-md);
}
.input:focus, textarea:focus, select:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: transparent; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; }

/* --- tables -------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; }
.table th { text-align: left; font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* --- chips: monochrome. Color only where something is wrong. ------------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); padding: 3px 9px; border-radius: 4px;
  background: var(--surface-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.chip.ok { background: var(--surface-2); color: var(--ink); }
.chip.info { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip.warn { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-2); }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.dark { background: var(--dark); color: var(--creme); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }

/* mood marker: only when the customer is upset, and in ink, not traffic lights */
.sdot { display: none; }
.sdot.s-frustrado, .sdot.s-irritado, .sdot.s-grave { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  flex: 0 0 7px; background: var(--ink-2); }
.sdot.s-irritado, .sdot.s-grave { background: var(--danger); }
.curve span { background: var(--line-strong); }
.curve span.s-frustrado { background: var(--ink-2); }
.curve span.s-irritado, .curve span.s-grave { background: var(--danger); }

/* --- inbox --------------------------------------------------------------- */
.inbox { display: flex; height: 100vh; min-width: 0; }
.col-list { width: 340px; flex: 0 0 340px; border-right: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; min-width: 0; }
.list-head { padding: 20px 18px 12px; border-bottom: 1px solid var(--line); }
.list-head h1 { font-size: var(--fs-lg); margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filters select { flex: 1 1 45%; min-width: 0; font-size: var(--fs-sm); padding: 5px 6px; }
.status-tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; }
.status-tabs a { font-size: var(--fs-xs); padding: 6px 9px; border-radius: var(--radius); text-decoration: none;
  color: var(--muted); white-space: nowrap; font-weight: 500; }
.status-tabs a.on { background: var(--verde-oliva); color: #fff; }
.status-tabs a:hover:not(.on) { background: var(--surface-2); color: var(--ink); }
.conv-list { overflow-y: auto; flex: 1; }
.conv {
  display: block; padding: 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; cursor: pointer;
}
.conv:hover { background: var(--bg); }
.conv.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--terracota); }
.conv-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-name { font-weight: 600; font-size: var(--fs-md); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: var(--fs-xs); color: var(--muted); }
.conv-prev { font-size: var(--fs-sm); color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.unread { background: var(--terracota); color: #fff; font-size: var(--fs-xs); font-weight: 700; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }
.ch { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.sla { font-size: var(--fs-xs); font-weight: 600; }
.sla.warn { color: var(--ink); }
.sla.late { color: var(--danger); }
.empty { padding: 40px 24px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }

.col-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); min-width: 0; }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who strong { font-size: var(--fs-lg); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.escalation { background: var(--surface-2); color: var(--ink); font-size: var(--fs-sm); padding: 8px 20px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 72%; padding: 8px 12px 6px; border-radius: 12px; font-size: var(--fs-md); line-height: 1.45; word-wrap: break-word; }
.msg-body { white-space: pre-wrap; }
.msg.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-ink); border-bottom-right-radius: 3px; }
.msg.out.bot { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.msg.sys { align-self: center; background: none; color: var(--muted); font-size: var(--fs-xs); }
.msg-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; font-size: 10px; margin-top: 3px; opacity: .7; }
.msg.failed { outline: 1px solid var(--danger); }
.msg .err { color: var(--danger); font-size: var(--fs-xs); display: block; margin-top: 4px; }
.msg.out:not(.bot) .err { color: #FFB4AE; }
.msg img, .msg video { max-width: 260px; border-radius: 8px; display: block; margin-bottom: 4px; }
.msg audio { max-width: 260px; }
.day { align-self: center; font-size: var(--fs-xs); color: var(--muted); letter-spacing: var(--tracking-label); text-transform: uppercase; margin: 10px 0; }
.typing { font-size: var(--fs-xs); color: var(--muted); padding: 0 24px 6px; min-height: 18px; }

.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 12px 16px; }
.draft { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; font-size: var(--fs-sm); }
.draft-actions { display: flex; gap: 6px; margin-top: 8px; }
.window-off { font-size: var(--fs-sm); color: var(--warn); padding: 8px 0 0; }
.picker { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; max-height: 240px; overflow-y: auto; }
.picker-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.picker-item:hover { background: var(--bg); }
.picker-item img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.picker-item .grow { flex: 1; min-width: 0; }

.col-panel { width: 300px; flex: 0 0 300px; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 20px 18px; }
.panel-sec { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel-sec:last-child { border-bottom: 0; }
.panel-sec .label { margin-bottom: 8px; display: block; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.order { font-size: var(--fs-sm); padding: 8px 0; border-bottom: 1px dashed var(--line); }
.order:last-child { border-bottom: 0; }
.curve { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.curve span { flex: 1; max-width: 14px; border-radius: 2px 2px 0 0; min-height: 3px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag-x { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 0 0 4px; }

.no-conv { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); flex-direction: column; gap: 6px; }
.no-conv .wordmark { color: var(--line-strong); padding: 0; font-size: 28px; }

/* --- auth pages ------------------------------------------------------------ */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand { background: var(--dark); color: var(--on-dark); display: flex; flex-direction: column; justify-content: space-between; padding: 48px; }
.auth-brand .wordmark { font-size: 30px; padding: 0; }
.auth-brand p { color: rgba(246,243,239,.6); font-size: var(--fs-sm); max-width: 320px; line-height: 1.6; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-form form { width: 100%; max-width: 340px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 28px; }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; }

/* --- cards and grids (asymmetric on purpose) ------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stats { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 8px; }
.stat strong { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.block { border-top: 1px solid var(--line); padding: 16px 0; }
.block:first-of-type { border-top: 0; padding-top: 0; }
.block textarea { min-height: 110px; }
.block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.modes { display: flex; flex-direction: column; gap: 8px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.mode-opt.on { border-color: var(--ink); background: var(--bg); }
.result { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; font-size: var(--fs-sm); }
.result .reply { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; margin: 8px 0; font-size: var(--fs-md); }
.events { font-size: var(--fs-sm); }
.events li { padding: 7px 0; border-bottom: 1px solid var(--line); list-style: none; }
.events ul { padding: 0; margin: 0; }

@media (max-width: 1180px) { .col-panel { display: none; } }
.topbar, .side-backdrop, .back-btn { display: none; }
@media (max-width: 860px) {
  .shell { flex-direction: column; height: 100dvh; }
  .topbar {
    display: flex; align-items: center; gap: 12px; flex: 0 0 56px; padding: 0 12px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .menu-btn { width: 40px; height: 40px; border: 0; background: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 9px; cursor: pointer; border-radius: 8px; }
  .menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
  .brand-mini .logo-mark { height: 32px; font-size: 12px; padding: 0 12px; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: 272px; max-width: 84vw;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .shell.menu-open .side { transform: none; box-shadow: 0 0 40px rgba(51,40,34,.18); }
  .shell.menu-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(51,40,34,.32); }
  .main { flex: 1; min-height: 0; }
  .inbox { height: 100%; }
  .back-btn { display: inline-flex; padding: 8px; }
  .back-btn .ico { transform: rotate(90deg); }
  .chat-head { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .chat-head .who { flex: 1 1 0; }
  .chat-head .who .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-actions { width: 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .chat-actions > * { flex: 0 0 auto; }
  .col-list { width: 100%; flex-basis: 100%; }
  .inbox.has-conv .col-list { display: none; }
  .inbox:not(.has-conv) .col-chat { display: none; }
  .auth-wrap { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* --- phase 2: flows, catalog, tickets, training ---------------------------- */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.step-head .muted { display: block; margin-top: 2px; }
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.step-grid .label { display: block; margin-bottom: 6px; }
.switch { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.switch input { width: 16px; height: 16px; accent-color: var(--ink); }
code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
details summary { cursor: pointer; }
.ticket { margin-bottom: 12px; }
.ticket-main { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.ticket-main > div { min-width: 0; }
.ticket-photo { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; flex: 0 0 96px; }
.ticket-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ticket-form select { width: auto; }
.ticket-form input[name=notes] { flex: 1; min-width: 200px; }
.review { margin-bottom: 12px; }
.review.done { opacity: .7; }
.review-pair { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.review-pair .msg { max-width: 85%; }
.version { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.version:last-child { border-bottom: 0; }
.subnav { display: flex; gap: 6px; margin-bottom: 20px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--danger); font-size: var(--fs-xs); cursor: pointer; text-decoration: underline; }

/* --- phase 3 --------------------------------------------------------------- */
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form .input { width: auto; min-width: 0; flex: 1 1 140px; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ink-2); }
.health { display: grid; grid-template-columns: 10px 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.health:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.att { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; }
.att strong { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.att span { font-size: var(--fs-sm); color: var(--muted); }
.att.hot { border-color: var(--terracota); box-shadow: inset 0 0 0 1px var(--terracota); }
.quote { font-size: var(--fs-sm); color: var(--ink-2); border-left: 2px solid var(--line-strong); padding-left: 10px; margin: 4px 0; font-style: italic; }
.point { margin-bottom: 10px; }
.up { color: var(--ok); display: block; }
.down { color: var(--danger); display: block; }
.wrong-btn { background: none; border: 0; padding: 0; margin-left: 6px; font-size: 10px; color: inherit; opacity: .7; cursor: pointer; text-decoration: underline; }

/* local one-click login */
.dev-login { width: 100%; max-width: 360px; }
.dev-login form { margin-bottom: 10px; }
.dev-user { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, transform .08s, box-shadow .15s; }
.dev-user:hover { border-color: var(--ink); box-shadow: 0 6px 18px rgba(29,26,24,.08); }
.dev-user:active { transform: scale(.98); }
.dev-user > span:last-child { display: flex; flex-direction: column; }
.dev-user strong { font-size: var(--fs-md); }
.dev-user span span { font-size: 12px; color: var(--muted); }

/* --- Instagram inbox ---------------------------------------------------------- */
.list-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.list-title h1 { margin: 0; }
.list-note { font-size: var(--fs-xs); color: var(--ink-2); background: var(--surface-2); padding: 8px 12px; border-radius: 6px; margin: 0 0 10px; }
.conv-list .list-note { margin: 10px 18px; }
.status-tabs.wrap { flex-wrap: wrap; overflow: visible; margin: 0 0 10px; gap: 4px; }
.status-tabs a b { font-weight: 600; opacity: .6; margin-left: 2px; }
.status-tabs a.on b { opacity: .8; }
.filters .check { display: flex; align-items: center; gap: 6px; flex: 1 1 45%; }
.batch { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.batch .small { flex: 1; }
.batch-start { display: flex; justify-content: flex-end; margin-top: 6px; }
.batch-start .btn { padding: 4px 10px; font-size: 12px; }
.conv-list.selecting .conv-sel { opacity: 1; }
.conv-line > .conv:not(.ig) { padding-left: 32px; }
.conv-line > .conv:not(.ig) + .conv-sel, .conv-line .conv-sel { left: 10px; }
.batch .small { white-space: nowrap; }
.conv-line { position: relative; }
.conv-sel { position: absolute; left: 6px; top: 22px; z-index: 2; opacity: 0; width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; transition: opacity .15s; }
.conv-line:hover .conv-sel, .conv-sel:checked { opacity: 1; }
.conv.ig .conv-top { align-items: flex-start; gap: 12px; }
.conv-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-id .conv-prev { margin-top: 2px; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.conv.ig .conv-meta { padding-left: 52px; }
.conv.waiting .conv-name { font-weight: 700; }
.ig-avatar { position: relative; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; overflow: hidden;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-2);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-strong); }
.conv.waiting .ig-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.ig-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* --- overview ----------------------------------------------------------------- */
.period { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.period > a { padding: 8px 12px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; color: var(--ink-2); }
.period > a:hover { background: var(--surface-2); color: var(--ink); }
.period > a.on { background: var(--verde-oliva); color: #fff; }
.period-custom { display: flex; gap: 6px; margin-left: 8px; }
.period-custom .input { width: auto; padding: 6px 8px; font-size: var(--fs-sm); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: inherit; }
.kpi strong { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi.link { transition: border-color .15s, box-shadow .15s, transform .08s; }
.kpi.link:hover { border-color: var(--ink); box-shadow: 0 8px 22px rgba(29,26,24,.08); }
.kpi.link:active { transform: scale(.99); }
.kpi.hot { box-shadow: inset 0 0 0 1px var(--terracota); border-color: var(--terracota); }
.kpi.hot strong { color: var(--accent-ink); }
.notice { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; margin-bottom: 20px; border-radius: 10px;
  background: var(--surface-2); font-size: var(--fs-sm); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.delta { font-size: var(--fs-sm); font-weight: 700; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.daybars { display: flex; align-items: flex-end; gap: 3px; height: 170px; }
.daybar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.daybar small { font-size: 10px; color: var(--muted); }
.bar-all { width: 100%; min-height: 2px; background: var(--line-strong); border-radius: 3px 3px 0 0; display: flex; align-items: flex-end; overflow: hidden; }
.bar-paid { width: 100%; background: var(--verde-oliva); }
.daybars { position: relative; cursor: crosshair; }
.daybars:has(.daybar.on) .daybar:not(.on) .bar-all { opacity: .45; }
.daybar.on .bar-paid { background: var(--oliva-escuro); }
.daybar.on small { color: var(--ink); font-weight: 700; }
.day-tip {
  position: absolute; top: 0; z-index: 5; min-width: 168px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 12px; font-size: var(--fs-sm);
}
.day-tip strong { display: block; margin-bottom: 6px; }
.day-tip div { display: flex; align-items: center; gap: 6px; }
.day-tip div b { margin-left: auto; font-variant-numeric: tabular-nums; }
.day-tip .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--verde-oliva); }
.day-tip .muted { margin-top: 6px; font-size: var(--fs-xs); }
.legend { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw.paid { background: var(--verde-oliva); } .sw.all { background: var(--line-strong); margin-left: 8px; }
.split-num { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.split-num div { background: var(--bg); border-radius: 10px; padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.split-num strong { font-size: 30px; font-weight: 700; }
.split-num span { font-size: var(--fs-sm); color: var(--muted); }
.kv-line { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.kv-line span { color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--bg); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.tile span { font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tile strong { font-size: 26px; font-weight: 700; }
.rank-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.rank-row:first-of-type { border-top: 0; }
.rank-n { color: var(--muted); font-weight: 700; }
.rank-name { overflow: hidden; text-overflow: ellipsis; }
.rank-val { white-space: nowrap; text-align: right; }
.now-row { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line);
  font-size: var(--fs-sm); text-decoration: none; color: inherit; }
.now-row:first-of-type { border-top: 0; }
a.now-row:hover strong { text-decoration: underline; }
.table.plain { border: 0; }
.table .r { text-align: right; }
@media (max-width: 1100px) { .grid-2, .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); } }
.batch[hidden], [hidden] { display: none !important; }

/* --- composer: one box, tools inside, grows with the text ---------------------- */
.composer { position: relative; padding: 14px 18px 16px; }
.composer-box { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29,26,24,.06); }
.composer-box textarea { display: block; width: 100%; border: 0; outline: none; resize: none; background: transparent;
  padding: 14px 16px 6px; font-size: 15px; line-height: 1.5; min-height: 76px; max-height: 300px; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 8px 8px; }
.composer-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s, transform .08s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { background: var(--verde-oliva); color: #fff; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.text-btn:hover { background: var(--surface-2); color: var(--ink); }
.text-btn:disabled { opacity: .5; cursor: wait; }
.send-btn { min-height: 40px; padding: 0 18px; }
.replying, .attach-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px;
  padding: 8px 10px 8px 14px; background: var(--surface-2); border-radius: 8px; border-left: 3px solid var(--terracota); font-size: var(--fs-sm); }
.replying > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.replying #replying-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.recording { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--oliva-escuro); color: var(--creme); }
.recording .btn.ghost { color: rgba(255,255,255,.8); margin-left: auto; }
.recording .btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.recording .btn.primary { background: #fff; color: var(--dark); }
#rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--terracota); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.emoji-pop { position: absolute; left: 18px; bottom: calc(100% - 6px); width: 340px; max-width: calc(100% - 36px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(29,26,24,.16); padding: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; margin-top: 8px; }
.emoji-grid .cat { grid-column: 1 / -1; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 2px 2px; }
.emoji-grid button { border: 0; background: none; font-size: 22px; line-height: 1; padding: 6px 0; border-radius: 6px; cursor: pointer; }
.emoji-grid button:hover { background: var(--surface-2); }
.picker { position: absolute; left: 18px; right: 18px; bottom: calc(100% - 6px); z-index: 30; box-shadow: 0 18px 40px rgba(29,26,24,.16); }

/* --- message actions: reply and react, on hover --------------------------------- */
.msg { position: relative; }
.msg-actions { position: absolute; top: 4px; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 2px; box-shadow: 0 4px 12px rgba(29,26,24,.08); }
.msg.in .msg-actions { right: -64px; }
.msg.out .msg-actions { left: -40px; }
.msg:hover .msg-actions { display: flex; }
.msg-actions button { border: 0; background: none; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.msg-actions button:hover { background: var(--surface-2); color: var(--ink); }
.quote-in { font-size: var(--fs-xs); padding: 6px 8px; margin-bottom: 6px; border-left: 3px solid currentColor; border-radius: 4px;
  background: rgba(0,0,0,.05); opacity: .85; white-space: pre-wrap; }
.msg.out:not(.bot) .quote-in { background: rgba(255,255,255,.12); }
.msg.has-reaction { margin-bottom: 14px; }
.reaction { position: absolute; bottom: -14px; right: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 1px 6px; font-size: 14px; box-shadow: 0 1px 3px rgba(29,26,24,.12); }
.react-pop { position: absolute; z-index: 40; display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 10px 24px rgba(29,26,24,.16); }
.react-pop button { border: 0; background: none; font-size: 22px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.react-pop button:hover { background: var(--surface-2); transform: scale(1.15); }
.msg audio { width: 280px; max-width: 100%; }

/* --- post-sale inbox ------------------------------------------------------------- */
.cuts { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.cuts a { font-size: var(--fs-xs); font-weight: 600; padding: 5px 9px; border-radius: 6px; text-decoration: none; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong); }
.cuts a:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-2); }
.cuts a.on { background: var(--verde-oliva); color: #fff; box-shadow: none; }
.cuts a b { opacity: .6; font-weight: 600; margin-left: 2px; }
select.input.mark-select, select.input[data-assign] { width: auto; min-height: 38px; padding: 0 10px; font-size: var(--fs-sm); }

/* --- chat tools ------------------------------------------------------------------ */
.presence { padding: 7px 20px; background: var(--pessego); color: var(--grafite-quente); font-size: var(--fs-sm); font-weight: 600; }
.inline-panel { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); }
.list-head .inline-panel { border-radius: 10px; margin-bottom: 10px; padding: 12px; }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-row .input { flex: 1 1 160px; }
.inline-actions { display: flex; justify-content: flex-end; gap: 6px; }
.compose-mode { display: flex; gap: 2px; margin-bottom: 8px; }
.compose-mode button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600;
  color: var(--muted); cursor: pointer; }
.compose-mode button.on { background: var(--surface-2); color: var(--ink); }
.composer.note-mode .composer-box { background: #FBF6E9; border-color: #D9C58F; }
.composer.note-mode .composer-box:focus-within { border-color: #A88A3A; box-shadow: 0 0 0 3px rgba(168,138,58,.12); }
.note-item { align-self: center; width: min(560px, 92%); background: #FBF6E9; border: 1px solid #EADDB5; border-radius: 10px;
  padding: 8px 12px; font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 3px; }
.note-item .label { color: #8A6D1F; }
.media-text { display: block; font-size: var(--fs-xs); font-style: italic; opacity: .8; margin: 2px 0 4px; white-space: pre-wrap; }
.window-off { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-btn.dark { color: var(--ink); }
.other-conv { display: block; text-decoration: none; color: inherit; }
.other-conv:hover strong { text-decoration: underline; }
.picker-form { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.picker-form .inline-row .input { flex: 1 1 110px; }
/* templates screen: one quiet line per template, the message opens on click */
.tpl-sub { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.tpl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.tpl-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.tpl-f { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-sm); font-weight: 600;
  padding: 7px 12px; border-radius: 6px; cursor: pointer; }
.tpl-f span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.tpl-f:hover { background: var(--surface-2); }
.tpl-f.on { background: var(--ink); color: #fff; }
.tpl-f.on span { color: inherit; opacity: .7; }
.tpl-search { width: 260px; max-width: 100%; }
.tpl-group { margin-bottom: 28px; }
.tpl-group > h2 { margin: 0 0 10px; font-size: var(--fs-xs); }
.tpl-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.tpl-row + .tpl-row { border-top: 1px solid var(--line); }
.tpl-row[hidden] + .tpl-row { border-top: 0; }
.tpl-row > summary { display: flex; align-items: center; gap: 16px; padding: 14px 18px; cursor: pointer; list-style: none; }
.tpl-row > summary::-webkit-details-marker { display: none; }
.tpl-row > summary:hover, .tpl-row[open] > summary { background: var(--bg); }
.tpl-row > summary::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin: 0 4px 3px 0; transition: transform .15s; }
.tpl-row[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.tpl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tpl-name .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-cat { flex: 0 0 84px; color: var(--muted); font-size: var(--fs-xs); }
.tpl-ok { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--ok); }
.tpl-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.tpl-open { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 28px; padding: 6px 18px 22px; background: var(--bg); }
.tpl-phone { background: var(--surface-2); border-radius: 12px; padding: 16px; align-self: start; }
.tpl-bubble { background: var(--surface); border-radius: 2px 10px 10px 10px; padding: 10px 12px; font-size: var(--fs-sm); line-height: 1.5;
  box-shadow: 0 1px 1px rgba(51,40,34,.08); }
.tpl-bubble p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.tpl-bubble .tpl-foot { margin-top: 6px; color: var(--muted); font-size: var(--fs-xs); }
.tpl-btn { margin-top: 4px; background: var(--surface); border-radius: 8px; padding: 9px 12px; text-align: center; font-size: var(--fs-sm);
  font-weight: 600; color: var(--confirm); box-shadow: 0 1px 1px rgba(51,40,34,.08); }
.tpl-open mark { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 3px; }
.tpl-facts { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tpl-facts .label { display: block; margin-bottom: 4px; }
.tpl-facts code { overflow-wrap: anywhere; }
.tpl-url { overflow-wrap: anywhere; }
.tpl-do { display: flex; gap: 8px; flex-wrap: wrap; }
.copy { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) {
  .tpl-bar { align-items: stretch; flex-direction: column; margin-bottom: 20px; }
  .tpl-search { width: 100%; }
  .tpl-row > summary { flex-wrap: wrap; gap: 6px 12px; padding: 12px 14px; }
  .tpl-name { flex: 1 1 100%; }
  .tpl-name .small { white-space: normal; }
  .tpl-cat { flex: 1 1 auto; }
  .tpl-row > summary::after { margin-left: auto; }
  .tpl-open { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 4px 14px 18px; }
}
.howto { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.slash { position: absolute; left: 18px; right: 18px; bottom: calc(100% - 6px); z-index: 30; }

/* --- brand (Bagin) ----------------------------------------------------------------- */
/* The mark as the site writes it: BAG upright, "in" lower case in limao.
   Swap for the SVG when the official file arrives (static/img/bagin-logo.svg). */
.logo-mark { display: inline-flex; align-items: center; justify-content: center; background: var(--petroleo); color: var(--creme);
  font-family: var(--font-editorial); font-weight: 700; letter-spacing: .02em; border-radius: 10px; }
.logo-mark em { font-style: italic; font-weight: 600; color: var(--limao); margin-left: 1px; text-transform: lowercase; }
.logo-mark img { width: 100%; height: 100%; display: block; }
.brand .logo-mark { width: 104px; height: 44px; font-size: 16px; }
.editorial { font-family: var(--font-editorial); font-weight: 400; }
.no-conv .editorial { font-size: 18px; color: var(--ink-2); }
.no-conv .organic { width: 180px; height: 110px; }
.side { background: var(--oliva-escuro); }
.nav-title { color: rgba(245,231,214,.45); }
.profile-menu { background: var(--profile-dark); }
.av-0 { background: var(--terracota); } .av-1 { background: var(--verde-oliva); } .av-2 { background: var(--caramelo); }
.av-3 { background: var(--folha); } .av-4 { background: var(--pessego); }
.auth-brand { background: var(--oliva-escuro); position: relative; overflow: hidden; }
.auth-brand .logo-mark { width: 150px; height: 150px; font-size: 26px; position: relative; z-index: 1; }
.auth-brand .editorial { font-size: 22px; line-height: 1.45; color: var(--creme); max-width: 360px; position: relative; z-index: 1; }
.auth-brand p { position: relative; z-index: 1; }
.auth-brand .shapes { position: absolute; right: -120px; bottom: -80px; width: 520px; height: 520px; z-index: 0; }

/* --- light sidebar (24/09: the dark olive was tiring; text must read at a glance) --- */
.side { background: #FFFFFF; color: var(--ink); border-right: 1px solid var(--line); }
.nav-title { color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.nav a { color: var(--ink-2); font-size: 15px; font-weight: 500; }
.nav a .ico { opacity: 1; color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a:hover .ico { color: var(--ink); }
.nav a.on { background: var(--nav-on); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--terracota); }
.nav a.on .ico { color: var(--terracota); }
.nav .count { background: var(--terracota); color: #fff; }
.profile { border-top: 1px solid var(--line); }
.profile-btn { color: var(--ink); }
.profile-btn:hover, .profile.open .profile-btn { background: var(--surface-2); }
.profile-who span { color: var(--muted); }
.profile-menu { background: #FFFFFF; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(51,40,34,.14); }
.profile-head { border-bottom: 1px solid var(--line); }
.profile-head span { color: var(--muted); }
.profile-menu a, .profile-menu button { color: var(--ink-2); }
.profile-menu a:hover, .profile-menu button:hover { background: var(--surface-2); color: var(--ink); }
.profile-menu form { border-top: 1px solid var(--line); }

/* calmer accents: olive only where something is chosen or confirmed */
.status-tabs a { color: var(--ink-2); font-size: 12.5px; }
.status-tabs a.on { background: var(--ink); color: #fff; }
.cuts a.on { background: var(--ink); color: #fff; }
.period > a.on { background: var(--ink); color: #fff; }
.chip { color: var(--ink-2); }
.conv-name { color: var(--ink); }
.conv-prev { color: var(--ink-2); }
.conv.on { background: var(--nav-on); }
.msg.out { background: var(--bubble-out); }
.label { color: var(--muted); }
h1 { color: var(--ink); }
.presence { background: var(--surface-2); color: var(--ink-2); font-weight: 500; border-bottom: 1px solid var(--line); }
.presence::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--verde-oliva); margin-right: 8px; vertical-align: middle; }
.window-off { color: var(--ink-2); }

/* --- filter button, like the Películas CRM ---------------------------------------- */
.list-head form { position: relative; }
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-row .input { flex: 1; min-width: 0; }
.filter-btn { flex: 0 0 auto; gap: 6px; }
.filter-btn.on { background: var(--ink); color: #fff; }
.filter-count { background: var(--terracota); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.filter-pop { position: absolute; top: 48px; left: 0; right: 0; z-index: 40; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 40px rgba(51,40,34,.14); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.filter-field .label { display: block; margin-bottom: 6px; }
.filter-check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.filter-check input { width: 16px; height: 16px; accent-color: var(--verde-oliva); }
.filter-actions { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

/* a conversation that just received a message rises and glows briefly */
@keyframes bump { from { background: var(--nav-on); } to { background: transparent; } }
.conv.bump, .conv-line.bump .conv { animation: bump 1.6s ease-out; }

/* --- team: permissions per person ------------------------------------------ */
.back-link { display: inline-block; margin-bottom: 10px; text-decoration: none; }
.back-link::before { content: "‹ "; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.perm-group-head h2 { margin: 0; font-size: var(--fs-lg); }
.small-btn { padding: 6px 10px; font-size: var(--fs-xs); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.perm-row.locked { cursor: default; opacity: .6; }
.perm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-text strong { font-weight: 600; }
.perm-text .chip { margin-left: 4px; vertical-align: 1px; }
.toggle { position: relative; flex: 0 0 40px; width: 40px; height: 22px; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }
.toggle i { position: absolute; inset: 0; border-radius: 11px; background: var(--line-strong); transition: background .15s ease; pointer-events: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s ease; }
.toggle input:checked + i { background: var(--confirm); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
.perm-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.perm-count { font-variant-numeric: tabular-nums; }

/* short screens (laptops): the whole menu fits without scrolling */
@media (max-height: 860px) and (min-width: 861px) {
  .side { padding-top: 20px; }
  .brand { padding-bottom: 20px; }
  .nav { gap: 14px; }
  .nav a { padding: 7px 12px; }
  .nav-title { padding-bottom: 4px; }
}

/* --- pontos de melhoria ------------------------------------------------------ */
.points-nav { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.points-nav a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: var(--fs-sm);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.points-nav a:hover { color: var(--ink); }
.points-nav a.on { color: var(--ink); border-bottom-color: var(--terracota); }
.points-head { align-items: flex-start; margin-bottom: 18px; }
.points-head p { margin: 4px 0 0; max-width: 640px; }
.point-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.point-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.point-form-row label { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.point-form-row label.grow-2 { flex: 1.4; }
.point-form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.points-tabs { margin-bottom: 14px; }
.points-list { display: flex; flex-direction: column; gap: 10px; }

/* urgency: the color lives here, the list and the sheet share it */
.u-urgente { --u-bg: var(--danger-soft); --u-ink: var(--danger); }
.u-alta    { --u-bg: var(--accent-soft); --u-ink: var(--accent-ink); }
.u-media   { --u-bg: var(--ok-soft); --u-ink: var(--verde-oliva); }
.u-baixa   { --u-bg: var(--surface-2); --u-ink: var(--muted); }
.u-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs);
  font-weight: 700; background: var(--u-bg); color: var(--u-ink); }
.point-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  border-left: 4px solid var(--u-ink); padding: 14px 18px; transition: box-shadow .15s ease, transform .15s ease; }
.point-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.point-card.closed { opacity: .6; }
.point-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.point-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.point-title { font-size: var(--fs-md); font-weight: 600; }
.point-go .ico { transform: rotate(-90deg); color: var(--muted); }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terracota); display: inline-block; }
.points-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; }
.points-empty .ico { width: 28px; height: 28px; color: var(--muted); }

.point-sheet { border-left: 4px solid var(--u-ink); margin-bottom: 16px; }
.point-sheet-title { font-size: 22px; margin: 10px 0 4px; }
.point-body { white-space: pre-wrap; font-size: var(--fs-md); line-height: 1.55; margin: 12px 0 0; }
.point-files { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.point-files img { max-width: 220px; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.point-files video { max-width: 320px; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); }
.point-attach { margin-top: 12px; }
.file-link { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.point-controls { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.point-controls form { display: flex; align-items: center; gap: 8px; }
.point-controls .input { width: auto; padding: 6px 10px; }
.point-delete { margin-left: auto; }
.point-talk h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
.point-comment { border-left: 2px solid var(--line); padding-left: 12px; margin-bottom: 12px; }
.point-comment p { margin: 2px 0 0; white-space: pre-wrap; }
.point-talk form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 8px; }
.point-talk textarea { width: 100%; }

/* --- avisos: cards in the corner, in every page ------------------------------------ */
.avisos { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px;
  width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.aviso { pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--verde-oliva);
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(51,40,34,.16); font-size: var(--fs-sm);
  animation: aviso-in .25s ease; }
.aviso.personal { border-left-color: var(--terracota); }
.aviso.urgent { border-left-color: var(--danger); }
.aviso-head { display: flex; align-items: center; gap: 8px; }
.aviso-head strong { font-weight: 700; }
.aviso-min { margin-left: auto; border: 0; background: none; font-size: 16px; font-weight: 700; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 2px; }
.aviso-by { display: block; color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.aviso p { margin: 6px 0 10px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.aviso-foot { display: flex; gap: 8px; }
.aviso-foot .btn { padding: 6px 12px; font-size: var(--fs-xs); }
.aviso-foot .btn.primary { flex: 1; justify-content: center; }
.aviso.small .aviso-by, .aviso.small p, .aviso.small .aviso-foot { display: none; }
.aviso.small { cursor: pointer; padding: 8px 12px; }
.aviso.leaving { opacity: 0; transform: translateX(12px); transition: opacity .3s ease, transform .3s ease; }
@keyframes aviso-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .avisos { top: 66px; right: 12px; } }

/* Chat teste */
.tc { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.tc-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.tc-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tc-msgs { display: flex; flex-direction: column; gap: 8px; padding: 16px; height: 60vh; overflow-y: auto; background: var(--bg); }
.tc-reply { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 80%; }
.tc-reply .msg { max-width: 100%; }
.tc-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: var(--muted); }
.tc-why summary { cursor: pointer; color: var(--muted); }
.tc-why ul { margin: 6px 0 0; padding-left: 18px; }
.tc-rate { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tc-fix { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 280px; }
.tc-err { color: var(--danger); }
.tc-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.tc-compose textarea { flex: 1; min-width: 0; resize: vertical; }
.tc-old { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: var(--fs-md); }
.tc-old.on { font-weight: 600; }
@media (max-width: 900px) {
  .tc { grid-template-columns: minmax(0, 1fr); }
  .tc-reply { max-width: 100%; }
  .tc-msgs { height: 55vh; }
}
.rules { list-style: none; margin: 16px 0 0; padding: 0; }
.rules li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.tc-btn { padding: 4px 10px; font-size: var(--fs-xs); }

/* Phone. Last in the file so it wins over the screen rules above. */
@media (max-width: 860px) {
  /* A wide table scrolls inside its card instead of widening the page:
     one 7-column table was pushing every card on the home off screen. */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 20px; }
  .page-head h1 { font-size: 26px; }
  .period { justify-content: flex-start; }
  .period > a { padding: 7px 10px; }
  .period-custom { margin-left: 0; width: 100%; }
  .period-custom .input { flex: 1 1 0; min-width: 0; width: auto; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 16px; gap: 6px; min-width: 0; }
  .kpi strong { font-size: clamp(17px, 5.2vw, 22px); white-space: nowrap; }
  .card { min-width: 0; }
  /* 30 day numbers do not fit side by side: show 1, 6, 11... and the one tapped. */
  .daybar small { visibility: hidden; }
  .daybar:nth-child(5n+2) small, .daybar.on small { visibility: visible; }
  /* Login: the brand panel stays, as a band on top (same logo, shapes and
     line as on the computer), and the form follows below it. */
  .auth-wrap { grid-template-rows: auto 1fr; min-height: 100dvh; }
  .auth-brand { min-height: 260px; padding: 28px 24px 32px; gap: 28px; justify-content: flex-start; }
  .auth-brand .logo-mark { width: 92px; height: 92px; font-size: 16px; }
  .auth-brand .editorial { font-size: 19px; max-width: 230px; }
  .auth-brand p:not(.editorial) { display: none; }
  .auth-brand .shapes { width: 300px; height: 300px; right: -110px; bottom: -120px; }
  .auth-form { align-items: flex-start; padding: 28px 20px 40px; }
}

/* --- cadastro de produtos ----------------------------------------------- */
.product-form { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.product-form h2 { margin: 0 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 600; min-width: 0; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid textarea { resize: vertical; font: inherit; }
.sizes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.size { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; min-width: 0; }
.size .input { text-align: center; width: 100%; }
.drop { display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 18px; border: 1.5px dashed var(--line-strong);
  border-radius: 8px; color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer; text-align: center; }
.drop.on { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.thumbs img:first-child { outline: 2px solid var(--accent); outline-offset: 2px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 14px; }
.cat { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
details.card summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .sizes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.photo-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--surface); cursor: grab; }
.photo.main { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.photo.arrastando { opacity: .45; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.photo-tag { position: absolute; top: 12px; left: 12px; background: var(--dark); color: var(--creme); font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.photo.main .photo-tag { background: var(--accent); }
.photo-acts { display: flex; justify-content: space-between; gap: 4px; margin-top: 6px; }
.photo-acts button { background: none; border: 0; padding: 4px 2px; font-size: var(--fs-xs); color: var(--ink-2); cursor: pointer; text-decoration: underline; }
.photo-acts button:disabled { opacity: .3; cursor: default; text-decoration: none; }
.photo-acts [data-tirar] { color: var(--danger); }
.copy-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface-2); }
.copy-head { display: flex; gap: 8px; }
.copy-head .input { flex: 1; min-width: 0; }
.copy-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
.copy-opt { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.copy-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.copy-opt p { margin: 0; white-space: pre-line; font-size: var(--fs-sm); line-height: 1.5; flex: 1; }
.copy-opt .btn { align-self: flex-start; }
@media (max-width: 720px) { .copy-head { flex-direction: column; } }
.link-box { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; gap: 8px; }
.link-row .input { flex: 1; min-width: 0; }
@media (max-width: 720px) { .link-row { flex-wrap: wrap; } }
.form-grid .span-3 { grid-column: 1 / -1; }
.cor-bloco { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cor-bloco + .cor-bloco { margin-top: 12px; }
.cor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.cor-nome { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 600; flex: 1; max-width: 320px; }
.status-form { display: flex; flex-direction: column; gap: 12px; }
.status-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.status-opt { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: var(--fs-sm); cursor: pointer; }
.status-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.field-col { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 600; }
.status-form .btn.primary { align-self: flex-start; }
@media (max-width: 720px) { .status-opts { grid-template-columns: minmax(0, 1fr); } }
.cart-items { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.cart-items img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.cart-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cart-line:first-of-type { border-top: 0; }
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.cart-line.total { border-top: 1px solid var(--line-strong); }
.ia-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ia-box textarea { width: 100%; }

/* --- Canais --- */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.ch-card { padding: 18px 20px; }
.ch-wide { grid-column: 1 / -1; }
.ch-card h2 { font-size: 16px; margin: 0; }
.ch-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.ch-line { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ch-line:last-child { border-bottom: 0; }
.ch-title { font-weight: 600; font-size: 13.5px; }
.ch-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.ch-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.ch-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.ch-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.ch-result { display: grid; gap: 6px; margin: 4px 0 10px; }
.ch-msg { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.ch-msg.ok { background: var(--ok-soft); color: var(--ok); }
.ch-msg.warn { background: var(--warn-soft); color: var(--warn); }
.ch-msg.bad { background: var(--danger-soft); color: var(--danger); }
.ch-copy { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 6px 6px 10px; margin-bottom: 8px; }
.ch-copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }
.ch-steps { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; font-size: 13.5px; }
@media (max-width: 720px) { .ch-grid { grid-template-columns: 1fr; } }
/* sem subtitulo o bloco do titulo encolhia e "Visao geral" quebrava em duas linhas */
.page-head h1 { white-space: nowrap; }

/* Na loja agora: pontinho verde que pulsa quando tem gente */
.na-loja { display:flex; align-items:center; gap:7px; white-space:nowrap; margin:6px 0 0; font-size:14px; color:var(--muted); }
.na-loja strong { color:var(--ink); }
.pulso-dot { width:9px; height:9px; border-radius:50%; background:var(--line-strong); flex:none; }
.pulso-dot.on { background:#22c55e; animation:pulso 1.8s infinite; }
@keyframes pulso { 0% { box-shadow:0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow:0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow:0 0 0 0 rgba(34,197,94,0); } }
@media (prefers-reduced-motion: reduce) { .pulso-dot.on { animation:none; } }

/* --- E-mail marketing ----------------------------------------------------------------- */
.table .num, .table th.num { text-align:right; white-space:nowrap; }
.em-grid { display:grid; grid-template-columns:minmax(420px, 1fr) minmax(0, 620px); gap:20px; align-items:start; }
.em-grid > * { min-width:0; }
.em-titulo { margin:0; }
.page-head > div:first-child:has(.em-titulo) { flex:1; min-width:0; }
.em-nome { font:inherit; color:inherit; border:1px solid transparent; background:transparent; border-radius:6px;
  padding:2px 6px; margin-left:-7px; width:100%; max-width:560px; }
.em-nome:hover { border-color:var(--line); }
.em-nome:focus { outline:none; border-color:var(--line-strong); background:var(--surface); }
.em-salvo { margin-left:8px; }
.em-conta { float:right; font-weight:400; color:var(--muted); font-size:12px; }
.em-conta.longo { color:var(--warn); }
.em-blocos { display:flex; flex-direction:column; gap:10px; margin:4px 0 14px; }
.em-bloco { border:1px solid var(--line); border-radius:8px; padding:12px 14px; background:var(--surface); display:flex; flex-direction:column; gap:8px; }
.em-bloco-topo { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:13px; }
.em-bloco-acoes { display:flex; gap:4px; }
.em-bloco-acoes .btn { padding:3px 9px; font-size:12px; }
.em-bloco textarea { resize:vertical; min-height:96px; }
.em-duas { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.em-add { display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding-top:12px; border-top:1px solid var(--line); }
.em-add .small.muted { margin-right:4px; }
.em-ia { display:flex; flex-direction:column; gap:8px; padding:12px; margin:0 0 12px; border-radius:8px; background:var(--accent-soft); }
.em-prods { display:flex; flex-wrap:wrap; gap:8px; }
.em-prod { display:flex; align-items:center; gap:8px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; font-size:12.5px; line-height:1.3; max-width:100%; }
.em-prod img { width:40px; height:40px; object-fit:cover; border-radius:4px; flex:none; }
.em-x { border:0; background:none; font-size:18px; line-height:1; color:var(--muted); cursor:pointer; padding:0 2px; }
.em-x:hover { color:var(--danger); }
.em-resultados { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:6px; max-height:260px; overflow:auto; }
.em-resultados:empty { display:none; }
.em-res { display:flex; align-items:center; gap:8px; text-align:left; padding:6px; border:1px solid var(--line); border-radius:6px;
  background:var(--surface); font:inherit; font-size:12.5px; line-height:1.3; cursor:pointer; color:var(--ink); }
.em-res:hover { border-color:var(--accent); }
.em-res img { width:36px; height:36px; object-fit:cover; border-radius:4px; flex:none; }
.em-falta { margin:0 0 12px; padding:10px 12px 10px 28px; border-radius:6px; background:var(--warn-soft); font-size:13px; }
.em-previa-col { position:sticky; top:16px; display:flex; flex-direction:column; align-items:center; gap:10px; }
.em-previa-barra { display:flex; justify-content:center; width:100%; }
.em-caixa { width:100%; display:flex; flex-direction:column; align-items:center; background:#efe9e1; border-radius:10px; padding:14px; max-height:calc(100vh - 110px); overflow:auto; }
.em-caixa-topo { width:100%; max-width:680px; display:flex; flex-direction:column; gap:2px; font-size:13px; padding:0 4px 10px; color:var(--ink); }
.em-caixa-topo span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#em-previa { width:390px; max-width:100%; min-height:520px; border:0; background:#FBF6EF; border-radius:6px; transition:width .2s; }
.em-mini { width:100%; height:420px; border:1px solid var(--line); border-radius:6px; margin-top:10px; background:#FBF6EF; }
@media (max-width:1100px) { .em-grid { grid-template-columns:1fr; } .em-previa-col { position:static; } }
@media (max-width:560px) { .em-duas { grid-template-columns:1fr; } }
.btn.small { min-height:30px; padding:0 12px; font-size:12.5px; }
.em-bloco-acoes .btn { min-height:26px; }
.btn.primary.danger { background:var(--danger); color:#fff; }
.kpis.cinco { grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); }

/* API: chaves de leitura */
.api-main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.api-main > section > .label { display: block; margin-bottom: 10px; }
.api-list { display: flex; flex-direction: column; gap: 10px; }
.api-key { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.api-key.off { opacity: .6; }
.api-key-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.api-key-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.api-scopes { display: flex; flex-wrap: wrap; gap: 6px; }
.api-scroll { overflow-x: auto; }
.api-fact { margin: 14px 0; min-width: 0; }
.api-fact .label { display: block; margin-bottom: 4px; }
.api-fact code { overflow-wrap: anywhere; }
.api-pre { margin: 0; padding: 12px; background: var(--surface-2); border-radius: 8px; font-size: var(--fs-xs); white-space: pre-wrap; overflow-wrap: anywhere; }
.api-contact { border-bottom: 1px solid var(--line); }
.api-made .api-pre { margin: 12px 0 14px; font-size: var(--fs-sm); }
.api-routes { margin: 6px 0 14px; }
.api-routes > div { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.api-routes code { flex: 0 0 220px; overflow-wrap: anywhere; }
.api-routes span { flex: 1 1 220px; min-width: 0; }
.picker { max-height: min(340px, 50vh); }
.picker-top { padding: 8px; border-bottom: 1px solid var(--line); }
.picker-form textarea.input { resize: vertical; min-height: 84px; }

/* --- Estoque ------------------------------------------------------------------------ */
.est-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.est-acoes .period-custom { margin-left: 0; }
.est-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.est-ordem { display: flex; align-items: center; gap: 8px; }
.est-ordem .input { width: auto; padding: 6px 8px; font-size: var(--fs-sm); }
.est-foto { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; display: block; }
.est-foto.grande { width: 72px; height: 72px; border-radius: var(--radius); flex: none; }
.est-cab { display: flex; align-items: center; gap: 16px; min-width: 0; }
.est-nome { min-width: 220px; }
.table th.est-th, .table td.est-td { text-align: center; padding-left: 3px; padding-right: 3px; width: 40px; }
.est-q { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 6px;
  border-radius: 4px; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--ink); }
.est-q.um { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-2); }
.est-q.zero { background: transparent; color: var(--line-strong); font-weight: 500; }
.est-q.zero.falta { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.est-q.fora { background: transparent; }
.table.est-grade { width: auto; min-width: min(100%, 560px); }
.est-grade td:first-child { color: var(--ink-2); white-space: nowrap; padding-left: 0; padding-right: 28px; }
.est-grade td.num, .est-grade th.num { width: 64px; }
.est-delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.est-delta.menos { color: var(--accent-ink); }
.est-modos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.est-modos label { cursor: pointer; }
.est-modos input { position: absolute; opacity: 0; pointer-events: none; }
.est-modos label span { display: inline-block; padding: 8px 14px; border-radius: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); background: var(--btn-2); }
.est-modos input:checked + span { background: var(--ink); color: #fff; }
.est-modos input:focus-visible + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.est-modos [data-dica] { margin-left: 8px; }
.est-campos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.est-campos label { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: var(--fs-sm); font-weight: 600; }
.est-campos .input { width: 68px; text-align: center; font-variant-numeric: tabular-nums; }
.est-fim { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.est-fim .field-col { margin: 0; min-width: 0; }
.est-fim select.input { min-width: 200px; }
@media (max-width: 860px) {
  .est-acoes { justify-content: flex-start; }
  .est-acoes .period-custom { width: 100%; }
  .est-cab { align-items: flex-start; }
  .est-campos .input { width: 56px; }
  .est-fim > * { flex: 1 1 100%; }
  .est-nome { min-width: 180px; white-space: normal !important; }
  /* a grade do produto cabe inteira no celular, sem rolar para o lado */
  .table.est-grade { display: table; width: 100%; min-width: 0; table-layout: auto; }
  .table.est-grade th, .table.est-grade td { padding: 9px 2px; }
  .table.est-grade td:first-child { white-space: normal; padding-right: 6px; font-size: var(--fs-xs); line-height: 1.25; }
  .est-grade td.num, .est-grade th.num { width: auto; text-align: center; }
  .est-grade .est-q { min-width: 26px; padding: 0 4px; }
}

.cart-acts { display: flex; gap: 6px; justify-content: flex-end; }

/* gravar video pela camera: so no celular (no computador o clipe ja escolhe arquivo) */
.so-celular { display: none !important; }
@media (pointer: coarse) { .so-celular { display: inline-flex !important; } }

/* ---------- Tarefas: quadro com colunas (09/11/2026, igual ao da Origyn) ---------- */
.tk-head { margin-bottom: 14px; align-items: flex-end; }
.tk-head h1 { margin-bottom: 4px; }
.tk-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-board-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-board-pick select.input { width: auto; min-width: 200px; }
.tk-filtros { margin: 0 0 12px; }
.tk-vazio { text-align: center; padding: 48px 22px; }
.tk-vazio h2 { margin-bottom: 6px; }
.tk-vazio .btn { margin-top: 16px; }

.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding: 2px 2px 18px;
          min-height: calc(100vh - 230px); cursor: grab; }
.kanban.rolando { cursor: grabbing; user-select: none; }
.kanban.rolando .tk-ficha { pointer-events: none; }
.tk-col { flex: 0 0 286px; width: 286px; background: var(--surface-2); border: 1px solid var(--line);
          border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 220px); cursor: auto; }
.tk-col-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; cursor: grab; }
.tk-col-name { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
               text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
.tk-pega { color: var(--muted); opacity: .5; flex: 0 0 auto; }
.tk-col-top:hover .tk-pega { opacity: 1; }
.tk-feita { color: var(--verde-oliva); flex: 0 0 auto; }
.tk-col-right { display: flex; align-items: center; gap: 4px; }
.tk-conta { font-size: var(--fs-xs); color: var(--muted); background: var(--surface); border-radius: 10px; padding: 1px 8px; }
.tk-col-menu { border: 0; background: transparent; color: var(--muted); border-radius: var(--radius); padding: 3px; cursor: pointer; line-height: 0; }
.tk-col-menu:hover { background: var(--surface); color: var(--ink); }
.tk-lista { display: flex; flex-direction: column; gap: 8px; padding: 2px 10px 6px; overflow-y: auto; min-height: 40px; flex: 1 1 auto; }
.tk-add { margin: 4px 10px 10px; padding: 7px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
          background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.tk-add:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--surface); }
.tk-col-nova { background: transparent; border-style: dashed; padding: 10px; flex-basis: 220px; width: 220px; }
.tk-col-nova .input { background: transparent; border: 0; }

.tk-ficha { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
            border-radius: var(--radius); padding: 10px 11px 9px; cursor: grab; box-shadow: var(--shadow);
            -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tk-ficha:hover { border-color: var(--line-strong); }
.tk-ficha.prio-urgente { border-left-color: var(--danger); }
.tk-ficha.prio-alta { border-left-color: var(--terracota); }
.tk-ficha.prio-media { border-left-color: var(--areia); }
.tk-ficha.feita .tk-titulo { color: var(--muted); text-decoration: line-through; }
.tk-titulo { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.tk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: var(--fs-xs); color: var(--muted); }
.tk-num { display: inline-flex; align-items: center; gap: 3px; }
.tk-num .ico { width: 13px; height: 13px; }
.tk-cresce { flex: 1; }
.tk-av { width: 24px; height: 24px; flex: 0 0 24px; font-size: 11px; border-radius: 50%; color: #fff; }
.tk-prazo { font-weight: 500; }
.due-late { color: var(--danger) !important; font-weight: 600; }
.due-today { color: var(--warn) !important; font-weight: 600; }
.due-soon { color: var(--ink-2) !important; }

/* arrastando: o lugar fica tracejado e a copia segue o ponteiro */
.kb-fantasma { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; opacity: .95;
               box-shadow: 0 12px 32px rgba(51,40,34,.22); }
.tk-ficha.kb-lugar, .tk-col.kb-lugar { background: transparent; border: 1px dashed var(--line-strong); box-shadow: none; }
.tk-ficha.kb-lugar > *, .tk-col.kb-lugar > * { visibility: hidden; }
body.kb-arrastando, body.kb-arrastando * { cursor: grabbing !important; }

/* janelas */
.tk-dialog { border: 0; border-radius: var(--radius-lg); padding: 22px 24px; width: min(560px, 94vw); background: var(--surface);
             color: var(--ink); box-shadow: 0 24px 60px rgba(51,40,34,.25); }
.tk-dialog-sm { width: min(440px, 94vw); }
.tk-dialog::backdrop { background: rgba(51,40,34,.35); }
.tk-dialog form, .tk-form { display: flex; flex-direction: column; gap: 12px; }
.tk-dialog label, .tk-form label { display: flex; flex-direction: column; gap: 4px; }
.tk-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tk-dialog-head h2 { font-size: var(--fs-lg); }
.tk-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.tk-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-linha-btn { display: flex; gap: 8px; }
.tk-linha-btn .input { flex: 1; min-width: 0; }
.tk-quem { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tk-dialog .tk-radio, .tk-form .tk-radio { flex-direction: row; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.tk-sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* detalhe */
.tk-volta { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; margin-bottom: 6px; }
.tk-volta .ico { transform: rotate(90deg); width: 14px; height: 14px; }
.tk-detalhe { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tk-detalhe-main, .tk-detalhe-lado { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tk-comentar { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.tk-comentar textarea { flex: 1; min-width: 0; }
.tk-comentario { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.tk-texto { white-space: pre-wrap; font-size: var(--fs-sm); margin-top: 2px; overflow-wrap: anywhere; }
.tk-check { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.tk-check label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); cursor: pointer; min-width: 0; }
.tk-check .feito { text-decoration: line-through; color: var(--muted); }
.tk-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; line-height: 0; border-radius: var(--radius); }
.tk-x:hover { color: var(--danger); background: var(--surface-2); }
.tk-x .ico { width: 14px; height: 14px; }
.tk-check-novo { margin-top: 8px; border-width: 0 0 1px; border-radius: 0; padding-left: 2px; }
.tk-contexto dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: var(--fs-sm); }
.tk-contexto dt { color: var(--muted); }
.tk-contexto dd { margin: 0; text-align: right; }

@media (max-width: 860px) {
  .kanban { scroll-snap-type: x mandatory; min-height: 0; }
  .tk-col { flex-basis: 86vw; width: 86vw; scroll-snap-align: center; max-height: none; }
  .tk-detalhe { grid-template-columns: 1fr; }
  .tk-linha { grid-template-columns: 1fr; }
  .tk-head { flex-direction: column; align-items: stretch; }
}

/* --- Bagin: leads e disparos (16/11/2026) ------------------------------------------ */
.lead-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead-filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.lead-filtros .input { width: auto; min-width: 0; flex: 1 1 160px; }
.lead-filtros input[type=search] { flex: 2 1 240px; }
.funil { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.funil-etapa { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface); color: var(--ink-2); text-decoration: none; min-width: 0; }
.funil-etapa span { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funil-etapa strong { font-family: var(--font-editorial); font-size: 26px; color: var(--ink); line-height: 1; }
.funil-etapa:hover { border-color: var(--line-strong); }
.funil-etapa.on { border-color: var(--petroleo); box-shadow: inset 0 0 0 1px var(--petroleo); }
.funil-etapa.etapa-fechado strong { color: var(--ok); }
.funil-etapa.etapa-perdido strong { color: var(--muted); }
.etapa-chip { background: var(--surface-2); color: var(--ink); }
.etapa-chip.etapa-novo { background: var(--limao); color: var(--abismo); }
.etapa-chip.etapa-orcamento { background: var(--petroleo); color: var(--creme); }
.etapa-chip.etapa-fechado { background: var(--ok-soft); color: var(--ok); }
.etapa-chip.etapa-perdido { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.etapas { display: flex; gap: 0; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.etapa-btn { flex: 1 1 0; min-width: 0; padding: 12px 8px; border: 0; border-right: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.etapa-btn:last-child { border-right: 0; }
.etapa-btn:hover { background: var(--surface-2); }
.etapa-btn.on { background: var(--petroleo); color: var(--creme); font-weight: 600; }
.etapa-btn.on.etapa-fechado { background: var(--ok); }
.etapa-btn.on.etapa-perdido { background: var(--muted); }
.lead-grade { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lead-lado { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.lead-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.lead-inline { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lead-inline .input { flex: 1 1 auto; min-width: 0; }
.lead-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lead-hist li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); }
.lead-hist li.ev-nota { border-left-color: var(--petroleo); }
.lead-hist li.ev-saiu { border-left-color: var(--danger); }
.lead-hist li.ev-disparo { border-left-color: var(--ceu); }
.tabela-rola { overflow-x: auto; }
.canais-status { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip.disparo-enviando { background: var(--limao); color: var(--abismo); }
.chip.disparo-concluido { background: var(--ok-soft); color: var(--ok); }
.chip.disparo-pausado { background: var(--warn-soft); color: var(--warn); }
.chip.disparo-cancelado { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.bolha-previa { white-space: pre-wrap; background: var(--nevoa); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px;
  font-size: var(--fs-sm); color: var(--ink); }
.var-linha { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.var-linha label { margin: 0; font-weight: 600; }
h1, .page-head h1 { font-family: var(--font-editorial); font-weight: 600; letter-spacing: .01em; }
@media (max-width: 760px) {
  .funil { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-grade, .lead-form { grid-template-columns: minmax(0, 1fr); }
  .etapas { flex-wrap: wrap; }
  .etapa-btn { flex: 1 1 33%; border-bottom: 1px solid var(--line); }
  .var-linha { grid-template-columns: 40px minmax(0, 1fr); }
  .var-linha input { grid-column: 2; }
}
.panel-etapas { display: flex; flex-wrap: wrap; gap: 6px; }
.panel-etapas .chip { border: 0; cursor: pointer; font: inherit; font-size: var(--fs-xs); opacity: .55; }
.panel-etapas .chip.on { opacity: 1; font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink-2); }
.opcoes { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Chat no jeito do WhatsApp, igual ao CRM do Call Center (16/11/2026) ----------------- */
.inbox .col-list { width: 380px; flex-basis: 380px; background: var(--surface); }
.inbox .list-head { padding: 18px 16px 8px; border-bottom: 0; }
.inbox .list-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.inbox .list-title h1 { font-family: var(--font); font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.busca { display: flex; align-items: center; gap: 8px; background: var(--zap-cabeca); border-radius: 10px; padding: 0 6px 0 12px; height: 40px; }
.busca > .ico { color: var(--zap-cinza); flex: 0 0 auto; }
.busca input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: var(--fs-md); outline: none; color: var(--ink); }
.busca .filtro-btn { border: 0; background: transparent; color: var(--zap-cinza); display: inline-flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 8px; cursor: pointer; }
.busca .filtro-btn:hover, .busca .filtro-btn.on { background: #E2E6EA; color: var(--ink); }
.status-tabs.pilulas { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; border: 0; }
.status-tabs.pilulas a { border: 0; border-radius: 999px; background: var(--zap-cabeca); color: var(--ink-2); padding: 6px 12px;
  font-size: var(--fs-sm); font-weight: 500; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.status-tabs.pilulas a b { font-weight: 600; color: var(--zap-cinza); font-size: 12px; }
.status-tabs.pilulas a:hover { background: #E2E6EA; }
.status-tabs.pilulas a.on { background: var(--zap-verde-claro); color: var(--zap-verde-escuro); font-weight: 600; }
.status-tabs.pilulas a.on b { color: var(--zap-verde-escuro); }

.inbox .conv-list { padding: 0; }
.inbox .conv-line { position: relative; }
.inbox .conv { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border: 0; border-radius: 0; box-shadow: none;
  background: transparent; text-decoration: none; color: var(--ink); }
.inbox .conv:hover { background: #F5F6F6; }
.inbox .conv.on { background: var(--zap-cabeca); box-shadow: none; }
.av { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .02em; background: #C8CDD2; }
.av-0 { background: var(--av-0); } .av-1 { background: var(--av-1); } .av-2 { background: var(--av-2); }
.av-3 { background: var(--av-3); } .av-4 { background: var(--av-4); } .av-5 { background: var(--av-5); }
.av.sem-nome { background: #C8CDD2; }
.inbox .chat-head .back-btn { display: none; }
.conv-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 0 10px;
  border-bottom: 1px solid #EEF0F2; }
.inbox .conv:hover .conv-corpo, .inbox .conv.on .conv-corpo { border-bottom-color: transparent; }
.inbox .conv-top { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.inbox .conv-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox .conv-time { font-size: 12px; color: var(--zap-cinza); white-space: nowrap; }
.conv-bottom { display: flex; align-items: center; gap: 8px; }
.inbox .conv-prev { flex: 1; min-width: 0; font-size: 14px; color: var(--zap-cinza); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.inbox .unread { background: var(--zap-verde); color: #fff; min-width: 20px; height: 20px; border-radius: 10px; font-size: 12px;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.conv.nao-lida .conv-name { font-weight: 700; }
.conv.nao-lida .conv-time { color: var(--zap-verde); font-weight: 600; }
.conv-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.conv-meta .dono, .conv-meta .etq { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--zap-cabeca); color: var(--ink-2); }
.conv-meta .dono { background: #E8EEFB; color: #2F4A9E; }
.inbox .conv-sel { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); z-index: 2; opacity: 0; }
.inbox .conv-line:hover .conv-sel, .inbox .conv-list.selecting .conv-sel { opacity: 1; }
.inbox .empty { padding: 28px 18px; color: var(--zap-cinza); text-align: center; }

/* cabeca da conversa */
.inbox .chat-head { background: var(--zap-cabeca); border-bottom: 1px solid #E3E6E8; padding: 10px 18px; gap: 12px; }
.inbox .chat-head .av { width: 42px; height: 42px; font-size: 15px; }
.inbox .chat-head .who strong { font-size: 16px; font-weight: 600; }
.who-sub { font-size: 13px; color: var(--zap-cinza); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-actions { display: flex; align-items: center; gap: 4px; }
.chat-actions .icon-btn, .zap-lado .icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: #54656F; background: transparent; border: 0; cursor: pointer; }
.chat-actions .icon-btn:hover, .zap-lado .icon-btn:hover { background: rgba(5, 38, 45, .07); color: var(--ink); }
.chat-actions .icon-btn .ico, .zap-lado .icon-btn .ico { width: 22px; height: 22px; }
.btn.pill { border-radius: 999px; background: var(--zap-verde); color: #fff; padding: 0 14px; min-height: 34px; gap: 6px;
  display: inline-flex; align-items: center; font-weight: 600; margin-right: 6px; }
.btn.pill:hover { background: var(--zap-verde-escuro); }

/* conversa */
.inbox .msgs { background-color: var(--zap-fundo); padding: 18px 7%;
  background-image: radial-gradient(var(--zap-fundo-ponto) 1px, transparent 1px); background-size: 18px 18px; gap: 3px; }
.inbox .msg { border-radius: 8px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); padding: 6px 9px 4px; max-width: min(65%, 560px);
  font-size: 15px; color: #111B21; }
.inbox .msg.in { background: var(--zap-entrada); }
.inbox .msg.out, .inbox .msg.out.bot { background: var(--zap-saida); color: #111B21; }
.inbox .msg + .msg.in:not(.has-reaction), .inbox .msg.in + .msg.out, .inbox .msg.out + .msg.in { margin-top: 8px; }
.inbox .msg .msg-foot { color: var(--zap-cinza); font-size: 11px; justify-content: flex-end; gap: 4px; margin-top: 2px; }
.tick { display: inline-flex; color: var(--zap-cinza); }
.tick-lido { color: var(--zap-azul-lido); }
.tick-falhou { color: var(--danger); font-weight: 600; }
.inbox .note-item { background: var(--nota-fundo); border: 1px solid var(--nota-borda); color: var(--nota-texto); box-shadow: none;
  border-radius: 8px; }
.inbox .note-item .label { color: var(--nota-texto); }

/* caixa de mensagem */
.inbox .composer { background: var(--zap-cabeca); border-top: 0; padding: 8px 14px 10px; }
.inbox .compose-mode { margin: 0 0 6px 96px; }
.inbox .compose-mode button { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--zap-cinza); }
.inbox .compose-mode button .ico { width: 15px; height: 15px; }
.inbox .compose-mode button.on { background: #fff; color: var(--ink); }
.zap-box { display: flex; align-items: flex-end; gap: 6px; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.zap-lado { display: flex; align-items: center; gap: 2px; padding-bottom: 6px; }
.zap-campo { flex: 1; min-width: 0; background: #fff; border-radius: 12px; padding: 9px 14px 8px; display: flex; flex-direction: column; gap: 6px; }
.inbox .zap-campo textarea { border: 0; outline: none; resize: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 0;
  min-height: 24px; max-height: 220px; background: transparent; color: var(--ink); width: 100%; }
.zap-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-escrita { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: var(--zap-cabeca);
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; padding: 4px 11px; cursor: pointer; }
.chip-escrita .ico { width: 15px; height: 15px; }
.chip-escrita:hover { background: #E2E6EA; }
.chip-escrita.leve { background: transparent; color: var(--zap-cinza); }
.chip-escrita.leve:hover { background: var(--zap-cabeca); color: var(--ink); }
.chip-escrita.corr { background: #FFF1DD; color: #8A4B00; }
.chip-escrita.corr .ponto { width: 7px; height: 7px; border-radius: 50%; background: #E8890C; }
.chip-escrita:disabled { opacity: .6; cursor: wait; }
.send-round { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--zap-verde); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; margin-left: 4px; }
.send-round:hover { background: var(--zap-verde-escuro); }
.send-round .ico { width: 20px; height: 20px; }
.inbox .composer.note-mode .zap-campo { background: var(--nota-fundo); box-shadow: inset 0 0 0 1px var(--nota-borda); }
.inbox .composer.note-mode .send-round { background: #B88A00; }

/* painel de correcao e de sugestao, em cima da caixa */
.escrita-painel { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(11, 20, 26, .12); margin: 0 0 8px; overflow: hidden; }
.escrita-topo { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #EEF0F2; }
.escrita-topo strong { flex: 1; font-size: 15px; }
.escrita-link { border: 0; background: none; color: var(--zap-verde-escuro); font: inherit; font-weight: 600; cursor: pointer; }
.escrita-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--zap-cinza); cursor: pointer; }
.escrita-lista { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.escrita-lista li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid #F2F3F5; }
.escrita-lista .errado { text-decoration: line-through; text-decoration-color: #E8590C; color: var(--zap-cinza); }
.escrita-lista .seta { color: var(--zap-cinza); }
.escrita-lista .troca { border: 1px solid #BFE9D4; background: var(--zap-verde-claro); color: var(--zap-verde-escuro); font: inherit;
  font-weight: 600; border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.escrita-lista small { flex-basis: 100%; color: var(--zap-cinza); font-size: 12.5px; }
.escrita-opcoes { display: flex; flex-direction: column; gap: 8px; padding: 12px; max-height: 300px; overflow: auto; }
.escrita-opcoes .opcao { text-align: left; border: 1px solid #E3E6E8; background: #fff; border-radius: 10px; padding: 10px 14px;
  font: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer; line-height: 1.4; }
.escrita-opcoes .opcao:hover { border-color: var(--zap-verde); background: #F6FEF4; }
.escrita-vazio { padding: 14px 16px; margin: 0; color: var(--zap-cinza); }
.escrita-carregando { display: flex; gap: 6px; padding: 18px 16px; }
.escrita-carregando span { width: 8px; height: 8px; border-radius: 50%; background: #C3CBD0; animation: escrita-pulo 1s infinite ease-in-out; }
.escrita-carregando span:nth-child(2) { animation-delay: .15s; } .escrita-carregando span:nth-child(3) { animation-delay: .3s; }
@keyframes escrita-pulo { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

.no-conv { background: var(--zap-cabeca); color: var(--zap-cinza); gap: 14px; }
.no-conv-marca { font-family: var(--font-editorial); font-size: 44px; font-weight: 700; color: var(--petroleo); opacity: .25; }
.no-conv-marca em { color: var(--petroleo); font-style: italic; }
.inbox .col-panel { background: #fff; }
.inbox .inline-panel { border-radius: 12px; }
#panel-transfer select { margin-bottom: 8px; }
@media (max-width: 760px) {
  .inbox .col-list { width: 100%; flex-basis: 100%; }
  .inbox .msgs { padding: 12px 10px; }
  .inbox .msg { max-width: 85%; }
  .inbox .compose-mode { margin-left: 0; }
  .inbox .chat-head .back-btn { display: inline-flex; }
  .zap-lado .icon-btn { width: 36px; height: 36px; }
  .chat-actions .btn.pill span, .chat-actions .btn.pill { padding: 0 10px; }
}
