/* =========================================================
   SLIDERS · MKT — Calendario de contenidos
   ========================================================= */
:root {
  --orange: #ff7900;
  --orange-d: #e56a00;
  --orange-soft: #fff1e3;
  --orange-soft2: #fde9d4;
  --ink: #141414;
  --ink-2: #3a3a3a;
  --muted: #7a7a7a;
  --line: #1d1d1d;
  --line-soft: #e6e6e6;
  --bg: #ffffff;
  --bg-2: #f4f4f4;
  --red: #e63329;
  --star: #f5a623;
  --blue: #2e9be6;
  --green: #1e9e5a;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  --topbar: 64px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--orange-d); }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--red); }

/* ---------- Botones ---------- */
.btn { border: 1.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 13px; transition: transform .08s, background .15s, color .15s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn-ghost { border-color: var(--line-soft); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }
.link:hover { color: var(--ink); }
.badge { background: var(--ink); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; min-width: 18px; text-align: center; }
.badge:empty, .badge[data-n="0"] { background: var(--line-soft); color: var(--muted); }
.select-sm { border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; background: #fff; max-width: 190px; }

/* ---------- Login ---------- */
.is-login { background: var(--orange); min-height: 100vh; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: #fff; width: min(400px, 100%); border-radius: 22px; padding: 36px 32px 28px; box-shadow: 0 30px 60px rgba(0,0,0,.25); text-align: center; }
.login-logo { width: 220px; max-width: 80%; filter: drop-shadow(0 3px 0 rgba(0,0,0,.08)); }
.login h1 { font-size: 26px; font-weight: 900; letter-spacing: -.01em; margin: 6px 0 24px; text-transform: uppercase; }
.login label { display: block; text-align: left; font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.login input { width: 100%; border: 2px solid var(--ink); border-radius: 12px; padding: 13px 14px; font-size: 18px; letter-spacing: .1em; margin-bottom: 14px; outline: none; }
.login input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft2); }
.login-error { color: var(--red); font-weight: 600; min-height: 1.4em; margin: 12px 0 0; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; }
.tb-left, .tb-center, .tb-right { display: flex; align-items: center; gap: 10px; }
.tb-logo { height: 34px; }
.tb-title { display: flex; flex-direction: column; line-height: 1.1; border-left: 1.5px solid var(--line-soft); padding-left: 12px; }
.tb-title .eyebrow { font-size: 9px; }
.tb-title strong { font-size: 13px; font-weight: 800; }
.seg { display: inline-flex; border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; padding-left: 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--orange); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.sync { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-soft); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: #bbb; }
.sync.ok .dot { background: var(--green); }
.sync.err .dot { background: var(--red); }
.sync.busy .dot { background: var(--star); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Meses ---------- */
#months { padding: 10px 28px 80px; }
.prev-wrap { text-align: center; padding: 6px 0 0; }
.prev-wrap .btn { padding: 4px 12px; font-size: 11px; border-color: transparent; color: var(--muted); }
.month { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 36px; padding: 28px 0 44px; border-bottom: 2px dashed var(--line-soft); scroll-margin-top: calc(var(--topbar) + 4px); }
.month:last-child { border-bottom: 0; }
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.cal-head h2 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 900; margin: 4px 0 0; letter-spacing: -.01em; line-height: 1; text-transform: uppercase; }
.cal-head .sub { text-align: right; color: var(--ink-2); font-size: 12px; }
.cal-head .sub b { display: block; font-weight: 500; }

.banners { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.banner { background: var(--orange-soft); border-radius: 4px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; border: 1px solid transparent; }
.banner:hover { border-color: var(--orange); }
.banner b { font-weight: 800; }
.banner .t { color: var(--ink-2); }
.banner-add { align-self: flex-start; background: none; border: 1px dashed #d9c3ad; color: #a07a55; border-radius: 4px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.banner-add:hover { border-color: var(--orange); color: var(--orange-d); }

.dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 6px; }
.dow div { text-align: center; font-size: 11px; letter-spacing: .22em; font-weight: 600; padding: 8px 0; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1.5px solid var(--line); border-left: 1.5px solid var(--line); }
.cell { position: relative; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); min-height: 128px; padding: 8px 7px 26px; background: #fff; transition: background .12s; min-width: 0; }
.cell.out { background: var(--bg-2); }
.cell.out .num { color: #b9b9b9; }
.cell.today .num { background: var(--orange); color: #fff; border-radius: 6px; padding: 0 6px; margin-left: -3px; }
.cell.drop { background: var(--orange-soft); box-shadow: inset 0 0 0 2px var(--orange); }
.num { font-size: 20px; font-weight: 500; line-height: 1; display: inline-block; margin-bottom: 8px; }
.num small { font-size: 13px; letter-spacing: .04em; }
.add { position: absolute; right: 6px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink); background: #fff; font-weight: 800; font-size: 14px; line-height: 1; display: grid; place-items: center; opacity: 0; transition: opacity .12s, background .12s; padding: 0; }
.cell:hover .add, .add:focus { opacity: 1; }
.add:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

.item { display: flex; align-items: flex-start; gap: 5px; font-size: 11.5px; line-height: 1.25; padding: 3px 4px; border-radius: 5px; cursor: grab; user-select: none; position: relative; margin-bottom: 2px; border: 1px solid transparent; }
.item:hover { background: #f6f6f6; border-color: var(--line-soft); }
.item.dragging { opacity: .35; }
.item.accion .ttl { font-weight: 700; }
.item.publicado .ttl { color: var(--green); }
.item .ttl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item .fmt { font-weight: 800; font-size: 8.5px; letter-spacing: .02em; vertical-align: 1px; margin-left: 2px; }
.item .who { flex: none; font-size: 8.5px; font-weight: 800; background: var(--ink); color: #fff; border-radius: 4px; padding: 1px 4px; margin-top: 1px; }
.item .chk { color: var(--green); font-weight: 900; }
.item.hidden-by-filter { display: none; }

/* íconos de categoría (como el PDF) */
.ic { flex: none; width: 10px; height: 10px; margin-top: 2px; display: inline-block; }
.ic.triangle { width: 0; height: 0; border-left: 5.5px solid transparent; border-right: 5.5px solid transparent; border-bottom: 10px solid var(--red); background: none; }
.ic.circle { border-radius: 50%; background: var(--blue); }
.ic.star { background: var(--star); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); width: 12px; height: 12px; margin-top: 1px; }
.ic.square { background: #9a9a9a; border-radius: 2px; width: 9px; height: 9px; }
.ic.diamond { background: var(--orange); width: 8px; height: 8px; transform: rotate(45deg); margin: 3px 1px 0; }
.ic.none { display: none; }
.ic.lg { transform: scale(1.35); margin: 3px 4px 0 2px; }

/* ---------- Pizarra ---------- */
.board { position: relative; }
.board-inner { position: sticky; top: calc(var(--topbar) + 18px); max-height: calc(100vh - var(--topbar) - 36px); overflow: auto; padding: 4px 6px 16px 2px; scrollbar-width: thin; }
.board-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.board-title span { font-size: 11px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.sec { margin-bottom: 22px; position: relative; }
.sec h3 { font-size: 15px; font-weight: 800; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.sec h3 .ic { margin-top: 0; }
.sec.box { background: var(--bg-2); padding: 14px 16px 10px; }
.sec.sep { border-top: 1.5px solid var(--ink); padding-top: 16px; }
.sec-tools { position: absolute; right: 0; top: -2px; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.sec:hover .sec-tools { opacity: 1; }
.sec-tools button { border: 0; background: #fff; border-radius: 6px; width: 24px; height: 24px; font-size: 12px; color: var(--muted); box-shadow: 0 0 0 1px var(--line-soft); padding: 0; }
.sec-tools button:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.note { font-size: 13px; color: var(--ink-2); margin: 0 0 9px; cursor: pointer; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.note:hover { background: #f6f6f6; }
.sec.box .note:hover { background: #ebebeb; }
.note b { color: var(--ink); font-weight: 600; }
.note i { color: var(--ink-2); }
.note .txt { white-space: pre-wrap; }
.sec.box .note { display: flex; gap: 8px; align-items: flex-start; }
.sec.box .note input { margin-top: 3px; accent-color: var(--orange); }
.note.done .body { text-decoration: line-through; color: var(--muted); }
.add-note { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 600; padding: 2px 0; }
.add-note:hover { color: var(--orange-d); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--ink-2); border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 8px; }
.legend b { font-size: 9px; font-weight: 800; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.board-logo { width: 190px; margin-top: 18px; opacity: .95; }
.board-empty { border: 2px dashed var(--line-soft); border-radius: 14px; padding: 22px; text-align: center; }
.board-empty p { margin: 0 0 14px; color: var(--muted); }
.board-empty .btn { margin: 4px; }
.sentinel { text-align: center; color: var(--muted); padding: 30px; font-size: 12px; }

/* ---------- Drawers ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; z-index: 80; box-shadow: var(--shadow); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; border-left: 1.5px solid var(--ink); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.drawer-head h2 { margin: 0; font-size: 20px; font-weight: 900; text-transform: uppercase; }
.drawer-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 0 20px 12px; border-bottom: 1px solid var(--line-soft); }
.drawer-tools input[type=search] { flex: 1; border: 1.5px solid var(--line-soft); border-radius: 999px; padding: 7px 12px; font-size: 13px; }
.drawer-tools p { margin: 0; font-size: 12px; }
.drawer-body { overflow: auto; flex: 1; padding: 8px 20px 30px; }
.x { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 4px; color: var(--muted); }
.x:hover { color: var(--ink); }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.act { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.act .avatar { width: 26px; height: 26px; font-size: 11px; }
.act .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.act .tag { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--bg-2); color: var(--ink-2); margin-right: 4px; }
.act .tag.mover { background: #e8f3fc; color: #1b6fae; }
.act .tag.crear { background: #e7f6ee; color: #177a45; }
.act .tag.publicar { background: var(--green); color: #fff; }
.act .tag.eliminar, .act .tag.papelera { background: #fdeaea; color: #b4251e; }
.act .tag.editar { background: var(--orange-soft); color: #a85200; }
.act .tag.duplicar { background: #f1ecfb; color: #5a3ea8; }
.act a.it { color: var(--ink); font-weight: 700; text-decoration: none; }
.act a.it:hover { text-decoration: underline; }
.trash-it { border: 1.5px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.trash-it .t { font-weight: 700; }
.trash-it .meta { font-size: 11px; color: var(--muted); margin: 3px 0 8px; }
.trash-it .row { display: flex; gap: 6px; }
.empty-msg { color: var(--muted); text-align: center; padding: 40px 10px; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(20,20,20,.45); display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto; }
.modal-wrap.open { display: flex; }
.modal { background: #fff; width: min(760px, 100%); border-radius: 18px; box-shadow: var(--shadow); border: 1.5px solid var(--ink); animation: pop .16s ease; }
.modal.sm { width: min(460px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 0; }
.m-head h2 { margin: 0; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--red); font-weight: 800; }
.m-body { padding: 14px 22px 8px; }
.m-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line-soft); margin-top: 10px; flex-wrap: wrap; }
.m-foot .r { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.confirm-text { font-size: 17px; font-weight: 600; margin: 4px 0 6px; line-height: 1.4; }
.confirm-text b { font-weight: 800; }

.f-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.f { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.f-row .f { margin-bottom: 0; }
.f > label, .f-lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.f input[type=text], .f input[type=url], .f input[type=date], .f select, .f textarea { width: 100%; border: 1.5px solid #d6d6d6; border-radius: 10px; padding: 9px 11px; font-size: 14px; background: #fff; outline: none; }
.f textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft2); }
.f .title-in { font-size: 20px !important; font-weight: 800; border-width: 0 0 2px !important; border-radius: 0 !important; padding: 6px 0 !important; box-shadow: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid #d6d6d6; background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on.pub { background: var(--orange); border-color: var(--orange); }
.type-toggle .chip { font-size: 13px; padding: 7px 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.box-f { border: 1.5px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.box-f textarea { border: 0 !important; padding: 4px 0 !important; box-shadow: none !important; min-height: 54px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.links a, .file { font-size: 11.5px; background: var(--bg-2); border-radius: 6px; padding: 3px 8px; text-decoration: none; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.links a:hover, .file a:hover { background: var(--orange-soft); }
.file a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.file button { border: 0; background: none; color: var(--muted); padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.file button:hover { color: var(--red); }
.file img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.upload-btn { font-size: 11px; font-weight: 700; color: var(--orange-d); background: none; border: 0; padding: 0; text-transform: none; letter-spacing: 0; }
.upload-btn:hover { text-decoration: underline; }
.link-row { display: flex; gap: 6px; }
.link-row input { flex: 1; }
.meta-line { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 6px; }
.meta-line b { color: var(--ink); }
.hist { margin-top: 6px; }
.hist summary { font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.hist .act { padding: 7px 0; font-size: 12px; }
.status-sel.publicado { border-color: var(--green) !important; color: var(--green); font-weight: 700; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); animation: pop .18s ease; pointer-events: auto; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .tb-title { display: none; }
  #months { padding: 10px 16px 60px; }
  .month { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
}
@media (max-width: 920px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .tb-center { order: 3; width: 100%; overflow-x: auto; }
  .month { grid-template-columns: 1fr; }
  .board-inner { position: static; max-height: none; }
  .cell { min-height: 92px; padding: 5px 3px 22px; }
  .num { font-size: 15px; }
  .item { font-size: 10.5px; padding: 2px; }
  .item .who { display: none; }
  .dow div { letter-spacing: .05em; font-size: 10px; }
  .f-row { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .add { opacity: 1; width: 18px; height: 18px; font-size: 12px; }
  .me #meName { display: none; }
}
@media (max-width: 620px) {
  /* En el celular el mes se ve como agenda: un día por fila */
  .dow { display: none; }
  .grid { grid-template-columns: 1fr; }
  .cell.out { display: none; }
  .cell { min-height: 0; padding: 8px 10px 8px 64px; }
  .cell.empty { padding-top: 6px; padding-bottom: 6px; }
  .num { position: absolute; left: 10px; top: 8px; font-size: 18px; font-weight: 700; }
  .cell::before { content: attr(data-dow); position: absolute; left: 10px; top: 30px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .cell.empty::before { content: ''; }
  .cell.empty .num { position: static; font-size: 14px; color: var(--muted); margin: 0 0 0 -54px; }
  .item { font-size: 13px; padding: 4px; }
  .item .who { display: inline-block; }
  .add { right: 8px; top: 8px; bottom: auto; }
  .cal-head { flex-direction: column; align-items: flex-start; }
  .cal-head .sub { text-align: left; }
  .tb-logo { height: 26px; }
  .tb-right { gap: 5px; }
  .tb-right .btn-sm, .sync { padding: 5px 8px; font-size: 11px; }
}
@media print {
  .topbar, .prev-wrap, .sentinel, .add, .sec-tools, .add-note, .banner-add { display: none !important; }
  .board-inner { position: static; max-height: none; }
  .month { page-break-after: always; }
}
