/* =========================================================
   e-Himung - Tema
   Warna utama: Teal (ramah, tenang) + Amber (hangat, "himung")
   ========================================================= */
:root {
  --hm-primary: #0f766e;
  --hm-primary-600: #0d6660;
  --hm-primary-50: #ecfdf9;
  --hm-accent: #f59e0b;
  --hm-ink: #0f172a;
  --hm-muted: #64748b;
  --hm-radius: 16px;
  --bs-primary: #0f766e;
  --bs-primary-rgb: 15, 118, 110;
  --bs-link-color: #0f766e;
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: #0b5550;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { font-family: var(--bs-body-font-family); }

.btn-primary {
  --bs-btn-bg: var(--hm-primary);
  --bs-btn-border-color: var(--hm-primary);
  --bs-btn-hover-bg: var(--hm-primary-600);
  --bs-btn-hover-border-color: var(--hm-primary-600);
  --bs-btn-active-bg: #0b5550;
  --bs-btn-active-border-color: #0b5550;
  --bs-btn-disabled-bg: var(--hm-primary);
  --bs-btn-disabled-border-color: var(--hm-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--hm-primary);
  --bs-btn-border-color: var(--hm-primary);
  --bs-btn-hover-bg: var(--hm-primary);
  --bs-btn-hover-border-color: var(--hm-primary);
  --bs-btn-active-bg: var(--hm-primary);
}
.text-bg-primary { background-color: var(--hm-primary) !important; }
.bg-primary { background-color: var(--hm-primary) !important; }
.text-primary { color: var(--hm-primary) !important; }
.form-control:focus, .form-select:focus {
  border-color: #5eead4;
  box-shadow: 0 0 0 .25rem rgba(20, 184, 166, .2);
}
.form-check-input:checked { background-color: var(--hm-primary); border-color: var(--hm-primary); }
.page-link { color: var(--hm-primary); }
.active > .page-link { background-color: var(--hm-primary); border-color: var(--hm-primary); }

/* ---------- Sidebar ---------- */
.app-sidebar { background: linear-gradient(180deg, #0b3f3b 0%, #0f2e2c 100%) !important; }
.app-sidebar .sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.08); }
.app-sidebar .brand-text { font-weight: 700 !important; letter-spacing: .3px; }
.app-sidebar .brand-image { border-radius: 10px; }
.sidebar-menu .nav-link.active {
  background: linear-gradient(90deg, #14b8a6, #0f766e) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(20,184,166,.25);
}
.sidebar-menu .nav-header { font-size: .7rem; letter-spacing: 1px; opacity: .6; }
.app-header { border-bottom: 1px solid rgba(0,0,0,.05); }

/* ---------- Kartu & elemen ---------- */
.card { border: 0; border-radius: var(--hm-radius); box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 20px rgba(15,23,42,.05); }
.card > .card-header { background: transparent; border-bottom: 1px solid rgba(15,23,42,.06); padding: 1rem 1.25rem; }
.card > .card-header .card-title { font-weight: 700; font-size: 1rem; }
.app-content-header h3 { font-weight: 800; letter-spacing: -.3px; }
.table > :not(caption) > * > * { padding: .7rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--hm-muted); font-weight: 700; background: #f8fafc; }
.badge { font-weight: 600; padding: .45em .7em; border-radius: 8px; }

.stat-card { position: relative; overflow: hidden; border-radius: var(--hm-radius); padding: 1.15rem 1.25rem; color: #fff; min-height: 118px; }
.stat-card .stat-num { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { opacity: .9; font-weight: 500; font-size: .9rem; }
.stat-card .stat-icon { position: absolute; right: -6px; bottom: -14px; font-size: 5rem; opacity: .18; }
.grad-teal   { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.grad-amber  { background: linear-gradient(135deg, #fbbf24, #d97706); }
.grad-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.grad-rose   { background: linear-gradient(135deg, #fb7185, #e11d48); }
.grad-slate  { background: linear-gradient(135deg, #64748b, #334155); }

.avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--hm-primary-50); color: var(--hm-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.4rem; }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; display: inline-block; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.empty-state { text-align: center; padding: 2.2rem 1rem; color: var(--hm-muted); }
.empty-state i { font-size: 2.6rem; opacity: .35; display: block; margin-bottom: .5rem; }

/* ---------- Linimasa aktivitas kiosk ---------- */
.timeline-feed { list-style: none; padding: 0; margin: 0; max-height: 430px; overflow-y: auto; }
.timeline-feed li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; animation: pop .35s ease; }
.timeline-feed li:last-child { border-bottom: 0; }
.timeline-feed li.empty-state { display: block; border: 0; }
.tf-ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.timeline-feed li.in .tf-ic { background: #d1fae5; color: #047857; }
.timeline-feed li.out .tf-ic { background: #fee2e2; color: #b91c1c; }
.tf-body { flex: 1; min-width: 0; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tf-jam { font-weight: 700; font-size: .85rem; color: #64748b; font-variant-numeric: tabular-nums; }

/* ---------- Halaman login & tamu ---------- */
.auth-bg, .guest-bg {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at -10% -10%, rgba(20,184,166,.35), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(251,191,36,.28), transparent 60%),
    linear-gradient(160deg, #0b3f3b, #0f2e2c);
}
.auth-card, .guest-card { border-radius: 24px; border: 0; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.guest-wrap { max-width: 520px; margin: 0 auto; padding: 1.25rem .9rem 2.5rem; }
.guest-head { color: #fff; text-align: center; padding: 1rem 0 1.25rem; }
.guest-head img { width: 64px; height: 64px; border-radius: 18px; background: #fff; padding: 4px; }
.guest-head h1 { font-size: 1.35rem; font-weight: 800; margin: .6rem 0 .15rem; }
.guest-head p { opacity: .8; margin: 0; font-size: .9rem; }

.step-dots { display: flex; justify-content: center; gap: .4rem; margin-bottom: .75rem; }
.step-dots span { width: 28px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.25); }
.step-dots span.on { background: #fbbf24; }

.kategori-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.kategori-grid input { display: none; }
.kategori-grid label { border: 2px solid #e2e8f0; border-radius: 12px; padding: .6rem .7rem; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; transition: .15s; height: 100%; }
.kategori-grid label i { font-size: 1.15rem; color: var(--hm-primary); }
.kategori-grid input:checked + label { border-color: var(--hm-primary); background: var(--hm-primary-50); color: var(--hm-primary); }

.sig-pad { width: 100%; height: 180px; border: 2px dashed #cbd5e1; border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; }
.foto-preview { width: 110px; height: 110px; border-radius: 18px; object-fit: cover; background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 2rem; border: 2px dashed #cbd5e1; }
.form-label { font-weight: 600; font-size: .9rem; }
.form-control-lg, .form-select-lg { border-radius: 12px; font-size: 1rem; }

/* Kartu tamu digital */
.pass { border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.pass-top { background: linear-gradient(135deg, #14b8a6, #0f766e); color: #fff; padding: 1.4rem 1.25rem 3.2rem; position: relative; }
.pass-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 28px; background: #fff; border-radius: 24px 24px 0 0; }
.pass-photo { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; border: 4px solid #fff; margin: -64px auto 0; position: relative; z-index: 2; background: var(--hm-primary-50); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 800; color: var(--hm-primary); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.pass-row { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed #e2e8f0; font-size: .92rem; }
.pass-row span:first-child { color: var(--hm-muted); }
.pass-row span:last-child { font-weight: 600; text-align: right; }
.stars { display: flex; justify-content: center; gap: .35rem; font-size: 2.3rem; }
.stars i { cursor: pointer; color: #e2e8f0; transition: .15s; }
.stars i.on { color: #f59e0b; transform: scale(1.08); }

/* ---------- Cetak ---------- */
@media print {
  .no-print, .app-header, .app-sidebar, .app-footer { display: none !important; }
  .app-main { margin: 0 !important; }
  .card { box-shadow: none !important; }
  body { background: #fff !important; }
}
