/* PATCH UI 4 - Riwayat and Jadwal, scoped to employee portal pages. */
.am-history-page,
.am-schedule-page {
  min-height: 100%;
  padding: 72px 16px 98px !important;
  background: var(--amanda-background, #F8FAFC);
}

.am-history-intro,
.am-schedule-intro { margin: 1px 2px 19px; }
.am-page-eyebrow { display: block; margin-bottom: 5px; color: #881337; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.am-history-intro h1,
.am-schedule-intro h1 { margin: 0; color: #0F172A; font-size: 26px; line-height: 1.2; }
.am-history-intro p,
.am-schedule-intro p { margin: 7px 0 0; color: #64748B; font-size: 13px; line-height: 1.45; }

/* Riwayat */
.am-history-tabs { display: flex; gap: 7px; margin: 0 -16px 18px; padding: 0 16px 3px; overflow-x: auto; scrollbar-width: none; }
.am-history-tabs::-webkit-scrollbar { display: none; }
.am-history-tabs button { flex: 0 0 auto; min-height: 36px; padding: 7px 14px; border: 1px solid #E2E8F0; border-radius: 999px; color: #64748B; background: #fff; font-size: 11px; font-weight: 700; }
.am-history-tabs button.is-active { color: #fff; border-color: #881337; background: #881337; box-shadow: 0 5px 12px rgba(104,66,41,.16); }

.am-history-filter { padding: 17px; border: 1px solid rgba(121,83,55,.1); border-radius: 18px; background: #fff; box-shadow: 0 7px 20px rgba(82,55,37,.06); }
.am-history-filter__heading,
.am-history-results__heading,
.am-schedule-list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.am-history-filter__heading h2,
.am-history-results__heading h2,
.am-schedule-list-heading h2 { margin: 0; color: #0F172A; font-size: 18px; line-height: 1.2; }
.am-history-download { display: inline-flex; min-height: 34px; align-items: center; gap: 5px; padding: 6px 10px; border: 0; border-radius: 10px; color: #881337; background: #FFF1F4; font-size: 11px; font-weight: 700; }
.am-history-download ion-icon { font-size: 16px; }
.am-history-date-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.am-history-date-grid label > span { display: block; margin-bottom: 6px; color: #6b5749; font-size: 11px; font-weight: 700; }
.am-history-date-grid label > div { position: relative; }
.am-history-date-grid .form-control { height: 45px; padding: 9px 34px 9px 11px; border: 1px solid #E2E8F0; border-radius: 11px; color: #4c3d34; background: #FFFFFF; font-size: 12px; }
.am-history-date-grid ion-icon { position: absolute; top: 50%; right: 10px; color: #a27651; font-size: 17px; transform: translateY(-50%); pointer-events: none; }
.am-history-filter__actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 13px; }
.am-history-filter__actions .btn { display: inline-flex; width: 100%; min-width: 0; min-height: 44px; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 9px 12px; border-radius: 11px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.am-history-filter__actions .btn ion-icon { flex: 0 0 auto; font-size: 18px; }
.am-history-apply { color: #fff; border-color: #881337; background: #881337; }
.am-history-reset { color: #7d5436; border: 1px solid #b99b85; background: #fff; }

.am-history-results { margin-top: 23px; }
.am-history-count,
.am-schedule-list-heading > span { color: #9a897e; font-size: 11px; }
.am-history-feed { margin-top: 12px; }
.am-history-skeleton { height: 82px; margin-bottom: 9px; border-radius: 15px; }
.am-history-feed-result { display: block; }
.am-history-timeline { position: relative; display: grid; gap: 9px; }
.am-history-item { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr) auto 16px; gap: 11px; align-items: center; min-height: 83px; padding: 13px 13px 13px 14px; border: 1px solid rgba(121,83,55,.1); border-radius: 16px; color: #0F172A; background: #fff; box-shadow: 0 6px 17px rgba(82,55,37,.055); }
article.am-history-item { grid-template-columns: 42px minmax(0,1fr) auto; }
.am-history-item__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #881337; background: #FFF1F4; }
.am-history-item__icon ion-icon { font-size: 21px; }
.am-history-item__content { display: block; min-width: 0; }
.am-history-item__content > small { display: block; color: #9b8270; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.am-history-item__content > strong { display: block; overflow: hidden; margin-top: 2px; color: #0F172A; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.am-history-item__content > span:not(.am-history-photo-links) { display: block; margin-top: 3px; color: #88796e; font-size: 11px; }
.am-history-item__arrow { color: #b6a79b; font-size: 15px; }
.am-history-photo-links { display: flex; gap: 9px; margin-top: 5px; }
.am-history-photo-links a { color: #881337; font-size: 10px; font-weight: 700; text-decoration: underline; }
.am-history-empty { display: flex; min-height: 220px; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; border: 1px solid rgba(121,83,55,.1); border-radius: 17px; color: #817268; background: #fff; text-align: center; }
.am-history-empty ion-icon { margin-bottom: 11px; color: #b58a65; font-size: 34px; }
.am-history-empty strong { color: #1E293B; font-size: 15px; }
.am-history-empty p { max-width: 270px; margin: 6px 0 0; font-size: 12px; line-height: 1.45; }
.am-history-empty.is-error { border-color: #f0c7cc; background: #fffafa; }
.am-history-retry { margin-top: 13px; padding: 8px 14px; border: 0; border-radius: 10px; color: #fff; background: #881337; font-size: 11px; font-weight: 700; }
.am-history-page #modal-print .modal-content { border-radius: 18px 18px 0 0; }
.am-history-page #modal-print .close { position: static; color: #881337; }

/* Jadwal */
.am-schedule-control { padding: 16px; border: 1px solid rgba(121,83,55,.1); border-radius: 18px; background: #fff; box-shadow: 0 7px 20px rgba(82,55,37,.06); }
.am-schedule-month-form label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.am-schedule-month-form label span { color: #5e493c; font-size: 12px; font-weight: 700; }
.am-schedule-month-form input { width: 166px; height: 42px; padding: 8px 10px; border: 1px solid #E2E8F0; border-radius: 11px; color: #4d3c32; background: #FFFFFF; font-size: 12px; }
.am-schedule-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; margin-top: 13px; padding: 4px; border-radius: 12px; background: #f3eee9; }
.am-schedule-tabs a { display: flex; min-height: 36px; align-items: center; justify-content: center; border-radius: 9px; color: #7e7066; font-size: 11px; font-weight: 700; }
.am-schedule-tabs a.is-active { color: #fff; background: #881337; box-shadow: 0 4px 10px rgba(104,66,41,.16); }
.am-schedule-list-section { margin-top: 23px; }
.am-schedule-list { display: grid; gap: 9px; margin-top: 12px; }
.am-schedule-card { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 78px; padding: 12px 14px; border: 1px solid rgba(121,83,55,.1); border-radius: 16px; background: #fff; box-shadow: 0 6px 17px rgba(82,55,37,.05); }
.am-schedule-card.is-today { border-color: #c39976; background: #fffaf5; box-shadow: 0 7px 18px rgba(112,72,44,.1); }
.am-schedule-card.is-day-off { background: #f8f6f4; }
.am-schedule-card__date { display: flex; width: 48px; height: 52px; flex-direction: column; align-items: center; justify-content: center; border-radius: 13px; color: #704a30; background: #f6ede5; }
.am-schedule-card__date strong { font-size: 18px; line-height: 1; }
.am-schedule-card__date span { margin-top: 5px; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.am-schedule-card.is-day-off .am-schedule-card__date { color: #756a63; background: #eae6e3; }
.am-schedule-card__content { min-width: 0; }
.am-schedule-card__content > div { display: flex; align-items: center; gap: 7px; }
.am-schedule-card__content strong { overflow: hidden; color: #3f3027; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.am-schedule-card__content > span { display: block; overflow: hidden; margin-top: 4px; color: #8b7d73; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.am-schedule-today { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: #881337; background: #f3dfce; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.am-schedule-card__hours { display: flex; align-items: center; gap: 5px; color: #6f5747; }
.am-schedule-card__hours ion-icon { color: #b1845f; font-size: 15px; }
.am-schedule-card__hours strong { font-size: 11px; white-space: nowrap; }
.am-schedule-card.is-day-off .am-schedule-card__hours { color: #847a74; }
.am-schedule-card__actual { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) auto 1px auto; align-items: center; gap: 10px; margin: 0 -2px -1px; padding: 10px 2px 0; border-top: 1px dashed #E2E8F0; color: #96887f; }
.am-schedule-card__actual-label { display: inline-flex; min-width: 0; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; }
.am-schedule-card__actual-label ion-icon { flex: 0 0 auto; color: #b49a87; font-size: 15px; }
.am-schedule-card__actual-time { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.am-schedule-card__actual-time small { color: #9b8e85; font-size: 8px; font-weight: 600; text-transform: uppercase; }
.am-schedule-card__actual-time strong { color: #8e827a; font-size: 11px; font-weight: 700; }
.am-schedule-card__actual-divider { width: 1px; height: 18px; background: #E2E8F0; }
.am-schedule-card__actual.has-presence { color: #5d493c; }
.am-schedule-card__actual.has-presence .am-schedule-card__actual-label ion-icon { color: #881337; }
.am-schedule-card__actual.has-presence .am-schedule-card__actual-time strong { color: #1E293B; }
.am-schedule-note { display: flex; gap: 9px; margin-top: 15px; padding: 12px 13px; border-radius: 13px; color: #725f4e; background: #f7eee5; }
.am-schedule-note ion-icon { flex: 0 0 auto; margin-top: 1px; color: #a77850; font-size: 18px; }
.am-schedule-note p { margin: 0; font-size: 10px; line-height: 1.45; }

@media (max-width: 370px) {
  .am-history-page, .am-schedule-page { padding-right: 12px !important; padding-left: 12px !important; }
  .am-history-tabs { margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
  .am-history-filter { padding: 14px; }
  .am-history-item { grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; padding-right: 11px; padding-left: 11px; }
  .am-history-item__arrow { display: none; }
  .am-history-item__icon { width: 38px; height: 38px; }
  .am-status-badge { padding-right: 7px; padding-left: 7px; font-size: 9px; }
  .am-schedule-card { grid-template-columns: 46px minmax(0,1fr); gap: 10px; }
  .am-schedule-card__hours { grid-column: 2; justify-content: flex-start; margin-top: -4px; }
  .am-schedule-card__actual { grid-template-columns: minmax(0,1fr) auto 1px auto; gap: 7px; }
  .am-schedule-card__actual-label { font-size: 9px; }
  .am-schedule-card__actual-time { gap: 3px; }
  .am-schedule-card__actual-time small { display: none; }
}
