:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #8a8a93;
  --line: #e7e5e4;
  --navy: #0b0b0c;
  --navy-2: #17171a;
  --black: #0b0b0c;
  --black-2: #17171a;
  --black-3: #232327;
  --accent: #ea580c;
  --accent-ink: #ffffff;
  --accent-soft: #fff7ed;
  --orange: #f97316;
  --warn: #b45309;
  --warn-soft: #fdf1e1;
  --ok: #15803d;
  --ok-soft: #e6f4ea;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.04);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Estrutura: menu lateral preto + conteúdo ---------- */
.app-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--black); color: #d4d4d8; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; z-index: 30; overflow-y: auto;
}
.side svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 2px 6px 18px; text-decoration: none; color: inherit; }
.side-logo img { border-radius: 10px; display: block; }
.side-title { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -.01em; line-height: 1.1; }
.side-sub { font-size: 12px; color: #a1a1aa; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #71717a; padding: 14px 10px 6px; }
.side-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #d4d4d8; width: 100%;
  text-decoration: none; font-weight: 600; font-size: 14px; border: 0; background: none; text-align: left; cursor: pointer; position: relative;
}
.side-item:hover { background: var(--black-2); color: #fff; }
.side-item.active { background: rgba(249, 115, 22, .14); color: var(--orange); }
.side-item.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
.side-item .side-out { margin-left: auto; width: 14px; height: 14px; opacity: .6; }
.side-foot { margin-top: auto; border-top: 1px solid var(--black-3); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; min-width: 0; }
.side-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--black-3); color: var(--orange); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.side-avatar svg { width: 16px; height: 16px; }
.side-me-text { min-width: 0; }
.side-me-name { font-size: 13px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me-role { font-size: 11px; color: var(--orange); font-weight: 700; }
.side-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px; border-radius: 8px;
  border: 1px solid var(--black-3); background: transparent; color: #d4d4d8; font-weight: 600; cursor: pointer;
}
.side-logout:hover { background: var(--black-2); color: #fff; }
.side-shade { position: fixed; inset: 0; background: rgba(10, 10, 12, .45); z-index: 25; }
.app-main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 24px; flex-wrap: wrap;
  background: rgba(245, 245, 244, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.topbar-sub { font-size: 13px; color: var(--ink-2); }
.topbar-status { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pause-group { display: flex; gap: 6px; }
.pause-group select { width: auto; }
.menu-btn { display: inline-flex; padding: 7px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav[hidden] { display: none; }
.app-shell { transition: grid-template-columns .18s ease; }

/* menu recolhido (computador): só os ícones */
@media (min-width: 961px) {
  body.side-mini .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  body.side-mini .side { padding: 18px 10px; }
  body.side-mini .side-text, body.side-mini .side-out { display: none !important; }
  body.side-mini .side-logo { justify-content: center; padding: 2px 0 18px; }
  body.side-mini .side-item { justify-content: center; padding: 11px 0; }
  body.side-mini .side-item.active::before { left: -10px; }
  body.side-mini .side-label { height: 1px; padding: 0; margin: 10px 6px; background: var(--black-3); }
  body.side-mini .side-me { justify-content: center; padding: 4px 0; }
  body.side-mini .side-logout { padding: 8px 0; }
}
.menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: block; }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .side.open { transform: none; }
  .topbar { padding: 10px 14px; }
}

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-muted { background: #f4f4f5; color: var(--ink-3); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-info { background: var(--info-soft); color: var(--info); }

/* ---------- Ringbar ---------- */
.ringbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 20px; background: var(--warn-soft); border-bottom: 1px solid #f3d8b0;
}
.ringbar-label { font-weight: 650; color: var(--warn); margin-right: 4px; display: flex; align-items: center; gap: 8px; }
.ring-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); animation: pulse 1.1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180,83,9,.5); } 70% { box-shadow: 0 0 0 9px rgba(180,83,9,0); } 100% { box-shadow: 0 0 0 0 rgba(180,83,9,0); } }
.ring-chip {
  background: #fff; border: 1px solid #f0d2a6; border-radius: 8px; padding: 4px 10px; font-size: 13px;
}
.ring-chip strong { font-variant-numeric: tabular-nums; }
.ring-chip .muted { color: var(--ink-3); }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(360px, 5fr) minmax(360px, 6fr); gap: 16px;
  padding: 18px 24px 16px; width: 100%;
}
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .layout { padding: 14px; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 750; color: var(--ink); margin: 0; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* ---------- Call card ---------- */
.call-live { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; }
.call-number { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.call-meta { color: var(--ink-2); display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.call-timer { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.call-state { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #f4f4f5; color: var(--ink-2); }

.idle { text-align: center; padding: 10px 0 4px; }
.idle-icon {
  width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; background: var(--accent-soft);
  display: grid; place-items: center; color: var(--accent);
}
.idle-title { font-weight: 650; font-size: 15px; }
.manual-search { display: flex; gap: 8px; margin-top: 14px; }
.manual-search input { flex: 1; }
.history { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.history-title { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.history-item {
  display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.history-item:hover { background: #f4f6f9; }
.history-item span:last-child { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Contact ---------- */
.contact-name { font-size: 18px; font-weight: 700; margin: 0 0 2px; }
.contact-type { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 13px; }
.kv dd { margin: 0; word-break: break-word; }
.phone-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; text-align: left; cursor: pointer;
}
.match:hover { border-color: var(--accent); background: var(--accent-soft); }
.match-name { font-weight: 650; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--info-soft); color: #1e3a8a; margin-bottom: 12px; font-size: 13px; }
.notice-warn { background: var(--warn-soft); color: #7c2d12; }
.notice-bad { background: var(--bad-soft); color: #7f1d1d; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--bad); }
input[type=text], input[type=email], input[type=tel], input[type=search], select, textarea {
  border: 1px solid #d6d3d1; border-radius: 9px; padding: 8px 10px; background: #fff; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 3px solid rgba(249,115,22,.25); outline-offset: 1px; border-color: var(--orange);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.field-error { font-size: 12px; color: var(--bad); min-height: 0; }
.segmented { display: inline-flex; border: 1px solid #cfd6e0; border-radius: 8px; overflow: hidden; }
.segmented label { padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--black); color: var(--orange); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.btn {
  border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; font-weight: 700; cursor: pointer;
  background: #f4f4f5; color: var(--ink); white-space: nowrap; text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #111; }
.btn-primary:hover { background: var(--accent); color: #fff; filter: none; }
.btn-outline { background: #fff; border-color: #d6d3d1; }
.btn-outline:hover { border-color: var(--orange); color: #c2410c; filter: none; }
.btn-pause { background: var(--warn-soft); color: var(--warn); border-color: #f5d9a8; }
.btn-pause:hover { background: var(--warn); color: #fff; filter: none; }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.btn-danger:hover { background: var(--bad); color: #fff; filter: none; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; cursor: pointer; }
.btn-ghost-light { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); }

/* ---------- Tickets ---------- */
.ticket-list { display: flex; flex-direction: column; }
.ticket { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ticket:last-child { border-bottom: 0; }
.ticket-key { font-weight: 700; color: var(--accent); text-decoration: none; font-variant-numeric: tabular-nums; }
.ticket-key:hover { text-decoration: underline; }
.ticket-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ticket-sub { grid-column: 2 / -1; font-size: 12px; color: var(--ink-3); }
.status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.status-new { background: var(--info-soft); color: var(--info); }
.status-indeterminate { background: var(--warn-soft); color: var(--warn); }
.status-done { background: var(--ok-soft); color: var(--ok); }

.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton div { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton div:nth-child(2) { width: 80%; } .skeleton div:nth-child(3) { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { color: var(--ink-3); padding: 6px 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 380px; }
.toast { background: var(--black); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; border-left: 4px solid var(--orange); }
.toast a { color: var(--orange); font-weight: 700; }
.toast-bad { border-left-color: #ef4444; }
.toast-ok { border-left-color: #22c55e; }

/* ---------- Dialog ---------- */
.dialog { border: 0; border-radius: 12px; padding: 0; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-body { padding: 18px 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; font-size: 17px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.table th, .table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.table th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.row-3 { display: grid; grid-template-columns: 1.3fr 1fr .7fr auto; gap: 8px; align-items: end; }

/* ---------- Demo ---------- */
.sim {
  position: fixed; left: 0; top: 84px; bottom: 0; z-index: 15; width: 290px; background: #fff;
  border-right: 1px solid var(--line); box-shadow: 2px 0 12px rgba(15,42,68,.08); font-size: 13px; overflow-y: auto;
}
body.demo-mode .layout, body.demo-mode .ringbar { margin-left: 290px; }
body.demo-mode .layout { max-width: none; }
@media (max-width: 1000px) { .sim { position: static; width: auto; } body.demo-mode .layout, body.demo-mode .ringbar { margin-left: 0; } }
.sim-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #1f2937; color: #fff; }
.sim-head strong { font-size: 13px; }
.sim-body { padding: 10px 12px; display: grid; gap: 8px; }
.sim-group { display: grid; gap: 6px; }
.sim-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.sim .btn { width: 100%; text-align: left; }
.sim-stats { font-size: 12px; color: var(--ink-2); background: #f6f8fa; border-radius: 6px; padding: 6px 8px; }
.demo-banner { background: #1f2937; color: #e5e7eb; text-align: center; font-size: 12px; padding: 5px; }
.mt-12 { margin-top: 12px; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .pad-8 { padding: 8px 0; }

.pill-btn { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.steps { margin: 6px 0 12px; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.section { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.section h3 { margin: 0 0 8px; font-size: 14px; }
.inline-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 260px; }
.notice .btn { margin-top: 8px; }

/* ---------- Login (tela dividida) ---------- */
.login-page { background: #fff; min-height: 100vh; margin: 0; }
.login-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-hero {
  background: radial-gradient(900px 520px at 20% 110%, rgba(249,115,22,.32), transparent 60%),
              radial-gradient(700px 420px at 110% -10%, rgba(249,115,22,.18), transparent 55%), var(--black);
  color: #e4e4e7; padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero-top { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.login-hero-top img { border-radius: 12px; display: block; }
.login-hero-body h2 { font-size: 38px; line-height: 1.15; margin: 0 0 28px; color: #fff; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
.login-hero-body h2 em { font-style: normal; color: var(--orange); }
.login-hero-body ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 460px; }
.login-hero-body li { display: flex; gap: 12px; align-items: center; font-size: 15px; color: #d4d4d8; }
.login-hero-body li span {
  width: 28px; height: 28px; border-radius: 8px; background: rgba(249,115,22,.16); color: var(--orange);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none;
}
.login-hero-foot { font-size: 12px; color: #71717a; letter-spacing: .06em; text-transform: uppercase; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.login-box { width: min(420px, 100%); text-align: center; }
.login-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; color: var(--ink); }
.login-text { margin: 0 0 26px; color: var(--ink-2); }
.login-logo { display: block; margin: 0 auto 34px; height: auto; }
.login-card {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; box-shadow: 0 10px 30px rgba(0,0,0,.05);
}
.login-card .notice { margin-bottom: 16px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px;
  border: 0; border-radius: 10px; background: var(--orange); color: #111; font-weight: 800;
  text-decoration: none; font-size: 15px; box-shadow: 0 8px 20px rgba(249,115,22,.25); transition: background .12s, color .12s;
}
.btn-google svg { background: #fff; border-radius: 50%; padding: 3px; width: 26px; height: 26px; }
.btn-google:hover { background: var(--accent); color: #fff; }
.btn-google:focus-visible { outline: 3px solid rgba(249,115,22,.45); outline-offset: 3px; }
.login-hint { font-size: 13px; color: var(--ink-2); margin: 16px 0 0; text-align: center; }
.login-sep { height: 1px; background: var(--line); margin: 20px 0 14px; }
.login-help { margin: 0; text-align: center; font-size: 13px; color: var(--accent); font-weight: 600; }
.login-help span { display: block; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.login-version { margin: 34px 0 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .login-hero { padding: 22px 24px; }
  .login-hero-body, .login-hero-foot { display: none; }
}

/* ---------- Histórico / relatório ---------- */
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
input[type=date] { border: 1px solid #cfd6e0; border-radius: 7px; padding: 7px 10px; background: #fff; width: 100%; }
.report { width: 100%; padding: 18px 24px 40px; display: flex; flex-direction: column; gap: 14px; }
.report-body { display: flex; flex-direction: column; gap: 14px; }
.report-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.report-filter-actions { display: flex; }
.report-presets { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 13px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.report-title { font-size: 20px; margin: 0 0 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat-label { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }
.report-table td { vertical-align: top; }
.report-table .num { text-align: right; }
.report-table .nowrap { white-space: nowrap; }
.report-ticket + .report-ticket { margin-top: 4px; }
.report-ticket a { color: var(--accent); font-weight: 600; }

@media print {
  .no-print { display: none !important; }
  .app-shell { display: block; }
  body.report-page { background: #fff; }
  .report { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .report-table { font-size: 11px; }
  .report-table tr { break-inside: avoid; }
  .stat { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Atendimentos de hoje (tela do atendente) ---------- */
.today-wrap { width: 100%; padding: 0 24px 40px; }
@media (max-width: 960px) { .today-wrap { padding: 0 14px 30px; } }
.today-table td { vertical-align: top; }
.today-table .num { text-align: right; }
.today-table .nowrap { white-space: nowrap; }
.today-row { cursor: pointer; }
.today-row:hover td { background: #f6f8fb; }
.today-row.is-current td { background: var(--accent-soft); }
.today-row:focus-visible { outline: 2px solid rgba(11,122,117,.35); }
.today-table a { color: var(--accent); font-weight: 600; }
.call-live + .manual-search { margin-top: 14px; }
.form [data-group="servidor"] { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Janela do chamado ---------- */
.ticket-open { cursor: pointer; white-space: nowrap; }
.ticket-open:hover, .ticket-open:focus-visible { color: var(--accent); }
.issue-dialog { width: min(820px, 96vw); max-height: 90vh; padding: 0; border-radius: 14px; overflow: hidden; }
.issue-dialog[open] { display: flex; flex-direction: column; }
.issue-body { padding: 0 22px 18px; overflow-y: auto; max-height: 90vh; }
.issue-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 1;
  background: #fff; padding: 16px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.issue-head-main { display: flex; align-items: center; gap: 10px; }
.issue-key { font-weight: 800; color: var(--accent); font-size: 15px; letter-spacing: .01em; }
.issue-title { font-size: 20px; margin: 0 0 14px; line-height: 1.3; }
.issue-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin: 0 0 14px; padding: 12px 14px; background: #fafaf9; border: 1px solid var(--line); border-radius: 10px; }
.issue-meta dt { font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.issue-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.issue-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.issue-section { margin-top: 16px; }
.issue-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 8px; }
.adf { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.adf-p, .adf-quote { margin: 0 0 8px; white-space: pre-wrap; }
.adf-h { margin: 12px 0 6px; font-size: 15px; }
.adf-list { margin: 0 0 8px; padding-left: 22px; white-space: pre-wrap; }
.adf-code { background: #18181b; color: #f4f4f5; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; white-space: pre-wrap; }
.adf-quote { border-left: 3px solid var(--orange); background: var(--accent-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; }
.adf-hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.adf a { color: var(--accent); font-weight: 600; }
.adf-b { font-weight: 700; } .adf-i { font-style: italic; } .adf-s { text-decoration: line-through; }
.adf-c { font-family: ui-monospace, Consolas, monospace; background: #f4f4f5; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.issue-comment { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.issue-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.issue-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.issue-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Avisos: somem sozinhos, com barra de tempo e botão de fechar */
.toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 10px; padding-right: 34px; animation: toast-in .18s ease-out; }
.toast.leaving { animation: toast-out .2s ease-in forwards; }
.toast-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: rgba(255,255,255,.7); font-size: 18px; line-height: 1; cursor: pointer; }
.toast-x:hover, .toast-x:focus-visible { background: rgba(255,255,255,.12); color: #fff; }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255,255,255,.35); transform-origin: left; animation: toast-timer linear forwards; }
.toast:hover .toast-timer { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.leaving { animation: none; } .toast.leaving { opacity: 0; } }

/* Comentário interno no chamado */
.comment-form { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 12px; margin: 8px 0 14px; background: #fffaf5; }
.comment-form-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.comment-form textarea { width: 100%; resize: vertical; min-height: 72px; }
.comment-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.comment-form .field-error:empty { display: none; }
.comment-form .field-error { color: #b91c1c; font-size: 13px; margin-top: 6px; }
.issue-comment-new { animation: toast-in .25s ease-out; box-shadow: inset 3px 0 0 var(--orange); }
