/* =====================================================================
   D&M Calendario de Publicaciones — Estilos
   Branding: Naranja #E8603C · Azul #2D3D6B · Rosa #FAF0EE
   ===================================================================== */
:root {
  --naranja: #E8603C;
  --naranja-dark: #d24f2d;
  --azul: #2D3D6B;
  --azul-light: #3d5090;
  --rosa: #FAF0EE;
  --rosa-hover: #f3e2de;

  --ink: #20283f;
  --muted: #6b7280;
  --line: #e7e3e1;
  --white: #ffffff;
  --bg: #fbf8f7;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 22px rgba(45, 61, 107, 0.10);
  --shadow-lg: 0 18px 50px rgba(45, 61, 107, 0.22);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------------- Botones ---------------- */
.btn {
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--naranja); color: #fff; }
.btn-primary:hover { background: var(--naranja-dark); }
.btn-ghost { background: transparent; color: var(--azul); }
.btn-ghost:hover { background: var(--rosa-hover); }
.btn-danger { background: #e2483f; color: #fff; }
.btn-danger:hover { background: #c93b33; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  background: var(--white); color: var(--azul);
  width: 38px; height: 38px; border-radius: 10px;
  font-size: 22px; line-height: 1; box-shadow: var(--shadow);
}
.btn-icon:hover { background: var(--rosa); }

/* =====================================================================
   GATE
   ===================================================================== */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--azul) 0%, #1d2950 100%);
  padding: 20px;
}
.gate-card {
  background: #fff; border-radius: 20px; padding: 40px 34px;
  width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-lg);
}
.gate-logo { width: 96px; height: auto; margin: 0 auto 14px; display: block; }
.gate-card h1 { font-size: 20px; margin: 0 0 6px; color: var(--azul); }
.gate-card p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.gate-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; font-family: var(--font); font-size: 15px; margin-bottom: 14px;
}
.gate-card input:focus { outline: none; border-color: var(--naranja); }
.gate-card .btn { width: 100%; }
.gate-error { color: #c93b33; margin-top: 12px !important; font-weight: 600; }

/* =====================================================================
   TOPBAR
   ===================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--azul); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: calc(22px + env(safe-area-inset-left));
  padding-right: calc(22px + env(safe-area-inset-right));
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 38px; width: auto; background: #fff; padding: 5px 8px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; opacity: .8; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-badge {
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 20px;
  background: rgba(255,255,255,.12);
}
.sync-badge.online { color: #b7f7cf; }
.sync-badge.local { color: #ffd9a8; }
.topbar .btn-ghost { color: #fff; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.14); }

/* =====================================================================
   TOOLBAR (navegación + filtros)
   ===================================================================== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 22px; flex-wrap: wrap;
}
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-label {
  margin: 0; font-size: 22px; color: var(--azul); font-weight: 700;
  min-width: 190px; text-align: center;
}
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-select {
  font-family: var(--font); font-size: 13px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 8px 10px; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--naranja); }

/* =====================================================================
   CALENDARIO
   ===================================================================== */
.calendar-wrap { padding: 0 22px 16px; flex: 1; }
.weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  margin-bottom: 8px;
}
.weekdays > div {
  text-align: center; font-weight: 600; font-size: 12px; color: var(--azul);
  text-transform: uppercase; letter-spacing: .04em; padding: 4px 0;
}
.weekdays .wd-weekend { color: var(--naranja); }

.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cell {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  min-height: 118px; min-width: 0; padding: 6px; display: flex; flex-direction: column;
  transition: border-color .12s ease, background .12s ease;
}
.cell-empty { background: transparent; border: 1.5px dashed #ece7e5; }
.cell:not(.cell-empty):hover { border-color: #d9d2cf; }
.cell.is-today { border-color: var(--naranja); box-shadow: 0 0 0 2px rgba(232,96,60,.18); }
.cell.drop-hover { background: var(--rosa); border-color: var(--naranja); }

.cell-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cell-num { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 2px; }
.is-today .cell-num {
  background: var(--naranja); color: #fff; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.cell-add {
  border: none; background: transparent; color: var(--azul); cursor: pointer;
  font-size: 16px; line-height: 1; width: 22px; height: 22px; border-radius: 6px;
  opacity: 0; transition: opacity .12s ease;
}
.cell:hover .cell-add { opacity: .55; }
.cell-add:hover { opacity: 1; background: var(--rosa); }
.cell-list { display: flex; flex-direction: column; gap: 4px; overflow: hidden; min-width: 0; }

/* ---------------- Tarjeta ---------------- */
.card {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid #999;
  border-radius: 7px; padding: 5px 7px; cursor: pointer; min-width: 0; max-width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .12s ease, transform .06s ease;
}
.card:hover { box-shadow: 0 3px 10px rgba(45,61,107,.16); }
.card.dragging { opacity: .45; }
.card-cliente {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .01em;
  padding: 1px 7px 1px 5px; border-radius: 20px; margin-bottom: 3px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-cliente-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.card-top { display: flex; }
.card-resp {
  margin-left: auto; font-size: 9px; font-weight: 700; color: var(--azul);
  background: var(--rosa); padding: 1px 5px; border-radius: 10px;
}
.card-title {
  font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
/* La etapa: pastilla destacada. Sobre una tarjeta pintada por el tipo
   lleva un halo claro para que no se confunda con el fondo. */
.card-estado {
  display: inline-block; margin-top: 5px; font-size: 10px; font-weight: 800;
  padding: 2px 9px; border-radius: 20px; white-space: nowrap;
  letter-spacing: .02em;
}
.card-estado.sobre-color { box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }
.card-clirow { display: flex; align-items: center; gap: 4px; }
/* ---- Tarjetas "semáforo" (etapa pinta toda la tarjeta) ---- */
.card.solid { border-width: 1px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.card.solid .card-title { color: inherit; }
.card.solid .card-cliente { background: rgba(255,255,255,.92) !important; }
.card.solid .card-resp { background: rgba(255,255,255,.28); color: inherit; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.appfoot { padding: 8px 22px 18px; color: var(--muted); font-size: 12px; }

/* =====================================================================
   VISTAS: selector + Tablero (Tabla / Kanban)
   ===================================================================== */
.viewswitch { display: flex; gap: 6px; padding: 12px 22px 0; }
.vbtn {
  font-family: var(--font); font-weight: 600; font-size: 14px;
  border: 1.5px solid var(--line); background: #fff; color: var(--azul);
  padding: 8px 16px; border-radius: 22px; cursor: pointer; transition: all .12s ease;
}
.vbtn:hover { border-color: var(--azul-light); }
.vbtn.active { background: var(--azul); color: #fff; border-color: var(--azul); }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 22px; }

.tablero-toolbar { display: flex; align-items: center; gap: 12px; padding: 2px 22px 12px; }
.subswitch { display: flex; gap: 3px; background: var(--rosa); padding: 3px; border-radius: 10px; }
.sbtn {
  border: none; background: transparent; font-family: var(--font); font-weight: 600;
  font-size: 13px; color: var(--azul); padding: 7px 15px; border-radius: 8px; cursor: pointer;
}
.sbtn.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tablero-count { font-size: 13px; color: var(--muted); }
.tablero-content { padding: 0 22px 92px; }

/* ---- Tabla editable ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

/* ---- Kanban ---- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol {
  flex: 0 0 250px; background: var(--rosa); border-radius: 12px; padding: 8px;
  display: flex; flex-direction: column; max-height: 72vh;
}
.kcol-head {
  display: flex; align-items: center; gap: 6px; padding: 8px 6px;
  border-top: 3px solid #ccc; border-radius: 4px 4px 0 0; margin-bottom: 6px; background: rgba(255,255,255,.5);
}
.kcol-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kcol-name { font-size: 12.5px; font-weight: 700; color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcol-count { font-size: 11px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 10px; padding: 1px 7px; }
.kcol.kdrop { outline: 2px dashed var(--naranja); outline-offset: -2px; }
.kcol-body { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; min-height: 24px; }
.kcard {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid #999; border-radius: 8px;
  padding: 8px 9px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kcard:hover { box-shadow: 0 3px 10px rgba(45,61,107,.14); }
.kcard.dragging { opacity: .45; }
.kcard-cli { font-size: 10px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.kcard-title { font-size: 12.5px; font-weight: 600; margin-top: 2px; line-height: 1.25; color: var(--ink); }
.kcard-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.kcard-fecha { font-size: 10px; color: var(--muted); font-weight: 600; }

/* =====================================================================
   MODALES
   ===================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(32, 40, 63, .42); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); animation: pop .16s ease;
}
.modal-wide { max-width: 620px; }
.modal-sm { max-width: 400px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 18px; color: var(--azul); }
.modal-close {
  border: none; background: transparent; font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: 8px;
}
.modal-close:hover { background: var(--rosa); color: var(--ink); }
.modal-body { padding: 18px 22px; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--line);
}
.modal-foot .hint { font-size: 12px; color: var(--muted); }

/* ---------------- Campos del formulario ---------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--azul); margin-bottom: 6px; }
.field .req { color: var(--naranja); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--naranja); }
.field textarea { resize: vertical; }
.field .err { border-color: #e2483f; animation: shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--naranja); margin: 6px 0 12px; padding-top: 12px; border-top: 1px solid var(--line);
}

/* ---------------- Chips (multi-selección) ---------------- */
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 20px; padding: 6px 12px; cursor: pointer; transition: all .12s ease;
}
.chip:hover { border-color: var(--naranja); }
.chip.on { background: var(--azul); border-color: var(--azul); color: #fff; }
#f-canales.err, #f-canales.err .chip { border-color: #e2483f; }

/* =====================================================================
   GESTOR DE ETIQUETAS
   ===================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  border: none; background: transparent; color: var(--muted);
  padding: 9px 13px; cursor: pointer; border-bottom: 2.5px solid transparent;
}
.tab:hover { color: var(--azul); }
.tab.active { color: var(--azul); border-bottom-color: var(--naranja); }

.tag-editor { display: flex; flex-direction: column; gap: 8px; }
.tag-row { display: flex; align-items: center; gap: 8px; }
.tag-moves { display: flex; flex-direction: column; gap: 1px; }
.mini {
  border: 1px solid var(--line); background: #fff; color: var(--azul);
  width: 22px; height: 16px; font-size: 9px; line-height: 1; border-radius: 4px; cursor: pointer; padding: 0;
}
.mini:hover:not(:disabled) { background: var(--rosa); }
.mini:disabled { opacity: .3; cursor: default; }
.mini-danger { width: 30px; height: 30px; font-size: 13px; color: #c93b33; }
.mini-danger:hover { background: #fde8e6; }
.tag-color { width: 34px; height: 30px; padding: 2px; border: 1.5px solid var(--line); border-radius: 7px; cursor: pointer; }
.tag-icon { width: 42px; text-align: center; font-size: 16px; border: 1.5px solid var(--line); border-radius: 7px; padding: 5px; font-family: var(--font); }
.tag-name { flex: 1; font-family: var(--font); font-size: 14px; border: 1.5px solid var(--line); border-radius: 7px; padding: 7px 10px; }
.tag-name:focus, .tag-icon:focus { outline: none; border-color: var(--naranja); }
.add-tag { align-self: flex-start; margin-top: 4px; }

/* ---- Editor de actividades (estrella de favorita) ---- */
.act-intro { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.act-name { font-size: 13.5px; color: var(--ink); }

/* =====================================================================
   RESPONSIVE (celular)
   ===================================================================== */
@media (max-width: 720px) {
  /* ----- Header compacto ----- */
  .topbar { padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); gap: 8px; }
  .brand-sub { display: none; }
  .brand-logo { height: 34px; }
  .brand-name { font-size: 15px; }
  .topbar-actions { gap: 7px; }
  .sync-badge { font-size: 11px; padding: 4px 9px; }

  /* "+ Nueva publicación" -> botón flotante (FAB) abajo a la derecha */
  #btnNew {
    position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 60; width: 58px; height: 58px; border-radius: 50%;
    padding: 0; font-size: 0; box-shadow: 0 8px 22px rgba(232,96,60,.45);
  }
  #btnNew::after { content: "+"; font-size: 32px; font-weight: 400; line-height: 1; }

  /* ----- Toolbar / filtros ----- */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .month-nav { justify-content: space-between; }
  .month-label { min-width: 0; flex: 1; font-size: 20px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter-select { width: 100%; padding: 11px 10px; font-size: 14px; }
  #clearFilters { grid-column: 1 / -1; padding: 9px; }

  /* ----- Calendario ----- */
  .calendar-wrap { padding: 0 8px 90px; }   /* espacio abajo para el FAB */
  .grid { gap: 4px; }
  .weekdays { gap: 4px; }
  .weekdays > div { font-size: 9.5px; }
  .cell { min-height: 78px; padding: 4px 3px; border-radius: 7px; }
  .cell-num { font-size: 12px; }
  .cell-add { opacity: .5; }   /* visible en táctil (no hay hover) */
  .card { padding: 4px 5px; }
  .card-cliente { font-size: 9px; padding: 1px 6px 1px 4px; }
  .card-title { font-size: 10.5px; -webkit-line-clamp: 2; }
  .card-estado { font-size: 9px; }
  .appfoot { padding: 8px 14px calc(16px + env(safe-area-inset-bottom)); }

  /* ----- Modal como hoja inferior a pantalla completa ----- */
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal, .modal-wide, .modal-sm {
    max-width: 100%; width: 100%; border-radius: 0; min-height: 100%;
    display: flex; flex-direction: column;
  }
  .modal-head { position: sticky; top: 0; background: #fff; z-index: 2; padding-top: calc(18px + env(safe-area-inset-top)); }
  .modal-body { flex: 1; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; padding-bottom: calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-close { width: 40px; height: 40px; font-size: 30px; }
  .row { grid-template-columns: 1fr; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 11px 12px; }  /* 16px evita zoom en iOS */
  .chip { font-size: 14px; padding: 9px 14px; }
  .btn { padding: 11px 18px; font-size: 15px; }
  .tab { font-size: 14px; padding: 10px 12px; }
  .tag-name, .tag-icon { padding: 10px; font-size: 15px; }
  .mini-danger { width: 38px; height: 38px; }
}

/* En pantallas muy angostas, máximo aprovechamiento */
@media (max-width: 380px) {
  .cell { min-height: 66px; }
}

/* =====================================================================
   REDISEÑO MÓVIL — estilo Calendario de iPhone (mes aireado + chips)
   ===================================================================== */
@media (max-width: 720px) {
  .calendar-wrap { padding: 0 6px 92px; }
  .weekdays { gap: 0; padding: 0 3px; margin-bottom: 2px; }
  .weekdays > div { font-size: 10px; color: var(--muted); font-weight: 600; }
  .grid { gap: 0; }

  /* Celdas sin caja: solo una línea fina que separa las semanas */
  .cell, .cell-empty {
    background: transparent; border: none; border-top: 1px solid var(--line);
    border-radius: 0; min-height: 88px; padding: 4px 3px 6px;
  }
  .cell:not(.cell-empty):hover { border-color: var(--line); }
  .cell.is-today { border-color: var(--line); box-shadow: none; }
  .cell.drop-hover { background: var(--rosa); }
  .cell-head { justify-content: flex-start; margin-bottom: 3px; }
  .cell-add { display: none; }        /* en móvil se usa la hoja de día + FAB */
  .cell-num { font-size: 12.5px; font-weight: 600; color: var(--ink); padding-left: 1px; }
  .is-today .cell-num {
    background: var(--naranja); color: #fff; width: 22px; height: 22px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
  }
  .cell-list { gap: 2px; }

  /* Chips compactos: punto de color + título en una línea */
  .mchip {
    display: flex; align-items: center; gap: 4px; cursor: pointer;
    background: #eceaf0; border-radius: 5px; padding: 2px 5px;
    font-size: 10.5px; line-height: 1.3; color: var(--ink); overflow: hidden;
  }
  .mchip-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
  .mchip-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; min-width: 0; }
  .cell-more {
    border: none; background: transparent; color: var(--muted);
    font-size: 10px; font-weight: 700; padding: 1px 4px; text-align: left; cursor: pointer;
  }

  /* Hoja de día: sheet inferior (no pantalla completa) */
  #daySheet { align-items: flex-end; }
  #daySheet .modal.sheet {
    min-height: auto; max-height: 82vh; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #daySheet .modal-head { padding-top: 16px; border-radius: 20px 20px 0 0; }
  #daySheet .modal-head h3 { text-transform: capitalize; }
  #daySheetBody { display: flex; flex-direction: column; gap: 8px; }
  #daySheetBody .card { padding: 9px 11px; border-left-width: 5px; }
  #daySheetBody .card-title { font-size: 13px; -webkit-line-clamp: 3; }
  #daySheetBody .card-cliente { font-size: 11px; }
  .sheet-empty { color: var(--muted); text-align: center; padding: 24px 0; margin: 0; }

  /* ----- Tablero en móvil ----- */
  .viewswitch { padding: 10px 12px 0; }
  .vbtn { flex: 1; padding: 9px 10px; font-size: 13.5px; }
  .filters { padding: 10px 12px; }
  .tablero-toolbar { padding: 2px 12px 10px; }
  .tablero-content { padding: 0 8px 92px; }
  .kcol { flex-basis: 80vw; max-height: 64vh; }
  .tin, .tsel { font-size: 16px; padding: 8px; }  /* 16px evita zoom en iOS */
}

/* =====================================================================
   VISTA HOY
   ===================================================================== */
.hoy-wrap { padding: 4px 16px 40px; max-width: 760px; margin: 0 auto; }
.hoy-sec { margin-bottom: 26px; }
.hoy-sec-head { display: flex; align-items: center; gap: 9px; margin: 0 0 11px; }
.hoy-sec-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--azul); }
.hoy-sec-count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--rosa); color: var(--azul);
  font-size: 12px; font-weight: 600; text-align: center;
}
.hoy-late .hoy-sec-title { color: #c93b33; }
.hoy-late .hoy-sec-count { background: #fde8e6; color: #c93b33; }
.hoy-empty { margin: 0; color: var(--muted); font-size: 13.5px; }

.hoy-list { display: flex; flex-direction: column; gap: 9px; }
.hoy-card {
  background: var(--white); border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius-sm); padding: 11px 13px;
  cursor: pointer; transition: box-shadow .14s, transform .14s;
}
.hoy-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.hoy-card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.hoy-card-cli {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
}
.hoy-card-title { font-size: 14.5px; font-weight: 500; line-height: 1.35; }
.hoy-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.hoy-tag {
  padding: 2px 8px; border-radius: 999px; background: var(--bg);
  color: var(--muted); font-size: 11px; border: 1px solid var(--line);
}
.hoy-add {
  margin-top: 11px; width: 100%; padding: 10px;
  background: transparent; border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: var(--font); font-size: 13.5px; cursor: pointer;
}
.hoy-add:hover { border-color: var(--naranja); color: var(--naranja); }

/* =====================================================================
   IMPORTADOR JSON
   ===================================================================== */
.import-ta {
  width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.5; resize: vertical;
  padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fdfcfc; color: var(--ink);
}
.import-ta:focus { outline: none; border-color: var(--azul-light); }
.import-preview:not(:empty) { margin-top: 14px; }
.import-err { color: #c93b33; font-size: 13px; margin: 8px 0 0; font-weight: 500; }

.import-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; display: block; overflow-x: auto; }
.import-tbl th, .import-tbl td {
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.import-tbl th { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.import-tbl tr.row-err td { background: #fdf1f0; }
.import-row-err { margin-top: 4px; color: #c93b33; font-size: 11.5px; line-height: 1.45; }
.import-sum { margin: 11px 0 0; font-size: 13px; font-weight: 500; color: var(--azul); }

.import-help { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.import-help summary { cursor: pointer; color: var(--azul); font-weight: 500; }
.import-help p { line-height: 1.5; }
.import-help code { background: var(--rosa); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.import-help-tbl { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.import-help-tbl td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.import-help-tbl code { word-break: break-word; }

@media (max-width: 720px) {
  .hoy-wrap { padding: 4px 12px 40px; }
  #importModal .modal { max-height: 92vh; }
  .import-ta { font-size: 12px; }
}

/* =====================================================================
   TEMAS DE MARCA + MODO CLIENTE   (sep 2026)
   ---------------------------------------------------------------------
   applyTheme() en app.js reescribe las variables de :root según el
   cliente. Esta hoja no conoce las marcas: solo consume las variables.
   ===================================================================== */
:root { --font-titulo: var(--font); }

/* Titulares en la tipografía de titular de cada marca */
.brand-name, .month-label, .modal-head h3, .gate-card h1,
.hoy-sec-title, .kcol-name { font-family: var(--font-titulo); }

.brand-name { letter-spacing: .01em; }

/* ---- Modo cliente: se oculta todo lo interno de la agencia ---- */
.modo-cliente .solo-agencia { display: none !important; }
.modo-cliente .brand { padding-left: 2px; }
.modo-cliente .brand-name { font-size: 20px; font-weight: 700; }
.modo-cliente .brand-sub { font-style: italic; opacity: .75; }

/* ---- Tipo de pieza en la tarjeta ---- */
.card-tipo {
  display: inline-block; font-size: 9.5px; font-weight: 600;
  color: var(--muted); letter-spacing: .02em; margin-bottom: 1px;
}
.card.solid .card-tipo { color: inherit; opacity: .85; }

/* ---- Marcas de contenido (guion / comentarios / enlace) ---- */
.card-mark { font-size: 10px; line-height: 1; opacity: .75; cursor: help; }
.card.solid .card-mark { opacity: .9; }
.card-arch { font-size: 10px; margin-left: auto; opacity: .6; }

.kcard-tipo { font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 1px; }

/* El guion ya no es un textarea: sus estilos viven en .rt-editor */
#f-comentarios { line-height: 1.5; }

/* ---- Pie del calendario de cliente ---- */
.modo-cliente .appfoot { text-align: center; opacity: .8; }

/* ---- Interruptor "Pintar" de cada etapa (⚙ Etiquetas → Etapas) ---- */
.tag-solido {
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 20px; padding: 6px 12px; cursor: pointer; flex: none;
  letter-spacing: .02em; transition: all .12s ease;
}
.tag-solido:hover { border-color: var(--azul-light); }
.tag-solido.on { border-width: 1.5px; }

/* En modo cliente el campo Cliente desaparece: la fila no debe quedar coja */
.modo-cliente .row-cliente { grid-template-columns: 1fr; }

/* Logo del cliente en el encabezado (si existe el archivo) */
.modo-cliente .brand-logo {
  height: 40px; width: auto; background: #fff;
  padding: 5px 9px; border-radius: 9px;
}

/* Pieza sin tipo: la tarjeta no puede tomar color. Se marca como pendiente
   interno para que se note, sin gritar. El cliente nunca ve esta etiqueta. */
.card-sin-tipo {
  color: var(--muted); opacity: .7; font-style: italic; font-weight: 500;
  border: 1px dashed var(--line); border-radius: 4px; padding: 0 4px;
}

/* ---- Canales: "¿para dónde va?" ------------------------------------
   Mismo lenguaje visual que la pastilla de etapa, con el color de cada
   plataforma. En tarjeta pintada llevan halo claro para despegarse. */
.card-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 5px; }
.card-pills .card-estado { margin-top: 0; }
.card-canal {
  display: inline-block; font-size: 9px; font-weight: 800;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
  letter-spacing: .02em;
}
.card-canal.sobre-color { box-shadow: 0 0 0 1.5px rgba(255,255,255,.85); }

/* En Hoy y en Kanban conviven con otras etiquetas */
.hoy-card-meta .card-canal, .kcard-foot .card-canal { font-size: 10px; padding: 2px 8px; }

/* Etiqueta corta del canal en ⚙ Etiquetas */
.tag-corto {
  width: 74px; text-align: center; font-size: 12px; font-family: var(--font);
  border: 1.5px solid var(--line); border-radius: 7px; padding: 6px 4px; flex: none;
}
.tag-corto:focus { outline: none; border-color: var(--naranja); }

.hint-canal { font-weight: 400; font-size: 11px; color: var(--muted); }

/* =====================================================================
   TABLA ESTILO NOTION
   ---------------------------------------------------------------------
   El color va en la fila, no en un rótulo aparte: así se distingue una
   pieza de otra sin leerla. Cada pastilla es a la vez el editor.
   ===================================================================== */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line);
  border-radius: 12px; background: var(--white);
}
.dtable { border-collapse: collapse; width: 100%; min-width: 980px; font-size: 13px; table-layout: auto; }

.dtable th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--muted); padding: 10px 10px; background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
.dtable th.th-titulo { padding-left: 14px; }
.dtable td {
  padding: 3px 8px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.dtable tbody tr:last-child td { border-bottom: none; }
.drow { transition: background .12s ease; }
.drow:hover { background: var(--bg); }
.drow.guardada { background: rgba(30,142,62,.10); }
.drow-new td { background: var(--bg); }

/* ---- Celda del nombre ---- */
/* El nombre es lo que se lee primero: se le da el ancho que necesita y el
   resto de columnas se aprietan. */
.td-titulo, .th-titulo { min-width: 340px; width: 40%; padding-left: 14px !important; }
.tnombre { display: flex; align-items: center; gap: 7px; }
.tnombre-ico { font-size: 13px; opacity: .45; flex: none; }
.tin-titulo {
  flex: 1; min-width: 0; font-family: var(--font); font-size: 13.5px; font-weight: 500;
  color: var(--ink); background: transparent;
  border: 1px solid transparent; border-radius: 6px; padding: 6px 7px;
}
.tin-titulo:hover { border-color: var(--line); background: #fff; }
.tin-titulo:focus { outline: none; border-color: var(--naranja); background: #fff; }
.tin-titulo.err { border-color: #e2483f; background: #fdecea; }

/* Botón Abrir: aparece al pasar el ratón, como en Notion */
.tabrir {
  flex: none; opacity: 0; font-family: var(--font); font-size: 11px; font-weight: 600;
  color: var(--muted); background: var(--white); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px 9px; cursor: pointer; transition: opacity .12s ease;
}
.drow:hover .tabrir { opacity: 1; }
.tabrir:hover { color: var(--azul); border-color: var(--azul-light); }

/* ---- Pastillas: el select ES la pastilla ---- */
.tpill {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font); font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent; border-radius: 5px;
  padding: 4px 9px; cursor: pointer; max-width: 100%;
  background: transparent; color: var(--ink);
  text-overflow: ellipsis; white-space: nowrap;
}
.tpill:hover { border-color: var(--line); }
.tpill:focus { outline: none; border-color: var(--naranja); }
.tpill.vacia { color: var(--muted); font-weight: 500; }

/* Punto de color a la izquierda (Etapa y Cliente, como el status de Notion).
   Un <select> no admite ::before, asi que el punto se dibuja como fondo.
   Por eso el JS pinta backgroundColor y no background: si usara el atajo,
   borraria este gradiente. */
.tpill-punto {
  padding-left: 21px;
  background-image: radial-gradient(circle at 9px 50%, var(--punto, #999) 3.5px, transparent 4px);
  background-repeat: no-repeat;
}

/* Pastillas de solo lectura (canales) */
.tcanales { display: flex; flex-wrap: wrap; gap: 3px; }
.td-canales { min-width: 130px; }
.tpill-ro { cursor: default; border: none; }
.tvacio { color: var(--muted); font-size: 12px; padding-left: 4px; }

.tin-fecha {
  font-family: var(--font); font-size: 12.5px; color: var(--ink);
  background: transparent; border: 1px solid transparent;
  border-radius: 6px; padding: 5px 6px; min-width: 128px;
}
.tin-fecha:hover { border-color: var(--line); background: #fff; }
.tin-fecha:focus { outline: none; border-color: var(--naranja); background: #fff; }

.trow-actions { white-space: nowrap; text-align: right; padding-right: 12px !important; }
.tsave { opacity: 0; transition: opacity .12s ease; }
.drow:hover .tsave { opacity: 1; }

@media (max-width: 720px) {
  .dtable { min-width: 760px; font-size: 14px; }
  .tin-titulo, .tin-fecha { font-size: 16px; }   /* 16px evita el zoom de iOS */
  .tpill { font-size: 13px; padding: 6px 10px; }
  .tabrir, .tsave { opacity: 1; }                /* en táctil no hay hover */
}

/* =====================================================================
   GUION CON FORMATO + FICHA MÁS AMPLIA
   ===================================================================== */

/* La ficha crece: el guion es lo que más se escribe y 560px se quedaban
   cortos. No tanto como para romper la proporción del resto. */
.modal { max-width: 680px; }

.field-guion { margin-bottom: 18px; }

.rt-barra {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  border: 1.5px solid var(--line); border-bottom: none;
  border-radius: 9px 9px 0 0; padding: 5px 7px; background: var(--bg);
}
.rt-btn {
  min-width: 28px; height: 28px; padding: 0 7px;
  font-family: var(--font); font-size: 13px; line-height: 1;
  border: none; background: transparent; color: var(--ink);
  border-radius: 6px; cursor: pointer;
}
.rt-btn:hover { background: var(--rosa-hover); }
.rt-btn.on { background: var(--azul); color: #fff; }
.rt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.rt-editor {
  min-height: 320px; max-height: 52vh; overflow-y: auto;
  border: 1.5px solid var(--line); border-radius: 0 0 9px 9px;
  padding: 14px 16px; background: #fff;
  font-family: var(--font); font-size: 14.5px; line-height: 1.65; color: var(--ink);
}
.rt-editor:focus { outline: none; border-color: var(--naranja); }
.rt-editor:empty::before {
  content: attr(data-ph); color: var(--muted); pointer-events: none;
}
.rt-editor h2 { font-size: 18px; font-weight: 700; margin: 14px 0 6px; color: var(--azul); }
.rt-editor h3 { font-size: 15.5px; font-weight: 700; margin: 12px 0 4px; color: var(--ink); }
.rt-editor h2:first-child, .rt-editor h3:first-child { margin-top: 0; }
.rt-editor ul, .rt-editor ol { margin: 6px 0; padding-left: 22px; }
.rt-editor li { margin: 3px 0; }
.rt-editor a { color: var(--azul-light); text-decoration: underline; }

/* ---- Enlace clicable ---- */
.campo-link { display: flex; align-items: center; gap: 8px; }
.campo-link input { flex: 1; min-width: 0; }
.link-abrir {
  flex: none; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--azul-light); background: var(--rosa);
  border-radius: 8px; padding: 9px 12px; white-space: nowrap;
}
.link-abrir:hover { background: var(--rosa-hover); text-decoration: underline; }

/* =====================================================================
   FICHA EN MÓVIL — fondo completo
   ---------------------------------------------------------------------
   El fondo se veía a medias porque `align-items: stretch` con overflow
   dejaba la caja a la altura de la pantalla y el contenido se salía fuera
   del blanco. Ahora la ficha ocupa la pantalla exacta y lo que scrollea es
   el cuerpo, no el overlay: el fondo siempre cubre.
   ===================================================================== */
@media (max-width: 720px) {
  .modal-overlay { padding: 0; align-items: stretch; overflow: hidden; }
  .modal, .modal-wide, .modal-sm {
    max-width: 100%; width: 100%; border-radius: 0;
    height: 100vh; height: 100dvh; min-height: 0; max-height: 100dvh;
    display: flex; flex-direction: column;
  }
  .modal-head { flex: none; position: static; }
  .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-foot { flex: none; position: static; }

  .rt-editor { min-height: 300px; max-height: none; font-size: 16px; }
  .rt-btn { min-width: 34px; height: 34px; font-size: 15px; }
  .campo-link { flex-wrap: wrap; }
  .link-abrir { width: 100%; text-align: center; }

  /* La hoja de día sigue siendo hoja inferior, no pantalla completa */
  #daySheet { align-items: flex-end; overflow: hidden; }
  #daySheet .modal.sheet {
    height: auto; min-height: auto; max-height: 82vh;
    border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom);
  }
  #daySheet .modal-head { border-radius: 20px 20px 0 0; }
}

/* =====================================================================
   SEPTIEMBRE 2026 — arrastrar, deshacer, TikTok y la pestaña comercial
   ---------------------------------------------------------------------
   El acabado de este bloque sigue el del calendario comercial de Casa
   Tibaná: filete de 1px en vez de bordes gruesos, sombras muy bajas,
   selector de vista como control segmentado y rótulos pequeños en
   versalitas. Es la misma familia visual, no un tema aparte.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Selector de vista: control segmentado
   Antes eran píldoras sueltas; agrupadas se lee de un golpe cuántas
   vistas hay y en cuál estás.
   --------------------------------------------------------------------- */
.viewswitch {
  display: flex; gap: 2px; align-items: center;
  margin: 12px 22px 0; padding: 3px;
  background: var(--rosa); border-radius: 11px;
  width: fit-content; max-width: calc(100% - 44px);
  overflow-x: auto; scrollbar-width: none;
}
.viewswitch::-webkit-scrollbar { display: none; }
.vbtn {
  font-family: var(--font); font-weight: 600; font-size: 13.5px;
  border: none; background: transparent; color: var(--azul);
  padding: 8px 15px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; transition: background .14s ease, color .14s ease;
}
.vbtn:hover { background: rgba(255,255,255,.6); }
.vbtn.active {
  background: var(--white); color: var(--azul);
  box-shadow: 0 1px 2px rgba(32,40,63,.10), 0 2px 6px -3px rgba(32,40,63,.24);
}

/* ---------------------------------------------------------------------
   Deshacer / rehacer
   --------------------------------------------------------------------- */
.historial { display: flex; gap: 2px; background: rgba(255,255,255,.14); padding: 2px; border-radius: 9px; }
.hbtn {
  width: 30px; height: 30px; border: none; border-radius: 7px;
  background: transparent; color: #fff; font-size: 16px; line-height: 1;
  cursor: pointer; transition: background .14s ease, opacity .14s ease;
}
.hbtn:hover:not(:disabled) { background: rgba(255,255,255,.22); }
.hbtn:disabled { opacity: .32; cursor: default; }

/* ---------------------------------------------------------------------
   Aviso breve
   --------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  z-index: 200; max-width: min(92vw, 460px);
  background: var(--ink); color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 500; line-height: 1.4;
  padding: 11px 18px; border-radius: 11px;
  box-shadow: 0 10px 34px rgba(32,40,63,.34);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------------
   Orden de la tabla
   --------------------------------------------------------------------- */
.ordenmodo { display: flex; align-items: center; gap: 2px; }
.ordenmodo-lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-right: 6px;
}
.obtn {
  font-family: var(--font); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--white); color: var(--muted);
  padding: 6px 12px; cursor: pointer; transition: all .12s ease;
}
.obtn:first-of-type { border-radius: 8px 0 0 8px; }
.obtn:last-of-type { border-radius: 0 8px 8px 0; margin-left: -1px; }
.obtn:hover { color: var(--ink); }
.obtn.active { background: var(--azul); border-color: var(--azul); color: #fff; }

/* ---------------------------------------------------------------------
   Arrastrar filas de la tabla
   El punteado solo aparece al pasar por encima: en reposo la tabla se
   mantiene limpia, como en Notion.
   --------------------------------------------------------------------- */
.th-agarre, .td-agarre { width: 26px; padding: 0 !important; }
.tagarre {
  display: block; width: 100%; text-align: center;
  color: var(--muted); font-size: 13px; line-height: 1;
  opacity: 0; cursor: grab; user-select: none;
  transition: opacity .12s ease;
}
.drow:hover .tagarre { opacity: .5; }
.tagarre:hover { opacity: 1 !important; }
.tagarre:active { cursor: grabbing; }
.drow.arrastrando { opacity: .4; }
.drow.drop-arriba td { box-shadow: inset 0 2px 0 var(--naranja); }
.drow.drop-abajo td { box-shadow: inset 0 -2px 0 var(--naranja); }

/* ---------------------------------------------------------------------
   Pestaña del calendario comercial (solo Casa Tibaná)
   Va en un iframe: se le da altura completa y se deja que él scrollee.
   --------------------------------------------------------------------- */
#viewComercial { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.comercial-barra {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 4px 22px 12px;
}
.comercial-txt { font-size: 12.5px; color: var(--muted); }
.comercial-link {
  margin-left: auto; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--azul-light); background: var(--rosa);
  border-radius: 8px; padding: 7px 12px; white-space: nowrap;
}
.comercial-link:hover { background: var(--rosa-hover); }
.comercial-wrap { flex: 1; min-height: 0; padding: 0 22px 22px; display: flex; }
.comercial-frame {
  flex: 1; width: 100%; min-height: 72vh; height: calc(100dvh - 220px);
  border: 1px solid var(--line); border-radius: 14px; background: var(--white);
  box-shadow: 0 1px 2px rgba(32,40,63,.05), 0 10px 30px -18px rgba(32,40,63,.28);
}
.en-comercial .appfoot { display: none; }

@media (max-width: 720px) {
  /* Con la pestaña Comercial son cuatro: se aprieta lo justo para que
     quepan las cuatro en un iPhone sin tener que desplazar. */
  .viewswitch { margin: 10px 10px 0; max-width: calc(100% - 20px); }
  .vbtn { font-size: 12.5px; padding: 8px 10px; }
  .historial { order: -1; }
  .ordenmodo { width: 100%; }
  .ordenmodo-lbl { margin-right: auto; }
  .tagarre { opacity: .5; }               /* en táctil no hay hover */
  .comercial-barra { padding: 2px 10px 8px; }
  .comercial-txt { display: none; }          /* en celular el espacio es el contenido */
  .comercial-link { margin-left: 0; }
  .comercial-wrap { padding: 0 8px 10px; }
  .comercial-frame {
    min-height: 0; height: calc(100dvh - 160px);
    border-radius: 10px;
  }
  /* El botón flotante taparía el calendario comercial, que además no crea
     piezas: ahí no hace falta. */
  .en-comercial #btnNew { display: none !important; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------------
   Fechas clave del calendario comercial dentro del mes (Casa Tibaná, nov 2026)
   --------------------------------------------------------------------- */
.cell.is-festivo { background: #fdf4f3; }
.cell.is-festivo .cell-num { color: #c8463f; }
.cell-fechas { display: flex; flex-direction: column; gap: 2px; margin: 0 0 5px; }
.cf {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--c) 9%, transparent); color: var(--ink);
  border-left: 3px solid var(--c); border-radius: 0 5px 5px 0;
  font-family: inherit; font-size: 10.5px; font-weight: 500; line-height: 1.3; padding: 2px 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf:hover { background: color-mix(in srgb, var(--c) 20%, transparent); }
.cf-mas { border-left-color: transparent; background: none; color: var(--muted); }
.btn-fechas[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
@media (max-width: 720px) { .cf { font-size: 9.5px; padding: 1px 4px; } }
