:root {
  --bg: #f4efe6;
  --bg-strong: #efe4d1;
  --card: rgba(255, 252, 246, 0.88);
  --card-strong: #fffaf2;
  --text: #1b1a18;
  --muted: #5f584e;
  --line: rgba(63, 50, 35, 0.12);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d5eeeb;
  --danger: #a61b1b;
  --shadow: 0 20px 60px rgba(47, 39, 28, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.16), transparent 24%),
    linear-gradient(135deg, var(--bg), #f8f3eb 50%, #f5ead7);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.login-body,
.dashboard-body {
  min-height: 100vh;
}

.dashboard-body {
  background:
    radial-gradient(circle at 12% 10%, rgba(66, 178, 3, 0.1), transparent 22%),
    radial-gradient(circle at 88% 16%, rgba(66, 178, 3, 0.08), transparent 18%),
    linear-gradient(135deg, #eef5e6 0%, #f4f1e8 48%, #efe8d9 100%);
}

.login-shell,
.centered-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-stage {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 460px);
  gap: 36px;
  align-items: center;
}

.login-intro {
  max-width: 620px;
}

.login-eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.login-intro h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 0.94;
  color: white;
}

.login-intro p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
}

.login-card,
.panel-card,
.hero-card,
.sidebar {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 32px;
  padding: 40px;
  border-radius: var(--radius-xl);
}

.login-copy h1,
.hero-card h1,
.section-heading h2,
.sidebar h2,
.error-card h1 {
  font-family: var(--font-display);
  line-height: 1;
  margin: 0 0 12px;
}

.login-copy h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.login-body {
  background:
    linear-gradient(rgba(4, 14, 10, 0.52), rgba(4, 14, 10, 0.6)),
    url("/fondo.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.auth-wrapper {
  position: relative;
  width: 100%;
  min-height: 540px;
  background: rgba(10, 20, 22, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px;
  padding: 40px;
  overflow: hidden;
}

.auth-wrapper::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 90deg,
    transparent 0deg,
    rgba(66, 178, 3, 0.05) 80deg,
    rgba(66, 178, 3, 0.22) 145deg,
    transparent 220deg
  );
  animation: auth-spin 10s linear infinite;
}

.auth-wrapper::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(66, 178, 3, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(8, 18, 20, 0.58), rgba(5, 10, 16, 0.42));
}

.auth-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  transition: transform 0.9s ease, opacity 0.9s ease;
}

.auth-sign-in {
  transform: translateY(0);
  opacity: 1;
}

.auth-sign-up {
  transform: translateY(100%);
  opacity: 0;
}

.auth-wrapper.active .auth-sign-in {
  transform: translateY(-100%);
  opacity: 0;
}

.auth-wrapper.active .auth-sign-up {
  transform: translateY(0);
  opacity: 1;
}

.auth-form {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  gap: 24px;
}

.auth-form h2 {
  margin: 0;
  font-size: 2.2rem;
  text-align: center;
  color: #f7fbff;
}

.auth-input-group {
  position: relative;
  margin-top: 6px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
}

.auth-input-group label {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  transition: 0.3s ease;
}

.auth-input-group input {
  width: 100%;
  height: 46px;
  padding: 0 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: white;
}

.auth-input-group input:focus,
.auth-input-group input:valid {
  outline: none;
  border: none;
}

.auth-input-group input:focus ~ label,
.auth-input-group input:valid ~ label {
  top: -6px;
  color: #42b203;
  font-size: 0.85rem;
}

.auth-remember {
  margin-top: -8px;
}

.auth-remember label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.auth-remember input {
  accent-color: #42b203;
}

.auth-button {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #42b203 0%, #349000 100%);
  box-shadow: 0 0 18px rgba(66, 178, 3, 0.28);
  color: #f4fbff;
  font-weight: 700;
  cursor: pointer;
}

.auth-alt-button {
  background: linear-gradient(90deg, #42b203, #66cf2b);
  color: #f5f8fb;
}

.auth-switch {
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
}

.auth-switch a {
  color: #42b203;
  font-weight: 700;
}

.auth-feature-list {
  display: grid;
  gap: 14px;
}

.auth-feature-list article {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(66, 178, 3, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.auth-feature-list strong {
  display: block;
  margin-bottom: 6px;
  color: white;
}

.auth-feature-list p {
  margin: 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-form,
.stack-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffdf8;
  padding: 14px 16px;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.danger-button {
  background: #fff1f1;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.14);
}

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin: 0;
}

.alert.error {
  background: #feeaea;
  color: var(--danger);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 28px;
}

.content-panel {
  display: grid;
  gap: 24px;
}

.admin-hero {
  align-items: stretch;
}

.hero-card,
.panel-card,
.sidebar {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.hero-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 249, 240, 0.88)),
    radial-gradient(circle at top left, rgba(66, 178, 3, 0.08), transparent 28%);
  border: 1px solid rgba(105, 93, 72, 0.12);
  box-shadow:
    0 22px 60px rgba(83, 69, 46, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-card h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
}

.hero-stats {
  display: flex;
  gap: 12px;
}

.hero-stats article,
.detail-grid article,
.stack-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(105, 93, 72, 0.1);
  border-radius: 20px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-stats strong {
  display: block;
  font-size: 1.6rem;
}

.section-heading,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.table-list {
  display: grid;
  gap: 12px;
}

.list-row {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(105, 93, 72, 0.08);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 25px rgba(79, 67, 45, 0.06);
}

.list-row div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plate-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(66, 178, 3, 0.12);
  color: #397a15;
  font-weight: 700;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-top: 20px;
}

.compact {
  align-content: start;
}

.stack-card p,
.stack-card span,
.sidebar,
.empty-state {
  color: var(--muted);
}

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

.detail-grid span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.sidebar {
  position: sticky;
  top: 24px;
  height: fit-content;
  display: grid;
  gap: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(248, 253, 244, 0.28)),
    radial-gradient(circle at top, rgba(66, 178, 3, 0.1), transparent 36%);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 24px 50px rgba(83, 69, 46, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(66, 178, 3, 0.2), rgba(66, 178, 3, 0.08));
  border: 1px solid rgba(66, 178, 3, 0.18);
}

.brand-mark span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #42b203;
  box-shadow: 0 0 20px rgba(66, 178, 3, 0.55);
}

.nav-link {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(66, 178, 3, 0.92), rgba(50, 138, 0, 0.92));
  color: white;
  box-shadow: 0 14px 30px rgba(66, 178, 3, 0.22);
}

.nav-kicker {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(27, 26, 24, 0.48);
}

.nav-link.active .nav-kicker {
  color: rgba(255, 255, 255, 0.9);
}

.single-column-form {
  display: grid;
  gap: 16px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-form {
  margin: 0;
}

.standalone-danger-form {
  margin-top: 14px;
}

.entity-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(105, 93, 72, 0.08);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 28px rgba(79, 67, 45, 0.06);
}

.entity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.entity-card-head div {
  display: grid;
  gap: 6px;
}

.entity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.workspace-card {
  display: grid;
  gap: 20px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
}

.workspace-side,
.workspace-main {
  min-width: 0;
}

.subpanel {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(247, 250, 242, 0.96), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(105, 93, 72, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.subpanel h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.hero-copy {
  display: grid;
  gap: 10px;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(66, 178, 3, 0.1);
  color: #397a15;
  font-size: 0.85rem;
  font-weight: 700;
}

.section-copy {
  margin: 6px 0 0;
  color: var(--muted);
}

.list-row-main,
.list-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.logout-form {
  margin-top: auto;
}

.sidebar-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-note p:last-child {
  margin: 0;
  line-height: 1.6;
}

.error-card {
  max-width: 520px;
  text-align: center;
}

code {
  background: #f3efe8;
  padding: 3px 7px;
  border-radius: 10px;
  word-break: break-all;
}

@media (max-width: 980px) {
  .login-stage,
  .login-card,
  .app-shell,
  .split-grid,
  .workspace-grid,
  .hero-card,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .list-row,
  .section-heading,
  .entity-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar {
    position: static;
  }

  .hero-stats {
    width: 100%;
    justify-content: space-between;
  }

  .auth-wrapper {
    min-height: 580px;
  }

  .inline-actions,
  .list-row-actions {
    width: 100%;
  }
}
