/* Movimientos recurrentes */

.rc-body { display: grid; gap: 22px; align-content: start; }
.rc-section { display: grid; gap: 0; min-width: 0; }
.rc-section > .section-head { margin-bottom: 12px; }

.rc-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.rc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }

.rc-item {
  display: grid; gap: 10px; min-width: 0; padding: 12px 12px 8px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.rc-item:hover, .rc-item:focus-within { border-color: color-mix(in srgb, var(--violet) 45%, transparent); }
.rc-item.is-paused .rc-main, .rc-item.is-finished .rc-main { opacity: 0.72; }

.rc-main { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-width: 0; }
.rc-text { min-width: 0; }
.rc-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.rc-right { display: grid; justify-items: end; gap: 4px; min-width: 0; }
.rc-right .pill-soft { margin-left: 0; }

.rc-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.rc-next-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rc-date {
  display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 4px 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--input-bg); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.rc-date:not(:has(.icon-btn)) { padding-right: 12px; }
.rc-date .icon-btn { width: 28px; height: 28px; border-radius: 999px; }
.rc-date .icon-btn .icon { width: 15px; height: 15px; }
.rc-date.is-skipped { color: var(--muted); }
.rc-date.is-skipped .rc-date-text { text-decoration: line-through; }

.rc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; opacity: 0.7; transition: opacity 0.12s; }
.rc-item:hover .rc-actions, .rc-item:focus-within .rc-actions { opacity: 1; }
.rc-actions .icon-btn { width: 36px; height: 36px; }
.rc-actions .icon-btn:hover { background: var(--surface-3); }
@media (hover: none) { .rc-actions { opacity: 1; } }

.rc-finished > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.rc-finished > summary::-webkit-details-marker { display: none; }
.rc-finished > summary .icon { color: var(--muted); transition: rotate 0.2s; }
.rc-finished[open] > summary { margin-bottom: 12px; }
.rc-finished[open] > summary .icon { rotate: 180deg; }
.rc-finished > summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 8px; }

/* Cabecera de Movimientos */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Formulario */
.rc-day { display: grid; min-width: 0; }
.rc-day-box { display: grid; gap: 6px; }
.rc-day .seg button { padding: 0 4px; }
.rc-end { display: grid; gap: 12px; align-content: start; min-width: 0; }
.rc-end .check { min-height: 44px; }
.rc-preview-box { display: grid; gap: 8px; }
.rc-preview {
  padding: 10px 14px; border-radius: 12px; background: var(--input-bg); border: 1px dashed var(--line);
  font-size: 14px; font-weight: 600;
}
.rc-preview:empty { display: none; }
.rc-history { font-size: 13px; color: var(--muted); }

@media (max-width: 560px) {
  .rc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-summary > .stat:first-child { grid-column: 1 / -1; }
  .rc-link { padding: 0 12px; }
  .rc-main { gap: 12px; }
}

@media (max-width: 420px) {
  .page-head:has(.head-actions) { grid-template-columns: minmax(0, 1fr); }
  .head-actions { justify-content: flex-start; }
  .head-actions .btn-primary { order: -1; }
}
