/* ============================================================
   PATYTA PRO · AGENDA APP R3.1
   Consolidada: reemplaza R2A + R2B + R2C
   ============================================================ */

body.pt-agenda-r3{
  background:#F7F9FB!important;
}

body.pt-agenda-r3 .x-main{
  min-width:0!important;
}

body.pt-agenda-r3 .patyta-calendar-r1{
  --pt-r3-navy:#052F5E;
  --pt-r3-sky:#ACDCF2;
  --pt-r3-bg:#F7F9FB;
  --pt-r3-line:rgba(5,47,94,.085);
  --pt-r3-line-strong:rgba(5,47,94,.14);
  --pt-r3-muted:#6F8295;

  width:100%!important;
  max-width:none!important;

  margin:0!important;
  padding:30px 30px 48px!important;

  color:var(--pt-r3-navy)!important;
}

/* ============================================================
   CABECERA PRINCIPAL
   ============================================================ */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-top{
  margin:0 0 26px!important;
  padding:0!important;

  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:start!important;
  gap:28px!important;

  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-top h1{
  margin:5px 0 8px!important;

  color:var(--pt-r3-navy)!important;

  font-size:36px!important;
  line-height:1.05!important;
  font-weight:700!important;
  letter-spacing:-.045em!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-top p{
  max-width:760px!important;

  margin:0!important;

  color:var(--pt-r3-muted)!important;

  font-size:14px!important;
  line-height:1.6!important;
  font-weight:400!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
  flex-wrap:wrap!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions a,
body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions button{
  min-height:44px!important;

  padding:0 18px!important;

  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;

  border:1px solid var(--pt-r3-line-strong)!important;
  border-radius:999px!important;

  background:#FFFFFF!important;
  color:var(--pt-r3-navy)!important;

  box-shadow:none!important;

  font-size:12px!important;
  line-height:1!important;
  font-weight:500!important;

  text-decoration:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions .pc-manual-open{
  border-color:var(--pt-r3-navy)!important;

  background:var(--pt-r3-navy)!important;
  color:var(--pt-r3-sky)!important;
}

/* ============================================================
   TOOLBAR
   DOM ORIGINAL: nav | title | tabs
   No movemos nodos.
   ============================================================ */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-toolbar{
  margin:0 0 16px!important;
  padding:0!important;

  display:grid!important;
  grid-template-columns:auto minmax(180px,1fr) auto!important;
  align-items:center!important;
  gap:16px!important;

  border:0!important;
  background:transparent!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:7px!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav a{
  min-width:42px!important;
  min-height:42px!important;

  padding:0 13px!important;

  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;

  border:1px solid var(--pt-r3-line)!important;
  border-radius:999px!important;

  background:#FFFFFF!important;
  color:var(--pt-r3-navy)!important;

  box-shadow:none!important;

  font-size:12px!important;
  line-height:1!important;
  font-weight:500!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-title{
  min-width:0!important;

  text-align:center!important;

  color:var(--pt-r3-navy)!important;

  font-size:22px!important;
  line-height:1.2!important;
  font-weight:600!important;
  letter-spacing:-.025em!important;

  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs{
  padding:3px!important;

  display:flex!important;
  justify-content:flex-end!important;
  gap:2px!important;

  border:1px solid var(--pt-r3-line)!important;
  border-radius:999px!important;

  background:#EEF3F6!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs a{
  min-width:68px!important;
  min-height:36px!important;

  padding:0 14px!important;

  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;

  border-radius:999px!important;

  color:#708295!important;

  font-size:11px!important;
  line-height:1!important;
  font-weight:500!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs a.is-active{
  background:#FFFFFF!important;
  color:var(--pt-r3-navy)!important;

  box-shadow:0 2px 8px rgba(5,47,94,.07)!important;
}

/* ============================================================
   SEMÁFORO
   Los COLORES los sigue gobernando R4.
   ============================================================ */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-semaphore{
  margin:0 0 20px!important;
  padding:11px 2px!important;

  display:flex!important;
  align-items:center!important;
  gap:8px!important;

  border-top:1px solid var(--pt-r3-line)!important;
  border-bottom:1px solid var(--pt-r3-line)!important;

  background:transparent!important;

  overflow-x:auto!important;
  scrollbar-width:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-semaphore::-webkit-scrollbar{
  display:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-sem{
  flex:0 0 auto!important;

  min-height:28px!important;

  padding:0 9px!important;

  font-size:10px!important;
  font-weight:500!important;
}

/* ============================================================
   SUPERFICIE DEL CALENDARIO
   ============================================================ */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-card{
  position:relative!important;

  border:1px solid var(--pt-r3-line)!important;
  border-radius:14px!important;

  background:#FFFFFF!important;

  box-shadow:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-grid-head{
  z-index:12!important;

  border-bottom:1px solid var(--pt-r3-line)!important;

  background:#FFFFFF!important;

  box-shadow:0 1px 0 var(--pt-r3-line)!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-day-head{
  min-height:58px!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-day-head span{
  color:#7C8E9F!important;

  font-size:10px!important;
  font-weight:500!important;
  letter-spacing:.04em!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-day-head strong{
  width:32px!important;
  height:32px!important;

  font-size:14px!important;
  font-weight:600!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-hour-label{
  padding-right:9px!important;

  color:#8A99A7!important;

  font-size:10px!important;
  line-height:1!important;
  font-weight:400!important;
}

/* Citas */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-event{
  left:4px!important;
  right:4px!important;

  padding:7px 8px!important;

  border-radius:8px!important;

  box-shadow:none!important;

  transition:
    transform 150ms ease,
    box-shadow 150ms ease!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-event strong{
  margin-bottom:3px!important;

  font-size:12px!important;
  line-height:1.2!important;
  font-weight:600!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-event span{
  font-size:10px!important;
  line-height:1.3!important;
  font-weight:400!important;
}

@media(hover:hover){
  body.pt-agenda-r3 .patyta-calendar-r1 .pc-event:hover{
    z-index:18!important;

    transform:translateY(-1px)!important;

    box-shadow:0 8px 18px rgba(5,47,94,.09)!important;
  }
}

/* Mes */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-month-weekday{
  min-height:38px!important;

  padding:11px 6px!important;

  color:#7C8E9F!important;

  font-size:10px!important;
  font-weight:500!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-month-num{
  width:30px!important;
  height:30px!important;

  font-size:12px!important;
  font-weight:600!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-month-event,
body.pt-agenda-r3 .patyta-calendar-r1 .pc-month-block{
  margin-top:4px!important;

  padding:6px 7px!important;

  border-radius:7px!important;

  font-size:10px!important;
  line-height:1.25!important;
  font-weight:500!important;
}

/* Operación Día/Hoy */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-today-ops-r1{
  margin:0!important;
  padding:18px 20px!important;

  border:0!important;
  border-bottom:1px solid var(--pt-r3-line)!important;
  border-radius:0!important;

  background:#FFFFFF!important;

  box-shadow:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-today-kicker-r1{
  color:#7C8E9F!important;

  font-size:10px!important;
  font-weight:600!important;
  letter-spacing:.12em!important;
}

/* ============================================================
   DETALLE: estructura común
   R3 JS crea .pt-r3-detail-shell y mueve el botón X fuera del
   panel. La X ya NO puede ser recortada por overflow del panel.
   ============================================================ */

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail[hidden]{
  display:none!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail{
  position:fixed!important;
  inset:0!important;
  z-index:999998!important;

  display:flex!important;

  padding:0!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-bg{
  position:absolute!important;
  inset:0!important;

  border:0!important;

  background:rgba(5,47,94,.16)!important;

  backdrop-filter:blur(5px)!important;
  -webkit-backdrop-filter:blur(5px)!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-detail-shell{
  position:relative!important;
  z-index:2!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-panel{
  background:#FFFFFF!important;

  overscroll-behavior:contain!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-close{
  z-index:8!important;

  display:grid!important;
  place-items:center!important;

  border:1px solid var(--pt-r3-line)!important;
  border-radius:50%!important;

  background:#FFFFFF!important;
  color:var(--pt-r3-navy)!important;

  box-shadow:0 14px 32px rgba(5,47,94,.14)!important;

  font-size:24px!important;
  line-height:1!important;
  font-weight:400!important;

  cursor:pointer!important;

  visibility:visible!important;
  opacity:1!important;
}

/* Bloque cliente */

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-card{
  display:flex!important;
  align-items:flex-start!important;
  gap:16px!important;

  margin:16px 0 20px!important;
  padding:18px!important;

  border:1px solid var(--pt-r3-line)!important;
  border-radius:22px!important;

  background:#FAFCFD!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-avatar{
  flex:0 0 58px!important;

  width:58px!important;
  height:58px!important;

  display:grid!important;
  place-items:center!important;

  border-radius:50%!important;

  background:#EEF4FB!important;
  color:var(--pt-r3-navy)!important;

  font-size:24px!important;
  font-weight:700!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-copy{
  min-width:0!important;
  flex:1!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-kicker{
  display:block!important;

  margin:0 0 5px!important;

  color:#7C8E9F!important;

  font-size:10px!important;
  font-weight:700!important;
  letter-spacing:.12em!important;
  text-transform:uppercase!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-name{
  margin:0!important;

  color:var(--pt-r3-navy)!important;

  font-size:24px!important;
  line-height:1.08!important;
  font-weight:700!important;
  letter-spacing:-.04em!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-sub{
  margin:7px 0 0!important;

  color:var(--pt-r3-muted)!important;

  font-size:13px!important;
  line-height:1.5!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;

  margin-top:14px!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-action{
  min-height:38px!important;

  padding:0 14px!important;

  border:1px solid var(--pt-r3-line-strong)!important;
  border-radius:999px!important;

  background:#FFFFFF!important;
  color:var(--pt-r3-navy)!important;

  font-size:11px!important;
  font-weight:500!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-status{
  min-height:30px!important;

  padding:0 10px!important;

  font-size:10px!important;
  font-weight:600!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta{
  margin-top:16px!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta div{
  padding:14px 0!important;

  border-bottom:1px solid var(--pt-r3-line)!important;
  border-radius:0!important;

  background:transparent!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta span{
  display:block!important;

  margin-bottom:5px!important;

  color:#7C8E9F!important;

  font-size:10px!important;
  font-weight:500!important;
  letter-spacing:.04em!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta strong{
  color:var(--pt-r3-navy)!important;

  font-size:14px!important;
  line-height:1.4!important;
  font-weight:500!important;
}

body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-note{
  margin-top:18px!important;
  padding:16px 0!important;

  border-top:1px solid var(--pt-r3-line)!important;
  border-bottom:1px solid var(--pt-r3-line)!important;

  color:var(--pt-r3-muted)!important;

  font-size:13px!important;
  line-height:1.6!important;
}

/* ============================================================
   DESKTOP
   ============================================================ */

@media(min-width:821px){

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail{
    align-items:stretch!important;
    justify-content:flex-end!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-detail-shell{
    width:min(620px,46vw)!important;
    height:calc(100dvh - 44px)!important;

    margin:22px 26px 22px 0!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-panel{
    width:100%!important;
    height:100%!important;
    max-height:none!important;

    margin:0!important;
    padding:28px 28px 32px!important;

    overflow:auto!important;

    border:1px solid var(--pt-r3-line)!important;
    border-radius:30px!important;

    box-shadow:0 24px 64px rgba(5,47,94,.16)!important;
  }

  /*
   * El botón es hermano del panel dentro del shell.
   * El shell NO tiene overflow, así que la burbuja sí sale fuera.
   */
  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-close{
    position:absolute!important;

    top:0!important;
    left:-60px!important;
    right:auto!important;

    width:46px!important;
    height:46px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:0 22px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta div{
    min-height:78px!important;
  }
}

/* ============================================================
   MÓVIL
   ============================================================ */

@media(max-width:820px){

  body.pt-agenda-r3{
    overflow-x:hidden!important;
  }

  body.pt-agenda-r3 .x-main{
    padding-left:0!important;
    padding-right:0!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1{
    width:100%!important;

    padding:
      32px
      0
      calc(104px + env(safe-area-inset-bottom))!important;
  }

  /* Cabecera de módulo */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-top{
    margin:0!important;
    padding:14px 18px 16px!important;

    display:block!important;

    background:#F7F9FB!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-top h1{
    font-size:26px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-top p{
    display:none!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions{
    margin-top:14px!important;

    justify-content:flex-start!important;
  }

  /*
   * Ya existe + Nueva cita en el bottom nav móvil.
   * Evita duplicar el CTA.
   */
  body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions .pc-manual-open{
    display:none!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-actions a{
    min-height:40px!important;

    padding:0 13px!important;

    font-size:11px!important;
  }

  /* Toolbar: respirada, sin mover nodos */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-toolbar{
    margin:0!important;
    padding:14px 18px 16px!important;

    display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    align-items:center!important;
    gap:12px 10px!important;

    border-top:1px solid var(--pt-r3-line)!important;
    border-bottom:1px solid var(--pt-r3-line)!important;

    background:#F7F9FB!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-title{
    grid-column:1 / -1!important;
    grid-row:1!important;

    font-size:20px!important;

    text-align:left!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav{
    grid-column:1!important;
    grid-row:2!important;

    justify-content:flex-start!important;
    gap:5px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav a{
    min-width:36px!important;
    min-height:38px!important;
    padding:0 9px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav a:nth-child(2){
    min-width:56px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs{
    grid-column:2!important;
    grid-row:2!important;
    justify-self:end!important;

    width:min(100%,180px)!important;

    margin:0!important;

    justify-content:stretch!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs a{
    flex:1 1 0!important;

    min-width:0!important;
    min-height:38px!important;

    padding:0 8px!important;

    font-size:10.5px!important;
  }

  /* Semáforo */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-semaphore{
    margin:0!important;
    padding:10px 14px!important;

    border-top:0!important;

    background:#FFFFFF!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-sem{
    min-height:27px!important;

    font-size:9.5px!important;
  }

  /* ----------------------------------------------------------
     EXACTAMENTE 3px de margen sólo al calendario
     ---------------------------------------------------------- */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card{
    width:calc(100% - 6px)!important;

    margin-left:3px!important;
    margin-right:3px!important;

    border-left:1px solid var(--pt-r3-line)!important;
    border-right:1px solid var(--pt-r3-line)!important;
    border-radius:10px!important;
  }

  /* ----------------------------------------------------------
     DÍA
     SIN scroll horizontal.
     Header real sticky.
     ---------------------------------------------------------- */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-day{
    overflow:visible!important;

    max-width:calc(100% - 6px)!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-day > *{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-day .pc-grid-head,
  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-day .pc-allday-row{
    grid-template-columns:
      52px
      minmax(0,1fr)!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-day .pc-grid-head{
    position:sticky!important;

    top:calc(72px + env(safe-area-inset-top))!important;
    z-index:44!important;

    background:#FFFFFF!important;
  }

  /* ----------------------------------------------------------
     SEMANA
     Un solo scroller horizontal real: .pc-scroll.
     La página/body conserva el scroll vertical.
     SIN sticky, SIN host, SIN clones.
     ---------------------------------------------------------- */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-week{
    /*
     * La card vuelve a ser sólo marco visual.
     * NO debe ser un segundo scroller.
     */
    overflow:hidden!important;

    height:auto!important;
    max-height:none!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-week .pc-scroll{
    /*
     * ÉSTE es el único scroller horizontal de Semana.
     * El CSS histórico ya usaba .pc-scroll{overflow:auto};
     * aquí lo reducimos al eje horizontal.
     */
    width:100%!important;
    max-width:100%!important;

    overflow-x:auto!important;
    overflow-y:hidden!important;

    height:auto!important;
    max-height:none!important;

    -webkit-overflow-scrolling:auto!important;

    overscroll-behavior:auto!important;
    touch-action:auto!important;

    scrollbar-width:thin!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-week .pc-week-inner{
    /*
     * El ancho vive en el contenido, no en la card ni en pc-scroll.
     * 56px rail + 7×112px = 840px.
     */
    width:840px!important;
    min-width:840px!important;
    max-width:none!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-week .pc-grid-head{
    position:relative!important;
    top:auto!important;
    z-index:12!important;

    display:grid!important;

    grid-template-columns:
      56px
      repeat(7,112px)!important;

    background:#FFFFFF!important;

    box-shadow:0 1px 0 rgba(5,47,94,.085)!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-week .pc-allday-row,
  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-week .pc-grid-body{
    grid-template-columns:
      56px
      repeat(7,112px)!important;
  }

  /* ----------------------------------------------------------
     MES
     Conserva scroll horizontal.
     ---------------------------------------------------------- */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-month{
    overflow-x:auto!important;
    overflow-y:clip!important;

    height:auto!important;
    max-height:none!important;

    -webkit-overflow-scrolling:touch!important;

    overscroll-behavior:auto!important;

    touch-action:pan-x pan-y!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-card-month .pc-month{
    width:840px!important;
    min-width:840px!important;
    max-width:none!important;
  }

  /* Citas móviles */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-event{
    padding:7px!important;

    border-radius:7px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-event strong{
    font-size:11px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-event span{
    font-size:9px!important;
  }

  /* ----------------------------------------------------------
     DETALLE = bottom sheet
     ---------------------------------------------------------- */

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail{
    align-items:flex-end!important;
    justify-content:stretch!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-detail-shell{
    width:100%!important;
    max-height:88dvh!important;

    margin:0!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-panel{
    width:100%!important;
    max-width:none!important;
    max-height:88dvh!important;

    margin:0!important;
    padding:
      30px
      20px
      calc(28px + env(safe-area-inset-bottom))!important;

    overflow:auto!important;

    border:0!important;
    border-radius:28px 28px 0 0!important;

    box-shadow:0 -18px 50px rgba(5,47,94,.14)!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-panel::before{
    content:""!important;

    display:block!important;

    width:42px!important;
    height:4px!important;

    margin:-17px auto 18px!important;

    border-radius:999px!important;

    background:#D7E0E7!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-close{
    position:absolute!important;

    top:14px!important;
    right:16px!important;
    left:auto!important;

    width:42px!important;
    height:42px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-card{
    margin-top:12px!important;
    padding:16px!important;

    border-radius:20px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-avatar{
    flex-basis:52px!important;

    width:52px!important;
    height:52px!important;

    font-size:21px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pt-r3-client-name{
    font-size:20px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-detail-meta{
    display:block!important;
  }

  body.pt-agenda-r3.pt-r3-detail-open{
    overflow:hidden!important;
  }
}

@media(max-width:390px){

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-top{
    padding-left:16px!important;
    padding-right:16px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-toolbar{
    padding-left:14px!important;
    padding-right:14px!important;
    gap:10px 8px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav a{
    min-width:34px!important;
    min-height:36px!important;
    padding:0 7px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-nav a:nth-child(2){
    min-width:52px!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs{
    width:min(100%,168px)!important;
  }

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-tabs a{
    min-height:36px!important;
    padding:0 6px!important;
    font-size:10px!important;
  }
}

@media(prefers-reduced-motion:reduce){

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-event{
    transition:none!important;
  }
}

/* ============================================================
   PATYTA PRO · AGENDA APP R3.3
   Conserva el offset superior móvil de R3.2.
   Semana ya quedó consolidada en su bloque principal.
   ============================================================ */

@media(max-width:820px){

  body.pt-agenda-r3 .patyta-calendar-r1 .pc-top{
    margin-top:24px!important;
  }
}


/* ============================================================
   PATYTA PRO · AGENDA APP R3.4
   Ajuste exclusivo móvil: listas operativas con margen lateral.
   ============================================================ */

@media(max-width:820px){

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-today-ops-r1{
    width:calc(100% - 6px)!important;

    margin-left:3px!important;
    margin-right:3px!important;

    border-left:1px solid rgba(5,47,94,.085)!important;
    border-right:1px solid rgba(5,47,94,.085)!important;
    border-radius:12px!important;

    overflow:hidden!important;
  }

  /*
   * Si la operación del día usa un contenedor de lista propio,
   * mantenemos también el contenido respirando 3px.
   */
  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-today-list-r1{
    margin-left:3px!important;
    margin-right:3px!important;
  }
}


/* ============================================================
   PATYTA PRO · AGENDA APP R3.5
   FIX REAL de Lista operativa móvil.
   R3.4 tocó pc-today-ops-r1; la lista de la captura vive en
   pc-request-section.
   ============================================================ */

@media(max-width:820px){

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-request-section{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    margin-left:0!important;
    margin-right:0!important;

    padding-left:16px!important;
    padding-right:16px!important;

    box-sizing:border-box!important;

    overflow-x:hidden!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-request-head{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    box-sizing:border-box!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-request-head > *{
    min-width:0!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-request-section .x-list{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-request-section .x-row{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;

    box-sizing:border-box!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-request-section .x-row > *{
    min-width:0!important;
  }
}


/* ============================================================
   PATYTA PRO · AGENDA APP R3.6
   Settings gear real en header.
   ============================================================ */

body.pt-agenda-r3
.patyta-calendar-r1
.pc-heading-r36{
  min-width:0!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-title-row-r36{
  min-width:0!important;

  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-title-row-r36 h1{
  min-width:0!important;
  margin-right:0!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-settings-trigger-r36{
  flex:0 0 40px!important;

  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  min-height:40px!important;

  margin-top:2px!important;

  border-color:rgba(5,47,94,.11)!important;

  background:#FFFFFF!important;
  color:#052F5E!important;

  box-shadow:0 7px 18px rgba(5,47,94,.07)!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-settings-trigger-r36:hover{
  background:#F4F8FB!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-settings-trigger-r36 svg{
  width:20px!important;
  height:20px!important;
}

.pc-settings-popover-r36{
  min-width:244px!important;
  padding:7px!important;
}

.pc-settings-popover-r36
.pt-popover__item{
  min-height:52px!important;
  gap:12px!important;
  padding:7px 11px!important;
}

.pc-settings-popover-r36
.pt-popover__item > svg{
  flex:0 0 34px;

  width:34px;
  height:34px;

  padding:7px;

  border-radius:10px;

  background:#F3F7FA;
  color:#052F5E;

  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.pc-settings-popover-r36
.pt-popover__item-copy{
  min-width:0;
  display:block;
}

.pc-settings-popover-r36
.pt-popover__item-copy strong{
  display:block;

  color:#052F5E;

  font-size:13px;
  line-height:1.25;
  font-weight:600;
}

.pc-settings-popover-r36
.pt-popover__item-copy small{
  display:block;

  margin-top:2px;

  color:#74869A;

  font-size:10.5px;
  line-height:1.35;
  font-weight:400;
}

/* Móvil: Nueva cita ya vive en bottom nav, por lo que pc-actions
   no necesita ocupar una fila vacía. */
@media(max-width:820px){

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-actions{
    display:none!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-title-row-r36{
    gap:8px!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-settings-trigger-r36{
    flex-basis:36px!important;

    width:36px!important;
    height:36px!important;
    min-width:36px!important;
    min-height:36px!important;

    margin-top:0!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-settings-trigger-r36 svg{
    width:18px!important;
    height:18px!important;
  }

  .pc-settings-popover-r36{
    min-width:232px!important;
  }
}

@media(max-width:360px){

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-title-row-r36 h1{
    font-size:24px!important;
  }
}

/* ============================================================
   PATYTA PRO · AGENDA APP R3.7 FIX1
   Engrane reconocible + popover.
   ============================================================ */

body.pt-agenda-r3
.patyta-calendar-r1
.pc-heading-r37{
  min-width:0!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-title-row-r37{
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-title-row-r37 h1{
  min-width:0!important;
  margin-right:0!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-settings-trigger-r37{
  flex:0 0 42px!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  min-height:42px!important;

  display:grid!important;
  place-items:center!important;

  padding:0!important;

  border:1px solid rgba(5,47,94,.12)!important;
  border-radius:50%!important;

  background:#FFFFFF!important;
  color:#052F5E!important;

  box-shadow:0 10px 24px rgba(5,47,94,.08)!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-settings-trigger-r37:hover{
  background:#F4F8FB!important;
  transform:translateY(-1px)!important;
}

body.pt-agenda-r3
.patyta-calendar-r1
.pc-settings-trigger-r37 svg{
  width:23px!important;
  height:23px!important;

  display:block!important;

  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.9!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

.pc-settings-popover-r37{
  min-width:250px!important;
  padding:7px!important;
}

.pc-settings-popover-r37
.pt-popover__item{
  min-height:54px!important;
  gap:12px!important;
  padding:8px 11px!important;
}

.pc-settings-popover-r37
.pt-popover__item > svg{
  flex:0 0 34px;

  width:34px;
  height:34px;

  padding:7px;

  border-radius:10px;

  background:#F3F7FA;
  color:#052F5E;

  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.pc-settings-popover-r37
.pt-popover__item-copy{
  display:block;
  min-width:0;
}

.pc-settings-popover-r37
.pt-popover__item-copy strong{
  display:block;

  color:#052F5E;

  font-size:13px;
  line-height:1.25;
  font-weight:700;
}

.pc-settings-popover-r37
.pt-popover__item-copy small{
  display:block;

  margin-top:2px;

  color:#74869A;

  font-size:10.5px;
  line-height:1.35;
  font-weight:400;
}

@media(max-width:820px){

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-actions{
    display:none!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-title-row-r37{
    gap:8px!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-settings-trigger-r37{
    flex-basis:38px!important;

    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
  }

  body.pt-agenda-r3
  .patyta-calendar-r1
  .pc-settings-trigger-r37 svg{
    width:21px!important;
    height:21px!important;
  }

  .pc-settings-popover-r37{
    min-width:234px!important;
  }
}
