/* Overrides / estilos específicos de módulos do dashboard */

/* Modal simples para o portal do cliente */
.tp-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tp-modal.hidden {
  display: none;
}

.tp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.tp-modal-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  z-index: 51;
}

.tp-toggle-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tp-toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.tp-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* =========================
   MODAL "Novo utilizador"
   ========================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  padding: 24px;
  overflow-y: auto;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}

.permissions-grid .checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

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

/* -------------------------------------------------
   Estado "desativado" na navegação lateral do portal
-------------------------------------------------- */

.sidebar .nav-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar .nav-item.disabled.active {
  opacity: 0.7;
}

.sidebar .nav-item.disabled:hover {
  background: transparent;
}

/* ----------------------------------------
 * Chips / toggles
 * -------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  min-width: 48px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.05s ease;
}

.chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.chip-success {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
}

.chip-success:hover {
  background: rgba(34, 197, 94, 0.28);
}

.chip-error {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.75);
  color: #fecaca;
}

.chip-error:hover {
  background: rgba(239, 68, 68, 0.28);
}

.chip-neutral {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

.clickable-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================
 * BOTÕES / CHIPS CLICÁVEIS NA LISTA DE APIÁRIOS
 * ============================================ */

.apiary-name-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font: inherit;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.apiary-name-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.apiary-hives-chip {
  cursor: pointer;
  min-width: 40px;
  justify-content: center;
}

.apiary-hives-chip:hover {
  filter: brightness(1.15);
}

.modal-card .tabs .btn-primary,
.modal-card .tabs .btn-primary:focus,
.modal-card .tabs .btn-primary:active {
  box-shadow: none;
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.16);
}

/* ============================================
 * RESUMO RÁPIDO / CHECKLIST / PRÓXIMO PASSO
 * ============================================ */

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.summary-card-subtitle {
  margin: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.summary-block {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
}

.summary-block-title {
  margin: 0 0 12px 0;
  font-size: 1rem;
}

.summary-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-check-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

.summary-check-item.done {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
}

.summary-check-item.pending {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.25);
}

.summary-check-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.summary-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 12px;
  flex: 0 0 auto;
}

.summary-check-label {
  color: #fff;
  font-size: 0.95rem;
}

.summary-check-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.86);
  white-space: nowrap;
}

.summary-next-step-card {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
}

.summary-next-step-card h4 {
  margin: 0 0 8px 0;
}

.summary-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.summary-stat-box {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
}

.summary-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}

.summary-stat-value {
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.4;
}

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

  .summary-stats-grid {
    grid-template-columns: 1fr;
  }
}
