/* DASHWOOT — visual sóbrio no estilo Apple: menu lateral, cartões, controles segmentados.
   Cores de dados e de status vêm de paletas validadas (dataviz): texto nunca usa a cor da série. */
:root {
  color-scheme: light;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --page: #f5f5f7;
  --sidebar: #efeff2;
  --sidebar-line: #dcdce1;
  --sb-hover: rgba(0, 0, 0, 0.045);
  --sb-active: rgba(0, 0, 0, 0.075);
  --sb-card: #ffffff;
  --card: #ffffff;
  --card-2: #f7f7f9;
  --card-line: rgba(0, 0, 0, 0.04);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --fill-strong: rgba(120, 120, 128, 0.36);
  --hover: rgba(0, 0, 0, 0.035);
  --seg-active: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #636366;
  --line: #e6e6eb;
  --line-strong: #d2d2d7;
  --accent: #0071e3;
  --accent-ink: #0066cc;
  --accent-strong: #0058b0;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --field-line: #8e8e93;
  --switch-off: #86868b;
  --primary-bg: #0071e3;
  --primary-ink: #ffffff;
  --series-1: #0071e3;
  --series-2: #e8710a;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --good-ink: #006300;
  --warning-ink: #8a5300;
  --bad-ink: #b42323;
  --focus: #0071e3;
  --login-glow: rgba(0, 113, 227, 0.13);
  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 10px rgba(0, 0, 0, 0.045);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
  --radius-card: 18px;
  --sb-width: 268px;
  font-family: var(--font-text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b0b0c;
    --sidebar: #121214;
    --sidebar-line: #232326;
    --sb-hover: rgba(255, 255, 255, 0.05);
    --sb-active: rgba(255, 255, 255, 0.09);
    --sb-card: #1a1a1d;
    --card: #161618;
    --card-2: #1d1d20;
    --card-line: rgba(255, 255, 255, 0.06);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.16);
    --fill-strong: rgba(120, 120, 128, 0.42);
    --hover: rgba(255, 255, 255, 0.035);
    --seg-active: #636366;
    --ink: #f5f5f7;
    --ink-2: #d1d1d6;
    --muted: #98989d;
    --line: #262629;
    --line-strong: #3a3a3d;
    --accent: #2f8cff;
    --accent-ink: #5aa6ff;
    --accent-strong: #5aa6ff;
    --field-line: #6e6e73;
    --switch-off: #6e6e73;
    --accent-soft: rgba(47, 140, 255, 0.16);
    --series-1: #2f8cff;
    --series-2: #de6a1a;
    --good-ink: #2dbf2d;
    --warning-ink: #fab219;
    --bad-ink: #ef7676;
    --focus: #5aa6ff;
    --login-glow: rgba(47, 140, 255, 0.2);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0b0c;
  --sidebar: #121214;
  --sidebar-line: #232326;
  --sb-hover: rgba(255, 255, 255, 0.05);
  --sb-active: rgba(255, 255, 255, 0.09);
  --sb-card: #1a1a1d;
  --card: #161618;
  --card-2: #1d1d20;
  --card-line: rgba(255, 255, 255, 0.06);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.16);
  --fill-strong: rgba(120, 120, 128, 0.42);
  --hover: rgba(255, 255, 255, 0.035);
  --seg-active: #636366;
  --ink: #f5f5f7;
  --ink-2: #d1d1d6;
  --muted: #98989d;
  --line: #262629;
  --line-strong: #3a3a3d;
  --accent: #2f8cff;
  --accent-ink: #5aa6ff;
  --accent-strong: #5aa6ff;
  --field-line: #6e6e73;
  --switch-off: #6e6e73;
  --accent-soft: rgba(47, 140, 255, 0.16);
  --series-1: #2f8cff;
  --series-2: #de6a1a;
  --good-ink: #2dbf2d;
  --warning-ink: #fab219;
  --bad-ink: #ef7676;
  --focus: #5aa6ff;
  --login-glow: rgba(47, 140, 255, 0.2);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.noscript {
  padding: 24px;
  text-align: center;
}

.muted {
  color: var(--muted);
}

.strong {
  font-weight: 600;
}

/* ---------- marca ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #3d8fff 0%, #0064d6 52%, #4a3fd4 100%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.28), 0 1px 2px rgba(0, 0, 0, 0.18);
}

.logo svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.16em;
}

/* ---------- ícones ---------- */
.icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon .solid {
  fill: currentColor;
  stroke: none;
}

/* ---------- botões e links ---------- */
.link {
  font: inherit;
  color: var(--accent-ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:disabled {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-ink);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-tinted {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.btn-danger {
  background: color-mix(in srgb, var(--critical) 12%, transparent);
  color: var(--bad-ink);
}

.btn-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
  transform: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: var(--fill-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--fill);
  color: var(--ink);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.link-btn {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.link-btn:hover {
  color: var(--accent-ink);
}

.ext {
  font-size: 11px;
}

/* ---------- campos ---------- */
.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.field input {
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid var(--field-line);
  border-radius: 11px;
  padding: 11px 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: 2px solid transparent;
  outline-offset: 1px;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-error {
  color: var(--bad-ink);
  font-size: 13px;
  min-height: 1.2em;
}

.form-error:empty {
  min-height: 0;
}

.select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
}

.select-box {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.select-box select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  height: 34px;
  max-width: min(42ch, 70vw);
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
  text-overflow: ellipsis;
  cursor: pointer;
}

.select-box select:hover {
  border-color: var(--line-strong);
}

.select-box .icon {
  position: absolute;
  right: 11px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  color: var(--muted);
  pointer-events: none;
}

select option {
  background: var(--card);
  color: var(--ink);
}

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--fill);
}

.segmented button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-pressed="true"] {
  background: var(--seg-active);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--muted), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: var(--switch-off);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.switch input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.switch input:checked {
  background: var(--accent);
}

.switch input:checked::before {
  transform: translateX(16px);
}

/* ---------- entrar (Chatwoot, código da rede) ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: radial-gradient(1100px 560px at 50% -12%, var(--login-glow), transparent 62%), var(--page);
}

.login-box {
  width: min(410px, 100%);
  display: grid;
  gap: 24px;
  padding: 32px 30px 26px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .btn {
  min-height: 44px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-help {
  color: var(--muted);
  margin-top: -8px;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.login-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wait-check {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

/* ---------- estrutura: menu lateral + conteúdo ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sb-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}

.sb-top {
  display: grid;
  gap: 12px;
  padding: 2px 6px 0;
}

.sb-account {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.sb-account-name {
  font-weight: 650;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.sb-account-host {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sb-top .select-box,
.sb-top .select-box select {
  width: 100%;
  max-width: 100%;
}

.sb-heading {
  padding: 0 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.sb-nav,
.sb-group {
  display: grid;
  gap: 1px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sb-item:hover {
  background: var(--sb-hover);
}

.sb-item[aria-current] {
  background: var(--sb-active);
  font-weight: 600;
}

.sb-item .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  color: var(--accent);
}

.sb-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding: 11px 12px;
  border-radius: 14px;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, #0a6ee6 0%, #0058c7 55%, #4338ca 100%);
  box-shadow: 0 8px 18px -8px rgba(0, 88, 199, 0.65), inset 0 0 0 0.5px rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sb-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -10px rgba(0, 88, 199, 0.75), inset 0 0 0 0.5px rgba(255, 255, 255, 0.22);
}

.sb-cta-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
}

.sb-cta-icon .icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.sb-cta-text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.sb-cta-text strong {
  font-size: 14px;
  font-weight: 650;
}

.sb-cta-text small {
  font-size: 12px;
  font-weight: 500;
}

.sb-cta > .icon {
  width: 15px;
  height: 15px;
}

/* acesso pela rede: separado e só do administrador de entrada */
.sb-admin {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-line);
}

.sb-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 6px;
}

.sb-admin-head .sb-heading {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sb-admin-head .sb-heading .icon {
  width: 13px;
  height: 13px;
}

.sb-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sb-admin-body {
  display: grid;
  gap: 8px;
}

.sb-admin .form-error {
  padding: 0 6px;
  font-size: 12px;
}

.sb-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sb-close {
  display: none;
}

.sb-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: var(--sb-card);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow-card);
}

.sb-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sb-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sb-note:empty {
  display: none;
}

.sb-warn {
  color: var(--bad-ink);
  font-size: 12px;
  line-height: 1.45;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lan-code {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  user-select: all;
}

.lan-value {
  color: var(--ink);
  font-weight: 600;
  user-select: all;
  overflow-wrap: anywhere;
}

.lan-fingerprint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  word-break: break-all;
  user-select: all;
}

.count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.count-alert {
  background: var(--critical);
  color: #ffffff;
}

.sb-requests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sb-req {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: var(--card-2);
}

.sb-req-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.sb-req-check {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sb-req-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sb-req-name {
  color: var(--ink);
  font-weight: 600;
}

.sb-req-actions {
  display: flex;
  gap: 6px;
}

.sb-req-actions .btn {
  flex: 1;
}

.sb-rows {
  display: grid;
  gap: 1px;
}

.sb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sb-row:hover {
  background: var(--sb-hover);
}

.sb-row:disabled {
  opacity: 0.45;
  cursor: default;
  background: none;
}

.sb-row .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  color: var(--muted);
}

.sb-row span:first-of-type {
  flex: 1;
}

.sb-row-danger,
.sb-row-danger .icon {
  color: var(--bad-ink);
}

.sb-details {
  padding: 0 4px;
}

.sb-details summary {
  cursor: pointer;
  padding: 4px 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}

.sb-details[open] summary {
  margin-bottom: 6px;
}

.sb-details .sb-note + .sb-note {
  margin-top: 6px;
}

.sb-bottom {
  margin-top: auto;
  display: grid;
  gap: 1px;
  padding-top: 12px;
  border-top: 1px solid var(--sidebar-line);
}

.sb-bottom .sb-item {
  font-size: 13.5px;
}

.sb-bottom .sb-item .icon {
  color: var(--muted);
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px 2px 8px;
  min-width: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #8e8e93, #5b5b60);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sb-user-text {
  display: grid;
  min-width: 0;
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-role {
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 30px clamp(16px, 3.2vw, 44px) 36px;
}

.main-inner {
  max-width: 1240px;
  margin: 0 auto;
  container-type: inline-size;
}

.mobilebar,
.scrim {
  display: none;
}

/* ---------- cabeçalho e filtros ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  scroll-margin-top: 24px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-top: 2px;
}

.page-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow-card);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status:empty {
  display: none;
}

.status .icon {
  width: 12px;
  height: 12px;
}

.status-good .icon {
  color: var(--good);
  animation: live-pulse 2.4s ease-in-out infinite;
}

.status-warning .icon {
  color: var(--warning);
}

.status-critical .icon {
  color: var(--critical);
}

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.updated {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 22px;
}

/* ---------- avisos ---------- */
.notices {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.notices:empty {
  display: none;
}

.notice,
.section-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}

.notice .icon,
.section-error .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--accent);
}

.notice-critical,
.section-error {
  border-color: color-mix(in srgb, var(--critical) 45%, var(--line));
}

.notice-critical .icon,
.section-error .icon {
  color: var(--critical);
}

.section-error {
  margin: 0 0 16px;
}

/* ---------- resumo executivo ---------- */
.summary {
  display: grid;
  gap: 16px;
  scroll-margin-top: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 158px;
  padding: 18px 20px 16px;
  transition: opacity 0.2s ease;
}

.metric.is-empty .metric-value {
  color: var(--muted);
}

.metric-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.metric-top span {
  min-width: 0;
}

.metric-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.metric-icon .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

.metric-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.metric-live .icon {
  width: 9px;
  height: 9px;
  color: var(--good);
  animation: live-pulse 2.4s ease-in-out infinite;
}

.metric-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spark {
  display: block;
  width: 46%;
  max-width: 150px;
  height: 42px;
  flex: none;
  overflow: visible;
}

.spark .spark-line {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark .spark-area {
  stroke: none;
}

.spark .spark-dot {
  fill: var(--series-1);
  stroke: var(--card);
  stroke-width: 2;
}

.stop-top {
  stop-color: var(--series-1);
  stop-opacity: 0.22;
}

.stop-bottom {
  stop-color: var(--series-1);
  stop-opacity: 0;
}

.metric-foot {
  display: grid;
  gap: 7px;
  margin-top: auto;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
}

.metric-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-width: 0;
}

.metric-text {
  min-width: 0;
}

.metric-foot strong {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.metric .meter {
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill-good {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good-ink);
}

.pill-bad {
  background: color-mix(in srgb, var(--critical) 13%, transparent);
  color: var(--bad-ink);
}

.pill-neutral {
  background: var(--fill);
  color: var(--ink-2);
}

.highlights {
  padding: 20px 22px 18px;
}

.highlights-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.highlights-head h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
}

.hl {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.45;
}

.hl strong {
  color: var(--ink);
  font-weight: 650;
}

.hl-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.hl-icon .icon {
  width: 15px;
  height: 15px;
}

.hl-warning .hl-icon {
  background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning-ink);
}

.hl-critical .hl-icon {
  background: color-mix(in srgb, var(--critical) 13%, transparent);
  color: var(--bad-ink);
}

.hl-good .hl-icon {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good-ink);
}

.hl-empty {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- seções ---------- */
.section {
  margin-top: 20px;
  padding: 24px 26px 6px;
  scroll-margin-top: 24px;
  transition: opacity 0.2s ease;
}

.section.is-loading .kpis,
.section.is-loading .block,
.section.is-loading .grid-2,
.section.is-loading .grid-live,
.loading-dim {
  opacity: 0.55;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 4px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.018em;
}

.section-sub {
  color: var(--muted);
  font-size: 13px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.kpi {
  min-width: 0;
  padding: 14px 16px 13px;
  border-radius: 13px;
  background: var(--card-2);
}

.kpi-label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.kpi-emph .kpi-label::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--series-1);
  margin-right: 7px;
  vertical-align: 1px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.kpi .meter {
  margin-top: 10px;
}

.kpi-delta {
  margin-top: 8px;
}

.delta-good {
  color: var(--good-ink);
}

.delta-bad {
  color: var(--bad-ink);
}

.delta-neutral {
  color: var(--muted);
}

.delta-inline {
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

.block {
  margin-bottom: 26px;
  min-width: 0;
}

.block h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}

.block-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 12px;
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.block-head h3 {
  margin-bottom: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 0 40px;
}

/* fila (6 colunas) e agentes: um embaixo do outro; lado a lado só com bastante largura */
.grid-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 40px;
}

@container (min-width: 1180px) {
  .grid-live {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

/* ---------- tabelas ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 -10px;
  padding: 0 10px;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.table th,
.table td {
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th:first-child,
.table td:first-child {
  padding-left: 10px;
}

.table th:last-child,
.table td:last-child {
  padding-right: 10px;
}

.table thead th {
  padding-top: 4px;
  padding-bottom: 9px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.table tbody th {
  text-align: left;
  font-weight: 600;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table tbody tr:hover > * {
  background: var(--hover);
}

.table tbody tr:hover > :first-child {
  border-radius: 9px 0 0 9px;
}

.table tbody tr:hover > :last-child {
  border-radius: 0 9px 9px 0;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-muted > * {
  color: var(--muted);
}

.row-selected > * {
  background: var(--accent-soft);
}

.empty {
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}

/* barra na célula: uma cor, ponta de dado arredondada */
.cellbar {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 118px;
}

.cellbar-track {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--fill-2);
}

.cellbar-fill {
  display: block;
  height: 100%;
  width: calc(var(--w, 0) * 1%);
  min-width: 3px;
  background: var(--series-1);
  border-radius: 3px;
}

/* ---------- status: ícone + rótulo, nunca só cor ---------- */
.chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip-good {
  background: color-mix(in srgb, var(--good) 12%, transparent);
}

.chip-warning {
  background: color-mix(in srgb, var(--warning) 17%, transparent);
}

.chip-critical {
  background: color-mix(in srgb, var(--critical) 12%, transparent);
}

.chip-good .icon {
  color: var(--good);
}

.chip-warning .icon {
  color: var(--warning-ink);
}

.chip-critical .icon {
  color: var(--critical);
}

.chip-neutral .icon {
  color: var(--muted);
}

/* ---------- medidor ---------- */
.meter {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--meter, var(--muted)) 20%, var(--card));
  overflow: hidden;
  min-width: 80px;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--w, 0) * 1%);
  background: var(--meter, var(--muted));
  border-radius: 3px;
}

.tone-good {
  --meter: var(--good);
}

.tone-warning {
  --meter: var(--warning);
}

.tone-critical {
  --meter: var(--critical);
}

.meter-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 4.5em;
  gap: 12px;
  align-items: center;
}

/* ---------- distribuição de notas (CSAT) ---------- */
.dist {
  display: grid;
  gap: 12px;
}

.dist-row {
  display: grid;
  grid-template-columns: 4.5em minmax(60px, 1fr) 8em;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.dist-label {
  color: var(--muted);
}

.dist-track {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--fill-2);
}

.dist-fill {
  display: block;
  height: 100%;
  width: calc(var(--w, 0) * 1%);
  min-width: 3px;
  background: var(--series-1);
  border-radius: 4px;
}

.dist-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- NPS (planilha da pesquisa) ---------- */
.nps-value.tone-good {
  color: var(--good-ink);
}

.nps-value.tone-warning {
  color: var(--warning-ink);
}

.nps-value.tone-critical {
  color: var(--bad-ink);
}

/* Notas de 0 a 10: promotores verdes, neutros cinza, detratores vermelhos. */
.dist-row.nps-good .dist-fill {
  background: var(--good);
}

.dist-row.nps-neutral .dist-fill {
  background: var(--muted);
}

.dist-row.nps-critical .dist-fill {
  background: var(--critical);
}

.nps-mix {
  display: grid;
  gap: 12px;
}

.nps-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--fill-2);
}

.nps-part {
  width: calc(var(--w, 0) * 1%);
  min-width: 3px;
}

.nps-part.tone-good,
.nps-dot.tone-good {
  background: var(--good);
}

.nps-part.tone-neutral,
.nps-dot.tone-neutral {
  background: var(--muted);
}

.nps-part.tone-critical,
.nps-dot.tone-critical {
  background: var(--critical);
}

.nps-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.nps-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nps-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.nps-days {
  max-height: 360px;
  overflow: auto;
}

.nps-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented-small button {
  padding: 4px 12px;
}

.nps-comments {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nps-comments li {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill-2);
}

.nps-comments p {
  margin: 0;
}

.nps-comment {
  overflow-wrap: anywhere;
}

.nps-score {
  display: grid;
  place-items: center;
  height: 2.2em;
  border-radius: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  background: var(--muted);
}

.nps-score.tone-good {
  background: var(--good);
}

.nps-score.tone-critical {
  background: var(--critical);
}

/* Notas de um agente, cada uma com a conversa avaliada (tabela "Por agente" da satisfação). */
.rating-toggle {
  color: inherit;
  font-weight: 600;
  text-align: left;
}

.rating-row td {
  background: var(--fill-2);
}

.ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
}

.rating .nps-score {
  width: 1.9em;
  height: 1.9em;
}

/* ---------- gráfico ---------- */
.legend {
  display: flex;
  gap: 18px;
  margin: 8px 0 10px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.key {
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}

.key.s1 {
  background: var(--series-1);
}

.key.s2 {
  background: var(--series-2);
}

.chart {
  position: relative;
  width: 100%;
  min-height: 250px;
}

.chart svg {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.chart .gridline {
  stroke: var(--line);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart .baseline {
  stroke: var(--line-strong);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart .tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart .line {
  fill: none;
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .line.s1 {
  stroke: var(--series-1);
}

.chart .line.s2 {
  stroke: var(--series-2);
}

.chart .area {
  stroke: none;
}

.chart .dot {
  stroke: var(--card);
  stroke-width: 2;
}

.chart .dot.s1 {
  fill: var(--series-1);
}

.chart .dot.s2 {
  fill: var(--series-2);
}

.chart .end-label {
  fill: var(--ink-2);
  font-size: 12px;
}

.chart .end-value {
  fill: var(--ink);
  font-weight: 650;
}

.chart .crosshair {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart .hit {
  fill: transparent;
  cursor: crosshair;
}

.tooltip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  padding: 9px 12px;
  font-size: 12px;
  min-width: 160px;
  z-index: 5;
}

.tooltip-title {
  color: var(--muted);
  margin-bottom: 4px;
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tooltip-row strong {
  font-variant-numeric: tabular-nums;
  min-width: 2.5em;
}

/* ---------- janelas (diagnóstico, acesso ADM) ---------- */
.dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  border: 0;
  border-radius: 20px;
  padding: 24px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(3px);
}

.dialog-sm {
  width: min(400px, calc(100vw - 32px));
  padding: 26px 24px 22px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.dialog-head h2,
.dialog-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dialog-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin: 6px 0 16px;
}

.dialog-form {
  display: grid;
  gap: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.dialog-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}

.dialog-icon .icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.diag-list {
  display: grid;
  gap: 2px;
  margin-bottom: 20px;
}

.diag-row {
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.diag-detail {
  color: var(--muted);
  font-size: 12px;
}

.footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 30px 8px 6px;
}

/* ---------- painel de entrada (/entrada) ---------- */
.bar {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.lan-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.lan-note:empty {
  display: none;
}

.entrada {
  padding-top: 28px;
  padding-bottom: 48px;
}

.entrada-section {
  margin-top: 18px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.entrada-section h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.entrada-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.entrada-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.entrada-who {
  min-width: 0;
  flex: 1 1 240px;
  overflow-wrap: anywhere;
}

.entrada-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.entrada-meta {
  color: var(--muted);
  font-size: 13px;
}

.entrada-check {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.entrada-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.entrada-empty {
  padding: 12px 0;
  color: var(--muted);
}

.entrada-form {
  display: grid;
  gap: 12px;
  max-width: 380px;
  margin-top: 14px;
}

.entrada-form + .lan-note {
  margin-top: 16px;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* ---------- telas menores: o menu vira gaveta ---------- */
@container (max-width: 900px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (max-width: 760px) {
  .hl-list {
    grid-template-columns: 1fr;
  }
}

@container (max-width: 520px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    box-shadow: var(--shadow-pop);
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .shell.menu-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(0, 0, 0, 0.36);
  }

  .shell.menu-open .scrim {
    display: block;
  }

  .sb-close {
    display: inline-grid;
  }

  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 16px;
    background: color-mix(in srgb, var(--page) 84%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--line);
  }

  .mobilebar .brand {
    flex: 1;
  }

  .main {
    padding-top: 22px;
  }

  html {
    scroll-padding-top: 64px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px 16px 28px;
  }

  .bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-title {
    font-size: 27px;
  }

  .section {
    padding: 18px 16px 4px;
    border-radius: 16px;
  }

  .metric-value {
    font-size: 30px;
  }

  .kpi-value {
    font-size: 25px;
  }

  .segmented button {
    padding: 6px 10px;
  }

  .diag-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .login-box {
    padding: 26px 20px 22px;
  }

  .entrada-section {
    padding: 18px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .cellbar-fill,
  .dist-fill,
  .meter-fill {
    background: CanvasText;
  }

  .meter,
  .chip,
  .pill,
  .card,
  .kpi {
    border: 1px solid CanvasText;
  }

  /* estado da chave, período escolhido, seção atual e cores da legenda continuam visíveis */
  .switch input {
    border: 1px solid CanvasText;
  }

  .switch input::before {
    background: ButtonText;
  }

  .switch input:checked {
    background: Highlight;
    border-color: Highlight;
  }

  .switch input:checked::before {
    background: HighlightText;
  }

  .segmented button[aria-pressed="true"],
  .sb-item[aria-current] {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }

  .key,
  .chart .line,
  .chart .dot {
    forced-color-adjust: none;
  }
}

@media print {
  .sidebar,
  .mobilebar,
  .scrim,
  .toolbar,
  .topbar-actions {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .card {
    box-shadow: none;
    border-color: #cccccc;
  }
}

/* ---------- relatórios (/relatorios) ---------- */
.rel-page {
  min-height: 100vh;
}

.rel-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, calc((100vw - 980px) / 2));
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.rel-top .icon-btn {
  justify-self: end;
}

.rel-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  color: var(--accent-ink);
  font-size: 15px;
  text-decoration: none;
}

.rel-back:hover {
  text-decoration: underline;
}

.rel-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rel-main .page-head {
  margin-bottom: 0;
}

.rel-lead {
  max-width: 62ch;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
}

.rel-form {
  padding: 8px 24px 24px;
}

.rel-step {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.rel-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rel-step-n {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.rel-quick {
  flex-wrap: wrap;
}

.rel-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.rel-when {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.rel-when legend {
  float: left;
  min-width: 2.4em;
  margin-right: 4px;
  font-weight: 600;
  color: var(--ink-2);
}

.rel-input input,
.rel-search,
.rel-link {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid var(--field-line);
  border-radius: 10px;
  padding: 8px 11px;
  min-height: 40px;
}

.rel-input input:focus,
.rel-search:focus,
.rel-link:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.rel-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.rel-hint.is-error {
  color: var(--bad-ink);
}

.rel-teams-box {
  width: 100%;
}

.rel-teams-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.rel-search {
  flex: 1 1 220px;
  max-width: 340px;
}

.rel-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.rel-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  cursor: pointer;
  font-size: 14px;
}

.rel-team[hidden] {
  display: none;
}

.rel-team:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.rel-team input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.rel-step .switch small,
.rel-title-field small {
  color: var(--muted);
  font-weight: 400;
}

.rel-title-field {
  width: min(100%, 440px);
}

.rel-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding-top: 20px;
}

.rel-generate {
  min-height: 46px;
  padding: 0 28px;
  font-size: 16px;
}

.rel-progress,
.rel-result,
.rel-history {
  padding: 22px 24px;
}

.rel-card-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 2px 0 6px;
}

.rel-progress progress {
  width: 100%;
  height: 10px;
  margin: 10px 0 8px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--fill);
  accent-color: var(--accent);
}

.rel-progress progress::-webkit-progress-bar {
  background: var(--fill);
}

.rel-progress progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.rel-progress progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.rel-outputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.rel-output {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
}

.rel-output h3 {
  font-size: 17px;
  font-weight: 700;
}

.rel-output-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.rel-output-icon .icon {
  width: 22px;
  height: 22px;
}

.rel-output .rel-hint {
  flex: 1;
}

.rel-output-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 4px;
}

.rel-link {
  width: 100%;
  font-size: 12.5px;
  font-family: var(--font-mono);
}

.rel-danger {
  color: var(--bad-ink);
}

.rel-empty {
  color: var(--muted);
  padding: 8px 0 4px;
}

.rel-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.rel-nowrap {
  white-space: nowrap;
}

.rel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.rel-table td {
  vertical-align: top;
}

.rel-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  max-width: min(92vw, 520px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--page);
  font-size: 14px;
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.rel-toast.is-gone {
  opacity: 0;
  transform: translate(-50%, 8px);
}

@media (max-width: 640px) {
  .rel-form,
  .rel-progress,
  .rel-result,
  .rel-history {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rel-top {
    grid-template-columns: auto 1fr auto;
  }

  .rel-top .brand {
    justify-self: center;
  }
}

/* Celular estreito: a hora desce para baixo da data quando as duas não cabem lado a lado (relatórios e
   atividades), em vez de passar do cartão e a página rolar para o lado. */
@media (max-width: 380px) {
  .rel-when {
    flex-wrap: wrap;
  }
}

/* Relatórios trancados pela senha. */
.rel-lock {
  max-width: 460px;
  padding: 28px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.rel-lock-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.rel-lock-icon .icon {
  width: 22px;
  height: 22px;
}

.rel-lock-field {
  width: 100%;
  margin-top: 6px;
}

.rel-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rel-content[hidden] {
  display: none;
}

.rel-lock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 4px;
}

.rel-main .page-head .rel-change-open {
  align-self: flex-end;
  font-size: 14px;
}

/* ---------- registro de atividades (/atividades) ---------- */
/* A mesma página dos relatórios (rel-page, rel-top, rel-main), um pouco mais larga por causa da tabela. */
.atv-top {
  padding-left: max(16px, calc((100vw - 1160px) / 2));
  padding-right: max(16px, calc((100vw - 1160px) / 2));
}

.atv-main {
  max-width: 1160px;
}

/* Cor de cada tipo: só identifica (o nome do tipo está sempre escrito ao lado). Paleta categórica validada,
   na ordem fixa dos tipos; no escuro, os mesmos tons ajustados para o fundo escuro. */
.atv-page {
  --atv-entrada: #2a78d6;
  --atv-relatorios: #eb6834;
  --atv-tv: #1baf7a;
  --atv-metas: #eda100;
  --atv-rede: #e87ba4;
  --atv-atividades: #008300;
  --atv-sistema: #4a3aa7;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .atv-page {
    --atv-entrada: #3987e5;
    --atv-relatorios: #d95926;
    --atv-tv: #199e70;
    --atv-metas: #c98500;
    --atv-rede: #d55181;
    --atv-atividades: #008300;
    --atv-sistema: #9085e9;
  }
}

:root[data-theme="dark"] .atv-page {
  --atv-entrada: #3987e5;
  --atv-relatorios: #d95926;
  --atv-tv: #199e70;
  --atv-metas: #c98500;
  --atv-rede: #d55181;
  --atv-atividades: #008300;
  --atv-sistema: #9085e9;
}

.atv-cat-entrada {
  --atv-cat: var(--atv-entrada);
}

.atv-cat-relatorios {
  --atv-cat: var(--atv-relatorios);
}

.atv-cat-tv {
  --atv-cat: var(--atv-tv);
}

.atv-cat-metas {
  --atv-cat: var(--atv-metas);
}

.atv-cat-rede {
  --atv-cat: var(--atv-rede);
}

.atv-cat-atividades {
  --atv-cat: var(--atv-atividades);
}

.atv-cat-sistema {
  --atv-cat: var(--atv-sistema);
}

/* menu do painel: o cadeado pequeno ao lado de "Atividades" */
.sb-item .atv-sb-lock {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--muted);
}

/* cabeçalho: onde fica guardado; trocar a senha e trancar */
.atv-storage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.atv-storage .icon {
  width: 13px;
  height: 13px;
}

.atv-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.atv-head-actions .link {
  font-size: 14px;
}

/* senha: o aviso de que não pode ser a das metas e como recuperar */
.atv-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--fill-2);
  background: color-mix(in srgb, var(--warning) 15%, transparent);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.atv-warn .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--warning-ink);
}

.atv-recover {
  width: 100%;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.atv-recover code,
.atv-code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--fill-2);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* filtros */
.atv-filters {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 24px 20px;
}

.atv-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  max-width: 100%;
}

.atv-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.atv-quick {
  flex-wrap: wrap;
}

.atv-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.atv-search-box {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.atv-search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  color: var(--muted);
  pointer-events: none;
}

.atv-search {
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  width: 250px;
  max-width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--card);
}

.atv-search::placeholder {
  color: var(--muted);
}

.atv-search:focus {
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* lista */
.atv-list-card {
  padding: 20px 24px 18px;
}

.atv-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 6px;
}

.atv-list-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.018em;
}

/* Recebe o foco ao abrir (leitor de tela), mas não é um controle: sem moldura. */
.atv-list-title:focus {
  outline: none;
}

.atv-count {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.atv-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.atv-list-actions .is-busy .icon {
  animation: atv-spin 0.9s linear infinite;
}

@keyframes atv-spin {
  to {
    transform: rotate(360deg);
  }
}

.atv-list {
  transition: opacity 0.2s ease;
}

.atv-list[aria-busy="true"] {
  opacity: 0.55;
}

.atv-loading {
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
}

.atv-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 12px 26px;
  text-align: center;
}

.atv-empty-title {
  font-size: 15px;
  font-weight: 650;
}

.atv-empty .btn {
  margin-top: 8px;
}

.atv-more-box {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.atv-more-box:has(> [hidden]) {
  padding-top: 0;
}

/* gravadas depois da 1ª página: "N atividades novas — Atualizar" (vazio, não ocupa espaço) */
.atv-newer {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.atv-newer:not(:empty) {
  padding-top: 12px;
}

/* tabela: hora, tipo, atividade, quem e origem; um grupo por dia */
.atv-table {
  table-layout: fixed;
}

.atv-col-time {
  width: 92px;
}

.atv-col-type {
  width: 206px;
}

.atv-col-who {
  width: 21%;
}

.atv-col-from {
  width: 21%;
}

.atv-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.atv-table .atv-day th {
  padding: 20px 10px 8px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
}

.atv-table tbody:first-of-type .atv-day th {
  padding-top: 6px;
}

.atv-table .atv-day:hover > * {
  background: none;
}

.atv-row {
  cursor: pointer;
}

.atv-table .atv-row:focus-within > * {
  background: var(--hover);
}

.atv-row.is-fail > :first-child {
  box-shadow: inset 3px 0 0 var(--critical);
}

.atv-time {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.atv-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 6px;
}

.atv-tag,
.atv-fail,
.atv-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.atv-tag {
  background: var(--fill-2);
  color: var(--ink);
}

.atv-tag::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--atv-cat, var(--muted));
}

.atv-fail {
  gap: 4px;
  padding-left: 6px;
  background: var(--fill-2);
  background: color-mix(in srgb, var(--critical) 13%, transparent);
  color: var(--bad-ink);
  font-weight: 650;
}

.atv-ok {
  gap: 4px;
  padding-left: 6px;
  background: var(--fill-2);
  background: color-mix(in srgb, var(--good) 13%, transparent);
  color: var(--good-ink);
  font-weight: 650;
}

.atv-fail .icon,
.atv-ok .icon {
  width: 13px;
  height: 13px;
}

.atv-open {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.atv-row:hover .atv-open {
  color: var(--accent-ink);
}

.atv-line {
  display: block;
}

.atv-detail,
.atv-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.atv-none {
  color: var(--muted);
}

/* detalhe de uma atividade */
.atv-dialog {
  width: min(620px, calc(100vw - 32px));
}

.atv-dialog .dialog-head h2 {
  overflow-wrap: anywhere;
}

.atv-fields {
  display: grid;
  grid-template-columns: minmax(9.5em, auto) minmax(0, 1fr);
  margin: 0;
  font-size: 13.5px;
}

.atv-fields dt,
.atv-fields dd {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.atv-fields dt {
  padding-right: 16px;
  color: var(--muted);
  font-weight: 500;
}

.atv-fields dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.atv-fields > :nth-last-child(-n + 2) {
  border-bottom: 0;
}

/* Até 1100 px: Tipo, Quem e Origem mais estreitos, para sobrar espaço para a Atividade (a etiqueta mais longa
   ainda cabe; a de falha desce para baixo dela). */
@media (max-width: 1100px) {
  .atv-col-type {
    width: 176px;
  }

  .atv-col-who,
  .atv-col-from {
    width: 19%;
  }
}

/* Até 900 px: cada atividade vira um bloco empilhado (hora e tipo; o que foi; quem; de onde), sem rolagem lateral.
   Mais largo que isso, a tabela de 5 colunas deixaria a Atividade com poucas letras por linha. */
@media (max-width: 900px) {
  .atv-table,
  .atv-table tbody,
  .atv-table tr,
  .atv-table th,
  .atv-table td {
    display: block;
  }

  .atv-table thead,
  .atv-table colgroup {
    display: none;
  }

  .atv-table .atv-day th {
    padding: 18px 2px 6px;
  }

  .atv-table .atv-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
  }

  .atv-table .atv-row > td {
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
  }

  /* destaque (mouse ou foco) na linha inteira, e não em cada pedaço dela */
  .atv-table .atv-row:hover,
  .atv-table .atv-row:focus-within {
    background: var(--hover);
  }

  .atv-table .atv-row:hover > td,
  .atv-table .atv-row:focus-within > td {
    background: none;
  }

  .atv-row .atv-type {
    flex: 1 1 0;
  }

  .atv-row .atv-what,
  .atv-row .atv-who,
  .atv-row .atv-from {
    flex: 1 1 100%;
  }

  .atv-row .atv-who,
  .atv-row .atv-from {
    color: var(--muted);
    font-size: 12.5px;
  }

  .atv-row .atv-line,
  .atv-row .atv-sub {
    display: inline;
    margin: 0;
    font-size: inherit;
  }

  .atv-row .atv-line + .atv-line::before {
    content: " · ";
  }

  /* sem IP nem aparelho: empilhada, a linha some (o detalhe mostra "—") */
  .atv-row .atv-from:has(> .atv-none) {
    display: none;
  }

  .atv-row.is-fail {
    padding-left: 10px;
    box-shadow: inset 3px 0 0 var(--critical);
  }

  .atv-row.is-fail > :first-child {
    box-shadow: none;
  }
}

/* Até 640 px: filtros um embaixo do outro e o detalhe numa coluna só. */
@media (max-width: 640px) {
  .atv-filters,
  .atv-list-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* período: 3 por linha (no mais estreito, 2), todos do mesmo tamanho */
  .atv-period {
    display: grid;
    width: 100%;
  }

  .atv-quick {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .atv-quick button {
    padding-left: 4px;
    padding-right: 4px;
  }

  .atv-filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .atv-filter-row .select {
    display: grid;
    grid-template-columns: 4.2em minmax(0, 1fr);
  }

  .atv-filter-row .select-box,
  .atv-filter-row .select-box select,
  .atv-search-box,
  .atv-search {
    width: 100%;
    max-width: 100%;
  }

  .atv-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .atv-fields dt {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .atv-fields dd {
    padding-top: 2px;
  }
}

@media (max-width: 360px) {
  .atv-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (forced-colors: active) {
  .atv-tag::before {
    background: CanvasText;
  }

  .atv-tag,
  .atv-fail,
  .atv-ok,
  .atv-warn {
    border: 1px solid CanvasText;
  }
}

@media print {
  .atv-top,
  .atv-head-actions,
  .atv-filters,
  .atv-list-actions,
  .atv-more-box,
  .atv-newer {
    display: none !important;
  }
}
