/* 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; }
.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; }
.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; }
.tpl { margin-bottom: 12px; }
.tpl-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.tpl-head > div { display: flex; flex-direction: column; gap: 3px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 10px; }
.tpl-grid .label { display: block; margin-bottom: 4px; }
.copy { display: flex; gap: 8px; align-items: center; }
.tpl-body { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; background: var(--bg); border-radius: 8px;
  padding: 10px 12px; font-size: var(--fs-sm); line-height: 1.5; }
.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 (Manual de Marca Aluzza) ----------------------------------------------- */
/* Placeholder for the official square logo. The manual forbids typing the
   name in place of the vector file: replace .logo-mark with the SVG when it
   arrives (static/img/aluzza-logo.svg) and delete the text inside. */
.logo-mark { display: inline-flex; align-items: center; justify-content: center; background: var(--terracota); color: var(--creme);
  font-family: var(--font); font-weight: 500; letter-spacing: .06em; }
.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: #353A26; }
.av-0 { background: var(--terracota); } .av-1 { background: var(--verde-oliva); } .av-2 { background: var(--caramelo); }
.av-3 { background: #7A5A44; } .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: #F4ECE6; 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: #F4F1ED; }
.msg.out { background: #2F3526; }
.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: #F4ECE6; } 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; }
}
