/* v3-agenda.css v8 — Agenda Reuni Perak 2026 */
:root {
  --ag-red: #a80f19;
  --ag-red-deep: #701018;
  --ag-ink: #1b1815;
  --ag-muted: #756f69;
  --ag-paper: #f4f0eb;
  --ag-line: rgba(27, 24, 21, .11);
  --ag-green: #176b4d;
}

.ag-svg-sprite { display: none; }
.ag-shell { width: min(620px, 100%); }
.ag-header { margin-bottom: 8px; }

/* ── Intro ── */
.ag-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
  padding: 18px 4px 24px;
}
.ag-eyebrow,
.ag-section-heading p,
.ag-ticket-header p {
  margin: 0 0 7px;
  color: var(--ag-red);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.ag-intro h1 {
  margin: 0;
  font: 700 clamp(45px, 13vw, 64px)/.92 var(--serif);
  letter-spacing: -.045em;
}
.ag-intro > div:first-child > p:last-child {
  max-width: 440px;
  margin: 12px 0 0;
  color: var(--ag-muted);
  font-size: 12px;
  line-height: 1.55;
}
.ag-count {
  display: grid;
  min-width: 68px;
  min-height: 68px;
  place-content: center;
  border: 1px solid var(--ag-line);
  border-radius: 22px;
  background: rgba(255,255,255,.7);
  text-align: center;
}
.ag-count b { font: 700 26px/1 var(--serif); }
.ag-count span { margin-top: 4px; color: var(--ag-muted); font-size: 8px; font-weight: 800; }

/* ── Locked (belum login) ── */
.ag-locked {
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 52px 20px;
  text-align: center;
}
.ag-locked-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(168,15,25,.08);
  color: var(--ag-red);
}
.ag-locked-icon svg { width: 28px; height: 28px; }
.ag-locked h2 { margin: 0; font: 700 26px/1.1 var(--serif); }
.ag-locked p { margin: 0; max-width: 300px; color: var(--ag-muted); font-size: 11px; line-height: 1.5; }
.ag-cta-btn {
  display: inline-block;
  border-radius: 15px;
  padding: 12px 22px;
  background: var(--ag-red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

/* ── Next event card ── */
.ag-next {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 19px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,255,255,.17), transparent 35%),
    linear-gradient(145deg, var(--ag-red-deep), #bd1520 70%, #d32631);
  box-shadow: 0 25px 60px rgba(127, 15, 24, .23);
  color: #fff;
}
.ag-next::after {
  position: absolute;
  right: -28px;
  bottom: 34px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 50%;
  content: "";
}
.ag-next-topline,
.ag-next-main,
.ag-next-location,
.ag-ticket-primary { position: relative; z-index: 1; }
.ag-next-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.ag-next-topline span { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.67); }
.ag-next-topline i { width: 6px; height: 6px; border-radius: 50%; background: #ffd0d3; box-shadow: 0 0 0 4px rgba(255,255,255,.09); }
.ag-next-topline b { border-radius: 999px; padding: 6px 8px; background: rgba(255,255,255,.1); }
.ag-next-main {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 15px;
  margin-top: 22px;
}
.ag-next-main time {
  display: grid;
  min-height: 74px;
  place-content: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 22px;
  background: rgba(255,255,255,.1);
  text-align: center;
}
.ag-next-main time b { font: 700 36px/.82 var(--serif); }
.ag-next-main time span { margin-top: 8px; color: rgba(255,255,255,.7); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.ag-next-main p { margin: 0 0 5px; color: rgba(255,255,255,.6); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.ag-next-main h2 { margin: 0; font: 700 34px/.95 var(--serif); letter-spacing: -.025em; }
.ag-next-main div > span { display: block; margin-top: 7px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; }
.ag-next-location {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 15px;
  border-top: 1px solid rgba(255,255,255,.13);
  padding-top: 14px;
}
.ag-next-location svg { width: 18px; height: 18px; }
.ag-next-location span { display: grid; gap: 2px; }
.ag-next-location b { font-size: 9px; }
.ag-next-location small { color: rgba(255,255,255,.55); font-size: 8px; }
.ag-next-unregistered {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 11px 15px;
  border-radius: 15px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.72);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}
.ag-next-unregistered a { color: rgba(255,255,255,.9); text-decoration: underline; }

/* ── Ticket primary button ── */
.ag-ticket-primary {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  border: 0;
  border-radius: 17px;
  padding: 0 15px;
  background: #fff;
  color: var(--ag-red);
  font-size: 11px;
  font-weight: 900;
}
.ag-ticket-primary svg { width: 19px; height: 19px; }
.ag-ticket-primary > span { font-size: 18px; }

/* ── Section heading & filter tabs ── */
.ag-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 34px 2px 13px;
}
.ag-section-heading h2 { margin: 0; font: 700 29px/.95 var(--serif); letter-spacing: -.03em; }
.ag-section-heading a { color: var(--ag-red); font-size: 9px; font-weight: 900; }
.ag-view-tabs {
  display: flex;
  gap: 3px;
  border-radius: 13px;
  padding: 3px;
  background: rgba(27,24,21,.06);
}
.ag-view-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 10px;
  padding: 0 10px;
  background: transparent;
  color: var(--ag-muted);
  font-size: 8px;
  font-weight: 900;
}
.ag-view-tabs button.is-active { background: #fff; color: var(--ag-ink); box-shadow: 0 4px 12px rgba(0,0,0,.06); }

/* ── Event timeline ── */
.ag-timeline { display: grid; gap: 9px; }
.ag-event-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr 18px;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--ag-line);
  border-radius: 22px;
  padding: 11px 13px 11px 11px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 30px rgba(45,28,22,.045);
}
.ag-event-date {
  display: grid;
  min-height: 62px;
  place-content: center;
  border-radius: 17px;
  background: #f9e7e7;
  color: var(--ag-red);
  text-align: center;
}
.ag-event-date.is-night { background: var(--ag-ink); color: #fff; }
.ag-event-date.is-muted { background: #ebe7e2; color: var(--ag-muted); }
.ag-event-date b { font: 700 26px/.85 var(--serif); }
.ag-event-date span { margin-top: 6px; font-size: 7px; font-weight: 900; letter-spacing: .13em; }
.ag-event-card > button {
  min-width: 0;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ag-event-card > button:disabled { cursor: default; opacity: .7; }
.ag-event-card h3 { margin: 5px 0 2px; font: 700 20px/1 var(--serif); }
.ag-event-card p { margin: 0; color: var(--ag-ink); font-size: 9px; font-weight: 800; }
.ag-event-card small { display: block; overflow: hidden; margin-top: 3px; color: var(--ag-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ag-chevron { color: var(--ag-red); font: 400 24px/1 var(--sans); }
.ag-status { display: inline-flex; align-items: center; gap: 5px; color: var(--ag-green); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.ag-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ag-status.is-neutral { color: var(--ag-muted); }
.ag-status.is-checkedin { color: #2a9d6f; }

/* ── Main tabs (Agenda Angkatan / Jadwal Saya) ── */
.ag-main-tabs {
  display: flex;
  gap: 3px;
  border-radius: 16px;
  padding: 4px;
  background: rgba(27,24,21,.07);
  margin-bottom: 18px;
}
.ag-main-tabs button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: transparent;
  color: var(--ag-muted);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.ag-main-tabs button.is-active {
  background: #fff;
  color: var(--ag-ink);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

/* ── Poster ── */
.ag-poster {
  margin: 0 0 14px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.14);
}
.ag-poster img { width: 100%; display: block; }

/* ── Rangkaian acara per tanggal ── */
.ag-rangkaian { display: grid; gap: 12px; margin-top: 8px; }

.ag-r-day {
  border-radius: 20px;
  background: var(--ag-surface, #fff);
  border: 1px solid rgba(28,25,23,.08);
  overflow: hidden;
}

.ag-r-day-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(28,25,23,.07);
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.ag-r-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--ag-red);
  color: #fff;
  flex-shrink: 0;
}
.ag-r-date b { font: 700 22px/1 var(--serif); }
.ag-r-date span { font-size: 7px; font-weight: 900; letter-spacing: .1em; margin-top: 2px; opacity: .8; }

.ag-r-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ag-muted);
  transition: transform .2s ease;
}
.ag-r-day-header[aria-expanded="false"] .ag-r-chevron { transform: rotate(-90deg); }
.ag-r-day.is-peak .ag-r-chevron { color: rgba(255,255,255,.45); }

.ag-r-day-info { flex: 1; min-width: 0; }
.ag-r-day-info p { margin: 0; font-size: 11px; font-weight: 800; color: var(--ag-ink); }

.ag-r-peak-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--ag-red);
  color: #fff;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ag-r-events { padding: 0 18px; }

.ag-r-event {
  padding: 14px 0;
  border-bottom: 1px solid rgba(28,25,23,.06);
}
.ag-r-event:last-child { border-bottom: none; }

.ag-r-meta {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ag-red);
  letter-spacing: .02em;
  margin-bottom: 4px;
}
.ag-r-title { margin: 0 0 6px; font: 700 19px/1.1 var(--serif); color: var(--ag-ink); }
.ag-r-desc { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ag-muted); }

/* Aug 23 — Acara Puncak: dark treatment */
.ag-r-day.is-peak { background: var(--ag-ink); border-color: transparent; }
.ag-r-day.is-peak .ag-r-day-header { border-bottom-color: rgba(255,255,255,.1); }
.ag-r-day.is-peak .ag-r-date { background: var(--ag-red); }
.ag-r-day.is-peak .ag-r-day-info p { color: #fff; }
.ag-r-day.is-peak .ag-r-event { border-bottom-color: rgba(255,255,255,.08); }
.ag-r-day.is-peak .ag-r-meta { color: #e07070; }
.ag-r-day.is-peak .ag-r-title { color: #fff; }
.ag-r-day.is-peak .ag-r-desc { color: rgba(255,255,255,.55); }

/* ── Public event cards (no auth required) ── */
.ag-public-section { margin-bottom: 4px; }
.ag-personal-heading { margin-top: 28px; }
.ag-event-card.ag-event-public { grid-template-columns: 54px 1fr 18px; }
.ag-event-info { display: grid; gap: 0; }
button.ag-event-info { border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; color: inherit; }
.ag-event-info h3 { margin: 5px 0 2px; font: 700 20px/1 var(--serif); }
.ag-event-info p { margin: 0; color: var(--ag-ink); font-size: 9px; font-weight: 800; }
.ag-event-info small { display: block; margin-top: 3px; color: var(--ag-muted); font-size: 8px; }
.ag-event-desc { margin-top: 6px !important; font-size: 9.5px !important; line-height: 1.5; white-space: normal !important; overflow: visible !important; text-overflow: unset !important; color: var(--ag-muted); }
.ag-locked-compact { padding: 32px 20px; gap: 12px; }
.ag-locked-compact h2 { font: 700 22px/1.1 var(--serif); }

/* ── Note (check-in info) ── */
.ag-note {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  gap: 12px;
  margin-top: 13px;
  border: 1px solid rgba(23,107,77,.15);
  border-radius: 21px;
  padding: 14px;
  background: rgba(232,244,238,.75);
}
.ag-note > svg { width: 40px; height: 40px; border-radius: 14px; padding: 10px; background: #fff; color: var(--ag-green); }
.ag-note b { font-size: 10px; }
.ag-note p { margin: 4px 0 0; color: #567064; font-size: 9px; line-height: 1.5; }

/* ── Announcements ── */
.ag-announcements { margin-top: 34px; }
.ag-announcements .ag-section-heading { margin-top: 0; }
.ag-announcement-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--ag-line);
  border-radius: 22px;
  padding: 17px;
  background: rgba(255,255,255,.72);
}
.ag-announcement-card > span { color: var(--ag-red); font-size: 7px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ag-announcement-card b { font: 700 21px/1.05 var(--serif); }
.ag-announcement-card small { color: var(--ag-muted); font-size: 8px; }

/* ── Ticket dialog ── */
.ag-ticket-dialog {
  width: min(560px, 100%);
  max-width: none;
  max-height: 92dvh;
  inset: auto 0 0;
  overflow: visible;
  margin: auto;
  border: 0;
  padding: 0;
  background: transparent;
}
.ag-ticket-dialog::backdrop { background: rgba(21,17,15,.72); backdrop-filter: blur(12px) saturate(.7); }
.ag-ticket-sheet {
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 31px 31px 0 0;
  padding: 10px 17px calc(18px + env(safe-area-inset-bottom));
  background: #fffdfa;
  box-shadow: 0 -24px 80px rgba(20,14,12,.32);
}
.ag-sheet-handle { width: 44px; height: 4px; margin: 0 auto 12px; border-radius: 999px; background: #d8d2cd; }
.ag-ticket-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.ag-ticket-header h2 { margin: 0; font: 700 38px/.9 var(--serif); letter-spacing: -.035em; }
.ag-ticket-header button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #efebe7; color: var(--ag-ink); font-size: 21px; cursor: pointer; }
.ag-detail-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 10px; }
.ag-detail-summary > div { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; border: 1px solid var(--ag-line); border-radius: 16px; padding: 10px; }
.ag-detail-summary svg { width: 18px; height: 18px; color: var(--ag-red); }
.ag-detail-summary span { min-width: 0; display: grid; gap: 3px; }
.ag-detail-summary small { color: var(--ag-muted); font-size: 7px; }
.ag-detail-summary b { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ag-digital-ticket {
  position: relative;
  overflow: hidden;
  border-radius: 25px;
  padding: 17px;
  background: var(--ag-ink);
  box-shadow: 0 20px 50px rgba(27,24,21,.17);
  color: #fff;
}
.ag-digital-ticket::before,
.ag-digital-ticket::after { position: absolute; top: 110px; width: 22px; height: 22px; border-radius: 50%; background: #fffdfa; content: ""; }
.ag-digital-ticket::before { left: -11px; }
.ag-digital-ticket::after { right: -11px; }
.ag-ticket-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: rgba(255,255,255,.58); font-size: 7px; font-weight: 900; letter-spacing: .11em; }
.ag-ticket-brand b { color: #fff; }
.ag-ticket-person { display: grid; gap: 3px; min-height: 72px; align-content: center; border-bottom: 1px dashed rgba(255,255,255,.22); }
.ag-ticket-person small { color: rgba(255,255,255,.53); font-size: 7px; text-transform: uppercase; letter-spacing: .1em; }
.ag-ticket-person b { font: 700 21px/1 var(--serif); }
.ag-ticket-person span { color: rgba(255,255,255,.56); font-size: 8px; }

/* QR container (real token) */
[data-ag-qr-container] {
  display: flex;
  justify-content: center;
  padding: 20px 0 13px;
}
[data-ag-qr-container] img {
  display: block;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  width: 170px;
  height: 170px;
}

/* QR pending state */
/* ── QR used (sudah check-in) ── */
.ag-qr-used {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  margin: 0 -20px;
  background: rgba(42,157,111,.18);
  border-top: 1px solid rgba(42,157,111,.3);
  border-bottom: 1px solid rgba(42,157,111,.3);
  text-align: center;
}
.ag-qr-used-check { font-size: 22px; color: #2a9d6f; }
.ag-qr-used b { font-size: 11px; font-weight: 900; color: #2a9d6f; letter-spacing: .06em; text-transform: uppercase; }
.ag-qr-used small { color: rgba(255,255,255,.5); font-size: 8px; }

.ag-qr-pending {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 28px 20px;
  gap: 8px;
  text-align: center;
}
.ag-qr-pending-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  margin-bottom: 6px;
}
.ag-qr-pending-icon svg { width: 28px; height: 28px; color: rgba(255,255,255,.65); }
.ag-qr-pending b { font: 700 14px/1.2 var(--serif); color: #fff; }
.ag-qr-pending p { margin: 0; max-width: 220px; color: rgba(255,255,255,.5); font-size: 8px; line-height: 1.5; }

.ag-ticket-footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px dashed rgba(255,255,255,.22); padding-top: 13px; color: rgba(255,255,255,.48); font-size: 7px; font-weight: 900; letter-spacing: .09em; }
.ag-ticket-footer b { color: #8fd4b4; }

/* ── Toast ── */
.ag-toast { position: fixed; z-index: 11000; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); transform: translate(-50%, 20px); border-radius: 999px; padding: 10px 14px; background: var(--ag-ink); color: #fff; font-size: 9px; font-weight: 800; opacity: 0; pointer-events: none; transition: .2s ease; }
.ag-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 700px) {
  .ag-ticket-dialog { inset: 0; width: min(480px, calc(100% - 32px)); }
  .ag-ticket-sheet { border-radius: 31px; padding-bottom: 18px; }
}
@media (max-width: 390px) {
  .ag-intro { grid-template-columns: 1fr; }
  .ag-count { display: none; }
  .ag-detail-summary { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-toast { transition: none; }
}
