/*
 * Dojo Fácil — capa de tema del panel (elegante y moderno).
 * Se carga DESPUÉS de app.css en layouts/app.php, así que refina los componentes
 * compartidos (botones, tarjetas, inputs, cabecera, pie) sin tocar el build de Tailwind.
 * Es una hoja estática: `npm run build` regenera app.css pero no toca este archivo.
 */

:root {
  --brand-50: #eef1ff;
  --brand-100: #e0e5ff;
  --brand-200: #c7ccff;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;

  --ink: #0f172a;
  --ink-700: #1e293b;
  --body: #475569;
  --muted: #64748b;
  --faint: #94a3b8;

  --line: #e6e8f0;
  --line-soft: #eef1f6;
  --bg: #f6f7fb;
  --card: #ffffff;

  --gold: #f59e0b;
  --gold-600: #d97706;
  --success: #10b981;
  --danger: #dc2626;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
  --shadow-md: 0 16px 38px -20px rgba(15, 23, 42, .30);
  --shadow-brand: 0 12px 28px -12px rgba(79, 70, 229, .5);
}

body {
  background:
    radial-gradient(900px 420px at 100% -12%, rgba(99, 102, 241, .07), transparent 60%),
    radial-gradient(700px 360px at 0 0, rgba(129, 140, 248, .05), transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabecera del panel ---------- */
body > header {
  position: sticky;
  top: 0;
  z-index: 40;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(160%) blur(10px);
  box-shadow: 0 8px 26px -24px rgba(15, 23, 42, .8);
}
body > header .link,
body > header a.text-lg { color: var(--ink-700); }
body > header a.text-lg { letter-spacing: -.02em; }
body > header nav a.link { font-weight: 600; transition: color .16s ease; }
body > header nav a.link:hover { color: var(--brand-700); text-decoration: none; }

/* ---------- Botones ---------- */
.btn-primary {
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: var(--shadow-brand);
  transition: transform .18s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 16px 34px -12px rgba(79, 70, 229, .62);
  filter: saturate(1.05);
}
.btn-primary:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; }
.btn-secondary { border-radius: 12px; border-color: var(--line); transition: border-color .16s ease, background-color .16s ease; }
.btn-secondary:hover { border-color: var(--brand-200); background: var(--brand-50); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }

/* ---------- Tarjetas, inputs y enlaces ---------- */
.card { border-radius: var(--radius-lg); border-color: var(--line); box-shadow: var(--shadow-sm); }
.form-input {
  border-radius: 11px;
  border-color: #d6dbe6;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.form-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
  outline: none;
}
.link { color: var(--brand-600); }
.link:hover { color: var(--brand-700); }

/* ---------- Branding: selectores de color y logo ---------- */
.color-field { display: inline-flex; align-items: center; gap: .6rem; margin-top: .35rem; }
.color-swatch {
  width: 3.2rem; height: 2.5rem; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.color-swatch:hover { border-color: var(--brand-200); }
.color-swatch:focus-visible { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.color-swatch::-webkit-color-swatch-wrapper { padding: 3px; }
.color-swatch::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color-swatch::-moz-color-swatch { border: 0; border-radius: 7px; }
.color-hex { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; font-weight: 600; letter-spacing: .02em; color: var(--body); }
.brand-logo-current { display: flex; flex-direction: column; gap: .5rem; }

/* ---------- Pie del panel ---------- */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.site-footer nav {
  max-width: 72rem;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  padding: 22px 24px;
}
.site-footer a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.site-footer a:hover { color: var(--brand-700); }

/* ---------- Alertas ---------- */
.alert {
  margin-top: 16px;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: .93rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-700);
}
.alert--success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.alert--error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.alert.alert--warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.alert code { background: rgba(15, 23, 42, .06); padding: .05rem .3rem; border-radius: 5px; font-size: .88em; }
.muted { color: var(--muted); }

/* ---------- Envoltorio de autenticación (login / registro) ---------- */
.auth { max-width: 46rem; margin-inline: auto; }
.auth--narrow { max-width: 27rem; }
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 34px;
}
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 16px;
}
.auth-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: var(--shadow-brand);
}
.auth-brand__mark svg { width: 21px; height: 21px; }
.auth-title { margin: 0; font-size: 1.7rem; font-weight: 850; letter-spacing: -.02em; color: var(--ink); }
.auth-sub { margin: 8px 0 0; color: var(--muted); }
.auth-foot { margin-top: 22px; text-align: center; font-size: .9rem; color: var(--muted); }

/* ---------- Selector de plan del registro ---------- */
.plan-picker { border: 0; padding: 0; margin: 0 0 6px; }
.plan-picker__legend {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.plan-picker__hint { font-size: .85rem; color: var(--muted); margin: 0 0 14px; }
.plan-picker__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-option { position: relative; display: block; cursor: pointer; }
.plan-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.plan-option__body {
  display: block;
  height: 100%;
  padding: 16px 16px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.plan-option:hover .plan-option__body { border-color: var(--brand-200); transform: translateY(-2px); }
.plan-option input:checked + .plan-option__body {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100), var(--shadow-sm);
}
.plan-option input:focus-visible + .plan-option__body { box-shadow: 0 0 0 3px var(--brand-200); }
.plan-option__name { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
.plan-option__badge {
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-600));
  padding: 2px 7px;
  border-radius: 999px;
}
.plan-option__price { margin-top: 10px; font-size: 1.4rem; font-weight: 850; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.plan-option__price small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.plan-option__meta { display: block; margin-top: 7px; font-size: .82rem; color: var(--muted); }
.plan-option__check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-600);
  opacity: 0;
  transform: scale(.5);
  transition: opacity .16s ease, transform .16s ease;
}
.plan-option__check svg { width: 13px; height: 13px; }
.plan-option input:checked ~ .plan-option__check { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .plan-picker__grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
}

/* ---------- Interior del panel: barra lateral izquierda ---------- */
:root { --sidebar-w: 264px; --sidebar-bg: #0b1220; }

.app-sidebar {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: var(--sidebar-w); height: 100vh;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.app-sidebar__brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.app-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.app-brand__mark {
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: 40px; height: 40px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: var(--shadow-brand);
}
.app-brand__mark svg { width: 23px; height: 23px; }
.app-brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.app-brand__name { display: flex; flex-direction: column; min-width: 0; }
.app-brand__name strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.015em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-brand__name small { font-size: .78rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.app-nav__label { margin: 15px 10px 5px; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #56617a; }
.app-nav__label:first-child { margin-top: 4px; }
.app-nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 11px;
  color: #cbd5e1; text-decoration: none; font-weight: 600; font-size: .93rem;
  transition: background-color .15s ease, color .15s ease;
}
.app-nav__item svg { width: 20px; height: 20px; flex: none; opacity: .8; }
.app-nav__item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-nav__item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.app-nav__item:hover svg { opacity: 1; }
.app-nav__item.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .75);
}
.app-nav__item.is-active svg { opacity: 1; }

.app-sidebar__user { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.app-user { display: flex; align-items: center; gap: 11px; padding: 2px 6px 12px; min-width: 0; }
.app-user__avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); }
.app-user__text { display: flex; flex-direction: column; min-width: 0; }
.app-user__text strong { font-size: .92rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user__text small { font-size: .78rem; color: #64748b; }
.app-signout {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 11px;
  background: transparent; color: #e2e8f0; font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.app-signout svg { width: 18px; height: 18px; }
.app-signout:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .28); }

.app-body { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-content { flex: 1; width: 100%; max-width: 1140px; margin-inline: auto; padding: 36px 34px 52px; }
.app-body .site-footer { margin-top: auto; }

.app-topbar { display: none; }
.app-scrim { display: none; }

@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: 0 0 70px rgba(0, 0, 0, .45); }
  .app-nav-switch:checked ~ .app-sidebar { transform: translateX(0); }
  .app-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(2, 6, 23, .55); }
  .app-nav-switch:checked ~ .app-scrim { display: block; }
  .app-body { margin-left: 0; }
  .app-topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
    padding: 11px 16px; background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line);
  }
  .app-topbar__burger { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
  .app-topbar__burger svg { width: 22px; height: 22px; }
  .app-topbar__title { font-weight: 800; letter-spacing: -.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-content { padding: 20px 16px 40px; }
}

/* ---------- Pulido fino global del panel ---------- */
::selection { background: var(--brand-100); color: var(--brand-800); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px;
}
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: #f8faff; }
.empty-state { color: var(--muted); }
