/* fastecom Admin - Mismo diseño que landing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
}

.admin-nav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-nav .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-nav .logo-img {
  height: 88px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(82, 113, 255, 0.5));
}

.admin-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-nav .nav-brand h2 {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}

.admin-nav a[href="/dashboard"] {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.admin-nav a[href="/dashboard"]:hover {
  color: #3b82f6;
}

.admin-container {
  padding: 2rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.admin-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.admin-container h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #1e293b;
}

.admin-back-link {
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.admin-back-link:hover {
  color: #3b82f6;
}

.admin-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 500;
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.admin-tab:hover {
  color: #1e293b;
}

.admin-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.admin-container .admin-section h1,
.admin-container h1 + .admin-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #1e293b;
}

.admin-section {
  background: #fff;
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  margin-bottom: 2rem;
}

.admin-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.admin-section p {
  color: #64748b;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.loading-message,
.error-message {
  padding: 1rem;
  border-radius: 1rem;
  margin: 1rem 0;
  text-align: center;
  font-size: 0.9375rem;
}

.loading-message {
  background: #f1f5f9;
  color: #64748b;
}

.error-message {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-save {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.permissions-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.permissions-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.permissions-table thead {
  background: #f8fafc;
}

.permissions-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
  border-bottom: 1px solid #e2e8f0;
}

.permissions-table th:first-child {
  min-width: 220px;
}

.permissions-table td {
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: 0.9375rem;
}

.permissions-table tbody tr:hover {
  background: #f8fafc;
}

.feature-cell {
  min-width: 220px;
}

.feature-info strong {
  color: #1e293b;
  font-size: 0.9375rem;
}

.feature-desc {
  color: #64748b;
  font-size: 0.8125rem;
}

.checkbox-cell {
  text-align: center;
}

.permission-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #3b82f6;
}

.save-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.save-status.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.save-status.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Overrides para contenido inline en admin (roles, users) */
#rolesConfigContent > div {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 1rem !important;
}

#rolesConfigContent input,
#rolesConfigContent select {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  border-radius: 0.5rem !important;
}

#rolesConfigContent label,
#rolesConfigContent h3 {
  color: #1e293b !important;
}

#rolesConfigContent small {
  color: #64748b !important;
}

#customRolesList > div {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}

#customRolesList .font-weight-600,
#customRolesList [style*="color: white"] {
  color: #1e293b !important;
}

#customRolesList [style*="color: #94a3b8"],
#customRolesList .text-muted {
  color: #64748b !important;
}

/* Tabla de usuarios: selects y botones */
#usersTableBody select {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}

#usersTableBody button {
  border-radius: 0.5rem !important;
}

@media (max-width: 768px) {
  .admin-nav .logo-img {
    height: 64px;
  }

  .permissions-table-container {
    overflow-x: scroll;
  }

  .permissions-table {
    min-width: 560px;
  }
}
