:root {
  /* === MODO CLARO (default) === */
  --bg: #fbfbfc;
  --bg-gradient: radial-gradient(1200px circle at 10% -10%, #eef6ff 0%, #fbfbfc 40%);
  --surface: #ffffff;
  --surface-alt: #f6f6f8;
  --surface-muted: #fafafc;
  --surface-dark: #0a0a0f;
  --surface-elevated: #ffffff;

  --border: rgba(17, 17, 23, 0.06);
  --border-soft: rgba(17, 17, 23, 0.04);
  --border-strong: rgba(17, 17, 23, 0.12);

  --text: #0a0a0f;
  --text-muted: #5c5c66;
  --text-soft: #8c8c94;

  /* Azul Link3rs (mismo que --color-primary de la web pública) */
  --accent: #0096FF;
  --accent-hover: #007acc;
  --accent-soft: #e6f5ff;
  --accent-contrast: #ffffff;

  --ink: #0a0a0f;            /* para botones primarios tipo Apple "negro" */
  --ink-hover: #1c1c22;

  --black: #0a0a0f;
  --green: #2e8a4c;
  --green-soft: #e7f5ed;
  --red: #d92d20;
  --red-soft: #fdeceb;
  --amber: #b76b00;
  --amber-soft: #fbf3e3;
  --purple: #7c3aed;
  --purple-soft: #f0eafc;

  --shadow-xs: 0 1px 2px rgba(17,17,23,0.04);
  --shadow-sm: 0 1px 3px rgba(17,17,23,0.04), 0 1px 2px rgba(17,17,23,0.03);
  --shadow-md: 0 4px 20px rgba(17,17,23,0.06), 0 1px 3px rgba(17,17,23,0.04);
  --shadow-lg: 0 20px 50px rgba(17,17,23,0.10), 0 4px 12px rgba(17,17,23,0.04);
  --shadow-xl: 0 32px 80px rgba(17,17,23,0.12), 0 8px 20px rgba(17,17,23,0.05);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Variable-weight Inter cuando esté disponible */
@supports (font-variation-settings: normal) {
  :root { --font: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, sans-serif; }
}

/* === MODO OSCURO === */
:root[data-theme="dark"] {
  --bg: #0c0d11;
  --bg-gradient: radial-gradient(1200px circle at 10% -10%, #11253d 0%, #0c0d11 40%);
  --surface: #16171c;
  --surface-alt: #1c1d24;
  --surface-muted: #14151a;
  --surface-elevated: #1c1d24;

  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f4f5f7;
  --text-muted: #a8a9b0;
  --text-soft: #6b6c75;

  --accent: #38b6ff;
  --accent-hover: #5cc4ff;
  --accent-soft: rgba(56, 182, 255, 0.12);
  --accent-contrast: #0c0d11;

  --ink: #f4f5f7;
  --ink-hover: #e4e5e8;

  --green-soft: rgba(46, 138, 76, 0.16);
  --red-soft: rgba(217, 45, 32, 0.16);
  --amber-soft: rgba(183, 107, 0, 0.16);
  --purple-soft: rgba(124, 58, 237, 0.16);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.32), 0 1px 3px rgba(0,0,0,0.22);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

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

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0;
}

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }

/* ---- App shell ---- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 220ms var(--ease);
}
:root.sidebar-collapsed .app-shell {
  grid-template-columns: 64px 1fr;
}

.app-sidebar {
  background: var(--surface-muted);
  border-right: 1px solid var(--border);
  padding: 12px 10px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.sidebar-top-spacer {
  height: 28px;
  flex-shrink: 0;
}


.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 180ms var(--ease), color 180ms var(--ease);
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(17, 17, 23, 0.04);
}
.nav-item.is-active {
  background: rgba(17, 17, 23, 0.05);
  color: var(--text);
  font-weight: 600;
}
.nav-emoji {
  font-size: 14px;
  width: 18px;
  text-align: center;
  line-height: 1;
  opacity: 0.85;
}

/* Section labels */
.nav-group-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  padding: 14px 12px 6px;
  margin-top: 8px;
  text-transform: uppercase;
}
.nav-group-label:first-of-type { margin-top: 10px; }

/* ---- Sidebar footer (usuario + logout) ---- */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: default;
}
.sidebar-user__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user__info {
  min-width: 0;
  flex: 1;
  transition: opacity 180ms var(--ease);
}
.sidebar-user__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user__email {
  font-size: 11px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout-form { margin: 0; }
.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}
.sidebar-logout-btn:hover {
  background: rgba(217, 45, 32, 0.08);
  color: var(--red);
}

/* Separador "— Ocultos —" entre items activos y ocultos en listas
   reordenables (logos, languages, carousel items, eventos). */
.hidden-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 4px 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hidden-divider::before,
.hidden-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.hidden-divider span {
  padding: 0 4px;
}

/* Theme toggle (modo claro / oscuro) */
.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: background 180ms var(--ease), color 180ms var(--ease);
  margin-bottom: 4px;
}
.theme-toggle:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.theme-toggle__icon { display: flex; width: 18px; justify-content: center; }
.theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: flex; }

/* ---- Botón colapsar sidebar (en el header) ---- */
.sidebar-toggle {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}
.sidebar-toggle:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* ---- Main ---- */
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-header {
  /* Antes era una franja blanca sticky arriba. Ahora la ocultamos: cada
     página ya tiene su propio page-hero, así que esto solo añadía ruido. */
  display: none;
}
.app-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.app-title:empty { display: none; }
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 500;
}
.logout-form { margin: 0; }

.app-content {
  padding: 64px 56px 96px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-search {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 640px;
}
.toolbar-search input,
.toolbar-search select { flex: 1; }

/* ---- Forms ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--text);
}
.field > span { font-weight: 500; color: var(--text); }
.field small { color: var(--text-muted); font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}
textarea { resize: vertical; font-family: var(--font); line-height: 1.55; }
input[type="file"] { font: inherit; padding: 6px 0; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.checkbox input { width: auto; accent-color: var(--accent); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 160px; }

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}
@media (max-width: 960px) { .form-grid { grid-template-columns: 1fr; } }
.form-main, .form-side { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; flex-direction: column; gap: 8px; }

.preview {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}
.preview-sm { max-width: 140px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s,
              transform 0.06s, box-shadow 0.15s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-primary {
  background: #0a0a0f;
  color: #fff;
  border-color: #0a0a0f;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  font-weight: 500;
  transition: all 180ms var(--ease);
}
.btn-primary:hover {
  background: #1c1c22;
  border-color: #1c1c22;
  box-shadow: 0 2px 8px rgba(0,0,0,0.20);
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover { background: #edeef2; }

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}
.btn-danger:hover { background: #ffd9d6; }

.btn-success {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-success:hover { background: #30b653; border-color: #30b653; }

/* ---- Pills ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11.5px;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
}
.pill-green { background: var(--green-soft); color: #1e8f3e; border-color: #cdeed8; }
.pill-blue  { background: var(--accent-soft); color: var(--accent); border-color: #d2e4fb; }
.pill-gray  { background: var(--surface-alt); color: var(--text-muted); }
.pill-amber { background: var(--amber-soft); color: #b56c00; border-color: #ffdeae; }
.pill-red   { background: var(--red-soft); color: var(--red); border-color: #ffd0cd; }
.pill-purple{ background: var(--purple-soft); color: var(--purple); border-color: #e9d3f5; }

/* ---- Segmented ---- */
.segmented {
  display: inline-flex;
  background: var(--surface-alt);
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.seg-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: 999px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13.5px;
}
.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover td { background: var(--surface-alt); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .thumb-cell img {
  width: 72px; height: 44px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
}
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

.empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-emoji { font-size: 36px; display: block; margin-bottom: 6px; }

/* ---- Stats (home) ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  text-decoration: none;
}
.stat-emoji {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat-sub { font-size: 12.5px; color: var(--text-muted); }

.home-quick {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.home-quick h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.quick-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  background: var(--surface-alt);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-card:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-1px);
}

/* ---- Logos grid ---- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.logo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.2s;
}
.logo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.logo-card.is-inactive { opacity: 0.5; }
.logo-thumb {
  height: 100px;
  display: grid;
  place-items: center;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}
.logo-thumb img { max-width: 80%; max-height: 78px; object-fit: contain; }
.logo-name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; }
.logo-sub { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-muted); }
.logo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
}
.logo-badges .chip { font-size: 10.5px; padding: 2px 8px; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.logo-actions form { margin: 0; }

/* ---- Carousel items ---- */
.carousel-items { display: flex; flex-direction: column; gap: 10px; }
.ci-card {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.ci-card:hover { box-shadow: var(--shadow-sm); }
.ci-card.is-inactive { opacity: 0.5; }
.ci-thumb {
  height: 68px; background: var(--surface-alt);
  border-radius: 8px; overflow: hidden; display: grid; place-items: center;
}
.ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ci-actions { display: flex; gap: 4px; }
.ci-actions form { margin: 0; }

/* ---- Media grid ---- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.2s;
}
.media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.media-thumb {
  height: 128px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-icon { font-size: 28px; }
.media-name {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-meta { display: flex; flex-direction: column; gap: 6px; }
.media-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.media-actions form { margin: 0; }

/* ---- Flash ---- */
.flash-stack {
  padding: 12px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash::before { font-size: 16px; line-height: 1; }
.flash-success {
  background: var(--green-soft); border-color: #cdeed8; color: #1e8f3e;
}
.flash-success::before { content: "✅"; }
.flash-error {
  background: var(--red-soft); border-color: #ffd0cd; color: var(--red);
}
.flash-error::before { content: "❌"; }
.flash-info {
  background: var(--accent-soft); border-color: #d2e4fb; color: var(--accent);
}
.flash-info::before { content: "ℹ️"; }
.flash-warning {
  background: var(--amber-soft); border-color: #ffdeae; color: #b56c00;
}
.flash-warning::before { content: "⚠️"; }

/* ---- Login (Link3rs blue gradient) ---- */
body.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #001a33;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 150, 255, 0.55) 0%, transparent 60%),
    radial-gradient(circle at 15% 110%, rgba(0, 95, 204, 0.45), transparent 55%),
    radial-gradient(circle at 85% 100%, rgba(56, 182, 255, 0.30), transparent 50%),
    linear-gradient(180deg, #0a1628 0%, #001a33 100%);
  background-attachment: fixed;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.login-logo svg {
  width: 56px; height: 56px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 150, 255, 0.35);
}
.login-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}
.login-sub {
  margin: 0 0 12px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
}
.login-form {
  display: flex; flex-direction: column;
  gap: 14px;
  width: 100%;
}
.login-form .field > span {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.login-form input[type="email"],
.login-form input[type="password"] {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.login-form input::placeholder { color: rgba(255,255,255,0.35); }
.login-form input:focus {
  outline: none;
  border-color: #38b6ff;
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(56,182,255,0.18);
}
.login-form .btn-primary {
  background: linear-gradient(135deg, #0096FF 0%, #007acc 100%);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  margin-top: 4px;
  box-shadow: 0 8px 20px rgba(0, 150, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.login-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 150, 255, 0.45);
}

/* ============================================================
   Nuevas vistas por página (Landing / Solutions / Impact / About)
   Estilo Apple.com: mucho aire, tipografía grande y ligera,
   sin bordes duros, sombras sutiles, imágenes protagonistas.
   ============================================================ */

/* ---- HERO de cada página ---- */
.page-hero {
  padding: 0 0 56px;
  margin-bottom: 64px;
}
.page-hero--centered {
  text-align: center;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}
.page-hero--centered .page-hero__subtitle {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Home: centrar verticalmente el hero respecto al viewport.
   .app-content tiene padding-top/bottom propios; les hacemos override aquí
   para que el wrapper ocupe toda la altura y el contenido quede en el centro. */
body.home-page .app-content {
  padding-top: 0;
  padding-bottom: 0;
  min-height: 100vh;
  justify-content: center;
}
.home-center {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-hero__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.page-hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 64px;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 16px;
  color: var(--text);
}
.serif-flourish {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  opacity: 0.7;
}
.page-hero__subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 60ch;
  font-weight: 400;
}
.page-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Iframe preview ---- */
.page-preview {
  position: relative;
  margin: 0 0 64px;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(17, 17, 23, 0.04);
}
.page-preview__bar {
  display: none;
}
.page-preview__url {
  display: none;
}
.page-preview__refresh {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: #0a0a0f;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  z-index: 10;
}
.page-preview:hover .page-preview__refresh {
  opacity: 1;
}
.page-preview iframe {
  width: 100%;
  height: 520px;
  border: 0;
  display: block;
  background: #fff;
}
.page-preview__footer {
  display: none;
}

/* ---- Sección de página (texto intro + contenido) ---- */
.page-intro {
  display: none; /* sustituido por page-hero */
}
.sections-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0 24px;
}
.sections-intro__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0;
}
.sections-intro__hint {
  color: var(--text-soft);
  font-size: 13px;
}

/* ---- Card de sección (Apple-style module) ---- */
.page-card {
  background: #ffffff;
  border: none;
  border-radius: 24px;
  padding: 32px 36px;
  box-shadow: 0 1px 3px rgba(17, 17, 23, 0.04);
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 28px;
  transition: box-shadow 240ms var(--ease), transform 240ms var(--ease);
}
.page-card:hover {
  box-shadow: 0 4px 12px rgba(17, 17, 23, 0.08);
  transform: translateY(-2px);
}

.page-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 0;
}
.page-card__eyebrow {
  display: none;
}
.page-card__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.page-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 640px;
  font-weight: 400;
}
.page-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 0;
}
.page-card__count {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

/* Chips pequeños (contadores, "oculto", etc.) */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 0;
  letter-spacing: 0.01em;
}
.chip-warn { background: var(--amber-soft); color: #8a5a00; }
.chip-ok   { background: var(--green-soft); color: #1f7a35; }
.chip-info { background: var(--accent-soft); color: var(--accent); }

/* Empty state genérico dentro de una page-card */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}
.empty-state--informative {
  gap: 12px;
  padding: 28px 32px;
  border: none;
  text-align: left;
  align-items: flex-start;
}
.empty-state ul {
  margin: 8px 0;
  padding-left: 20px;
  line-height: 1.7;
  text-align: left;
}
.empty-state p { margin: 0; }
.empty-state p.muted {
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 4px;
}

/* Grids de preview comunes */
.preview-grid {
  display: grid;
  gap: 20px;
}
.preview-grid--logos {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 24px;
}
.preview-grid--logos.preview-grid--big {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}
.preview-grid--events {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.preview-grid--thumbs {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.preview-grid--cards {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* Preview logo (tile limpio estilo Apple) */
.preview-logo {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 16px;
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s ease, background 0.18s ease;
}
.preview-logo:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.preview-logo img {
  max-width: 85%;
  max-height: 56px;
  object-fit: contain;
}
.preview-logo__name {
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}
.preview-logo.is-inactive { opacity: 0.35; filter: grayscale(1); }
.preview-logo--more {
  justify-content: center;
  color: var(--text-soft);
  font-weight: 600;
  background: transparent;
  border: 1.5px dashed var(--border);
}

/* Preview vídeo */
.preview-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.preview-video {
  background: var(--surface-alt, #f5f5f7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-video.is-inactive { opacity: 0.5; }
.preview-video__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-video__media {
  width: 100%;
  max-height: 180px;
  border-radius: 8px;
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.preview-video__title {
  font-size: 13px;
  color: var(--text);
}

/* Preview event (card de evento, estilo producto Apple) */
.preview-event {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(17, 17, 23, 0.04);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.preview-event:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 17, 23, 0.08);
}
.preview-event.is-inactive { opacity: 0.5; }
.preview-event__cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: #f5f5f7;
}
.preview-event__cover--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 12px;
  background: #f5f5f7;
}
.preview-event__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 18px 4px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.preview-event__short {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 18px;
  line-height: 1.5;
}
.preview-event__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 18px;
  font-size: 12px;
  color: var(--text-soft);
  align-items: center;
}

/* Preview thumb (carruseles de fotos) */
.preview-thumb {
  position: relative;
  background: var(--surface-alt);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}
.preview-thumb:hover { transform: scale(1.015); }
.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-thumb.is-inactive { opacity: 0.4; }
.preview-thumb__caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.75), rgba(0,0,0,0));
  color: #fff;
  padding: 28px 12px 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.preview-thumb--more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1.5px dashed var(--border);
  box-shadow: none;
}

/* Preview card (stack de soluciones) */
.preview-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.preview-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.preview-card.is-inactive { opacity: 0.55; }
.preview-card__cover {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  margin-bottom: 4px;
  background-color: var(--surface-alt);
}
.preview-card__title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.preview-card__caption {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---- Home + Ajustes avanzados: grid de accesos ---- */
.advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.advanced-card {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(17, 17, 23, 0.04);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
  overflow: hidden;
}
.advanced-card::after {
  content: "→";
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 16px;
  color: var(--text-soft);
  opacity: 0;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.advanced-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 17, 23, 0.08);
}
.advanced-card:hover::after {
  opacity: 1;
  transform: translateX(3px);
}
.advanced-card__emoji {
  display: none;
}
.advanced-card__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.advanced-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
}

/* Home - sección de resumen */
.home-summary {
  margin: 56px 0 0;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}
.home-summary__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

/* ---- Mobile ---- */
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .app-content { padding: 18px; }
  .app-header { padding: 14px 18px; }
  .page-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}


/* ============================================================
   MÓDULOS INTERNOS (frontstage): CRM, Social, Tareas (kanban)
   Estilos portados de frontstage/static/app.css en la unificación.
   ============================================================ */

.app-subtitle { color: var(--text-faint); font-size: 13px; margin-top: 2px; }

.btn--primary {
  background: var(--accent); color: #fff; border-color: transparent;
}

.btn--primary:hover { background: #2a63d6; }

.btn--ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--text-soft); }

.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn--danger { color: var(--tag-red-fg); border-color: transparent; box-shadow: none; background: transparent; }

.btn--danger:hover { background: var(--tag-red-bg); }

.btn--sm { padding: 4px 9px; font-size: 12px; }

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
  background: var(--tag-gray-bg); color: var(--tag-gray-fg);
}

.tag--gray   { background: var(--tag-gray-bg);   color: var(--tag-gray-fg); }

.tag--blue   { background: var(--tag-blue-bg);   color: var(--tag-blue-fg); }

.tag--green  { background: var(--tag-green-bg);  color: var(--tag-green-fg); }

.tag--yellow { background: var(--tag-yellow-bg); color: var(--tag-yellow-fg); }

.tag--red    { background: var(--tag-red-bg);    color: var(--tag-red-fg); }

.tag--purple { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }

.tag--orange { background: var(--tag-orange-bg); color: var(--tag-orange-fg); }

.tag__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Table (Notion-ish) ---------- */
.panel {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}

.cell-primary { font-weight: 600; }

.cell-sub { color: var(--text-faint); font-size: 12px; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-faint);
}

.empty__emoji { font-size: 34px; }

.empty__title { color: var(--text); font-weight: 650; margin-top: 10px; font-size: 16px; }

.empty__hint { margin-top: 4px; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; }

.board-col { background: var(--bg-sunken); border-radius: var(--radius-lg); padding: 10px; min-height: 120px; }

.board-col__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }

.board-col__title { font-weight: 650; font-size: 13px; }

.board-col__count { color: var(--text-faint); font-size: 12px; font-weight: 600; }

.board-col.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; }

.kard {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); cursor: grab;
}

.kard:active { cursor: grabbing; }

.kard__title { font-weight: 600; }

.kard__meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Modal (dialog) ---------- */
dialog.modal {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 0; width: min(560px, 92vw); background: var(--bg-elevated);
  color: var(--text); box-shadow: var(--shadow-md);
}

dialog.modal::backdrop { background: rgba(15, 15, 15, 0.4); backdrop-filter: blur(2px); }

.modal__head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 6px; }

.modal__title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

.modal__body { padding: 10px 22px 4px; }

.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.empty-state { text-align: center; padding: 28px; color: var(--text-faint); }

.empty-state--informative { text-align: left; background: var(--bg-sunken); border-radius: 12px; }

.empty-state ul { margin: 8px 0; padding-left: 18px; }

/* Progreso RRSS */
.progress { display: inline-flex; align-items: center; gap: 8px; }

.progress__bar { width: 84px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }

.progress__fill { height: 100%; background: var(--tag-green-fg); border-radius: 999px; }

.progress__txt { font-size: 12px; color: var(--text-faint); font-weight: 600; }

/* Variables que usan los MÓDULOS INTERNOS (mapeadas a la paleta nueva) */
:root {
  --bg-elevated: var(--surface);
  --bg-sunken: var(--surface-alt);
  --tag-gray-bg: #f0f0f2;   --tag-gray-fg: #5c5c66;
  --tag-blue-bg: var(--accent-soft);  --tag-blue-fg: #0072c3;
  --tag-green-bg: var(--green-soft); --tag-green-fg: var(--green);
  --tag-yellow-bg: var(--amber-soft); --tag-yellow-fg: var(--amber);
  --tag-red-bg: var(--red-soft);   --tag-red-fg: var(--red);
  --tag-purple-bg: var(--purple-soft); --tag-purple-fg: var(--purple);
  --tag-orange-bg: #fdf0e3;  --tag-orange-fg: #c2570a;
}
:root[data-theme="dark"] {
  --bg-elevated: var(--surface);
  --bg-sunken: rgba(255,255,255,0.04);
  --tag-gray-bg: rgba(255,255,255,0.08); --tag-gray-fg: #b9b9c0;
}

/* Cabecera visible SOLO en los módulos internos (título + botones de acción);
   el resto de páginas usa su propio page-hero y la mantiene oculta. */
body.has-header .app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

/* Chips de filtro de Clientes/Social (el .chip global es un badge informativo) */
.toolbar a.chip {
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; text-decoration: none;
}
.toolbar a.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Campos dentro de los modales de Clientes/Tareas */
.modal__body .field { margin-bottom: 14px; }
.modal__body .field label { display: block; font-weight: 600; font-size: 12px; color: var(--text-soft); margin-bottom: 5px; }
input[type="tel"], input[type="datetime-local"], input[type="date"] { font: inherit; }

/* Panel desplegable "Editar" de la tabla de Premios */
.row-edit { position: relative; display: inline-block; }
.row-edit > summary { list-style: none; cursor: pointer; }
.row-edit > summary::-webkit-details-marker { display: none; }
.row-edit[open] .row-edit__form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: 340px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 18px 44px rgba(17,17,23,0.14);
  text-align: left;
}


/* ============================================================
   REDISEÑO 2026-07 — Apple + toques skeuomórficos
   Referencias: OpenPurpose (pills y aire), holo-chrome (acento),
   chips pastel con emoji. Capa de overrides: gana por cascada.
   ============================================================ */

:root {
  --r-card: 22px;
  --r-pill: 999px;
  --shadow-float: 0 1px 2px rgba(17,17,23,0.04), 0 10px 28px rgba(17,17,23,0.07), 0 28px 60px rgba(17,17,23,0.05);
  --shadow-pop: 0 2px 6px rgba(17,17,23,0.08), 0 24px 64px rgba(17,17,23,0.18);
  --holo: conic-gradient(from 210deg at 50% 50%, #ffd1f0, #ffd9a8, #fdffb8, #b8ffd9, #b8e9ff, #d9c8ff, #ffd1f0);
}

/* Fondo un punto más profundo para que las cards "floten" */
body { background: #f2f2f5; }
:root[data-theme="dark"] body { background: var(--bg); }

/* ---- Sidebar: panel flotante ---- */
.app-sidebar {
  margin: 14px 0 14px 14px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-float);
  height: calc(100svh - 28px);
  position: sticky;
  top: 14px;
}
.sidebar-top-spacer { height: 12px; }

/* Marca con acento holográfico (chapa skeuomórfica) */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 14px 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(17,17,23,0.05), inset 0 1px 0 rgba(255,255,255,0.7);
}
.sidebar-brand__gem {
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--holo);
  filter: saturate(1.15) blur(0.2px);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), inset 0 -2px 4px rgba(17,17,23,0.18), 0 1px 3px rgba(17,17,23,0.18);
}
.sidebar-brand__name { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.sidebar-brand__name small { display: block; font-weight: 500; font-size: 11px; color: var(--text-soft); letter-spacing: 0; }

.nav-item { border-radius: 12px; }
.nav-item.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(10,10,15,0.22);
}
:root[data-theme="dark"] .nav-item.is-active { background: #fff; color: #0a0a0f; }

/* ---- Cards flotantes ---- */
.card, .advanced-card, .page-card {
  border-radius: var(--r-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-float);
}
.advanced-card { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease; }
.advanced-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }

/* ---- Botones: todo pill; primario negro tipo "Complete" ---- */
.btn { border-radius: var(--r-pill); font-weight: 600; }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 1px 2px rgba(17,17,23,0.2), 0 8px 20px rgba(10,10,15,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); transform: translateY(-1px); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(17,17,23,0.05);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

/* ---- Chips de estado: pastel + emoji, sin borde duro ---- */
.pill {
  border: none;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 2px rgba(17,17,23,0.04);
}
.pill-holo {
  background: var(--holo);
  color: #1c1c22;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* ---- Segmentado: pills sueltas tipo OpenPurpose ---- */
.segmented { display: flex; gap: 8px; background: transparent; border: none; padding: 0; }
.seg-btn {
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 16px;
  box-shadow: 0 1px 2px rgba(17,17,23,0.04);
}
.seg-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(10,10,15,0.2);
}

/* ---- Tabla: filas suaves, aire ---- */
.data-table th { border-bottom: 1px solid var(--border); font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-soft); }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); }
.data-table tbody tr:hover td { background: var(--surface-muted); }
.thumb-cell img { border-radius: 12px; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(17,17,23,0.14); }

/* ---- Inputs ---- */
.field input, .field select, .field textarea,
.toolbar-search input, .toolbar-search select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(17,17,23,0.03);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

/* ---- Modales y popovers: card flotante grande ---- */
dialog, .modal {
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(17,17,23,0.28); backdrop-filter: blur(3px); }

/* ---- Hero de página: titular grande, aire ---- */
.page-hero__title { font-size: 32px; letter-spacing: -0.022em; }
.page-hero__subtitle { font-size: 15px; }

/* ---- Login: claro, card flotante sobre lavado holo ---- */
body.login-page {
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(255,209,240,0.45), transparent 70%),
    radial-gradient(600px 380px at 80% 0%, rgba(184,233,255,0.45), transparent 70%),
    radial-gradient(500px 340px at 15% 5%, rgba(253,255,184,0.40), transparent 70%),
    #f2f2f5;
}
.login-card {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border-soft);
  border-radius: 26px;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--holo);
}
.login-title { color: var(--text); }
.login-sub { color: var(--text-muted); }
.login-form .field > span { color: var(--text-muted); }
.login-form input[type="email"],
.login-form input[type="password"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(17,17,23,0.03);
}
.login-form input::placeholder { color: var(--text-soft); }
.login-form input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-form .btn-primary {
  background: var(--ink);
  border-radius: var(--r-pill);
  box-shadow: 0 1px 2px rgba(17,17,23,0.2), 0 10px 24px rgba(10,10,15,0.28), inset 0 1px 0 rgba(255,255,255,0.12);
}
.login-form .btn-primary:hover {
  background: var(--ink-hover);
  box-shadow: 0 14px 30px rgba(10,10,15,0.32);
}
.login-logo svg { box-shadow: 0 8px 24px rgba(17,17,23,0.18); }


/* ============================================================
   ARQUITECTURA 2026-07 — espacios, lanzadera y movimiento
   ============================================================ */

/* Entrada suave de cada pantalla */
.app-content { animation: contentIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes contentIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Grids que aparecen en cascada */
.stagger > * { animation: contentIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.13s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.23s; }
.stagger > *:nth-child(6) { animation-delay: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  .app-content, .stagger > * { animation: none; }
}

/* ---- Pestañas de espacio (Historias · Premios · Eventos) ---- */
.space-tabs {
  display: flex; gap: 8px;
  margin-bottom: 22px;
}
.space-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(17,17,23,0.04);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, color 0.2s;
}
.space-tab:hover { transform: translateY(-1px); color: var(--text); text-decoration: none; }
.space-tab.is-active {
  background: var(--ink); border-color: var(--ink); color: #fff;
  box-shadow: 0 6px 16px rgba(10,10,15,0.2);
}
:root[data-theme="dark"] .space-tab.is-active { background: #fff; color: #0a0a0f; }

/* ---- Miga de vuelta al espacio ---- */
a.crumb { cursor: pointer; transition: color 0.2s; }
a.crumb:hover { color: var(--accent); text-decoration: none; }

/* ---- Hub Web: mapa de páginas ---- */
.web-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}
.web-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 26px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-float);
  text-decoration: none; color: var(--text);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}
.web-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); text-decoration: none; }
.web-card__emoji { font-size: 26px; }
.web-card__name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.web-card__desc { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.web-hint { margin-top: 26px; font-size: 13px; color: var(--text-soft); text-align: center; }
.web-hint a { color: var(--accent); }

/* ---- Lanzadera del Inicio ---- */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 860px;
  margin: 26px auto 0;
}
.launch-card {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 34px 26px 30px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-float);
  text-decoration: none; color: var(--text);
  text-align: left;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s;
}
.launch-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--holo);
  opacity: 0; transition: opacity 0.25s;
}
.launch-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-pop); text-decoration: none; }
.launch-card:hover::before { opacity: 1; }
.launch-card__emoji { font-size: 30px; }
.launch-card__name { font-weight: 700; font-size: 18px; letter-spacing: -0.015em; }
.launch-card__desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.launch-card__badge {
  align-self: flex-start;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12.5px; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ---- Flashes como toast flotante ---- */
.flash, #flashes .flash {
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-pop);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .web-grid, .launch-grid { grid-template-columns: 1fr 1fr; }
}


/* ============================================================
   DOCK 2026-07 — canvas centrado + dock flotante estilo macOS
   (sustituye al layout sidebar; el CSS viejo del sidebar queda
   inerte porque el markup ya no existe)
   ============================================================ */

/* Transiciones de página nativas (Chrome/Safari modernos): cross-fade
   suave entre pantallas sin tocar JavaScript. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: 0.22s; }
::view-transition-new(root) { animation-duration: 0.28s; }

/* ---- Canvas: columna centrada, sin marco de admin ---- */
.canvas { min-height: 100svh; display: flex; flex-direction: column; }
.app-shell { display: block; } /* neutraliza el grid viejo si quedara */
.canvas .app-main {
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 140px; /* aire para el dock */
}

/* ---- Barra superior mínima ---- */
.canvas-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
  padding: 14px 0 10px;
  background: transparent;
}
.canvas-brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
}
.canvas-brand:hover { text-decoration: none; }
.canvas-brand__gem {
  width: 22px; height: 22px; border-radius: 8px;
  background: var(--holo);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), inset 0 -2px 4px rgba(17,17,23,0.18), 0 1px 3px rgba(17,17,23,0.18);
}
.canvas-top__side { display: flex; align-items: center; gap: 10px; }
.canvas-top .theme-toggle {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-pill); padding: 6px 10px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(17,17,23,0.05); font-size: 13px;
}
.theme-toggle__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: inline; }
.canvas-logout button {
  border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-soft);
  padding: 6px 8px; border-radius: 8px;
}
.canvas-logout button:hover { color: var(--red); }

/* ---- Título de pantalla grande, tipo página de Apple ---- */
.canvas .app-header { display: none; }
body.has-header .canvas .app-header {
  display: flex;
  align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.canvas .page-hero__title { font-size: clamp(34px, 4vw, 44px); letter-spacing: -0.025em; }
.canvas .page-hero { padding: 26px 0 8px; }

/* ---- EL DOCK ---- */
.dock {
  position: fixed;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 10px 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 2px 8px rgba(17,17,23,0.08), 0 24px 60px rgba(17,17,23,0.22), inset 0 1px 0 rgba(255,255,255,0.8);
}
:root[data-theme="dark"] .dock {
  background: rgba(24, 24, 30, 0.62);
  border-color: rgba(255,255,255,0.12);
}
.dock-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 14px 6px;
  border-radius: 18px;
  text-decoration: none;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}
.dock-item__icon {
  font-size: 26px; line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(17,17,23,0.18));
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dock-item__label {
  margin-top: 4px;
  font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0;
}
/* Lupa: el que tocas crece, los vecinos un poco */
.dock-item:hover { text-decoration: none; }
.dock-item:hover .dock-item__icon { transform: translateY(-8px) scale(1.35); }
.dock-item:hover + .dock-item .dock-item__icon,
.dock-item:has(+ .dock-item:hover) .dock-item__icon { transform: translateY(-3px) scale(1.12); }
/* Punto de "app abierta" bajo el espacio activo */
.dock-item.is-active::after {
  content: '';
  position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text);
  opacity: 0.7;
}
.dock-item:active .dock-item__icon { transform: scale(0.92); }

/* El contenido no se esconde tras el dock al final del scroll */
@media (max-width: 720px) {
  .dock-item__label { display: none; }
  .dock-item { padding: 8px 12px 6px; }
}


/* Home lanzadera: saludo SIEMPRE encima de las tarjetas, todo centrado */
.canvas .home-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100svh - 220px);
  text-align: center;
}
.canvas .home-center .page-hero { padding-bottom: 6px; }
@media (max-width: 720px) {
  .launch-grid { grid-template-columns: 1fr; max-width: 380px; }
}
