:root {
  --sky: #0ea5e9;
  --sky-dark: #0284c7;
  --sky-light: #e0f2fe;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f7f9fc;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #d97706;
  --amber-bg: #fef3c7;
}
/* ---- Minimalist Segmented Toggle (ex: Sim / Não) ---- */
.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 320px;
  transition: all 0.15s ease;
}
.segmented-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  touch-action: manipulation;
}
.segmented-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}
.segmented-btn.is-active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.segmented-btn svg {
  flex-shrink: 0;
}
[data-theme="dark"] .segmented-control {
  background: #0f172a;
  border-color: #334155;
}
[data-theme="dark"] .segmented-btn {
  color: #94a3b8;
}
[data-theme="dark"] .segmented-btn.is-active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---- Modern Minimalist Location Picker ---- */
.location-picker {
  position: relative;
  margin-top: .35rem;
}
.location-picker.is-open {
  z-index: 60;
}
.location-picker-trigger {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.location-picker-trigger:hover {
  border-color: #cbd5e1;
  background: #fafafa;
}
.location-picker.is-open .location-picker-trigger,
.location-picker-trigger:focus-visible {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
  background: #ffffff;
}
.location-picker-value {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
}
.location-picker-placeholder {
  color: #94a3b8;
}
.location-picker-chevron {
  display: flex;
  align-items: center;
  color: #94a3b8;
  transition: transform .2s ease, color .15s ease;
}
.location-picker.is-open .location-picker-chevron {
  transform: rotate(180deg);
  color: #0284c7;
}
.location-picker-menu {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 290px;
  overflow-y: auto;
  padding: .45rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(0,0,0,0.04);
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.location-picker-menu::-webkit-scrollbar {
  width: 6px;
}
.location-picker-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
.location-picker-group-label {
  padding: .6rem .75rem .25rem;
  color: #64748b;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.location-picker-group-label::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0ea5e9;
  opacity: 0.7;
}
.location-picker-option {
  width: 100%;
  display: block;
  padding: .65rem .85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1e293b;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
  margin-bottom: 2px;
}
.location-picker-option:last-child {
  margin-bottom: 0;
}
.location-picker-option:hover {
  background: #f8fafc;
  color: #0284c7;
}
.location-picker-option.is-selected {
  background: #f0f9ff;
  color: #0284c7;
  font-weight: 700;
}
[data-theme="dark"] .location-picker-trigger {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
[data-theme="dark"] .location-picker-menu {
  background: #0f172a;
  border-color: #334155;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .location-picker-group-label {
  color: #94a3b8;
}
[data-theme="dark"] .location-picker-option {
  color: #e2e8f0;
}
[data-theme="dark"] .location-picker-option:hover {
  background: #1e293b;
  color: #38bdf8;
}
[data-theme="dark"] .location-picker-option.is-selected {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
}
.card:has(.location-picker.is-open),
.card:has(.address-search.is-open),
.card:has(.address-search:focus-within),
.card:has(.client-autocomplete-wrapper.is-open),
.card:has(.client-autocomplete-wrapper:focus-within),
.card.is-dropdown-open {
  position: relative;
  z-index: 1000 !important;
}
.address-search {
  position: relative;
  margin-top: .35rem;
  z-index: 60;
}
.address-search.is-open,
.address-search:focus-within {
  z-index: 1001 !important;
}
.address-search-suggestions {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  right: 0;
  z-index: 1002 !important;
  max-height: 320px;
  overflow-y: auto;
  padding: .45rem;
  border: 1px solid rgba(14,165,233,.28);
  border-radius: 1rem;
  background: rgba(255,255,255,.99);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(15,23,42,.22), 0 4px 12px rgba(0,0,0,.08);
}
.address-search-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 0;
  border-radius: .7rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all .15s ease;
  margin-bottom: .25rem;
}
.address-search-item:last-child {
  margin-bottom: 0;
}
.address-search-item:hover,
.address-search-item.is-active {
  background: var(--sky-light);
}
.address-search-item.is-history-item:hover,
.address-search-item.is-history-item.is-active {
  background: #f0f9ff;
  border-left: 3px solid #0ea5e9;
}
.address-search-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .1rem;
}
.address-search-icon-wrap.is-hist {
  background: #e0f2fe;
  color: #0284c7;
}
.address-search-text {
  flex: 1;
  min-width: 0;
}
.address-search-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.address-search-title {
  font-size: .88rem;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
}
.address-search-subtitle {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .15rem;
  line-height: 1.35;
}
.addr-badge {
  font-size: .68rem;
  font-weight: 800;
  padding: .15rem .5rem;
  border-radius: 99px;
  letter-spacing: .02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.addr-badge-hist {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}
.addr-badge-osm {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.address-search-empty {
  padding: .75rem .9rem;
  color: var(--muted);
  font-size: .84rem;
  text-align: center;
}

/* ---- Card do Histórico das Últimas 3 Visitas ---- */
.historico-visitas-wrap {
  margin-top: .85rem;
}
.historico-visitas-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.08);
  animation: fadeInVisitas .25s ease;
}
@keyframes fadeInVisitas {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.historico-visitas-card.is-loading {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .84rem;
}
.historico-visitas-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spinVisita .7s linear infinite;
}
@keyframes spinVisita {
  to { transform: rotate(360deg); }
}
.historico-visitas-empty {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
}
.historico-visitas-empty-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.historico-visitas-empty-text {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .82rem;
}
.historico-visitas-empty-text strong {
  color: var(--ink);
  font-size: .85rem;
}
.historico-visitas-empty-text span {
  color: var(--muted);
}
.historico-visitas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid #f1f5f9;
}
.historico-visitas-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: .88rem;
  color: #0369a1;
}
.historico-visitas-badge-count {
  font-size: .72rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0284c7;
  padding: .2rem .6rem;
  border-radius: 99px;
}
.historico-visitas-timeline {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.historico-visita-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .75rem .9rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.historico-visita-item.is-latest {
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
}
.historico-visita-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .45rem;
}
.historico-visita-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
}
.hv-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
  background: #f8fafc;
  padding: .15rem .5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.historico-visita-item.is-latest .hv-tech-badge {
  background: #ffffff;
  border-color: #bae6fd;
}
.hv-date {
  font-size: .78rem;
  color: var(--muted);
}
.hv-latest-tag {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #0284c7;
  color: #ffffff;
  padding: .1rem .45rem;
  border-radius: 99px;
  letter-spacing: .03em;
}
.hv-status-pill {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 99px;
}
.status-pill-resolved {
  background: #dcfce7;
  color: #16a34a;
}
.status-pill-pending {
  background: #fef3c7;
  color: #b45309;
}
.hv-address-tag {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .45rem;
}
.hv-detail-row {
  margin-top: .45rem;
  font-size: .78rem;
}
.hv-label {
  font-weight: 700;
  color: var(--ink);
  margin-right: .3rem;
}
.hv-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .25rem;
}
.hv-chip {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .74rem;
  font-weight: 600;
}
.hv-chip-equip {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.historico-visita-item.is-latest .hv-chip-equip {
  background: #ffffff;
  border-color: #bae6fd;
  color: #0369a1;
}
.hv-ocorrencias-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .25rem;
}
.hv-oc-item {
  font-size: .76rem;
  color: var(--ink);
  background: #f8fafc;
  padding: .35rem .6rem;
  border-radius: 6px;
  border-left: 3px solid #cbd5e1;
}
.hv-oc-item.is-alta {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}
.hv-oc-tag-done {
  font-size: .68rem;
  font-weight: 700;
  color: #16a34a;
  margin-left: .35rem;
}
.hv-oc-tag-open {
  font-size: .68rem;
  font-weight: 700;
  color: #dc2626;
  margin-left: .35rem;
}
.hv-obs-text {
  margin: .2rem 0 0;
  font-size: .76rem;
  font-style: italic;
  color: var(--muted);
}

[data-theme="dark"] .address-search-suggestions {
  background: rgba(15,23,42,.98);
  border-color: rgba(14,165,233,.3);
}
[data-theme="dark"] .address-search-item {
  color: #e2e8f0;
}
[data-theme="dark"] .address-search-item:hover,
[data-theme="dark"] .address-search-item.is-active {
  background: rgba(14,165,233,.16);
  color: #7dd3fc;
}
[data-theme="dark"] .address-search-item.is-history-item:hover,
[data-theme="dark"] .address-search-item.is-history-item.is-active {
  background: rgba(14,165,233,.22);
  border-left-color: #38bdf8;
}
[data-theme="dark"] .address-search-icon-wrap {
  background: #1e293b;
  color: #94a3b8;
}
[data-theme="dark"] .address-search-icon-wrap.is-hist {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}
[data-theme="dark"] .address-search-title {
  color: #f8fafc;
}
[data-theme="dark"] .addr-badge-osm {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
[data-theme="dark"] .historico-visitas-card {
  background: #162032;
  border-color: rgba(14, 165, 233, 0.35);
}
[data-theme="dark"] .historico-visitas-empty {
  background: #0f172a;
  border-color: #1e293b;
}
[data-theme="dark"] .historico-visitas-empty-icon {
  background: #1e293b;
  color: #94a3b8;
}
[data-theme="dark"] .historico-visitas-empty-text strong {
  color: #f8fafc;
}
[data-theme="dark"] .historico-visitas-title {
  color: #38bdf8;
}
[data-theme="dark"] .historico-visita-item {
  background: #0f172a;
  border-color: #1e293b;
}
[data-theme="dark"] .historico-visita-item.is-latest {
  border-color: #0284c7;
  background: rgba(14, 165, 233, 0.08);
}
[data-theme="dark"] .hv-tech-badge {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}
[data-theme="dark"] .hv-chip-equip {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}
[data-theme="dark"] .hv-oc-item {
  background: #1e293b;
  color: #f8fafc;
}
* {
  box-sizing: border-box;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    Arial,
    sans-serif;
}
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.security-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.85) 0%, rgba(254, 243, 199, 0.45) 100%);
  backdrop-filter: blur(28px) saturate(200%) contrast(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(200%) contrast(1.05);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.85), inset 0 -1px 1px rgba(217, 119, 6, 0.1);
  font-size: 0.85rem;
}
.security-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(217, 119, 6, 0.15);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: security-banner-pulse 2.2s ease-in-out infinite;
}
@keyframes security-banner-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
}
.security-banner-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.security-banner-text strong {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}
.security-banner-text span {
  color: var(--amber);
  font-weight: 500;
  font-size: 0.8rem;
}
.security-banner-action {
  background: var(--amber);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: 0.15s ease;
  flex-shrink: 0;
}
.security-banner-action:hover {
  background: #b45309;
}
@media (max-width: 640px) {
  .security-banner {
    flex-wrap: wrap;
    border-radius: 20px;
  }
}

header {
  background: transparent;
  color: var(--ink);
  padding: 1rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 30;
}
/* ---- Liquid glass: recipe partilhada por pílulas do topo, dropdowns e o aviso de senha.
   Um fundo translúcido plano com blur lê-se só como "transparente" — o que dá o ar de
   vidro é o gradiente diagonal (zona mais clara em cima, simula reflexo) + saturate/
   contrast a realçar o que está por trás + o brilho fino interior no topo ---- */
.liquid-glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.46) 100%);
  backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
  -webkit-backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.95), inset 0 -1px 1px rgba(255, 255, 255, 0.2);
}
.topbar-pill {
  display: flex;
  align-items: center;
  border-radius: 999px;
}
.topbar-pill-brand {
  padding: 0.5rem 1.1rem;
}
.topbar-pill-nav {
  padding: 0.4rem 0.5rem;
}
.topbar-pill-profile {
  gap: 0.4rem;
  padding: 0.4rem 0.5rem 0.4rem 0.4rem;
  justify-content: flex-end;
  margin-left: auto;
}
header h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
}
header h1 .brand-accent {
  color: var(--sky);
}
header h1 small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
nav {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}
nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: 0.15s ease;
}
nav a:hover {
  color: var(--sky-dark);
  background: rgba(14, 165, 233, 0.12);
}
nav a.active {
  color: var(--sky-dark);
  background: rgba(14, 165, 233, 0.16);
}

.icon {
  flex-shrink: 0;
  vertical-align: middle;
}

.profile-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: none;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s ease;
}
.profile-trigger:hover,
.profile-trigger.is-open {
  background: rgba(14, 165, 233, 0.1);
}
.profile-greeting {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.profile-trigger-caret {
  display: flex;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.profile-trigger.is-open .profile-trigger-caret {
  transform: rotate(180deg);
}
.notification-bell {
  display: flex;
  align-items: center;
}
/* ancorado à pílula inteira (não só ao botão do sino) — assim alinha sempre com o
   canto direito do cabeçalho, em vez de "saltar" para a posição do sino dentro da
   pílula, que varia conforme o que mais está nela (saudação, avatar, etc.) */
.topbar-pill-profile {
  position: relative;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 2rem);
  border-radius: 20px;
  z-index: 40;
}
.notification-panel.liquid-glass {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 -1px 1px rgba(255, 255, 255, 0.15);
}
/* o scroll fica isolado num wrapper interno, separado do elemento com backdrop-filter —
   overflow-y:auto e backdrop-filter no MESMO elemento é um bug conhecido em browsers
   Chromium que faz o vidro líquido não renderizar (fica opaco) */
.notification-panel-scroll {
  max-height: 420px;
  overflow-y: auto;
  border-radius: 20px;
}
.notification-panel-header {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.notification-panel-list {
  display: flex;
  flex-direction: column;
}
.notification-panel-empty {
  padding: 1.25rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: 0.15s ease;
}
.notification-item:last-child {
  border-bottom: none;
}
.notification-item:hover {
  background: var(--sky-light);
}
.notification-item .icon {
  color: var(--sky);
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.notification-item-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.notification-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.notification-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 320px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.7) 100%);
  backdrop-filter: blur(28px) saturate(180%) contrast(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(180%) contrast(1.08);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  padding: 0.9rem 1rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  cursor: pointer;
  z-index: 200;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.25s ease;
}
.notification-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.notification-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sky-light);
  color: var(--sky-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notification-toast-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.notification-toast-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ---- Banner de permissão de notificações ---- */
.notif-permission-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 2rem);
  max-width: 420px;
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 32px rgba(15,23,42,0.28);
  z-index: 250;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.notif-permission-banner.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.notif-permission-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-permission-banner-text {
  flex: 1;
  min-width: 0;
}
.notif-permission-banner-title {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
}
.notif-permission-banner-sub {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.15rem;
}
.notif-permission-banner-btn {
  background: #fff;
  color: var(--ink);
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.notif-permission-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ---- Popups de erro/aviso/sucesso do sistema (substituem alert()) ---- */
.system-alert-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 360px;
}
.system-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.7) 100%);
  backdrop-filter: blur(28px) saturate(180%) contrast(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(180%) contrast(1.08);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-left: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  padding: 0.85rem 0.9rem;
  opacity: 0;
  transform: translateX(16px);
  transition: 0.25s ease;
}
.system-alert.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.system-alert.type-error {
  border-left-color: var(--red);
}
.system-alert.type-warn {
  border-left-color: var(--amber);
}
.system-alert.type-success {
  border-left-color: var(--green);
}
.system-alert-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.system-alert.type-error .system-alert-icon {
  color: var(--red);
}
.system-alert.type-warn .system-alert-icon {
  color: var(--amber);
}
.system-alert.type-success .system-alert-icon {
  color: var(--green);
}
.system-alert-message {
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
}
.system-alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem;
  display: flex;
}
.system-alert-close:hover {
  color: var(--ink);
}
.notification-bell-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s ease;
}
.notification-bell-button:hover {
  background: var(--sky-light);
  border-color: var(--sky);
}
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.profile-chip .nav-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--red);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  margin-left: 0.25rem;
}
.profile-chip .nav-logout:hover {
  background: var(--red-bg);
}

/* ---- Dropdown de perfil — ancorado ao chip, "vidro líquido", com seta para o gatilho ---- */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 280px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  border-radius: 20px;
  padding: 1.1rem;
  z-index: 40;
}
.profile-dropdown.liquid-glass {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 -1px 1px rgba(255, 255, 255, 0.15);
}
.profile-dropdown[hidden] {
  display: none;
}
.profile-dropdown-arrow,
.notification-panel-arrow {
  position: absolute;
  top: -7px;
  right: 28px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.46) 100%);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  border-left: 1px solid rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 3px 0 0 0;
  transform: rotate(45deg);
}
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.profile-dropdown-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.profile-modal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.35);
}
.profile-modal-email {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.profile-modal-role-badge {
  align-self: flex-start;
}
.profile-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.25rem;
}
.profile-modal-actions .primary-button,
.profile-modal-actions .secondary-button {
  width: 100%;
}

main {
  padding: 2rem;
  display: grid;
  gap: 1.75rem;
  max-width: 1240px;
  margin: 0 auto;
}
main.has-sidebar {
  max-width: 1400px;
  grid-template-columns: 1fr 352px;
  align-items: start;
}
.main-col {
  display: grid;
  gap: 1.75rem;
  min-width: 0;
}
.side-col {
  display: grid;
  align-content: start;
  gap: 1.75rem;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.side-col::-webkit-scrollbar {
  display: none;
}
@media (max-width: 900px) {
  main.has-sidebar {
    grid-template-columns: 1fr;
  }
  .side-col {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  padding: 1.5rem;
  min-width: 0;
}
.card + .card {
  margin-top: 0;
}
.form-row,
.field-row {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1.25rem;
}
.form-row:last-child,
.field-row:last-child {
  margin-bottom: 0;
}
label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: #fff;
  font-size: 0.95rem;
  color: var(--ink);
  font-family: inherit;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-light);
}
textarea {
  resize: vertical;
  min-height: 120px;
}
.section-title {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title:not(:first-child) {
  margin-top: 1.75rem;
}
.section-title .icon {
  color: var(--sky);
}
.section-subtitle {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.option-group,
.checkbox-group {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.option-button,
.checkbox-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: 0.15s ease;
}
.option-button:hover,
.checkbox-button:hover {
  background: var(--sky-light);
  border-color: var(--sky);
}
.option-button input,
.checkbox-button input {
  transform: scale(1.05);
}
.primary-button,
.secondary-button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}
.primary-button {
  background: var(--sky);
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.25);
}
.primary-button:hover {
  background: var(--sky-dark);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.32);
}
.secondary-button {
  background: #f1f5f9;
  color: var(--ink);
}
.secondary-button:hover {
  background: var(--border);
}
.status {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--sky-light);
  color: var(--ink);
  min-height: 1.5rem;
  font-size: 0.92rem;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 45;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.72) 100%);
  backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
  -webkit-backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  text-align: center;
}
.survey-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}
.survey-buttons button {
  border: none;
  border-radius: 12px;
  padding: 1rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--sky-light);
  color: var(--sky-dark);
  cursor: pointer;
  transition: 0.15s ease;
}
.survey-buttons button:hover {
  background: var(--sky);
  color: #fff;
}
.modal-card.survey-card {
  max-width: 640px;
  text-align: left;
  padding: 0 1.5rem 1.25rem;
  overflow: hidden;
}
/* ── Changelog modal ─────────────────────────────────────────────────────── */
.modal-card.cl-card {
  max-width: 520px;
  text-align: left;
  padding: 1.75rem;
}
.cl-header { text-align: center; margin-bottom: 1.25rem; }
.cl-version-badge {
  background: var(--sky-light);
  color: var(--sky-dark);
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}
.cl-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.4rem 0 0.25rem;
}
.cl-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.cl-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.45;
}
.cl-item .badge { flex-shrink: 0; margin-top: 0.05rem; }
.badge-info-cl {
  background: rgba(99,102,241,.12);
  color: #4338ca;
}
[data-theme="dark"] .badge-info-cl {
  background: rgba(99,102,241,.22);
  color: #a5b4fc;
}
[data-theme="dark"] .cl-version-badge {
  background: var(--sky-dark-bg, rgba(14,165,233,.15));
  color: var(--sky);
}
/* ---- Welcome wizard (onboarding de primeiro login, página inteira) ---- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 15% 10%, #e0f2fe 0%, #ffffff 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.welcome-overlay.is-active {
  opacity: 1;
}
.welcome-overlay.is-closing {
  opacity: 0;
}
.welcome-wizard {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  min-height: min(640px, 88vh);
}
.welcome-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.welcome-wizard-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--sky-dark);
}
.welcome-wizard-skip-password {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--amber);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
  transition: 0.15s ease;
  white-space: nowrap;
}
.welcome-wizard-skip-password:hover {
  background: #b45309;
}
.welcome-wizard-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.welcome-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  transition: width 0.3s ease, background 0.3s ease;
  cursor: pointer;
}
.welcome-dot.is-active {
  width: 28px;
  background: var(--sky);
}
.welcome-wizard-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.welcome-step-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.welcome-step-leave-forward {
  opacity: 0;
  transform: translateX(-36px);
}
.welcome-step-leave-back {
  opacity: 0;
  transform: translateX(36px);
}
.welcome-step-enter-forward {
  opacity: 0;
  transform: translateX(36px);
}
.welcome-step-enter-back {
  opacity: 0;
  transform: translateX(-36px);
}
.welcome-illustration-wrap {
  width: min(280px, 70vw);
  margin-bottom: 0.75rem;
}
.welcome-illustration {
  width: 100%;
  height: auto;
  display: block;
}
.welcome-illustration .pulse-ring {
  animation: welcome-dash 2.4s linear infinite;
}
@keyframes welcome-dash {
  to { stroke-dashoffset: -20; }
}
.welcome-step-page h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--ink);
}
.welcome-step-page p {
  margin: 0;
  max-width: 440px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}
.welcome-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}
.welcome-wizard-nav .secondary-button,
.welcome-wizard-nav .primary-button {
  width: auto;
}
#welcomeBackButton.is-hidden {
  visibility: hidden;
}
.welcome-wizard-counter {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
@media (max-width: 540px) {
  .welcome-overlay {
    padding: 1.25rem 1rem;
  }
  .welcome-wizard-header {
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
  }
  .welcome-wizard-brand {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  .welcome-step-page h2 {
    font-size: 1.2rem;
  }
  .welcome-step-page p {
    max-width: 100%;
  }
  .welcome-wizard-nav {
    gap: 0.5rem;
  }
  .welcome-wizard-nav .primary-button,
  .welcome-wizard-nav .secondary-button {
    padding: 0.65rem 0.8rem;
    font-size: 0.82rem;
  }
  .welcome-wizard-counter {
    font-size: 0.72rem;
    white-space: nowrap;
  }
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination-bar .pagination-info {
  font-size: 0.85rem;
  color: var(--muted);
}
.pagination-bar .pagination-actions {
  display: flex;
  gap: 0.6rem;
}
.occurrence-item .occurrence-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}
.occurrence-item .occurrence-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sky-dark);
  text-decoration: none;
}
.occurrence-item .occurrence-link:hover {
  text-decoration: underline;
}
.survey-scroll {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 0.4rem;
  margin: 0 -1.5rem 1rem;
}
.survey-doc-header {
  background: linear-gradient(120deg, #15847b, #1c9c8f);
  color: #fff;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.survey-doc-logo {
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}
.survey-doc-logo span {
  color: #cdeee8;
}
.survey-doc-title {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  flex: 1;
}
.survey-doc-date-pill {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.survey-question {
  margin: 0 1.5rem 1.1rem;
}
.survey-question-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.survey-doc-input {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  background: #e3f2f0;
  font-size: 0.9rem;
  color: var(--ink);
}
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.survey-chevron-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--ink);
  transition: 0.15s ease;
}
.survey-chevron-option:hover {
  background: #f1faf9;
}
.survey-chevron-option input {
  display: none;
}
.survey-chevron {
  color: #e08a9b;
  font-weight: 800;
  font-size: 1rem;
  transition: 0.15s ease;
}
.survey-chevron-option input:checked ~ .survey-chevron {
  color: #15847b;
  transform: scale(1.3);
}
.survey-chevron-option input:checked + .survey-chevron + span,
.survey-chevron-option:has(input:checked) {
  font-weight: 700;
  color: #15847b;
}
.survey-options-readonly .survey-chevron-option {
  cursor: default;
}
.survey-options-readonly .survey-chevron-option:not(.is-selected) {
  opacity: 0.4;
}
.survey-options-readonly .survey-chevron-option.is-selected {
  background: #e3f2f0;
  border: 1px solid #15847b;
  font-weight: 700;
  color: #0f6e63;
}
.survey-options-readonly .survey-chevron-option.is-selected .survey-chevron {
  color: #0f6e63;
  font-size: 1.05rem;
}
.survey-options-unanswered {
  padding: 0.3rem 0.4rem;
}

/* ── Nota de satisfação 1-10 ─────────────────────────────────────────── */
.survey-question-rating {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 2px dashed var(--border);
}
.survey-rating10 {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.survey-rating10-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.survey-rating10-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, transform 0.1s ease;
  user-select: none;
}
.survey-rating10-btn input[type="radio"] { display: none; }
.survey-rating10-btn:hover {
  border-color: var(--sky);
  color: var(--sky);
  transform: translateY(-2px);
}
/* seleccionado — vermelho (1-3) */
.survey-rating10-btn.is-selected.range-low {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}
/* seleccionado — âmbar (4-6) */
.survey-rating10-btn.is-selected.range-mid {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}
/* seleccionado — verde (7-10) */
.survey-rating10-btn.is-selected.range-high {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}
.survey-rating10-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 2px;
}
/* dark mode */
[data-theme="dark"] .survey-rating10-btn { border-color: rgba(255,255,255,0.12); color: var(--muted); }
[data-theme="dark"] .survey-rating10-btn.is-selected.range-low  { background: rgba(239,68,68,0.15);  border-color: #ef4444; color: #fca5a5; }
[data-theme="dark"] .survey-rating10-btn.is-selected.range-mid  { background: rgba(245,158,11,0.15); border-color: #f59e0b; color: #fcd34d; }
[data-theme="dark"] .survey-rating10-btn.is-selected.range-high { background: rgba(34,197,94,0.15);  border-color: #22c55e; color: #86efac; }

/* ── Banner de nota de satisfação (vista do supervisor) ─────────────────── */
.survey-nota-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  border: 2px solid;
  margin-bottom: 1rem;
}
.survey-nota-number {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.survey-nota-dez {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.6;
}
.survey-nota-label {
  font-size: 1.05rem;
  font-weight: 700;
}
/* Excelente / Muito bom (verde) */
.nota-excellent, .nota-good {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}
/* Bom / Razoável (âmbar) */
.nota-fair, .nota-poor {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
/* Mau (vermelho) */
.nota-bad {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}
/* dark mode */
[data-theme="dark"] .nota-excellent,
[data-theme="dark"] .nota-good  { background: rgba(34,197,94,0.12);  border-color: #22c55e; color: #86efac; }
[data-theme="dark"] .nota-fair,
[data-theme="dark"] .nota-poor  { background: rgba(245,158,11,0.12); border-color: #f59e0b; color: #fcd34d; }
[data-theme="dark"] .nota-bad   { background: rgba(239,68,68,0.12);  border-color: #ef4444; color: #fca5a5; }

.survey-doc-readonly {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.survey-doc-readonly .survey-doc-header {
  margin-bottom: 1.25rem;
}
.survey-doc-readonly .survey-question {
  margin: 0 1.25rem 1.1rem;
}
.survey-modal-actions {
  display: flex;
  gap: 0.75rem;
}
.survey-modal-actions .primary-button,
.survey-modal-actions .secondary-button {
  width: auto;
  flex: 1;
}

/* ---- Dashboard ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  padding: 1.25rem 1.4rem;
}
.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stat-card .stat-label .icon {
  color: var(--sky);
  flex-shrink: 0;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 0.45rem;
}
.stat-card.accent-red .stat-value {
  color: var(--red);
}
.stat-card.accent-amber .stat-value {
  color: var(--amber);
}
.stat-card.accent-green .stat-value {
  color: var(--green);
}
.stat-card.accent-sky .stat-value {
  color: var(--sky-dark);
}
.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.stat-card.clickable:hover {
  border-color: var(--sky);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}
.stat-card.clickable:active {
  transform: translateY(0);
}
.stat-card.clickable .stat-label {
  justify-content: space-between;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.panel-grid-2 {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}
@media (max-width: 760px) {
  .panel-grid-2 {
    grid-template-columns: 1fr;
  }
}
.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  padding: 1.25rem;
}
.chart-card.clickable {
  cursor: pointer;
  transition: 0.15s ease;
}
.chart-card.clickable:hover {
  border-color: var(--sky);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.chart-card .chart-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
}
.chart-card canvas {
  max-height: 190px;
}
.chart-card canvas.chart-tall {
  max-height: none;
}
.chart-canvas-wrap {
  position: relative;
  height: 190px;
}
/* ---- Anel de atividade (inspirado no Apple Watch, mas no fundo branco do resto do
   dashboard): anel grosso de uma só cor vibrante sobre um arco residual cinza claro sem
   pontas arredondadas (parece um círculo contínuo) — só a forma do anel é "inspiração",
   o cartão continua igual aos outros (.chart-card). O valor fica ao lado do anel, não
   dentro do buraco (que é pequeno demais para o texto respirar) ---- */
.donut-ring-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}
.donut-ring-wrap {
  position: relative;
  width: 130px;
  flex-shrink: 0;
}
.donut-ring-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}
.donut-pending-value {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}
.donut-pending-value.is-zero {
  color: var(--green);
}
.donut-pending-caption {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
#statGrid,
#slaStatGrid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* ---- Skeleton loading ---- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #e2e8f0 !important;
  border-color: transparent !important;
  pointer-events: none;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}
.stat-card.skeleton {
  min-height: 70px;
}
.chart-card.skeleton {
  min-height: 160px;
}
.attendance-row.skeleton {
  min-height: 56px;
}
.chart-card.is-loading,
.card.is-loading {
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
}
.chart-card.is-loading > *,
.card.is-loading > * {
  visibility: hidden;
}
.chart-card.is-loading::after,
.card.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-good {
  background: var(--green-bg);
  color: var(--green);
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
.badge-bad {
  background: var(--red-bg);
  color: var(--red);
}
.badge-warn {
  background: var(--amber-bg);
  color: var(--amber);
}

/* ---- Upload tiles & file list ---- */
.upload-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.upload-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 1.75rem 1.25rem;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  transition: 0.15s ease;
}
.upload-tile:hover {
  border-color: var(--sky);
  background: var(--sky-light);
}
.upload-tile .icon {
  color: var(--sky);
  width: 28px;
  height: 28px;
}
.upload-tile .upload-tile-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.upload-tile .upload-tile-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.upload-tile input[type="file"] {
  display: none;
}

.file-chip-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.6rem;
}
.file-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.file-chip .file-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
}
.file-chip .file-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--sky-light);
  color: var(--sky-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-chip .file-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chip .file-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  display: flex;
}
.file-chip .file-remove:hover {
  background: var(--red-bg);
  color: var(--red);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Gauge (toner) ---- */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 130px;
}
.gauge-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.gauge-top .gauge-name {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}
.gauge-top .gauge-pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
}
.gauge-track {
  height: 14px;
  border-radius: 5px;
  background: repeating-linear-gradient(
    135deg,
    #f1f5f9 0 4px,
    #f8fafc 4px 8px
  );
  border: 1px solid var(--border);
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 4px 0 0 4px;
  transition: width 0.3s ease;
}
.gauge-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--muted);
}
.gauge-slider {
  width: 100%;
  margin: 0.15rem 0;
  accent-color: var(--sky);
  cursor: pointer;
}
.wifi-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 8px;
  transition: 0.15s ease;
}
.wifi-toggle:hover {
  background: var(--sky-light);
}
.wifi-toggle-icon.is-connected {
  color: var(--green);
}
.wifi-toggle-icon.is-disconnected {
  color: var(--red);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.equip-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
.equip-table th {
  text-align: left;
  padding: 0.6rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.equip-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}
.equip-table tr:last-child td {
  border-bottom: none;
}
.equip-table input[type="text"] {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

.equip-occurrence-group {
  margin-bottom: 1.5rem;
}
.equip-occurrence-group:last-child {
  margin-bottom: 0;
}
.equip-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--sky-dark);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.equip-group-header .icon {
  color: var(--sky);
  flex-shrink: 0;
}
.occurrence-item {
  position: relative;
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  margin-bottom: 0.75rem;
}
.occurrence-status-corner {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
}
.occurrence-item:last-child {
  margin-bottom: 0;
}

/* ── Destaque: rota via Oficina ───────────────────────────────────────────── */
.occurrence-item.is-oficina {
  border-left: 3px solid #0ea5e9;
  padding-left: calc(1rem - 2px);
  background: rgba(14,165,233,.04);
}
/* ── Destaque: APV em curso (urgente) ─────────────────────────────────────── */
.occurrence-item.is-apv-ativa {
  border-left: 3px solid #f59e0b;
  padding-left: calc(1rem - 2px);
  background: rgba(245,158,11,.05);
}

/* Strip interior — aparece no topo do occurrence-body */
.oc-route-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .22rem .55rem;
  border-radius: .35rem;
  margin-bottom: .5rem;
}
/* Quando há barra de rota, o badge de status fica dentro dela — esconde o canto absoluto */
.occurrence-item.is-oficina .occurrence-status-corner,
.occurrence-item.is-apv-ativa .occurrence-status-corner {
  display: none;
}
.oc-route-bar.bar-oficina {
  background: rgba(14,165,233,.1);
  color: #0369a1;
  border: 1px solid rgba(14,165,233,.25);
}
.oc-route-bar.bar-apv {
  background: rgba(245,158,11,.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,.3);
}

/* dark mode */
@media (prefers-color-scheme: dark) {
  .occurrence-item.is-oficina  { background: rgba(14,165,233,.08); }
  .occurrence-item.is-apv-ativa { background: rgba(245,158,11,.09); }
  .oc-route-bar.bar-oficina { background: rgba(14,165,233,.14); color: #38bdf8; }
  .oc-route-bar.bar-apv     { background: rgba(245,158,11,.15); color: #fbbf24; }
}
[data-theme="dark"] .occurrence-item.is-oficina  { background: rgba(14,165,233,.08); }
[data-theme="dark"] .occurrence-item.is-apv-ativa { background: rgba(245,158,11,.09); }
[data-theme="dark"] .oc-route-bar.bar-oficina { background: rgba(14,165,233,.14); color: #38bdf8; }
[data-theme="dark"] .oc-route-bar.bar-apv     { background: rgba(245,158,11,.15); color: #fbbf24; }

/* Checkbox items da lista de pendentes no formulário APV */
.apv-oc-checkbox { align-items: flex-start; flex-wrap: nowrap; }
.apv-oc-checkbox.is-oficina-item {
  border-left: 3px solid #0ea5e9;
  padding-left: calc(.9rem - 2px);
  background: rgba(14,165,233,.04);
}
.apv-oc-title {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: .85rem;
}
.apv-oc-evidence {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: .1rem;
}
[data-theme="dark"] .apv-oc-checkbox.is-oficina-item { background: rgba(14,165,233,.08); }
@media (prefers-color-scheme: dark) {
  .apv-oc-checkbox.is-oficina-item { background: rgba(14,165,233,.08); }
}

/* ══ Occurrence cards (consolidados no final do ficheiro) ══ */

.occurrence-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.occurrence-icon.sev-alta {
  background: var(--red-bg);
  color: var(--red);
}
.occurrence-icon.sev-normal {
  background: var(--amber-bg);
  color: var(--amber);
}
.occurrence-icon.sev-baixa {
  background: var(--sky-light);
  color: var(--sky-dark);
}
.occurrence-body .occurrence-title {
  padding-right: 6.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.occurrence-body .occurrence-evidence {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.occurrence-body .occurrence-decision {
  font-size: 0.85rem;
  color: var(--sky-dark);
  font-weight: 600;
  margin-top: 0.4rem;
}
.occurrence-group {
  margin-bottom: 1.25rem;
}
.occurrence-group:last-child {
  margin-bottom: 0;
}
.occurrence-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.occurrence-remove-button {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.occurrence-remove-button:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

/* ---- Percurso da Visita ----
   duas peças deliberadamente separadas, porque medem coisas diferentes e misturá-las
   numa só barra (tentativa anterior) cria pontos que se sobrepõem ou que caem em cima
   de uma zona "ainda não feito" sem sentido:
   1) .visit-stepper — só a SEQUÊNCIA de ações, espaçada por flexbox (nunca sobrepõe,
      independente de quantos passos existam, sem fingir relação com tempo/progresso)
   2) .visit-progress — só a % real de ocorrências resolvidas, sem pontos
   o detalhe (quem, quando, duração) está sempre na lista por baixo, e também num
   tooltip ao passar o mouse/focar cada ponto do stepper */
.visit-stepper {
  display: flex;
  list-style: none;
  margin: 0.5rem 0 1.5rem;
  padding: 0;
}
.visit-stepper-item {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  outline: none;
}
.visit-stepper-item::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 50%;
  width: 100%;
  height: 3px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 0;
}
.visit-stepper-item:first-child::before {
  display: none;
}
.visit-stepper-item.is-done::before,
.visit-stepper-item.is-warn::before {
  background: var(--green);
}
.visit-stepper-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--muted);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.visit-stepper-item.is-done .visit-stepper-dot {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}
.visit-stepper-item.is-warn .visit-stepper-dot {
  background: var(--amber-bg);
  border-color: var(--amber);
  color: var(--amber);
}
.visit-stepper-item.is-current .visit-stepper-dot {
  background: var(--amber-bg);
  border-color: var(--amber);
  color: var(--amber);
  animation: visit-timeline-pulse 1.8s ease-in-out infinite;
}
.visit-timeline-tooltip {
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 200px;
  width: max-content;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
}
.visit-timeline-tooltip strong {
  font-size: 0.78rem;
}
.visit-timeline-tooltip span {
  color: #cbd5e1;
}
.visit-timeline-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.visit-stepper-item:hover .visit-timeline-tooltip,
.visit-stepper-item:focus .visit-timeline-tooltip,
.visit-stepper-item:focus-within .visit-timeline-tooltip {
  opacity: 1;
  visibility: visible;
}
@keyframes visit-timeline-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0); }
}
.visit-progress {
  margin-bottom: 1.5rem;
}
.visit-progress-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.visit-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.visit-progress-fill {
  height: 100%;
  border-radius: 999px;
  background-image: linear-gradient(to right, var(--red) 0%, var(--amber) 50%, var(--green) 100%);
  background-repeat: no-repeat;
  transition: width 0.3s ease;
}
.visit-timeline-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.visit-timeline-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.visit-timeline-step-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--muted);
}
.visit-timeline-step.is-done .visit-timeline-step-icon {
  background: var(--green-bg);
  color: var(--green);
}
.visit-timeline-step.is-warn .visit-timeline-step-icon {
  background: var(--amber-bg);
  color: var(--amber);
}
.visit-timeline-step.is-current .visit-timeline-step-icon {
  background: var(--amber-bg);
  color: var(--amber);
}
.visit-timeline-step-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.visit-timeline-step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.visit-timeline-step-meta span:not(:last-child)::after {
  content: '·';
  margin-left: 0.5rem;
  color: var(--border);
}

/* ---- Cartão de APV (histórico de ordens de serviço) ---- */
/* APV pendente de confirmação do supervisor — borda âmbar para chamar atenção */
.apv-card-pendente-supervisor {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
[data-theme="dark"] .apv-card-pendente-supervisor {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}

/* Cards do Herculano (página de oficina) */
.herculano-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.herculano-card-tema {
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .35rem;
}
.herculano-card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.herculano-card-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.herculano-card-evidencia {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .25rem;
}
.herculano-card-decisao {
  font-size: .82rem;
  padding: .5rem .75rem;
  background: var(--sky-light, #e0f2fe);
  border-radius: 8px;
  color: var(--ink);
}
[data-theme="dark"] .herculano-card-decisao { background: rgba(14,165,233,0.12); }
.herculano-card-approved { opacity: 0.6; }

.apv-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.apv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.apv-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.apv-card-tech {
  font-weight: 500;
  color: var(--muted);
}
.apv-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
.apv-card-note {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}
.apv-card-note-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 700;
}
.apv-card-note p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--ink);
  white-space: pre-wrap;
}
.apv-card-note-closure .apv-card-note-label {
  color: var(--amber);
}

/* Supervisor rejection note — shown on APV card when Xavier refused the closure */
.apv-card-rejected-note {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  padding: .5rem .65rem;
  border-radius: 8px;
  font-size: .82rem;
  background: rgba(220,38,38,.07);
  border: 1px solid rgba(220,38,38,.18);
  color: #b91c1c;
  line-height: 1.45;
}
.apv-card-rejected-note svg { flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .apv-card-rejected-note {
  background: rgba(220,38,38,.12);
  border-color: rgba(220,38,38,.25);
  color: #fca5a5;
}

/* Confirm/reject action panel */
.apv-confirm-panel {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .75rem;
}
.apv-recusar-form {
  margin-top: .65rem;
  padding: .75rem;
  border-radius: 10px;
  border: 1px solid rgba(220,38,38,.2);
  background: rgba(220,38,38,.04);
}
[data-theme="dark"] .apv-recusar-form {
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.2);
}
.apv-recusar-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .3rem;
  color: var(--ink);
}
.apv-recusar-textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 7px;
  border: 1px solid var(--border);
  padding: .45rem .6rem;
  font-size: .84rem;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
}
.apv-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.apv-task {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--ink);
}
.apv-task-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.apv-task.is-done .apv-task-icon {
  color: var(--green);
}
.apv-task.is-pending .apv-task-icon {
  color: var(--amber);
}
.apv-task-text {
  flex: 1 1 auto;
  min-width: 0;
}
.apv-task .badge {
  flex-shrink: 0;
}

.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  margin-bottom: 0.6rem;
}
.attendance-row:last-child {
  margin-bottom: 0;
}
.attendance-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}
.attendance-main .icon {
  color: var(--sky);
}
.attendance-client {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.attendance-date {
  font-size: 0.78rem;
  color: var(--muted);
}
.attendance-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--sky-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.attendance-link:hover {
  text-decoration: underline;
}

/* ---- Listas de "attendance-row" dentro da coluna lateral (mais estreita) ---- */
.side-col .attendance-row {
  position: relative;
  flex-wrap: wrap;
  align-items: flex-start;
  row-gap: 0.6rem;
}
.side-col .attendance-main {
  flex: 1 0 100%;
}
.side-col .attendance-client {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
}
.side-col .attendance-row > .badge,
.side-col .attendance-link {
  flex-shrink: 0;
}
.side-col .priority-corner {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
}
.side-col .attendance-row.has-corner-badge .attendance-client {
  padding-right: 3.5rem;
}
.side-col .attendance-link {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  background: var(--sky-light);
  color: var(--sky-dark);
  font-size: 0.8rem;
  transition: 0.15s ease;
}
.side-col .attendance-link:hover {
  background: var(--sky);
  color: #fff;
  text-decoration: none;
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.status-select {
  width: auto;
  min-width: 150px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  flex-shrink: 0;
}
.status-select {
  transition: 0.15s ease;
}

/* ---- Detail hero (visita.html) ---- */
.detail-hero-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}
.detail-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--sky-light);
  color: var(--sky-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-hero-main {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-width: 0;
}
.detail-hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.detail-hero-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.detail-hero-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.detail-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.detail-meta-item .icon {
  color: var(--sky);
}
.detail-meta-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detail-meta-value {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem 1.5rem;
}
.info-item .info-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.info-item .info-value {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
  margin-top: 0.3rem;
  line-height: 1.4;
}
.info-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.readonly-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ---- Login (duas colunas: informação à esquerda, formulário à direita) ---- */
.login-shell {
  min-height: 100vh;
  display: flex;
}
.login-info {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-dark) 100%);
  color: #fff;
}
.login-info h1 {
  margin: 0 0 0.5rem;
  font-size: 2.4rem;
}
.login-info h1 .brand-accent {
  color: #fff;
  font-weight: 800;
  opacity: 0.85;
}
.login-info-tagline {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.92;
}
.login-info-text {
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 420px;
  opacity: 0.95;
}
.login-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.9rem;
}
.login-info-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.login-form-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
.login-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  color: var(--ink);
}
.login-card p.subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .login-shell {
    flex-direction: column;
  }
  .login-info {
    padding: 1.75rem;
    text-align: center;
  }
  .login-info-text,
  .login-info-list {
    display: none;
  }
  .login-form-side {
    padding: 2rem 1.25rem 3rem;
  }
}

/* ---- Widget flutuante "Instalar App" (login.html) ---- */
.install-floating {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 30;
}
.install-floating-button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.46) 100%);
  backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
  -webkit-backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 0.55rem 1.1rem 0.55rem 0.55rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  cursor: pointer;
  font: inherit;
}
.install-floating-button:hover {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
}
.install-floating-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.install-floating-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}
.install-floating-text strong {
  font-size: 0.85rem;
  color: var(--ink);
}
.install-floating-text small {
  font-size: 0.75rem;
  color: var(--muted);
}
.install-floating-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
    padding-top: 5.5rem;
  }
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.85rem 0.85rem 0;
  }
  .topbar-pill-brand {
    min-width: 0;
    padding: 0.55rem 0.85rem;
  }
  header h1 {
    font-size: 1rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  header h1 small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  main {
    padding-bottom: 5rem;
  }
  nav {
    position: fixed;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 1rem;
    z-index: 35;
    flex-wrap: nowrap;
    justify-content: space-around;
    gap: 0.4rem;
    padding: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.46) 100%);
    backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
    -webkit-backdrop-filter: blur(34px) saturate(180%) contrast(1.08);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  }
  nav a {
    white-space: nowrap;
  }
  .topbar-pill-profile {
    flex-shrink: 0;
  }
  .form-row,
  .field-row {
    /* !important: várias páginas definem grid-template-columns inline (estilo no
       HTML), que vence sempre uma regra normal de stylesheet — só um !important
       aqui garante que os formulários colapsem para 1 coluna no mobile */
    grid-template-columns: 1fr !important;
  }
  .survey-buttons {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .detail-meta-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Modo escuro ─────────────────────────────────────────────────────────────
   Todas as cores são sobrescritas via data-theme="dark" no <html>.
   O JS aplica o atributo antes do primeiro render (sem flash). */
[data-theme="dark"] {
  --ink: #f1f5f9;
  --muted: #94a3b8;
  /* border visível sobre fundos escuros — branco a baixa opacidade,
     não #1e293b que ficava igual ao fundo dos cards (bordas invisíveis) */
  --border: rgba(255,255,255,0.10);
  --bg: #0f172a;
  --green-bg: #052e16;
  --red-bg: #450a0a;
  --amber-bg: #431407;
  --sky-light: #0c4a6e;
  color-scheme: dark;
}

/* liquid-glass dark: branco com opacidade muito baixa sobre fundo escuro
   — é assim que o macOS/iOS fazem frosted glass em dark mode */
[data-theme="dark"] .liquid-glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.05) 100%);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 1px rgba(255,255,255,0.10), inset 0 -1px 1px rgba(0,0,0,0.2);
}
[data-theme="dark"] .profile-dropdown-arrow,
[data-theme="dark"] .notification-panel-arrow {
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.07) 100%);
  border-color: rgba(255,255,255,0.12);
}
/* estilos do sino definidos no bloco final de dark mode */

/* superfícies (cards) — borda fina branca + sombra com profundidade */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .apv-card-note,
[data-theme="dark"] .occurrence-item {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.35),
    0 4px 14px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
/* stat-card ligeiramente mais claro para contrastar com o fundo da página */
[data-theme="dark"] .stat-card { background: #1e2d40; }

/* opções de selecção */
[data-theme="dark"] .option-button,
[data-theme="dark"] .checkbox-button {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.09);
}
[data-theme="dark"] .option-button:hover,
[data-theme="dark"] .checkbox-button:hover {
  background: #273548;
  border-color: rgba(255,255,255,0.16);
}
/* opção seleccionada */
[data-theme="dark"] .option-button.is-selected,
[data-theme="dark"] .checkbox-button.is-selected {
  border-color: var(--sky);
}

/* !important necessário: o browser aplica a cor dos inputs via user-agent e
   color-scheme, mas regras de autor com alta especificidade ainda podem perder
   para regras de classe mais específicas sem !important */
[data-theme="dark"] input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1e293b !important;
  color: var(--ink) !important;
}

/* toast de notificação */
[data-theme="dark"] .notification-toast {
  background: linear-gradient(135deg, rgba(30,41,59,0.97) 0%, rgba(15,23,42,0.92) 100%);
  border-color: rgba(255,255,255,0.08);
}

/* skeletons */
[data-theme="dark"] .stat-card.skeleton,
[data-theme="dark"] .chart-card.skeleton,
[data-theme="dark"] .attendance-row.skeleton { background: #162032; }

/* ── Toggle de tema (dentro do dropdown de perfil) ─── */
.profile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.1rem 0.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.15rem;
}
.profile-theme-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.theme-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.22s ease;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle.is-dark { background: var(--sky); }
.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.22s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  pointer-events: none;
}
.theme-toggle.is-dark .theme-toggle-knob { transform: translateX(18px); }

/* ── Dark mode — overrides adicionais ───────────────────────────────────────── */

/* botão secundário */
[data-theme="dark"] .secondary-button {
  background: #1e293b;
  color: var(--ink);
}
[data-theme="dark"] .secondary-button:hover { background: #273548; }

/* inputs de data — color-scheme faz o browser (Chrome/Safari) renderizar
   o date-picker nativo já em dark, além de mudar a cor do ícone de calendário */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
  background: #1e293b;
  color: var(--ink);
  color-scheme: dark;
}

/* overlay do welcome wizard */
[data-theme="dark"] .welcome-overlay {
  background: radial-gradient(circle at 15% 10%, #0c4a6e 0%, #0f172a 55%);
}

/* hover de opção no survey */
[data-theme="dark"] .survey-chevron-option:hover { background: #1e293b; }

/* gradiente lateral do survey */
[data-theme="dark"] .survey-chevron {
  background: linear-gradient(180deg, #1e293b 0%, var(--bg) 100%);
}

/* labels que envolvem inputs herdarem fundo transparente */
[data-theme="dark"] label { color: var(--ink); }

/* ── Dark mode — modal e inquérito ────────────────────────────────────────── */
[data-theme="dark"] .modal-card {
  background: linear-gradient(135deg, rgba(30,41,59,0.96) 0%, rgba(15,23,42,0.92) 100%);
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.05);
}
[data-theme="dark"] .survey-doc-input {
  background: #1e293b !important;
  color: var(--ink) !important;
}
[data-theme="dark"] .survey-scroll {
  color-scheme: dark;
}

/* ── Dark mode — skeletons e loading ─────────────────────────────────────── */
/* o .skeleton original usa !important — precisamos de !important aqui também */
[data-theme="dark"] .skeleton {
  background: #1a2536 !important;
  border-color: transparent !important;
}
[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}
[data-theme="dark"] .chart-card.is-loading,
[data-theme="dark"] .card.is-loading {
  background: #1a2536;
}
[data-theme="dark"] .chart-card.is-loading::after,
[data-theme="dark"] .card.is-loading::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

/* ── Dark mode — botão do sino de notificações ─────────────────────────── */
[data-theme="dark"] .notification-bell-button {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: var(--ink);
}
[data-theme="dark"] .notification-bell-button:hover {
  background: rgba(14,165,233,0.25);
  border-color: var(--sky);
  color: var(--sky);
}

/* ── Dark mode — hierarquia de texto e divisores ───────────────────────── */

/* título de secção / headings dentro de cards */
[data-theme="dark"] .card h2,
[data-theme="dark"] .card h3,
[data-theme="dark"] .stat-card h2,
[data-theme="dark"] .stat-card h3,
[data-theme="dark"] .chart-card h2,
[data-theme="dark"] .chart-card h3 {
  color: var(--ink);
}

/* valores numéricos destacados nos stat-cards */
[data-theme="dark"] .stat-value { color: #f8fafc; }
[data-theme="dark"] .stat-label { color: var(--muted); }

/* divisores hr e linhas de separação */
[data-theme="dark"] hr { border-color: rgba(255,255,255,0.08); }

/* tabelas */
[data-theme="dark"] th {
  background: #162032;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
[data-theme="dark"] td { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] tr:hover td { background: rgba(255,255,255,0.03); }

/* ocorrência item — variação elevada */
[data-theme="dark"] .occurrence-item {
  background: #1a2942;
}
[data-theme="dark"] .occurrence-item:hover {
  background: #1f3254;
  border-color: rgba(255,255,255,0.14);
}

/* linhas de lista de visitas / attendance */
[data-theme="dark"] .attendance-row {
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .attendance-row:hover { background: rgba(255,255,255,0.03); }

/* tags e badges de estado */
[data-theme="dark"] .badge,
[data-theme="dark"] .status-tag {
  border: 1px solid rgba(255,255,255,0.10);
}

/* progress bar track em dark */
[data-theme="dark"] .progress-track {
  background: rgba(255,255,255,0.08);
}

/* login card ligeiramente mais elevado */
[data-theme="dark"] .login-card {
  background: #1e293b;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

/* toggle de tema em dark — o knob fica sobre fundo mais escuro */
[data-theme="dark"] .theme-toggle:not(.is-dark) {
  background: rgba(255,255,255,0.18);
}

/* textos secundários em zonas escuras */
[data-theme="dark"] .section-title,
[data-theme="dark"] .card-title { color: #cbd5e1; }

/* ── Badge de versão (página de login) ────────────────────────────────── */
.app-version-badge {
  position: fixed;
  bottom: 0.9rem;
  right: 1.1rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  z-index: 10;
}
[data-theme="dark"] .app-version-badge { opacity: 0.4; }

/* ── Modal de aviso de inatividade ─────────────────────────────────────── */
.inactivity-modal-card {
  text-align: center;
  max-width: 340px;
}
.inactivity-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--amber-bg, #fef3c7);
  color: var(--amber, #f59e0b);
  margin: 0 auto 0.5rem;
}
.inactivity-countdown-display {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--amber, #f59e0b);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.02em;
}
[data-theme="dark"] .inactivity-modal-icon {
  background: rgba(245,158,11,0.15);
}

/* ── Dark mode — tooltip do percurso da visita ────────────────────────── */
/* em dark mode --ink é #f1f5f9 (branco), por isso o tooltip fica branco;
   forçamos o fundo escuro explicitamente */
[data-theme="dark"] .visit-timeline-tooltip {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  color: #f1f5f9;
}
[data-theme="dark"] .visit-timeline-tooltip span {
  color: #94a3b8;
}
[data-theme="dark"] .visit-timeline-tooltip::after {
  border-top-color: #1e293b;
}



/* ══════════════════════════════════════════════════════════════════
   HERCULANO — Página de Oficina (hd-*)
   ══════════════════════════════════════════════════════════════════ */

@keyframes hd-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hd-slide-out {
  from { opacity: 1; transform: translateX(0);    max-height: 300px; margin-bottom: .75rem; }
  to   { opacity: 0; transform: translateX(32px); max-height: 0;    margin-bottom: 0; overflow: hidden; }
}

/* ── Pending card ────────────────────────────────────────────────── */
.hd-pc {
  border-left-width: 4px;
  border-left-style: solid;
  margin-bottom: .75rem;
  transition: box-shadow .15s;
}
.hd-pc:last-child { margin-bottom: 0; }
.hd-pc:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.08); }
.hd-pc-alta   { border-left-color: var(--red,   #ef4444); }
.hd-pc-normal { border-left-color: var(--amber,  #f59e0b); }
.hd-pc-baixa  { border-left-color: var(--green,  #22c55e); }

/* ── Nota IA (azul) ──────────────────────────────────────────────── */
.hd-pc-ai-note {
  background: rgba(14,165,233,0.06);
  border-color: rgba(14,165,233,0.2);
}
[data-theme="dark"] .hd-pc-ai-note {
  background: rgba(14,165,233,0.1);
  border-color: rgba(14,165,233,0.22);
}
.hd-pc-ai-note .apv-card-note-label { color: var(--primary); }

/* ── Botão compacto (override width:100%) ────────────────────────── */
.hd-aval-btn {
  width: auto !important;
  padding: .4rem .9rem !important;
  font-size: .82rem !important;
  border-radius: 9px !important;
  white-space: nowrap;
}

/* ── Segmented control de filtros ────────────────────────────────── */
.hd-seg-ctrl {
  display: inline-flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.hd-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .8rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .13s, color .13s;
  line-height: 1;
  white-space: nowrap;
}
.hd-seg-btn:hover { background: rgba(0,0,0,0.05); color: var(--ink); }
.hd-seg-btn.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
}
[data-theme="dark"] .hd-seg-ctrl { background: #1e293b; }
[data-theme="dark"] .hd-seg-btn:hover { background: rgba(255,255,255,0.07); }
[data-theme="dark"] .hd-seg-btn.is-active { background: #273548; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }

/* Ponto de severidade */
.hd-sev-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hd-dot-alta   { background: var(--red,   #ef4444); }
.hd-dot-normal { background: var(--amber,  #f59e0b); }
.hd-dot-baixa  { background: var(--green,  #22c55e); }

/* Contagem dentro do botão */
.hd-seg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.07);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
}
.hd-seg-btn.is-active .hd-seg-count {
  background: rgba(0,0,0,0.09);
  color: var(--ink);
}
[data-theme="dark"] .hd-seg-count { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .hd-seg-btn.is-active .hd-seg-count { background: rgba(255,255,255,0.13); }

/* ── Acompanhamento ao alto ──────────────────────────────────────── */
.hd-acomp-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.hd-acomp-row:last-child { border-bottom: none; padding-bottom: 0; }
.hd-acomp-body { flex: 1; min-width: 0; }
.hd-acomp-tema { font-size: .82rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-acomp-meta { font-size: .72rem; color: var(--muted); margin-top: .1rem; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.hd-acomp-track {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.hd-acomp-step {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
}
.hd-acomp-done   { background: rgba(34,197,94,.12);  color: var(--green,#22c55e); }
.hd-acomp-active { background: rgba(14,165,233,.12); color: var(--primary,#0ea5e9); }
.hd-acomp-wait   { background: rgba(245,158,11,.12); color: var(--amber,#f59e0b); }
.hd-acomp-arrow  { font-size: .68rem; color: var(--muted); flex-shrink: 0; }
[data-theme="dark"] .hd-acomp-done   { background: rgba(34,197,94,.18); }
[data-theme="dark"] .hd-acomp-active { background: rgba(14,165,233,.18); }
[data-theme="dark"] .hd-acomp-wait   { background: rgba(245,158,11,.18); }

/* ── Filtro de datas — painel de avaliados ───────────────────────── */
.hd-date-filter {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}
.hd-date-input {
  flex: 1;
  min-width: 0;
  padding: .3rem .45rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: .76rem;
  font-family: inherit;
}
.hd-date-input:focus { outline: none; border-color: var(--primary); }
.hd-date-sep { color: var(--muted); font-size: .82rem; flex-shrink: 0; }
.hd-date-hoje { padding: .28rem .65rem !important; font-size: .74rem !important; }
[data-theme="dark"] .hd-date-input { background: #1e293b; border-color: rgba(255,255,255,0.1); color: var(--ink); }

/* ── Comentário dentro do item avaliado ─────────────────────────── */
.hd-avaliado-note {
  display: flex;
  align-items: flex-start;
  gap: .3rem;
  margin-top: .3rem;
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.45;
  font-style: italic;
}

/* ── Item avaliado no painel lateral ─────────────────────────────── */
.hd-approved-entry { animation: hd-slide-in .28s ease; }

/* ── Novo card chegado em tempo real ─────────────────────────────── */
@keyframes hd-new-glow {
  0%   { box-shadow: 0 0 0 3px rgba(14,165,233,.5), inset 0 0 0 9999px rgba(14,165,233,.08); }
  70%  { box-shadow: 0 0 0 3px rgba(14,165,233,.2), inset 0 0 0 9999px rgba(14,165,233,.04); }
  100% { box-shadow: none; }
}
.hd-new-highlight { animation: hd-new-glow 2.5s ease forwards; }

/* ── Urgente: pulso na borda esquerda ────────────────────────────── */
@keyframes hd-border-pulse {
  0%, 100% { border-left-color: #ef4444; box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 0 0 1px var(--border); }
  50%       { border-left-color: #fca5a5; box-shadow: 0 1px 4px rgba(239,68,68,.25), 0 0 0 1px rgba(239,68,68,.2); }
}
.hd-card-urgente { animation: hd-border-pulse 2s ease-in-out infinite; }

/* ── Rodapé de acções ────────────────────────────────────────────── */
.hd-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.hd-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .62rem .5rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background .12s;
  text-decoration: none;
}
.hd-footer-btn:first-child {
  border-right: 1px solid var(--border);
  color: var(--ink);
}
.hd-footer-btn:first-child:hover { background: var(--surface); }
.hd-footer-btn.is-primary {
  color: #fff;
  background: var(--primary, #0ea5e9);
}
.hd-footer-btn.is-primary:hover { filter: brightness(1.1); }

/* ── Estado vazio ────────────────────────────────────────────────── */
.hd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
  gap: .65rem;
  color: var(--muted);
}
.hd-empty-icon { color: var(--green,#22c55e); opacity: .65; }
.hd-empty-state h3 { margin: 0; font-size: 1rem; color: var(--ink); }
.hd-empty-state p  { margin: 0; font-size: .82rem; max-width: 36ch; line-height: 1.5; }

/* ── Modal de avaliação ──────────────────────────────────────────── */
.hd-modal {
  max-width: 540px;
  text-align: left;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hd-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}
.hd-modal-title {
  margin: 0 0 .2rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.hd-modal-sub {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.hd-modal-close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  padding: .25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: background .12s;
}
.hd-modal-close:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
[data-theme="dark"] .hd-modal-close:hover { background: rgba(255,255,255,0.08); }

.hd-modal-evidence { margin: 0; }

.hd-modal-label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.hd-modal-label span {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.hd-modal-label textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
}

.hd-modal-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.hd-modal-btn-reject {
  width: auto !important;
  flex-shrink: 0;
  border-color: var(--red,#ef4444) !important;
  color: var(--red,#ef4444) !important;
  font-size: .82rem !important;
  padding: .5rem 1rem !important;
  border-radius: 9px !important;
}
.hd-modal-btn-reject:hover {
  background: rgba(239,68,68,.08) !important;
}
.hd-modal-btn-cancel {
  width: auto !important;
  flex: 1;
  font-size: .82rem !important;
  padding: .5rem 1rem !important;
  border-radius: 9px !important;
}
.hd-modal-btn-approve {
  width: auto !important;
  flex: 2;
  font-size: .82rem !important;
  padding: .5rem 1rem !important;
  border-radius: 9px !important;
}

/* ── Modal de província — liquid glass (light + dark) ────────────────────── */
.pm-card {
  /* liquid glass — light mode */
  background: linear-gradient(
    160deg,
    rgba(255,255,255,.78) 0%,
    rgba(255,255,255,.52) 100%
  );
  backdrop-filter: blur(40px) saturate(190%) contrast(1.06);
  -webkit-backdrop-filter: blur(40px) saturate(190%) contrast(1.06);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow:
    0 24px 64px rgba(15,23,42,.13),
    0 6px 20px rgba(15,23,42,.07),
    inset 0 1.5px 0 rgba(255,255,255,.98),   /* borda luminosa no topo */
    inset 0 -1px 0 rgba(255,255,255,.30),
    inset 1px 0 0 rgba(255,255,255,.45),
    inset -1px 0 0 rgba(255,255,255,.45);
}
[data-theme="dark"] .pm-card {
  background: linear-gradient(
    160deg,
    rgba(255,255,255,.11) 0%,
    rgba(255,255,255,.05) 100%
  );
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 24px 64px rgba(0,0,0,.60),
    0 6px 20px rgba(0,0,0,.35),
    inset 0 1.5px 0 rgba(255,255,255,.18),   /* borda luminosa no topo */
    inset 0 -1px 0 rgba(255,255,255,.05),
    inset 1px 0 0 rgba(255,255,255,.07),
    inset -1px 0 0 rgba(255,255,255,.07);
}

/* ── acento superior: glow adicional via JS (cor dinâmica) ─────────────── */
#pmAccentBar {
  flex-shrink: 0;
  border-radius: .9rem .9rem 0 0;
}

/* ── cabeçalho ─────────────────────────────────────────────────────────── */
.pm-header {
  background: transparent;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
[data-theme="dark"] .pm-header {
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* ── painel do mapa ────────────────────────────────────────────────────── */
.pm-mapa-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,.18) 100%);
  border-right: 1px solid rgba(0,0,0,.06);
}
[data-theme="dark"] .pm-mapa-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(0,0,0,.12) 100%);
  border-right: 1px solid rgba(255,255,255,.07);
}

/* ── secções (deslocação + SLA) ────────────────────────────────────────── */
.pm-section {
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.80);
  border-radius: .6rem;
  padding: .75rem .9rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 2px 6px rgba(15,23,42,.05);
}
[data-theme="dark"] .pm-section {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 2px 8px rgba(0,0,0,.20);
}

/* ── label de secção ───────────────────────────────────────────────────── */
.pm-label {
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .5rem;
}

/* ── inputs ────────────────────────────────────────────────────────────── */
.pm-inp {
  width: 100%;
  padding: .28rem .3rem;
  border: 1px solid rgba(0,0,0,.13);
  border-radius: .38rem;
  /* inset — recuado no vidro */
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.07), inset 0 1px 2px rgba(0,0,0,.05);
  color: var(--ink);
  font-size: .8rem;
  text-align: center;
  font-weight: 500;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pm-inp:focus {
  border-color: var(--sky);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.06),
    0 0 0 3px rgba(14,165,233,.18);
}
[data-theme="dark"] .pm-inp {
  background: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.10);
  color: #e2e8f0;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.35), inset 0 1px 2px rgba(0,0,0,.25);
}
[data-theme="dark"] .pm-inp:focus {
  border-color: var(--sky);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,.30),
    0 0 0 3px rgba(14,165,233,.25);
}

/* ── linhas N1/N2/N3 ───────────────────────────────────────────────────── */
.pm-sla-row {
  display: grid;
  grid-template-columns: 6rem 1fr 1fr 1fr auto;
  gap: .28rem .4rem;
  align-items: center;
  padding: .38rem .4rem;
  margin-bottom: .28rem;
  border-radius: .45rem;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.65);
}
[data-theme="dark"] .pm-sla-row {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
}

/* ── botão guardar ─────────────────────────────────────────────────────── */
.pm-save-btn {
  visibility: hidden;
  padding: .24rem .6rem;
  font-size: .72rem;
  width: auto;
  border-radius: .35rem;
  background: var(--sky);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background .14s, box-shadow .14s;
  box-shadow: 0 2px 8px rgba(14,165,233,.35);
}
.pm-save-btn:hover {
  background: var(--sky-dark);
  box-shadow: 0 4px 14px rgba(14,165,233,.45);
}

/* ── botão fechar ──────────────────────────────────────────────────────── */
.pm-close-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  background: rgba(0,0,0,.07);
  border: 1px solid rgba(0,0,0,.08);
  cursor: pointer;
  color: var(--muted);
  border-radius: .4rem;
  transition: background .12s;
}
.pm-close-btn:hover { background: rgba(0,0,0,.13); }
[data-theme="dark"] .pm-close-btn {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.10);
  color: #94a3b8;
}

/* Period selector bar */
.period-bar {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
}
.period-bar > span {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.period-bar-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: .45rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.period-bar-group select {
  border: none;
  padding: .35rem .65rem;
  font-size: .82rem;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: background .12s;
  height: 34px;
}
.period-bar-group select:hover { background: var(--hover, rgba(0,0,0,.04)); }
.period-bar-group select + select { border-left: 1px solid var(--border); }
#periodAno.period-tudo { opacity: .38; pointer-events: none; }


/* ── Horário Útil — tabela de configuração ────────────────────────────────── */
.horario-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}
.horario-table th {
  text-align: left;
  padding: .28rem .55rem;
  font-size: .71rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.horario-table td {
  padding: .42rem .55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.horario-table tr:last-child td { border-bottom: none; }
.horario-table .dia-label { font-weight: 500; transition: color .15s; }
.horario-table .dia-label.encerrado { color: var(--muted); }
.horario-table input[type="time"] {
  border: 1px solid var(--border);
  border-radius: .35rem;
  padding: .26rem .42rem;
  font-size: .82rem;
  background: var(--surface);
  color: var(--ink);
  width: 7.2rem;
  transition: border-color .15s, opacity .15s;
}
.horario-table input[type="time"]:focus {
  outline: none;
  border-color: var(--primary, #0ea5e9);
}
.horario-table input[type="time"]:disabled {
  opacity: .35;
  cursor: not-allowed;
  background: var(--surface);
}
/* ── Feriados — botão de adicionar ─────────────────────────────────────────── */
.feriado-add-btn {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .26rem .55rem;
  border: 1px dashed var(--border);
  border-radius: .38rem;
  background: none;
  color: var(--primary, #0ea5e9);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.feriado-add-btn:hover { background: rgba(14,165,233,.06); border-color: rgba(14,165,233,.4); }
.feriado-add-btn.is-open { color: var(--muted); border-style: solid; }

/* ── Feriados — formulário de adição (animado) ───────────────────────────── */
.feriado-add-form {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease;
  margin-bottom: 0;
}
.feriado-add-form.is-open { grid-template-rows: 1fr; }
.feriado-add-form > div { overflow: hidden; }
.feriado-add-body {
  background: rgba(14,165,233,.04);
  border: 1px solid rgba(14,165,233,.18);
  border-radius: .45rem;
  padding: .6rem;
  margin-bottom: .55rem;
}
.feriado-add-field-label {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .18rem;
}
.feriado-add-body input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: .35rem;
  padding: .3rem .45rem;
  font-size: .82rem;
  background: var(--surface);
  color: var(--ink);
  box-sizing: border-box;
  margin-bottom: .42rem;
}
.feriado-add-body input:last-of-type { margin-bottom: 0; }
.feriado-add-body input:focus { outline: none; border-color: var(--primary, #0ea5e9); }
.feriado-add-footer {
  display: flex;
  gap: .35rem;
  justify-content: flex-end;
  margin-top: .5rem;
}

/* ── Feriados — lista ───────────────────────────────────────────────────────── */
.feriado-empty {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 1.1rem 0 .5rem;
}
.feriado-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem 0;
  border-bottom: 1px solid var(--border);
}
.feriado-item:last-child { border-bottom: none; }
/* amber date badge */
.feriado-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.22);
  border-radius: .35rem;
  padding: .15rem .38rem;
  flex-shrink: 0;
  min-width: 2.6rem;
  line-height: 1.2;
}
.feriado-badge-day  { font-size: .84rem; font-weight: 700; color: #92400e; letter-spacing: .01em; }
.feriado-badge-mon  { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #b45309; }
.feriado-info       { flex: 1; min-width: 0; }
.feriado-info-name  { font-size: .8rem; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feriado-info-year  { font-size: .69rem; color: var(--muted); }
/* icon-only action buttons */
.feriado-item-btns  { display: flex; gap: .22rem; flex-shrink: 0; }
.feriado-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: .32rem;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  color: var(--muted);
  transition: background .12s, color .12s, border-color .12s;
}
.feriado-icon-btn:hover { background: var(--hover, rgba(0,0,0,.06)); color: var(--ink); }
.feriado-icon-btn.del:hover { background: rgba(220,38,38,.08); color: #dc2626; border-color: rgba(220,38,38,.28); }
/* inline edit inputs */
.feriado-edit-wrap { display: flex; gap: .35rem; flex: 1; min-width: 0; flex-wrap: wrap; }
.feriado-edit-input {
  border: 1px solid rgba(14,165,233,.45);
  border-radius: .35rem;
  padding: .25rem .4rem;
  font-size: .8rem;
  background: var(--surface);
  color: var(--ink);
  box-sizing: border-box;
}
.feriado-edit-input:focus { outline: none; border-color: var(--primary, #0ea5e9); }
/* dark mode */
[data-theme="dark"] .feriado-badge { background: rgba(245,158,11,.13); border-color: rgba(245,158,11,.28); }
[data-theme="dark"] .feriado-badge-day { color: #fbbf24; }
[data-theme="dark"] .feriado-badge-mon { color: #f59e0b; }
[data-theme="dark"] .feriado-add-body { background: rgba(14,165,233,.07); border-color: rgba(14,165,233,.25); }
@media (prefers-color-scheme: dark) {
  .feriado-badge { background: rgba(245,158,11,.13); border-color: rgba(245,158,11,.28); }
  .feriado-badge-day { color: #fbbf24; }
  .feriado-badge-mon { color: #f59e0b; }
  .feriado-add-body { background: rgba(14,165,233,.07); border-color: rgba(14,165,233,.25); }
}
[data-theme="dark"] .pm-close-btn:hover { background: rgba(255,255,255,.15); }

/* ══ Report cards — helpdesk main list ════════════════════════════════════ */
.rpt-card {
  border-left: 4px solid transparent;
  border-radius: 14px;
  margin-bottom: .55rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.05);
  transition: box-shadow .18s ease, transform .18s ease;
}
.rpt-card:hover {
  box-shadow: 0 6px 22px rgba(0,0,0,.11), 0 0 0 1px rgba(0,0,0,.05);
  transform: translateY(-2px);
}
.rpt-card:last-child { margin-bottom: 0; }

/* priority stripe */
.rpt-p-urgent   { border-left-color: var(--red);   animation: hd-border-pulse 2s ease-in-out infinite; }
.rpt-p-escalado { border-left-color: var(--amber); }
.rpt-p-oficina  { border-left-color: var(--sky);   }

/* inner layout */
.rpt-inner {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .9rem 1.1rem;
}

/* avatar circle — tinted by priority */
.rpt-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(14,165,233,.1);
  color: var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rpt-p-urgent   .rpt-avatar { background: rgba(220,38,38,.1);  color: var(--red);   }
.rpt-p-escalado .rpt-avatar { background: rgba(217,119,6,.1);  color: var(--amber); }
.rpt-p-oficina  .rpt-avatar { background: rgba(14,165,233,.1); color: var(--sky);   }

/* info column */
.rpt-info { flex: 1 1 auto; min-width: 0; }

/* title row — name left, status badge right */
.rpt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.rpt-title {
  font-weight: 700;
  font-size: .93rem;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpt-status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.rpt-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
  flex-shrink: 0;
}

/* meta row */
.rpt-meta {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* alert badges row */
.rpt-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin-top: .5rem;
}

/* progress + action row */
.rpt-bottom {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: .65rem;
}
.rpt-progress {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.rpt-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.rpt-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}
.rpt-progress-fill.pf-done { background: var(--green); }
.rpt-progress-fill.pf-mid  { background: var(--sky);   }
.rpt-progress-fill.pf-zero { background: var(--border); }
.rpt-progress-pct {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 3.2ch;
}
.rpt-action {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .32rem .8rem;
  border-radius: 8px;
  background: var(--sky-light);
  color: var(--sky-dark);
  font-weight: 600;
  font-size: .78rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .13s, color .13s;
}
.rpt-action:hover { background: var(--sky); color: #fff; text-decoration: none; }

/* ── Theme — authGuard always sets data-theme; no @media needed ────────── */
[data-theme="light"] .rpt-card {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.05);
}
[data-theme="light"] .rpt-card:hover {
  background: #fff;
  box-shadow: 0 6px 22px rgba(0,0,0,.11), 0 0 0 1px rgba(0,0,0,.05);
}
[data-theme="light"] .rpt-action { background: var(--sky-light); color: var(--sky-dark); }
[data-theme="light"] .rpt-action:hover { background: var(--sky); color: #fff; }
[data-theme="light"] .rpt-progress-track { background: #e2e8f0; }

[data-theme="dark"] .rpt-card { background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.06); }
[data-theme="dark"] .rpt-card:hover { background: #243447; box-shadow: 0 6px 22px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.06); }
[data-theme="dark"] .rpt-avatar { background: rgba(14,165,233,.12); }
[data-theme="dark"] .rpt-p-urgent   .rpt-avatar { background: rgba(220,38,38,.15); }
[data-theme="dark"] .rpt-p-escalado .rpt-avatar { background: rgba(217,119,6,.15); }
[data-theme="dark"] .rpt-progress-track { background: rgba(255,255,255,.08); }
[data-theme="dark"] .rpt-action { background: rgba(14,165,233,.15); color: #38bdf8; }
[data-theme="dark"] .rpt-action:hover { background: var(--sky); color: #fff; }

/* ── Escalation buttons on occurrence cards ─────────────────────────────── */
.oc-escalate-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .65rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}
.oc-escalate-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--sky);
  background: var(--sky-light);
  color: var(--sky-dark);
  transition: background .13s, color .13s;
}
.oc-escalate-btn:hover { background: var(--sky); color: #fff; }
.oc-escalate-btn.oc-escalate-oficina {
  border-color: var(--amber, #f59e0b);
  background: rgba(245,158,11,.08);
  color: #92400e;
}
.oc-escalate-btn.oc-escalate-oficina:hover { background: var(--amber, #f59e0b); color: #fff; }
.oc-escalate-btn.oc-rever-btn {
  border-color: #6366f1;
  background: rgba(99,102,241,.09);
  color: #4f46e5;
}
.oc-escalate-btn.oc-rever-btn:hover { background: #6366f1; color: #fff; }

[data-theme="dark"] .oc-escalate-btn { background: rgba(14,165,233,.12); color: #38bdf8; }
[data-theme="dark"] .oc-escalate-btn:hover { background: var(--sky); color: #fff; }
[data-theme="dark"] .oc-escalate-btn.oc-escalate-oficina { background: rgba(245,158,11,.1); color: #fbbf24; }
[data-theme="dark"] .oc-escalate-btn.oc-escalate-oficina:hover { background: var(--amber, #f59e0b); color: #fff; }
[data-theme="dark"] .oc-escalate-btn.oc-rever-btn { background: rgba(99,102,241,.18); color: #818cf8; }
[data-theme="dark"] .oc-escalate-btn.oc-rever-btn:hover { background: #6366f1; color: #fff; }

/* ── Completed visit banner ──────────────────────────────────────────────── */
.visit-done-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1.5px solid #16a34a;
  background: rgba(22,163,74,.08);
}
.visit-done-title {
  font-weight: 700;
  font-size: .95rem;
  color: #15803d;
}
.visit-done-sub {
  font-size: .82rem;
  color: #16a34a;
  margin-top: .1rem;
}
[data-theme="dark"] .visit-done-banner {
  background: rgba(22,163,74,.13);
  border-color: rgba(22,163,74,.4);
}
[data-theme="dark"] .visit-done-title { color: #4ade80; }
[data-theme="dark"] .visit-done-sub   { color: #86efac; }

/* ── Reclamações page ────────────────────────────────────────────────────── */
.rec-form-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.rec-tipo-row {
  display: flex;
  gap: .5rem;
}
.rec-tipo-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem .8rem;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .13s, background .13s, color .13s;
}
.rec-tipo-btn.is-active {
  border-color: var(--sky);
  background: var(--sky-light);
  color: var(--sky-dark);
}
.rec-tipo-btn.is-active.rec-tipo-phone {
  border-color: var(--amber, #f59e0b);
  background: rgba(245,158,11,.09);
  color: #92400e;
}
[data-theme="dark"] .rec-tipo-btn.is-active           { background: rgba(14,165,233,.12); color: #38bdf8; }
[data-theme="dark"] .rec-tipo-btn.is-active.rec-tipo-phone { background: rgba(245,158,11,.12); color: #fbbf24; }

.rec-file-area {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: .8rem 1rem;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .13s, background .13s;
}
.rec-file-area:hover, .rec-file-area.is-drag { border-color: var(--sky); background: var(--sky-light); }
.rec-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .4rem;
}
.rec-file-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  background: var(--sky-light);
  color: var(--sky-dark);
  border-radius: 6px;
  font-size: .76rem;
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rec-file-chip button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  flex-shrink: 0;
}
.rec-file-chip button:hover { opacity: 1; }
[data-theme="dark"] .rec-file-chip { background: rgba(14,165,233,.12); color: #38bdf8; }

.rec-list { display: flex; flex-direction: column; gap: .65rem; }
.rec-item {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: .85rem 1rem;
}
[data-theme="light"] .rec-item { background: #fff; }
[data-theme="dark"]  .rec-item { background: #1e293b; }
.rec-item-header {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.rec-item-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.rec-item-subject {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  margin-bottom: .15rem;
}
.rec-item-info {
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .8rem;
}
.rec-item-desc {
  margin-top: .55rem;
  font-size: .84rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.rec-item-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
}
.rec-attach-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .55rem;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 600;
  background: var(--sky-light);
  color: var(--sky-dark);
  text-decoration: none;
  transition: background .12s;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.rec-attach-link:hover { background: var(--sky); color: #fff; text-decoration: none; }
[data-theme="dark"] .rec-attach-link { background: rgba(14,165,233,.12); color: #38bdf8; }
.rec-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: .25rem;
  border-radius: 6px;
  transition: color .12s, background .12s;
}
.rec-delete-btn:hover { color: var(--red, #dc2626); background: rgba(220,38,38,.08); }
.rec-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.rec-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: flex-end;
  margin-bottom: .75rem;
}
.rec-filter-row label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.rec-filter-row select,
.rec-filter-row input[type="date"],
.rec-filter-row input[type="text"] {
  font-size: .82rem;
  padding: .32rem .6rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}
.rec-filter-row .rec-filter-clear {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .32rem .65rem;
  font-size: .78rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.rec-filter-row .rec-filter-clear:hover { border-color: var(--sky); color: var(--sky); }
.rec-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--muted);
}
.rec-pagination button {
  padding: .3rem .75rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: .8rem;
  transition: border-color .12s, background .12s;
}
.rec-pagination button:disabled { opacity: .4; cursor: default; }
.rec-pagination button:not(:disabled):hover { border-color: var(--sky); background: var(--sky-light); }

/* Small field label shared on reclamacoes form */
.rec-field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
}

/* Canal selector cards */
.rec-canal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.rec-canal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1rem .75rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
  text-align: center;
}
.rec-canal-card:hover { border-color: var(--sky); color: var(--sky); }
.rec-canal-icon { font-size: 0; line-height: 0; }
.rec-canal-label { font-size: .9rem; font-weight: 700; color: inherit; }
.rec-canal-desc  { font-size: .75rem; color: var(--muted); }
.rec-canal-card.is-active {
  border-color: var(--sky);
  background: var(--sky-light);
  color: var(--sky-dark);
  box-shadow: 0 0 0 3px rgba(14,165,233,.1);
}
.rec-canal-card.is-active .rec-canal-desc { color: var(--sky-dark); opacity: .7; }
.rec-canal-card.is-active.rec-tipo-phone {
  border-color: var(--amber, #f59e0b);
  background: rgba(245,158,11,.08);
  color: #92400e;
  box-shadow: 0 0 0 3px rgba(245,158,11,.1);
}
.rec-canal-card.is-active.rec-tipo-phone .rec-canal-desc { color: #92400e; }
[data-theme="dark"] .rec-canal-card.is-active           { background: rgba(14,165,233,.12); color: #38bdf8; }
[data-theme="dark"] .rec-canal-card.is-active .rec-canal-desc { color: #38bdf8; opacity: .7; }
[data-theme="dark"] .rec-canal-card.is-active.rec-tipo-phone { background: rgba(245,158,11,.12); color: #fbbf24; }
[data-theme="dark"] .rec-canal-card.is-active.rec-tipo-phone .rec-canal-desc { color: #fbbf24; }

/* AI analysis result block on complaint card */
.rec-ia-block {
  margin-top: .6rem;
  padding: .55rem .75rem;
  border-radius: 9px;
  border: 1px solid rgba(14,165,233,.2);
  background: rgba(14,165,233,.05);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
[data-theme="dark"] .rec-ia-block { background: rgba(14,165,233,.08); border-color: rgba(14,165,233,.18); }
.rec-ia-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rec-ia-resumo {
  font-size: .82rem;
  color: var(--ink);
  font-style: italic;
}
.rec-ia-temas {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.rec-ia-tema {
  font-size: .72rem;
  padding: .15rem .48rem;
  border-radius: 5px;
  background: var(--sky-light);
  color: var(--sky-dark);
  font-weight: 600;
}
[data-theme="dark"] .rec-ia-tema { background: rgba(14,165,233,.12); color: #38bdf8; }
.rec-ia-loading {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem 0;
}
.rec-ia-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* badge for encaminhamento */
.badge-oficina { background: rgba(139,92,246,.12); color: #6d28d9; }
[data-theme="dark"] .badge-oficina { background: rgba(139,92,246,.18); color: #a78bfa; }

/* Compact complaint items in side-col */
.rec-item-compact {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: .65rem .8rem;
  background: var(--surface);
}
[data-theme="light"] .rec-item-compact { background: #fff; }
[data-theme="dark"]  .rec-item-compact { background: #1e293b; }

/* Botão voltar (navegação rápida entre páginas) */
.back-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.back-link-btn:hover {
  background: var(--surface);
  border-color: var(--sky);
  color: var(--sky);
  transform: translateX(-2px);
}
.back-link-btn svg {
  transition: transform 0.15s ease;
}
.back-link-btn:hover svg {
  transform: translateX(-2px);
}

/* ── Dashboard de Inquéritos de Satisfação ───────────────────────────────────── */
.survey-questions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .survey-questions-grid {
    grid-template-columns: 1fr;
  }
}

.question-analysis-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.question-analysis-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}


.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sky-light);
  color: var(--sky-dark);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.question-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
  line-height: 1.35;
}

.question-total-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.question-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.survey-bar-row {
  cursor: pointer;
  border-radius: 0.45rem;
  padding: 0.4rem 0.55rem;
  background: var(--surface);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.survey-bar-row:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.3);
  transform: translateX(3px);
}

.survey-bar-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.survey-bar-label {
  font-weight: 600;
  color: var(--ink);
}

.survey-bar-count {
  font-size: 0.78rem;
  color: var(--muted);
}

.survey-bar-count strong {
  color: var(--ink);
}

.survey-bar-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

[data-theme="dark"] .survey-bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.survey-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.option-good .survey-bar-fill { background: #16a34a; }
.option-sky .survey-bar-fill  { background: #0ea5e9; }
.option-neutral .survey-bar-fill { background: #94a3b8; }
.option-warn .survey-bar-fill { background: #f59e0b; }
.option-bad .survey-bar-fill  { background: #dc2626; }

/* ── Autocomplete de Clientes ────────────────────────────────────────────────── */
.client-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.client-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.client-autocomplete-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.client-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  transition: background 0.12s ease, color 0.12s ease;
}

.client-autocomplete-item:last-child {
  border-bottom: none;
}

.client-autocomplete-item:hover,
.client-autocomplete-item.is-active {
  background: rgba(14, 165, 233, 0.1);
  color: var(--sky);
}

.client-autocomplete-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-autocomplete-name strong {
  color: var(--sky);
  font-weight: 700;
}

.client-autocomplete-badge {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.client-autocomplete-new {
  border-top: 1px dashed var(--border);
  background: rgba(14, 165, 233, 0.04);
  font-size: 0.84rem;
  color: var(--sky);
}

.client-autocomplete-new:hover,
.client-autocomplete-new.is-active {
  background: rgba(14, 165, 233, 0.14);
}

.new-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--sky);
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  margin-right: 0.35rem;
  display: inline-block;
  vertical-align: middle;
}

/* ── Layout em Duas Colunas para Inquéritos ──────────────────────────────────── */
.inqueritos-two-column-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 1.25rem;
  align-items: start;
}

.inqueritos-main-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.inqueritos-side-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 1080px) {
  .inqueritos-two-column-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Estilo de Cartões de Estatísticas Inspirados no Dashboard ────────────────── */
.clean-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 98px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.clean-stat-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.clean-stat-card.clickable {
  cursor: pointer;
}

.clean-stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: var(--sky);
}

.clean-stat-card.clickable:active {
  transform: translateY(0);
}

.clean-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.clean-stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.clean-stat-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clean-stat-icon-badge.sky    { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.clean-stat-icon-badge.green  { background: rgba(22, 163, 74, 0.12);  color: #16a34a; }
.clean-stat-icon-badge.amber  { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.clean-stat-icon-badge.purple { background: rgba(147, 51, 234, 0.12); color: #9333ea; }
.clean-stat-icon-badge.red    { background: rgba(220, 38, 38, 0.12);  color: #dc2626; }

.clean-stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.clean-stat-caption {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

[data-theme="dark"] .clean-stat-card {
  background: #1e2d40;
}

[data-theme="dark"] .clean-stat-icon-badge.sky    { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
[data-theme="dark"] .clean-stat-icon-badge.green  { background: rgba(34, 197, 94, 0.2);  color: #4ade80; }
[data-theme="dark"] .clean-stat-icon-badge.amber  { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="dark"] .clean-stat-icon-badge.purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
[data-theme="dark"] .clean-stat-icon-badge.red    { background: rgba(239, 68, 68, 0.2);  color: #f87171; }

/* ── Modern Donut Cards ─────────────────────────────────────────────────────── */
.modern-donut-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 320px;
}

.modern-donut-card.clickable {
  cursor: pointer;
}

.modern-donut-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  border-color: var(--sky);
}

.modern-donut-body {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.15rem auto;
  width: 170px;
  height: 170px;
}

.modern-donut-canvas-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  max-width: 110px;
}

.modern-donut-percent {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.modern-donut-center-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.modern-donut-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.45rem;
  text-align: center;
  padding-top: 0.95rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.modern-donut-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modern-donut-stat-val {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.modern-donut-stat-val.text-good  { color: #16a34a; }
.modern-donut-stat-val.text-bad   { color: #dc2626; }
.modern-donut-stat-val.text-sky   { color: #0284c7; }
.modern-donut-stat-val.text-amber { color: #d97706; }

.card:has(.location-picker.is-open),
.card.is-dropdown-open {
  position: relative;
  z-index: 1000 !important;
}
.location-picker {
  position: relative;
  margin-top: .35rem;
}
.location-picker.is-open {
  z-index: 1001 !important;
}
.location-picker-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.location-picker-trigger:hover,
.location-picker.is-open .location-picker-trigger {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(14,165,233,.14);
}
.location-picker-placeholder {
  color: var(--muted);
}
.location-picker-chevron {
  color: var(--muted);
  transition: transform .15s ease;
}
.location-picker.is-open .location-picker-chevron {
  transform: rotate(180deg);
}
.location-picker-menu {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: .4rem;
  border: 1.5px solid #cbd5e1;
  border-radius: .7rem;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15,23,42,.22), 0 4px 12px rgba(15,23,42,.1);
  z-index: 99999 !important;
}

.modern-donut-stat-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.15rem;
  text-transform: capitalize;
}

.modern-donut-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.75rem;
  margin-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.modern-donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink);
}

.modern-donut-legend-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.modern-donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.modern-donut-legend-name {
  color: var(--muted);
  font-size: 0.78rem;
}

.modern-donut-legend-count {
  font-weight: 700;
  color: var(--ink);
}

[data-theme="dark"] .modern-donut-card {
  background: #1e2d40;
}

/* ── Padronização Global de Stat Cards (Portal Tickets Style) ─────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-2px);
}

.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 0.35rem;
}

.dash-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.dash-icon-box:hover {
  transform: scale(1.05);
}

/* ── Header Row & Select Sizing (Sem cortes nem transbordamentos) ────────── */
.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 240px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.period-bar-group select {
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
  height: 34px;
}

#periodMes {
  min-width: 100px;
}

#periodAno {
  min-width: 68px;
}

/* ── Donut Grid Layout (Grelha 2x2 perfeitamente equilibrada) ─────────────── */
.donut-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 1600px) {
  .donut-panel-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .donut-panel-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Ticket Detail View (Portal Tickets Inspired Design) ───────────────────── */
.ticket-hero-layout {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.ticket-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ticket-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.ticket-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ticket-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.ticket-badges-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.15rem 0;
}

.ticket-sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.ticket-sla-pill.excedido {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.ticket-sla-pill.resolvido {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.25);
}

.ticket-body-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .ticket-body-grid {
    grid-template-columns: 1fr;
  }
}

.ticket-side-boxes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.card {
  position: relative;
}
.card:has(.location-picker.is-open),
.card.is-dropdown-open {
  position: relative;
  z-index: 1000 !important;
}
.location-picker {
  position: relative;
  margin-top: .35rem;
}
.location-picker.is-open {
  z-index: 1001 !important;
}
.location-picker-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.location-picker-trigger:hover,
.location-picker.is-open .location-picker-trigger {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(14,165,233,.14);
}
.location-picker-placeholder {
  color: var(--muted);
}
.location-picker-chevron {
  color: var(--muted);
  transition: transform .15s ease;
}
.location-picker.is-open .location-picker-chevron {
  transform: rotate(180deg);
}
.location-picker-menu {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: .4rem;
  border: 1.5px solid #cbd5e1;
  border-radius: .7rem;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15,23,42,.22), 0 4px 12px rgba(15,23,42,.1);
  z-index: 99999 !important;
}

.ticket-stat-box {
  border-radius: 0.65rem;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid transparent;
}

.ticket-stat-box.box-apv {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.18);
}

.ticket-stat-box.box-estado {
  background: rgba(147, 51, 234, 0.08);
  border-color: rgba(147, 51, 234, 0.18);
}

.ticket-stat-box-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.ticket-stat-box.box-apv .ticket-stat-box-lbl {
  color: #6366f1;
}

.ticket-stat-box.box-estado .ticket-stat-box-lbl {
  color: #9333ea;
}

.ticket-stat-box-val {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.ticket-stat-box.box-apv .ticket-stat-box-val {
  color: #4f46e5;
}

.ticket-stat-box.box-estado .ticket-stat-box-val {
  color: #7e22ce;
}

[data-theme="dark"] .ticket-stat-box.box-apv {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .ticket-stat-box.box-apv .ticket-stat-box-val {
  color: #a5b4fc;
}

[data-theme="dark"] .ticket-stat-box.box-estado {
  background: rgba(147, 51, 234, 0.15);
  border-color: rgba(147, 51, 234, 0.3);
}

[data-theme="dark"] .ticket-stat-box.box-estado .ticket-stat-box-val {
  color: #d8b4fe;
}

.ticket-info-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.95rem 1.15rem;
}

@media (max-width: 600px) {
  .ticket-info-grid-2col {
    grid-template-columns: 1fr;
  }
}

.ticket-info-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.35rem 0.15rem;
}

.ticket-info-cell-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.2);
  transition: all 0.2s ease;
}

.ticket-info-cell-icon.icon-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.22);
}

.ticket-info-cell-icon.icon-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.22);
}

.ticket-info-cell-icon.icon-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.22);
}

.ticket-info-cell-icon.icon-purple {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border-color: rgba(147, 51, 234, 0.22);
}

.ticket-info-cell-icon.icon-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.22);
}

.ticket-info-cell-icon.icon-rose {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  border-color: rgba(244, 63, 94, 0.22);
}

.ticket-info-cell-icon.icon-red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.22);
}

.ticket-info-cell-icon.icon-sky {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.22);
}

[data-theme="dark"] .ticket-info-cell-icon.icon-blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-amber { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-green { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-purple { background: rgba(147, 51, 234, 0.18); color: #d8b4fe; border-color: rgba(147, 51, 234, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-cyan { background: rgba(6, 182, 212, 0.18); color: #67e8f9; border-color: rgba(6, 182, 212, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-rose { background: rgba(244, 63, 94, 0.18); color: #fda4af; border-color: rgba(244, 63, 94, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-red { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
[data-theme="dark"] .ticket-info-cell-icon.icon-sky { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.35); }

.ticket-info-cell-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.ticket-info-cell-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

/* ── Modern APV Workflow & Form Components ────────────────────────────────── */
.apv-create-trigger-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 0.55rem 1rem !important;
  border-radius: 0.65rem !important;
  transition: all 0.2s ease !important;
}

.apv-create-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45) !important;
  filter: brightness(1.05);
}

.apv-form-panel {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.2s ease;
}

[data-theme="dark"] .apv-form-panel {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.apv-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.apv-form-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.apv-form-main-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.apv-form-subtitle {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* OCR Dropzone */
.apv-ocr-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.01) 100%);
  transition: all 0.2s ease;
  cursor: pointer;
}

.apv-ocr-dropzone:hover,
.apv-ocr-dropzone.is-dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.09);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .apv-ocr-dropzone {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

.apv-ocr-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.apv-ocr-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .apv-ocr-icon {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.apv-ocr-text {
  min-width: 0;
}

.apv-ocr-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.apv-ocr-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.apv-ocr-btn {
  width: auto !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0.45rem 0.85rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  white-space: nowrap !important;
  flex-shrink: 0;
  border-radius: 8px !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
  background: #ffffff !important;
  color: #4f46e5 !important;
}

.apv-ocr-btn:hover {
  background: #f5f3ff !important;
  border-color: #6366f1 !important;
}

[data-theme="dark"] .apv-ocr-btn {
  background: var(--bg-card) !important;
  color: #a5b4fc !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
}

.apv-ocr-status {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
  animation: fadeIn 0.2s ease;
}

/* Fields & Form Groups */
.apv-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.apv-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.apv-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0;
}

.apv-field-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
}

.apv-required {
  color: #ef4444;
  font-weight: 800;
}

.apv-count-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  text-transform: none;
}

.apv-input,
.apv-textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 0.6rem 0.85rem !important;
  font-size: 0.88rem !important;
  color: var(--ink) !important;
  background: var(--bg-card, #ffffff) !important;
  transition: all 0.15s ease !important;
  min-height: auto;
}

.apv-textarea {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.apv-input:focus,
.apv-textarea:focus {
  outline: none !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

[data-theme="dark"] .apv-input,
[data-theme="dark"] .apv-textarea {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

/* Occurrence Checkbox Cards */
.apv-occurrences-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}

.apv-oc-card {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  padding: 0.75rem 0.85rem !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  background: var(--bg-card, #ffffff) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin-bottom: 0 !important;
  position: relative;
}

.apv-oc-card:hover {
  border-color: rgba(99, 102, 241, 0.4) !important;
  background: rgba(99, 102, 241, 0.02) !important;
}

.apv-oc-card.is-selected {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.05) !important;
  box-shadow: 0 0 0 1px #6366f1;
}

.apv-oc-card.is-oficina {
  border-left: 3.5px solid #0ea5e9 !important;
}

.apv-oc-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  background: var(--surface) !important;
}

[data-theme="dark"] .apv-oc-card {
  background: var(--surface) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .apv-oc-card.is-selected {
  border-color: #818cf8 !important;
  background: rgba(99, 102, 241, 0.12) !important;
  box-shadow: 0 0 0 1px #818cf8;
}

.apv-oc-checkbox-input {
  width: 18px !important;
  height: 18px !important;
  accent-color: #6366f1;
  margin-top: 0.15rem !important;
  flex-shrink: 0;
  cursor: pointer;
}

.apv-oc-card-body {
  flex: 1;
  min-width: 0;
}

.apv-oc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.apv-oc-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.apv-oc-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.apv-oc-card-evidence {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.25rem;
}

/* Actions */
.apv-form-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.apv-action-btn {
  flex: 1 !important;
  width: auto !important;
  padding: 0.65rem 1rem !important;
  font-size: 0.88rem !important;
  border-radius: 9px !important;
}

/* Fechar APV Panel */
.apv-fechar-panel {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: fadeIn 0.2s ease;
}

[data-theme="dark"] .apv-fechar-panel {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
}

.apv-fechar-oc-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.apv-fechar-oc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

[data-theme="dark"] .apv-fechar-oc-row {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

.apv-fechar-oc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.apv-fechar-oc-tema {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.apv-fechar-oc-evidencia {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apv-fechar-select {
  width: auto !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card, #ffffff) !important;
  color: var(--ink) !important;
  cursor: pointer;
}

/* Side Column Global Form Safety */
.side-col .field-row,
.side-col .form-row,
.side-col [style*="grid-template-columns:1fr 1fr"],
.side-col [style*="grid-template-columns: 1fr 1fr"] {
  grid-template-columns: 1fr !important;
  gap: 0.85rem !important;
}

/* ── Barra Superior e Ações do Ticket (Sempre em Linha) ─────────────────────── */
.visita-top-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  margin-bottom: 0.85rem !important;
  flex-wrap: wrap !important;
}

.visita-breadcrumb {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-size: 0.85rem !important;
  color: var(--muted) !important;
}

.visita-top-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.5rem !important;
  flex-wrap: nowrap !important;
}

.visita-top-actions button,
.visita-top-actions .primary-button,
.visita-top-actions .secondary-button {
  width: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
  margin: 0 !important;
  height: 34px !important;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.82rem !important;
}

.visita-top-actions button.is-hidden,
.visita-top-actions button[style*="display: none"],
.visita-top-actions button[style*="display:none"] {
  display: none !important;
}

/* ── Section Title & Modern Section Icon Boxes ──────────────────────────────── */
.section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.section-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.section-title-icon.icon-blue   { background: rgba(59, 130, 246, 0.12); color: #2563eb; border-color: rgba(59, 130, 246, 0.22); }
.section-title-icon.icon-amber  { background: rgba(245, 158, 11, 0.12); color: #d97706; border-color: rgba(245, 158, 11, 0.22); }
.section-title-icon.icon-green  { background: rgba(16, 185, 129, 0.12); color: #059669; border-color: rgba(16, 185, 129, 0.22); }
.section-title-icon.icon-purple { background: rgba(147, 51, 234, 0.12); color: #9333ea; border-color: rgba(147, 51, 234, 0.22); }
.section-title-icon.icon-cyan   { background: rgba(6, 182, 212, 0.12); color: #0891b2; border-color: rgba(6, 182, 212, 0.22); }
.section-title-icon.icon-rose   { background: rgba(244, 63, 94, 0.12); color: #e11d48; border-color: rgba(244, 63, 94, 0.22); }
.section-title-icon.icon-red    { background: rgba(239, 68, 68, 0.12); color: #dc2626; border-color: rgba(239, 68, 68, 0.22); }
.section-title-icon.icon-sky    { background: rgba(14, 165, 233, 0.12); color: #0284c7; border-color: rgba(14, 165, 233, 0.22); }

[data-theme="dark"] .section-title-icon.icon-blue   { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
[data-theme="dark"] .section-title-icon.icon-amber  { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
[data-theme="dark"] .section-title-icon.icon-green  { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
[data-theme="dark"] .section-title-icon.icon-purple { background: rgba(147, 51, 234, 0.18); color: #d8b4fe; border-color: rgba(147, 51, 234, 0.35); }
[data-theme="dark"] .section-title-icon.icon-cyan   { background: rgba(6, 182, 212, 0.18); color: #67e8f9; border-color: rgba(6, 182, 212, 0.35); }
[data-theme="dark"] .section-title-icon.icon-rose   { background: rgba(244, 63, 94, 0.18); color: #fda4af; border-color: rgba(244, 63, 94, 0.35); }
[data-theme="dark"] .section-title-icon.icon-red    { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
[data-theme="dark"] .section-title-icon.icon-sky    { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.35); }

/* ── Ticket Hub (Painel Unificado com Abas Modernas) ─────────────────────────── */
.ticket-hub-card {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 0.85rem;
}

.ticket-hub-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.85rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.ticket-hub-nav::-webkit-scrollbar {
  display: none;
}

.ticket-hub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 0.6rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ticket-hub-tab-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .ticket-hub-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ticket-hub-tab-btn.active {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .ticket-hub-tab-btn.active {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hd-modal {
  max-width: 540px;
  text-align: left;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hd-modal-wide {
  max-width: 780px !important;
  width: 95vw !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
}
.hd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .6rem;
  background: var(--surface, var(--bg));
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .65rem;
  max-height: 280px;
  overflow-y: auto;
}
.hd-gallery-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: .45rem;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: rgba(0,0,0,0.03);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hd-gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-color: var(--primary, #0ea5e9);
}
.hd-gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hd-gallery-card-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd-gallery-card-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: .5rem;
  text-align: center;
  background: rgba(239,68,68,0.06);
  color: #ef4444;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.72rem;
  gap: 4px;
}
.hd-gallery-card-pdf:hover {
  background: rgba(239,68,68,0.12);
}

.ticket-hub-tab-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ticket-hub-tab-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  line-height: 1;
}

.ticket-hub-tab-btn.active .ticket-hub-tab-badge {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}

.ticket-hub-panes {
  padding: 1.25rem 1.35rem;
}

.ticket-hub-pane {
  animation: fadeIn 0.2s ease;
}

/* ── Empty State Boxes ──────────────────────────────────────────────────────── */
.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.empty-state-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.empty-state-sub {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.45;
}

/* ── Ocorrências Redesenhadas (Visita Detalhes - Compacto & Full Width) ──────── */
.oc-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  border-left: 4px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .oc-card {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.oc-card:hover {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.oc-card.is-done {
  border-left-color: #16a34a !important;
  background: rgba(22, 163, 74, 0.015);
}

.oc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.oc-card-top-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.oc-card-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oc-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
  margin-right: 0.25rem;
}

.oc-compact-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.oc-evidence-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
}

[data-theme="dark"] .oc-evidence-row {
  background: rgba(255, 255, 255, 0.03);
}

.oc-decision-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.06);
  border-left: 3px solid #0ea5e9;
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.65rem;
}

[data-theme="dark"] .oc-decision-row {
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
}

.oc-row-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  flex-shrink: 0;
}

.oc-row-tag.tag-sky {
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.oc-row-val {
  flex: 1;
}

.oc-photos-grid {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0.25rem 0;
}

.oc-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.oc-escalate-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.oc-escalate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.oc-escalate-btn:hover {
  background: var(--bg-card);
  border-color: var(--sky);
  color: var(--sky-dark);
}

/* ── Timeline Resumo e Passos Verticais ──────────────────────────────────────── */
.timeline-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.timeline-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.timeline-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.visit-timeline-steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  position: relative;
}

.visit-timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  position: relative;
}

.visit-timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: -22px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.visit-timeline-step.is-done:not(:last-child)::after {
  background: rgba(22, 163, 74, 0.4);
}

.visit-timeline-step-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--muted);
  z-index: 1;
  position: relative;
}

.visit-timeline-step.is-done .visit-timeline-step-icon {
  background: rgba(22, 163, 74, 0.12);
  border-color: #16a34a;
  color: #16a34a;
}

.visit-timeline-step.is-warn .visit-timeline-step-icon {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #d97706;
}

.visit-timeline-step.is-current .visit-timeline-step-icon {
  background: rgba(14, 165, 233, 0.12);
  border-color: #0ea5e9;
  color: #0284c7;
  animation: visit-timeline-pulse 1.8s ease-in-out infinite;
}

.visit-timeline-step-body {
  flex: 1;
  min-width: 0;
}

.visit-timeline-step-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.visit-timeline-step-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.visit-timeline-step-meta span:not(:last-child)::after {
  content: '·';
  margin-left: 0.45rem;
  color: var(--border);
}

/* ── Novo Fluxo & Percurso da Ocorrência (Pipeline Visual) ───────────────────── */
.oc-flow-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-top: 0.85rem;
}

.oc-flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.oc-flow-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
}

.oc-flow-track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.2rem 0.1rem;
  scrollbar-width: thin;
}

.oc-flow-node {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
}

[data-theme="dark"] .oc-flow-node {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.08);
}

.oc-flow-node.is-done {
  background: rgba(22, 163, 74, 0.06);
  border-color: rgba(22, 163, 74, 0.25);
}

.oc-flow-node.is-done .oc-flow-icon {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}

.oc-flow-node.is-current {
  background: rgba(14, 165, 233, 0.06);
  border-color: rgba(14, 165, 233, 0.3);
}

.oc-flow-node.is-current .oc-flow-icon {
  background: rgba(14, 165, 233, 0.15);
  color: #0284c7;
}

.oc-flow-node.is-warn {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
}

.oc-flow-node.is-warn .oc-flow-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.oc-flow-node.is-pending {
  background: transparent;
  border-style: dashed;
  opacity: 0.65;
}

.oc-flow-node.is-pending .oc-flow-icon {
  background: var(--border);
  color: var(--muted);
}

.oc-flow-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.oc-flow-info {
  display: flex;
  flex-direction: column;
}

.oc-flow-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.oc-flow-meta {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 1px;
}

.oc-flow-conn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0 0.1rem;
}

.oc-flow-line {
  width: 12px;
  height: 1.5px;
  background: var(--border);
}

.oc-flow-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.oc-flow-arrow {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}

/* ── Barra de Período e Ações de Topo (Dashboard / Admin / Inquéritos) ───────── */
.dash-header-right {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  flex-wrap: wrap !important;
}

.period-bar {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

.period-bar-group {
  display: inline-flex !important;
  align-items: center !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0.55rem !important;
  padding: 3px 4px !important;
  gap: 6px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.period-bar-group select {
  height: 32px !important;
  padding: 0 1.65rem 0 0.65rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  background-color: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0.4rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  width: auto !important;
  max-width: none !important;
}

[data-theme="dark"] .period-bar-group select {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.period-bar-group select:hover,
.period-bar-group select:focus {
  border-color: #0ea5e9 !important;
  outline: none !important;
}

#exportExcelButton,
#btnExportarExcel,
#btnExportarGeralExcel,
#btnExportarHelpdeskExcel,
#btnExportarSlaExcel,
.btn-export-excel {
  height: 36px !important;
  width: auto !important;
  max-width: max-content !important;
  padding: 0 0.95rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

#btnExportarExcel.secondary-button,
.secondary-button.btn-export-excel {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

#btnExportarExcel.secondary-button:hover,
.secondary-button.btn-export-excel:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}

#exportExcelButton,
#btnExportarGeralExcel,
#btnExportarHelpdeskExcel,
#btnExportarSlaExcel,
.primary-button.btn-export-excel {
  background: #0ea5e9 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.25) !important;
}

#exportExcelButton:hover,
#btnExportarGeralExcel:hover,
#btnExportarHelpdeskExcel:hover,
#btnExportarSlaExcel:hover,
.primary-button.btn-export-excel:hover {
  background: #0284c7 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35) !important;
}

/* ── Módulo de Reclamações (Redesign Moderno) ────────────────────────────────── */
.rec-page-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .rec-page-layout {
    grid-template-columns: 1fr;
  }
}

.rec-hero-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
}

.rec-form-panel {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
}

.rec-form-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.rec-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rec-field-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.rec-canal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .rec-canal-grid {
    grid-template-columns: 1fr;
  }
}

.rec-canal-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all 0.2s ease;
}

.rec-canal-card:hover {
  border-color: var(--sky);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.rec-canal-card.is-active {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.06);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.rec-canal-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rec-canal-card.rec-tipo-phone .rec-canal-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.rec-canal-card.is-active .rec-canal-icon {
  background: #0ea5e9;
  color: #ffffff;
}

.rec-canal-card.rec-tipo-phone.is-active .rec-canal-icon {
  background: #f59e0b;
  color: #ffffff;
}

.rec-canal-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rec-canal-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
}

.rec-canal-desc {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.rec-canal-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.rec-canal-card.is-active .rec-canal-check {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #ffffff;
}

.rec-canal-card.rec-tipo-phone.is-active .rec-canal-check {
  background: #f59e0b;
  border-color: #f59e0b;
}

.rec-fields-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .rec-fields-2col {
    grid-template-columns: 1fr;
  }
}

.rec-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rec-input-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.rec-input-group input,
.rec-input-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.rec-input-group input:focus,
.rec-input-group textarea:focus {
  border-color: #0ea5e9;
  background: var(--bg-card, #ffffff);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  outline: none;
}

.rec-file-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.15rem;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.rec-file-area:hover,
.rec-file-area.is-drag {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.04);
}

.rec-file-area-icon {
  color: #0ea5e9;
}

.rec-file-area-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

#recFileAreaLabel {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.rec-file-area-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.rec-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.rec-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}

.rec-file-chip button {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0;
}

.rec-file-chip button:hover {
  color: var(--red, #dc2626);
}

.rec-submit-btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 8px;
  width: 100%;
}

/* Sidebar History */
.rec-sidebar-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
}

.rec-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.rec-filters-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.rec-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.rec-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rec-filter-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.rec-filter-field select,
.rec-filter-field input {
  height: 32px;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card, #ffffff);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .rec-filter-field select,
[data-theme="dark"] .rec-filter-field input {
  background: rgba(255, 255, 255, 0.05);
}

.rec-filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.rec-filter-clear {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0284c7;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.rec-filter-clear:hover {
  background: rgba(14, 165, 233, 0.1);
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rec-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3.5px solid #0ea5e9;
  border-radius: 9px;
  padding: 0.75rem 0.85rem;
  transition: all 0.15s ease;
}

.rec-item-card.is-phone {
  border-left-color: #f59e0b;
}

.rec-item-card:hover {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rec-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.rec-item-meta {
  flex: 1;
  min-width: 0;
}

.rec-item-subject {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
}

.rec-item-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.rec-client-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 600;
  color: var(--ink);
}

.rec-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.rec-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.rec-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}

.rec-item-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink);
  margin-top: 0.45rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-item-attachments {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.rec-attach-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rec-attach-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: #0284c7;
  text-decoration: none;
}

.rec-attach-link:hover {
  border-color: #0ea5e9;
}

/* AI Analysis Block */
.rec-ia-block {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
  margin-top: 0.55rem;
}

.rec-ia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.rec-ia-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: #7c3aed;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rec-ia-badges {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.rec-ia-resumo {
  font-size: 0.76rem;
  color: var(--ink);
  line-height: 1.4;
}

.rec-ia-temas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.rec-ia-tema {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
}

[data-theme="dark"] .rec-ia-tema {
  color: #c4b5fd;
}

.rec-empty {
  text-align: center;
  padding: 2.25rem 1rem;
}

.rec-empty-icon {
  color: var(--muted);
  opacity: 0.65;
  margin-bottom: 0.5rem;
}

.rec-empty-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.rec-empty-sub {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.rec-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.rec-pagination-info {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── Fila do Helpdesk & APVs Sidebar Redesign ───────────────────────────────── */
.hd-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 1rem;
}

.hd-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 130px;
}

.hd-filter-item.full-w {
  flex: 1 1 100%;
}

.hd-filter-item.span-2 {
  grid-column: span 2;
}

.hd-filter-item label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.hd-filter-item select,
.hd-filter-item input {
  height: 34px;
  padding: 0 0.65rem;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card, #ffffff);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

[data-theme="dark"] .hd-filter-item select,
[data-theme="dark"] .hd-filter-item input {
  background: rgba(255, 255, 255, 0.05);
}

.hd-filter-item select:focus,
.hd-filter-item input:focus {
  border-color: #0ea5e9;
  outline: none;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.hd-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.hd-search-input-wrap .hd-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}

.hd-search-input-wrap input {
  padding-left: 2.1rem !important;
  padding-right: 1.8rem !important;
}

.hd-search-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.72rem;
  line-height: 1;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  transition: all 0.15s ease;
}

.hd-search-clear-btn:hover {
  background: var(--border);
  color: var(--ink);
}

/* Fila Reports List */
.hd-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hd-report-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-left: 3.5px solid #0ea5e9;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  transition: all 0.18s ease;
}

.hd-report-card.is-urgent {
  border-left-color: #ef4444;
}

.hd-report-card.is-escalado {
  border-left-color: #f59e0b;
}

.hd-report-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(14, 165, 233, 0.4);
}

.hd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hd-card-client-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.hd-client-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.08);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hd-report-card.is-urgent .hd-client-icon-box {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.hd-report-card.is-escalado .hd-client-icon-box {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
}

.hd-client-text-wrap {
  min-width: 0;
  flex: 1;
}

.hd-client-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hd-card-meta-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.hd-card-badges-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-left: 2.75rem;
}

@media (max-width: 600px) {
  .hd-card-badges-row {
    padding-left: 0;
  }
}

.hd-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
  padding-left: 2.75rem;
}

@media (max-width: 600px) {
  .hd-card-bottom {
    padding-left: 0;
    flex-direction: column;
    align-items: stretch;
  }
}

.hd-card-progress {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
}

.hd-progress-track {
  flex: 1;
  height: 7px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .hd-progress-track {
  background: rgba(255, 255, 255, 0.1);
}

.hd-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
  background: #cbd5e1;
}

/* 100% Completo - Verde Vibrante */
.hd-card-progress.is-complete .hd-progress-track {
  background: rgba(16, 185, 129, 0.15);
}

.hd-card-progress.is-complete .hd-progress-fill {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.hd-card-progress.is-complete .hd-progress-pct {
  color: #059669;
  font-weight: 800;
}

[data-theme="dark"] .hd-card-progress.is-complete .hd-progress-pct {
  color: #34d399;
}

/* 1% a 99% Em Progresso - Azul */
.hd-card-progress.is-in-progress .hd-progress-track {
  background: rgba(14, 165, 233, 0.12);
}

.hd-card-progress.is-in-progress .hd-progress-fill {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  box-shadow: 0 0 6px rgba(14, 165, 233, 0.35);
}

.hd-card-progress.is-in-progress .hd-progress-pct {
  color: #0284c7;
  font-weight: 700;
}

[data-theme="dark"] .hd-card-progress.is-in-progress .hd-progress-pct {
  color: #38bdf8;
}

/* 0% Vazio */
.hd-card-progress.is-empty .hd-progress-fill {
  width: 0% !important;
  background: transparent;
}

.hd-card-progress.is-empty .hd-progress-pct {
  color: var(--muted);
  font-weight: 600;
}

.hd-progress-pct {
  font-size: 0.74rem;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.hd-btn-details {
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.hd-btn-details:hover {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
}

/* Sidebar APVs */
.hd-sidebar-filter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.hd-sidebar-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.hd-apvs-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hd-apv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3.5px solid #f59e0b;
  border-radius: 9px;
  padding: 0.75rem 0.85rem;
  transition: all 0.15s ease;
}

.hd-apv-card.is-closed {
  border-left-color: #22c55e;
}

.hd-apv-card:hover {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.hd-apv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.hd-apv-badge-pill {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--ink);
  background: rgba(14, 165, 233, 0.09);
  border: 1px solid rgba(14, 165, 233, 0.18);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
}

.hd-apv-client-block {
  margin-bottom: 0.45rem;
}

.hd-apv-client-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.25;
}

.hd-apv-meta-text {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.hd-tech-pill {
  font-weight: 600;
  color: var(--ink);
}

.hd-apv-tasks-list {
  list-style: none;
  padding: 0;
  margin: 0.45rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hd-apv-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

.hd-apv-task-icon {
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.hd-apv-task-item.is-done .hd-apv-task-icon {
  color: #16a34a;
}

.hd-apv-task-item.is-pending .hd-apv-task-icon {
  color: #d97706;
}

.hd-apv-task-body {
  flex: 1;
  min-width: 0;
}

.hd-apv-task-title {
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.hd-apv-task-desc {
  color: var(--muted);
  font-size: 0.72rem;
  display: block;
  margin-top: 0.1rem;
  line-height: 1.35;
}

.hd-apv-note {
  background: rgba(245, 158, 11, 0.07);
  border-left: 2.5px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.6rem;
  margin-top: 0.45rem;
  font-size: 0.74rem;
}

.hd-apv-note.is-closure {
  background: rgba(14, 165, 233, 0.07);
  border-left-color: #0ea5e9;
}

.hd-apv-note-header {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.15rem;
}

.hd-apv-note p {
  margin: 0;
  color: var(--ink);
  line-height: 1.35;
}

.hd-apv-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
}

.hd-apv-action-btn {
  height: 26px;
  padding: 0 0.65rem;
  border-radius: 5px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.hd-apv-action-btn:hover {
  border-color: #0ea5e9;
  background: #0ea5e9;
  color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════════
   HERCULANO: REDESIGN DE HORÁRIO ÚTIL & FERIADOS
══════════════════════════════════════════════════════════════════════════ */
.herculano-tempos-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

@media (max-width: 960px) {
  .herculano-tempos-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Tabela de Horário Útil ──────────────────────────────────────────────── */
.horario-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card, #ffffff);
}

.horario-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.horario-table thead th {
  background: rgba(0, 0, 0, 0.03);
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

[data-theme="dark"] .horario-table thead th {
  background: rgba(255, 255, 255, 0.03);
}

.horario-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.horario-table tbody tr:last-child {
  border-bottom: none;
}

.horario-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.02);
}

.horario-table tbody tr.is-non-util {
  opacity: 0.65;
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .horario-table tbody tr.is-non-util {
  background: rgba(255, 255, 255, 0.015);
}

.horario-table tbody td {
  padding: 0.55rem 0.85rem;
  vertical-align: middle;
}

/* Badges de Dias */
.dia-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.dia-badge-work {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

[data-theme="dark"] .dia-badge-work {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.dia-badge-weekend {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .dia-badge-weekend {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dia-badge-off {
  background: rgba(100, 116, 139, 0.08);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Custom Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  user-select: none;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .switch-slider {
  background-color: #10b981;
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(16px);
}

/* Time inputs */
.horario-time-input {
  height: 32px;
  padding: 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #ffffff);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 125px;
}

.horario-time-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.horario-time-input:disabled {
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  border-color: transparent;
  cursor: not-allowed;
}

[data-theme="dark"] .horario-time-input:disabled {
  background: rgba(255, 255, 255, 0.04);
}

/* ── Card & Lista de Feriados ────────────────────────────────────────────── */
.feriados-card {
  display: flex;
  flex-direction: column;
}

.feriado-add-btn {
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0284c7;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.feriado-add-btn:hover,
.feriado-add-btn.is-open {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #ffffff;
}

[data-theme="dark"] .feriado-add-btn {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

.feriado-add-form {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
}

.feriado-add-form.is-open {
  max-height: 220px;
  margin-bottom: 0.85rem;
}

.feriado-add-body {
  padding: 0.85rem;
  background: rgba(14, 165, 233, 0.03);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feriado-add-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.feriado-input {
  height: 32px;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #ffffff);
  color: var(--ink);
  font-size: 0.78rem;
  outline: none;
  width: 100%;
}

.feriado-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.feriado-add-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.feriados-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}

.feriado-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s ease;
}

.feriado-item:hover {
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.feriado-item.is-past {
  opacity: 0.75;
}

.feriado-badge {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feriado-badge-day {
  font-size: 0.85rem;
  font-weight: 800;
  color: #6366f1;
  line-height: 1;
}

.feriado-badge-mon {
  font-size: 0.58rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  margin-top: 1px;
}

[data-theme="dark"] .feriado-badge {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .feriado-badge-day,
[data-theme="dark"] .feriado-badge-mon {
  color: #a5b4fc;
}

.feriado-info {
  flex: 1;
  min-width: 0;
}

.feriado-info-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feriado-info-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.feriado-info-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.feriado-info-year {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

[data-theme="dark"] .feriado-info-year {
  background: rgba(255, 255, 255, 0.08);
}

.feriado-item-btns {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.feriado-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.feriado-icon-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.3);
  color: #0284c7;
}

.feriado-icon-btn.del:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.feriado-edit-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.feriado-edit-input {
  height: 28px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.74rem;
  background: var(--surface, #ffffff);
  color: var(--ink);
}

/* ══════════════════════════════════════════════════════════════════════════
   NOVO LOGIN: DESIGN MODERNO BLUE HERO & PRO CARD (v1.8.0)
══════════════════════════════════════════════════════════════════════════ */
.login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #0284c7;
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 50%, #0ea5e9 100%);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

.login-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 2.5rem;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  box-sizing: border-box;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.login-brand-icon {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.login-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

/* Wrapper & Layout */
.login-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem 3rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.login-content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
  width: 100%;
}

@media (max-width: 860px) {
  .login-header {
    padding: 0 1.25rem;
  }
  .login-content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .login-hero-col {
    text-align: center;
  }
  .login-feature-list {
    display: none;
  }
}

/* Left Hero */
.login-hero-title {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: #ffffff;
}

.login-hero-subtitle {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 2rem;
  max-width: 480px;
}

.login-feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.login-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.login-feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.login-feature-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.login-feature-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.login-feature-text span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

/* Right Card */
.login-form-col {
  display: flex;
  justify-content: center;
}

.login-card-pro {
  background: #ffffff;
  border-radius: 18px;
  padding: 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  color: #0f172a;
  box-sizing: border-box;
}

.login-card-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.login-input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-forgot-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0284c7;
  text-decoration: none;
}

.login-forgot-link:hover {
  text-decoration: underline;
}

.login-input-group input {
  height: 42px;
  padding: 0 0.85rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.login-input-group input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.login-submit-btn {
  width: 100%;
  height: 44px;
  margin-top: 1.25rem;
  background: #0284c7;
  background: linear-gradient(90deg, #0284c7, #0ea5e9);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.login-submit-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.login-status-msg {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  text-align: center;
}

/* ── Cabeçalho do Dashboard ── */
.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 240px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* ── Barra de Período Integrada e Estável ── */
.p4y-period-toolbar {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.p4y-period-input-group {
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 0.35rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.p4y-period-input-group:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.p4y-period-prefix-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0284c7;
  padding: 0 0.35rem 0 0.2rem;
  flex-shrink: 0;
}

.p4y-toolbar-select {
  height: 100%;
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}

.p4y-mode-select {
  font-weight: 700;
  color: #0f172a;
}

.p4y-toolbar-divider {
  width: 1px;
  height: 18px;
  background: #e2e8f0;
  margin: 0 0.2rem;
  flex-shrink: 0;
}

/* ── Alertas de Período Futuro / Sem Visitas ── */
.p4y-period-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-top: 0.85rem;
  animation: p4yFadeIn 0.25s ease-out;
  flex-wrap: wrap;
}

@keyframes p4yFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.p4y-period-alert.is-future {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #1e3a8a;
}

.p4y-period-alert.is-empty {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #78350f;
}

.p4y-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.is-future .p4y-alert-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.is-empty .p4y-alert-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.p4y-alert-body {
  flex: 1;
  min-width: 240px;
}

.p4y-alert-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.p4y-alert-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
}

.is-future-tag {
  background: #dbeafe;
  color: #1e40af;
}

.is-empty-tag {
  background: #fef3c7;
  color: #92400e;
}

.p4y-alert-heading {
  font-size: 0.92rem;
  font-weight: 800;
}

.p4y-alert-text {
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.45;
  opacity: 0.9;
}

.p4y-alert-action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.p4y-alert-btn-action {
  height: 32px;
  padding: 0 0.85rem;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.p4y-alert-btn-action:hover {
  background: #0369a1;
}

.p4y-alert-btn-outline {
  height: 32px;
  padding: 0 0.85rem;
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.p4y-alert-btn-outline:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ── Autocomplete Inteligente de Clientes & Instituições ── */
.client-autocomplete-wrapper {
  position: relative;
  width: 100%;
  display: block;
}

.client-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 9999;
  padding: 0.25rem 0;
}

.client-autocomplete-header {
  padding: 0.45rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  letter-spacing: 0.05em;
}

.client-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: all 0.12s ease;
  border-bottom: 1px solid #f8fafc;
}

.client-autocomplete-item:hover,
.client-autocomplete-item.is-active {
  background: #f0fdfa;
}

.client-autocomplete-item:hover .client-autocomplete-name,
.client-autocomplete-item.is-active .client-autocomplete-name {
  color: #0f766e;
}

.client-autocomplete-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-autocomplete-name strong {
  color: #0284c7;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(2, 132, 199, 0.3);
}

.client-autocomplete-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: #f1f5f9;
  color: #475569;
  flex-shrink: 0;
}

.client-autocomplete-item:hover .client-autocomplete-badge,
.client-autocomplete-item.is-active .client-autocomplete-badge {
  background: #ccfbf1;
  color: #0f766e;
}

.client-autocomplete-new {
  border-top: 1.5px solid #e2e8f0;
  background: #f8fafc;
}

.client-autocomplete-new:hover {
  background: #f0fdf4;
}

.client-autocomplete-new .new-tag {
  background: #10b981;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  display: inline-block;
}

/* ── Donut Panel Grid & Modern Donut Cards ── */
.donut-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.35rem;
  margin-top: 1rem;
}

.modern-donut-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  min-height: 320px;
}

.modern-donut-card.clickable {
  cursor: pointer;
}

.modern-donut-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-color: #0284c7;
}

.modern-donut-body {
  position: relative;
  margin: 1.15rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 170px;
}

.modern-donut-canvas-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  max-width: 110px;
}

.modern-donut-percent {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--ink, #0f172a);
  line-height: 1;
  letter-spacing: -0.02em;
}

.modern-donut-center-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  white-space: nowrap;
}

.modern-donut-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border, #f1f5f9);
  gap: 0.5rem;
  text-align: center;
  margin-top: auto;
}

.modern-donut-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.modern-donut-stat-val {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--ink, #0f172a);
}

.modern-donut-stat-val.text-good {
  color: #16a34a;
}

.modern-donut-stat-val.text-bad {
  color: #dc2626;
}

.modern-donut-stat-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted, #64748b);
}

.modern-donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border, #f8fafc);
}

.modern-donut-legend-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.modern-donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.modern-donut-legend-name {
  font-weight: 600;
  color: var(--ink, #1e293b);
}

.modern-donut-legend-count {
  font-weight: 700;
  color: var(--muted, #64748b);
}

/* ══════════════════════════════════════════════════════════════════════════
   REVISÃO E POLIMENTO COMPLETO DO MODO ESCURO (DARK MODE)
   ══════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.12);
  --bg: #0b1329;
  --bg-card: #162032;
  --green: #4ade80;
  --green-bg: rgba(34, 197, 94, 0.15);
  --red: #f87171;
  --red-bg: rgba(239, 68, 68, 0.15);
  --amber: #fbbf24;
  --amber-bg: rgba(245, 158, 11, 0.15);
  --sky: #38bdf8;
  --sky-light: #0c4a6e;
}

/* ── Fundo global e Cards ── */
[data-theme="dark"] body {
  background-color: #0b1329;
  color: #f8fafc;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .modern-donut-card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .modal-card {
  background: #162032 !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .card .section-title,
[data-theme="dark"] .chart-title,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] .modern-donut-percent,
[data-theme="dark"] .modern-donut-stat-val,
[data-theme="dark"] .modern-donut-legend-name {
  color: #f8fafc !important;
}

[data-theme="dark"] .section-subtitle,
[data-theme="dark"] .modern-donut-center-label,
[data-theme="dark"] .modern-donut-stat-lbl,
[data-theme="dark"] .modern-donut-legend-count {
  color: #94a3b8 !important;
}

/* ── Barra de Período ── */
[data-theme="dark"] .p4y-period-input-group {
  background: #162032 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .p4y-period-prefix-icon {
  color: #38bdf8 !important;
}

[data-theme="dark"] .p4y-toolbar-select {
  background: transparent !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .p4y-toolbar-select option {
  background: #162032 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .p4y-toolbar-divider {
  background: rgba(255, 255, 255, 0.14) !important;
}

/* ── Alertas de Período ── */
[data-theme="dark"] .p4y-period-alert.is-future {
  background: rgba(30, 58, 138, 0.3) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  color: #bfdbfe !important;
}

[data-theme="dark"] .p4y-period-alert.is-empty {
  background: rgba(120, 53, 15, 0.3) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #fde68a !important;
}

[data-theme="dark"] .p4y-period-alert .p4y-alert-heading {
  color: #ffffff !important;
}

[data-theme="dark"] .p4y-period-alert .p4y-alert-text {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .p4y-alert-btn-outline {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .p4y-alert-btn-outline:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* ── Autocomplete de Clientes ── */
[data-theme="dark"] .client-autocomplete-dropdown {
  background: #162032 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .client-autocomplete-header {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .client-autocomplete-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .client-autocomplete-item:hover,
[data-theme="dark"] .client-autocomplete-item.is-active {
  background: #0f2b3c !important;
}

[data-theme="dark"] .client-autocomplete-item:hover .client-autocomplete-name,
[data-theme="dark"] .client-autocomplete-item.is-active .client-autocomplete-name {
  color: #38bdf8 !important;
}

[data-theme="dark"] .client-autocomplete-name {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .client-autocomplete-badge {
  background: #0f172a !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .client-autocomplete-new {
  background: #121c2c !important;
  border-top: 1.5px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .client-autocomplete-new:hover {
  background: #064e3b !important;
}

/* ── Seletor de Localização ── */
[data-theme="dark"] .location-picker-trigger {
  background: #162032 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .location-picker-menu {
  background: #162032 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .location-picker-group-label {
  background: #0f172a !important;
  color: #38bdf8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .location-picker-option {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .location-picker-option:hover,
[data-theme="dark"] .location-picker-option.is-selected {
  background: #0f2b3c !important;
  color: #38bdf8 !important;
}

/* ── Upload Tiles & Formulário ── */
[data-theme="dark"] .upload-tile {
  background: #162032 !important;
  border: 1.5px dashed rgba(255, 255, 255, 0.18) !important;
}

[data-theme="dark"] .upload-tile:hover {
  background: #1e2d40 !important;
  border-color: #38bdf8 !important;
}

[data-theme="dark"] .upload-tile-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .upload-tile-hint {
  color: #94a3b8 !important;
}

/* ── Aviso de Inquérito Registado ── */
[data-theme="dark"] #surveyLockedNotice {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #86efac !important;
}

/* ── Tabelas e Listas ── */
[data-theme="dark"] table {
  color: #f1f5f9;
}

[data-theme="dark"] th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] tr:hover td {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ── Botões Secundários ── */
[data-theme="dark"] .secondary-button {
  background: #1e2d40 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .secondary-button:hover {
  background: #27384e !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ── Donut Stats Cores ── */
[data-theme="dark"] .modern-donut-stat-val.text-good {
  color: #4ade80 !important;
}

/* ── Banner de Inquérito Pendente (Pós-Análise) ── */
.survey-pending-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
  border-left: 5px solid #ea580c;
  border-radius: 14px;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.08);
  flex-wrap: wrap;
}

.survey-pending-content {
  flex: 1;
  min-width: 240px;
}

/* ── Modal de Link Único / QR Code Premium ── */
.p4y-modal-glass {
  background: rgba(15, 23, 42, 0.68) !important;
  backdrop-filter: blur(8px) !important;
}

.p4y-link-modal-card {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0,0,0,0.03) !important;
  animation: p4yModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes p4yModalPop {
  0% { opacity: 0; transform: scale(0.94) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.p4y-link-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.p4y-link-modal-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.p4y-link-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.p4y-link-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.p4y-link-modal-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.p4y-link-modal-close {
  background: #f1f5f9;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.p4y-link-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.p4y-link-modal-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 1rem 0;
  line-height: 1.45;
}

.p4y-qr-showcase {
  text-align: center;
  padding: 1.15rem 1rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}

.p4y-qr-frame {
  position: relative;
  display: inline-block;
  background: #ffffff;
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.p4y-qr-img {
  width: 190px;
  height: 190px;
  border-radius: 8px;
  display: block;
}

.p4y-qr-caption-box {
  margin-top: 0.95rem;
  text-align: left;
}

.p4y-qr-caption-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  display: block;
  margin-bottom: 0.35rem;
}

.p4y-qr-input-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.p4y-qr-link-field {
  flex: 1;
  height: 36px;
  font-size: 0.78rem;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  padding: 0 0.75rem !important;
  color: #0f172a !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

.p4y-btn-copy {
  height: 36px;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.p4y-btn-copy:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.p4y-btn-copy.is-copied {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #15803d !important;
}

/* ── Modal Envio por E-mail ─────────────────────────────────────────── */
.p4y-email-send-card {
  background: rgba(14, 165, 233, 0.05);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1.1rem;
}

.p4y-email-send-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.p4y-email-send-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink, #0f172a);
}

.p4y-email-sender-badge {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  background: #ffffff;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  border: 1px solid #cbd5e1;
}

.p4y-email-sender-badge strong {
  color: #0284c7;
}

.p4y-email-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.p4y-email-field {
  flex: 1;
  height: 42px;
  font-size: 0.88rem;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 0 0.85rem !important;
  color: #0f172a !important;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.p4y-email-field:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2) !important;
}

.p4y-btn-email-send {
  height: 42px;
  padding: 0 1.25rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
  transition: all 0.15s ease;
}

.p4y-btn-email-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.45);
}

.p4y-btn-email-send:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.p4y-email-feedback {
  margin-top: 0.65rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.p4y-email-feedback.is-success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #15803d;
}

.p4y-email-feedback.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.p4y-btn-whatsapp-discrete {
  font-size: 0.75rem;
  color: var(--muted, #64748b);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.p4y-btn-whatsapp-discrete:hover {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.08);
}

.p4y-polling-pill {
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.p4y-polling-pill.is-completed {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #15803d !important;
}

.p4y-polling-pill.is-error {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

.p4y-polling-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.p4y-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  animation: p4yPulseDot 1.8s infinite;
}

@keyframes p4yPulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(14, 165, 233, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.p4y-live-tag {
  font-size: 0.72rem;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ── Badges de Inquérito Partilhado ── */
.badge-link-shared {
  background: rgba(14, 165, 233, 0.14) !important;
  color: #0284c7 !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
}

.badge-link-completed {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #16a34a !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
}

/* ── Dark Mode ── */
[data-theme="dark"] .survey-pending-banner {
  background: rgba(249, 115, 22, 0.12) !important;
  border-color: rgba(249, 115, 22, 0.3) !important;
  border-left-color: #f97316 !important;
}

[data-theme="dark"] .p4y-link-modal-card {
  background: #162032 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .p4y-link-modal-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .p4y-link-modal-close {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .p4y-link-modal-close:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .p4y-qr-showcase {
  background: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .p4y-qr-frame {
  background: #ffffff !important;
}

[data-theme="dark"] .p4y-qr-link-field {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .p4y-btn-copy {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .p4y-btn-copy:hover {
  background: #334155 !important;
}

[data-theme="dark"] .p4y-polling-pill {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(14, 165, 233, 0.25) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .p4y-live-tag {
  background: rgba(14, 165, 233, 0.25) !important;
  color: #38bdf8 !important;
}

/* ==========================================================================
   MOBILE FIRST & TABLET FIRST OPTIMIZATIONS (Print4You Técnico / Campo)
   ========================================================================== */

/* 1. Touch-friendly target heights e legibilidade para Tablets e Smartphones */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]),
select,
textarea,
.location-picker-trigger {
  min-height: 48px;
  font-size: 1rem;
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

/* 2. Upload Tiles Touch Targets */
.upload-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.upload-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border: 2px dashed #bae6fd;
  border-radius: 14px;
  background: #f0f9ff;
  color: #0369a1;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 130px;
  touch-action: manipulation;
}

.upload-tile:hover,
.upload-tile:active {
  background: #e0f2fe;
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.15);
}

.upload-tile input[type="file"] {
  display: none;
}

.upload-tile-title {
  font-weight: 800;
  font-size: 1rem;
  margin-top: 0.5rem;
  color: #0c4a6e;
}

.upload-tile-hint {
  font-size: 0.8rem;
  color: #0284c7;
  margin-top: 0.2rem;
}

/* 3. Opções e Checklists com área de toque generosa para uso no tablet */
.option-button,
.checkbox-button {
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.option-button:active,
.checkbox-button:active {
  background: var(--sky-light);
}

/* 4. Breakpoint Tablet (iPad / Android Tablet: <= 1024px) */
@media (max-width: 1024px) {
  main {
    padding: 1.25rem 1rem;
    gap: 1.25rem;
    max-width: 100%;
  }

  main.has-sidebar {
    grid-template-columns: 1fr;
  }

  .side-col {
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-top: 1rem;
  }

  .field-row,
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  }

  .section-title {
    font-size: 0.95rem;
  }

  .upload-tiles {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .upload-tile {
    min-height: 120px;
    padding: 1.1rem 0.8rem;
  }

  .address-search-suggestions {
    max-height: 280px;
  }

  .historico-visitas-card {
    padding: 0.9rem;
  }

  .historico-visita-item {
    padding: 0.7rem 0.75rem;
  }
}

/* 5. Breakpoint Mobile (<= 640px) */
@media (max-width: 640px) {
  header {
    padding: 0.75rem 0.85rem 0;
    gap: 0.5rem;
  }

  .topbar-pill-brand {
    padding: 0.35rem 0.75rem;
  }

  .topbar-pill-brand h1 {
    font-size: 1rem;
  }

  nav {
    gap: 0.2rem;
  }

  nav a {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
  }

  .upload-tiles {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .field-row,
  .form-row {
    grid-template-columns: 1fr;
  }

  .survey-pending-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .survey-pending-banner button {
    width: 100%;
    justify-content: center;
  }

  .historico-visita-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* ==========================================================================
   SLA Monitor & High-Density Ticket Table Styling
   ========================================================================== */

/* Quick Filter Segmented Tabs */
.sla-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.sla-quick-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  max-width: 100%;
  overflow-x: auto;
}

.sla-tab-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sla-tab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.sla-tab-btn.is-active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Filter Bar */
.sla-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  flex-wrap: wrap;
}

.sla-search-input-wrap {
  position: relative;
  flex: 1 1 300px;
  min-width: 220px;
}

.sla-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.sla-input-search {
  width: 100%;
  height: 36px;
  padding: 0 0.85rem 0 2.2rem;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: all 0.15s ease;
}

.sla-input-search:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.sla-filters-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sla-select-compact {
  height: 36px;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.sla-select-compact:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.sla-date-inputs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sla-input-date {
  height: 36px;
  padding: 0 0.5rem;
  font-size: 0.78rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.sla-input-date:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* High Density SLA Table */
.sla-table-hd {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.sla-table-hd th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.sla-table-hd td {
  padding: 0.5rem 0.65rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.35;
}

.sla-table-hd tr:hover td {
  background: #f8fafc;
}

/* Cell Elements */
.sla-cell-ticket {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sla-apv-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.74rem;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  white-space: nowrap;
}

.sla-apv-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.15rem 0.42rem;
  border-radius: 5px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  white-space: nowrap;
}

.sla-apv-none {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.sla-report-ref {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sla-client-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.86rem;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sla-tags-inline {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.18rem;
  flex-wrap: wrap;
}

/* Client Tier Badges */
.sla-badge-tier {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.08rem 0.38rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.sla-badge-tier.tier-top10 {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.sla-badge-tier.tier-top20 {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.sla-badge-tier.tier-geral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Priority & Regime Tags */
.sla-priority-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.sla-regime-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.sla-regime-tag.bancos {
  background: #fdf4ff;
  color: #a21caf;
  border-color: #f5d0fe;
}

.sla-regime-tag.tag-247 {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* Date status */
.sla-date-open {
  font-size: 0.74rem;
  font-weight: 600;
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #f0fdf4;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #dcfce7;
  white-space: nowrap;
}

.sla-date-pending {
  font-size: 0.74rem;
  font-weight: 600;
  color: #d97706;
  background: #fefce8;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #fef08a;
  white-space: nowrap;
}

.sla-date-muted {
  font-size: 0.74rem;
  color: #94a3b8;
}

.sla-issue-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sla-issue-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.84rem;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sla-issue-desc {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.1rem;
}

.sla-chip-intervencao {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.sla-chip-intervencao.chip-sem-pecas {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sla-chip-intervencao.chip-pecas {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.sla-chip-intervencao.chip-toner {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.sla-chip-intervencao.chip-alocacao {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.sla-tech-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sla-tech-field {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.sla-tech-oficina {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: #0369a1;
  white-space: nowrap;
}

/* Performance & Progress Bar */
.sla-perf-row {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.78rem;
}

.sla-perf-elapsed {
  font-weight: 700;
  color: var(--ink);
}

.sla-perf-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.sla-mini-bar-wrap {
  width: 100%;
  max-width: 110px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.sla-mini-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.sla-btn-view {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  text-decoration: none;
}

.sla-btn-view:hover {
  background: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.25);
}

.sla-badge-admin {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
}

.sla-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sla-dot-good {
  background: #16a34a;
}

.sla-dot-bad {
  background: #dc2626;
}

.sla-dot-warn {
  background: #f59e0b;
}

/* Dark theme overrides */
[data-theme="dark"] .sla-quick-tabs {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .sla-tab-btn {
  color: #94a3b8;
}

[data-theme="dark"] .sla-tab-btn.is-active {
  background: #1e293b;
  color: #38bdf8;
}

[data-theme="dark"] .sla-filter-bar {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .sla-input-search,
[data-theme="dark"] .sla-select-compact,
[data-theme="dark"] .sla-input-date {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .sla-table-hd th {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .sla-table-hd td {
  border-color: #1e293b;
}

[data-theme="dark"] .sla-table-hd tr:hover td {
  background: rgba(14, 165, 233, 0.08);
}

[data-theme="dark"] .sla-apv-pill {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.35);
  color: #38bdf8;
}

[data-theme="dark"] .sla-apv-pending {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

[data-theme="dark"] .sla-apv-none {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .sla-btn-view {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .sla-btn-view:hover {
  background: #0284c7;
  color: #ffffff;
}










