:root {
  --bg-0: #070708;
  --bg-1: #101014;
  --bg-2: #17171d;
  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-soft: rgba(201, 162, 39, 0.18);
  --text: #f4efe4;
  --muted: #a39b8c;
  --danger: #c45b5b;
  --ok: #6faf7a;
  --line: rgba(232, 197, 71, 0.22);
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(201, 162, 39, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 197, 71, 0.08), transparent 45%),
    linear-gradient(180deg, var(--bg-0), #0c0c10 40%, #08080a);
}

body {
  position: relative;
  overflow-x: hidden;
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: #ffe082; }

.bg-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 85%);
  opacity: 0.35;
  z-index: 0;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(7, 7, 8, 0.72);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.nav-user {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-main {
  padding: 2.5rem 0 4rem;
  min-height: calc(100vh - 140px);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero {
  min-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 4rem;
}

.hero-brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #fff4c8, var(--gold-bright) 45%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title {
  margin: 0 0 1rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.15;
}

.hero-text {
  margin: 0 0 2rem;
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions { display: flex; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  color: #1a1405;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 10px 30px rgba(201, 162, 39, 0.25);
}

.btn-primary:hover {
  color: #1a1405;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(232, 197, 71, 0.35);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.btn-danger {
  color: #fff;
  background: #8d3535;
}

.btn-lg { padding: 0.95rem 1.6rem; font-size: 1.02rem; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; border-radius: 8px; }
.btn-block { width: 100%; }

.flash {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.flash-success { border-color: rgba(111, 175, 122, 0.45); color: #b8e0bf; }
.flash-error { border-color: rgba(196, 91, 91, 0.5); color: #f0b4b4; }

.auth-panel,
.form-card {
  width: min(460px, 100%);
  margin: 1rem auto;
  padding: 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 23, 29, 0.95), rgba(12, 12, 16, 0.95));
  box-shadow: var(--shadow);
}

.auth-panel h1,
.form-card h2,
.section-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.muted { color: var(--muted); }

.form {
  display: grid;
  gap: 0.9rem;
}

.form label {
  display: grid;
  gap: 0.35rem;
}

.form label span {
  font-size: 0.86rem;
  color: var(--muted);
}

.form input,
.form textarea,
.form select {
  width: 100%;
  border: 1px solid rgba(232, 197, 71, 0.2);
  border-radius: 10px;
  background: #0d0d11;
  color: var(--text);
  padding: 0.75rem 0.85rem;
  font: inherit;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.link-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  margin: 0;
}

.link-box legend {
  padding: 0 0.35rem;
  color: var(--gold-bright);
  font-size: 0.9rem;
}

.page-cliente .section-head h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.check {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  grid-template-columns: none !important;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section-head { margin-bottom: 1.5rem; }

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.system-card {
  display: grid;
  gap: 0.55rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(28, 24, 14, 0.85), rgba(12, 12, 16, 0.95));
  color: var(--text);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.system-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 197, 71, 0.55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.system-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.system-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.system-card p {
  margin: 0;
  color: var(--muted);
  min-height: 2.8em;
}

.system-cta {
  margin-top: 0.4rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.stat {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(16, 16, 20, 0.85);
  text-align: center;
}

.stat span {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-bright);
}

.stat small { color: var(--muted); }

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.table-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 12, 16, 0.8);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--gold-bright);
  font-size: 0.85rem;
  font-weight: 600;
}

.data-table code {
  font-size: 0.82rem;
  color: #d8cfae;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.inline-form { display: inline-flex; gap: 0.35rem; align-items: center; }
.reset-form input {
  width: 140px;
  border: 1px solid rgba(232, 197, 71, 0.2);
  border-radius: 8px;
  background: #0d0d11;
  color: var(--text);
  padding: 0.35rem 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-on { background: rgba(111, 175, 122, 0.18); color: #b8e0bf; }
.badge-off { background: rgba(163, 155, 140, 0.15); color: var(--muted); }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s ease forwards;
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 800px) {
  .form-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 0;
  }
}
