:root {
  --bg: #050816;
  --bg-soft: #0b1020;
  --card-bg: #0f172a;
  --card-bg-soft: #111827;
  --accent: #00ffc3;
  --accent-soft: rgba(0, 255, 195, 0.1);
  --accent-strong: #22c55e;
  --text: #f9fafb;
  --muted: #9ca3af;
  --border: #1f2937;
  --danger: #f97373;
  --radius-xl: 18px;
  --radius-lg: 12px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.9);
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #111827 0, #020617 40%, #000 100%);
  color: var(--text);
  min-height: 100%;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 32px;
  width: 100%;
  max-width: 1200px;
  padding: 32px 20px;
}

/* SIDEBAR */

.sidebar {
  background: linear-gradient(160deg, #020617, #020617 40%, #020617 60%, #020617);
  border-radius: 24px;
  padding: 24px 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: visible; /* para que el logo no se corte */
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.17), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(34, 197, 94, 0.17), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

.sidebar-inner {
  position: relative;
  z-index: 1;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.9);
}

.sidebar h1 {
  margin: 18px 0 4px;
  font-size: 28px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar h1 span {
  color: var(--accent);
}

.sidebar-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.sidebar-tagline {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 18px;
  color: #e5e7eb;
}

.sidebar-tagline strong {
  color: var(--accent);
}

.sidebar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
}

.sidebar-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.sidebar-metric {
  margin: 14px 0 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.sidebar-metric strong {
  font-size: 13px;
  color: var(--accent-strong);
}

.sidebar-footer {
  margin-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.sidebar-footer span.highlight {
  color: var(--accent);
}

/* Logo LADV */

.logo-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 18px 0 28px;
}

.ladv-logo {
  max-width: 140px;
  width: 60%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
}

/* MAIN */

.main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.main-title {
  font-size: 18px;
  font-weight: 500;
}

.main-title span {
  color: var(--accent);
}

.main-badge {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--muted);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), #020617 60%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
}

.card-subtitle {
  font-size: 12px;
  color: var(--muted);
}

/* FORM */

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}

.form-label span {
  color: var(--accent);
}

.form-control,
.form-textarea,
.form-file-input {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: radial-gradient(circle at top left, #020617, #020617 60%);
  padding: 9px 11px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-control::placeholder,
.form-textarea::placeholder {
  color: #6b7280;
}

.form-control:focus,
.form-textarea:focus,
.form-file-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
  background: radial-gradient(circle at top left, #020617, #020617 60%);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
}

.form-help {
  font-size: 11px;
  color: var(--muted);
}

.form-footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--text);
  transition: background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.btn-primary {
  background: radial-gradient(circle at top left, #22c55e, #14b8a6);
  color: #020617;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.4);
}

.btn-ghost {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-icon-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

/* LOG / RESULTADOS */

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.log-table thead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.log-table th,
.log-table td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.8);
}

.log-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.8);
}

.log-status-ok {
  color: #22c55e;
  font-weight: 500;
}

.log-status-error {
  color: var(--danger);
  font-weight: 500;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--muted);
}

/* PEQUEÑOS DETALLES */

.code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.9);
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* ===========================
   RESPONSIVE
   =========================== */

/* Tablet / pantallas medias */
@media (max-width: 880px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 14px 28px;
    gap: 20px;
  }

  .sidebar {
    order: 0;
    padding: 20px 18px;
  }

  .main {
    order: 1;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

/* Móvil pequeño */
@media (max-width: 600px) {
  body {
    align-items: flex-start;
  }

  .page {
    padding: 14px 12px 24px;
  }

  .sidebar h1 {
    font-size: 22px;
  }

  .sidebar-subtitle {
    font-size: 11px;
  }

  .sidebar-tagline {
    font-size: 14px;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .main-title {
    font-size: 17px;
  }

  .card {
    padding: 14px 14px 12px;
  }

  .form-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    width: 100%;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}
