/* WedPlan Budget - modern dark pink/blue UI */
:root {
  --bg: #090B14;
  --bg-2: #0B0F1A;
  --sidebar: #111827;
  --card: rgba(22, 27, 46, .86);
  --card-solid: #161B2E;
  --border: #2A3148;
  --pink: #FF4ECD;
  --blue: #38BDF8;
  --purple: #A78BFA;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --warning: #F59E0B;
  --success: #22C55E;
  --danger: #EF4444;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 60px rgba(0, 0, 0, .34);
  --sidebar-w: 270px;
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Playfair Display", Georgia, serif;
}
body.theme-gold { --pink: #F59E0B; --blue: #FDE68A; --purple: #FBBF24; }
body.theme-purple { --pink: #C084FC; --blue: #A78BFA; --purple: #F0ABFC; }
body.theme-emerald { --pink: #34D399; --blue: #22D3EE; --purple: #86EFAC; }
body.light-mode {
  --bg: #F7F8FC; --bg-2: #EEF2FF; --sidebar: #111827; --card: rgba(255,255,255,.9); --card-solid: #FFFFFF; --border: #D9E0EF; --text: #111827; --muted: #64748B;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(255,78,205,.20), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(56,189,248,.18), transparent 32%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  background: linear-gradient(180deg, rgba(17,24,39,.98), rgba(11,15,26,.98));
  border-right: 1px solid rgba(42,49,72,.8);
  display: flex; flex-direction: column;
  box-shadow: 20px 0 80px rgba(0,0,0,.28);
}
.sidebar-brand { display: flex; align-items: center; gap: 14px; padding: 28px 22px 24px; }
.brand-mark { width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--pink), var(--blue)); color: white; box-shadow: 0 12px 36px rgba(255,78,205,.25); }
.sidebar-brand strong { display: block; font-size: 1.15rem; line-height: 1; }
.sidebar-brand span { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.sidebar-nav { padding: 8px 14px; display: grid; gap: 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 16px; color: var(--muted); text-decoration: none; transition: .2s ease; }
.nav-item i { width: 20px; text-align: center; }
.nav-item:hover, .nav-item.active { color: var(--text); background: linear-gradient(135deg, rgba(255,78,205,.17), rgba(56,189,248,.13)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.nav-item.active i { color: var(--blue); }
.sidebar-footer { margin-top: auto; padding: 18px; border-top: 1px solid rgba(42,49,72,.7); }
.mini-label, .eyebrow { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }

#mobile-header { display: none; position: fixed; inset: 0 0 auto 0; height: 62px; z-index: 40; background: rgba(9,11,20,.82); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); align-items: center; justify-content: space-between; padding: 0 16px; }
.mobile-logo { font-weight: 800; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--border); color: var(--text); background: rgba(22,27,46,.8); border-radius: 14px; }
#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.58); z-index: 25; }
#sidebar-overlay.active { display: block; }

#main-content { margin-left: var(--sidebar-w); min-height: 100vh; padding: 34px; }
.page { display: none; animation: fadeUp .24s ease; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
h1 { margin: 5px 0 0; font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1; }
h2 { margin: 0; font-size: 1.02rem; }
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)), var(--card);
  border: 1px solid rgba(42,49,72,.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.text-link { border: 0; color: var(--blue); background: transparent; font-weight: 700; padding: 4px; }


.custom-select {
  position: relative;
  width: 100%;
}
.custom-select > select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.custom-select-ui {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)), rgba(9,11,20,.78);
  border-radius: 14px;
  padding: 11px 13px 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.custom-select-ui span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-ui i {
  color: var(--blue);
  font-size: .78rem;
  transition: transform .2s ease;
}
.custom-select.open .custom-select-ui,
.custom-select-ui:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(56,189,248,.12);
}
.custom-select.open .custom-select-ui i { transform: rotate(180deg); }
.custom-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 95;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(42,49,72,.95);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22,27,46,.98), rgba(11,15,26,.98));
  box-shadow: 0 22px 60px rgba(0,0,0,.44);
  backdrop-filter: blur(16px);
  display: none;
}
.custom-select.open .custom-options { display: grid; gap: 4px; }
.custom-option {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 10px 11px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  white-space: normal;
}
.custom-option:hover,
.custom-option.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,78,205,.16), rgba(56,189,248,.13));
}
.confirm-box {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
}
.confirm-icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  border: 1px solid currentColor;
}
.confirm-icon.danger { color: var(--danger); background: rgba(239,68,68,.11); }
.confirm-icon.info { color: var(--blue); background: rgba(56,189,248,.11); }
.confirm-box p {
  max-width: 520px;
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

select, input, textarea {
  width: 100%; border: 1px solid var(--border); color: var(--text); background: rgba(9,11,20,.78); border-radius: 14px; padding: 12px 14px; outline: none;
}
textarea { min-height: 96px; resize: vertical; }
select:focus, input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(56,189,248,.12); }
.event-picker { min-width: 290px; display: flex; align-items: center; gap: 10px; background: rgba(22,27,46,.86); border: 1px solid var(--border); border-radius: 18px; padding: 8px 12px; }
.event-picker i { color: var(--pink); }
.event-picker select, .sidebar-footer select { border: 0; background: transparent; padding: 6px; }

.hero-summary { position: relative; overflow: hidden; padding: 28px; min-height: 205px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.hero-summary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,78,205,.20), rgba(56,189,248,.15) 48%, transparent); pointer-events: none; }
.hero-summary > * { position: relative; }
.hero-summary h2 { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: .98; margin: 8px 0 18px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(9,11,20,.32); color: var(--muted); }
.hero-meta i { color: var(--blue); }
.hero-meta b { color: var(--text); font-weight: 600; }
.countdown-orb { width: 154px; aspect-ratio: 1; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; text-align: center; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.28), transparent 28%), linear-gradient(135deg, var(--pink), var(--blue)); box-shadow: 0 22px 60px rgba(56,189,248,.20); }
.countdown-orb strong { display: block; font-size: 2.8rem; line-height: .8; }
.countdown-orb span { display: block; font-size: .78rem; margin-top: 8px; font-weight: 800; }

.summary-grid { display: grid; gap: 14px; }
.summary-grid.compact { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 18px; }
.summary-grid.mini { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 16px; }
.metric-card { padding: 18px; border-radius: 20px; background: rgba(22,27,46,.72); border: 1px solid var(--border); }
.metric-card span { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 9px; }
.metric-card strong { display: block; font-size: clamp(1.05rem, 2vw, 1.45rem); }
.dashboard-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 18px; }
.dashboard-grid .panel { padding: 20px; }
.progress-track { height: 15px; background: rgba(148,163,184,.16); border-radius: 999px; overflow: hidden; }
.progress-track.slim { height: 9px; margin-top: 8px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--blue)); border-radius: inherit; transition: width .45s ease; }
.progress-fill.over { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.progress-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; margin-top: 10px; }
.status-pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; border: 1px solid currentColor; }
.status-pill.safe { color: var(--success); background: rgba(34,197,94,.10); }
.status-pill.warn { color: var(--warning); background: rgba(245,158,11,.10); }
.status-pill.danger, .status-overdue, .status-belum { color: var(--danger); background: rgba(239,68,68,.10); }
.status-pill.info, .status-dp { color: var(--blue); background: rgba(56,189,248,.10); }
.status-lunas { color: var(--success); background: rgba(34,197,94,.10); }
.status-netral { color: var(--muted); background: rgba(148,163,184,.12); }

.bar-list, .recent-list, .task-preview-list, .events-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px,1fr) 120px auto; gap: 12px; align-items: center; }
.bar-row small, .muted { color: var(--muted); }
.mini-bar { height: 9px; background: rgba(148,163,184,.16); border-radius: 99px; overflow: hidden; }
.mini-bar div { height: 100%; background: linear-gradient(90deg, var(--pink), var(--blue)); }
.recent-row, .task-preview, .event-card { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 16px; background: rgba(9,11,20,.34); border: 1px solid rgba(42,49,72,.72); }
.recent-row .grow, .event-card .grow { flex: 1; min-width: 0; }
.recent-row strong, .event-card strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }

.events-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) 390px; gap: 18px; align-items: start; }
.event-card { align-items: flex-start; padding: 18px; }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wedding-preview-panel { padding: 20px; position: sticky; top: 24px; }
.wedding-card { min-height: 420px; border-radius: 28px; padding: 36px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle at 20% 10%, rgba(255,78,205,.24), transparent 34%), radial-gradient(circle at 80% 20%, rgba(56,189,248,.22), transparent 34%), linear-gradient(160deg, #101525, #171D31); border: 1px solid rgba(255,255,255,.10); }
.wedding-card p { color: var(--pink); text-transform: uppercase; letter-spacing: .16em; font-weight: 800; }
.wedding-card h2 { font-family: var(--display); font-size: 3rem; margin: 12px 0; }
.wc-line { width: 120px; height: 2px; background: linear-gradient(90deg, transparent, var(--pink), var(--blue), transparent); margin: 12px 0 20px; }
.wedding-card span, .wedding-card small { color: var(--muted); margin-top: 8px; }

.filters-panel { padding: 14px; display: grid; grid-template-columns: 210px minmax(220px,1fr) 190px 170px; gap: 10px; margin-bottom: 16px; }
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { padding-left: 40px; }
.table-panel { overflow: hidden; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; text-align: left; background: rgba(9,11,20,.38); }
th, td { padding: 15px 16px; border-bottom: 1px solid rgba(42,49,72,.76); vertical-align: middle; }
td { font-size: .88rem; }
.td-title { font-weight: 800; }
.td-sub { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.diff-pos { color: var(--success); font-weight: 800; }
.diff-neg { color: var(--danger); font-weight: 800; }
.diff-zero { color: var(--muted); font-weight: 800; }
.action-btns { display: flex; gap: 7px; }
.btn-icon { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--border); background: rgba(9,11,20,.45); color: var(--text); }
.btn-icon:hover { border-color: var(--blue); color: var(--blue); }
.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: var(--blue); }


.timeline-number {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  box-shadow: 0 12px 30px rgba(56,189,248,.18);
}
.timeline-heading { flex: 1; min-width: 0; }
.timeline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
.timeline-meta > span:not(.status-pill) {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(148,163,184,.10);
  border: 1px solid rgba(148,163,184,.16);
}
.timeline-now { border-color: rgba(245,158,11,.45); }
.timeline-done { opacity: .86; }

.timeline-filter { grid-template-columns: 280px 1fr; align-items: center; }
.timeline-total { display: grid; grid-template-columns: auto auto; gap: 0 12px; align-items: center; color: var(--muted); }
.timeline-total strong { justify-self: end; color: var(--text); }
.timeline-total .progress-track { grid-column: 1 / -1; }
.timeline-wrap { display: grid; gap: 16px; }
.timeline-card { padding: 18px; }
.timeline-phase-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.timeline-phase-head h3 { margin: 0; font-size: 1rem; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(42,49,72,.65); }
.task-row input { width: 20px; height: 20px; accent-color: var(--pink); }
.task-row.done span { color: var(--muted); text-decoration: line-through; }
.task-actions { margin-left: auto; display: flex; gap: 6px; }
.phase-progress { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .8rem; }
.phase-progress .mini-bar { width: 90px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.settings-grid .panel { padding: 20px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.setting-action { border: 1px solid var(--border); color: var(--text); background: rgba(9,11,20,.34); border-radius: 18px; min-height: 96px; display: grid; place-items: center; gap: 7px; text-align: center; }
.setting-action i { color: var(--blue); font-size: 1.55rem; }
.form-grid { display: grid; gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: grid; gap: 8px; color: var(--muted); font-size: .86rem; }
.form-row, .form-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.toggle-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); }
.toggle-row input { width: 46px; height: 24px; accent-color: var(--pink); }
.danger-panel { border-color: rgba(239,68,68,.42); }

.btn-primary, .btn-danger, .btn-secondary {
  border: 0; border-radius: 15px; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: white; font-weight: 800; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--blue)); box-shadow: 0 14px 36px rgba(56,189,248,.18); }
.btn-secondary { background: rgba(148,163,184,.18); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); margin-right: 10px; }
.btn-danger.ghost { background: rgba(239,68,68,.12); color: var(--danger); border: 1px solid rgba(239,68,68,.35); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.68); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; backdrop-filter: blur(10px); }
.modal-box { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: var(--card-solid); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.modal-header { position: sticky; top: 0; background: var(--card-solid); z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-close { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); background: rgba(9,11,20,.4); color: var(--text); }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

#toast-container { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 10px; }
.toast { padding: 13px 15px; min-width: 260px; max-width: 360px; border-radius: 16px; background: var(--card-solid); border: 1px solid var(--border); border-left: 4px solid var(--blue); box-shadow: var(--shadow); color: var(--text); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@media print {
  #sidebar, #mobile-header, .topbar button, .filters-panel, .action-btns, #toast-container { display: none !important; }
  body { background: white; color: black; }
  #main-content { margin: 0; padding: 0; }
  .page { display: block; }
  .page:not(.active) { display: none; }
  .panel { box-shadow: none; border: 1px solid #ddd; background: white; color: black; }
}
@media (max-width: 1180px) {
  .summary-grid.compact, .summary-grid.mini { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .events-layout, .settings-grid { grid-template-columns: 1fr; }
  .wedding-preview-panel { position: static; }
  .filters-panel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  #mobile-header { display: flex; }
  #sidebar { transform: translateX(-100%); transition: transform .24s ease; }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; padding: 82px 16px 24px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .event-picker { min-width: 0; width: 100%; }
  .hero-summary { flex-direction: column; align-items: flex-start; }
  .countdown-orb { width: 128px; }
  .summary-grid.compact, .summary-grid.mini, .filters-panel, .timeline-filter, .form-row, .form-grid.two, .action-grid { grid-template-columns: 1fr; }
  .hero-summary h2 { font-size: 2.6rem; }
  .bar-row { grid-template-columns: 1fr; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 24px 24px 0 0; max-height: 94vh; }
}


/* Responsive hardening */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
#main-content { width: calc(100% - var(--sidebar-w)); max-width: 1680px; }
.topbar > div { min-width: 0; }
.panel, .metric-card, .hero-summary, .event-card, .recent-row, .task-preview { min-width: 0; }
.btn-primary, .btn-secondary, .btn-danger, .text-link { min-height: 42px; }
.event-picker .custom-select { min-width: 0; }
.sidebar-footer .custom-options { top: auto; bottom: calc(100% + 8px); }

@media (max-width: 1360px) {
  #main-content { padding: 28px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .events-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  table { min-width: 920px; }
}

@media (max-width: 1180px) {
  #main-content { width: calc(100% - var(--sidebar-w)); }
  .topbar { align-items: flex-start; }
  .event-picker { min-width: 260px; }
  .hero-summary { min-height: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .events-layout { grid-template-columns: 1fr; }
  .event-card { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .event-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .wedding-card { min-height: 320px; }
  .filters-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline-phase-head { align-items: flex-start; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 260px; --radius: 18px; }
  #mobile-header { display: flex; }
  #sidebar {
    width: min(86vw, 320px);
    transform: translateX(-100%);
    transition: transform .24s ease;
    z-index: 50;
  }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay { z-index: 45; }
  #main-content {
    width: 100%;
    margin-left: 0;
    padding: 82px 18px 28px;
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
  }
  h1 { font-size: 2rem; line-height: 1.08; }
  .event-picker { width: 100%; min-width: 0; }
  .hero-summary {
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
  }
  .hero-summary h2 { font-size: clamp(2.2rem, 10vw, 3.2rem); }
  .hero-meta { display: grid; grid-template-columns: 1fr; }
  .hero-meta span { width: 100%; border-radius: 16px; }
  .countdown-orb { width: 132px; justify-self: center; align-self: center; }
  .summary-grid.compact, .summary-grid.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-panel, .timeline-filter { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .modal-box { width: min(100%, 680px); }
}

@media (max-width: 640px) {
  body { background-attachment: fixed; }
  #main-content { padding: 78px 12px 22px; }
  #mobile-header { height: 58px; padding: 0 12px; }
  .mobile-logo { max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; }
  .topbar .btn-primary { width: 100%; }
  .eyebrow { font-size: .68rem; }
  h1 { font-size: 1.72rem; }
  h2 { font-size: .96rem; }
  .panel-head { align-items: flex-start; }
  .panel-head h2 { min-width: 0; }
  .text-link { padding-inline: 0; }
  .hero-summary { padding: 18px; border-radius: 20px; }
  .hero-summary h2 { margin-bottom: 14px; }
  .countdown-orb { width: 118px; }
  .countdown-orb strong { font-size: 2.25rem; }
  .summary-grid.compact, .summary-grid.mini { grid-template-columns: 1fr; gap: 10px; }
  .metric-card { padding: 15px; border-radius: 16px; }
  .dashboard-grid .panel, .settings-grid .panel, .wedding-preview-panel { padding: 16px; }
  .bar-row { grid-template-columns: 1fr; gap: 8px; }
  .recent-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }
  .recent-row > strong, .recent-row > .badge { grid-column: 2; justify-self: start; }
  .event-card { grid-template-columns: 1fr; padding: 15px; }
  .event-card > .btn-icon { display: none; }
  .event-actions { justify-content: stretch; }
  .event-actions .btn-secondary { flex: 1 1 100%; }
  .wedding-card { min-height: 260px; padding: 26px 18px; border-radius: 22px; }
  .wedding-card h2 { font-size: 2.1rem; overflow-wrap: anywhere; }
  .filters-panel { padding: 12px; border-radius: 18px; }
  .table-panel { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table-responsive { overflow: visible; }
  #budget-table, #budget-table thead, #budget-table tbody, #budget-table tr, #budget-table th, #budget-table td { display: block; width: 100%; min-width: 0; }
  #budget-table thead { display: none; }
  #budget-table tbody { display: grid; gap: 12px; }
  #budget-table tr {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)), var(--card);
    box-shadow: 0 12px 34px rgba(0,0,0,.20);
  }
  #budget-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(42,49,72,.55);
    word-break: break-word;
  }
  #budget-table td:last-child { border-bottom: 0; }
  #budget-table td::before { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
  #budget-table td:nth-child(1)::before { content: 'Item'; }
  #budget-table td:nth-child(2)::before { content: 'Event'; }
  #budget-table td:nth-child(3)::before { content: 'Kategori'; }
  #budget-table td:nth-child(4)::before { content: 'Budget'; }
  #budget-table td:nth-child(5)::before { content: 'Aktual'; }
  #budget-table td:nth-child(6)::before { content: 'Selisih'; }
  #budget-table td:nth-child(7)::before { content: 'Status'; }
  #budget-table td:nth-child(8)::before { content: 'Jatuh Tempo'; }
  #budget-table td:nth-child(9)::before { content: 'Aksi'; }
  .action-btns { flex-wrap: wrap; }
  .timeline-card { padding: 15px; border-radius: 18px; }
  .timeline-phase-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }
  .timeline-number { width: 38px; height: 38px; border-radius: 13px; }
  .timeline-heading h3 { font-size: .98rem; line-height: 1.28; }
  .phase-progress { grid-column: 1 / -1; width: 100%; }
  .phase-progress .mini-bar { flex: 1; width: auto; }
  .task-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
  }
  .task-actions { margin-left: 0; }
  .action-grid, .form-row, .form-grid.two { grid-template-columns: 1fr; }
  .setting-action { min-height: 78px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .modal-body { padding: 16px; }
  .modal-header { padding: 15px 16px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn-primary, .modal-actions .btn-secondary, .modal-actions .btn-danger { width: 100%; }
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
  .custom-options { max-height: 220px; }
}

@media (max-width: 380px) {
  #main-content { padding-inline: 10px; }
  .hero-summary, .dashboard-grid .panel, .settings-grid .panel, .timeline-card, .metric-card { border-radius: 16px; }
  #budget-table td { grid-template-columns: 92px minmax(0, 1fr); }
  .btn-primary, .btn-secondary, .btn-danger { padding-inline: 12px; }
}

/* Mobile bottom navigation */
@media (max-width: 900px) {
  #sidebar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    transform: none !important;
    z-index: 70;
    border-right: 0;
    border-top: 1px solid rgba(42,49,72,.9);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 60px rgba(0,0,0,.42);
    background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(9,11,20,.98));
    backdrop-filter: blur(18px);
  }
  .sidebar-brand,
  .sidebar-footer {
    display: none;
  }
  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    overflow: visible;
  }
  .nav-item {
    min-height: 58px;
    padding: 6px 4px;
    border-radius: 16px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    font-size: .68rem;
    line-height: 1.15;
    text-align: center;
  }
  .nav-item i {
    width: auto;
    font-size: 1rem;
  }
  .nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #sidebar-overlay,
  #sidebar-overlay.active {
    display: none !important;
  }
  #mobile-header {
    display: flex;
  }
  #sidebar-toggle {
    visibility: hidden;
    pointer-events: none;
  }
  #main-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .nav-item {
    font-size: .62rem;
    min-height: 56px;
  }
  .nav-item i {
    font-size: .95rem;
  }
}

/* Timeline polish: pink-blue themed */
.timeline-card {
  position: relative;
  overflow: hidden;
}
.timeline-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), var(--blue));
  opacity: .85;
}
.timeline-now {
  border-color: rgba(255,78,205,.48);
  box-shadow: 0 18px 60px rgba(255,78,205,.10), 0 12px 44px rgba(56,189,248,.08);
}
.timeline-now::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,78,205,.10), rgba(56,189,248,.08), transparent 55%);
  pointer-events: none;
}
.timeline-card > * {
  position: relative;
  z-index: 1;
}
.timeline-meta .status-pill.warn,
.status-pill.warn {
  color: var(--blue);
  border-color: rgba(56,189,248,.64);
  background: linear-gradient(135deg, rgba(255,78,205,.14), rgba(56,189,248,.14));
}
.timeline-meta .status-pill.info {
  color: var(--muted);
  border-color: rgba(148,163,184,.24);
  background: rgba(148,163,184,.10);
}
.timeline-meta .status-pill.safe {
  color: var(--success);
}
.timeline-phase-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(42,49,72,.62);
}
.timeline-heading h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.timeline-meta > span:not(.status-pill) {
  color: var(--muted);
}
.timeline-card .phase-progress strong {
  min-width: 38px;
  text-align: right;
  color: var(--blue);
}
.timeline-card .task-row:first-of-type {
  border-top: 0;
}
.timeline-card .task-row {
  min-height: 48px;
  padding: 12px 0;
}
.timeline-card .task-row span {
  line-height: 1.45;
}
.timeline-card .task-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1.5px solid rgba(56,189,248,.55);
  background: rgba(9,11,20,.42);
  display: grid;
  place-items: center;
  margin: 0;
}
.timeline-card .task-row input::before {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .16s ease;
}
.timeline-card .task-row input:checked {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--blue));
}
.timeline-card .task-row input:checked::before {
  transform: rotate(-45deg) scale(1);
}
.timeline-card .task-actions {
  opacity: .72;
  transition: opacity .18s ease;
}
.timeline-card .task-row:hover .task-actions {
  opacity: 1;
}

@media (max-width: 640px) {
  .timeline-phase-head {
    padding-bottom: 12px;
  }
  .timeline-meta {
    gap: 6px;
  }
  .timeline-card .task-row {
    grid-template-columns: 24px minmax(0, 1fr) 78px;
    gap: 9px;
  }
  .timeline-card .task-actions {
    justify-content: flex-end;
  }
  .timeline-card .task-actions .btn-icon {
    width: 32px;
    height: 32px;
  }
}

/* Timeline dropdown and checklist fixes */
.timeline-filter {
  position: relative;
  z-index: 30;
  overflow: visible;
  grid-template-columns: minmax(260px, 360px) minmax(240px, 1fr);
}
.timeline-filter .custom-select {
  z-index: 120;
}
.timeline-filter .custom-select.open {
  z-index: 160;
}
.timeline-filter .custom-options {
  z-index: 999;
  min-width: 100%;
}
.timeline-wrap {
  position: relative;
  z-index: 1;
}
.task-row {
  cursor: pointer;
  border-radius: 14px;
  padding-inline: 8px;
  margin-inline: -8px;
  transition: background .18s ease, border-color .18s ease;
}
.task-row:hover {
  background: rgba(56,189,248,.06);
}
.timeline-card .task-row input {
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}
.timeline-card .task-row input::before {
  content: '';
  width: 6px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-left: 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform .16s ease;
  margin-top: -2px;
}
.timeline-card .task-row input:checked::before {
  transform: rotate(45deg) scale(1);
}
.task-row.done {
  background: rgba(255,78,205,.045);
}
.task-row.done span {
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(248,250,252,.45);
}

@media (max-width: 1100px) {
  .timeline-filter {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .timeline-total {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .timeline-filter {
    padding: 12px;
  }
  .timeline-filter .custom-options {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 146px;
    max-height: 48vh;
  }
  .timeline-total {
    grid-template-columns: 1fr auto;
  }
  .timeline-card .task-row {
    grid-template-columns: 26px minmax(0, 1fr) 74px;
    padding: 11px 6px;
    margin-inline: -6px;
  }
}

/* Timeline checkbox centering fix */
.timeline-card .task-row input {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  line-height: 1;
}
.timeline-card .task-row input::before {
  content: '\2713';
  width: auto;
  height: auto;
  border: 0;
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transform: scale(0);
  transform-origin: center;
  translate: 0 -1px;
  transition: transform .16s ease;
}
.timeline-card .task-row input:checked::before {
  transform: scale(1);
}
