/* ============================================================
   Check-In Undangan — Design System
   Modern & elegant theme
   ============================================================ */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/PlusJakartaSans-latin.woff2') format('woff2');
}

:root {
  --brand-1: #5b8def;
  --brand-2: #8ab8f5;
  --brand-3: #3b82f6;
  --gold: #c9a227;
  --ink: #171a25;
  --ink-soft: #3d4257;
  --muted: #737a91;
  --line: #ececf3;
  --bg: #f4f5fb;
  --card: #ffffff;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 37, .05);
  --shadow: 0 2px 4px rgba(23, 26, 37, .04), 0 12px 32px -16px rgba(23, 26, 37, .22);
  --shadow-lg: 0 8px 24px -8px rgba(23, 26, 37, .18), 0 24px 64px -24px rgba(23, 26, 37, .28);
  --grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --grad-soft: linear-gradient(135deg, rgba(91,141,239,.12), rgba(138,184,245,.12));
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(138,184,245,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(59,130,246,.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  letter-spacing: -0.01em;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .fw-bold, .fw-semibold { letter-spacing: -0.02em; }

/* ---------------- Navbar ---------------- */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(23, 26, 37, .06);
}
.app-nav .container-xl { display: flex; align-items: center; gap: 1rem; height: 70px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; font-size: 1.25rem;
  box-shadow: 0 8px 20px -6px rgba(109, 40, 217, .6);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0; border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
.brand-text { line-height: 1.05; }
.brand-title { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.brand-sub { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.nav-tabs-custom { display: flex; gap: .35rem; margin-left: auto; }
.nav-tabs-custom a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .58rem 1rem; border-radius: 12px;
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: all .18s ease; border: 1px solid transparent;
}
.nav-tabs-custom a:hover { background: rgba(23,26,37,.05); color: var(--ink); }
.nav-tabs-custom a.active {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(109, 40, 217, .65);
}
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--ink); margin-left: auto; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-tabs-custom {
    position: absolute; top: 70px; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: .25rem; padding: .75rem 1rem;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); display: none;
  }
  .nav-tabs-custom.open { display: flex; }
  .nav-tabs-custom a { width: 100%; }
}

/* ---------------- Page head ---------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-title { font-size: 1.4rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .6rem; }
.page-title .ti {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); color: var(--brand-1); font-size: 1.1rem;
}
.page-sub { color: var(--muted); font-size: .9rem; margin: .15rem 0 0; }

/* ---------------- Cards / Panels ---------------- */
.card {
  background: var(--card);
  border: 1px solid rgba(23,26,37,.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.25rem;
  font-weight: 700;
}

/* ---------------- Stat cards ---------------- */
.stat-card {
  position: relative;
  padding: 1.15rem 1.25rem;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-ic {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.25rem;
}
.stat-ic.violet { background: rgba(91,141,239,.12); color: var(--brand-1); }
.stat-ic.green  { background: rgba(16,185,129,.13); color: #059669; }
.stat-ic.red    { background: rgba(239,68,68,.12);  color: #dc2626; }
.stat-ic.blue   { background: rgba(59,130,246,.12); color: #2563eb; }
.stat-ic.amber  { background: rgba(245,158,11,.14); color: #d97706; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: .55rem; }
.stat-card .stat-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stat-card .stat-foot { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.stat-card .stat-value.ink { color: var(--ink); }
.stat-card .stat-value.green { color: #059669; }
.stat-card .stat-value.red { color: #dc2626; }
.stat-card .stat-value.violet { color: var(--brand-1); }

/* ---------------- Buttons ---------------- */
.btn { border-radius: 12px; font-weight: 600; letter-spacing: -0.01em; transition: all .18s ease; }
.btn-primary { background: var(--grad); border: 0; box-shadow: 0 8px 18px -8px rgba(91,141,239,.65); }
.btn-primary:hover, .btn-primary:focus { background: var(--grad); filter: brightness(1.07); box-shadow: 0 10px 24px -8px rgba(91,141,239,.8); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); border: 0; box-shadow: 0 8px 18px -8px rgba(16,185,129,.7); }
.btn-success:hover { background: linear-gradient(135deg, #059669, #10b981); filter: brightness(1.06); }
.btn-light { background: #fff; border: 1px solid var(--line); color: var(--ink-soft); }
.btn-light:hover { background: #f7f7fb; border-color: #dedee8; }
.btn-outline-primary { color: var(--brand-1); border-color: rgba(91,141,239,.35); }
.btn-outline-primary:hover { background: var(--brand-1); border-color: var(--brand-1); }
.btn-outline-success { color: #059669; border-color: rgba(16,185,129,.4); }
.btn-outline-success:hover { background: #059669; border-color: #059669; }
.btn-outline-danger { color: #dc2626; border-color: rgba(239,68,68,.4); }
.btn-outline-danger:hover { background: #dc2626; border-color: #dc2626; }
.btn-outline-secondary { color: var(--ink-soft); border-color: var(--line); }
.btn-sm { border-radius: 10px; }

/* ---------------- Form controls ---------------- */
.form-control, .form-select, .input-group-text {
  border-radius: 12px;
  border-color: var(--line);
  padding: .62rem .85rem;
  font-size: .95rem;
  background-color: #fbfbfe;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input-group-text { background: #f4f4fa; border-right: 0; color: var(--muted); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-2);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(138,184,245,.14);
}
.input-group .form-control { border-left: 0; }
.search-box { font-size: 1rem; }
.form-label { font-weight: 600; font-size: .85rem; color: var(--ink-soft); }

/* ---------------- Tables ---------------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line);
  padding: .85rem .75rem; white-space: nowrap;
}
.table > tbody > tr { transition: background .12s ease; }
.table-hover > tbody > tr:hover > * { background: rgba(91,141,239,.045); }
.table > tbody td { padding: .85rem .75rem; border-color: var(--line); vertical-align: middle; }
.guest-row.done { opacity: .72; }
.guest-row.done:hover { opacity: 1; }

/* ---------------- Badges (soft) ---------------- */
.badge { font-weight: 600; padding: .42em .7em; border-radius: 8px; letter-spacing: 0; }
.badge.bg-success { background: rgba(16,185,129,.14) !important; color: #047857 !important; }
.badge.bg-warning { background: rgba(245,158,11,.16) !important; color: #b45309 !important; }
.badge.bg-secondary { background: rgba(115,122,145,.14) !important; color: #4b5163 !important; }
.badge.bg-light { background: #f1f2f7 !important; color: var(--ink-soft) !important; border: 1px solid var(--line) !important; }

/* ---------------- Filter bar ---------------- */
.filter-bar {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(23,26,37,.05);
  box-shadow: var(--shadow);
}
.sticky-tools { position: sticky; top: 82px; z-index: 20; }

/* ---------------- Modal ---------------- */
.modal-content { border: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { border: 0; padding: 1.2rem 1.5rem; }
.modal-header.bg-success, .modal-header.grad {
  background: var(--grad) !important; color: #fff;
  position: relative;
}
.modal-header.bg-success::after, .modal-header.grad::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px 120px at 90% -30%, rgba(255,255,255,.25), transparent 70%);
}
.modal-header.bg-danger { background: linear-gradient(135deg, #b91c1c, #ef4444) !important; }
.modal-body { padding: 1.5rem; }
.modal-footer { border: 0; padding: 1rem 1.5rem 1.4rem; }
.modal-title { font-weight: 700; }

/* ---------------- Misc ---------------- */
.progress { border-radius: 999px; background: #eef0f6; }
.progress-bar { background: var(--grad); }
.sticky-top thead th, .sticky-top th, thead.sticky-top th { background: #fff; }
.avatar-initial {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 1rem;
  box-shadow: 0 6px 14px -6px rgba(23,26,37,.45);
}
.divider { height: 1px; background: var(--line); margin: 1rem 0; }
.chart-box { position: relative; height: 250px; width: 100%; }
.text-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

footer.app-footer {
  text-align: center; color: var(--muted); font-size: .8rem;
  padding: 1.6rem 0 2rem;
}
footer.app-footer .dot { opacity: .5; margin: 0 .4rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d7d9e4; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c3c6d6; }

/* live clock pill */
.live-clock {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .8rem; border-radius: 999px;
  background: rgba(16,185,129,.1); color: #047857;
  font-weight: 700; font-size: .8rem;
}
.live-clock .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.fade-up { animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- Alerts (soft) ---------------- */
.alert { border: 0; border-radius: 14px; font-weight: 500; box-shadow: var(--shadow-sm); }
.alert-success { background: rgba(16,185,129,.12); color: #047857; }
.alert-danger  { background: rgba(239,68,68,.12);  color: #b91c1c; }
.alert-warning { background: rgba(245,158,11,.14); color: #b45309; }
.alert-info    { background: rgba(59,130,246,.12); color: #1d4ed8; }

/* ---------------- Auth ---------------- */
.auth-body {
  background:
    radial-gradient(1200px 700px at 100% -10%, rgba(138,184,245,.16), transparent 60%),
    radial-gradient(1000px 600px at -10% 20%, rgba(91,141,239,.14), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-wrap { width: min(440px, 100%); display: flex; flex-direction: column; gap: 1.6rem; }

.auth-card {
  background: #fff;
  border: 1px solid rgba(23,26,37,.06);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 2.4rem 2.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(480px 140px at 50% -20%, rgba(138,184,245,.16), transparent 70%);
}

.auth-brand { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-bottom: 1.8rem; position: relative; z-index: 1; }
.auth-brand .brand-text { text-align: left; }

.auth-title { font-weight: 800; font-size: 1.5rem; margin: 0; position: relative; z-index: 1; }
.auth-sub { color: var(--muted); margin: .4rem 0 1.6rem; position: relative; z-index: 1; }

.auth-form { text-align: left; position: relative; z-index: 1; }
.auth-form .form-label { font-weight: 600; font-size: .92rem; }
.auth-form .form-control {
  border-radius: 12px;
  border: 1px solid rgba(23,26,37,.08);
  padding: .7rem .9rem .7rem 2.6rem;
  box-shadow: none;
}
.auth-form .form-control:focus { border-color: rgba(91,141,239,.6); box-shadow: 0 0 0 .25rem rgba(91,141,239,.12); }

.input-icon { position: relative; }
.input-icon i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.auth-btn { border-radius: 999px; padding: .75rem 1rem; font-weight: 700; box-shadow: 0 10px 30px -12px rgba(59,130,246,.9); }

.auth-hint {
  margin-top: 1.4rem;
  font-size: .85rem;
  color: var(--muted);
  position: relative; z-index: 1;
}

.auth-foot { text-align: center; color: var(--muted); font-size: .8rem; }

/* ---------------- Nav Extras ---------------- */
.nav-actions { display: flex; gap: .5rem; margin-left: auto; }
.nav-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem; border-radius: 999px;
  background: rgba(23,26,37,.05); color: var(--ink-soft); text-decoration: none;
  font-weight: 600; font-size: .9rem; border: 1px solid transparent;
}
.nav-pill:hover { background: rgba(23,26,37,.08); color: var(--ink); }
.nav-pill.show { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(59,130,246,.7); }

.nav-dropdown { border-radius: 14px; border: 1px solid rgba(23,26,37,.06); box-shadow: var(--shadow); padding: .4rem; }
.nav-dropdown .dropdown-item { border-radius: 10px; font-weight: 600; padding: .5rem .8rem; }
.nav-dropdown .dropdown-item.active { background: var(--grad-soft); color: var(--brand-1); }
.dropdown-form { margin: 0; }
.dropdown-form .dropdown-item { width: 100%; text-align: left; background: none; border: 0; }

@media (max-width: 768px) {
  .nav-actions { margin-left: 0; }
}

/* ---------------- Daftar tamu: mode kartu di mobile ---------------- */
@media (max-width: 768px) {
  .table-cards thead { display: none; }

  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td { display: block; width: 100%; }

  .table-cards tbody { padding: .85rem; }

  .table-cards tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem .9rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: .9rem 1rem;
    margin-bottom: .85rem;
  }
  .table-cards tr:last-child { margin-bottom: 0; }
  .table-cards tr.guest-row.done { background: #fafbff; }

  .table-cards td {
    border: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    min-width: 0;
  }

  .table-cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .18rem;
  }

  .table-cards td.cell-guest,
  .table-cards td.cell-aksi,
  .table-cards td[colspan] { grid-column: 1 / -1; }

  .table-cards td[colspan] { text-align: center !important; padding: 1.5rem .5rem !important; }

  .table-cards td.cell-guest {
    padding-bottom: .65rem !important;
    margin-bottom: .1rem;
    border-bottom: 1px dashed var(--line) !important;
  }

  .table-cards td.cell-aksi {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .15rem;
    padding-top: .7rem !important;
    border-top: 1px dashed var(--line) !important;
  }
  .table-cards td.cell-aksi .btn { min-height: 44px; }
  .table-cards td.cell-aksi .btn-checkin {
    flex: 1 1 auto;
    min-height: 46px;
    font-size: 1rem;
  }
  .table-cards td.cell-aksi form { display: contents; }
}

/* ---------------- Pagination ---------------- */
.pager-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}
.pager-wrap nav { max-width: 100%; overflow-x: auto; }

.pagination {
  --bs-pagination-border-width: 0;
  gap: .25rem;
  margin-bottom: 0;
}
.pagination .page-link {
  border-radius: var(--radius-sm) !important;
  color: var(--ink-soft);
  border: 0;
  min-width: 2.4rem;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.pagination .page-link:hover { background: var(--grad-soft); color: var(--brand-1); }
.pagination .page-item.active .page-link {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(91, 141, 239, .9);
}
.pagination .page-item.disabled .page-link { opacity: .45; box-shadow: none; }
.pagination .page-link:focus { box-shadow: 0 0 0 .2rem rgba(91, 141, 239, .25); }

/* ---------------- Indikator loading global ---------------- */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(244, 245, 251, .65);
  backdrop-filter: blur(2px);
}
.page-loading.show { display: flex; }
.page-loading-box {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  .pagination { flex-wrap: wrap; }
  .pagination .page-link { min-width: 2.1rem; min-height: 2.1rem; padding: .35rem .5rem; font-size: .85rem; }
}
