/* =========================================================
   PANEL DE ADMINISTRACIÓN
   ========================================================= */
body.admin { min-height: 100vh; }
.admin .aurora { opacity: .35; }

.adm-top {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 18px 20px;
}
.adm-brand { color: var(--cream); text-decoration: none; font-size: 1.15rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.adm-brand b { font-family: var(--font-title); font-size: 1.7rem; }
.adm-brand span { color: var(--gold); }
.adm-brand small { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; opacity: .6; }
.adm-user { display: flex; align-items: center; gap: 10px; font-size: .85rem; opacity: .9; }
.adm-user .chip { padding: 4px 10px; border-radius: 99px; background: rgba(246, 201, 107, .18); color: var(--gold-2); font-weight: 800; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

.adm-banner {
  position: relative; z-index: 10;
  max-width: 1140px; margin: 0 auto 10px; padding: 12px 16px; border-radius: 14px;
  background: rgba(246, 201, 107, .12); border: 1px solid rgba(246, 201, 107, .35);
  font-size: .9rem; line-height: 1.5;
}
.adm-banner code { background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 6px; }

.adm-main { position: relative; z-index: 5; max-width: 1180px; margin: 0 auto; padding: 10px 20px 80px; }

.panel {
  background: rgba(14, 22, 54, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px; padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.panel + .panel { margin-top: 20px; }
.panel h2 { font-family: var(--font-title); font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.1; }
.panel h3 { font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 12px; }
.panel p.lead { opacity: .8; margin: 6px 0 18px; line-height: 1.5; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.center-card { max-width: 440px; margin: 8vh auto 0; text-align: center; }
.center-card .big { font-size: 3.4rem; display: block; margin-bottom: 6px; }
.login-links { display: grid; gap: 8px; justify-items: center; margin-top: 16px; font-size: .9rem; opacity: .9; }
.login-links .link-btn { font-size: .9rem; }

/* Formularios */
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: .9rem; }
.field > span { font-weight: 700; opacity: .9; }
.field small.hint { opacity: .6; font-size: .8rem; }
.field input, .field textarea, .inline-form input {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  color: var(--cream); font: inherit; font-size: 1rem;
  transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .inline-form input:focus { outline: none; border-color: var(--gold); background: rgba(255, 255, 255, .1); }
.row { display: flex; gap: 12px; }
.grow { flex: 1; }
.emoji-field { width: 84px; flex: none; }
.emoji-field input { text-align: center; font-size: 1.5rem; padding: 6px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 4px 0 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.form-error { color: #ff9aa3; font-size: .9rem; margin: 4px 0 10px; }

.btn-gold { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-gold:disabled { opacity: .5; pointer-events: none; }
.btn-ghost-light {
  border-radius: 99px; font-weight: 800; padding: 12px 18px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  text-decoration: none; color: var(--cream); display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, transform .25s var(--ease-spring);
}
.btn-ghost-light:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }
.btn-small.danger { background: rgba(196, 47, 60, .2); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); font-size: 1rem; }
.icon-btn:hover { background: rgba(255,255,255,.18); }
.link-btn { background: none; border: 0; color: var(--gold-2); text-decoration: underline; font-size: .85rem; justify-self: start; padding: 0; }

/* Lista de calendarios */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cal-card {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: 18px;
  background: linear-gradient(150deg, rgba(196, 47, 60, .35), rgba(26, 36, 87, .6));
  border: 1px solid rgba(255,255,255,.14);
  display: grid; gap: 10px;
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.cal-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,.35); }
.cal-card h4 { font-family: var(--font-title); font-size: 1.7rem; line-height: 1.05; }
.cal-card .who { color: var(--gold-2); font-size: .95rem; }
.cal-card .meta { font-size: .8rem; opacity: .7; }
.cal-card .bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.cal-card .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-3), var(--gold)); border-radius: inherit; }
.cal-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cal-card .actions > * { padding: 8px 14px; font-size: .85rem; }
.cal-card .tag { justify-self: start; font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(0,0,0,.3); }
.empty-state { text-align: center; padding: 40px 10px; opacity: .85; }
.empty-state .big { font-size: 3rem; display: block; margin-bottom: 8px; }

.creators { display: grid; gap: 8px; margin-top: 14px; }
.creator { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: .95rem; }
.creator .seen { display: block; opacity: .6; font-size: .78rem; margin-top: 2px; }
.user-actions { display: flex; gap: 6px; align-items: center; }
.mini-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: .68rem; font-weight: 800; background: rgba(255,255,255,.12); vertical-align: middle; }
.mini-tag.gold { background: rgba(246, 201, 107, .2); color: var(--gold-2); }
#credBox:empty { display: none; }
.cred {
  margin: 14px 0; padding: 16px; border-radius: 16px; display: grid; gap: 8px;
  background: rgba(246, 201, 107, .1); border: 1px solid rgba(246, 201, 107, .45);
  animation: popIn .4s var(--ease-spring);
}
.cred-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cred-row code { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.35); color: var(--gold-2); user-select: all; }
.cred small { opacity: .75; }
.cred-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Editor de calendario */
.editor { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.adm-back { display: inline-flex; gap: 6px; color: var(--gold-2); text-decoration: none; font-weight: 700; margin-bottom: 14px; }
.share-box { display: grid; gap: 10px; }
.share-url {
  font-family: ui-monospace, Consolas, monospace; font-size: .8rem; word-break: break-all;
  padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px dashed rgba(255,255,255,.2);
}
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-actions > * { flex: 1; padding: 10px 12px; font-size: .9rem; }

.days-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.day-tile {
  position: relative; aspect-ratio: 1; border-radius: 14px; padding: 8px;
  display: grid; place-items: center; text-align: center; align-content: center; gap: 2px;
  background: rgba(255,255,255,.04); border: 2px dashed rgba(255,255,255,.18);
  transition: transform .25s var(--ease-spring), background .2s, border-color .2s;
}
.day-tile:hover { transform: translateY(-3px) scale(1.03); background: rgba(255,255,255,.09); border-color: var(--gold); }
.day-tile .n { position: absolute; top: 6px; left: 9px; font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; color: var(--gold-2); }
.day-tile .e { font-size: 1.9rem; line-height: 1; }
.day-tile .k { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; font-weight: 800; }
.day-tile .t { font-size: .72rem; opacity: .85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-tile .plus { font-size: 1.6rem; opacity: .35; }
.day-tile.filled { border-style: solid; border-color: rgba(246, 201, 107, .45); background: linear-gradient(160deg, rgba(196,47,60,.3), rgba(26,36,87,.5)); }
.day-tile.flash { animation: tileFlash .9s var(--ease-out); }
@keyframes tileFlash { 0% { box-shadow: 0 0 0 0 rgba(246,201,107,.9); } 100% { box-shadow: 0 0 0 16px rgba(246,201,107,0); } }
.days-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.days-head .count { font-size: .9rem; opacity: .8; }

/* Modal del editor de día */
.adm-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 14px; }
.adm-modal[hidden] { display: none; }
.adm-modal-bg { position: absolute; inset: 0; background: rgba(3, 5, 16, .75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.adm-modal-card {
  position: relative; width: min(600px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto;
  padding: 22px clamp(18px, 4vw, 28px);
  border-radius: 22px;
  background: linear-gradient(170deg, #17204a, #0e1534);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  animation: popIn .4s var(--ease-spring);
}
.adm-modal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.adm-modal-card h2 { font-family: var(--font-title); font-size: 2.2rem; color: var(--gold-2); }
.adm-modal-card footer { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

.kinds { border: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.kinds legend { font-size: .9rem; font-weight: 700; margin-bottom: 8px; opacity: .9; }
.kind-opt { position: relative; }
.kind-opt input { position: absolute; opacity: 0; }
.kind-opt span {
  display: grid; place-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  font-size: .72rem; font-weight: 800; cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s var(--ease-spring);
}
.kind-opt span i { font-style: normal; font-size: 1.4rem; }
.kind-opt input:checked + span { background: rgba(246, 201, 107, .2); border-color: var(--gold); transform: translateY(-2px); }
.kind-opt input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

.emoji-picks { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 14px; }
.emoji-picks button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: rgba(255,255,255,.06); font-size: 1.1rem; }
.emoji-picks button:hover { background: rgba(255,255,255,.16); transform: scale(1.12); }

.drop {
  position: relative; border-radius: 14px; min-height: 120px;
  border: 2px dashed rgba(255,255,255,.22); background: rgba(255,255,255,.04);
  display: grid; place-items: center; text-align: center; overflow: hidden;
  transition: border-color .2s, background .2s;
}
.drop.over { border-color: var(--gold); background: rgba(246,201,107,.1); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-empty { display: grid; gap: 4px; padding: 20px; pointer-events: none; }
.drop-empty small { opacity: .7; }
.drop-preview { width: 100%; pointer-events: none; }
.drop-empty[hidden], .drop-preview[hidden], .link-btn[hidden], .btn-small[hidden] { display: none; }
.drop-preview img, .drop-preview video { display: block; width: 100%; max-height: 260px; object-fit: contain; background: rgba(0,0,0,.3); }

.adm-modal.ask { z-index: 95; }
.ask-card { width: min(440px, 100%); }
.ask-card h2 { font-size: 1.9rem; margin-bottom: 8px; }
.ask-card .lead { opacity: .85; line-height: 1.5; margin-bottom: 14px; }
.danger-btn { background: linear-gradient(180deg, #ff7a85, #c42f3c); color: #fff; box-shadow: 0 8px 20px rgba(196, 47, 60, .45); }

.loading-view { text-align: center; padding: 60px 0; opacity: .8; }
.loading-view .spinner { margin: 0 auto 12px; border-color: rgba(255,255,255,.15); border-top-color: var(--gold); }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .days-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 520px) {
  .days-grid { grid-template-columns: repeat(3, 1fr); }
  .kinds { grid-template-columns: repeat(3, 1fr); }
  .adm-user .email { display: none; }
  .row { flex-wrap: wrap; }
}
