/*
 * Jadwal Aset: Kalender Aset (grid sesi) dan Kalender Bulanan.
 * Desain: docs/SIMARISA_Enterprise_Preview.html layar 36–43.
 */

.dspr-jadwal {
  --jd-primary: #b92335;
  --jd-primary-soft: #fcecef;
  --jd-text: #17212f;
  --jd-text-2: #344054;
  --jd-muted: #667085;
  --jd-line: #e2e7ed;
  --jd-surface: #ffffff;
  --jd-surface-2: #f5f7fa;
  --jd-free: #18744f;
  --jd-free-soft: #eaf6ef;
  --jd-free-line: #bddac7;
  --jd-booked: #234d76;
  --jd-booked-soft: #e0ecf7;
  color: var(--jd-text);
  font-size: 14px;
  padding: 28px 0 48px;
}

.dspr-jadwal button {
  cursor: pointer;
  font: inherit;
}

.dspr-jadwal button:focus-visible,
.dspr-jadwal input:focus-visible,
.dspr-jadwal select:focus-visible {
  outline: 2px solid var(--jd-primary);
  outline-offset: 2px;
}

.dspr-jadwal button:disabled {
  cursor: default;
  opacity: 0.5;
}

.jd-breadcrumb {
  font-size: 12px;
  color: var(--jd-muted);
  margin: 0 0 20px;
}

.jd-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 28px;
}

.jd-heading h1 {
  font-size: 30px;
  letter-spacing: -0.35px;
  margin: 0 0 12px;
  color: var(--jd-text);
}

.jd-subtitle {
  color: var(--jd-muted);
  margin: 0;
  line-height: 1.5;
}

.jd-badge {
  background: #f0f3f7;
  color: var(--jd-muted);
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.jd-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--jd-surface);
  border: 1px solid var(--jd-line);
  color: var(--jd-text-2);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.jd-btn:hover:not(:disabled) {
  background: var(--jd-surface-2);
}

.jd-btn.primary {
  background: var(--jd-primary);
  border-color: var(--jd-primary);
  color: #fff;
}

.jd-btn.primary:hover:not(:disabled) {
  background: #a01e2e;
}

.jd-icon-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 38px;
  font-size: 24px;
  line-height: 1;
  color: var(--jd-muted);
  padding: 0;
  border-radius: 6px;
}

.jd-icon-btn:hover:not(:disabled) {
  background: var(--jd-surface-2);
}

/* Opsi tampilan */
.jd-options {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.jd-option {
  height: 42px;
  min-width: 200px;
  border: 1px solid var(--jd-line);
  border-radius: 6px;
  color: var(--jd-text-2);
  background: var(--jd-surface);
  font-weight: 600;
  padding: 0 16px;
}

.jd-option.active {
  background: var(--jd-primary);
  border-color: var(--jd-primary);
  color: #fff;
}

.jd-link {
  margin-left: auto;
  color: var(--jd-primary);
  font-weight: 600;
  font-size: 13px;
}

/* Kartu kalender */
.jd-card {
  border: 1px solid var(--jd-line);
  border-radius: 10px;
  background: var(--jd-surface);
  overflow: hidden;
}

.jd-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--jd-line);
  flex-wrap: wrap;
}

.jd-venue {
  min-width: 240px;
  max-width: 320px;
  height: 42px;
  font-weight: 600;
}

.jd-date {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 0 4px;
  cursor: pointer;
  flex: 1;
  min-width: 220px;
}

.jd-date i {
  font-size: 14px;
  color: var(--jd-muted);
}

.jd-date input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.jd-filter-strip {
  display: flex;
  gap: 16px 28px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--jd-line);
  flex-wrap: wrap;
}

.jd-filters {
  display: flex;
  gap: 10px 24px;
  flex-wrap: wrap;
}

.jd-asset-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--jd-text-2);
  margin: 0;
  cursor: pointer;
}

.jd-asset-filter input {
  accent-color: var(--asset);
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}

.jd-legend {
  margin-left: auto;
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--jd-muted);
  align-items: center;
}

.jd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.jd-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--jd-surface);
  border: 1px solid #b6d9c3;
}

.jd-swatch.booked {
  background: var(--jd-booked-soft);
  border-color: var(--jd-booked-soft);
}

.jd-swatch.selected {
  background: var(--jd-free-soft);
  border: 1.5px solid var(--jd-free);
}

.jd-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--asset);
  flex-shrink: 0;
}

/* Grid sesi */
.jd-schedule-wrap {
  padding: 10px 20px 24px;
  overflow: auto;
}

.jd-grid {
  display: grid;
}

.jd-grid.lanes {
  grid-template-columns: 120px repeat(var(--cols), minmax(170px, 1fr));
}

.jd-grid.matrix {
  grid-template-columns: 220px repeat(var(--cols), minmax(150px, 1fr));
}

.jd-grid.week {
  grid-template-columns: 84px repeat(7, minmax(140px, 1fr));
}

.jd-corner {
  color: var(--jd-muted);
  padding: 16px 12px;
  font-size: 11px;
  line-height: 1.6;
  border-bottom: 1px solid var(--jd-line);
}

.jd-head {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--jd-line);
  border-right: 1px solid var(--jd-line);
  min-width: 0;
}

.jd-head strong {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  line-height: 1.35;
}

.jd-head small {
  display: block;
  margin: 6px 0 0 20px;
  font-size: 11px;
  color: var(--jd-muted);
}

.jd-head.session {
  text-align: center;
  font-size: 11px;
  color: var(--jd-muted);
}

.jd-head.session strong {
  justify-content: center;
  font-size: 13px;
  color: var(--jd-text);
  margin-bottom: 4px;
}

.jd-head.day {
  padding: 6px 4px;
}

.jd-head.day button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--jd-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.jd-head.day button:hover {
  background: var(--jd-surface-2);
}

.jd-head.day span {
  font-size: 12px;
  color: var(--jd-muted);
}

.jd-head.day b {
  font-size: 22px;
}

.jd-head.day.focus button {
  background: var(--jd-primary-soft);
  color: var(--jd-primary);
}

.jd-head.day.focus span {
  color: var(--jd-primary);
  font-weight: 600;
}

.jd-time {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  padding: 0 12px;
  border-bottom: 1px solid var(--jd-line);
}

.jd-time small {
  font-size: 12px;
  font-weight: 400;
  color: var(--jd-muted);
}

.jd-cell {
  border-bottom: 1px solid var(--jd-line);
  border-right: 1px solid var(--jd-line);
  padding: 8px;
  min-width: 0;
}

.jd-grid.week .jd-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
}

.jd-slot {
  width: 100%;
  min-height: 68px;
  height: 100%;
  text-align: left;
  border: 1px solid #d7e6dd;
  border-radius: 6px;
  background: var(--jd-surface);
  padding: 8px 12px;
  color: var(--jd-text);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.jd-slot-top {
  font-size: 11px;
  font-weight: 600;
  color: var(--asset);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jd-slot-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.jd-slot-time {
  font-size: 12px;
  color: var(--asset);
}

.jd-slot.booked {
  border: 0;
  border-left: 3px solid var(--asset);
  background: var(--asset-bg);
}

.jd-slot.booked:hover {
  box-shadow: 0 0 0 1px var(--asset);
}

.jd-slot.free {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  color: var(--jd-free);
}

.jd-slot.free:hover {
  box-shadow: 0 0 0 1px #b6d9c3;
}

.jd-slot.free .jd-pick {
  margin-left: auto;
  color: var(--jd-muted);
  font-size: 12px;
  white-space: nowrap;
}

.jd-slot.selected {
  background: var(--jd-free-soft);
  border: 1.5px solid var(--jd-free);
}

.jd-slot.past {
  background: var(--jd-surface-2);
  border-color: var(--jd-line);
  color: #98a2b3;
  justify-content: center;
  font-size: 12px;
}

.jd-check {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Slot kecil (tampilan mingguan) */
.jd-slot.mini {
  min-height: 34px;
  height: auto;
  padding: 3px 7px;
  gap: 1px;
  border-radius: 4px;
  flex-direction: column;
  align-items: stretch;
  font-size: 11px;
}

.jd-slot.mini .jd-slot-top {
  font-size: 10.5px;
}

.jd-slot.mini .jd-slot-label {
  font-size: 11px;
  font-weight: 400;
}

.jd-slot.mini.free .jd-slot-top {
  color: var(--jd-free);
}

.jd-slot.mini.free .jd-slot-label {
  color: var(--jd-muted);
}

.jd-slot.mini.booked {
  border-left-width: 2px;
}

.jd-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--jd-muted);
  font-size: 15px;
}

.jd-error {
  color: var(--jd-primary);
}

/* Pilihan dan petunjuk */
.jd-selection {
  background: var(--jd-free-soft);
  color: var(--jd-free);
  border: 1px solid var(--jd-free-line);
  border-radius: 7px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.jd-selection[hidden] {
  display: none;
}

.jd-selection-text {
  flex: 1;
  min-width: 240px;
  font-size: 13px;
  line-height: 1.6;
}

.jd-selection-text strong {
  display: block;
  font-size: 14px;
}

.jd-selection-text .jd-warn {
  display: block;
  color: var(--jd-primary);
  margin-top: 4px;
}

.jd-selection .jd-btn:not(.primary) {
  color: var(--jd-free);
  border-color: var(--jd-free-line);
}

.jd-hint {
  background: #edf2f7;
  border-radius: 7px;
  padding: 16px 20px;
  margin: 20px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--jd-text-2);
  line-height: 1.6;
}

.jd-hint i {
  color: #365a86;
  font-size: 18px;
  line-height: 22px;
}

/* Dialog detail */
.jd-status {
  display: inline-block;
  border-radius: 5px;
  background: var(--jd-booked-soft);
  color: var(--jd-booked);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  margin-bottom: 14px;
}

.jd-details {
  display: grid;
  gap: 16px;
  margin: 0;
}

.jd-details dt {
  font-size: 12px;
  color: var(--jd-muted);
  font-weight: 400;
  margin-bottom: 4px;
}

.jd-details dd {
  margin: 0;
  font-size: 14px;
  color: var(--jd-text);
}

.jd-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--jd-muted);
  margin: 18px 0 0;
}

/* Kalender bulanan */
.jd-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.jd-sidebar {
  padding: 24px 20px;
  border-right: 1px solid var(--jd-line);
}

/* flatpickr inline menampilkan input tanggalnya; kalender sudah cukup */
.jd-sidebar > .flatpickr-input {
  display: none !important;
}

.jd-sidebar .flatpickr-calendar.inline {
  box-shadow: none;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}

.jd-sidebar .flatpickr-day.today {
  border-color: var(--jd-primary);
}

.jd-sidebar .flatpickr-day.selected {
  background: var(--jd-primary);
  border-color: var(--jd-primary);
}

.jd-filter {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--jd-line);
}

.jd-filter label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.jd-filter input {
  margin-bottom: 10px;
}

.jd-legend-box {
  margin-top: 26px;
}

.jd-legend-box h3 {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--jd-muted);
  font-weight: 600;
  margin: 0 0 14px;
}

.jd-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--jd-text-2);
}

.jd-legend-row .jd-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.jd-sidebar-note {
  color: var(--jd-muted);
  font-size: 12px;
  margin: 22px 0 0;
  line-height: 1.6;
}

.jd-main {
  min-width: 0;
  padding: 18px 20px;
}

.jd-main .jd-status-line {
  font-size: 12px;
  color: var(--jd-muted);
  min-height: 18px;
  margin: 0 0 10px;
}

.jd-main .fc .fc-toolbar-title {
  font-size: 20px;
  font-weight: 700;
}

.jd-main .fc .fc-button {
  background: var(--jd-surface);
  border: 1px solid var(--jd-line);
  color: var(--jd-text-2);
  font-weight: 600;
  font-size: 13px;
  box-shadow: none;
  text-transform: none;
}

.jd-main .fc .fc-button:hover {
  background: var(--jd-surface-2);
  color: var(--jd-text-2);
}

.jd-main .fc .fc-button-primary:not(:disabled).fc-button-active,
.jd-main .fc .fc-button-primary:not(:disabled):active {
  background: var(--jd-primary);
  border-color: var(--jd-primary);
  color: #fff;
}

.jd-main .fc .fc-day-today {
  background: #fff8f9;
}

.jd-main .fc .fc-highlight {
  background: var(--jd-free-soft);
}

.jd-main .fc-event.jd-fc-booked {
  background: var(--jd-booked-soft);
  border: 0;
  border-left: 3px solid #35618d;
  color: var(--jd-booked);
  cursor: pointer;
}

.jd-main .fc-event.jd-fc-booked .fc-event-main,
.jd-main .fc-event.jd-fc-booked .fc-event-time,
.jd-main .fc-event.jd-fc-booked .fc-event-title {
  color: var(--jd-booked);
}

.jd-main .fc-daygrid-block-event .fc-event-main-frame {
  min-width: 0;
}

.jd-main .fc-daygrid-block-event .fc-event-time {
  flex-shrink: 0;
}

.jd-main .fc-daygrid-block-event .fc-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.jd-main .fc-timegrid-event.fc-event-mirror {
  background: var(--jd-free-soft);
  border: 1px solid var(--jd-free);
}

.jd-main .fc-timegrid-event.fc-event-mirror .fc-event-main {
  color: var(--jd-free);
}

@media (max-width: 991.98px) {
  .jd-heading {
    flex-direction: column;
  }

  .jd-heading h1 {
    font-size: 24px;
  }

  .jd-option {
    min-width: 0;
    flex: 1 1 auto;
  }

  .jd-link {
    margin-left: 0;
  }

  .jd-venue {
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  .jd-date {
    flex-basis: 100%;
    order: -1;
    font-size: 17px;
    margin: 0;
  }

  .jd-legend {
    margin-left: 0;
  }

  .jd-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .jd-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--jd-line);
  }

  .jd-main .fc .fc-toolbar {
    flex-direction: column;
    gap: 10px;
  }
}
