:root {
  --navy: #0b1f3a; --navy-2: #12294a; --navy-3: #1c3760;
  --teal: #0f9f90; --teal-2: #0c857a; --teal-soft: #e3f5f2;
  --bg: #f4f6f9; --surface: #ffffff; --line: #e2e7ee; --line-2: #cfd7e2;
  --text: #16233a; --muted: #5d6b80; --faint: #8a96a8;
  --red: #c2413b; --red-soft: #fbeceb; --amber: #b7791f; --amber-soft: #fdf3e1; --blue-soft: #e8f0fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 35, 58, .06), 0 2px 8px rgba(16, 35, 58, .05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --head: 'Plus Jakarta Sans', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-2); }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -.01em; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side { background: var(--navy); color: #c9d4e3; display: flex; flex-direction: column; padding: 18px 12px; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-family: var(--head); font-weight: 700; font-size: 16px; }
.brand small { display: block; font: 500 11px var(--font); color: #8fa3bf; letter-spacing: .02em; }
.side .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7e92ae; padding: 14px 10px 6px; }
.side .sec-top { padding-top: 10px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c9d4e3; text-decoration: none; font-weight: 500; }
.side a:hover { background: var(--navy-2); color: #fff; }
.side a.on { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.side a .count { margin-left: auto; background: var(--teal); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
.side .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--navy-3); font-size: 13px; }
.side .me button { background: none; border: 0; color: #8fa3bf; padding: 0; cursor: pointer; text-decoration: underline; }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top h1 { font-size: 20px; margin-right: auto; }
.content { flex: 1; overflow: auto; padding: 20px 24px; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-2); }
.btn.danger { color: var(--red); border-color: #efc9c6; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.top input[type=search] { width: 240px; }
.top select { width: auto; }
label.f { display: flex; flex-direction: column; gap: 4px; justify-content: flex-end; font-size: 12px; font-weight: 600; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--blue-soft); color: #264a7a; white-space: nowrap; }
.tag.teal { background: var(--teal-soft); color: var(--teal-2); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.gray { background: #eef1f5; color: var(--muted); }
.muted { color: var(--muted); }
.empty { color: var(--faint); text-align: center; padding: 28px 12px; font-size: 13px; }

/* Pipeline tabs */
.ptabs { display: flex; gap: 4px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.ptabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.ptabs a.on { color: var(--text); border-color: var(--teal); }

/* Kanban */
.board { display: flex; gap: 14px; align-items: flex-start; min-height: 100%; }
.col { flex: 0 0 272px; background: #eaeef3; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col.won .col-h { box-shadow: inset 0 3px 0 var(--teal); }
.col.lost .col-h { box-shadow: inset 0 3px 0 var(--red); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 11px 12px 9px; font-weight: 600; border-radius: var(--radius) var(--radius) 0 0; }
.col-h .n { margin-left: auto; font-size: 12px; color: var(--muted); background: #fff; border-radius: 99px; padding: 0 8px; }
.col-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col.drop { outline: 2px dashed var(--teal); outline-offset: -2px; }
.card { background: var(--surface); border-radius: 8px; padding: 10px 11px; box-shadow: var(--shadow); cursor: pointer; border: 1px solid transparent; }
.card:hover { border-color: var(--teal); }
.card.dragging { opacity: .45; }
.card .t { font-weight: 600; margin-bottom: 2px; overflow-wrap: anywhere; }
.card .s { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--faint); }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(11, 31, 58, .32); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg); z-index: 21; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(11, 31, 58, .18); }
.drawer-h { background: var(--surface); padding: 16px 20px 0; border-bottom: 1px solid var(--line); }
.drawer-h .row1 { display: flex; align-items: flex-start; gap: 10px; }
.drawer-h h2 { font-size: 19px; flex: 1; overflow-wrap: anywhere; }
.drawer-h .row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 12px; }
.drawer-h .row2 select { width: auto; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button.on { color: var(--text); border-color: var(--teal); }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 30px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.panel h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.callout { border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.callout.warn { background: var(--amber-soft); color: #7a4f10; }
.callout.bad { background: var(--red-soft); color: #8a2b26; }
.callout.info { background: var(--teal-soft); color: #0b5e56; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.li.done .grow { text-decoration: line-through; color: var(--faint); }
.timeline .li .grow { font-size: 13px; }
.timeline .ic { width: 22px; text-align: center; }
.note-form { display: flex; gap: 8px; }
.pre { white-space: pre-wrap; font-size: 13px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.wa { background: #e7f7ef; border-color: #cdebdc; }

/* Tables */
table.t { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: #f8fafc; padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f8fafc; }
.timeline .li.click { cursor: pointer; border-radius: 8px; }
.timeline .li.click:hover { background: #f1f5f9; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 31, 58, .4); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal h2 { font-size: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 16px; }
.login form { background: #fff; padding: 30px 28px; border-radius: 14px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 22px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--red); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; overflow-x: auto; padding: 8px; align-items: center; }
  .side .sec, .side .me, .brand small { display: none; }
  .brand { padding: 0 8px; }
  .top { padding: 12px 16px; }
  .top input[type=search] { width: 100%; }
  .content { padding: 14px 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .col { flex-basis: 250px; }
}

/* Conversas */
.chips { display: flex; gap: 6px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.chips button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 4px 11px; cursor: pointer; font-weight: 500; white-space: nowrap; font-size: 13px; }
.chips button.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-2); }
.chips button i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chips button b { background: var(--teal); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; }
.chips .off { color: var(--faint); font-size: 10px; }
.ch { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap; }
.inbox { flex: 1; display: grid; grid-template-columns: 330px 1fr; min-height: 0; }
.ilist { border-right: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
.iitem { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 11px 14px; cursor: pointer; }
.iitem:hover { background: #f8fafc; }
.iitem.on { background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal); }
.iitem .r1 { display: flex; justify-content: space-between; gap: 8px; }
.iitem .r1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.iitem.unread .r1 b { font-weight: 700; }
.iitem .when { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.iitem .r2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.iitem .snip { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iitem .count { background: var(--teal); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
.iitem .r3 { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.ithread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thead select { width: auto; }
.tbody { flex: 1; display: grid; grid-template-columns: 1fr 250px; min-height: 0; }
.msgs { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: 12px; overflow-wrap: anywhere; font-size: 13.5px; }
.msg.in { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: #d9f2ee; border-bottom-right-radius: 4px; }
.msg.auto { align-self: flex-end; background: #eef1f5; color: var(--muted); border: 1px dashed var(--line-2); font-size: 12.5px; }
.msg small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.msg .subj { font-weight: 600; margin-bottom: 4px; }
.msg .meta { font-size: 10.5px; color: var(--faint); text-align: right; margin-top: 3px; }
.msg .meta .bad { color: var(--red); font-weight: 600; }
.tside { border-left: 1px solid var(--line); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.tside .panel { padding: 12px; }
.reply { display: flex; gap: 8px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); align-items: flex-end; flex-wrap: wrap; }
.reply textarea { flex: 1; resize: vertical; min-width: 200px; }
.reply input { flex-basis: 100%; }
@media (max-width: 1100px) { .tbody { grid-template-columns: 1fr; } .tside { display: none; } }
@media (max-width: 860px) { .inbox { grid-template-columns: 1fr; } .ithread { display: none; } .inbox.has-open .ilist { display: none; } .inbox.has-open .ithread { display: flex; } }
.thead .back { display: none; }
@media (max-width: 860px) { .thead .back { display: inline-flex; } }

.msg .txt { white-space: pre-wrap; }

/* Plataformas no menu */
.side a.soon { opacity: .55; cursor: default; }
.side a.soon:hover { background: none; color: #c9d4e3; }
.side .soon-tag { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid #3a5378; border-radius: 99px; padding: 0 6px; }
/* Abas de funis no CRM */
.chips.funnels a { display: inline-flex; align-items: center; border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 4px 13px; font-weight: 600; font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; }
.chips.funnels a.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-2); }
/* Barra funil + etapas */
.stagebar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.drawer-h .stagebar { padding: 10px 0 4px; border-bottom: 0; }
.sb-pipes { display: flex; gap: 4px; flex-wrap: wrap; }
.sb-pipes button { border: 0; background: none; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--faint); cursor: pointer; }
.sb-pipes button:hover { color: var(--text); background: var(--bg); }
.sb-pipes button.on { color: var(--text); background: var(--bg); }
.sb-pipes button.cur { color: var(--teal-2); }
.sb-pipes button.cur::before { content: "● "; font-size: 9px; vertical-align: 1px; }
.sb-steps { display: flex; overflow-x: auto; scrollbar-width: thin; }
.sb-steps button { flex: 1 0 auto; position: relative; border: 0; background: #e9edf2; color: var(--muted); font-size: 12px; font-weight: 600; padding: 7px 14px 7px 20px; cursor: pointer; white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -6px; }
.sb-steps button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; padding-left: 14px; }
.sb-steps button:hover { background: #dce3eb; color: var(--text); }
.sb-steps button.done { background: #cdeae6; color: var(--teal-2); }
.sb-steps button.on { background: var(--teal); color: #fff; }
.sb-steps button.won.on { background: #2f9e5a; }
.sb-steps button.lost.on { background: var(--red); }

/* Arquivos do card */
.files { display: flex; flex-direction: column; gap: 6px; }
.files .file { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-decoration: none; color: var(--text); font-weight: 600; font-size: 13px; }
.files .file:hover { border-color: var(--teal); color: var(--teal-2); }
.files .file small { color: var(--faint); font-weight: 400; white-space: nowrap; }
.tside .files .file { flex-direction: column; align-items: flex-start; gap: 2px; }

.files .file-row { display: flex; gap: 6px; align-items: center; }
.files .file-row .file { flex: 1; min-width: 0; overflow: hidden; }

/* Orçamento */
.qt input { width: 100%; }
.qres { position: absolute; top: 38px; left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow: auto; }
.qres button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; cursor: pointer; font: inherit; }
.qres button:hover { background: var(--teal-soft); }
.qres small { color: var(--muted); display: block; }
.qtot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; margin-top: 10px; font-size: 13px; }
.qtot .big { font-size: 16px; width: 100%; text-align: right; }
.qsub { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.qsub label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; flex: 1; min-width: 90px; }
.qsub input { font-size: 12px; padding: 3px 6px; }

/* Dashboard */
.dh { font: 700 15px var(--head); margin: 22px 0 10px; color: var(--navy); }
.dtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dtile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; border-top: 3px solid var(--line-2); }
.dtile.good { border-top-color: var(--teal); } .dtile.warn { border-top-color: var(--amber); } .dtile.bad { border-top-color: var(--red); }
.dtile .dl { font-size: 12px; color: var(--muted); font-weight: 600; }
.dtile .dv { font: 700 24px var(--head); color: var(--text); margin-top: 4px; }
.dtile .ds { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dchart { position: relative; } .dchart svg { width: 100%; height: auto; display: block; }
.dchart .dg { stroke: var(--line); stroke-width: 1; } .dchart .dt { font-size: 10.5px; fill: var(--muted); }
.dchart .dbar { fill: var(--teal); } .dchart .db:hover .dbar { fill: var(--teal-2); }
.dtip { position: absolute; background: var(--navy); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.dfun { display: grid; grid-template-columns: 190px 1fr 200px; gap: 10px; align-items: center; padding: 5px 0; }
.dfl { font-size: 13px; } .dfn { font-size: 13px; color: var(--muted); text-align: right; } .dfn b { color: var(--text); }
.dfb { background: var(--bg); border-radius: 4px; height: 14px; } .dfb span { display: block; height: 100%; background: var(--teal); border-radius: 0 4px 4px 0; min-width: 2px; }
table.t td:has(.dinl) { white-space: nowrap; }
.dinl { display: inline-block; width: 60px; height: 8px; background: var(--bg); border-radius: 4px; margin-right: 8px; vertical-align: middle; } .dinl span { display: block; height: 100%; background: var(--teal); border-radius: 0 4px 4px 0; }
table.t .r { text-align: right; } .warn-t { color: var(--amber); font-weight: 600; } .bad-t { color: var(--red); font-weight: 600; }
.note-form select { max-width: 170px; }
@media (max-width: 900px) { .dtiles { grid-template-columns: repeat(2, 1fr); } .dfun { grid-template-columns: 120px 1fr; } .dfn { grid-column: 1 / -1; text-align: left; } }
a.li { text-decoration: none; color: inherit; } a.li:hover b { color: var(--teal-2); }
/* Fila de Conversas (meta: zerada no fim do dia) */
.queue { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 24px; font-size: 13px; border-bottom: 1px solid var(--line, #e5e9ef); }
.queue.good { background: #eaf7ef; color: #1b7a44; }
.queue.warn { background: #fff7e0; }
.queue.bad { background: #fdecec; }
.queue button { border: 1px solid transparent; background: rgba(255,255,255,.7); border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; }
.queue button.on { border-color: currentColor; background: #fff; }
.iitem .wait { color: #b7791f; font-weight: 600; }
.iitem .wait.bad { color: var(--red, #c53030); }
/* Dashboard: números clicáveis abrem a lista de cards */
.dclick { cursor: pointer; }
.dtile.dclick:hover { outline: 2px solid var(--teal, #14b8a6); outline-offset: -2px; }
.dnum { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-d, #0f766e); text-decoration: underline dotted; cursor: pointer; }
tr.dclick:hover td { background: #f3f8fa; }
/* Conversas: arquivos e ferramentas de resposta */
.msg .mimg { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; margin: 4px 0; }
.msg audio { width: 240px; margin: 4px 0; }
.msg .mdoc { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 4px 0; text-decoration: none; }
.reply .rtools { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 460px; }
.reply .rtools .btn { white-space: nowrap; }
.reply textarea { max-height: 40vh; }
/* Card aberto em tela cheia (conteúdo centralizado para leitura confortável) */
.drawer { width: 100vw; box-shadow: none; }
.drawer-h, .drawer-b { padding-left: max(20px, calc((100vw - 1180px) / 2)); padding-right: max(20px, calc((100vw - 1180px) / 2)); }
.msg.call { align-self: center; background: #fff7e6; border: 1px solid #f1d9a6; color: #5b4a1f; font-size: 13px; max-width: 70%; }
/* Dados do card aparecem em maiúsculas enquanto digita (o banco grava em maiúsculas) */
#df input[type=text]:not([name*=email]):not([name*=link]):not([name*=url]) { text-transform: uppercase; }
/* E-mail manual / modelos de e-mail */
.modal:has(.compose) { width: min(880px, 100%); }
.rte { border: 1px solid var(--line, #d5dde3); border-radius: 8px; overflow: hidden; background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #f3f6f8; border-bottom: 1px solid var(--line, #d5dde3); }
.rte-bar button { border: 1px solid transparent; background: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #1f2d3a; }
.rte-bar button:hover { background: #fff; border-color: #d5dde3; }
.rte-area { min-height: 260px; max-height: 46vh; overflow: auto; padding: 12px 14px; font: 14px/1.5 Arial, Helvetica, sans-serif; color: #1f2d3a; outline: none; }
.rte-src { width: 100%; min-height: 260px; border: 0; padding: 12px; font: 12px/1.4 ui-monospace, monospace; resize: vertical; }
.tpl-pick { position: relative; }
.tpl-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; max-height: 240px; overflow: auto; background: #fff; border: 1px solid #d5dde3; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.tpl-list button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; cursor: pointer; font-size: 14px; }
.tpl-list button:hover { background: #eef6f8; }
.sig-prev { border-left: 3px solid #d5dde3; padding: 6px 10px; font-size: 12px; color: #5b6b78; max-height: 140px; overflow: auto; }
.att-list { display: flex; flex-direction: column; gap: 4px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
/* Card do cliente no formato PipeRun: coluna de detalhes à esquerda, abas à direita */
.drawer-b.deal-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.deal-side { display: flex; flex-direction: column; gap: 14px; }
.deal-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.deal-body { display: flex; flex-direction: column; gap: 16px; }
.deal-tabs { flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px; }
.side-p { padding: 14px 16px; }
.side-h { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin: -2px 0 8px; padding-bottom: 8px; }
.side-h h3 { margin: 0; }
.side-h .ico { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.side-h .ico:hover { background: var(--bg); color: var(--text); }
.side-r { padding: 6px 0; }
.side-r + .side-r { border-top: 1px dashed var(--line); }
.side-l { font-size: 11.5px; color: var(--muted); }
.side-v { font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.deal-top { align-items: center; }
.won-btn { background: #22c55e; border-color: #22c55e; color: #fff; }
.won-btn:hover { background: #16a34a; }
.lost-btn { background: #ef4444; border-color: #ef4444; color: #fff; }
.lost-btn:hover { background: #dc2626; }
@media (max-width: 900px) { .drawer-b.deal-grid { grid-template-columns: 1fr; } .deal-side { position: static; order: 2; } }
.deal-top .grow { flex: 1; min-width: 0; }
.fin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.fin-col { background: rgba(255,255,255,.6); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fin-h { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.fin-col .files { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 900px) { .fin-grid { grid-template-columns: 1fr; } }
.prot { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }
.chips-pre { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip-pre { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text); text-align: left; }
.chip-pre:hover { border-color: var(--teal); color: var(--teal); }
/* Notas (formato PipeRun) */
.note-card { display: flex; gap: 12px; align-items: flex-start; }
.note-ic { width: 36px; height: 36px; border-radius: 50%; background: #fdba74; display: grid; place-items: center; flex: 0 0 36px; font-size: 16px; box-shadow: 0 0 0 4px #fff; }
.note-b { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-width: 0; }
.note-t { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.note-x { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-f { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; font-size: 12px; color: var(--muted); }
/* Sino de notificações */
.bell { position: fixed; top: 10px; right: 14px; z-index: 40; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; box-shadow: 0 2px 8px rgba(11,31,58,.12); }
.bell-n { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 6px; min-width: 18px; }
.bell-p { position: fixed; top: 58px; right: 14px; z-index: 41; width: min(380px, calc(100vw - 28px)); max-height: min(560px, calc(100vh - 80px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(11,31,58,.22); }
.bell-top { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px 0; font-size: 12px; }
.bell-top span { background: var(--bg); border-radius: 6px; padding: 5px 8px; text-align: center; }
.bell-sum { padding: 10px 14px; text-align: center; font-size: 14px; border-bottom: 1px solid var(--line); }
.bell-list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bell-i { border: 1px solid var(--teal); background: #f0fdfa; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.bell-i.lida { border: 1px dashed var(--line); background: var(--surface); opacity: .75; }
.bell-t { font-weight: 700; font-size: 14px; }
.bell-b { font-size: 13px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bell-d { font-size: 12px; color: var(--teal); margin-top: 4px; }
.bell-f { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.bell-f button, .bell-foot button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; }
.bell-foot { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 8px; }
.main .top { padding-right: 64px; } .drawer-h .row1 { padding-right: 52px; }
/* Fotos da proposta (Tray) */
.qthumbs { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.qthumbs img { width: 38px; height: 38px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.qgal { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 55vh; overflow-y: auto; }
.qgi { position: relative; border: 2px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; cursor: pointer; }
.qgi img { width: 100%; height: 100px; object-fit: contain; display: block; }
.qgi.on { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(20,184,166,.25); }
.qgn { position: absolute; top: 4px; left: 4px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.qgn:empty { display: none; }

/* Vendedor do card em destaque (cor de cada vendedor) */
.seller { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: color-mix(in srgb, var(--sc) 12%, #fff); border: 2px solid var(--sc); color: var(--sc); font-weight: 700; font-size: 14px; white-space: nowrap; }
.seller-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--sc); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 30%, #fff); }
.seller-mini { font-weight: 600; }
.tag.ptag { background: #e3f0fb; color: #1554a0; font-weight: 600; letter-spacing: .2px; }
button.seller { cursor: pointer; font-family: inherit; }
button.seller:hover { background: color-mix(in srgb, var(--sc) 22%, #fff); }
.seller-caret { font-size: 11px; opacity: .7; margin-left: -2px; }
.seller-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.seller-list .seller { width: 100%; justify-content: flex-start; }
.seller-list .seller.on { opacity: .6; }
.tro { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.tro-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-pre.on { border-color: var(--teal, #0f9d8a); background: #e3f5f2; font-weight: 700; }
.bell-p { position: fixed; }
.bell-x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted, #5b6775); z-index: 1; }
.bell-x:hover { background: rgba(0,0,0,.06); }
.bell-top { padding-right: 36px; }
.msg-err { font-size: 11.5px; color: #a3261b; margin-top: 4px; overflow-wrap: anywhere; }
.bell-p[hidden], .bell-n[hidden] { display: none !important; }
.task-focus { outline: 3px solid #f5b400; border-radius: 10px; background: #fff8e1; animation: taskpulse 1.2s ease 2; }
@keyframes taskpulse { 50% { outline-color: #ffd970; } }
.task-ctx { margin-top: 8px; padding: 8px 10px; background: var(--bg, #f4f6f8); border-radius: 8px; }
.task-msg { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; }
[hidden] { display: none !important; }
#stf { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
#stf select, #stf input[type=datetime-local] { width: 100%; min-width: 150px; }
/* E-mail (Central Dutra) */
.mailbox { grid-template-columns: 360px 1fr; }
.mailbox .row { display: flex; align-items: center; }
.mmsgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.mcard.out { border-left: 3px solid var(--teal); }
.mcard .mh { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; cursor: pointer; }
.mcard .mh .grow { flex: 1; }
.mcard .mb { display: none; padding: 0 14px 14px; }
.mcard.open .mb { display: block; }
.mcard.open .msnip, .mcard:not(.open) .mto { display: none; }
.mframe { width: 100%; min-height: 120px; border: 0; display: block; }
.matts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.matt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; text-decoration: none; color: var(--text); background: #fff; }
.linkbtn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 2px; }
.mcompose .f { margin-bottom: 8px; }
.mback { display: none; }
@media (max-width: 860px) { .mback { display: inline-flex; } .mailbox { grid-template-columns: 1fr; } }
.side a .count[hidden] { display: none; }
.mcompose label.f input, .mcompose label.f textarea, .mcompose label.f select, #msf label.f input, #msf label.f textarea { font-weight: 400; font-size: 14px; color: var(--text); }
.mbulk { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; position: sticky; top: 0; z-index: 2; flex-wrap: wrap; font-size: 12.5px; }
.mbulk label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.mbulk .grow { flex: 1; }
.mrow { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.mrow .iitem { border-bottom: 0; flex: 1; min-width: 0; padding-left: 6px; }
.mrow .msel { margin: 14px 0 0 12px; align-self: flex-start; }
/* Lidos x não lidos na caixa de e-mail */
.mailbox .mrow { background: #f6f8fa; }
.mailbox .mrow .iitem { background: transparent; }
.mailbox .mrow .iitem .r1 b { font-weight: 500; color: var(--muted); }
.mailbox .mrow .iitem .snip { color: var(--faint); }
.mailbox .mrow.unread { background: #fff; box-shadow: inset 4px 0 0 var(--teal); }
.mailbox .mrow.unread .iitem .r1 b { font-weight: 700; color: var(--text); }
.mailbox .mrow.unread .iitem .r1 b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: 7px; vertical-align: middle; }
.mailbox .mrow.unread .iitem .when { color: var(--teal-2); font-weight: 600; }
.mailbox .mrow .iitem.on { background: var(--teal-soft); }
/* Loja virtual (painel) */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 12px; }
#shopc .row { display: flex; align-items: center; }
#shopc .li { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; }
/* Menu lateral reorganizado */
.side { overflow-y: auto; scrollbar-width: none; padding: 14px 10px; gap: 1px; }
.side::-webkit-scrollbar { display: none; }
.side .brand { padding-bottom: 12px; }
.side a { padding: 7px 10px; font-size: 13.5px; }
.side a.main-link { background: var(--teal); color: #fff; margin-bottom: 4px; }
.side a.main-link:hover { background: var(--teal-2); }
.side a.main-link.on { box-shadow: none; background: var(--teal-2); }
.side a.main-link .count { background: #fff; color: var(--teal-2); }
.side .sec { padding: 12px 10px 4px; }
.sys { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 8px; }
.sys.on { background: var(--navy-3); }
.sys .sl { display: flex; align-items: center; gap: 8px; color: #c9d4e3; font-weight: 500; font-size: 13.5px; min-width: 0; }
.sys .sl svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .8 }
.sys .sl .count { margin-left: 4px; background: var(--teal); color: #fff; font-size: 10.5px; border-radius: 99px; padding: 0 6px; }
.sys .sw { display: flex; gap: 3px; flex: none; }
.side .sys a.so, .sys .so { display: inline-flex; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid rgba(255,255,255,.14); color: #c9d4e3; }
.side .sys a.so:hover { background: var(--navy-2); color: #fff; }
.side .sys a.so.on { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: none; }
.sys .so.soon { opacity: .4; cursor: default; }
.side-foot { margin-top: auto; }
.side-foot .me { margin-top: 6px; }
@media (max-height: 700px) { .side .sec { padding-top: 8px; } .side a { padding: 5px 10px; } .sys { padding: 3px 6px 3px 10px; } }
/* Configurações em grade */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; max-width: 1100px; margin: 10px auto; }
.cfg-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-decoration: none; color: var(--text); transition: .15s; }
.cfg-card:hover { border-color: var(--teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.cfg-card .ci { font-size: 24px; } .cfg-card b { font-size: 15px; } .cfg-card small { color: var(--muted); font-size: 12.5px; }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.perm { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.perm:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.dtile small { display: block; color: var(--muted); font-size: 12px; } .dtile b { display: block; font-size: 22px; font-family: var(--head); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bars .bar i { display: block; width: 100%; background: var(--teal); border-radius: 4px 4px 0 0; }
.bars .bar small { font-size: 10.5px; color: var(--muted); }
@media (max-width: 860px) { .side { padding: 8px; } .sys { flex: none; } .side-foot { margin: 0; display: flex; } .side-foot .me { display: none; } .perm-list { grid-template-columns: 1fr; } }
.chips.mboxes { background: #f8fafc; border-bottom: 1px solid var(--line); }
.chips.mboxes[hidden] { display: none; }
.sys .so .count { margin-left: 5px; background: #f59e0b; color: #1b1d20; font-size: 10px; border-radius: 99px; padding: 0 5px; }
.sys .so .count[hidden] { display: none; }
.perm-groups { display: grid; align-items: start; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; max-height: 62vh; overflow: auto; }
.pgrp { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pgrp.on { border-color: var(--teal); }
.pgrp legend { font-weight: 700; padding: 0 4px; }
.pgrp legend label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.pgrp .perm { padding: 6px 10px; font-size: 13px; }
@media (max-width: 860px) { .perm-groups { grid-template-columns: 1fr; } }
.tag.dutra { background: #26292d; color: #f7a21b; letter-spacing: .3px; }
.tag.abc { background: var(--teal-soft); color: var(--teal-2); }
h1 .tag { font-size: 12px; vertical-align: middle; margin-left: 6px; }
.chips.funnels.dutra a.on { background: #26292d; color: #f7a21b; border-color: #26292d; }
.org-pick { display: flex; gap: 8px; }
.org-pick label { flex: 1; cursor: pointer; }
.org-pick input { position: absolute; opacity: 0; }
.org-pick span { display: block; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
.org-pick input:checked + span { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-2); }
.org-pick .dutra input:checked + span { background: #26292d; border-color: #26292d; color: #f7a21b; }
/* Loja virtual: painel como o da Tray */
.shop-wrap { display: grid; grid-template-columns: 190px 1fr; flex: 1; min-height: 0; }
.shop-nav { border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; background: #fbfcfd; overflow: auto; }
.shop-nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px; font-weight: 600; color: var(--text); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.shop-nav button:hover { background: #eef1f5; }
.shop-nav button.on { background: #26292d; color: #f7a21b; }
.shop-body { padding: 16px 22px; overflow: auto; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.kpi .kl { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .kv { font-size: 22px; font-weight: 800; margin-top: 2px; }
.kpi .ks { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sbars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.sbars div { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.sbars span { display: block; width: 100%; background: #f7a21b; border-radius: 3px 3px 0 0; }
.mbars { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.mbars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mbars span { display: block; width: 70%; background: #26292d; border-radius: 4px 4px 0 0; }
.mbars small { font-size: 11px; color: var(--muted); }
.linkish { border: 0; background: none; cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; }
button.li.linkish:hover { background: #f4f6f8; }
.unlock { width: auto; display: inline; color: #b86e00; font-size: 12px; font-weight: 600; margin-left: 6px; }
tr.clk { cursor: pointer; } tr.clk:hover td { background: #f7f9fb; }
.noimg { width: 44px; height: 44px; display: grid; place-items: center; background: #f1f3f5; border-radius: 6px; }
.callout.gray { background: #f4f6f8; border-color: #dfe4ea; }
.pe-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.pe-tabs button { border: 0; background: none; padding: 8px 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.pe-tabs button.on { color: var(--text); border-bottom-color: #f7a21b; }
.pe section { min-height: 260px; }
.pe select[multiple] { min-height: 140px; }
.pe-imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.pe-img { width: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; position: relative; background: #fff; }
.pe-img img { width: 100%; height: 100px; object-fit: contain; }
.pe-img .tag { position: absolute; top: 6px; left: 6px; }
.pe-img div { display: flex; justify-content: space-between; margin-top: 4px; }
.pe-img button { border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 2px 8px; }
.hist { max-height: 180px; overflow: auto; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 860px) { .shop-wrap { grid-template-columns: 1fr; } .shop-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); } .shop-nav button { white-space: nowrap; } }
.shop-body .row, .modal .row { display: flex; align-items: center; }
.shop-body .row > select, .shop-body .row > input, .modal .row > input { width: auto; }
.shop-body .row > input[type=search] { flex: 1 1 220px; }
.shop-body .row > label.f, .modal .row > label.f { width: auto; }
.shop-body .row .grow, .modal .row .grow { flex: 1; }
.tag.mk-ml { background: #fff159; color: #2d3277; }
.tag.mk-magalu { background: #0086ff; color: #fff; }
.tag.mk-g { background: #e8f0fe; color: #1a56c4; }
.tag.mk-m { background: #eaf1ff; color: #7b2ff7; background: linear-gradient(90deg,#fdeef6,#eef0ff); }
.viewas-bar { position: sticky; top: 0; z-index: 50; background: #f7a21b; color: #1b1d20; padding: 8px 16px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.viewas-bar button { border: 0; background: #1b1d20; color: #fff; border-radius: 8px; padding: 5px 12px; font-weight: 700; cursor: pointer; }
.shell.viewing { height: calc(100vh - 37px); }

/* Atendimentos: canais em 2 linhas (ABC em cima, Dutra embaixo), sem rolagem */
.chips.chrows { flex-direction: column; gap: 6px; overflow: visible; }
.chrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chlbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); min-width: 74px; }
.chrow.dutra .chlbl { color: #d98a0b; }
.emojipop { position: fixed; z-index: 999; width: 292px; max-height: 230px; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.emojipop button { border: 0; background: none; font-size: 20px; padding: 3px; border-radius: 6px; cursor: pointer; }
.emojipop button:hover { background: var(--teal-soft); }

/* Canais: só ícone; o nome aparece ao passar o mouse. "Todos" em destaque */
.chips .chrow button.all { background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 700; padding: 5px 14px; }
.chips .chrow button.all b { background: #fff; color: var(--teal-2); }
.chips .chrow button.all:not(.on) { background: #fff; color: var(--teal-2); }
.chips .chrow button.all:not(.on) b { background: var(--teal); color: #fff; }
.chips button.chi { gap: 4px; padding: 4px 8px; border-color: color-mix(in srgb, var(--c) 45%, #fff); position: relative; }
.chi .ico { font-size: 15px; line-height: 1; }
.chi .nm { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .2s ease; font-size: 12.5px; }
.chi:hover .nm, .chi.on .nm { max-width: 140px; }
.chips button.chi.on { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: var(--c); color: var(--text); }
.chips.chrows { padding-top: 8px; padding-bottom: 8px; gap: 4px; }
.chlbl { min-width: 66px; }
.chi .ico sub { font-size: 9px; font-weight: 800; vertical-align: -1px; }

/* Conversa: cabeçalho compacto (mais espaço para as mensagens) */
#ithread .thead { padding: 6px 12px; gap: 6px; }
#ithread .thead b { font-size: 14px; }
#ithread .thead .muted { font-size: 11.5px !important; line-height: 1.3; max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ithread .thead .actions { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#ithread .thead select, #ithread .thead .btn { height: 28px; min-height: 28px; padding: 2px 8px; font-size: 12.5px; }
#ithread .thead select { padding-right: 22px; }
#ithread .stagebar { padding: 4px 12px 6px; gap: 4px; }
#ithread .sb-pipes button { padding: 1px 7px; font-size: 11.5px; }
#ithread .sb-steps button { padding: 4px 12px 4px 17px; font-size: 11.5px; }
#ithread .sb-steps button:first-child { padding-left: 11px; }

/* Conversa do WhatsApp colada numa nota */
.note-form textarea { flex: 1; min-height: 40px; resize: vertical; }
.note-form { align-items: flex-start; }
.wachat { background: #efe7de; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; white-space: normal; }
.wa-pre { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; margin-bottom: 6px; }
.wa-day { text-align: center; margin: 6px 0; }
.wa-day span { background: #fff; color: #54656f; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-msg { max-width: 78%; padding: 5px 9px 4px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.1); font-size: 13.5px; }
.wa-msg.them { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.wa-msg.us { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 2px; }
.wa-who { font-size: 11.5px; font-weight: 700; color: #1f7a6a; margin-bottom: 1px; }
.wa-msg.them .wa-who { color: #b25b00; }
.wa-b { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-t { font-size: 10.5px; color: #667781; text-align: right; margin-top: 1px; }
.wa-legend { font-size: 11px; color: #667781; text-align: center; margin-top: 6px; }

/* Avaliação do atendimento (IA) */
.stars { color: #f5a623; letter-spacing: 1px; font-size: 15px; }
.stars .off { color: #d6dbe1; }
.panel.review.good { border-left: 3px solid #2f9e5a; }
.panel.review.mid { border-left: 3px solid #f5a623; }
.panel.review.bad { border-left: 3px solid var(--red); }
.rv-score { display: flex; align-items: center; gap: 6px; }
.rv-h { font-size: 11.5px; font-weight: 700; margin-top: 6px; }
.rv-l { margin: 2px 0 0; padding-left: 16px; font-size: 12.5px; }
.rv-l.imp li::marker { content: "→ "; color: var(--teal-2); }

/* Posts (calendário) */
.post-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
@media (max-width: 800px) { .post-grid { grid-template-columns: 1fr; } }
.post-art { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #f4f6f8; display: block; }
.post-art.empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }

.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.vid { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; min-width: 0; }
.vid img, .vid-ph { width: 100%; aspect-ratio: 9 / 12; object-fit: cover; border-radius: 6px; background: #eef1f4; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.vid-n { font-weight: 600; font-size: 12.5px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; background: #e6eaee; border-radius: 3px; overflow: hidden; } .bar span { display: block; height: 100%; background: var(--teal); }
video.post-art { object-fit: contain; background: #000; }

.mfrom{font-size:12px;font-weight:400;color:var(--muted,#6b7a86);word-break:break-all}
.mfrom2{font-size:12px;color:var(--muted,#6b7a86);word-break:break-all}
.mfrom2.warn{color:#b42318;font-weight:600;margin-top:2px}
#mlist .r1 b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.xtra{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.xtra .xrow{display:grid;grid-template-columns:1.2fr 1fr 1fr 1.4fr auto;gap:6px;align-items:center}
.xtra .xrow input{min-width:0}
@media (max-width:760px){.xtra .xrow{grid-template-columns:1fr 1fr}}
.xtra [data-xadd]{align-self:flex-start;font-size:12px;padding:3px 10px}

#xcts{margin:0 0 12px;padding:10px 12px;border:1px dashed var(--line,#d9e0e5);border-radius:10px}

.cgrid4{display:grid;grid-template-columns:1.2fr 1fr 1fr 1.4fr;gap:12px}
@media (max-width:760px){.cgrid4{grid-template-columns:1fr 1fr}}

/* exemplos (placeholder) bem mais claros que o texto preenchido */
input::placeholder, textarea::placeholder { color: #b8c0cc; opacity: 1; font-style: italic; }
.lnk { display: flex; gap: 6px; align-items: stretch; }
.lnk input { flex: 1; min-width: 0; }
.lnk .btn { white-space: nowrap; display: inline-flex; align-items: center; }
.fin-pre > summary { list-style: none; cursor: pointer; display: inline-flex; margin-bottom: 8px; }
.fin-pre > summary::-webkit-details-marker { display: none; }
.btn.pend-btn { background: #f5c542; border-color: #e0aa12; color: #3d2e00; }
.btn.pend-btn:hover { background: #eab520; }
.fin-thread { margin-top: 10px; border-top: 1px dashed #e6d3a3; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.fin-msg { background: #fff; border: 1px solid #eee3c7; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
/* Telefone do painel (PABX) */
#abcph { position: fixed; right: 18px; bottom: 18px; z-index: 900; font-size: 14px; }
#abcph-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--brand, #0f9d8a); color: #fff; font-size: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; position: relative; }
#abcph-dot { position: absolute; right: 4px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
#abcph-dot.on { background: #22c55e; }
#abcph-box { position: absolute; right: 0; bottom: 62px; width: 300px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
#abcph-box[hidden] { display: none; }
.abcph-h { display: flex; align-items: center; gap: 8px; } .abcph-h .muted { font-size: 12px; flex: 1; } #abcph-x { border: 0; background: none; font-size: 20px; cursor: pointer; }
#abcph-dial { display: flex; gap: 6px; } #abcph-dial[hidden], #abcph-call[hidden] { display: none; } #abcph-num { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; }
.abcph-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.abcph-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; } .abcph-pad button { padding: 6px; border: 1px solid #e5e7eb; background: #f9fafb; border-radius: 6px; cursor: pointer; }
.ph-h { grid-template-columns: 140px 110px 110px auto; }

/* 📞 / 💬 dentro do campo de telefone (sem quebrar a linha do formulário) */
.telw{position:relative;display:block;width:100%;min-width:0}.telw input{width:100%;padding-right:62px}
.telb{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:flex;gap:2px}
.telb button,.telb a{border:0;background:transparent;cursor:pointer;font-size:15px;line-height:1;padding:4px;border-radius:6px;text-decoration:none}
.telb button:hover,.telb a:hover{background:#f1f5f9}

/* Linha do telefone (ABC 1, ABC 2, Dutra) */
#abcph-line{position:absolute;left:50%;bottom:-8px;transform:translateX(-50%);background:#12294a;color:#fff;font-size:10px;font-weight:700;line-height:1;padding:3px 6px;border-radius:99px;white-space:nowrap}
#abcph-line:empty{display:none}
.abcph-ln{display:inline-block;background:#fff4e0;color:#8a5a00;border-radius:99px;padding:2px 8px;font-size:12px;margin-bottom:4px}

/* Enviar por (qual WhatsApp) */
.rvia-l{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--muted);white-space:nowrap}
.rvia-l select{font-weight:700;border-radius:8px;padding:6px 8px;border:2px solid #cbd5e1}
.rvia-l select.abc{border-color:#0f9f90;background:#ecfdf8;color:#0b6b61}.rvia-l select.dutra{border-color:#f7a21b;background:#fff7e8;color:#8a5a00}

.bell-h{padding:8px 14px 4px;font-size:12px;font-weight:700;color:var(--muted,#6b7785);text-transform:uppercase;letter-spacing:.04em;border-top:1px solid var(--line,#e3e8ec)}

.bell-p { max-height: min(760px, calc(100vh - 80px)); }
.bell-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.bell-scroll .bell-list { overflow: visible; }
.prot-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prot-links:last-child { flex-wrap: nowrap; }
.prot-links .btn { white-space: nowrap; }
/* Topo sempre compacto; ▴ esconde os filtros de canais (ABC/Dutra); « recolhe o menu para a coluna de ícones */
.shell { position: relative; }
.top { padding: 8px 18px; gap: 8px; }
.top h1 { font-size: 17px; }
.top .btn, .top select, .top input { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.content { padding: 12px 16px; }
.shell.top-off .queue, .shell.top-off .chrows { display: none; }
.side .mi { width: 20px; text-align: center; flex: none; font-size: 15px; }
.side a.main-link .mi { display: none; }
.side .sys a.sl { text-decoration: none; color: inherit; padding: 0; background: none; box-shadow: none; }
.tgside { margin: 6px 0 0; align-self: flex-end; width: 28px; height: 28px; border-radius: 99px; border: 1px solid #2b3b55; background: #16233a; color: #cfd8e3; cursor: pointer; font-size: 13px; }
.tgside:hover { background: var(--teal); color: #fff; }
.shell.side-off { grid-template-columns: 62px 1fr; }
.shell.side-off .side { padding: 12px 8px; align-items: center; overflow-x: hidden; }
.shell.side-off .side .lt, .shell.side-off .side .sec, .shell.side-off .side .brand div, .shell.side-off .side .me, .shell.side-off .side .sw { display: none; }
.shell.side-off .side a, .shell.side-off .side .sys { justify-content: center; padding: 9px 0; width: 44px; }
.shell.side-off .side a.main-link .mi { display: inline; }
.shell.side-off .side .brand { padding: 0 0 12px; }
.shell.side-off .tgside { align-self: center; }
.lay-tg { position: absolute; left: 232px; top: 6px; z-index: 40; transform: translateX(-50%); }
.shell.side-off .lay-tg { left: 62px; }
.lay-tg button { width: 22px; height: 22px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 11px; line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.12); padding: 0; }
.lay-tg button:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
@media (max-width: 860px) { .lay-tg, .tgside { display: none; } .shell.side-off .side { display: flex; } .shell.side-off { grid-template-columns: 1fr; } .shell.side-off .side .lt { display: inline; } }
.side a.main-link .lt { display: flex; align-items: center; gap: 10px; flex: 1; }
.side a.main-link .lt .count { margin-left: auto; }
.shell.side-off .side a.main-link .lt { display: none; }
.shell.side-off .side .sys { padding: 4px 0; }
.bell-more { margin: -4px 0 6px 14px; border-left: 2px solid var(--line); padding-left: 8px; }
.bell-more summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--teal-2); padding: 4px 0; }
.bell-more .bell-sub { opacity: .9; font-size: 12.5px; }
.bell-rall { background: none; border: 0; color: var(--teal-2); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 4px 0; }
.prot .prot-links { flex-wrap: nowrap !important; gap: 5px; }
.prot .prot-links .btn { font-size: 11.5px; padding: 4px 7px; flex: 0 1 auto; min-width: 0; }
.deal-main > .deal-tabs { margin-bottom: 10px; position: sticky; top: 0; z-index: 5; }
/* Cabeçalho do card: ações rápidas em cima e abas numa linha só, faixa verde */
.deal-toprow { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.deal-main > .deal-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 3px 6px; border-radius: 10px; background: #e6f6ee; border-color: #a8dcc0; scrollbar-width: thin; }
.deal-main > .deal-tabs button { font-size: 12.5px; padding: 6px 9px; white-space: nowrap; flex: none; }
.deal-main > .deal-tabs button.on { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(18,97,58,.18); color: #12613a; }
.deal-main > .deal-tabs button { font-size: 12px; padding: 5px 7px; }
.deal-main > .deal-tabs { justify-content: space-between; }
.deal-tabs .tabn { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 99px; background: #12613a; color: #fff; font-size: 10.5px; line-height: 16px; text-align: center; }
/* Tabelas longas do dashboard: primeiras linhas visíveis e o resto rolando, com cabeçalho fixo */
.tscroll { overflow: auto; border-radius: 10px; }
.tscroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.bd-pie { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.pie { display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: var(--text); }
.pie-l { width: 100%; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.pie-l div { display: flex; align-items: center; gap: 6px; }
.pie-l i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pie-l b { margin-left: auto; }
@media (max-width: 1000px) { .bd-pie { grid-template-columns: 1fr; } }
