/* Nuevo diseño pastel / moderno para Login + CRUD usuarios */

:root {
  --color-bg: #020617;
  --color-bg-soft: #02081f;
  --color-surface: #020617;
  --color-surface-soft: #0b1120;
  --color-accent: #2563eb;
  --color-accent-strong: #1d4ed8;
  --color-accent-soft: rgba(37, 99, 235, 0.18);
  --color-danger: #f97373;
  --color-danger-soft: rgba(239, 68, 68, 0.22);
  --color-success: #22c55e;
  --color-success-soft: rgba(34, 197, 94, 0.22);
  --color-text: #e5e7eb;
  --color-muted: #9ca3af;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.8);
  --shadow-subtle: 0 1px 0 rgba(15, 23, 42, 0.6);

  --transition-fast: 150ms ease-out;
  --transition-normal: 200ms ease;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(150% 200% at 0% 0%, #e0f2fe 0, #f5f3ff 45%, #fef2f2 100%);
  color: var(--color-text);
  line-height: 1.5;
}

/* Layout base */

.app {
  min-height: 100vh;
}

.js-enabled .shell,
.js-enabled .auth-wrapper {
  animation: fadeInUp 260ms var(--transition-normal);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header general */

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 1.25rem;
  background: radial-gradient(circle at 0 0, #a855f7, #6366f1);
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-soft);
}

.brand-text-main {
  font-size: 1rem;
  font-weight: 600;
}

.brand-text-sub {
  font-size: 0.8rem;
  color: var(--color-muted);
}

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

.nav-link {
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-muted);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.5);
}

.nav-link:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: var(--color-surface-soft);
  color: var(--color-text);
}

.nav-link.active {
  background: var(--color-accent-soft);
  border-color: rgba(129, 140, 248, 0.5);
  color: var(--color-accent-strong);
}

.nav-link.nav-logout {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.35);
  color: #b91c1c;
}

.nav-link.nav-logout:hover {
  background: var(--color-danger-soft);
}

.nav-toggle {
  display: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

/* Contenido principal */

.shell-main {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 1.5rem 1.5rem 1.75rem;
  backdrop-filter: blur(16px);
}

.page-header {
  margin-bottom: 1.2rem;
}

.page-title {
  font-size: 1.4rem;
  margin: 0 0 0.25rem;
}

.page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Tarjetas / grid */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(
      135deg,
      rgba(129, 140, 248, 0.08),
      rgba(236, 72, 153, 0.05)
    ),
    var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-subtle);
}

.card-link {
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background 160ms ease-out;
}

.card-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  background: linear-gradient(
      135deg,
      rgba(129, 140, 248, 0.16),
      rgba(236, 72, 153, 0.11)
    ),
    var(--color-surface);
}

.card-link h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.card-link p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted);
}

/* Formularios */

.form {
  display: grid;
  gap: 0.8rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 200px;
}

.form-field label {
  font-size: 0.82rem;
  color: var(--color-muted);
}

input,
select,
textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.55rem 0.8rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background 120ms ease-out;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.6);
  background: var(--color-surface-soft);
}

/* Botones */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.1rem;
  border: none;
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #f9fafb;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.35);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--color-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger-soft);
  color: #b91c1c;
  border-radius: var(--radius-pill);
  padding-inline: 0.85rem;
  font-size: 0.8rem;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* Chips / badge */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.8);
}

.badge:hover {
  border-color: rgba(129, 140, 248, 0.7);
  color: var(--color-accent-strong);
}

/* Alertas */

.alert {
  border-radius: 0.9rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.alert span {
  font-weight: 500;
}

.alert.error {
  background: var(--color-danger-soft);
  color: #7f1d1d;
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.alert.info {
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.alert.ok {
  background: var(--color-success-soft);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.6);
}

/* Tabla */

.table-wrapper {
  margin-top: 0.9rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: linear-gradient(90deg, #eef2ff, #fae8ff);
}

thead th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  color: #4b5563;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.85);
}

tbody tr:nth-child(odd) {
  background: rgba(249, 250, 251, 0.85);
}

tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

tbody tr:hover {
  background: rgba(224, 231, 255, 0.55);
}

/* Texto utilitario */

.text-muted {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.text-right {
  text-align: right;
}

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

/* Layout autenticación */

.app-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem 1.25rem;
}

.auth-wrapper {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr);
  align-items: center;
}

.auth-illustration {
  padding-right: 1.5rem;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  background: rgba(129, 140, 248, 0.12);
  color: #4f46e5;
}

.auth-title {
  margin: 0.55rem 0 0.3rem;
  font-size: 1.7rem;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.auth-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 1.5rem 1.6rem 1.35rem;
  backdrop-filter: blur(18px);
}

.auth-card-header {
  margin-bottom: 0.9rem;
}

.auth-card-footer {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.auth-card-footer a {
  color: var(--color-accent-strong);
  text-decoration: none;
}

/* Responsive */

@media (max-width: 900px) {
  .auth-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-illustration {
    order: 2;
    padding-right: 0;
  }

  .auth-card {
    order: 1;
  }
}

@media (max-width: 768px) {
  .shell {
    padding-inline: 1rem;
  }

  .shell-main {
    padding-inline: 1.1rem;
  }

  .shell-header {
    align-items: flex-start;
  }

  .nav {
    display: none;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    position: absolute;
    top: 56px;
    right: 1.2rem;
    padding: 0.6rem;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    min-width: 170px;
  }

  .nav.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }
}


/* Override to enforce dark background + light text */
body {
  background:
    radial-gradient(140% 220% at 0% 0%, #020617 0, #020617 40%, #020818 75%, #000 100%);
  color: var(--color-text);
}
