/* Componentes base compartilhados por todos os apps do simulador. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--sz-font); font-size: var(--sz-fs-md); line-height: 1.5;
  color: var(--sz-text); background: #232323; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01"; overflow: hidden;
}
button { font: inherit; color: inherit; }
a { color: var(--sz-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--sz-text); letter-spacing: -0.01em; }
h1 { font-size: var(--sz-fs-xl); font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: var(--sz-fs-lg); font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
small, .muted { color: var(--sz-text-2); }
.text-3 { color: var(--sz-text-3); }
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
code, .code { font-family: var(--sz-mono); font-size: .92em; }
.hidden, [hidden] { display: none !important; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--sz-blue); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; }
::selection { background: var(--sz-blue-100); }

/* scrollbars discretas */
* { scrollbar-width: thin; scrollbar-color: var(--sz-border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--sz-border-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- Layout utilitário ---------- */
.row { display: flex; align-items: center; gap: var(--sz-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sz-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--sz-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sz-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sz-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sz-4); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Botões ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--sz-radius-sm);
  border: 1px solid var(--sz-border-2); background: var(--sz-surface); color: var(--sz-text);
  font-size: var(--sz-fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s;
  box-shadow: var(--sz-shadow-sm);
}
.btn:hover { background: var(--sz-surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--sz-blue); border-color: var(--sz-blue); color: var(--sz-on-blue); box-shadow: 0 1px 2px rgb(61 233 15 / 30%), inset 0 1px 0 rgb(255 255 255 / 16%); }
.btn-primary:hover { background: var(--sz-blue-600); border-color: var(--sz-blue-600); }
.btn-dark { background: #111; border-color: #111; color: #fff; }
.btn-dark:hover { background: #2a2e35; }
:root[data-theme="dark"] .btn-dark { background: #f2f3f5; color: #111; border-color: #f2f3f5; }
.btn-success { background: var(--sz-success); border-color: var(--sz-success); color: #fff; }
.btn-success:hover { filter: brightness(.95); }
.btn-danger { color: var(--sz-danger); }
.btn-danger:hover { background: var(--sz-danger-050); border-color: color-mix(in srgb, var(--sz-danger) 40%, transparent); }
.btn-danger-solid { background: var(--sz-danger); border-color: var(--sz-danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--sz-surface-2); }
.btn-soft { background: var(--sz-blue-050); border-color: transparent; color: var(--sz-blue); box-shadow: none; }
.btn-soft:hover { background: var(--sz-blue-100); }
.btn-glass { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 16%); color: #fff; box-shadow: none; }
.btn-glass:hover { background: rgb(255 255 255 / 18%); }
.btn-sm { height: 30px; padding: 0 10px; font-size: var(--sz-fs-xs); border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid rgb(255 255 255 / 35%); border-top-color: #fff; border-right-color: #fff;
  animation: spin .7s linear infinite;
}
.btn:not(.btn-primary):not(.btn-dark):not(.btn-success):not(.btn-danger-solid).busy::after { border-color: var(--sz-border-2); border-top-color: var(--sz-blue); border-right-color: var(--sz-blue); }
.btn-icon-ghost { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--sz-text-2); cursor: pointer; }
.btn-icon-ghost:hover { background: var(--sz-surface-2); color: var(--sz-text); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--sz-text-2); }
.field .req::after { content: " *"; color: var(--sz-danger); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--sz-border-2); border-radius: var(--sz-radius-sm);
  background: var(--sz-surface); color: var(--sz-text); font: inherit; font-size: var(--sz-fs-sm);
  transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a909c' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sz-blue); box-shadow: var(--sz-ring); }
.input::placeholder, .textarea::placeholder { color: var(--sz-text-3); }
.input-ic { position: relative; }
.input-ic > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--sz-text-3); pointer-events: none; }
.input-ic > .input { padding-left: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--sz-fs-sm); color: var(--sz-text-2); cursor: pointer; user-select: none; }
.check input { accent-color: var(--sz-blue); width: 16px; height: 16px; margin: 0; }
.hint { font-size: 12px; color: var(--sz-text-3); }
.form-err {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--sz-radius-sm);
  background: var(--sz-danger-050); color: var(--sz-danger); font-size: 13px; font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--sz-danger) 25%, transparent);
}
.fieldset { border: 1px solid var(--sz-border); border-radius: var(--sz-radius); padding: 14px; display: grid; gap: 12px; background: var(--sz-surface-2); }
.fieldset-h { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sz-surface-2); border: 1px solid var(--sz-border); gap: 2px; }
.seg button, .seg label { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--sz-text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg input { display: none; }
.seg button.active, .seg input:checked + span, .seg label:has(input:checked) { background: var(--sz-surface); color: var(--sz-text); box-shadow: var(--sz-shadow-sm); }
.seg .icon { width: 15px; height: 15px; }

/* combobox de busca */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow: auto;
  background: var(--sz-surface); border: 1px solid var(--sz-border-2); border-radius: var(--sz-radius-sm); box-shadow: var(--sz-shadow-lg); padding: 4px;
}
.combo-item { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.combo-item small { font-size: 12px; }
.combo-item:hover, .combo-item.hl { background: var(--sz-blue-050); }
.combo-sel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--sz-blue-200); background: var(--sz-blue-050); border-radius: var(--sz-radius-sm); font-size: 13px; }

/* ---------- Cards ---------- */
.card { background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-radius); box-shadow: var(--sz-shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--sz-border); }
.card-h h3 { display: flex; align-items: center; gap: 8px; }
.card-h h3 .icon { color: var(--sz-text-3); width: 17px; height: 17px; }
.card-b { padding: 18px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--sz-border); }
.card-flat { box-shadow: none; }

/* definição de dados */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; font-size: 13px; margin: 0; }
.dl dt { color: var(--sz-text-3); font-weight: 500; }
.dl dd { margin: 0; color: var(--sz-text); min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sz-text-3); padding: 10px 14px; border-bottom: 1px solid var(--sz-border); background: var(--sz-surface-2);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--sz-border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: color-mix(in srgb, var(--sz-blue-050) 70%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-main { font-weight: 600; color: var(--sz-text); }
.table .t-sub { font-size: 12px; color: var(--sz-text-3); }
.table .t-code { font-family: var(--sz-mono); font-size: 12px; font-weight: 600; color: var(--sz-text-2); white-space: nowrap; }
.table td.r, .table th.r { text-align: right; }
.table tr.flash-row td { animation: flashRow 1.6s var(--ease); }
@keyframes flashRow { 0%, 30% { background: var(--sz-blue-050); } 100% { background: transparent; } }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 12px; color: var(--sz-text-3); border-top: 1px solid var(--sz-border); }
.pager > div { display: flex; gap: 6px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--c-bg); color: var(--c-fg); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-novo { --c-bg: var(--sz-violet-050); --c-fg: var(--sz-violet); }
.st-em_triagem { --c-bg: var(--sz-warning-050); --c-fg: #b87300; }
.st-aguardando_cliente { --c-bg: #fff0e5; --c-fg: #c25a00; }
.st-agendado { --c-bg: var(--sz-ice); --c-fg: var(--sz-ice-700); }
.st-encaminhado { --c-bg: var(--sz-blue-050); --c-fg: var(--sz-blue); }
.st-em_atendimento { --c-bg: var(--sz-blue); --c-fg: #fff; }
.st-resolvido { --c-bg: var(--sz-success-050); --c-fg: var(--sz-success); }
.st-encerrado { --c-bg: var(--sz-surface-3); --c-fg: var(--sz-text-2); }
.st-cancelado { --c-bg: var(--sz-danger-050); --c-fg: var(--sz-danger); }
.st-reaberto { --c-bg: #fde8f1; --c-fg: #c2185b; }
:root[data-theme="dark"] .st-aguardando_cliente { --c-bg: #2e1d10; --c-fg: #ff9d4d; }
:root[data-theme="dark"] .st-reaberto { --c-bg: #331422; --c-fg: #ff6fa8; }
:root[data-theme="dark"] .st-em_triagem { --c-fg: #f2b441; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .st-aguardando_cliente { --c-bg: #2e1d10; --c-fg: #ff9d4d; }
  :root:not([data-theme="light"]) .st-reaberto { --c-bg: #331422; --c-fg: #ff6fa8; }
  :root:not([data-theme="light"]) .st-em_triagem { --c-fg: #f2b441; }
}
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--c); white-space: nowrap; }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); transform: rotate(45deg); }
.prio-baixa { --c: var(--sz-prio-baixa); } .prio-media { --c: var(--sz-prio-media); }
.prio-alta { --c: var(--sz-prio-alta); } .prio-urgente { --c: var(--sz-prio-urgente); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--sz-surface-3); color: var(--sz-text-2); }
.pill-ok { background: var(--sz-success-050); color: var(--sz-success); }
.pill-danger { background: var(--sz-danger-050); color: var(--sz-danger); }
.pill-amber { background: var(--sz-warning-050); color: #b87300; }
.pill-blue { background: var(--sz-blue-050); color: var(--sz-blue); }
.pill-ice { background: var(--sz-ice); color: var(--sz-ice-700); }
.pill-violet { background: var(--sz-violet-050); color: var(--sz-violet); }
.pill-new { background: var(--sz-blue); color: var(--sz-on-blue); animation: pop .5s var(--ease-spring); }
.pill .icon { width: 13px; height: 13px; }
.late { color: var(--sz-danger); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tagc { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 12px; background: var(--sz-surface-2); border: 1px solid var(--sz-border); color: var(--sz-text-2); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* avatar */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 700; color: hsl(var(--h) 55% 32%); background: hsl(var(--h) 70% 92%); }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 80% 80%); background: hsl(var(--h) 35% 22%); }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-foto { overflow: hidden; background: var(--sz-surface-2); }
.avatar-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* estrelas */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.star { width: 16px; height: 16px; fill: var(--sz-surface-3); stroke: none; }
.star.on { fill: #f5a524; }

/* ---------- Estados ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--sz-text-3); font-size: 13px; }
.sk { background: linear-gradient(90deg, var(--sz-surface-2) 0%, var(--sz-surface-3) 40%, var(--sz-surface-2) 80%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
.sk-rows { display: grid; gap: 10px; padding: 18px; }
.sk-row { height: 38px; width: var(--w, 100%); }
.sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.sk-card { height: 104px; border-radius: var(--sz-radius); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.error-box { display: flex; gap: 12px; align-items: flex-start; margin: 16px; padding: 14px 16px; border-radius: var(--sz-radius); background: var(--sz-danger-050); color: var(--sz-text); border: 1px solid color-mix(in srgb, var(--sz-danger) 25%, transparent); font-size: 13px; }
.error-box > .icon { color: var(--sz-danger); margin-top: 2px; }
.error-box > div { flex: 1; }
.error-box p { color: var(--sz-text-2); margin-top: 2px; }

/* ---------- Toasts ---------- */
.toast-stack { position: absolute; z-index: 400; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: min(380px, calc(100% - 32px)); }
.toast-stack.global { position: fixed; right: 20px; bottom: 20px; z-index: 9000; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; width: 100%; min-width: 260px;
  padding: 11px 12px; border-radius: 14px; font-size: 13px; color: var(--sz-text);
  background: color-mix(in srgb, var(--sz-surface) 88%, transparent); backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--sz-border); box-shadow: var(--sz-shadow-lg);
  transform: translateY(10px) scale(.97); opacity: 0; transition: transform .3s var(--ease-spring), opacity .25s;
}
.toast.in { transform: none; opacity: 1; }
.toast.out { transform: translateX(16px); opacity: 0; }
.toast.clickable { cursor: pointer; }
.toast-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; flex: none; background: var(--sz-blue-050); color: var(--sz-blue); }
.toast-ic .icon { width: 16px; height: 16px; }
.toast-ok .toast-ic { background: var(--sz-success-050); color: var(--sz-success); }
.toast-erro .toast-ic { background: var(--sz-danger-050); color: var(--sz-danger); }
.toast-aviso .toast-ic { background: var(--sz-warning-050); color: var(--sz-warning); }
.toast-push .toast-ic { background: var(--sz-blue); color: var(--sz-on-blue); }
.toast-tx { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-top: 1px; }
.toast-tx b { font-size: 13px; }
.toast-tx span { color: var(--sz-text-2); overflow-wrap: anywhere; }
.toast-x { border: 0; background: transparent; color: var(--sz-text-3); cursor: pointer; padding: 2px; border-radius: 6px; display: grid; }
.toast-x .icon { width: 14px; height: 14px; }

/* ---------- Modal ---------- */
.modal-ov {
  position: absolute; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
  background: rgb(10 12 16 / 46%); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s;
}
.modal-ov.in { opacity: 1; }
.modal-ov.out { opacity: 0; }
.modal {
  width: min(var(--mw, 520px), 100%); max-height: 100%; display: flex; flex-direction: column;
  background: var(--sz-surface); border-radius: var(--sz-radius-lg); box-shadow: var(--sz-shadow-lg); border: 1px solid var(--sz-border);
  transform: translateY(12px) scale(.98); transition: transform .3s var(--ease-spring); overflow: hidden; margin: 0;
}
.modal-ov.in .modal { transform: none; }
.modal-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.modal-h h3 { font-size: 16px; font-weight: 700; }
.modal-b { padding: 4px 18px 18px; overflow: auto; display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--sz-border); background: var(--sz-surface-2); }
.modal-ov.sheet { place-items: end stretch; padding: 0; }
.modal-ov.sheet .modal { width: 100%; border-radius: 22px 22px 0 0; transform: translateY(100%); max-height: 88%; }
.modal-ov.sheet.in .modal { transform: none; }
.modal-ov.sheet .modal::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--sz-border-2); margin: 8px auto 0; }
.modal-ov.sheet .modal-f { padding-bottom: 26px; }
.modal-ov.sheet .modal-f .btn { flex: 1; height: 44px; }

/* credenciais */
.cred { display: grid; gap: 10px; padding: 16px; border-radius: var(--sz-radius); background: linear-gradient(135deg, var(--sz-blue-050), var(--sz-ice)); border: 1px solid var(--sz-blue-100); position: relative; overflow: hidden; }
.cred::after { content: ""; position: absolute; top: -40px; right: -40px; width: 80px; height: 80px; border-radius: 50%; border: 12px solid transparent; border-top-color: var(--sz-blue); border-right-color: var(--sz-blue); opacity: .85; }
.cred-head { display: flex; gap: 12px; align-items: center; }
.cred-head small { display: block; color: var(--sz-text-2); }
.cred-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--sz-blue); color: var(--sz-on-blue); }
.cred-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--sz-surface); border: 1px solid var(--sz-border); }
.cred-row span { font-size: 12px; color: var(--sz-text-3); font-weight: 600; }
.cred-row code { font-size: 15px; font-weight: 700; color: var(--sz-text); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--sz-border); border-radius: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 8px 0; animation: fadeUp .35s var(--ease) both; }
.tl-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sz-surface); border: 2px solid var(--sz-border); color: var(--sz-text-2); }
.tl-dot .icon { width: 15px; height: 15px; }
.tl-dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--tone); border-right-color: var(--tone); }
.tone-blue { --tone: var(--sz-blue); color: var(--sz-blue); }
.tone-green { --tone: var(--sz-success); color: var(--sz-success); }
.tone-amber { --tone: #f5a524; color: #d98a00; }
.tone-dark { --tone: var(--sz-text); color: var(--sz-text); }
.tone-muted { --tone: var(--sz-text-3); }
.tl-body { min-width: 0; padding-top: 5px; }
.tl-title { font-weight: 600; font-size: 13.5px; }
.tl-meta { font-size: 12px; color: var(--sz-text-3); margin-top: 3px; }
.tl-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.tl-head time { margin-left: auto; font-size: 12px; color: var(--sz-text-3); }
.tl-tipo { font-size: 12px; color: var(--sz-text-3); }
.tl-text { margin-top: 6px; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: var(--sz-surface-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-ativ.interno .tl-text { background: var(--sz-warning-050); }
.tl-diff { display: grid; gap: 4px; margin-top: 6px; }
.diff { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.diff-k { color: var(--sz-text-3); min-width: 88px; }
.diff-old { color: var(--sz-text-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--sz-danger) 50%, transparent); }
.diff-new { color: var(--sz-text); font-weight: 600; }
.diff-arrow { width: 13px; height: 13px; color: var(--sz-text-3); }
.nil { color: var(--sz-text-3); font-weight: 400; }
.tl-quote { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--sz-blue); background: var(--sz-blue-050); border-radius: 0 8px 8px 0; font-size: 13px; }
.tl-empty { padding: 12px 0; font-size: 13px; }

/* ---------- KPIs e barras ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; }
.kpi-l { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--sz-text-2); }
.kpi-l .kpi-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--sz-blue-050); color: var(--sz-blue); }
.kpi-l .kpi-ic .icon { width: 15px; height: 15px; }
.kpi-v { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 6px; }
.kpi-v small { font-size: 14px; font-weight: 600; color: var(--sz-text-3); margin-left: 3px; letter-spacing: 0; }
.kpi-s { font-size: 12px; color: var(--sz-text-3); }
.kpi.danger .kpi-ic { background: var(--sz-danger-050); color: var(--sz-danger); }
.kpi.ok .kpi-ic { background: var(--sz-success-050); color: var(--sz-success); }
.kpi.ice .kpi-ic { background: var(--sz-ice); color: var(--sz-ice-700); }
.kpi.amber .kpi-ic { background: var(--sz-warning-050); color: var(--sz-warning); }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 36px; align-items: center; gap: 10px; font-size: 13px; }
.bar-l { color: var(--sz-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { height: 10px; border-radius: 6px; background: var(--sz-surface-2); overflow: hidden; }

/* ===== Agenda (calendário de OS) ===== */
.cal-card { padding: 14px 14px 16px; }
.cal-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-title { margin: 0; font-size: 17px; text-transform: capitalize; }
.cal-legenda { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: 12px; color: var(--sz-text-2); }
.cal-lg { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.cal-dot.corr { background: var(--sz-blue); }
.cal-dot.prev { background: var(--sz-success); }
.cal-dot.prev-sem { background: transparent; border: 2px solid var(--sz-success); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-head span { text-align: center; font-size: 12px; font-weight: 600; color: var(--sz-text-3); text-transform: uppercase; letter-spacing: .03em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-loading { grid-column: 1 / -1; text-align: center; color: var(--sz-text-3); padding: 40px 0; }
.cal-cell { min-height: 104px; border: 1px solid var(--sz-border); border-radius: var(--sz-radius-sm); background: var(--sz-surface); padding: 6px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-cell.fora { background: var(--sz-surface-2); opacity: .6; }
.cal-cell.hoje { border-color: var(--sz-blue); box-shadow: inset 0 0 0 1px var(--sz-blue); }
.cal-dia { font-size: 12px; font-weight: 600; color: var(--sz-text-2); }
.cal-cell.hoje .cal-dia { color: var(--sz-blue); }
.cal-eventos { display: flex; flex-direction: column; gap: 3px; }
.cal-ev { display: block; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; font-size: 11.5px; line-height: 1.35; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.cal-ev b { font-weight: 700; }
.cal-ev.corr { background: var(--sz-blue); }
.cal-ev.prev { background: var(--sz-success); }
.cal-ev.prev-sem { background: var(--sz-success-050); color: var(--sz-success); border-color: var(--sz-success); }
.cal-ev:hover { filter: brightness(.95); }
.cal-mais { border: none; background: none; color: var(--sz-text-3); font-size: 11px; cursor: pointer; text-align: left; padding: 1px 6px; }
.cal-mais:hover { color: var(--sz-blue); }
.cal-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--sz-border); border-left-width: 4px; border-radius: var(--sz-radius-sm); background: var(--sz-surface); padding: 8px 10px; cursor: pointer; }
.cal-row:hover { background: var(--sz-surface-2); }
.cal-row.corr { border-left-color: var(--sz-blue); }
.cal-row.prev, .cal-row.prev-sem { border-left-color: var(--sz-success); }
.cal-row-code { font-size: 12px; font-weight: 700; color: var(--sz-text-2); flex: none; }
.cal-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cal-row-main small { color: var(--sz-text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .cal-cell { min-height: 72px; }
  .cal-ev { font-size: 10px; }
  .cal-legenda { width: 100%; margin-left: 0; }
}

/* ===== WhatsApp — histórico de mensagens ===== */
.wa-hist { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.wa-msg { border: 1px solid var(--sz-border); border-radius: var(--sz-radius-sm); padding: 8px 10px; background: var(--sz-surface); }
.wa-msg.falha { border-color: var(--sz-danger); background: var(--sz-danger-050); }
.wa-msg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 4px; }
.wa-tel { font-variant-numeric: tabular-nums; color: var(--sz-text-2); }
.wa-ref { color: var(--sz-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-msg-top time { margin-left: auto; color: var(--sz-text-3); }
.wa-msg-txt { font-size: 13px; color: var(--sz-text); white-space: pre-wrap; word-break: break-word; }
.wa-msg-erro { margin-top: 4px; font-size: 12px; color: var(--sz-danger); display: flex; align-items: center; gap: 4px; }

/* aviso inline (ex.: cliente de contrato) */
.info-inline { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--sz-radius-sm); background: var(--sz-blue-050); color: var(--sz-blue-600); font-size: 13px; }
.info-inline svg { flex: none; margin-top: 1px; }
.bar-t i { display: block; height: 100%; width: var(--p); border-radius: 6px; background: var(--c, var(--sz-blue)); transform-origin: left; animation: growX .7s var(--ease) both; }
.bar-v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* chips de login rápido */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--sz-border-2); background: var(--sz-surface); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--sz-text); transition: all .15s; }
.chip:hover { border-color: var(--sz-blue); color: var(--sz-blue); background: var(--sz-blue-050); }

/* tabs internas */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--sz-border); }
.subtabs button { position: relative; border: 0; background: transparent; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--sz-text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.subtabs button.active { color: var(--sz-text); }
.subtabs button.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--sz-blue); border-radius: 2px; }
.subtabs .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--sz-surface-3); color: var(--sz-text-2); }

/* anim helpers */
.fade-in { animation: fadeUp .3s var(--ease) both; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.flash { animation: flashBg 1.2s var(--ease); }
@keyframes flashBg { 0%, 40% { box-shadow: 0 0 0 4px rgb(61 233 15 / 25%); } 100% { box-shadow: none; } }
