:root {
  --navy: #0f2a4a;
  --navy-2: #163a63;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --indigo: #4f46e5;
  --gold: #d4af37;
  --gold-2: #f0d264;
  --gold-soft: #f9efce;
  --bg: #eef2f8;
  --bg-2: #e5ecf6;
  --card: #ffffff;
  --ink: #16233a;
  --muted: #64748b;
  --line: #e6ebf3;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --grad: linear-gradient(135deg, #0f2a4a 0%, #1e4d86 55%, #2f6fb3 100%);
  --grad-gold: linear-gradient(135deg, #f0d264 0%, #d4af37 100%);
  --grad-soft: linear-gradient(135deg, #eaf1ff 0%, #f6efe0 100%);
  --shadow: 0 10px 30px rgba(15, 42, 74, 0.12);
  --shadow-sm: 0 2px 10px rgba(15, 42, 74, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 42, 74, 0.24);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: calc(78px + var(--safe-bottom));
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--grad);
  color: #fff;
  padding: 14px 16px calc(14px);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 3px; object-fit: contain; }
.brand-text h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: .74rem; opacity: .8; }
.header-actions { display: flex; gap: 8px; }

.ghost-btn {
  background: rgba(255,255,255,.14);
  color: inherit;
  border: 1px solid rgba(255,255,255,.25);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.view .ghost-btn { background: #fff; color: var(--navy); border-color: var(--line); }

/* ---------- Main ---------- */
.app-main { padding: 14px 14px 24px; max-width: 760px; margin: 0 auto; }

/* ---------- Stat bar ---------- */
.stat-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(15,42,74,.04);
}
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-lbl { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.stat.accent .stat-num { color: var(--gold); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-ic { position: absolute; left: 12px; font-size: .9rem; opacity: .6; }
.search-wrap input {
  width: 100%;
  padding: 11px 12px 11px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: .9rem;
  color: var(--ink);
}
.search-wrap input:focus { outline: 2px solid var(--blue); border-color: transparent; }

.leader-filter { display: flex; align-items: center; gap: 8px; }
.leader-filter[hidden] { display: none; }
.leader-filter > span { font-size: .8rem; font-weight: 700; color: var(--navy); flex: 0 0 auto; }
.leader-filter select {
  flex: 1; min-width: 0; padding: 10px 11px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); font-size: .88rem; color: var(--ink);
}
.leader-filter select:focus { outline: 2px solid var(--blue); border-color: transparent; }

.chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { height: 4px; }
.chips::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.chip {
  flex: 0 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}
.chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip[hidden] { display: none; }

/* ---------- Agenda list ---------- */
.agenda-list { display: flex; flex-direction: column; gap: 12px; }
.mcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(15,42,74,.05);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.mcard:active { transform: scale(.99); }
.mcard.status-selesai { border-left-color: var(--green); }
.mcard.status-batal { border-left-color: var(--red); opacity: .78; }
.mcard.status-terjadwal { border-left-color: var(--gold); }

.mcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mcard-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.mcard-date-badge {
  flex: 0 0 auto;
  text-align: center;
  background: var(--gold-soft);
  color: var(--navy);
  border-radius: 12px;
  padding: 6px 10px;
  min-width: 54px;
}
.mcard-date-badge .d { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.mcard-date-badge .m { font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; }

.mcard-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.mcard-meta .mi { display: inline-flex; align-items: center; gap: 5px; }

.tag {
  display: inline-block; font-size: .68rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .3px;
}
.tag.terjadwal { background: #fef3c7; color: #92600a; }
.tag.selesai { background: #dcfce7; color: #166534; }
.tag.batal { background: #fee2e2; color: #991b1b; }
.tag.mode { background: #e0edff; color: #1d4ed8; }
.tag.cat { background: #ede9fe; color: #6d28d9; }
.tag.range { background: #e0e7ff; color: #3730a3; }

.empty {
  text-align: center; color: var(--muted); padding: 48px 20px; font-size: .9rem;
}
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h2 { font-size: 1rem; color: var(--navy); font-weight: 700; }
.round-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--navy); font-size: 1.1rem; cursor: pointer;
  display: grid; place-items: center;
}
.cal-dow { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; font-size: .68rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-cell {
  min-height: 44px; border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  padding: 4px; font-size: .8rem; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center;
}
.cal-cell.dim { opacity: .35; }
.cal-cell.today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal-cell.selected { background: var(--navy); color: #fff; }
.cal-cell.has-event { background: #eef4ff; }
.cal-cell.selected.has-event { background: var(--navy); }
.cal-cell .num { font-weight: 600; }
.cal-dots { display: flex; gap: 2px; margin-top: auto; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); display: block; }
.cal-cell.selected .cal-dots i { background: var(--gold); }

.day-panel { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.day-panel h3 { font-size: .9rem; color: var(--navy); }

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(88px + var(--safe-bottom));
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--grad); color: #fff; border: none;
  font-size: 1.8rem; line-height: 1; cursor: pointer;
  box-shadow: 0 8px 20px rgba(15,42,74,.35);
  z-index: 30;
}
.fab:active { transform: scale(.94); }

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom));
  width: min(94%, 460px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid; grid-template-columns: repeat(3,1fr);
  box-shadow: var(--shadow);
  z-index: 25;
  overflow: hidden;
}
.tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .7rem; font-weight: 600; color: var(--muted);
}
.tab .ti { font-size: 1.2rem; }
.tab.is-active { color: var(--navy); }
.tab[hidden] { display: none; }
.tab.is-active .ti { transform: translateY(-1px); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,42,74,.45);
  display: grid; align-items: end; justify-items: center;
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.modal-sheet {
  width: min(100%, 640px);
  max-height: 92vh; overflow-y: auto;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 8px 18px calc(24px + var(--safe-bottom));
  animation: slideUp .25s ease;
}
@media (min-width: 680px) {
  .modal-overlay { align-items: center; }
  .modal-sheet { border-radius: 22px; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal-grip { width: 44px; height: 5px; background: var(--line); border-radius: 3px; margin: 6px auto 10px; }
.modal-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-top h2 { font-size: 1.1rem; color: var(--navy); }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field[hidden] { display: none; }
.field > span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.field > span small { font-weight: 400; }
.field-hint { font-size: .72rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px;
  font-size: .92rem; font-family: inherit; color: var(--ink); background: #fbfcfe;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.field-row .grow { flex: 2; }
.result-wrap { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: #f8fafc; border: 1px dashed var(--line); border-radius: 12px; }

.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.primary-btn {
  flex: 1; background: var(--grad); color: #fff; border: none; border-radius: 12px;
  padding: 13px; font-size: .95rem; font-weight: 700; cursor: pointer;
}
.primary-btn:active { transform: scale(.98); }
.danger-btn {
  background: #fee2e2; color: var(--red); border: none; border-radius: 12px;
  padding: 13px 18px; font-size: .95rem; font-weight: 700; cursor: pointer;
}

/* ---------- Detail ---------- */
.detail-body { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; }
.detail-hero {
  display: flex; gap: 14px; align-items: center;
  background: var(--grad); border-radius: 18px; padding: 16px 16px;
  box-shadow: 0 8px 22px rgba(15,42,74,.22);
}
.detail-hero .mcard-date-badge {
  min-width: 58px; background: var(--grad-gold); color: var(--navy);
  box-shadow: 0 4px 12px rgba(212,175,55,.4);
}
.detail-hero .hero-text { min-width: 0; }
.detail-hero h3 { font-size: 1.12rem; color: #fff; line-height: 1.25; }
.detail-hero .mcard-meta { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.info-card {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 16px;
  padding: 4px 14px; box-shadow: var(--shadow-sm);
}
.info-row {
  display: grid; grid-template-columns: 30px 104px 1fr; align-items: center;
  gap: 8px; padding: 10px 0; font-size: .9rem; border-bottom: 1px solid #eef1f6;
}
.info-row:last-child { border-bottom: none; }
.info-ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #eef4ff; font-size: .95rem;
}
.info-k { color: var(--muted); font-weight: 600; font-size: .82rem; }
.info-v { color: var(--ink); font-weight: 600; min-width: 0; word-break: break-word; }
.info-v a { color: var(--blue); word-break: break-all; font-weight: 600; }

.detail-section h4 {
  font-size: .82rem; color: var(--navy); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.detail-section ol, .detail-section ul { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.detail-section p { font-size: .9rem; white-space: pre-wrap; }

/* Peserta sebagai chip beravatar */
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: inline-flex; align-items: center; gap: 8px;
  background: #eef4ff; border: 1px solid #dce8fb; border-radius: 999px;
  padding: 5px 12px 5px 5px; font-size: .85rem; font-weight: 600; color: var(--navy);
}
.person .pav {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  font-size: .68rem; font-weight: 800;
}

/* Agenda bernomor rapi */
.agenda-ol { list-style: none; padding-left: 0 !important; gap: 8px !important; }
.agenda-ol li {
  counter-increment: ag; position: relative; padding: 8px 12px 8px 40px;
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; font-weight: 500;
}
.agenda-ol { counter-reset: ag; }
.agenda-ol li::before {
  content: counter(ag); position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; background: var(--grad-gold); color: var(--navy);
  display: grid; place-items: center; font-size: .72rem; font-weight: 800;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(96px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: .86rem; z-index: 60; box-shadow: var(--shadow); max-width: 90%;
  animation: toastIn .2s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Login ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--grad);
  display: grid; place-items: center; padding: 24px;
}
.login-screen[hidden] { display: none; }
.login-card {
  width: min(100%, 380px);
  background: var(--card);
  border-radius: 22px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  animation: slideUp .25s ease;
}
.login-logo { width: 68px; height: 68px; border-radius: 16px; margin-bottom: 12px; }
.login-card h1 { font-size: 1.15rem; color: var(--navy); }
.login-sub { font-size: .85rem; color: var(--muted); margin: 4px 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-form .field input { background: #fbfcfe; }
.login-error {
  background: #fee2e2; color: var(--red); border-radius: 10px;
  padding: 9px 12px; font-size: .82rem; margin: 0;
}
.login-error[hidden] { display: none; }
.login-hint { font-size: .78rem; color: var(--muted); margin-top: 14px; }

/* ---------- Avatar / Account ---------- */
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  border: 2px solid rgba(255,255,255,.5);
  font-weight: 800; font-size: .78rem; cursor: pointer;
  display: grid; place-items: center;
}
.avatar-btn[hidden] { display: none; }
.account-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  background: var(--grad); border-radius: 18px; padding: 16px;
  box-shadow: 0 8px 22px rgba(15,42,74,.22);
}
.account-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad-gold); color: var(--navy);
  font-weight: 800; font-size: 1.25rem; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(212,175,55,.4);
}
.account-head > div { min-width: 0; }
.account-name { font-size: 1.05rem; font-weight: 700; color: #fff; line-height: 1.25; }
.account-role { margin-top: 6px; }
.account-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.account-actions .ghost-btn {
  text-align: left; padding: 14px 15px; border-radius: 14px;
  background: #fbfcfe; color: var(--navy); border: 1px solid var(--line);
  font-size: .92rem; font-weight: 600; box-shadow: var(--shadow-sm);
}
.account-actions .ghost-btn:hover { background: #eef4ff; }
#passForm {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}

/* ---------- Users list ---------- */
.users-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.user-item {
  display: flex; align-items: center; gap: 12px;
  background: #fbfcfe; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px;
}
.user-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: var(--navy-2); color: #fff;
  font-weight: 700; font-size: .85rem; display: grid; place-items: center;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 700; color: var(--navy); font-size: .92rem; }
.user-name .you { color: var(--muted); font-weight: 400; font-size: .78rem; }
.user-jab { font-size: .8rem; color: var(--navy-2); font-weight: 600; margin-top: 1px; }
.user-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.user-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.user-actions .round-btn { width: 34px; height: 34px; font-size: .9rem; }

/* ---------- Notification bell ---------- */
.icon-btn {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: .95rem; cursor: pointer; display: grid; place-items: center;
}
.icon-btn[hidden] { display: none; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--gold); color: var(--navy);
  font-size: .62rem; font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
  border: 2px solid var(--navy);
}
.badge[hidden] { display: none; }

/* ---------- Tarik untuk menyegarkan ---------- */
.ptr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: grid; place-items: center;
  height: 0; overflow: hidden; pointer-events: none;
  color: var(--navy);
}
.ptr .ptr-spin {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-top: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 14px rgba(15,42,74,.25);
  font-size: 1.2rem; transition: transform .1s linear;
}
.ptr.refreshing .ptr-spin { animation: ptrspin .7s linear infinite; }
#refreshBtn.spinning { animation: ptrspin .7s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* ---------- Selected chips (peserta) ---------- */
.chips-selected { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-selected:not(:empty) { margin-bottom: 8px; }
.sel-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef4ff; color: var(--navy); border: 1px solid #d3e2fb;
  border-radius: 999px; padding: 5px 6px 5px 10px; font-size: .82rem; font-weight: 600;
}
.sel-chip.manual { background: #fdf3e0; color: #92600a; border-color: #f0dcae; }
.sel-chip.manual .chip-x { background: #f0dcae; color: #92600a; }
.chip-x {
  border: none; background: #c9d8f2; color: var(--navy);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: .9rem; line-height: 1; display: grid; place-items: center;
}

/* ---------- Picker (peserta) ---------- */
.picker { position: relative; }
.picker-options {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 220px; overflow-y: auto; padding: 4px;
}
.picker-options[hidden] { display: none; }
.picker-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: .88rem; color: var(--ink);
}
.picker-item:hover { background: #eef4ff; }
.picker-item .opt-note { color: var(--muted); font-weight: 400; font-size: .8rem; }
.picker-empty { padding: 10px; font-size: .82rem; color: var(--muted); text-align: center; }

/* ---------- Notifications list ---------- */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; cursor: pointer; width: 100%;
}
.notif-item.unread { background: #eef4ff; border-color: #d3e2fb; }
.notif-ic { font-size: 1.1rem; flex: 0 0 auto; }
.notif-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif-msg { font-size: .88rem; color: var(--ink); }
.notif-time { font-size: .72rem; color: var(--muted); }

/* ---------- Attachments ---------- */
.attach-add {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: #eef4ff; color: var(--navy); border: 1px dashed #b9cdf0;
  border-radius: 12px; padding: 11px 14px; font-size: .88rem; font-weight: 600;
}
.attach-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.attach-list:empty { margin-top: 0; }
.attach-item { display: flex; align-items: center; gap: 6px; }
.attach-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; text-align: left;
}
.attach-open:hover { background: #eef4ff; }
.attach-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: #eef; }
.attach-ic { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.4rem; flex: 0 0 auto; }
.attach-name { flex: 1; min-width: 0; font-size: .88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: .74rem; color: var(--muted); flex: 0 0 auto; }
.attach-del {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: #fee2e2; color: var(--red); font-size: 1.1rem; cursor: pointer;
}

/* ---------- Preview modal ---------- */
.preview-overlay { align-items: stretch; justify-items: stretch; }
.preview-overlay[hidden] { display: none; }
.preview-box {
  width: 100%; height: 100%; background: #0b1a2e; display: flex; flex-direction: column;
}
.preview-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--navy); color: #fff;
}
.preview-name { font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-top .round-btn { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; }
.preview-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-body:has(.pdf-pages) { align-items: flex-start; justify-content: center; }
.pdf-loading { color: #cbd5e1; font-size: .95rem; padding: 30px; }
.pdf-pages { width: 100%; padding: 12px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pdf-page { max-width: 100%; background: #fff; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.preview-fallback { color: #cbd5e1; text-align: center; padding: 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.preview-fallback .big { font-size: 3rem; }
.preview-fallback .muted { color: #94a3b8; font-size: .85rem; }
.preview-fallback .ghost-btn { color: #fff; border-color: rgba(255,255,255,.4); }

/* =====================================================================
 * VISUAL POLISH — tampilan lebih menarik & modern
 * ===================================================================== */

/* Header dengan kilau lembut */
.app-header { overflow: hidden; border-radius: 0 0 22px 22px; }
.app-header::after {
  content: ""; position: absolute; top: -60%; right: -8%;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.30), transparent 68%);
  pointer-events: none;
}
.brand, .header-actions { position: relative; z-index: 1; }
.brand-logo { box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.brand-text h1 { font-weight: 800; }
.brand-sub { opacity: .85; }

/* Kartu ringkasan */
.stat {
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: .9;
}
.stat.accent::before { background: var(--grad-gold); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-num {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat.accent .stat-num { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Kotak pencarian & filter */
.search-wrap input { box-shadow: var(--shadow-sm); transition: box-shadow .15s ease; }
.search-wrap input:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.chip { transition: transform .12s ease, background .15s ease, box-shadow .15s ease; }
.chip:hover { transform: translateY(-1px); }
.chip.is-active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(15,42,74,.28); }
.leader-filter select { box-shadow: var(--shadow-sm); }

/* Kartu kegiatan */
.mcard {
  border-left-width: 5px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
  animation: cardIn .32s ease both;
}
.mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mcard.status-terjadwal { border-left-color: var(--gold); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mcard-title { letter-spacing: .1px; }
.mcard-date-badge {
  background: var(--grad-gold); color: var(--navy);
  box-shadow: 0 4px 10px rgba(212,175,55,.32);
}

/* Tag lebih halus */
.tag { box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }

/* FAB dengan efek menyenangkan */
.fab {
  background: var(--grad);
  box-shadow: 0 12px 26px rgba(15,42,74,.42);
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease;
}
.fab:hover { transform: translateY(-2px) rotate(90deg); box-shadow: 0 16px 32px rgba(15,42,74,.5); }
.fab:active { transform: scale(.92) rotate(90deg); }

/* Bottom nav sebagai pil mengambang */
.tabbar {
  padding: 5px; gap: 2px;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 12px 32px rgba(15,42,74,.18);
}
.tab { border-radius: 14px; transition: color .15s ease, background .2s ease, transform .12s ease; }
.tab:active { transform: scale(.96); }
.tab.is-active { color: var(--navy); background: var(--grad-soft); }
.tab.is-active .ti { transform: translateY(-1px) scale(1.05); }

/* Kalender */
.round-btn { transition: transform .12s ease, background .15s ease, box-shadow .15s ease; box-shadow: var(--shadow-sm); }
.round-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.cal-cell { transition: transform .1s ease, background .18s ease, box-shadow .15s ease; }
.cal-cell:hover:not(.selected) { background: #f3f7ff; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--blue); }
.cal-cell.has-event { background: linear-gradient(180deg, #f1f6ff, #e9f1ff); }
.cal-cell.selected { background: var(--grad); border-color: transparent; box-shadow: 0 8px 16px rgba(15,42,74,.3); }
.cal-dots i { width: 6px; height: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* Tombol utama & modal */
.primary-btn {
  box-shadow: 0 8px 18px rgba(15,42,74,.26);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(15,42,74,.32); filter: brightness(1.04); }
.ghost-btn { transition: transform .12s ease, background .15s ease; }
.view .ghost-btn:hover { transform: translateY(-1px); background: #f3f7ff; }
.modal-overlay { background: rgba(11,26,46,.5); backdrop-filter: blur(5px); }
.modal-sheet { box-shadow: var(--shadow-lg); }
.avatar-btn, .icon-btn { transition: transform .12s ease, box-shadow .15s ease; }
.avatar-btn:hover, .icon-btn:hover { transform: translateY(-1px); }

/* Item pengguna & lampiran */
.user-item, .attach-open { transition: transform .12s ease, box-shadow .15s ease, background .15s ease; }
.user-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.attach-open:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* Scrollbar tipis yang rapi (desktop) */
* { scrollbar-width: thin; scrollbar-color: #c7d2e3 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #c7d2e3; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #aebfd6; }

/* ---------- Print ---------- */
@media print {
  .app-header, .tabbar, .fab, .toolbar, .stat-bar { display: none !important; }
  body { background: #fff; padding: 0; }
  .mcard { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
