/* =========================================================
   INDMANAGER — STYLE.CSS (v2.4 — LIMPO + PADRÃO ÚNICO)
   ✅ Layout consistente (Cadastro / Avaliação / Dashboard)
   ✅ Sem duplicações conflitantes (modal / botões / kpis)
   ✅ Modais responsivos + ações sticky
   ✅ Tabelas responsivas (scroll interno)
========================================================= */

/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
:root {
  --fs-base: 14px;
  --fs-small: 12.5px;
  --lh: 1.25;
  --pad-page-y: 18px;
  --pad-card: 16px;
  --pad-control-y: 10px;
  --pad-control-x: 12px;
  --radius: 12px;
  --row-h: 44px;
  --header-height: 60px;
  --tabs-h: 44px;
  --gap: 12px;
}
body.density-comfort {
  --fs-base: 14.5px;
  --fs-small: 13px;
  --pad-page-y: 18px;
  --pad-card: 18px;
  --pad-control-y: 10px;
  --pad-control-x: 12px;
  --row-h: 46px;
  --header-height: 64px;
  --tabs-h: 46px;
  --gap: 12px;
}
body.density-compact {
  --fs-base: 13.5px;
  --fs-small: 12px;
  --pad-page-y: 12px;
  --pad-card: 12px;
  --pad-control-y: 8px;
  --pad-control-x: 10px;
  --row-h: 38px;
  --header-height: 56px;
  --tabs-h: 40px;
  --gap: 10px;
}
body.density-ultra {
  --fs-base: 12.8px;
  --fs-small: 11.5px;
  --pad-page-y: 10px;
  --pad-card: 10px;
  --pad-control-y: 6px;
  --pad-control-x: 8px;
  --row-h: 34px;
  --header-height: 52px;
  --tabs-h: 36px;
  --gap: 8px;
}
body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background: #f3f6fb;
  color: #0f172a;
  font-size: var(--fs-base);
  line-height: var(--lh);
}

/* ================= HEADER ================= */
.header {
  background: linear-gradient(135deg, #003d6e 0%, #004d8c 100%);
  color: #fff;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  max-width: min(58vw, 520px);
  min-width: 0;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.26);
}
.brand-logo-img {
  max-height: 34px;
  max-width: 170px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.26);
  flex-shrink: 0;
}
.brand-logo-text {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-time {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.header-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-link {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 18px;
  color: #fff;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.icon-link:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}
#btn-compact-toggle.is-active {
  background: rgba(37, 99, 235, 0.35);
  outline: 1px solid rgba(147, 197, 253, 0.75);
}
#btn-compact-toggle[data-mode="density-ultra"] {
  background: rgba(30, 64, 175, 0.42);
  outline: 1px solid rgba(96, 165, 250, 0.9);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

/* ================= LAYOUT ================= */
.container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: 230px;
  background: #fff;
  padding: 10px;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: var(--header-height);
  align-self: flex-start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  transition:
    left 0.25s ease,
    width 0.2s ease;
  will-change: left, width;
}
.sidebar a {
  text-decoration: none;
  color: inherit;
}
.menu-item {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 6px;
  border-radius: 12px;
  cursor: pointer;

  color: #334155;
  font-weight: 800;
  font-size: 14px;

  user-select: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.density-compact .menu-item {
  padding: 8px 10px;
  font-size: var(--fs-small);
}
.density-ultra .menu-item {
  padding: 7px 9px;
  font-size: var(--fs-small);
}
.menu-item svg {
  width: 22px;
  height: 22px;
}
.menu-item.active svg {
  color: #2563eb;
}
.menu-item:hover {
  background: #f1f5f9;
  color: #2563eb;
}
.menu-item.active {
  background: #eaf2ff;
  color: #2563eb;
}

/* Submenu */
.menu-item-with-sub {
  position: relative;
}

.menu-item-with-sub > .menu-item {
  cursor: pointer;
  position: relative;
}

.menu-group-trigger {
  width: calc(100% - 12px);
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
}

.menu-item-toggle {
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 12px;
}

.menu-item-with-sub.open .menu-item-toggle {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  flex-direction: column;
  margin-left: 10px;
  margin-top: 4px;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
}

.menu-item-with-sub.open .submenu {
  display: flex;
}

.submenu .menu-item {
  padding: 7px 10px;
  margin: 2px 6px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  background: #f8fafc;
  gap: 8px;
}

.submenu .menu-item svg {
  width: 16px;
  height: 16px;
}

.submenu .menu-item::before {
  content: none;
}

body.sidebar-collapsed .menu-item-with-sub .submenu {
  display: none !important;
}

body.sidebar-collapsed .menu-item-toggle {
  display: none;
}

/* Desktop: sidebar colapsável via body.sidebar-collapsed */
body.sidebar-collapsed .sidebar {
  width: 78px;
  padding: 10px 8px;
}
body.sidebar-collapsed .menu-item {
  justify-content: center;
  gap: 0;
  font-size: 0; /* esconde texto */
}
body.sidebar-collapsed .menu-item svg,
body.sidebar-collapsed .menu-item .menu-icon {
  width: 20px;
  height: 20px;
  margin: 0 !important;
}

/* Mobile: sidebar vira gaveta */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    left: -260px;
    z-index: 2000;
    box-shadow: 2px 0 18px rgba(15, 23, 42, 0.14);
  }
  .sidebar.open {
    left: 0;
  }
  body.sidebar-collapsed .sidebar {
    width: 230px;
    padding: 10px;
  }

  .logo {
    max-width: min(54vw, 340px);
    gap: 10px;
  }
  .brand-logo-img {
    max-height: 36px;
    max-width: 140px;
    padding: 3px 8px;
  }
  .brand-logo-text {
    font-size: 20px;
  }
}

@media (max-width: 560px) {
  .logo {
    max-width: min(56vw, 230px);
    gap: 8px;
  }
  .brand-logo-img {
    max-height: 31px;
    max-width: 116px;
    border-radius: 8px;
    padding: 2px 6px;
  }
  .brand-logo-text {
    font-size: 16px;
    letter-spacing: 0.2px;
  }
}

/* ================= MAIN ================= */
.main-content,
.dashboard {
  flex: 1;
  padding: var(--pad-page-y);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

/* ================= PAGE HEADER ================= */
.page-header {
  margin-bottom: 18px;
}
.density-compact .page-header,
.density-ultra .page-header {
  margin-bottom: 12px;
}
.page-title {
  font-size: 28px;
  font-weight: 950;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.page-subtitle {
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
}
.page-title-inline .ico-soft {
  width: 20px;
  height: 20px;
  margin-right: 0;
  flex: 0 0 auto;
}
.tabs,
.tabbar,
.nav-tabs {
  min-height: var(--tabs-h);
  gap: var(--gap);
}
.tabs .tab,
.nav-tabs .nav-link,
.tabbar .item,
.cadastro-switch .chip {
  padding: calc(var(--pad-control-y) - 2px) var(--pad-control-x);
  font-size: var(--fs-small);
  border-radius: 999px;
}

/* AÇÕES DO TOPO (Cadastro/Avaliação) */
.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ================= BUTTONS (Padrão único) ================= */
.btn {
  padding: var(--pad-control-y) calc(var(--pad-control-x) + 2px);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: var(--fs-small);
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Primário */
.btn-primary {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(25, 118, 210, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(25, 118, 210, 0.28);
}

/* Secundário (Exportar) */
.btn-light,
.btn-export {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.btn-light:hover,
.btn-export:hover {
  background: #eaf2ff;
  color: #2563eb;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

/* Sucesso */
.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.18);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(34, 197, 94, 0.26);
}

/* ✅ PADRÃO: botão principal do topo - ESTILO FLAT SUAVE */
body[data-page="cadastro"] #btn-novo.btn-primary,
body[data-page="cadastro-equipamentos"] #btn-novo.btn-primary,
body[data-page="cadastro-produtos"] #btn-novo.btn-primary,
body[data-page="cadastro-materiais"] #btn-novo.btn-primary,
body[data-page="avaliacao"] #nova-avaliacao-btn.btn-primary,
body[data-page="ordem-producao"] #btn-op-nova.btn-primary,
body[data-page="ordem-servico"] #btn-os-nova.btn-primary,
body[data-page="ocorrencias-historico"] #btn-nova-ocorrencia.btn-primary,
body[data-page="pdi"] #pdi-novo-btn.btn-primary,
#btn-nova-avaliacao.btn-primary {
  background: #e3f2fd !important;
  color: #1976d2 !important;
  border: 1px solid #bbdefb !important;
  box-shadow: 0 2px 4px rgba(25, 118, 210, 0.08) !important;
  font-weight: 800 !important;
}
body[data-page="cadastro"] #btn-novo.btn-primary:hover,
body[data-page="cadastro-equipamentos"] #btn-novo.btn-primary:hover,
body[data-page="cadastro-produtos"] #btn-novo.btn-primary:hover,
body[data-page="cadastro-materiais"] #btn-novo.btn-primary:hover,
body[data-page="avaliacao"] #nova-avaliacao-btn.btn-primary:hover,
body[data-page="ordem-producao"] #btn-op-nova.btn-primary:hover,
body[data-page="ordem-servico"] #btn-os-nova.btn-primary:hover,
body[data-page="ocorrencias-historico"] #btn-nova-ocorrencia.btn-primary:hover,
body[data-page="pdi"] #pdi-novo-btn.btn-primary:hover,
#btn-nova-avaliacao.btn-primary:hover {
  background: #bbdefb !important;
  color: #1565c0 !important;
  border-color: #90caf9 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.12) !important;
}

/* ================= CARDS ================= */
.card,
.content-card {
  background: #fff;
  border: 1px solid #e9eef6;
  border-radius: var(--radius);
  padding: var(--pad-card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  margin-bottom: 18px;
  overflow: hidden;
}

/* ================= TABLE (responsiva) ================= */
.table-wrap,
.av-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  min-width: 1100px;
}
.table thead {
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
}
.table thead th {
  padding: calc(var(--pad-control-y) + 1px) var(--pad-control-x);
  text-align: left;
  font-size: var(--fs-small);
  font-weight: 950;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.table tbody tr {
  background: #fff;
  border-radius: 12px;
  border-left: 4px solid transparent;
  transition:
    box-shadow 0.12s ease,
    border-color 0.18s ease;
  min-height: var(--row-h);
  height: var(--row-h);
}

.table tbody td:nth-child(1),
.table thead th:nth-child(1) {
  width: 140px;
  text-align: left;
}
.table tbody td:nth-child(2),
.table thead th:nth-child(2) {
  width: 180px;
  text-align: left;
}
.table tbody td:nth-child(3),
.table thead th:nth-child(3),
.table tbody td:nth-child(4),
.table thead th:nth-child(4) {
  width: 120px;
  text-align: left;
}
.table tbody td:nth-child(5),
.table thead th:nth-child(5),
.table tbody td:nth-child(6),
.table thead th:nth-child(6) {
  width: 140px;
  text-align: left;
}
.table tbody td:nth-child(7),
.table thead th:nth-child(7) {
  width: 230px;
  text-align: left;
}
.table tbody td:nth-child(8),
.table thead th:nth-child(8) {
  width: 110px;
}
.table tbody td:nth-child(9),
.table thead th:nth-child(9) {
  width: 110px;
}
.table tbody td:nth-child(10),
.table thead th:nth-child(10) {
  width: 220px;
  text-align: left;
}
.table tbody td:nth-child(11),
.table thead th:nth-child(11) {
  width: 220px;
  text-align: left;
}
.table tbody td:nth-child(12),
.table thead th:nth-child(12) {
  width: 150px;
}
.table tbody tr:hover {
  transform: translateY(-2px);
  border-color: #dbe6fb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.card-row {
  border-left: 4px solid transparent;
}
.card-row td {
  padding: var(--pad-control-y) var(--pad-control-x);
  font-size: var(--fs-small);
  color: #1f2937;
  text-align: left;
  vertical-align: middle;
  border: none;
  white-space: nowrap;
}
.card-row td:nth-child(1) {
  min-width: 200px;
}
.card-row td:nth-child(2),
.card-row td:nth-child(3) {
  min-width: 120px;
  text-align: left;
}
.card-row td:nth-child(6),
.card-row td:nth-child(7) {
  min-width: 160px;
  text-align: left;
}
.card-row td:nth-child(11),
.card-row td:nth-child(12) {
  text-align: center;
}

.phone-cell {
  display: table-cell;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
.card-row.status-ativo {
  border-left-color: #10b981;
}
.card-row.status-inativo {
  border-left-color: #ef4444;
}
.card-row.status-ferias {
  border-left-color: #fbbf24;
}
.card-row.status-afastado {
  border-left-color: #3b82f6;
}
.card-row.status-experiencia {
  border-left-color: #8b5cf6;
}
.card-row.status-manutencao {
  border-left-color: #fbbf24;
}
@media (max-width: 768px) {
  .table {
    min-width: 720px;
  }
}

/* ================= BADGES ================= */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  border: 1px solid transparent;
}
.badge-ativo {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.badge-inativo {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.badge-ferias {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}
.badge-afastado {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.badge-experiencia {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}
.badge-warning {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.status-badge {
  cursor: pointer;
  transition: opacity 0.15s ease;
  min-width: 90px;
  justify-content: center;
  text-align: center;
  letter-spacing: 0.2px;
}
.density-compact .status-badge,
.density-ultra .status-badge {
  min-width: 78px;
  font-size: 10px;
  padding: 3px 8px;
}
.status-badge:hover {
  opacity: 0.85;
}

.action-btn.action-address {
  color: #1d4ed8;
}
.action-btn.action-address svg {
  width: 18px;
  height: 18px;
}
.action-btn.action-address:hover {
  color: #2563eb;
}

.address-popover {
  position: absolute;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  color: #0f172a;
  max-width: 280px;
  z-index: 1200;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: none;
}
.address-popover::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent #e2e8f0;
}
.address-popover-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ================= FORMS (padrão) ================= */
.form-grid,
.av-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 11px;
  color: #2563eb;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px; /* evita zoom automático no iPhone */
  font-weight: 700;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.form-group textarea {
  min-height: 92px;
  resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
.span-2 {
  grid-column: span 2 / span 2;
}
.span-3 {
  grid-column: span 3 / span 3;
}
@media (max-width: 1024px) {
  .form-grid,
  .av-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .span-3 {
    grid-column: span 2 / span 2;
  }
}
@media (max-width: 560px) {
  .form-grid,
  .av-form-grid {
    grid-template-columns: 1fr;
  }
  .span-2,
  .span-3 {
    grid-column: span 1 / span 1;
  }
}

/* ================= MODAL (padrão único + responsivo) ================= */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
  padding: 14px;
}
.modal.show {
  display: block;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.modal-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  max-height: calc(100vh - 28px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-top,
.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 950;
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc 0%, #f3f6fb 100%);
}

.modal-close,
.modal-header .close {
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #64748b;
  font-size: 20px;
  font-weight: 950;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    color 0.12s ease;
}
.modal-close:hover,
.modal-header .close:hover {
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px;
}

/* ações do modal sempre visíveis */
.modal-actions,
.modal-footer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 0 6px;
  border-top: 1px solid #e2e8f0;
  z-index: 10;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
@media (max-width: 560px) {
  .modal-actions .btn,
  .modal-footer .btn {
    width: 100%;
  }
}

/* ================= ÍCONES SVG (sprite) ================= */
.ico-soft {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  overflow: visible;
  color: #2563eb;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.08));
}
.ico-soft use {
  pointer-events: none;
}

/* ================= AÇÕES NA TABELA ================= */
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.density-compact .actions,
.density-ultra .actions {
  gap: 8px;
}
.btn-icon,
.action-btn {
  border: none;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.15s ease;
}
.density-compact .btn-icon,
.density-compact .action-btn,
.density-ultra .btn-icon,
.density-ultra .action-btn {
  width: 28px;
  height: 28px;
  padding: 3px;
}
.btn-icon svg,
.action-btn svg {
  width: 18px;
  height: 18px;
}
.density-compact .btn-icon svg,
.density-compact .action-btn svg,
.density-ultra .btn-icon svg,
.density-ultra .action-btn svg {
  width: 15px;
  height: 15px;
}
.btn-icon:hover,
.action-btn:hover {
  color: #2563eb;
  transform: translateY(-1px);
}
.action-btn.action-del {
  color: #ef4444;
}
.action-btn.action-del:hover {
  color: #dc2626;
}

/* ================= DASHBOARD KPIs ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 22px;
}
.kpi-card,
.stat-card {
  background: #fff;
  border: 1px solid #e9eef6;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.kpi-card:hover,
.stat-card:hover {
  transform: translateY(-2px);
  border-color: #dbe6fb;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.1);
}
.kpi-top,
.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.kpi-title,
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.kpi-value,
.stat-value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
}
.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= UTIL ================= */
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Acessibilidade (focus) */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.55);
  outline-offset: 2px;
}
/* =========================================================
   AÇÕES — ÍCONES LIMPOS (Avaliação + Cadastro)
   Sem fundo | Hover elegante | Lixeira vermelha
========================================================= */

/* Container das ações */
.actions {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

/* Botão base (ícone puro) */
.action-btn,
.btn-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  width: 32px;
  height: 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  color: #64748b; /* cinza elegante */

  transition:
    color 0.15s ease,
    transform 0.15s ease,
    filter 0.15s ease;
}

/* SVG acompanha a cor */
.action-btn svg,
.btn-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Hover geral */
.action-btn:hover,
.btn-icon:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.18));
}

/* ===== EDITAR ===== */
.action-btn.action-edit,
.btn-icon.edit {
  color: #475569;
}
.action-btn.action-edit:hover,
.btn-icon.edit:hover {
  color: #2563eb;
}

/* ===== VISUALIZAR ===== */
.action-btn.action-view,
.btn-icon.view {
  color: #475569;
}
.action-btn.action-view:hover,
.btn-icon.view:hover {
  color: #2563eb;
}

/* ===== EXCLUIR (LIXEIRA) ===== */
.action-btn.action-del,
.btn-icon.danger {
  color: #dc2626;
}
.action-btn.action-del:hover,
.btn-icon.danger:hover {
  color: #b91c1c;
}

/* Acessibilidade (focus) */
.action-btn:focus-visible,
.btn-icon:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 0 4px rgba(96, 165, 250, 0.35));
}
/* =========================================================
   AÇÕES — PADRÃO ÚNICO (Cadastro + Avaliação)
   Ícone sem fundo | hover leve | lixeira vermelha
========================================================= */

.actions {
  display: inline-flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.action-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #475569; /* cinza elegante */
  transition:
    transform 0.12s ease,
    color 0.12s ease,
    filter 0.12s ease;
}

.action-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* hover geral */
.action-btn:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.18));
  color: #2563eb; /* azul no hover */
}

/* LIXEIRA sempre vermelha */
.action-btn.action-del {
  color: #dc2626;
}
.action-btn.action-del:hover {
  color: #b91c1c;
}

/* focus acessível */
.action-btn:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 0 4px rgba(96, 165, 250, 0.35));
}

/* ================= MODAL DE VISUALIZAÇÃO (Ver Endereço) ================= */
.view-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}

.view-modal.show {
  display: flex;
}

.view-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.view-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  max-width: 520px;
  width: calc(100% - 40px);
  overflow: hidden;
  animation: viewSlideIn 0.2s ease-out;
}

@keyframes viewSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #003d6e 0%, #004d8c 100%);
  color: #fff;
}

.view-head > div {
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.view-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.view-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.view-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.view-hero-main {
  min-width: 0;
}

.view-colab-name {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.view-colab-role {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-top: 3px;
}

.view-status-badge {
  min-width: 96px;
  justify-content: center;
}

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

.view-mini-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
}

.view-mini-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.view-mini-value {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
}

.view-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.view-section-title {
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 10px;
}

.view-kv-list {
  display: grid;
  gap: 8px;
}

.view-kv-item {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 6px;
}

.view-kv-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.view-kv-item span {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.view-kv-item strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
}

.view-kv-item-address strong {
  max-width: 75%;
  text-align: left;
}

.view-observacoes-text {
  font-size: 13px;
  line-height: 1.45;
  color: #1e293b;
  margin: 0;
}

.view-link-btn {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.view-link-btn:hover {
  text-decoration: underline;
}

.btn-view-secondary {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #dbe3ef;
}

.view-actions {
  margin-top: 2px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 860px) {
  .view-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .view-box {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    overflow: auto;
  }
  .view-body {
    padding: 14px;
  }
  .view-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .view-status-badge {
    min-width: 82px;
  }
  .view-cards-grid {
    grid-template-columns: 1fr;
  }
  .view-kv-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .view-kv-item strong,
  .view-kv-item-address strong {
    text-align: left;
    max-width: 100%;
  }
  .view-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

html.embed-mode body {
  background: transparent !important;
}

html.embed-mode .header,
html.embed-mode .sidebar {
  display: none !important;
}

html.embed-mode .container {
  display: block !important;
  padding: 0 !important;
}

html.embed-mode .main-content {
  margin-left: 0 !important;
  min-height: auto !important;
  padding: 12px !important;
}

html.embed-mode .menu-toggle,
html.embed-mode .cadastro-switch {
  display: none !important;
}

.density-compact .table-colaboradores .card-row td,
.density-ultra .table-colaboradores .card-row td {
  padding: 7px 6px !important;
}
.density-compact .table-colaboradores td.phone-cell,
.density-ultra .table-colaboradores td.phone-cell {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}
.density-compact .table-colaboradores .status-badge,
.density-ultra .table-colaboradores .status-badge {
  min-width: 82px;
}
.density-compact .table-equipamentos .card-row td,
.density-ultra .table-equipamentos .card-row td {
  padding: 7px 6px !important;
}
