/* ================================================================
   NewLicitação — Painel Admin
   ================================================================ */

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--header-height));
}

.admin-sidebar {
  background: white;
  border-right: 1px solid var(--color-border);
  padding: 16px 12px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.admin-sidebar-section {
  margin-bottom: 18px;
}

.admin-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 12px 6px;
  margin: 0;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all var(--transition-base);
}
.admin-nav-item:hover { background: var(--color-bg-page); }
.admin-nav-item.active {
  background: rgba(0, 123, 255, 0.1);
  color: var(--color-primary);
  font-weight: 600;
}

.admin-content {
  padding: 24px;
  background: var(--color-bg-page);
  overflow-x: auto;
}

.admin-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-dark-navy);
  margin: 0 0 4px;
}
.admin-page-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  margin-bottom: 20px;
}

/* Tabela */
.admin-table {
  width: 100%;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  font-size: var(--font-sm);
}

.admin-table thead th {
  background: var(--color-bg-page);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.6px;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.admin-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #f8f9fa; }

/* Portal cards */
.portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.portal-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-card-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-dark-navy);
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { display: none; }
.toggle-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ced4da;
  border-radius: 22px;
  transition: .3s;
}
.toggle-switch-slider::before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-switch-slider { background: var(--color-success); }
.toggle-switch input:checked + .toggle-switch-slider::before { transform: translateX(18px); }

.portal-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: var(--font-sm);
  border-bottom: 1px dashed var(--color-border);
}
.portal-stat-row:last-of-type { border-bottom: none; }
.portal-stat-label { color: var(--color-text-secondary); }
.portal-stat-value { font-weight: 600; color: var(--color-text-primary); }

.portal-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.error-msg {
  background: #ffe3e3;
  color: #c92a2a;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-top: 8px;
}

/* Stats grid for dashboard */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
.admin-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-dark-navy);
}
.admin-stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

/* Badge sucesso/erro */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #d3f9d8; color: #2b8a3e; }
.badge-danger { background: #ffe3e3; color: #c92a2a; }
.badge-info { background: #d0ebff; color: #1971c2; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 53, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--color-dark-navy);
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
}
