/* CRM & Agenda — estilos próprios (agenda, fichas, listas). Usa só os tokens definidos em admin.css. */
.lbl { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--a-text2); }
.lnk { background: none; border: 0; padding: 0; color: var(--redes-primary); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }
.panel h3 { font-family: var(--redes-font-display); }
.toprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel .toprow { margin-bottom: 8px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.wrap { flex-wrap: wrap; }
.modal.wide { width: min(760px, 100%); }
.daytitle::first-letter { text-transform: uppercase; }
.daytitle { margin: 14px 0 4px; font: 700 14px var(--redes-font-display); color: var(--a-text2); }

/* avisos */
.notice { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--redes-line); background: var(--a-raised); font-size: 14px; margin: 0 0 12px; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.notice.warn { background: var(--a-warnbg); border-color: var(--a-warn); }
.notice.ok { background: var(--a-okbg); border-color: var(--a-ok); }
.panel .notice:last-child { margin-bottom: 0; }

/* linhas simples de lista (procedimentos, equipe, regras, fila) */
.row.slim { grid-template-columns: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: default; flex-wrap: wrap; }
.row.slim .nm, .row.slim .pv { white-space: normal; }
.row.slim.off { opacity: .65; }
.row.slim .check { margin: 0; padding: 0; border: 0; background: none; }
.pdot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.chipsline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chips .check { margin: 0; padding: 6px 10px; }
.chip { border: 1px solid var(--a-ctl); background: var(--a-raised); color: var(--redes-text); border-radius: 99px; padding: 6px 12px; font-size: 13px; min-height: 36px; }
.chip:hover { background: var(--a-hover); }
.chip[aria-pressed=true], .chip.on { background: var(--redes-primary); border-color: var(--redes-primary); color: var(--a-on-primary); font-weight: 700; }
.chip:disabled { opacity: .5; cursor: not-allowed; }

/* abas internas da ficha */
.subtabs { display: flex; gap: 4px; overflow-x: auto; margin: 14px 0 12px; border-bottom: 1px solid var(--redes-line); }
.subtabs button { flex: none; min-height: 40px; padding: 0 14px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--redes-muted); font-weight: 600; }
.subtabs button[aria-selected=true] { color: var(--redes-text); border-bottom-color: var(--redes-primary); }
.cl-panel .panel + .panel { margin-top: 12px; }

/* listas de dados */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--redes-muted); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.pkg, .rec { padding: 12px 0; border-top: 1px solid var(--redes-line); }
.pkg:first-of-type, .rec:first-of-type { border-top: 0; }
.pkg .bar { margin: 4px 0; }
.termtext { white-space: pre-wrap; max-height: 220px; overflow: auto; padding: 10px 12px; border: 1px solid var(--a-ctl); border-radius: 10px; background: var(--a-raised); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.help { font-size: 12.5px; color: var(--redes-muted); }

/* mensagens e pré-visualização do WhatsApp */
.msg { display: flex; flex-direction: column; margin: 8px 0; max-width: 85%; }
.msg.in { align-items: flex-start; }
.msg.out { align-items: flex-end; margin-left: auto; }
.msg .bub { padding: 8px 12px; border-radius: 12px; background: var(--a-raised); border: 1px solid var(--redes-line); white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.msg.out .bub { background: var(--a-emph); }
.msg small { color: var(--redes-muted); font-size: 11.5px; margin-top: 2px; }
.wabubble { padding: 10px 14px; border-radius: 12px 12px 12px 2px; background: var(--a-emph); border: 1px solid var(--redes-line); white-space: pre-wrap; font-size: 14px; line-height: 1.45; max-width: 460px; }
.wabubble.err { color: var(--a-bad); }

/* tabelas e importação */
.tablewrap { overflow-x: auto; margin: 8px 0; border: 1px solid var(--redes-line); border-radius: 10px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--redes-line); white-space: nowrap; }
.tbl th { color: var(--redes-muted); font-weight: 700; background: var(--a-raised); }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 12px; margin: 10px 0; }
.maprow { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: var(--a-text2); }
.warnlist { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--a-text2); }

/* horários da equipe */
.hours { display: flex; flex-direction: column; gap: 8px; }
.hday { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--redes-line); }
.hday b { width: 74px; flex: none; font-size: 13px; padding-top: 10px; }
.hrow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.hrow .redes-input { width: 118px; }

/* primeiros passos */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; }
.steps .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--a-ctl); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; }
.steps li.done .tick { background: var(--redes-primary); border-color: var(--redes-primary); color: var(--a-on-primary); }

/* agendamento: linha */
.arow { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--redes-line); border-left: 5px solid var(--pc, var(--redes-primary)); border-radius: 12px; background: var(--a-raised); cursor: pointer; flex-wrap: wrap; }
.arow:hover { background: var(--a-hover); }
.ar-time { display: flex; flex-direction: column; align-items: center; min-width: 52px; line-height: 1.2; }
.ar-time b { font: 800 16px var(--redes-font-display); font-variant-numeric: tabular-nums; }
.ar-time small { font-size: 11.5px; color: var(--redes-muted); }
.ar-main { flex: 1 1 200px; min-width: 0; }
.ar-title { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.ar-sub { font-size: 12.5px; color: var(--redes-muted); overflow-wrap: anywhere; }
.ar-alert { font-size: 12.5px; color: var(--a-warn); font-weight: 600; }
.ar-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.arow.st-cancelled, .arow.st-no_show { opacity: .6; }
.arow.st-done { border-left-style: dashed; }
.st-cancelled .ar-title { text-decoration: line-through; }

/* barra de ferramentas da agenda */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tb-nav { display: flex; gap: 6px; align-items: center; }
.tb-label::first-letter { text-transform: uppercase; }
.tb-label { font: 700 15px var(--redes-font-display); min-width: 150px; text-align: center; }
.tb-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.segbtn { display: inline-flex; border: 1px solid var(--a-ctl); border-radius: 10px; overflow: hidden; }
.segbtn button { min-height: 40px; padding: 0 14px; background: var(--a-raised); border: 0; border-right: 1px solid var(--a-ctl); }
.segbtn button:last-child { border-right: 0; }
.segbtn button[aria-pressed=true], .segbtn button[aria-selected=true] { background: var(--redes-primary); color: var(--a-on-primary); font-weight: 700; }
.datepick { width: auto; min-width: 150px; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--redes-primary); border-radius: 10px; background: var(--a-emph); margin-bottom: 12px; }
.ad-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ad-t { font: 700 18px var(--redes-font-display); }
.agbody { min-height: 120px; }

/* grade da agenda */
.gridwrap { border: 1px solid var(--redes-line); border-radius: 12px; background: var(--redes-surface); overflow: auto; max-height: calc(100dvh - 250px); min-height: 320px; }
.grid { min-width: calc(54px + var(--cols, 1) * 150px); }
.gheads { display: grid; grid-template-columns: 54px repeat(var(--cols, 1), minmax(0, 1fr)); position: sticky; top: 0; z-index: 5; background: var(--redes-surface); border-bottom: 1px solid var(--redes-line); }
.ghead { padding: 8px 6px; text-align: center; border-left: 1px solid var(--redes-line); border-top: 4px solid var(--pc, var(--redes-primary)); font-size: 13px; }
.ghead b { display: block; text-transform: capitalize; }
.ghead small { color: var(--redes-muted); }
.ghead.today b { color: var(--redes-primary); }
.gbody { display: grid; grid-template-columns: 54px 1fr; }
.gutter { position: relative; }
.gutter .hl { position: absolute; right: 6px; transform: translateY(-7px); font-size: 11.5px; color: var(--redes-muted); font-variant-numeric: tabular-nums; }
.gcols { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.gcol { position: relative; border-left: 1px solid var(--redes-line); background: var(--a-hover); cursor: cell; }
.gcol .wh { position: absolute; left: 0; right: 0; background: var(--redes-surface); pointer-events: none; }
.gcol .gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--redes-line); pointer-events: none; }
.ev { position: absolute; overflow: hidden; border-radius: 8px; padding: 3px 6px; font-size: 12px; line-height: 1.25; cursor: pointer; background: var(--a-emph); border: 1px solid var(--pc, var(--redes-primary)); border-left: 4px solid var(--pc, var(--redes-primary)); z-index: 2; }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; color: var(--a-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.st-confirmed { background: var(--a-okbg); }
.ev.st-scheduled { background: var(--a-raised); border-style: dashed; border-left-style: solid; }
.ev.st-done { opacity: .7; }
.ev.st-no_show { opacity: .55; background: var(--a-badbg); }
.ev.over { box-shadow: 0 0 0 2px var(--a-warn); }
.ev .al { position: absolute; top: 2px; right: 4px; font-style: normal; color: var(--a-warn); }
.blk { position: absolute; left: 2px; right: 2px; z-index: 1; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; color: var(--a-text2); background: repeating-linear-gradient(45deg, var(--a-raised), var(--a-raised) 6px, var(--a-hover) 6px, var(--a-hover) 12px); border: 1px dashed var(--a-ctl); cursor: pointer; overflow: hidden; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--a-bad); z-index: 3; pointer-events: none; }
.gcorner { background: var(--redes-surface); }

/* status */
.pill.st-scheduled { }
.pill.st-confirmed { background: var(--a-okbg); color: var(--a-ok); border-color: var(--a-ok); }
.pill.st-done { background: var(--a-emph); }
.pill.st-no_show, .pill.st-cancelled { background: var(--a-badbg); color: var(--a-bad); border-color: var(--a-bad); }

@media (max-width: 860px) {
  .tb-opts { margin-left: 0; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dt { margin-top: 8px; }
  .hday { flex-direction: column; gap: 4px; }
  .hday b { padding-top: 0; }
  .msg { max-width: 95%; }
}
.tb-opts .redes-input { width: auto; min-width: 190px; }
.toolbar .datepick { width: auto; }
