/* Design: painel denso no estilo Linear (tema escuro) */
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent); --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);
  --h-sm: 26px; --h-md: 30px; --overlay: rgba(0, 0, 0, .5);
  --bg: #1a1a19; --bg-side: #151514; --surface: #1d1d1c; --surface-2: #252524; --surface-3: #2d2d2b; --sunken: #181817;
  --border: #2c2b29; --border-strong: #3a3936; --divider: #252523;
  --text: #eceae5; --text-2: #b5b2ab; --text-3: #9a968f; --text-4: #6f6c66;
  --accent: #8e9af3; --on-accent: #12131c;
  --green: #5cba86; --amber: #d8a443; --red: #e57d70; --blue: #72a5ea; --violet: #a98deb; --teal: #58c0b6; --rose: #e68aab; --orange: #e3925f; --gray: #8f8b84;
  --shadow-pop: 0 12px 32px -8px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  --r-sm: 6px; --r: 8px; --r-lg: 10px;
  --ck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2312131c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.4'/%3E%3C/svg%3E");
  --font: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg-side); color: var(--text); font: 13.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.022em; line-height: 1.2; }
h2 { margin: 0; font-size: 14.5px; font-weight: 600; } h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
b { font-weight: 600; }
.muted { color: var(--text-3); } .small { font-size: 12.5px; } .msg { color: var(--text-3); } .sub { margin: 4px 0 0; color: var(--text-3); max-width: 70ch; }

/* ===== estrutura ===== */
.app { display: grid; grid-template-columns: 200px minmax(0, 1fr); height: 100vh; }
.side { display: flex; flex-direction: column; padding: 4px 8px 12px; overflow-y: auto; min-height: 0; }
.ws { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 8px; font-weight: 600; }
.wslogo { width: 20px; height: 20px; border-radius: 5px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.wslogo svg { width: 13px; height: 13px; stroke-width: 2; }
.wslogo-img { background: none; border-radius: 50%; }
.wslogo-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
#side-toggle { margin-left: auto; color: var(--text-3); }
#side-toggle:hover { color: var(--text); }
nav { display: grid; gap: 1px; margin-top: 6px; }
nav button { display: flex; align-items: center; gap: 9px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left; transition: background .14s var(--ease), color .14s; }
nav button:hover { background: var(--surface-2); color: var(--text); }
nav button.on { background: var(--surface-3); color: var(--text); font-weight: 500; }
nav button svg { color: var(--text-3); } nav button.on svg { color: var(--text); }
nav .cnt { margin-left: auto; font-size: 12px; color: var(--text-4); }
nav .cnt.acc { background: var(--accent); color: var(--on-accent); border-radius: 999px; min-width: 18px; height: 18px; padding: 0 6px; display: grid; place-items: center; font-weight: 600; font-size: 11px; }
.sec-l { font-size: 11px; letter-spacing: .06em; color: var(--text-4); padding: 18px 8px 6px; font-weight: 500; }
.side-regras { display: grid; gap: 1px; }
.side-regras button { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: inherit; cursor: pointer; text-align: left; }
.side-regras button:hover { background: var(--surface-2); color: var(--text); }
.side-regras .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.side-regras .off { color: var(--text-4); font-size: 11px; }
.side-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 10px; border-top: 1px solid var(--divider); }
.user { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.user .unome { display: grid; line-height: 1.2; min-width: 0; } .user small { color: var(--text-4); font-size: 11.5px; }
.user .av { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; border: 1px solid var(--border-strong); flex: none; }

.main { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--gray); }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.scroll { flex: 1; overflow-y: auto; min-height: 0; }
.content { padding: 22px 24px 48px; display: grid; gap: 16px; max-width: 2400px; width: 100%; margin-inline: auto; }
.content > section { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ===== componentes ===== */
.pg-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); min-width: 0; }
.card.flush { padding: 0; overflow-x: auto; overflow-y: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h.pad { padding: 14px 16px 0; margin-bottom: 8px; }
.btn, button.primary, button.ghost { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .14s var(--ease), transform .14s var(--ease); }
.btn:hover, button.ghost:hover { background: var(--surface-2); }
.btn:active, button.primary:active { transform: scale(.97); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.primary, button.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover, button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.icon { background: none; border: 0; color: var(--text-3); width: 24px; height: 24px; border-radius: var(--r-sm); font-size: 17px; line-height: 1; cursor: pointer; padding: 0; }
button.icon:hover { background: var(--surface-2); color: var(--text); }
button.link { background: none; border: 0; color: var(--text-3); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm); }
button.link:hover { color: var(--text); background: var(--surface-2); }
button.del { background: none; border: 0; color: var(--red); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); }
button.del:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
input, select, textarea { font: inherit; font-size: 13px; height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); color-scheme: dark; }
textarea { width: 100%; height: auto; padding: 8px 10px; margin: 8px 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
label { display: grid; gap: 5px; font-size: 12px; color: var(--text-3); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 4px 0; }
.alerta { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 38%, transparent); border-radius: var(--r); padding: 9px 14px; }
.sec-t { font-size: 11px; letter-spacing: .05em; color: var(--text-4); margin: 14px 0 6px; font-weight: 500; }
.tag { font-size: 11.5px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-2); }
.badge.ok { color: var(--green); background: color-mix(in srgb, var(--green) 11%, transparent); border-color: transparent; }
.badge.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); border-color: transparent; }
.nav-mini { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); font-size: 12.5px; }
.chip { font-size: 11.5px; border-radius: 5px; padding: 1px 7px; width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.f { background: var(--surface-2); color: var(--text-4); }
.fil { display: inline-flex; align-items: center; gap: 7px; height: 26px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); font: inherit; font-size: 12px; padding: 0 10px; border-radius: 999px; cursor: pointer; }
.fil:hover { background: var(--surface-2); } .fil.off { opacity: .45; text-decoration: line-through; }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .toolbar .filtros { margin: 0; }
.seg { margin-left: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; display: flex; }
.seg button { background: none; border: 0; color: var(--text-3); height: 24px; padding: 0 12px; border-radius: 4px; font: inherit; font-size: 12px; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }

/* ===== visao geral ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.stat { padding: 14px 16px; display: grid; gap: 2px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .l { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12px; }
.stat .l svg { width: 14px; height: 14px; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; }
.stat .c { font-size: 12px; color: var(--text-4); }
.stat .c.g { color: var(--green); } .stat .c.a { color: var(--amber); } .stat .c.r { color: var(--red); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.grid2.b { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.stack { display: grid; gap: 16px; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; padding: 8px 0 6px; }
.tl-grid { display: grid; gap: 4px; min-width: 860px; }
.tl-row { display: grid; grid-template-columns: 190px repeat(14, minmax(52px, 1fr)); gap: 4px; align-items: stretch; }
.tl-label { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r); min-height: 50px; background: var(--surface); }
.tl-label b { font-weight: 500; font-size: 13px; display: block; line-height: 1.25; } .tl-label small { color: var(--text-4); font-size: 11.5px; }
.tl-label.cab { border: 0; background: none; color: var(--text-4); min-height: 0; font-size: 12px; align-items: end; }
.rico { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--kc) 16%, transparent); color: var(--kc); flex: none; }
.rico svg { width: 13px; height: 13px; }
.dchip { border: 0; border-bottom: 2px solid transparent; background: none; padding: 2px 2px 5px; text-align: center; line-height: 1.2; color: var(--text-2); font: inherit; cursor: pointer; border-radius: 0; }
.dchip small { display: block; color: var(--text-4); font-size: 11px; } .dchip b { font-size: 12.5px; font-weight: 500; }
.dchip.nu { color: var(--text-4); }
.dchip.hoje { border-bottom-color: var(--accent); color: var(--accent); } .dchip.hoje small { color: var(--accent); }
.dchip.sel { background: var(--surface-2); border-radius: 5px 5px 0 0; }
.tcell { position: relative; border-radius: var(--r-sm); min-height: 50px; display: grid; place-items: center; padding: 3px; }
.tcell.nu { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--divider) 5px 6px), var(--sunken); border: 1px solid var(--divider); }
.tcell.pz { background: var(--sunken); opacity: .5; }
.tcell.hoje::before { content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px; border-left: 1px dashed var(--accent); pointer-events: none; z-index: 2; }
.blk { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 38px; border-radius: var(--r-sm); padding: 4px 6px; display: flex; flex-direction: column; justify-content: center; gap: 0; background: color-mix(in srgb, var(--kc) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--kc) 38%, transparent); color: var(--kc); font: inherit; text-align: left; cursor: pointer; transition: transform .14s var(--ease), background .14s; }
.blk:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--kc) 22%, var(--surface)); }
.blk b { font-size: 14px; font-weight: 600; line-height: 1.1; } .blk span { font-size: 10.5px; opacity: .85; line-height: 1.1; }
.blk em { position: absolute; top: -6px; right: 3px; font-style: normal; font-size: 9.5px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; }
.strip { margin-top: 12px; border-top: 1px solid var(--divider); padding-top: 12px; display: grid; gap: 6px; }
.strip h4 { margin: 0; font-weight: 600; font-size: 13px; }
.strip .grp { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.strip .grp > b { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; min-width: 190px; }
.prox-g { margin-bottom: 12px; } .prox-g:last-child { margin-bottom: 0; }
.prox-g .sec-t { margin: 0 0 4px; }
.pi { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid var(--divider); font-size: 13px; }
.pi:first-of-type { border-top: 0; }
.pi .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi .d { color: var(--text-4); font-size: 12px; white-space: nowrap; }
.passos { display: grid; gap: 8px; }
.passo { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 4px; text-align: left; background: var(--surface); color: var(--text); font: inherit; width: 100%; cursor: pointer; transition: background .14s; }
.passo:hover { background: var(--surface-2); }
.passo b { font-weight: 500; } .passo .d { color: var(--text-3); font-size: 12.5px; }
.passo.urg { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.passo.urg b { color: var(--amber); }
.passo .tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== regras / tabelas ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0 14px; height: 40px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
th { font-size: 12px; color: var(--text-3); font-weight: 500; height: 34px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
td .st { display: inline-flex; align-items: center; gap: 7px; }
td.muted { color: var(--text-3); } td .nm { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; }
.code { background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; overflow: auto; font: 12px/1.55 var(--mono); margin: 10px 0 0; color: var(--text-2); }
details summary { cursor: pointer; color: var(--text-3); margin-top: 6px; }

/* cores por regra */
.k0 { --kc: var(--blue); } .k1 { --kc: var(--orange); } .k2 { --kc: var(--green); } .k3 { --kc: var(--violet); } .k4 { --kc: var(--rose); } .k5 { --kc: var(--teal); }
.chip[class*=" k"] { background: color-mix(in srgb, var(--kc) 14%, transparent); color: var(--kc); }
i.dot[class*=" k"] { background: var(--kc); }

@media (prefers-reduced-motion: reduce) { .blk, nav button, .app { transition: none; } }

@media (max-width: 1100px) { .grid2, .grid2.b { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}
/* telas pequenas: menu lateral sempre recolhido (so icones), igual ao modo recolhido do desktop */
@media (max-width: 820px) {
  .app { grid-template-columns: 56px minmax(0, 1fr); }
  .side { overflow-x: hidden; }
  .ws { justify-content: center; padding: 0; }
  .ws > b, #side-toggle { display: none; }
  #logo { width: 30px; height: 30px; border-radius: 8px; }
  #logo svg { width: 17px; height: 17px; }
  nav button { justify-content: center; padding: 0; position: relative; }
  nav .lbl, nav .cnt:not(.acc) { display: none; }
  nav .cnt.acc { position: absolute; top: 5px; right: 7px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; border: 2px solid var(--bg-side); box-sizing: content-box; }
  .sec-l { height: 1px; background: var(--divider); margin: 10px 6px; padding: 0; font-size: 0; }
  .side-regras button { justify-content: center; padding: 0; }
  .side-regras .n, .side-regras .off { display: none; }
  .user { flex-direction: column; justify-content: center; padding: 0; gap: 8px; }
  .user .unome { display: none; }
  .user #btn-sair { margin: 0; }
  .user #btn-senha { display: none; }
}

/* campos nunca estouram o cartao */
label { min-width: 0; }
label > input, label > select, label > textarea { width: 100%; min-width: 0; }
.rcard .chk { align-self: end; min-height: 30px; }
.rcard select { text-overflow: ellipsis; }

@media (max-width: 760px) { .cards .card.geral { grid-template-columns: 1fr; } }


/* ===== Calendario (clone do Calendar do Gr8r) ===== */
.content.flush { padding: 0; max-width: none; min-height: 100%; display: flex; flex-direction: column; gap: 0; }
.content.flush > #alertas:not(:empty) { padding: 12px 24px 0; }
#tab-calendario { flex: 1; display: flex !important; flex-direction: column; gap: 0; min-height: 0; }
#tab-calendario[hidden] { display: none !important; }
.ph { display: flex; align-items: flex-start; gap: 12px; padding: 24px 24px 12px; flex-wrap: wrap; }
.ph h1 { font-size: 23px; } .ph p { margin: 4px 0 0; color: var(--text-2); }
.toolbar { display: flex; align-items: center; gap: 4px; padding: 8px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 44px; }
.toolbar .btn-ghost { height: var(--h-sm); font-size: 12px; padding: 0 8px; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost.on { background: var(--surface-3); color: var(--text); }
.inwrap { position: relative; display: flex; align-items: center; margin-right: 4px; }
.inwrap > .i { position: absolute; left: 9px; color: var(--text-4); pointer-events: none; display: flex; }
.inwrap > .i svg { width: 14px; height: 14px; }
.input { width: 100%; height: var(--h-md); padding: 0 10px; }
.inwrap > .input { padding-left: 30px; }
.search-sm { height: var(--h-sm); font-size: 12.5px; width: 200px; }
.sp { flex: 1 1 0%; }
.chips-row { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: 6px; }
.chip2 { display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 4px 0 8px; border-radius: var(--r-sm); font-size: 12px; background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent-line); }
.chip2 b { font-weight: 500; color: var(--text-2); }
.chip2 .ibtn { width: 18px; height: 18px; }
.ibtn { width: var(--h-md); height: var(--h-md); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--text-2); background: none; border: 0; cursor: pointer; flex: none; padding: 0; transition: background .14s, color .14s; }
.ibtn:hover { background: var(--surface-2); color: var(--text); }
.ibtn-sm { width: var(--h-sm); height: var(--h-sm); } .ibtn-xs { width: 22px; height: 22px; border-radius: 4px; }
.cal { display: flex; flex-direction: column; flex: 1 1 0%; min-height: 0; }
.ctool { border-bottom: 1px solid var(--border); }
.ctool h2 { margin: 0 4px; font-size: 14.5px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; }
.ctool .row { gap: 8px; }
#cal-leg { gap: 14px; font-size: 12px; color: var(--text-2); margin-right: 8px; }
#cal-leg .row { gap: 6px; }
.pdot { width: 8px; height: 8px; border-radius: 3px; background: var(--kc, var(--gray)); flex-shrink: 0; display: inline-block; }
.cal-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cal-h { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-h div { padding: 8px 10px; font-size: 12px; color: var(--text-3); font-weight: 500; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(112px, 1fr); flex: 1 1 0%; }
.cday { border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .14s; position: relative; }
.cday:nth-child(7n) { border-right: 0; }
.cday.out { background: var(--sunken); } .cday.out .dn { color: var(--text-3); }
.cday .dn { font-size: 12px; font-weight: 500; color: var(--text-2); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cday.nu .dn { color: var(--text-4); }
.cday.today .dn { background: var(--accent); color: var(--on-accent); }
.cday .add { position: absolute; top: 5px; right: 5px; opacity: 0; }
.cday:hover .add, .cday .add:focus-visible { opacity: 1; }
.cev { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; border-radius: 5px; font: inherit; font-size: 12px; background: color-mix(in srgb, var(--kc, var(--gray)) 11%, var(--surface)); color: var(--text); cursor: pointer; min-width: 0; border: 1px solid color-mix(in srgb, var(--kc, var(--gray)) 22%, transparent); text-align: left; width: 100%; }
.cev:hover { background: color-mix(in srgb, var(--kc, var(--gray)) 18%, var(--surface)); }
.cev svg { width: 12px; height: 12px; color: var(--kc, var(--gray)); }
.cev .trunc, .trunc { flex: 1 1 0%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cev.done { opacity: .55; } .cev.done .trunc { text-decoration: line-through; }
.cev.event { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--gray) 55%, transparent); color: var(--text-2); }
.av { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 8.5px; font-weight: 600; background: color-mix(in srgb, var(--kc, var(--gray)) 20%, var(--surface)); color: color-mix(in srgb, var(--kc, var(--gray)) 60%, var(--text)); flex: none; line-height: 1; }
.cmore { font: inherit; font-size: 11px; color: var(--text-2); padding: 0 6px; text-align: left; background: none; border: 0; cursor: pointer; }
.cmore:hover { color: var(--text); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex: 1 1 0%; min-height: 360px; }
.wcol { border-right: 1px solid var(--divider); display: flex; flex-direction: column; min-width: 0; } .wcol:last-child { border-right: 0; }
.wcol-h { padding: 10px; border-bottom: 1px solid var(--border); display: flex; align-items: baseline; gap: 6px; }
.wcol-h .n { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wcol-h.today .n { color: var(--accent); } .wcol-h .muted { font-size: 12.5px; }
.wcol-h .ibtn { align-self: center; }
.wcol-b { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 0%; }
.wcard { border-radius: var(--r-sm); padding: 7px 8px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 12.5px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; text-align: left; color: var(--text); }
.wcard:hover { border-color: var(--border-strong); }
.wcard .t { display: flex; gap: 7px; align-items: baseline; font-weight: 500; line-height: 1.3; } .wcard .t .pdot { transform: translateY(-1px); }
.wcard .m { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); } .wcard .m svg { width: 12px; height: 12px; flex: none; }
.wcard.event { background: color-mix(in srgb, var(--gray) 8%, var(--surface)); border-style: dashed; }
.wcard.done { opacity: .6; }
.wvazio { color: var(--text-4); font-size: 12px; text-align: center; padding: 14px 0; }
/* popover */
.pop { position: fixed; z-index: 110; min-width: 220px; max-width: 340px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 4px; max-height: min(420px, 70vh); overflow-y: auto; font-size: 13.5px; }
.pop.enter { animation: popIn .16s var(--ease) both; }
@keyframes popIn { 0% { opacity: 0; transform: translateY(-4px) scale(.97); } 100% { opacity: 1; transform: none; } }
.mh { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--text-3); padding: 8px 8px 4px; }
.mh.fb-h { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.mh .btn { text-transform: none; letter-spacing: 0; }
.msep { height: 1px; background: var(--divider); margin: 4px -4px; }
.mi { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 0 8px; border-radius: var(--r-sm); text-align: left; color: var(--text); font: inherit; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.mi:hover { background: var(--surface-2); } .mi svg { color: var(--text-3); }
.mi.danger, .mi.danger svg { color: var(--red); }
.mi .r { margin-left: auto; color: var(--text-3); font-size: 12px; display: flex; gap: 4px; align-items: center; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mi .ck { margin-left: auto; color: var(--accent); display: flex; }
.fb-empty { margin: 0; padding: 2px 8px 8px; font-size: 12.5px; color: var(--text-3); }
.fb-add { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 4px 8px 6px; font-size: 12px; } .fb-add .faint, .faint { color: var(--text-3); }
.pin2 { display: flex; gap: 6px; padding: 0 8px 8px; } .pin2 .input { flex: 1; min-width: 0; }
.badge svg { width: 12px; height: 12px; }
button.badge { cursor: pointer; background: var(--surface-2); } button.badge:hover { background: var(--surface-3); }
/* drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 49; background: transparent; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: -18px 0 40px -24px rgba(0,0,0,.35); z-index: 50; display: flex; flex-direction: column; }
.drawer.enter { animation: drawerIn .34s cubic-bezier(.32, .72, 0, 1) both; }
@keyframes drawerIn { 0% { transform: translateX(48px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.drawer.enter .drawer-b > * { animation: riseIn .38s var(--ease) both; }
.drawer.enter .drawer-b > :nth-child(2) { animation-delay: .04s; } .drawer.enter .drawer-b > :nth-child(3) { animation-delay: .07s; } .drawer.enter .drawer-b > :nth-child(n+4) { animation-delay: .1s; }
@keyframes riseIn { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
.drawer-h { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px 24px 32px; display: grid; gap: 14px; align-content: start; }
.ttl { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.018em; line-height: 1.3; }
.pillbtn { display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 7px; border-radius: var(--r-sm); font: inherit; font-size: 12.5px; color: var(--text); background: none; border: 0; white-space: nowrap; max-width: 100%; }
button.pillbtn { cursor: pointer; } button.pillbtn:hover { background: var(--surface-2); }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); row-gap: 2px; align-items: center; font-size: 12.5px; margin: 0; }
.kv > dt { color: var(--text-2); display: flex; align-items: center; gap: 7px; height: 30px; margin: 0; } .kv > dt svg { color: var(--text-4); width: 14px; height: 14px; }
.kv > dd { margin: 0; min-width: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 30px; }
.alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); font-size: 12.5px; align-items: flex-start; background: var(--surface); }
.alert svg { margin-top: 1px; flex: none; }
.alert.warn { background: color-mix(in srgb, var(--amber) 12%, transparent); border-color: transparent; } .alert.warn svg { color: var(--amber); }
.alert.info { background: var(--accent-soft); border-color: transparent; } .alert.info svg { color: var(--accent); }
.vlist { display: grid; }
.vrow { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--divider); font-size: 12.5px; flex-wrap: wrap; } .vrow:first-child { border-top: 0; }
.vrow .vd { min-width: 108px; font-weight: 500; }
.acts-b { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.green { color: var(--green); background: color-mix(in srgb, var(--green) 11%, transparent); border-color: transparent; }
@media (max-width: 760px) { .hide-m { display: none !important; } .cal-g { grid-auto-rows: minmax(72px, 1fr); } .cev .trunc, .cev .av { display: none; } .cev { height: 8px; padding: 0; background: var(--kc, var(--gray)); border: 0; } .cev svg { display: none; } .week { grid-template-columns: 1fr; } .search-sm { width: 140px; } }
@media (prefers-reduced-motion: reduce) { .drawer.enter, .pop.enter, .drawer.enter .drawer-b > * { animation: none; } }

/* clientes do disparo (Sienge) */
.cli-box { display: grid; gap: 4px; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--divider); }
.crow:first-child { border-top: 0; }
.crow .cl { display: grid; min-width: 0; line-height: 1.3; } .crow .cl b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .cr { display: flex; align-items: center; gap: 10px; flex: none; }
.tag.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); border-color: transparent; }

/* tabela de disparos */
.tbl-wrap { max-height: calc(100vh - 340px); min-height: 220px; overflow: auto; }
.tbl { table-layout: auto; }
.tbl thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; padding: 0; height: 36px; }
.tbl th.num, .tbl td.num { text-align: right; }
.thb { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px; width: 100%; height: 36px; padding: 0 14px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.tbl th.num .thb { justify-content: flex-end; }
.thb:hover { color: var(--text); } .tbl th.ord .thb { color: var(--text); }
.thb .seta { width: 10px; color: var(--accent); }
.tbl td { font-variant-numeric: tabular-nums; } .tbl td.nm2 { font-weight: 500; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td.vazio { text-align: center; color: var(--text-3); height: 80px; }
.btn:disabled { opacity: .45; pointer-events: none; }


/* filtro de empreendimento (Disparos) */
.emp-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.epill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; transition: background .14s var(--ease), border-color .14s; }
.epill:hover { background: var(--surface-2); color: var(--text); }
.epill.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.epill .ct { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.epill .vl { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.stat .v { font-variant-numeric: tabular-nums; }
.stat .c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Disparos: layout profissional ===== */
.dtool { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dnav { display: inline-flex; align-items: center; height: var(--h-md); border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); padding: 0 2px; }
.dnav .ibtn { width: 24px; height: 24px; }
.dsearch { margin: 0; width: min(340px, 100%); }
.dsearch .input { width: 100%; height: var(--h-md); }
.tbl-wrap { max-height: max(300px, calc(100vh - 500px)); }
.tbl td.idc { color: var(--text-3); }
.tbl thead th { border-bottom: 1px solid var(--border); }
.tbl td { height: 38px; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); background: var(--surface); }
.tbl-foot .muted { font-size: 12px; }
.stats .stat .l svg { flex: none; }

/* secoes nunca crescem alem da tela por causa de tabelas largas */
.content > section { grid-template-columns: minmax(0, 1fr); }
#dp-corpo { min-width: 0; }

/* Disparos: 3 indicadores */
#dp-stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { #dp-stats .stat:nth-child(3) { border-left: 1px solid var(--border); border-top: 0; } }
@media (max-width: 560px) { #dp-stats { grid-template-columns: 1fr; } #dp-stats .stat, #dp-stats .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); } #dp-stats .stat:first-child { border-top: 0; } }

.user #btn-sair { margin-left: auto; }
.user #btn-sair[hidden] { display: none; }

/* ===== Regras de disparo: tela de configuracoes ===== */
/* Regras ocupa a largura toda, como as outras telas */
.rform { display: grid; gap: 16px; }
.sgrp { padding: 0; overflow: hidden; }
.sg-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sg-t { display: flex; align-items: center; gap: 10px; margin: 8px 2px 0; }
.ssec { padding: 4px 18px 6px; }
.ssec + .ssec { border-top: 1px solid var(--border); }
.ssec > .sec-t { margin: 14px 0 2px; }
.srow { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); gap: 8px 20px; padding: 12px 0; align-items: start; }
.sgrp > .srow, .sgrp > .sg-h + .srow { padding-left: 18px; padding-right: 18px; }
.sgrp > .srow + .srow, .ssec .srow + .srow { border-top: 1px solid var(--divider); }
.sl-l b { display: block; font-weight: 500; font-size: 13px; line-height: 30px; }
.hint { display: block; color: var(--text-3); font-size: 12px; line-height: 1.4; margin-top: -2px; }
.sl-r { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sl-r .hint { flex-basis: 100%; margin-top: 0; }
.sl-r input[type="text"], .mono-in { width: 100%; }
.mono-in { font-family: var(--mono); font-size: 12.5px; }
.hrs { display: inline-flex; align-items: center; gap: 8px; }
.hrs input { width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
/* etiquetas */
.chipin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); cursor: text; transition: border-color .14s, box-shadow .14s; }
.chipin:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-3)); }
.chipin:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chipin input { flex: 1 1 120px; min-width: 90px; height: 24px; border: 0; background: transparent; padding: 0 4px; outline: none; box-shadow: none; font-size: 13px; }
.chipin input:focus { outline: none; box-shadow: none; }
.chipin input.bad { color: var(--red); }
.cp { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 3px 0 9px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp button { all: unset; box-sizing: border-box; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; cursor: pointer; color: var(--text-3); font-size: 14px; line-height: 1; }
.cp button:hover { background: var(--surface-2); color: var(--red); }
/* seletor segmentado */
.segc { display: inline-flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.segc button { height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: background .14s, color .14s; }
.segc button:hover { color: var(--text); }
.segc button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong), 0 1px 2px rgba(0,0,0,.18); }
/* interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .sl { width: 32px; height: 18px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .18s var(--ease), border-color .18s; flex: none; }
.switch .sl::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform .18s var(--ease), background .18s; }
.switch input:checked + .sl { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .sl::after { transform: translateX(14px); background: var(--on-accent); }
.switch input:focus-visible + .sl { box-shadow: 0 0 0 3px var(--accent-soft); }
/* cores */
.swatches { display: flex; gap: 10px; }
.sw-c { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0; background: var(--kc); cursor: pointer; transition: transform .14s var(--ease); }
.sw-c:hover { transform: scale(1.12); }
.sw-c.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--kc); }
/* cartao da regra */
.rcard { padding: 0; }
.rcard.pausada { opacity: 1; } .rcard.pausada .rhead .nome-in, .rcard.pausada .rsum { opacity: .6; }
.rhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0 10px; flex-wrap: nowrap; }
.rdot { width: 10px; height: 10px; border-radius: 3px; background: var(--kc); flex: none; }
.nome-in { flex: 0 1 320px; min-width: 120px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.nome-in:hover { background: var(--surface-2); }
.nome-in:focus { background: var(--surface); border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.rtog svg { transition: transform .2s var(--ease); }
.rcard.fechado .rtog svg { transform: rotate(-90deg); }
.rsum { display: flex; align-items: flex-start; gap: 10px; padding: 6px 18px 12px 46px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.rsum .badge { flex: none; margin-top: 1px; }
.rbody { border-top: 1px solid var(--border); }
.rcard.fechado .rbody { display: none; } .rcard.fechado .rsum { padding-bottom: 14px; }
.ibtn.perigo:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
/* barra de alteracoes */
.savebar { position: sticky; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop); animation: riseIn .22s var(--ease) both; }
.savebar[hidden] { display: none; }
.savebar::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.savebar .txt { font-size: 13px; }
.savebar .msg { font-size: 12.5px; margin-left: 4px; } .savebar .msg.erro { color: var(--red); }
.savebar .sp { flex: 1; }
/* aviso rapido */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 90; background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow-pop); animation: riseIn .22s var(--ease) both; }
.toast.erro { border-color: var(--red); color: var(--red); }
.toast.sai { opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; }
@media (max-width: 760px) { .srow { grid-template-columns: 1fr; } .sl-l b { line-height: 1.4; } .rsum { padding-left: 18px; flex-wrap: wrap; } .rhead { flex-wrap: wrap; } .nome-in { flex-basis: 100%; } }

/* ===== Controles personalizados: caixa de selecao e seletor de data (padrao Gr8r) ===== */
.selbtn { display: inline-flex; align-items: center; gap: 8px; height: var(--h-md); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; min-width: 0; max-width: 100%; transition: border-color .14s, box-shadow .14s, background .14s; }
.selbtn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-3)); }
.selbtn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.selbtn .sbt { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.selbtn .sbt.vazio { color: var(--text-3); }
.selbtn svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.selbtn.datebtn { min-width: 138px; }
#dp-regra-host .selbtn { min-width: 240px; }
.dnav .selbtn { border: 0; background: transparent; height: 28px; padding: 0 8px; min-width: 124px; justify-content: center; }
.dnav .selbtn:hover { background: var(--surface-2); }
.dnav .selbtn .sbt { flex: none; }
.mi .pdot, .selbtn .pdot { flex: none; }
.dpk { width: 292px; padding: 2px; }
.dpk-h { display: flex; align-items: center; gap: 2px; padding: 8px 8px 2px; }
.dpk-h b { font-size: 13px; font-weight: 600; }
.dpk-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4px; text-align: center; }
.dpk-w { font-size: 11px; color: var(--text-3); padding: 4px 0; }
.dday { height: 30px; border-radius: 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums; transition: background .12s; }
.dday:hover { background: var(--surface-2); }
.dday.fora { color: var(--text-3); }
.dday.hoje { color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-line); }
.dday.sel { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: none; }
.dday:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mi:focus-visible { outline: none; background: var(--surface-2); }

/* formularios de cadastro (Feriados, Exclusoes): campos e botao alinhados pela base */
.fform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.fform label { display: grid; gap: 6px; font-size: 12px; color: var(--text-3); min-width: 0; }
.fform label.grow { flex: 1 1 220px; }
.fform input, .fform .selbtn, .fform .btn { height: var(--h-md); }

/* ===== menu lateral recolhido (so icones) ===== */
@media (min-width: 821px) {
  .app { transition: grid-template-columns .22s var(--ease); }
  html.side-min .app { grid-template-columns: 56px minmax(0, 1fr); }
  html.side-min .side { overflow-x: hidden; }
  html.side-min .ws { justify-content: center; padding: 0; }
  html.side-min .ws > b, html.side-min #side-toggle { display: none; }
  html.side-min #logo { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; transition: transform .14s var(--ease); }
  html.side-min #logo:hover { transform: scale(1.06); }
  html.side-min #logo svg { width: 17px; height: 17px; }
  html.side-min nav button { justify-content: center; padding: 0; position: relative; }
  html.side-min nav .lbl, html.side-min nav .cnt:not(.acc) { display: none; }
  html.side-min nav .cnt.acc { position: absolute; top: 5px; right: 7px; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; border: 2px solid var(--bg-side); box-sizing: content-box; }
  html.side-min .sec-l { height: 1px; background: var(--divider); margin: 10px 6px; padding: 0; font-size: 0; }
  html.side-min .side-regras button { justify-content: center; padding: 0; }
  html.side-min .side-regras .n, html.side-min .side-regras .off { display: none; }
  html.side-min .user { flex-direction: column; justify-content: center; padding: 0; gap: 8px; }
  html.side-min .user .unome { display: none; }
  html.side-min .user #btn-sair { margin: 0; }
}
@media (max-width: 820px) { #side-toggle { display: none; } }

/* tooltip proprio */
.tip { position: fixed; z-index: 120; pointer-events: none; background: #ffffff; color: #1d1c1a; border: 0; border-radius: var(--r-sm); padding: 5px 10px; font-size: 12.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; box-shadow: 0 6px 18px -4px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .08); opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .14s var(--ease); }
.tip.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }

/* Disparos: caixa de selecao de empreendimento */
#dp-emp-host .selbtn { min-width: 240px; }
.mi .ex { margin-left: auto; padding-left: 14px; color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mi .ex + .ck { margin-left: 8px; }
.selbtn:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* Disparos: tabela maior e paginacao */
.tbl-wrap { max-height: none; min-height: 0; overflow: auto; }
.tbl-wrap.rolavel { max-height: calc(100vh - 180px); }
.tbl-foot { gap: 16px; padding: 10px 14px; }
.pag { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pag .muted { margin-right: 2px; }
.pag .selbtn { height: 26px; min-width: 74px; font-size: 12px; padding: 0 8px; }
.pgn { font-size: 12px; min-width: 112px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); }
.ibtn:disabled { opacity: .35; pointer-events: none; }

/* ---------- Envios ---------- */
.badge.red { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: transparent; }
.badge.gray { color: var(--text-3); background: var(--surface-2); border-color: transparent; }
.ctrl-st { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ctrl-st h3 { margin: 0; margin-right: 4px; }
.ev-avisos { display: grid; gap: 8px; padding: 12px 18px 0; }
.sgrp .sl-r { flex-wrap: wrap; }
.det { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-id { color: var(--text-4); font-size: 11.5px; font-weight: 400; }
.btn.perigo-b { background: var(--red); color: #1a0d0b; border-color: transparent; } .btn.perigo-b:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
#ev-stats { margin: 0; }
.dlg-scrim { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; animation: riseIn .15s var(--ease) both; }
.dlg { width: min(460px, 100%); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px; padding: 20px; display: grid; gap: 12px; box-shadow: var(--shadow-pop); }
.dlg h3 { margin: 0; font-size: 16px; } .dlg-b { display: grid; gap: 8px; color: var(--text-2); font-size: 13px; line-height: 1.5; } .dlg-b p { margin: 0; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Acessos ---------- */
.utabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0; }
.utabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text-3); cursor: pointer; }
.utabs button:hover { color: var(--text); } .utabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.pess { display: flex; align-items: center; gap: 12px; min-width: 0; } .pess-t { display: grid; min-width: 0; line-height: 1.35; } .pess-t b { font-weight: 500; }
.papel { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); } .papel svg { width: 14px; height: 14px; color: var(--text-3); }
tr.inativo td { opacity: .55; } tr.inativo td.acoes { opacity: 1; }
td.acoes { text-align: right; white-space: nowrap; } td.acoes .ibtn { display: inline-grid; }
.tbl.matriz th.c, .tbl.matriz td.c { text-align: center; } .matriz .sim { color: var(--green); display: inline-grid; } .matriz .sim svg { width: 16px; height: 16px; } .matriz .nao { color: var(--text-4); }
.dlg-l { width: min(480px, 100%); } .dlg-t { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; } .dlg-t p { margin: 4px 0 0; }
.fld { display: grid; gap: 6px; } .fld-l { font-size: 12.5px; font-weight: 500; color: var(--text-2); } .fld .input { width: 100%; height: var(--h-md); }
.erro-t { margin: 0; color: var(--red); font-size: 12.5px; min-height: 0; } .erro-t:empty { display: none; }
.senha-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); }
.senha-box > div { display: grid; gap: 4px; min-width: 0; } .senha { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .04em; user-select: all; word-break: break-all; }
.user #btn-senha { margin-left: auto; } .user #btn-senha:not([hidden]) + #btn-sair { margin-left: 0; }
html.side-min .user #btn-senha { display: none; }

.av2 { --ac: var(--blue); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--ac) 20%, var(--surface)); color: var(--ac); border: 1px solid color-mix(in srgb, var(--ac) 30%, transparent); }
.av2.sm { width: 24px; height: 24px; font-size: 9.5px; border: 2px solid var(--surface); }
.av-stack { display: inline-flex; } .av-stack .av2 + .av2 { margin-left: -6px; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
td.online { color: var(--green); }
.tbl .selbtn { height: 28px; }
.utabs { gap: 2px; } .utabs button { padding: 10px 12px; }
.nota-papeis { margin: 10px 2px 0; }
.fld2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .fld2 .selbtn { width: 100%; justify-content: space-between; }
.dlg-f .sp { flex: 1; } .btn.perigo-t { color: var(--red); } .btn.perigo-t:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
@media (max-width: 560px) { .fld2 { grid-template-columns: 1fr; } }
#tab-acessos .dsearch { width: min(230px, 100%); }
#tab-acessos .tbl td, #tab-acessos .tbl th .thp { white-space: nowrap; }
#tab-acessos .pess-t span { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.thp { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.tbl th.c .thp { width: 100%; justify-content: center; }
html { color-scheme: dark; }
.tbl-wrap { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
#ac-membros { display: grid; gap: 14px; }

.tpl-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .tpl-h code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; margin-right: 4px; }
.tpl-corpo { margin: 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hint.aviso { color: var(--amber); } .tpl-hint:empty { display: none; }

/* ---------- Cobranca ---------- */
.cb-aba { display: grid; gap: 14px; }
code.zid { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text-2); }
.tbl td.num, .tbl th.num { text-align: right; }
.previa-stats { grid-template-columns: repeat(4, 1fr); } .previa-stats .stat .v { margin-top: 0; }
.previa-lista { display: grid; gap: 2px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }
.previa-it { display: grid; padding: 8px 12px; border-bottom: 1px solid var(--divider); } .previa-it:last-child { border-bottom: 0; } .previa-it b { font-weight: 500; }
.cfg-rodape { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--divider); }
.cfg-rodape .erro-t { margin-right: auto; }

.chkrow { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; } .chkrow input { width: 16px; height: 16px; accent-color: var(--accent); }
#cb-zres, #cb-zstats { margin: 0; }

.sinc { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.sinc-t { color: var(--text-3); font-size: 12.5px; } .sinc-t.erro { color: var(--red); }
.sinc .btn { gap: 7px; } .sinc .btn svg { width: 15px; height: 15px; }
.sinc .btn.sincronizando svg { animation: giro 1s linear infinite; } @keyframes giro { to { transform: rotate(360deg); } }

.linkcel { all: unset; cursor: pointer; display: block; } .linkcel:hover b { text-decoration: underline; } .linkcel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
#cb-fstats { margin: 0; } #cb-fsinc { flex-wrap: wrap; justify-content: flex-end; }

/* janelas com conteudo longo: cabecalho e rodape ficam fixos e so o miolo rola */
.dlg-l { max-height: calc(100vh - 32px); grid-template-rows: auto minmax(0, 1fr) auto; }
.dlg-c { display: grid; gap: 12px; min-height: 0; overflow-y: auto; align-content: start; padding-right: 2px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.dlg-c .tbl-wrap { max-height: none; min-height: 0; overflow: visible; }
.dlg-c .tbl thead th { top: 0; }
.dlg-c > .card { overflow: visible; flex: none; min-height: auto; }
.dlg-c > * { min-height: min-content; }

/* ===== aba WhatsApp: numero conectado e cards de templates ===== */
.wa-conta { display: grid; gap: 16px; }
.wa-id { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wa-av { width: 48px; height: 48px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 16%, var(--surface-2)); color: var(--green); }
.wa-av svg { width: 24px; height: 24px; }
.wa-nome { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.wa-nome > .tpl-h b { font-size: 15px; }
.wa-num { font-family: var(--mono); font-size: 14px; color: var(--text-2); letter-spacing: .01em; }
.wa-desde { align-self: flex-start; }
.wa-fatos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.wa-fato { background: var(--surface); padding: 10px 12px; display: grid; gap: 3px; min-width: 0; }
.wa-fato b { display: flex; align-items: center; gap: 7px; font-weight: 500; overflow-wrap: anywhere; }
.wa-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--gray); }
.wa-dot.green { background: var(--green); } .wa-dot.warn { background: var(--amber); } .wa-dot.red { background: var(--red); } .wa-dot.gray { background: var(--text-4); }
.badge .wa-dot { width: 6px; height: 6px; }

.wa-tpl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.wa-tpl-head h2 { display: flex; gap: 8px; align-items: baseline; }
.wa-seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); }
.wa-seg button { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border: 0; border-radius: 4px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; cursor: pointer; }
.wa-seg button:hover { color: var(--text); }
.wa-seg button.on { background: var(--surface-3); color: var(--text); }
.wa-seg .n { font-size: 11.5px; color: var(--text-4); }

.wa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.wa-vazio { grid-column: 1 / -1; text-align: center; padding: 28px 16px; } .wa-vazio p { margin: 0; }
.wa-tpl { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-width: 0; }
.wa-tpl > .wa-chat { flex: 1 1 auto; align-content: start; }
/* na tela de templates a mensagem fica num bloco so, sem a moldura externa, no tom mais escuro */
.wa-tpl > .wa-chat { background: none; border: 0; padding: 0; justify-items: stretch; }
.wa-tpl .wa-bolha, .wa-tpl .wa-btns span { background: var(--sunken); border: 1px solid var(--divider); box-shadow: none; }
.wa-tpl .wa-bolha { border-radius: var(--r); }
.wa-tpl > .wa-tpl-pe { margin-top: auto; }
.wa-tpl-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-tpl-nome { font-family: var(--mono); font-size: 13px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat { background: var(--sunken); border: 1px solid var(--divider); border-radius: var(--r); padding: 12px; display: grid; gap: 4px; justify-items: start; }
.wa-bolha { position: relative; max-width: 100%; background: color-mix(in srgb, var(--green) 9%, var(--surface-2)); border-radius: 2px var(--r) var(--r) var(--r); padding: 8px 10px; display: grid; gap: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.25); }
.wa-midia { height: 64px; border-radius: 6px; background: var(--surface-3); color: var(--text-4); display: grid; place-items: center; font-size: 12px; min-width: 180px; }
.wa-midia-img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.wa-midia-doc { gap: 6px; grid-auto-flow: column; color: var(--blue); text-decoration: none; } .wa-midia-doc svg { width: 14px; height: 14px; }
.wa-cab { font-size: 13px; }
.wa-corpo { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-corpo.curto { display: -webkit-box; -webkit-line-clamp: 12; -webkit-box-orient: vertical; overflow: hidden; }
.wa-mais { justify-self: start; border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 500; color: var(--accent); cursor: pointer; }
.wa-mais:hover { text-decoration: underline; }
.wa-rod { font-size: 11.5px; color: var(--text-4); }
.wa-var { font-family: var(--mono); font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 4px; }
.wa-btns { display: grid; gap: 4px; width: 100%; max-width: 100%; }
.wa-btns span { text-align: center; font-size: 12.5px; font-weight: 500; color: var(--blue); background: color-mix(in srgb, var(--green) 9%, var(--surface-2)); border-radius: var(--r); padding: 6px 10px; }
.wa-tpl-pe { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wa-tpl-pe > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-tpl-pe b { color: var(--text-2); font-weight: 500; }
@media (max-width: 560px) { .wa-tpl-head .dsearch { width: 100%; } }

/* ===== Disparos: coluna Opcoes, clientes retirados e envio individual ===== */
.tbl th.opc, .tbl td.opc { width: 1%; text-align: center; white-space: nowrap; }
.tbl td.opc .ibtn { margin: -4px auto; }
.tbl tr.pulado td:not(.opc) { color: var(--text-4); }
.tbl tr.pulado .dp-nome > :first-child { text-decoration: line-through; }
.dp-nome { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-pul { font-size: 11px; padding: 1px 6px; gap: 4px; text-decoration: none; }
.dp-pul svg { width: 11px; height: 11px; }
.mi[disabled] { opacity: .45; cursor: default; } .mi[disabled]:hover { background: none; }
.mi-nota { padding: 6px 8px 2px; font-size: 11.5px; color: var(--text-4); max-width: 260px; white-space: normal; }
.dp-resumo { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.dp-resumo > div { background: var(--surface); padding: 8px 10px; display: grid; gap: 2px; min-width: 0; }
.dp-resumo b { font-weight: 500; overflow-wrap: anywhere; }
.dp-erro:empty { display: none; }

/* envio individual: template, variaveis e previa */
.dp-sec { display: grid; gap: 6px; }
.dp-tpl-sel .selbtn { width: 100%; max-width: 100%; justify-content: space-between; }
.dp-tpl-aviso:empty { display: none; } .dp-tpl-aviso { display: grid; gap: 6px; }
.dp-vars { display: grid; gap: 6px; }
.dp-var { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.dp-var > .wa-var { min-width: 34px; text-align: center; }
.dp-var .selbtn { min-width: 150px; }
.dp-previa { justify-items: start; }
.dp-val { background: color-mix(in srgb, var(--green) 18%, transparent); border-radius: 3px; padding: 0 2px; }
@media (max-width: 560px) { .dp-var { grid-template-columns: auto minmax(0, 1fr); } .dp-var > span:last-child { grid-column: 2; } }
/* envio individual: cabecalho do cliente */
.dp-cli { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.dp-cli-top { display: flex; align-items: center; gap: 12px; padding: 14px; }
.dp-cli-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.dp-cli-id { display: grid; gap: 2px; min-width: 0; flex: 1; }
.dp-cli-id b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-cli-id span { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-cli-valor { display: grid; gap: 2px; text-align: right; flex: none; }
.dp-cli-valor span { color: var(--text-4); font-size: 11.5px; }
.dp-cli-valor b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dp-cli-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 9px 14px; border-top: 1px solid var(--divider); background: var(--sunken); color: var(--text-3); font-size: 12.5px; }
.dp-cli-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.dp-cli-meta svg { width: 14px; height: 14px; color: var(--text-4); }
.dp-cli-meta b { color: var(--text); font-weight: 500; }
.dp-cli-meta .badge { font-size: 11px; padding: 1px 7px; margin-left: 2px; }
@media (max-width: 480px) { .dp-cli-top { flex-wrap: wrap; } .dp-cli-valor { text-align: left; flex-basis: 100%; padding-left: 50px; } }

/* envio individual na tela lateral */
.drawer-f { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.dp-drawer .drawer-b { display: flex; flex-direction: column; gap: 16px; }
.dp-drawer .drawer-b > * { flex: none; }
.dp-drawer .dp-sec { gap: 0; }
.dp-drawer .dp-sec > .sec-t { margin: 0 0 8px; }
.dp-drawer .ttl { margin-bottom: -2px; }

/* aba WhatsApp: card do numero sem caixa interna */
.wa-conta { padding: 0; gap: 0; overflow: hidden; }
.wa-conta .wa-id { padding: 18px 20px; }
.wa-conta .wa-fatos { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; background: none; border: 0; border-top: 1px solid var(--divider); border-radius: 0; }
/* linhas finas entre os indicadores; as que caem na borda do card ficam escondidas pelo overflow */
.wa-conta .wa-fato { background: none; padding: 14px 20px; gap: 4px; box-shadow: -1px 0 0 var(--divider), 0 -1px 0 var(--divider); }
.wa-fato-l { font-size: 12px; color: var(--text-3); }
.wa-conta .wa-fato b { font-size: 14px; }
.wa-fato-d { font-size: 11.5px; color: var(--text-4); }
.wa-conta > .alert { margin: 0 20px 18px; }
.wa-conta .wa-av { width: 52px; height: 52px; }
.wa-conta .wa-nome > .tpl-h b { font-size: 16px; }
.wa-conta .wa-fato { align-content: start; }

/* ===== Regras: abas, regras recolhidas, mapeamento de variaveis ===== */
.rg-abas { margin-bottom: 4px; }
.rg-abas .rg-cnt, #ac-abas .rg-cnt { margin-left: 6px; font-size: 11.5px; color: var(--text-4); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.rg-painel { display: grid; gap: 12px; }
.rg-info { margin: 0 2px; }
.rcard .rhead { padding: 12px 14px 0 10px; }
.rcard .rsum { display: grid; gap: 8px; padding: 8px 18px 14px 48px; cursor: pointer; }
.rcard:not(.fechado) .rsum { padding-bottom: 12px; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12px; color: var(--text-2); background: var(--surface); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rg-chip svg { width: 13px; height: 13px; color: var(--text-4); flex: none; }
.rg-chip.mono-chip { font-family: var(--mono); font-size: 11.5px; }
.rg-chip .wa-dot { width: 6px; height: 6px; }

.rcard:hover .rsum .rg-chip { border-color: var(--border-strong); }
.rcard .rbody .ssec > .sec-t { letter-spacing: .05em; }
.tplsel, .tplsel-box { display: block; width: 100%; }
.tplsel .selbtn { width: min(420px, 100%); justify-content: space-between; font-family: var(--mono); font-size: 12.5px; }
.varmap { display: grid; gap: 6px; width: 100%; }
.varmap-l { display: flex; align-items: center; gap: 8px; }
.varmap-l > .wa-var { min-width: 38px; text-align: center; }
.varmap-seta { color: var(--text-4); }
.varmap-sel .selbtn { min-width: 220px; justify-content: space-between; }
.varmap-add { justify-self: start; }
.rg-prev-host { width: 100%; }
.rg-previa { max-width: 460px; }
.hint.aviso { color: var(--amber); }
@media (max-width: 760px) { .rcard .rsum { padding-left: 18px; } .varmap-sel .selbtn { min-width: 0; } }
@media (max-width: 560px) {
  .rg-abas { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; } .rg-abas::-webkit-scrollbar { display: none; }
  .rg-abas button { white-space: nowrap; flex: none; }
  .rcard .segc { flex-wrap: wrap; height: auto; }
  .rcard .rhead { flex-wrap: wrap; } .rcard .rhead .nome-in { flex: 1 1 100%; order: 1; }
  .rg-chip { white-space: normal; height: auto; min-height: 24px; padding: 3px 9px; }
}

/* Disparos: de quando sao os dados do Sienge e uso da cota diaria */
.dp-fonte { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); font-size: 12.5px; color: var(--text-3); }
.dp-fonte-i { display: inline-flex; align-items: center; gap: 7px; }
.dp-fonte-i svg { width: 14px; height: 14px; color: var(--text-4); }
.dp-fonte-i.velho svg { color: var(--amber); }
.dp-fonte-erro { color: var(--amber); }
.dp-cota { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.dp-cota-b { width: 64px; height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.dp-cota-b i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.dp-cota.alta .dp-cota-b i { background: var(--amber); } .dp-cota.alta { color: var(--amber); }

/* Disparos: origem dos dados no cabecalho (no lugar do antigo "Baixar CSV") */
.pg-head .dp-fonte { border: 0; background: none; padding: 0; gap: 6px 14px; justify-content: flex-end; align-self: center; }
.pg-head .dp-fonte .sp { display: none; }
@media (max-width: 760px) { .pg-head .dp-fonte { justify-content: flex-start; } }

/* Zeev: numero clicavel e historico da solicitacao */
.zid-link { font: inherit; font-family: var(--mono); font-size: 12.5px; background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 4px; color: var(--accent); cursor: pointer; }
.zid-link:hover { background: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.zv-drawer .drawer-h a.btn { text-decoration: none; }
.zv-linha { list-style: none; margin: 0; padding: 0; display: grid; }
.zv-t { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 16px; }
.zv-t::before { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--divider); }
.zv-t:last-child::before { display: none; } .zv-t:last-child { padding-bottom: 0; }
.zv-dot { width: 12px; height: 12px; margin: 4px 0 0 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--surface); }
.zv-t.ativa .zv-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-soft); }
.zv-t.atrasada .zv-dot { background: var(--red); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--red) 20%, transparent); }
.zv-tc { display: grid; gap: 6px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.zv-t.ativa .zv-tc { border-color: var(--accent-line); }
.zv-t.atrasada .zv-tc { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.zv-th { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.zv-th b { font-weight: 500; overflow-wrap: anywhere; }
.zv-th .badge { flex: none; font-size: 11px; padding: 1px 7px; }
.zv-tm { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-3); }
.zv-tm > span { display: inline-flex; align-items: center; gap: 5px; }
.zv-tm svg { width: 13px; height: 13px; color: var(--text-4); }
.zv-tm b { color: var(--text-2); font-weight: 500; }
.zv-late { color: var(--red); } .zv-late svg { color: var(--red); }
.zv-t.fim .zv-dot { background: var(--text-4); }
.zv-t.fim .zv-tc { background: none; border-style: dashed; }

/* fila da cobranca: abrir a solicitacao de um cliente */

/* fila da cobranca: abrir a solicitacao de um cliente */
.cb-abrir { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--accent-line); border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .14s var(--ease), border-color .14s; }
.cb-abrir:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); }
.cb-abrir:disabled { opacity: .6; cursor: default; }
.cb-abrir svg { width: 13px; height: 13px; }

/* botao Abrir solicitacao: branco, com o icone do Zeev */
.cb-abrir { background: #ffffff; color: #1d1c1a; border-color: transparent; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cb-abrir:hover { background: #ecebe8; border-color: transparent; }
.cb-abrir svg { width: 14px; height: 14px; }
.cb-abrir svg path { stroke: #ffffff !important; }

/* cobranca: 5 indicadores (em andamento, concluidas, rejeitadas, canceladas, total) */
.stats.cinco { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats.cinco { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.cinco .stat:nth-child(5) { grid-column: 1 / -1; } }

/* cobranca: filtros da consulta de inadimplentes */
.sg-h.sg-sub { border-top: 1px solid var(--border); margin-top: 4px; display: grid; gap: 2px; justify-content: start; }
.msel { display: flex; flex-wrap: wrap; gap: 6px; }
.msel button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.msel button:hover { color: var(--text); }
.msel button.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.msel button svg { width: 13px; height: 13px; }

/* titulos das linhas de configuracao: alinhados ao controle, sem espaco exagerado quando quebram em 2 linhas */
.sl-l b { line-height: 1.35; min-height: 30px; display: flex; align-items: center; }

/* cobranca: empresas do Sienge */
.emps { display: grid; gap: 8px; width: 100%; }
.emps-h { display: flex; align-items: center; gap: 8px; }
.emps-l { display: grid; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.emp { display: grid; grid-template-columns: 18px 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-top: 1px solid var(--divider); background: var(--surface); color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.emp:first-child { border-top: 0; }
.emp:hover { background: var(--surface-2); }
.emp.on { background: var(--accent-soft); color: var(--text); }
.emp-ck { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-strong); display: grid; place-items: center; background: var(--surface); }
.emp.on .emp-ck { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.emp-ck svg { width: 11px; height: 11px; stroke-width: 3; }
.emp-id { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-align: right; }
.emp-n { display: grid; gap: 1px; min-width: 0; }
.emp-n b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-n span { font-size: 11.5px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp.sumiu .emp-n b { color: var(--amber); }
.emp { min-height: 50px; }

/* centros de custo agrupados por empresa */
.cc-grupo { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; background: var(--surface-2); border-top: 1px solid var(--divider); font-size: 11.5px; font-weight: 500; letter-spacing: .02em; color: var(--text-3); text-transform: uppercase; }
.emps-l > .cc-grupo:first-child { border-top: 0; }
.cc-grupo span { color: var(--accent); }
.emps-l > .cc-grupo + .emp { border-top: 0; }
.emp-n { align-content: center; }
.cc-grupo ~ .emp { min-height: 42px; }

/* empresas e centros de custo: cartoes lado a lado (varias colunas conforme a largura) */
.emps-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 6px; border: 0; border-radius: 0; overflow: visible; background: none; }
.emps-l > .cc-grupo { grid-column: 1 / -1; background: none; border: 0; padding: 12px 2px 2px; font-size: 11px; letter-spacing: .05em; }
.emps-l > .cc-grupo:first-child { padding-top: 0; }
.emps-l .emp, .emps-l > .cc-grupo + .emp, .emps-l .emp:first-child { border: 1px solid var(--border); border-radius: var(--r); min-height: 0; padding: 9px 12px; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; }
.emps-l .emp:hover { border-color: var(--border-strong); }
.emps-l .emp.on { border-color: var(--accent-line); }
.emps-l .emp-ck { order: 0; }
.emps-l .emp-n { order: 1; }
.emps-l .emp-id { order: 2; font-size: 11px; color: var(--text-4); background: var(--surface-2); border-radius: 4px; padding: 1px 6px; text-align: center; min-width: 26px; }
.emps-l .emp.on .emp-id { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.emps-l .emp-n b { font-size: 12.5px; white-space: normal; line-height: 1.3; }
.emps-l .emp-n span { white-space: normal; line-height: 1.3; }

/* seletor de horario no padrao do sistema */
.hmbtn { min-width: 118px; justify-content: space-between; }
.hmbtn .sbt { font-variant-numeric: tabular-nums; font-weight: 500; }
.hmbtn svg { color: var(--text-3); }
.pop:has(.hm) { min-width: 0; padding: 6px; overflow: hidden; }
.hm { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 176px; }
.hm-col { display: grid; gap: 2px; min-width: 0; }
.hm-col + .hm-col { border-left: 1px solid var(--divider); padding-left: 6px; }
.hm-t { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); padding: 2px 8px 4px; }
.hm-l { display: grid; gap: 1px; max-height: 232px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; position: relative; }
.hm-i { height: 28px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.hm-i:hover { background: var(--surface-2); color: var(--text); }
.hm-i.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hm-i:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }

/* ===== Visao geral: painel de cobrancas ===== */
.ovc-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ovc-h h2 { font-size: 17px; letter-spacing: -.01em; }
.ovc-h .sub { margin-top: 2px; }
.ovc-h .acts { gap: 10px; }
.stat .v.vr { color: var(--red); }
.ovc-grid { align-items: start; }
.ovc-tbl th, .ovc-tbl td { white-space: nowrap; }
.ovc-tbl td:first-child { white-space: normal; }
.ovc-etapa { font-weight: 500; }
.ovc-pessoas { display: inline-flex; align-items: center; gap: 8px; }
.ovc-avs { display: inline-flex; } .ovc-avs .ovc-av + .ovc-av { margin-left: -6px; }
.ovc-av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 600; flex: none;
  background: color-mix(in srgb, var(--kc, var(--gray)) 22%, var(--surface)); color: color-mix(in srgb, var(--kc, var(--gray)) 70%, var(--text)); box-shadow: 0 0 0 2px var(--surface); }
.ovc-late { color: var(--red); font-weight: 600; }
.ovc-prog { display: inline-flex; align-items: center; gap: 8px; }
.ovc-bar { width: 72px; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--red) 30%, var(--surface-3)); overflow: hidden; display: inline-block; }
.ovc-bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.ovc-vazio { margin: 0; padding: 14px 16px 16px; }
.ovc-lista { display: grid; }
.ovc-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border: 0; border-top: 1px solid var(--divider); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ovc-item:hover { background: var(--surface-2); }
.ovc-it-n { display: grid; gap: 1px; min-width: 0; } .ovc-it-n b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovc-it-e { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.ovc-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ovc-dias { color: var(--red); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.ovc-stack { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; margin: 4px 0 14px; }
.ovc-stack i { display: block; height: 100%; }
.c-accent { background: var(--accent); } .c-green { background: var(--green); } .c-amber { background: var(--amber); } .c-red { background: var(--red); }
.ovc-leg { display: grid; gap: 8px; }
.ovc-leg-l { display: grid; grid-template-columns: 10px 1fr auto 42px; align-items: center; gap: 10px; font-size: 13px; }
.ovc-leg-l b { font-weight: 500; font-variant-numeric: tabular-nums; } .ovc-leg-l .small { text-align: right; }
.ovc-dot { width: 8px; height: 8px; border-radius: 50%; }
.ovc-work { display: grid; gap: 10px; }
.ovc-wl { display: grid; grid-template-columns: 22px minmax(70px, 120px) 1fr 28px; align-items: center; gap: 10px; font-size: 13px; }
.ovc-wn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovc-wb { display: flex; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ovc-wb i { display: block; height: 100%; }
.ovc-wl b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .ovc-item { grid-template-columns: 1fr auto; } .ovc-it-e { grid-column: 1 / -1; grid-row: 2; } }
.ovc-tbl { width: 100%; border-collapse: collapse; }
.ovc-tbl th, .ovc-tbl td { padding: 9px 12px; border-top: 1px solid var(--divider); text-align: left; }
.ovc-tbl th { font-size: 12px; font-weight: 500; color: var(--text-3); border-top: 0; padding-top: 4px; }
.ovc-tbl th:first-child, .ovc-tbl td:first-child { padding-left: 16px; } .ovc-tbl th:last-child, .ovc-tbl td:last-child { padding-right: 16px; }
.ovc-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
#ovc-etapas { overflow-x: auto; }
.tbl.ovc-tbl thead th { padding: 6px 12px; height: 34px; position: static; background: none; }
.tbl.ovc-tbl thead th:first-child { padding-left: 16px; } .tbl.ovc-tbl thead th:last-child { padding-right: 16px; }
/* tooltip acima/abaixo do elemento quando nao cabe a direita */
.tip.cima:not(.on) { transform: translateY(4px); } .tip.baixo:not(.on) { transform: translateY(-4px); }

/* painel clicavel (indicadores, etapas, situacao, responsaveis) */
.stat.clic { cursor: pointer; transition: background .14s var(--ease); position: relative; }
.stat.clic:hover { background: var(--surface-2); }
.stat.clic:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.clic-seta { margin-left: auto; opacity: 0; color: var(--text-4); display: inline-flex; transition: opacity .14s; }
.clic-seta svg { width: 13px; height: 13px; }
.stat.clic:hover .clic-seta { opacity: 1; }
.ovc-tbl tr.clic { cursor: pointer; } .ovc-tbl tr.clic:hover td { background: var(--surface-2); }
.ovc-tbl tr.clic:focus-visible { outline: none; } .ovc-tbl tr.clic:focus-visible td { background: var(--surface-2); }
button.ovc-leg-l { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 4px 6px; margin: -4px -6px; border-radius: var(--r-sm); cursor: pointer; box-sizing: content-box; }
button.ovc-leg-l:hover { background: var(--surface-2); }
.ovc-stack i { cursor: pointer; }
button.ovc-wl { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 4px 6px; margin: -4px -6px; border-radius: var(--r-sm); cursor: pointer; box-sizing: content-box; }
button.ovc-wl:hover { background: var(--surface-2); }
/* tela de detalhe */
.dt-drawer { width: min(720px, 100vw); }
.dt-cab { display: flex; align-items: center; gap: 14px; }
.dt-av { width: 46px; height: 46px; font-size: 15px; }
.dt-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.dt-ico.late { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.dt-ico svg { width: 22px; height: 22px; }
.dt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dt-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.dt-sec-h .sec-t { margin: 0; }
.dt-lista .ovc-item:first-child { border-top: 0; }
.dt-lista { max-height: none; }
.dt-prazo { color: var(--green); font-size: 12.5px; white-space: nowrap; }
.dt-quebra { display: grid; gap: 10px; }
.dt-ql-i { width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-3); }
.dt-ql-i svg { width: 15px; height: 15px; }
.dt-quebra .ovc-wl { grid-template-columns: 22px minmax(120px, 260px) 1fr 32px; }
@media (max-width: 760px) { .dt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#stats > .stat:first-child { cursor: pointer; transition: background .14s var(--ease); } #stats > .stat:first-child:hover { background: var(--surface-2); }
/* tela de detalhe: secoes em coluna (sem a grade comprimir os blocos) e a lista de tarefas com rolagem propria */
.dt-drawer .drawer-b { display: flex; flex-direction: column; } .dt-drawer .drawer-b > * { flex: none; }
.dt-drawer .card.flush:has(.dt-lista) { max-height: 56vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ===== Auditoria ===== */
.au-tbl tr.clic { cursor: pointer; } .au-tbl tr.clic:hover td { background: var(--surface-2); }
.au-tbl td { vertical-align: middle; }
.au-quando { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.au-usu { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.au-cat { margin-left: 8px; white-space: nowrap; }
.au-acao { max-width: 560px; } .au-acao > span:last-child { overflow-wrap: anywhere; }
.au-niv { margin-right: 8px; font-size: 11px; padding: 1px 7px; }
.au-tbl tr.au-n-erro td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.au-tbl tr.au-n-aviso td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.au-pre { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--sunken); font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); max-height: 60vh; overflow: auto; }

/* ===== menu do usuario (rodape do menu lateral, como no Gr8r) ===== */
.user { padding: 0; }
.user-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .14s var(--ease); }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); }
.user-btn .av { width: 28px; height: 28px; font-size: 11px; position: relative; }
.user-btn .av::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--bg-side); }
.user-btn .unome { flex: 1; min-width: 0; } .user-btn .unome b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chev { color: var(--text-4); display: inline-flex; } .user-chev svg { width: 14px; height: 14px; }
html.side-min .user-btn { justify-content: center; padding: 6px 0; } html.side-min .user-btn .unome, html.side-min .user-chev { display: none; }
@media (max-width: 820px) { .user-btn { justify-content: center; padding: 6px 0; } .user-btn .unome, .user-chev { display: none; } }
.pop-um { width: 280px; max-width: calc(100vw - 16px); padding: 6px; }
.um { display: grid; gap: 1px; }
.um-cab { display: flex; align-items: center; gap: 12px; padding: 8px 8px 10px; }
.um-av { width: 38px; height: 38px; font-size: 13px; flex: none; }
.um-id { display: grid; gap: 1px; min-width: 0; } .um-id b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .um-id span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-sep { height: 1px; background: var(--divider); margin: 4px 2px; }
.um-t { font-size: 10.5px; letter-spacing: .06em; color: var(--text-4); padding: 8px 8px 4px; font-weight: 500; }
.um-tema { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; margin: 0 4px 4px; background: var(--surface-2); border-radius: var(--r-sm); }
.um-tema button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; cursor: pointer; }
.um-tema button svg { width: 14px; height: 14px; }
.um-tema button:hover { color: var(--text); }
.um-tema button.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong), 0 1px 2px rgba(0,0,0,.12); }
.um .mi span:not(.um-kbd) { flex: 1; }
.um-kbd, .at kbd { font-family: var(--mono); font-size: 11px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text-3); background: var(--surface-2); }
.at { display: grid; gap: 2px; }
.at-l { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 2px; border-top: 1px solid var(--divider); } .at-l:first-child { border-top: 0; }
.at-k { display: inline-flex; gap: 4px; }

/* ===== tema claro (o escuro e o padrao) ===== */
html[data-tema="claro"] {
  --overlay: rgba(0, 0, 0, .28);
  --bg: #f7f7f5; --bg-side: #f0efec; --surface: #ffffff; --surface-2: #f2f1ee; --surface-3: #e7e5e1; --sunken: #f7f6f3;
  --border: #e3e1dc; --border-strong: #d2cfc8; --divider: #ebe9e5;
  --text: #1c1b19; --text-2: #46443f; --text-3: #6b6862; --text-4: #9a968e;
  --accent: #5866df; --on-accent: #ffffff;
  --green: #2c8f5c; --amber: #ad7612; --red: #cc4a3b; --blue: #3474cf; --violet: #7656d2; --teal: #1f9187; --rose: #c44c79; --orange: #c4662b; --gray: #7a766e;
  --shadow-pop: 0 12px 32px -8px rgba(0,0,0,.16), 0 0 0 1px var(--border);
  --ck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.4'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html[data-tema="sistema"] {
    --overlay: rgba(0, 0, 0, .28);
    --bg: #f7f7f5; --bg-side: #f0efec; --surface: #ffffff; --surface-2: #f2f1ee; --surface-3: #e7e5e1; --sunken: #f7f6f3;
    --border: #e3e1dc; --border-strong: #d2cfc8; --divider: #ebe9e5;
    --text: #1c1b19; --text-2: #46443f; --text-3: #6b6862; --text-4: #9a968e;
    --accent: #5866df; --on-accent: #ffffff;
    --green: #2c8f5c; --amber: #ad7612; --red: #cc4a3b; --blue: #3474cf; --violet: #7656d2; --teal: #1f9187; --rose: #c44c79; --orange: #c4662b; --gray: #7a766e;
    --shadow-pop: 0 12px 32px -8px rgba(0,0,0,.16), 0 0 0 1px var(--border);
    --ck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.6 8.4l2.9 2.9 5.9-6.4'/%3E%3C/svg%3E");
    color-scheme: light;
  }
}
html[data-tema="escuro"] { color-scheme: dark; }
/* cores fixas que precisam inverter no claro: tooltip escuro e botao "Abrir solicitacao" com contorno */
html[data-tema="claro"] .tip { background: #1c1b19; color: #ffffff; }
html[data-tema="claro"] .cb-abrir { border-color: var(--border-strong); }
html[data-tema="claro"] .dlg-scrim { background: rgba(0, 0, 0, .3); }
@media (prefers-color-scheme: light) {
  html[data-tema="sistema"] .tip { background: #1c1b19; color: #ffffff; }
  html[data-tema="sistema"] .cb-abrir { border-color: var(--border-strong); }
  html[data-tema="sistema"] .dlg-scrim { background: rgba(0, 0, 0, .3); }
}

/* auditoria: linhas registradas pelo sistema durante a acao */
.au-evs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.au-ev { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.au-ev .badge { flex: none; }

/* regras lado a lado; a regra aberta para edicao ocupa a linha inteira */
.rg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; }
.rg-grid > .rcard { min-width: 0; }
.rg-grid > .rcard:not(.fechado) { grid-column: 1 / -1; }
.rcard .rhead .switch, .rcard .rhead .ibtn { flex: none; } .rcard .rhead .nome-in { min-width: 0; }

/* regra: mensagem num bloco so (template e variaveis | previa) */
.rg-msg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); border: 1px solid var(--border); border-radius: var(--r-lg, 10px); overflow: hidden; margin: 10px 0 14px; }
.rg-msg-f { display: grid; gap: 18px; padding: 16px 18px; align-content: start; min-width: 0; }
.rg-msg-c { display: grid; gap: 8px; min-width: 0; }
.rg-msg-c > .hint:empty { display: none; }
.rg-msg-r { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rg-msg-r b { font-size: 13px; font-weight: 600; }
.rg-msg-r .hint { margin: 0; }
.rg-msg-p { display: grid; gap: 10px; align-content: start; padding: 16px 18px; background: var(--sunken); border-left: 1px solid var(--border); min-width: 0; }
.rg-msg-p .rg-prev-host { width: 100%; }
.rg-msg-p .wa-chat { background: none; border: 0; padding: 0; width: fit-content; max-width: 100%; }
.rg-msg .varmap-sel { width: min(240px, 100%); } .rg-msg .varmap-sel .selbtn { min-width: 0; width: 100%; }
.rg-msg .tplsel .selbtn { width: 100%; max-width: 420px; }
@media (max-width: 900px) { .rg-msg { grid-template-columns: 1fr; } .rg-msg-p { border-left: 0; border-top: 1px solid var(--border); } }
/* sem "card dentro de card": o bloco da mensagem fica plano dentro da regra, com uma divisoria entre edicao e previa */
.rg-msg { border: 0; border-radius: 0; overflow: visible; background: none; gap: 0 28px; margin: 12px 0 16px; }
.rg-msg-f { padding: 0; }
.rg-msg-p { background: none; border-left: 1px solid var(--divider); padding: 0 0 0 28px; }
@media (max-width: 900px) { .rg-msg { gap: 20px; } .rg-msg-p { border-left: 0; border-top: 1px solid var(--divider); padding: 18px 0 0; } }

/* lista de clientes por situacao (cards Inadimplentes / Em cobranca da visao geral) */
.sit-item { cursor: default; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
.sit-item:hover { background: none; }
.sit-valor { display: grid; justify-items: end; gap: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sit-valor b { font-weight: 600; }
.dt-ico.warn { background: color-mix(in srgb, var(--amber, #e0a33a) 14%, transparent); color: var(--amber, #e0a33a); }
.dt-drawer .drawer-b > input[type="search"] { width: 100%; }
@media (max-width: 760px) { .sit-item { grid-template-columns: 1fr auto; } }
.dt-drawer .dt-stats .stat { min-width: 0; } .dt-drawer .dt-stats .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-drawer .dt-stats .c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* template + previa (esquerda) | variaveis (direita) */
.rg-msg { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rg-msg-f { gap: 12px; }
.rg-msg-prev { gap: 6px; }
.rg-msg-prev .rg-prev-host > p { margin: 0; }
.rg-msg-prev .wa-chat { background: var(--sunken); border: 1px solid var(--divider); border-radius: var(--r); padding: 12px; width: fit-content; max-width: min(100%, 420px); }
.rg-msg-p { padding-left: 28px; }
@media (max-width: 900px) { .rg-msg { grid-template-columns: 1fr; } }
.rg-msg-prev[hidden], .rg-msg-p[hidden] { display: none; }
/* sem variaveis (nenhum template escolhido): o template ocupa a linha toda, sem a divisoria */
.rg-msg:has(> .rg-msg-p[hidden]) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .rg-msg-p { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--divider); } }

/* ---------- Acessos: papel e permissoes por modulo ---------- */
.dlg-l:has(.ea) { width: min(780px, 100%); }
.ea { display: grid; gap: 14px; } .ea-area { display: grid; gap: 10px; }
.ea-papeis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ea-papel { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.ea-papel > span { display: grid; gap: 2px; line-height: 1.4; }
.ea-papel { position: relative; padding: 12px 42px 12px 14px; transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease); }
.ea-papel::after { content: ""; position: absolute; top: 13px; right: 14px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease); }
.ea-papel:hover { background: var(--surface-2); border-color: var(--text-4); }
.ea-papel:hover::after { border-color: var(--text-3); }
.ea-papel.on { border-color: var(--text-4); } /* so a bolinha fica na cor de destaque */
.ea-papel.on::after { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3.5px var(--surface); }
.ea-papel:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent); }
.ea-papel:active { transform: scale(.995); }
.pm-topo { display: flex; align-items: center; gap: 8px; } .pm-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pm-wrap { max-height: 330px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }
.pm th, .pm td { padding: 8px 10px; } .pm th.c, .pm td.c { text-align: center; width: 78px; }
.pm .pm-d { display: block; font-size: 11.5px; line-height: 1.35; max-width: 330px; }
.pm-cb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; vertical-align: middle; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface) center / 13px 13px no-repeat;
  transition: background-color .12s var(--ease), border-color .12s var(--ease), box-shadow .12s var(--ease), transform .12s var(--ease); }
.pm-cb:hover { border-color: var(--text-4); background-color: var(--surface-2); }
.pm-cb:checked { border-color: var(--accent); background-color: var(--accent); background-image: var(--ck); }
.pm-cb:checked:hover { border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.pm-cb:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent); }
.pm-cb:active { transform: scale(.9); }
.pm .nao { color: var(--text-4); }
@media (prefers-reduced-motion: reduce) { .ea-papel, .ea-papel::after, .pm-cb { transition: none; } .ea-papel:active, .pm-cb:active { transform: none; } }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; } .pp-card { padding: 14px 16px; }
.pp-t { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; } .pp-t svg { width: 16px; height: 16px; color: var(--text-3); } .pp-card p { margin: 0; }
.pp-acoes { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.acs { display: grid; gap: 2px; }
tr.convite td:first-child { box-shadow: inset 2px 0 0 var(--accent-soft); }
@media (max-width: 640px) { .ea-papeis, .pp-grid { grid-template-columns: 1fr; } }
/* sem permissao de editar: as telas viram so consulta (o servidor tambem recusa qualquer alteracao) */
#tab-regras.somente-leitura .rbody, #tab-regras.somente-leitura .rg-painel[data-painel=geral] { pointer-events: none; opacity: .85; }
#tab-regras.somente-leitura .rhead .switch, #tab-regras.somente-leitura .rhead .ibtn:not(.rtog) { display: none; }

/* ---------- Convites de acesso por e-mail ---------- */
.cv-vazio { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 32px 16px; color: var(--text-3); }
.cv-vazio b { color: var(--text-2); font-weight: 600; }
.cv-aviso { margin-bottom: 12px; }
.badge.cv-pendente { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.cv-entrega { font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.cv-entrega.ok { color: var(--green); } .cv-entrega.bad { color: var(--red); } .cv-entrega.warn { color: var(--amber); }
.cv-expira { color: var(--text-3); font-size: 12.5px; } .cv-expira.curto { color: var(--amber); }

/* ---------- Tutorial de primeiro acesso ---------- */
.tt-mascara { position: fixed; inset: 0; z-index: 130; background: transparent; }
.tt-foco { position: fixed; z-index: 131; display: none; border-radius: var(--r); pointer-events: none; box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(0, 0, 0, .62); transition: left .25s var(--ease), top .25s var(--ease), width .25s var(--ease), height .25s var(--ease); }
.tt-mascara.escura { background: rgba(0, 0, 0, .62); }
.tt-balao { position: fixed; z-index: 132; width: min(340px, calc(100vw - 24px)); background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 14px 16px 14px; display: grid; gap: 8px; animation: riseIn .22s var(--ease) both; }
.tt-balao.centro { width: min(420px, calc(100vw - 24px)); }
.tt-balao h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.tt-balao p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.tt-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tt-n { font-size: 11.5px; color: var(--text-4); font-weight: 500; }
.tt-pular { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: 12px; color: var(--text-3); cursor: pointer; border-radius: 4px; }
.tt-pular:hover { color: var(--text); text-decoration: underline; }
.tt-pontos { display: flex; gap: 4px; margin-top: 2px; }
.tt-pontos span { flex: 1; height: 3px; border-radius: 2px; background: var(--border-strong); }
.tt-pontos span.feito { background: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); } .tt-pontos span.on { background: var(--accent); }
.tt-acoes { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* telas estreitas: as abas (Cobranca, Acessos, Regras) quebram de linha em vez de serem cortadas na borda */
@media (max-width: 560px) { .utabs { flex-wrap: wrap; } }
/* Acessos > Membros: o grid interno crescia ate a largura da tabela (565 px) em telas de 360 px; a tabela ja rola dentro do card */
#ac-membros > * { min-width: 0; }

/* Envios: aviso de webhook da Meta sem status */
.aviso-wh { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r); font-size: 12.5px; line-height: 1.45;
  background: color-mix(in srgb, var(--amber) 10%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 38%, transparent); color: var(--text); }
.aviso-wh svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--amber); }
