@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');

/* ===== DESIGN TOKENS (Beauty Buket Palette) ===== */
:root {
  --cream:        #F7F0E6;
  --cream-dark:   #EDE0C8;
  --terra:        #C4714A;  /* Terracotta – main accent */
  --terra-dark:   #A05535;
  --terra-light:  #F9EDE5;
  --brown:        #8B6E5A;
  --text:         #2C2015;
  --text-muted:   #8B7355;
  --border:       #E5D3BC;
  --card:         #FFFFFF;
  --success:      #5A8A6A;
  --warning:      #C49A3A;
  --danger:       #B04545;
  --info:         #4A6FA5;
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    24px;
  --shadow-sm:    0 2px 8px rgba(44,32,21,0.06);
  --shadow:       0 4px 20px rgba(44,32,21,0.10);
  --shadow-lg:    0 12px 40px rgba(44,32,21,0.15);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout-wrapper {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ===== SIDENAV ===== */
.sidenav {
  width: 260px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidenav-brand {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidenav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--terra);
  display: block;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.sidenav-logo small {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: -4px;
}

.sidenav-nav {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidenav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s;
}

.sidenav-link:hover {
  background: var(--cream);
  color: var(--text);
}

.sidenav-link.active {
  background: var(--terra-light);
  color: var(--terra);
}

.sidenav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidenav-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.sidenav-link-danger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--danger);
  text-decoration: none;
  transition: all .2s;
}

.sidenav-link-danger:hover { background: #fdf2f2; }
.sidenav-link-danger svg { width: 18px; height: 18px; }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ===== MOBILE TOPBAR ===== */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.125rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.mobile-topbar-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--terra);
  text-decoration: none;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text);
  transition: all .15s;
}

.hamburger-btn:active { background: var(--cream); }

/* ===== MAIN CONTENT ===== */
.main-content-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== OVERLAY ===== */
.sidenav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,32,21,.5);
  z-index: 50;
  backdrop-filter: blur(2px);
}

@media (max-width: 1023px) {
  .sidenav {
    position: fixed;
    inset-y: 0;
    left: 0;
    z-index: 60;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidenav.open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
}

/* ===== PUBLIC NAV ===== */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  color: var(--terra);
  text-decoration: none;
}

.nav-logo small {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-top: -4px;
}

.nav-links { display: flex; gap: 6px; }

.nav-link {
  padding: 7px 16px;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: all .2s;
}

.nav-link:hover, .nav-link.active {
  background: var(--terra-light);
  color: var(--terra);
}

/* ===== PAGE CONTAINER ===== */
.page-container { padding: 1.5rem; max-width: 1280px; margin: 0 auto; }

@media (max-width: 640px) {
  .page-container { padding: 1rem; }
}

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 1.5rem; }

.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-subtitle { color: var(--text-muted); font-size: .875rem; margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-body { padding: 1.5rem; }

/* ===== STAT CARD ===== */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.terra   { background: var(--terra-light); color: var(--terra); }
.stat-icon.amber   { background: #FEF3E2; color: #B07830; }
.stat-icon.blue    { background: #EBF0FA; color: var(--info); }
.stat-icon.green   { background: #EBF5EE; color: var(--success); }

.stat-value {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
}

.stat-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--terra); color: #fff; border-color: var(--terra); }
.btn-primary:hover { background: var(--terra-dark); border-color: var(--terra-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--cream); color: var(--text); }

.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ===== BADGE / STATUS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.badge-pending   { background: #FEF3E2; color: #B07830; }
.badge-proses    { background: #EBF0FA; color: var(--info); }
.badge-selesai   { background: #EBF5EE; color: var(--success); }
.badge-dibatalkan{ background: #FBE8E8; color: var(--danger); }

/* ===== FORM ===== */
.form-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  padding: 11px 14px;
  transition: all .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--terra);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196,113,74,.12);
}

.form-control::placeholder { color: #B09A82; }

textarea.form-control { resize: vertical; min-height: 100px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--cream); }
tbody td { padding: 14px 16px; font-size: .875rem; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,32,21,.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 1rem; }
}

.modal-overlay.open { display: flex; animation: fadeIn .2s; }

.modal {
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-lg);
    max-width: 520px;
    max-height: 90vh;
  }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

@media (min-width: 640px) { .modal-handle { display: none; } }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--text);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.modal-close:hover { background: #FBE8E8; color: var(--danger); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--cream);
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100vw - 2rem);
  max-width: 360px;
}

@media (min-width: 640px) {
  #toast-container {
    top: 80px;
    bottom: auto;
    right: 24px;
    left: auto;
    transform: none;
  }
}

.toast {
  background: var(--text);
  color: #fff;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: .875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
  pointer-events: all;
  white-space: nowrap;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--info); }
.toast svg     { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(44,32,21,.06);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  width: 100%;
  height: 62px;
}

/* All children: links AND buttons share this look */
.bottom-nav-inner a,
.bottom-nav-inner button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  text-decoration: none;
  background: none;
  border: none;
  border-top: 2.5px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.bottom-nav-inner a:active,
.bottom-nav-inner button:active {
  background: var(--cream);
}

.bottom-nav-inner a svg,
.bottom-nav-inner button svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Active link */
.bottom-nav-item.active {
  color: var(--terra) !important;
  border-top-color: var(--terra) !important;
}

/* Install button — always terracotta so it stands out slightly */
#pwaInstallBtnMobile {
  color: var(--terra);
  border-left: 1px solid var(--border);
}

@media (max-width: 1023px) {
  .bottom-nav { display: flex; }
  .main-content-area { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ===== CALENDAR GRID ===== */
.calendar-table { width: 100%; border-collapse: collapse; table-layout: fixed; }

.calendar-day-header {
  padding: .5rem .25rem;
  text-align: center;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.calendar-day-header.weekend { color: var(--terra); }

.calendar-cell {
  padding: .375rem .25rem;
  border: 1px solid var(--border);
  vertical-align: top;
  height: 80px;
  background: var(--card);
  transition: background .12s;
}

.calendar-cell.empty { background: var(--cream); }
.calendar-cell:hover { background: var(--cream); }

.calendar-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.calendar-date.today { background: var(--terra); color: #fff; }
.calendar-date.weekend { color: var(--terra); }

.calendar-event {
  display: block;
  width: 100%;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: .65rem;
  font-weight: 700;
  text-align: left;
  border: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
  transition: filter .15s, transform .1s;
}

.calendar-event:active { transform: scale(.97); }
.calendar-event:hover { filter: brightness(.93); }

.calendar-event.pending    { background: #FEF3E2; color: #B07830; }
.calendar-event.proses     { background: #EBF0FA; color: var(--info); }
.calendar-event.selesai    { background: #EBF5EE; color: var(--success); }
.calendar-event.dibatalkan { background: #FBE8E8; color: var(--danger); }

@media (min-width: 640px) {
  .calendar-cell { height: 120px; padding: .5rem; }
  .calendar-date { width: 30px; height: 30px; font-size: .875rem; }
  .calendar-event { font-size: .75rem; padding: 3px 8px; border-radius: 6px; }
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: .35; }
.empty-state p { font-size: .95rem; }

/* ===== FILTER TABS ===== */
.filter-tabs { display: flex; gap: 4px; background: var(--cream); padding: 4px; border-radius: var(--radius-sm); }

.filter-tab {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all .15s;
  white-space: nowrap;
}

.filter-tab.active { background: var(--card); color: var(--terra); box-shadow: var(--shadow-sm); }
.filter-tab:hover:not(.active) { color: var(--text); }

/* ===== SEARCH INPUT ===== */
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.search-input { width: 100%; padding: 9px 12px 9px 36px; background: var(--cream); border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: .875rem; color: var(--text); outline: none; transition: all .2s; }
.search-input:focus { border-color: var(--terra); background: #fff; box-shadow: 0 0 0 3px rgba(196,113,74,.1); }
.search-input::placeholder { color: #B09A82; }

/* ===== DETAIL INFO ROW ===== */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.info-item { background: var(--cream); border-radius: var(--radius-sm); padding: .875rem; }
.info-item.full { grid-column: 1 / -1; }
.info-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 4px; }
.info-value { font-size: .9rem; font-weight: 600; color: var(--text); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }

.animate-spin { animation: spin 1s linear infinite; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ===== LOADING PULSE ===== */
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.45 } }
.animate-pulse { animation: pulse 1.4s ease-in-out infinite; }
