/* stage-50-schedule-cards-polish */

#entryModal[data-action="schedule"][data-mode="list"] .modal-panel {
  width: min(940px, calc(100vw - 28px));
  border-color: color-mix(in srgb, var(--label-schedule, #5f9073) 18%, var(--glass-border));
  background:
    radial-gradient(circle at 8% -8%, color-mix(in srgb, var(--label-schedule, #5f9073) 15%, transparent), transparent 19rem),
    radial-gradient(circle at 100% 8%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 18rem),
    linear-gradient(145deg, color-mix(in srgb, var(--glass-elevated) 76%, transparent), color-mix(in srgb, var(--glass-surface) 96%, transparent));
}

#entryModal[data-action="schedule"][data-mode="list"] .modal-fields {
  gap: clamp(14px, 1.8vw, 20px);
}

#entryModal[data-action="schedule"][data-mode="list"] .managed-shell-schedule {
  gap: clamp(14px, 1.8vw, 18px);
}

#entryModal[data-action="schedule"][data-mode="list"] .managed-head {
  margin: 0;
}

.schedule-managed-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: stretch;
  border: 1px solid color-mix(in srgb, var(--label-schedule, #5f9073) 16%, var(--glass-border));
  border-radius: 28px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--label-schedule, #5f9073) 13%, transparent), transparent 17rem),
    linear-gradient(145deg, color-mix(in srgb, var(--glass-elevated) 58%, transparent), color-mix(in srgb, var(--glass-surface) 92%, transparent));
  box-shadow:
    var(--focus-shadow),
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: clamp(14px, 1.8vw, 18px);
}

.schedule-managed-head::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, color-mix(in srgb, #fff 18%, transparent), transparent 38%),
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 16rem);
  content: "";
  pointer-events: none;
  z-index: -1;
}

.schedule-section-hero {
  gap: 12px;
}

.schedule-section-copy {
  gap: 5px;
}

.schedule-section-copy span {
  color: color-mix(in srgb, var(--label-schedule, #5f9073) 78%, var(--muted-strong));
  font-size: 0.78rem;
  font-weight: 780;
}

.schedule-section-copy p {
  max-width: 54ch;
  color: var(--text);
  font-size: clamp(1.03rem, 1.35vw, 1.2rem);
  font-weight: 720;
  letter-spacing: 0;
}

.schedule-section-stats {
  gap: 9px;
}

.schedule-section-stat {
  min-width: 88px;
  border-color: color-mix(in srgb, var(--label-schedule, #5f9073) 13%, var(--glass-border));
  border-radius: 18px;
  background:
    radial-gradient(circle at 24% 0%, color-mix(in srgb, #fff 20%, transparent), transparent 58%),
    color-mix(in srgb, var(--glass-surface) 78%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
}

.schedule-filter-bar {
  gap: 8px;
}

.schedule-filter-chip {
  min-height: 36px;
  border-color: color-mix(in srgb, var(--label-schedule, #5f9073) 14%, var(--glass-border));
  background:
    radial-gradient(circle at 24% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 58%),
    color-mix(in srgb, var(--glass-surface) 78%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
}

.schedule-add-button {
  min-height: 44px;
  border-radius: 18px;
  box-shadow:
    var(--shadow-xs),
    0 12px 28px color-mix(in srgb, var(--label-schedule, #5f9073) 12%, transparent);
}

.schedule-records-list {
  display: grid;
  gap: 12px;
}

.schedule-entry-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 14px;
  row-gap: 10px;
  overflow: hidden;
  min-height: 144px;
  border: 1px solid color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 18%, var(--glass-border));
  border-radius: 26px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 15%, transparent), transparent 16rem),
    linear-gradient(145deg, color-mix(in srgb, var(--glass-elevated) 58%, transparent), color-mix(in srgb, var(--glass-surface) 94%, transparent));
  box-shadow:
    var(--focus-shadow),
    inset 0 1px 0 color-mix(in srgb, #fff 17%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 18px 18px 16px 24px;
  transition:
    border-color var(--motion-standard),
    box-shadow var(--motion-standard),
    transform var(--motion-fast),
    background var(--motion-standard);
}

.schedule-entry-card::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, color-mix(in srgb, #fff 18%, transparent), transparent 36%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 11%, transparent), transparent 15rem);
  content: "";
  opacity: 0.82;
  pointer-events: none;
  z-index: -1;
}

.schedule-entry-card::after {
  inset: 18px auto 18px 11px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--schedule-entry-color, var(--label-schedule, #5f9073)), color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 26%, transparent));
  box-shadow: 0 0 22px color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 32%, transparent);
}

.schedule-entry-card:is(:hover, :focus-visible) {
  border-color: color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 38%, var(--glass-border));
  box-shadow:
    var(--focus-shadow),
    0 18px 42px color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 14%, transparent),
    var(--focus-glow);
  transform: translateY(-2px);
}

.schedule-entry-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.schedule-entry-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.05rem, 1.45vw, 1.24rem);
  font-weight: 780;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-entry-toggle {
  display: inline-grid;
  grid-template-columns: auto auto;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-color: color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 20%, var(--glass-border));
  border-radius: 999px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--glass-elevated) 50%, transparent), color-mix(in srgb, var(--glass-surface) 86%, transparent));
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
  padding: 6px 8px 6px 12px;
}

.schedule-entry-toggle span {
  font-size: 0.82rem;
  font-weight: 780;
}

.schedule-entry-toggle i {
  width: 42px;
  height: 24px;
}

.schedule-entry-toggle i::before {
  width: 16px;
  height: 16px;
}

.schedule-entry-toggle input:checked + i::before {
  transform: translateX(18px);
}

.schedule-entry-meta {
  grid-column: 1;
  gap: 7px;
}

.schedule-entry-kind-pill,
.schedule-entry-status-pill {
  min-height: 28px;
  border-color: color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 14%, var(--glass-border));
  background: color-mix(in srgb, var(--glass-surface) 74%, transparent);
  font-size: 0.76rem;
  padding-inline: 10px;
}

.schedule-entry-subtitle {
  grid-column: 1;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 650;
}

.schedule-entry-overview {
  grid-column: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.schedule-entry-overview span {
  min-height: 54px;
  border-color: color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 12%, var(--glass-border));
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, #fff 16%, transparent), transparent 58%),
    color-mix(in srgb, var(--glass-surface) 74%, transparent);
  padding: 9px 10px;
}

.schedule-entry-overview small {
  color: var(--muted);
}

.schedule-entry-overview strong {
  color: var(--text);
}

.schedule-entry-actions {
  grid-column: 2;
  grid-row: 2 / span 5;
  align-self: start;
  justify-self: end;
  margin-top: 0;
}

.schedule-entry-card .item-actions {
  gap: 6px;
  border-color: color-mix(in srgb, var(--schedule-entry-color, var(--label-schedule, #5f9073)) 17%, var(--glass-border));
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 56%),
    color-mix(in srgb, var(--glass-surface) 78%, transparent);
  box-shadow: var(--shadow-xs), inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
}

.schedule-entry-card .icon-action {
  width: 39px;
  min-width: 39px;
  height: 39px;
  min-height: 39px;
  border-radius: 14px;
}

.schedule-entry-card.is-paused {
  opacity: 0.86;
}

.schedule-empty {
  min-height: 150px;
  border-color: color-mix(in srgb, var(--label-schedule, #5f9073) 20%, var(--glass-border));
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--label-schedule, #5f9073) 10%, transparent), transparent 17rem),
    color-mix(in srgb, var(--glass-surface) 72%, transparent);
  box-shadow: var(--focus-shadow), inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

@media (max-width: 760px) {
  #entryModal[data-action="schedule"][data-mode="list"] .modal-panel {
    width: min(100vw - 14px, 620px);
  }

  .schedule-managed-head {
    grid-template-columns: 1fr;
    border-radius: 24px;
    padding: 14px;
  }

  .schedule-section-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-filter-chip {
    min-height: 34px;
    font-size: 0.8rem;
  }

  .schedule-entry-card {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 24px;
    row-gap: 9px;
    padding: 16px 15px 15px 22px;
  }

  .schedule-entry-head,
  .schedule-entry-meta,
  .schedule-entry-subtitle,
  .schedule-entry-overview,
  .schedule-entry-actions {
    grid-column: 1;
  }

  .schedule-entry-head {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .schedule-entry-head strong {
    white-space: normal;
  }

  .schedule-entry-toggle {
    justify-self: start;
  }

  .schedule-entry-overview {
    grid-template-columns: 1fr;
  }

  .schedule-entry-actions {
    grid-row: auto;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .schedule-managed-head,
  .schedule-filter-chip,
  .schedule-entry-card,
  .schedule-entry-card .icon-action {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .schedule-entry-card:is(:hover, :focus-visible) {
    transform: none;
  }
}
