/* ==========================================================================
   Panel de administración de eventos · FIHNEC C.R. Capítulo San Pablo L.C.
   Mismos tokens, tono y recursos (aro animado, tema claro/oscuro) que el sitio.
   ========================================================================== */
:root {
  --navy-950: #050f20; --navy-900: #0a1b35; --navy-800: #102b52; --navy-700: #1a3d6f;
  --red: #ba1b1b; --red-600: #d62d2d; --gold: #f2b84b; --green: #1f9d57;
  --surface: #ffffff; --bg: #f5f7fb; --line: #e2e7f0; --field: #f5f7fb;
  --heading: var(--navy-900); --text: #38425a; --muted: #5a6479;
  --radius: 20px; --radius-sm: 14px;
  --shadow-sm: 0 2px 8px rgb(10 27 53 / .06);
  --shadow: 0 14px 40px -14px rgb(10 27 53 / .25);
  --shadow-lg: 0 34px 80px -24px rgb(10 27 53 / .45);
  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Roboto', system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --bar-h: 72px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --surface: #0e1a2e; --bg: #091322; --line: #213250; --field: #0a1424;
  --heading: #f1f5ff; --text: #b9c4da; --muted: #92a0ba; --green: #36c47a;
  --shadow-sm: 0 2px 8px rgb(0 0 0 / .35);
  --shadow: 0 14px 40px -14px rgb(0 0 0 / .6);
  --shadow-lg: 0 34px 80px -24px rgb(0 0 0 / .8);
}
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-head); font-weight: 800; color: var(--heading); text-wrap: balance; }
.wrap { inline-size: min(1180px, 100% - 2rem); margin-inline: auto; }
.sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- barra */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 1030;
  block-size: var(--bar-h);
  display: flex; align-items: center;
  color: #fff;
  background: rgb(5 15 32 / .72);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 8px 30px rgb(0 0 0 / .22);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; color: #fff; text-decoration: none; min-inline-size: 0; }
.brand img { block-size: 52px; inline-size: auto; flex: none; }
.brand b { display: block; font: 800 1rem var(--font-head); letter-spacing: .06em; line-height: 1.1; white-space: nowrap; }
.brand small { display: block; font-size: .74rem; letter-spacing: .04em; color: rgb(255 255 255 / .75); white-space: nowrap; }
.bar-tools { display: flex; align-items: center; gap: .5rem; }
.chip-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .9rem .3rem .3rem;
  border: 1px solid rgb(255 255 255 / .22); border-radius: 999px;
  background: rgb(255 255 255 / .08);
  font: 700 .8rem var(--font-head); line-height: 1.15;
}
.chip-user .av { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 50%; font-size: .78rem; background: linear-gradient(135deg, var(--red-600), var(--red)); }
.chip-user small { display: block; font: 500 .68rem var(--font-body); color: rgb(255 255 255 / .7); text-transform: capitalize; }
.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  block-size: 40px; min-inline-size: 40px; padding: 0 .9rem;
  font: 700 .78rem var(--font-head);
  color: #fff; text-decoration: none; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .25); border-radius: 999px;
  background: rgb(255 255 255 / .1);
  transition: background-color .25s, transform .25s var(--ease);
}
.tbtn:hover { color: #fff; background: rgb(255 255 255 / .22); transform: translateY(-2px); }
.tbtn svg { inline-size: 18px; block-size: 18px; flex: none; }
.tbtn.icon { padding: 0; inline-size: 40px; }
.tbtn.danger:hover { background: var(--red); border-color: var(--red); }
.sun { display: none; } [data-theme="dark"] .sun { display: block; } [data-theme="dark"] .moon { display: none; }
@media (max-width: 760px) { .tbtn .lbl, .chip-user div { display: none; } .tbtn { padding: 0; inline-size: 40px; } .chip-user { padding: .25rem; } .brand small { display: none; } }
@media (max-width: 420px) { .brand b { font-size: .86rem; } .chip-user { display: none; } }

/* ----------------------------------------------------------------- portada */
.hero {
  position: relative; isolation: isolate;
  padding: calc(var(--bar-h) + clamp(1.8rem, 5vw, 3.4rem)) 0 clamp(4.5rem, 9vw, 6rem);
  color: #fff; overflow: hidden;
  background: var(--navy-950) url('../img/hero.jpg') center 40% / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(80% 120% at 10% 0%, rgb(186 27 27 / .35), transparent 60%),
    linear-gradient(180deg, rgb(5 15 32 / .82), rgb(5 15 32 / .7) 55%, rgb(5 15 32 / .95));
}
.hero .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.4rem 2rem; }
.badge {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .95rem;
  font: 700 .68rem var(--font-head); letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid rgb(255 255 255 / .25); border-radius: 999px; background: rgb(255 255 255 / .12);
}
.badge::before { content: ""; inline-size: .5rem; block-size: .5rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgb(242 184 75 / .3); }
.hero h1 { margin: .9rem 0 .5rem; font-size: clamp(1.7rem, 1rem + 3vw, 3rem); line-height: 1.08; letter-spacing: -.02em; color: #fff; text-shadow: 0 4px 28px rgb(0 0 0 / .45); }
.hero h1 em { font-style: normal; background: linear-gradient(95deg, var(--gold), #ff8a5b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; max-inline-size: 48ch; color: rgb(255 255 255 / .86); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .9rem 1.5rem;
  font: 800 .9rem var(--font-head);
  color: #fff; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px;
  background: linear-gradient(135deg, var(--red-600), var(--red));
  box-shadow: 0 16px 32px -10px rgb(186 27 27 / .7);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
}
.btn:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 22px 40px -10px rgb(186 27 27 / .85); }
.btn svg { inline-size: 18px; block-size: 18px; }
.btn[disabled] { cursor: progress; filter: saturate(.6); transform: none; }
.btn.ghost { color: var(--heading); background: transparent; border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { color: var(--heading); border-color: var(--heading); box-shadow: none; }
.btn.sm { padding: .55rem 1rem; font-size: .78rem; }
.btn .spin { display: none; inline-size: 16px; block-size: 16px; border: 2.5px solid rgb(255 255 255 / .4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
.btn[disabled] .spin { display: block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- estadísticas */
.stats { display: grid; gap: .8rem; margin-block: -3.2rem 1.6rem; position: relative; z-index: 2; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.stat {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  animation: rise .7s var(--ease) both;
}
.stat:nth-child(2) { animation-delay: .06s; } .stat:nth-child(3) { animation-delay: .12s; } .stat:nth-child(4) { animation-delay: .18s; }
.stat .ic { flex: none; display: grid; place-items: center; inline-size: 46px; block-size: 46px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); }
.stat .ic svg { inline-size: 22px; block-size: 22px; }
.stat.red .ic { background: linear-gradient(135deg, var(--red-600), var(--red)); }
.stat.gold .ic { background: linear-gradient(135deg, #f2b84b, #e08a1e); }
.stat.grey .ic { background: linear-gradient(135deg, #8d97ab, #5d6880); }
.stat b { display: block; font: 800 clamp(1.4rem, 1.1rem + 1vw, 1.9rem) var(--font-head); line-height: 1; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); line-height: 1.2; display: block; margin-top: .2rem; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- barra de filtros */
.tools {
  display: grid; gap: .8rem;
  padding: .8rem;
  margin-block-end: 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) { .tools { grid-template-columns: auto 1fr auto; align-items: center; } }
.seg { display: flex; padding: .25rem; gap: .2rem; border-radius: 999px; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.seg button {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1rem;
  font: 700 .8rem var(--font-head); white-space: nowrap;
  color: var(--muted); border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  transition: color .25s, background-color .25s, box-shadow .25s;
}
.seg button span { padding: .05rem .5rem; font-size: .7rem; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); }
.seg button:hover { color: var(--heading); }
.seg button[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); box-shadow: 0 8px 18px -8px rgb(10 27 53 / .7); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--red-600), var(--red)); }
.seg button[aria-pressed="true"] span { background: rgb(255 255 255 / .2); }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; inset-inline-start: .95rem; inline-size: 18px; block-size: 18px; color: var(--muted); pointer-events: none; }
.search input {
  inline-size: 100%; padding: .75rem 1rem .75rem 2.7rem;
  font: 500 .95rem var(--font-body); color: var(--heading);
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--field); outline: 0;
  transition: border-color .25s, box-shadow .25s;
}
.search input:focus { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }
.search input::placeholder { color: var(--muted); opacity: .8; }

/* ---------------------------------------------------------------- tarjetas */
.month { display: flex; align-items: center; gap: .8rem; margin: 1.8rem 0 1rem; }
.month h3 { font-size: 1.15rem; }
.month i { flex: 1; block-size: 1px; background: var(--line); }
.month small { font: 700 .72rem var(--font-head); letter-spacing: .08em; color: var(--muted); }

.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: rise .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card.up::before, .card.today::before {          /* aro animado en los próximos */
  content: ""; position: absolute; inset: -1px; z-index: 3; pointer-events: none;
  padding: 2px; border-radius: inherit;
  background: conic-gradient(from var(--ang), var(--red), var(--gold), var(--red-600), var(--red));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin 4s linear infinite;
}
@keyframes spin { to { --ang: 360deg; } }
.card.past .poster, .card.past .body { filter: saturate(.35); opacity: .88; }

.poster { position: relative; display: block; inline-size: 100%; block-size: 210px; padding: 0; border: 0; background: color-mix(in srgb, var(--navy-900) 7%, var(--bg)); cursor: zoom-in; overflow: hidden; }
.poster img { inline-size: 100%; block-size: 100%; object-fit: contain; padding: .5rem; transition: transform .6s var(--ease); }
.card:hover .poster img { transform: scale(1.04); }
.poster.none { display: grid; place-items: center; cursor: default; color: var(--muted); font: 700 .74rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.poster.none svg { inline-size: 38px; block-size: 38px; margin-block-end: .3rem; opacity: .6; }
.poster.none div { text-align: center; }

.tag {
  position: absolute; inset: .7rem auto auto .7rem; z-index: 2;
  padding: .3rem .75rem;
  font: 800 .64rem var(--font-head); letter-spacing: .12em; text-transform: uppercase;
  border-radius: 999px;
}
.tag.up { color: #fff; background: linear-gradient(135deg, var(--red-600), var(--red)); box-shadow: 0 8px 18px -8px rgb(186 27 27 / .9); }
.tag.today { color: #3b2a00; background: linear-gradient(135deg, var(--gold), #ffd78a); }
.tag.past { color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.tag.past::before { content: "✓ "; }
.dateblk {
  position: absolute; inset: .7rem .7rem auto auto; z-index: 2;
  display: grid; place-items: center; inline-size: 54px; padding: .3rem 0 .35rem;
  border-radius: 14px; text-align: center; line-height: 1;
  color: var(--heading); background: var(--surface); box-shadow: var(--shadow);
}
.dateblk b { font: 800 1.35rem var(--font-head); }
.dateblk small { font: 700 .6rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-block-start: .15rem; }
[data-theme="dark"] .dateblk small { color: var(--gold); }

.body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.2rem 1.2rem; }
.body h4 { font-size: 1.08rem; line-height: 1.25; margin-block-end: .3rem; }
.desc { margin: 0 0 .8rem; font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: grid; gap: .45rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: .88rem; }
.meta li { display: flex; align-items: flex-start; gap: .6rem; }
.meta svg { flex: none; inline-size: 17px; block-size: 17px; margin-block-start: .2rem; color: var(--red); }
[data-theme="dark"] .meta svg { color: var(--gold); }
.meta span { overflow-wrap: anywhere; }
.actions { display: flex; gap: .5rem; margin-block-start: auto; }
.actions .btn { flex: 1; }
.iconbtn {
  display: grid; place-items: center; inline-size: 42px; block-size: 42px; flex: none; padding: 0;
  color: var(--heading); border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.iconbtn svg { inline-size: 18px; block-size: 18px; }
.iconbtn:hover { transform: translateY(-2px); border-color: var(--heading); }
.iconbtn.del:hover { color: #fff; background: var(--red); border-color: var(--red); }

/* esqueleto de carga */
.skel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.skel i { display: block; background: linear-gradient(90deg, var(--bg) 25%, color-mix(in srgb, var(--muted) 18%, var(--bg)) 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
.skel .a { block-size: 190px; border-radius: 0; } .skel .b { block-size: 18px; inline-size: 70%; margin: 1.1rem 1.2rem .6rem; } .skel .c { block-size: 12px; margin: .5rem 1.2rem; } .skel .d { block-size: 40px; margin: 1rem 1.2rem 1.2rem; border-radius: 999px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { display: grid; place-items: center; gap: .8rem; padding: 3rem 1rem; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.empty svg { inline-size: 52px; block-size: 52px; color: var(--muted); opacity: .6; }
.empty b { font: 800 1.1rem var(--font-head); color: var(--heading); }

.fab { position: fixed; inset: auto 1.1rem 1.1rem auto; z-index: 1040; display: none; inline-size: 58px; block-size: 58px; padding: 0; border-radius: 50%; }
.fab svg { inline-size: 26px; block-size: 26px; }
@media (max-width: 760px) { .fab { display: inline-flex; } .hero .btn.new { display: none; } }

/* ----------------------------------------------------------------- avisos */
.toasts { position: fixed; inset: calc(var(--bar-h) + .8rem) 1rem auto auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; display: grid; gap: .6rem; inline-size: min(380px, calc(100vw - 2rem)); }
.toasts:not(:popover-open) { display: none; }
.toast {
  display: flex; align-items: center; gap: .8rem;
  padding: .9rem 1rem;
  font-weight: 500; color: var(--heading);
  border: 1px solid var(--line); border-inline-start: 5px solid var(--green); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-lg);
  animation: toast-in .45s var(--ease) both;
}
.toast.err { border-inline-start-color: var(--red); }
.toast svg { flex: none; inline-size: 22px; block-size: 22px; color: var(--green); }
.toast.err svg { color: var(--red); }
.toast.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ------------------------------------------------------------------ modales */
dialog.modal {
  inline-size: min(780px, calc(100vw - 1.5rem));
  max-inline-size: none; max-block-size: calc(100dvh - 1.5rem);
  margin: auto; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible;
}
dialog.modal.sm { inline-size: min(440px, calc(100vw - 1.5rem)); }
dialog.modal.lg { inline-size: min(1000px, calc(100vw - 1.5rem)); }
dialog.modal::backdrop { background: rgb(5 15 32 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: pop .38s var(--ease) both; }
dialog.modal[open]::backdrop { animation: fade .3s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
body:has(dialog[open]) { overflow: hidden; }
.mcard { display: flex; flex-direction: column; max-block-size: calc(100dvh - 1.5rem); border-radius: calc(var(--radius) + 4px); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
form.mcard { margin: 0; }
.mhead { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.5rem; color: #fff; background: linear-gradient(120deg, var(--navy-800), var(--navy-950)); }
.mhead::after { content: ""; position: absolute; inset: auto 0 0 0; block-size: 3px; background: linear-gradient(90deg, var(--red), var(--gold)); }
.mhead h5 { font-size: 1.15rem; color: #fff; }
.mhead small { display: block; font-size: .8rem; color: rgb(255 255 255 / .75); font-family: var(--font-body); font-weight: 400; }
.mclose { display: grid; place-items: center; inline-size: 38px; block-size: 38px; padding: 0; color: #fff; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); cursor: pointer; transition: transform .3s var(--ease), background-color .25s; }
.mclose:hover { background: var(--red); transform: rotate(90deg); }
.mclose svg { inline-size: 16px; block-size: 16px; }
.mbody { padding: 1.4rem 1.5rem; overflow-y: auto; flex: 1; }
.mfoot { flex: none; display: flex; gap: .7rem; padding: 1rem 1.5rem 1.3rem; border-block-start: 1px solid var(--line); }
.mfoot .btn { flex: 1; }

.fgrid { display: grid; gap: 1rem; grid-template-columns: repeat(12, 1fr); }
.fgrid > * { grid-column: span 12; }
@media (min-width: 768px) { .c4 { grid-column: span 4; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; } .c3 { grid-column: span 3; } }
.fld { display: grid; gap: .35rem; align-content: start; }
.fld label { font: 700 .72rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fld label em { color: var(--red); font-style: normal; }
.in { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--field); transition: border-color .25s, box-shadow .25s, background-color .25s; }
.in:focus-within { border-color: var(--red); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }
.in > svg { flex: none; inline-size: 18px; block-size: 18px; margin-inline-start: .85rem; color: var(--muted); }
.in input, .in textarea, .in button.pick { flex: 1; min-inline-size: 0; padding: .8rem .85rem; font: 500 .96rem var(--font-body); color: var(--heading); background: transparent; border: 0; outline: 0; resize: vertical; }
.in input::placeholder, .in textarea::placeholder { color: var(--muted); opacity: .7; }
.in.bad { border-color: var(--red); }
.hint { font-size: .78rem; color: var(--muted); }
.hint a { color: var(--red); font-weight: 700; text-decoration: none; } .hint a:hover { text-decoration: underline; }
[data-theme="dark"] .hint a { color: #ff7b7b; }
.preview { display: none; margin-block-start: .4rem; padding: .5rem; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--bg); text-align: center; }
.preview.on { display: block; }
.preview img { max-inline-size: 100%; max-block-size: 170px; border-radius: 8px; }

#modalPreviewEvento .mbody { background: var(--bg); padding: 1rem; text-align: center; }
#modalPreviewEventoImg { inline-size: 100%; max-block-size: 78vh; object-fit: contain; border-radius: 10px; background: var(--surface); }
.confirm { text-align: center; padding: 2rem 1.5rem 1rem; }
.confirm .ic { display: grid; place-items: center; inline-size: 64px; block-size: 64px; margin: 0 auto 1rem; border-radius: 50%; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.confirm .ic svg { inline-size: 30px; block-size: 30px; }
.confirm h5 { font-size: 1.2rem; margin-block-end: .4rem; }
.confirm p { margin: 0; color: var(--muted); }
.confirm p b { color: var(--heading); }

/* ---------------------------------------------- flatpickr con los colores del sitio */
.flatpickr-calendar { font-family: var(--font-body); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--red); border-color: var(--red); color: #fff; }
.flatpickr-day.today { border-color: var(--gold); }
.flatpickr-day:hover { background: color-mix(in srgb, var(--red) 12%, var(--surface)); border-color: transparent; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; }
[data-theme="dark"] .flatpickr-calendar { background: var(--surface); color: var(--heading); }
[data-theme="dark"] .flatpickr-months .flatpickr-month, [data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-theme="dark"] span.flatpickr-weekday, [data-theme="dark"] .flatpickr-day, [data-theme="dark"] .numInputWrapper input,
[data-theme="dark"] .flatpickr-time input, [data-theme="dark"] .flatpickr-time .flatpickr-am-pm { color: var(--heading); background: transparent; }
[data-theme="dark"] .flatpickr-day.prevMonthDay, [data-theme="dark"] .flatpickr-day.nextMonthDay { color: var(--muted); }
[data-theme="dark"] .flatpickr-months .flatpickr-prev-month svg, [data-theme="dark"] .flatpickr-months .flatpickr-next-month svg { fill: var(--heading); }
[data-theme="dark"] .flatpickr-calendar.arrowTop::after, [data-theme="dark"] .flatpickr-calendar.arrowTop::before { border-bottom-color: var(--surface); }

html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .4s, color .4s, border-color .4s, box-shadow .4s !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* flatpickr en modo estático dentro de los campos */
.in .flatpickr-wrapper { flex: 1; min-inline-size: 0; display: block; position: relative; }
.in .flatpickr-wrapper input { inline-size: 100%; }
.flatpickr-calendar.static { inset-block-start: calc(100% + 6px); z-index: 20; }
.flatpickr-calendar.static.open { display: block; }
@media (max-width: 480px) {
  .seg button { padding: .5rem .7rem; font-size: .76rem; }
  .brand b { font-size: .76rem; letter-spacing: .04em; }
}

/* interruptor de calendario */
.calswitch { display: inline-flex; align-items: center; gap: .3rem; margin-block-start: 1rem; padding: .25rem; border: 1px solid rgb(255 255 255 / .25); border-radius: 999px; background: rgb(255 255 255 / .1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.calswitch-l { padding: 0 .5rem 0 .8rem; font: 700 .7rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .75); }
.calswitch button { padding: .5rem 1.1rem; font: 800 .8rem var(--font-head); color: #fff; border: 0; border-radius: 999px; background: transparent; cursor: pointer; transition: background-color .3s, box-shadow .3s; }
.calswitch button:hover { background: rgb(255 255 255 / .16); }
.calswitch button[aria-pressed="true"] { background: linear-gradient(135deg, var(--red-600), var(--red)); box-shadow: 0 8px 18px -8px rgb(0 0 0 / .6); }
.calmsg { margin-block-start: .5rem !important; font-size: .85rem; color: var(--gold) !important; font-weight: 700; }
@media (max-width: 480px) { .calswitch-l { display: none; } .calswitch { inline-size: 100%; } .calswitch button { flex: 1; } }

/* Damas → paleta rosada */
[data-cal="damas"] {
  --navy-950: #1f0a18; --navy-900: #3a1030; --navy-800: #5b1a4a; --navy-700: #7a2563;
  --red: #d6336c; --red-600: #ee4d86; --gold: #ffb3d1;
}
[data-cal="damas"]:not([data-theme="dark"]) { --bg: #fdf1f6; --line: #f4d9e6; --field: #fdf1f6; --heading: #3a1030; --text: #5a3a4e; --muted: #7a5a6c; }
[data-cal="damas"][data-theme="dark"] { --surface: #26111f; --bg: #170a14; --line: #4a2442; --field: #1d0c19; --text: #e0c3d4; --muted: #c4a0b6; }
[data-cal="damas"] .bar { background: rgb(31 10 24 / .72); }
[data-cal="damas"] .hero::before { background: radial-gradient(80% 120% at 10% 0%, rgb(214 51 108 / .4), transparent 60%), linear-gradient(180deg, rgb(31 10 24 / .84), rgb(31 10 24 / .7) 55%, rgb(31 10 24 / .95)); }
[data-cal="damas"] .hero h1 em { background: linear-gradient(95deg, #ffb3d1, #c77dff); -webkit-background-clip: text; background-clip: text; }
[data-cal="damas"] .tag.today { color: #4a0f2b; }
[data-cal="damas"] .stat.gold .ic { background: linear-gradient(135deg, #ffb3d1, #e0709c); }

.calswitch[hidden] { display: none; }

/* ---------------------------------------------------------------- crud2: pestañas y lives */
.tabs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.tabs-note { font: 700 .76rem var(--font-head); letter-spacing: .06em; color: var(--muted); }
[hidden] { display: none !important; }

.lform { margin-block-end: 1.6rem; padding: clamp(1.1rem, 3vw, 1.6rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.lform h3 { margin-block-end: 1rem; font-size: 1.1rem; }
.lform-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; margin-block-start: 1.2rem; }
.lform-foot .hint { flex: 1 1 260px; }
.lform-foot .btn { flex: none; }
.in input[type="date"], .in input[type="time"] { color-scheme: light; }
[data-theme="dark"] .in input[type="date"], [data-theme="dark"] .in input[type="time"] { color-scheme: dark; }
.in input:disabled { opacity: .45; cursor: not-allowed; }

.switch { display: flex; align-items: center; gap: .7rem; min-block-size: 50px; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font: 500 .92rem var(--font-body) !important; color: var(--heading) !important; }
.switch input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.sw-track { position: relative; flex: none; inline-size: 46px; block-size: 26px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 35%, var(--bg)); transition: background-color .3s; }
.sw-track i { position: absolute; inset: 3px auto 3px 3px; inline-size: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .3); transition: transform .3s var(--ease); }
.switch input:checked + .sw-track { background: linear-gradient(135deg, var(--red-600), var(--red)); }
.switch input:checked + .sw-track i { transform: translateX(20px); }
.switch input:focus-visible + .sw-track { outline: 3px solid var(--gold); outline-offset: 3px; }

.live .body { padding-block-start: 1.2rem; }
.live-top { display: flex; align-items: center; justify-content: space-between; margin-block-end: .8rem; }
.live-ic { display: grid; place-items: center; inline-size: 44px; block-size: 44px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--red-600), var(--red)); box-shadow: 0 10px 20px -8px rgb(0 0 0 / .5); }
.live-ic svg { inline-size: 22px; block-size: 22px; }
.live.past .live-ic { background: linear-gradient(135deg, #8d97ab, #5d6880); }
.pill { padding: .28rem .75rem; font: 800 .64rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; border-radius: 999px; }
.pill.rec { color: #fff; background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); }
.pill.soon { color: #fff; background: linear-gradient(135deg, var(--red-600), var(--red)); }
.pill.old { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.live .actions .btn svg { inline-size: 15px; block-size: 15px; }

/* ------------------------------------------------------------ módulo de álbum */
.drop { display: grid; justify-items: center; gap: .4rem; padding: clamp(1.6rem, 5vw, 2.6rem) 1rem; margin-block-end: 1.4rem; text-align: center; border: 2px dashed color-mix(in srgb, var(--red) 55%, var(--line)); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: background-color .3s, transform .3s var(--ease), border-color .3s; }
.drop:hover, .drop.over, .drop:focus-visible { background: color-mix(in srgb, var(--red) 8%, var(--surface)); border-color: var(--red); }
.drop.over { transform: scale(1.01); }
.drop svg { inline-size: 48px; block-size: 48px; color: var(--red); }
.drop b { font: 800 1.05rem var(--font-head); color: var(--heading); }
.drop span { font-size: .85rem; color: var(--muted); }
.cola { margin-block-end: 1.6rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.cola-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-block-end: 1rem; }
.cola-head h3 { font-size: 1.05rem; }
.cola-tit { flex: 1 1 280px; max-inline-size: 420px; }
.cola-tit input { inline-size: 100%; padding: .7rem 1rem; font: 500 .92rem var(--font-body); color: var(--heading); border: 1.5px solid var(--line); border-radius: 999px; background: var(--field); outline: 0; }
.cola-tit input:focus { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }
.cola-grid, .pgrid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.pgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.cola-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; margin-block-start: 1.1rem; }
.ph { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.ph img { display: block; inline-size: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg); }
.ph figcaption { display: grid; padding: .55rem .7rem .7rem; line-height: 1.25; }
.ph figcaption b { font: 700 .82rem var(--font-head); color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph figcaption small { font-size: .72rem; color: var(--muted); }
.ph .iconbtn { position: absolute; inset: .5rem .5rem auto auto; background: rgb(5 15 32 / .6); color: #fff; border-color: transparent; inline-size: 36px; block-size: 36px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ph .iconbtn:hover { background: var(--red); }
.st.busy { color: var(--gold); font-weight: 700; } .st.good { color: var(--green); font-weight: 700; } .st.bad { color: var(--red); font-weight: 700; }

/* ---------------------------------------------------------------- módulo editorial */
.egrid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.ed .body { padding-block-start: 1.2rem; }
.ed-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-block-end: .7rem; }
.ed-top time { font: 700 .74rem var(--font-head); color: var(--muted); }
.ed h4 { font-size: 1.12rem; }
.ed .desc { -webkit-line-clamp: 4; line-clamp: 4; white-space: pre-line; }
.ed.off { opacity: .75; filter: saturate(.4); }
.pill.pub { color: #fff; background: linear-gradient(135deg, #1f9d57, #167a43); }
.pill.prog { color: #3b2a00; background: linear-gradient(135deg, var(--gold), #ffd78a); }
.pill.off { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.in textarea { line-height: 1.6; min-block-size: 180px; }

/* ======================================================================
   Menú superior en móvil (topnav): hamburguesa + panel desplegable
   ====================================================================== */
.bar-burger, .bar-scrim { display: none; }
@media (max-width: 760px) {
  .bar-burger {
    display: grid; align-content: center; justify-items: center; gap: 5px;
    inline-size: 44px; block-size: 44px; padding: 0; flex: none;
    color: #fff; border: 1px solid rgb(255 255 255 / .28); border-radius: 14px;
    background: rgb(255 255 255 / .1); cursor: pointer;
  }
  .bar-burger span { display: block; inline-size: 20px; block-size: 2px; border-radius: 2px; background: #fff; transition: transform .35s var(--ease), opacity .25s; }
  .bar.open .bar-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .bar.open .bar-burger span:nth-child(2) { opacity: 0; }
  .bar.open .bar-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .bar .wrap { flex-wrap: nowrap; }
  .bar .brand { flex: 1; min-inline-size: 0; }
  .bar .brand small { display: block; overflow: hidden; text-overflow: ellipsis; }
  .bar .brand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .bar .bar-tools {
    position: fixed; inset: var(--bar-h) 0 auto 0; z-index: 1029;
    display: grid; gap: .5rem; align-items: stretch;
    max-block-size: calc(100dvh - var(--bar-h));
    overflow-y: auto;
    padding: .9rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
    background: rgb(5 15 32 / .96);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-block-end: 3px solid var(--red);
    box-shadow: 0 30px 50px -20px rgb(0 0 0 / .7);
    visibility: hidden; opacity: 0; transform: translateY(-12px);
    transition: opacity .3s ease, transform .4s var(--ease), visibility 0s linear .4s;
  }
  [data-cal="damas"] .bar .bar-tools { background: rgb(31 10 24 / .96); }
  .bar.open .bar-tools { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }

  .bar .bar-tools .chip-user { display: flex; justify-content: flex-start; padding: .55rem .8rem .55rem .55rem; border-radius: 16px; }
  .bar .bar-tools .chip-user div { display: block; }
  .bar .bar-tools .tbtn {
    inline-size: 100%; block-size: 50px; justify-content: flex-start; gap: .9rem; padding: 0 1rem;
    font-size: .9rem; border-radius: 14px;
  }
  .bar .bar-tools .tbtn .lbl { display: inline; }
  .bar .bar-tools .tbtn.icon::after { content: attr(title); }
  .bar .bar-tools .tbtn svg { inline-size: 20px; block-size: 20px; }
  .bar .bar-tools .tbtn.danger { margin-block-start: .3rem; background: rgb(214 45 45 / .18); border-color: rgb(214 45 45 / .5); }
  .bar .bar-tools .tbtn:hover { transform: none; }

  .bar-scrim { display: block; position: fixed; inset: var(--bar-h) 0 0 0; z-index: 1028; background: rgb(5 15 32 / .55); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s linear .3s; }
  body.nav-open .bar-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
  body.nav-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .bar-burger span, .bar .bar-tools { transition: none; } }

/* ------------------------------------------------ menú lateral (escritorio) ------------------------------------------------
   adminnav.js agrega .side-on al <body> de los paneles; en móvil se mantiene la barra superior con hamburguesa. */
@media (min-width: 761px) {
  body.side-on { --bar-h: 0px; padding-inline-start: 264px; }
  body.side-on .bar {
    inset: 0 auto 0 0; inline-size: 264px; block-size: 100dvh;
    align-items: stretch; padding: 1.5rem 1rem 1.2rem; overflow: hidden auto;
    background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
    -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: 8px 0 30px rgb(0 0 0 / .22);
  }
  body.side-on .bar .wrap { inline-size: 100%; block-size: 100%; margin: 0; flex: 1; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1.8rem; }
  body.side-on .brand { padding-inline: .4rem; gap: .8rem; }
  body.side-on .brand img { block-size: 46px; inline-size: 46px; padding: 5px; object-fit: contain; border-radius: 14px; background: rgb(255 255 255 / .12); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
  body.side-on .brand b { order: 2; font: 800 1.45rem var(--font-head); letter-spacing: 0; color: var(--gold); }
  body.side-on .brand small { order: 1; font: 700 .68rem var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: rgb(255 255 255 / .6); }
  body.side-on .brand > span { display: flex; flex-direction: column; }
  body.side-on .bar-tools { flex: 1 1 auto; min-block-size: 0; flex-direction: column; align-items: stretch; gap: .3rem; }
  body.side-on .tbtn {
    justify-content: flex-start; gap: .9rem; block-size: 50px; padding: 0 1rem;
    font: 700 .95rem var(--font-head); color: rgb(255 255 255 / .82);
    border: 0; border-radius: 14px; background: transparent;
    transition: background-color .25s, color .25s, box-shadow .25s;
  }
  body.side-on .tbtn:hover { color: #fff; background: rgb(255 255 255 / .09); transform: none; }
  body.side-on .tbtn svg { inline-size: 22px; block-size: 22px; }
  body.side-on .tbtn.icon { inline-size: auto; padding: 0 1rem; }
  body.side-on .tbtn.active { color: var(--navy-950); background: var(--gold); box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--gold) 55%, transparent); }
  body.side-on .tbtn .lbl { display: inline; }
  body.side-on .brand b { overflow: hidden; text-overflow: ellipsis; }
  /* orden: navegación arriba; tema, usuario y salir abajo */
  body.side-on #lnkEventos, body.side-on .bar-tools > a[href="crud.html"] { order: 1; }
  body.side-on #lnkAlbum { order: 2; } body.side-on #lnkEditorial { order: 3; } body.side-on #lnkJunta { order: 4; } body.side-on #lnkSitio { order: 5; }
  body.side-on #themeToggle { order: 18; margin-block-start: auto; }
  body.side-on .chip-user { order: 19; display: block; margin-block-start: .6rem; padding: 1rem .4rem .5rem; border: 0; border-block-start: 1px solid rgb(255 255 255 / .14); border-radius: 0; background: none; font: 800 1.02rem var(--font-head); }
  body.side-on .chip-user .av { display: none; }
  body.side-on .chip-user div { display: block; }
  body.side-on .chip-user small { display: block; inline-size: fit-content; margin-block-start: .5rem; padding: .3rem .8rem; border-radius: 999px; background: rgb(255 255 255 / .1); font: 700 .72rem var(--font-head); letter-spacing: .04em; text-transform: uppercase; color: rgb(255 255 255 / .85); }
  body.side-on #logoutBtn { order: 20; justify-content: flex-start; block-size: 48px; border: 2px solid rgb(255 255 255 / .28); border-radius: 999px; }
  body.side-on #logoutBtn:hover { border-color: var(--red); background: var(--red); }
}

/* ======================================================== estilo One UI (todos los paneles) ========================================================
   Superficies muy redondeadas, sombras suaves, acciones tonales en vez de botones rojos anchos. */
:root { --radius: 28px; --radius-sm: 20px; --shadow-sm: 0 1px 2px rgb(10 27 53 / .05); --shadow: 0 16px 34px -16px rgb(10 27 53 / .28); }
[data-theme="dark"] { --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); }
.hero { border-radius: 0 0 36px 36px; }
.badge { backdrop-filter: blur(8px); }
.card { border-color: color-mix(in srgb, var(--line) 70%, transparent); }
.card:hover { transform: translateY(-3px); }
.stat { padding: 1.05rem 1.2rem; box-shadow: var(--shadow-sm); }
.stat .ic { border-radius: 50%; inline-size: 50px; block-size: 50px; }
.tools { padding: .7rem .8rem; box-shadow: var(--shadow-sm); }
.search input { background: color-mix(in srgb, var(--navy-900) 6%, var(--surface)); border-color: transparent; }
.seg { background: color-mix(in srgb, var(--navy-900) 7%, var(--surface)); }
.seg button[aria-pressed="true"] { box-shadow: 0 4px 12px -6px rgb(10 27 53 / .6); }
.actions .btn { color: var(--red); background: color-mix(in srgb, var(--red) 11%, var(--surface)); box-shadow: none; }
.actions .btn:hover { color: #fff; background: var(--red); transform: none; box-shadow: none; }
.iconbtn { border-color: transparent; background: color-mix(in srgb, var(--navy-900) 8%, var(--surface)); }
.iconbtn:hover { transform: scale(1.08); border-color: transparent; background: color-mix(in srgb, var(--navy-900) 15%, var(--surface)); }
.iconbtn.del:hover { background: var(--red); }
.ph .iconbtn { background: rgb(5 15 32 / .6); }
.ph .iconbtn:hover { background: var(--red); transform: none; }
.pill { box-shadow: none; }
.empty { border-radius: var(--radius); }
.poster { border-radius: 0; }
[data-theme="dark"] .actions .btn { color: #ff9a9a; background: rgb(255 255 255 / .09); }
[data-theme="dark"] .actions .btn:hover { color: #fff; background: var(--red); }
[data-theme="dark"] .iconbtn { color: #fff; background: rgb(255 255 255 / .1); }
[data-theme="dark"] .iconbtn:hover { background: rgb(255 255 255 / .2); }
[data-theme="dark"] .iconbtn.del:hover { background: var(--red); }
