/* ===== ATIVOS GLPI ===== */

.form-shell,
.results-shell {
  margin-bottom: 32px;
}

.form-card,
.results-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.form-card__header {
  margin-bottom: 24px;
}

.form-card__header h2,
.toolbar h2 {
  font-size: 1.45rem;
  color: var(--brand-neutral);
  margin-bottom: 8px;
}

.form-card__header p,
.toolbar p {
  color: var(--text-soft);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  gap: 18px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 700;
  color: var(--brand-neutral);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.form-actions {
  display: flex;
  align-items: end;
}

.glpi-btn {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #42b649;
  color: #fff;
}

.glpi-btn:hover {
  filter: brightness(0.96);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.glpi-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
}

.glpi-table th,
.glpi-table td {
  border-bottom: 1px solid #e6ebf0;
  padding: 14px 12px;
  vertical-align: top;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}

.glpi-table th {
  color: var(--brand-neutral);
  font-size: 0.92rem;
  background: #f7f9fc;
  font-weight: 700;
}

.glpi-table tbody tr:hover {
  background: #f8fafc;
}

.glpi-table th:nth-child(1),
.glpi-table td:nth-child(1) {
  width: 120px;
}

.glpi-table th:nth-child(2),
.glpi-table td:nth-child(2) {
  width: 240px;
}

.glpi-table th:nth-child(3),
.glpi-table td:nth-child(3) {
  width: 180px;
}

.glpi-table th:nth-child(4),
.glpi-table td:nth-child(4) {
  width: 120px;
}

.glpi-table th:nth-child(5),
.glpi-table td:nth-child(5) {
  width: 280px;
}

.glpi-table th:nth-child(6),
.glpi-table td:nth-child(6) {
  width: 280px;
}

.glpi-table td strong {
  color: var(--brand-neutral);
  font-weight: 800;
}

.glpi-cell-muted {
  color: var(--text-soft);
}

.glpi-loading,
.glpi-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-soft);
}

.form-message {
  min-height: 24px;
  margin-bottom: 16px;
  font-weight: 700;
}

.form-message--success {
  color: #12723d;
}

.form-message--error {
  color: #a31645;
}

@media (max-width: 1080px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-actions {
    grid-column: 1 / -1;
  }

  .glpi-btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .form-card,
  .results-shell {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status--ativo {
  background: #ebf9ef;
  color: #156b33;
  border-color: #9fd9ad;
}

.status--inativo {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.status--manutencao {
  background: #fff4df;
  color: #8a5a00;
  border-color: #f3d68a;
}

.status--neutro {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pagination__btn {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-neutral);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pagination__btn:hover:not(:disabled) {
  background: #f7f9fc;
}

.pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination__info {
  color: var(--text-soft);
  font-weight: 700;
}

/* ===== MODAL DE DETALHES DO ATIVO ===== */
.glpi-table tbody tr {
  cursor: pointer;
}

.glpi-table tbody tr:hover {
  background: #eef6ff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid #e6ebf0;
}

.modal-header h2 {
  margin: 0;
  color: var(--brand-neutral);
  font-size: 1.35rem;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #f7f9fc;
}

.modal-body {
  padding: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px 18px;
}

.detail-label {
  color: var(--text-soft);
  font-weight: 700;
}

.detail-value {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

@media (max-width: 640px) {
  .modal-backdrop {
    padding: 12px;
    align-items: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-label {
    margin-top: 8px;
  }
}
