/* IPMS Lite — gaya aplikasi di atas Bootstrap 5 */
:root {
    --ipms-primary: #1e40af;
    --ipms-sidebar-bg: #0f172a;
    --ipms-sidebar-fg: #cbd5e1;
    --ipms-sidebar-active: #1e3a8a;
    --ipms-sidebar-width: 260px;
    --ipms-body-bg: #f1f5f9;
    --bs-primary: #1e40af;
    --bs-primary-rgb: 30, 64, 175;
    --bs-link-color: #1d4ed8;
    --bs-link-color-rgb: 29, 78, 216;
}

.btn-primary {
    --bs-btn-bg: #1e40af; --bs-btn-border-color: #1e40af;
    --bs-btn-hover-bg: #1e3a8a; --bs-btn-hover-border-color: #1e3a8a;
    --bs-btn-active-bg: #1e3a8a; --bs-btn-active-border-color: #1e3a8a;
    --bs-btn-disabled-bg: #1e40af; --bs-btn-disabled-border-color: #1e40af;
}
.btn-outline-primary {
    --bs-btn-color: #1e40af; --bs-btn-border-color: #1e40af;
    --bs-btn-hover-bg: #1e40af; --bs-btn-hover-border-color: #1e40af;
    --bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af;
}
.text-bg-primary { background-color: #1e40af !important; }
.page-link { --bs-pagination-active-bg: #1e40af; --bs-pagination-active-border-color: #1e40af; }

body.app-body { background: var(--ipms-body-bg); min-height: 100vh; }
.min-w-0 { min-width: 0; }

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1 1 auto; padding: 1.5rem; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .75rem 1.5rem; font-size: .75rem; color: #64748b; border-top: 1px solid #e2e8f0; background: #fff; }

/* Sidebar */
.sidebar { background: var(--ipms-sidebar-bg) !important; color: var(--ipms-sidebar-fg); width: var(--ipms-sidebar-width); }
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--ipms-sidebar-width); overflow-y: auto; display: flex; flex-direction: column; }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: var(--ipms-sidebar-width); --bs-offcanvas-bg: var(--ipms-sidebar-bg); }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #1e3a8a); color: #fff; font-size: 1.15rem; }
.brand-mark-lg { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 14px; }
.brand-name { display: block; color: #fff; font-weight: 700; line-height: 1.1; }
.brand-sub { display: block; color: #94a3b8; font-size: .7rem; }
.sidebar-nav { padding: .75rem .75rem 1.5rem; flex: 1 1 auto; width: 100%; }
.sidebar-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; color: #64748b; padding: 1rem .75rem .35rem; font-weight: 600; }
.sidebar-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: .5rem; color: var(--ipms-sidebar-fg); text-decoration: none; font-size: .9rem; }
.sidebar-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: var(--ipms-sidebar-active); color: #fff; font-weight: 600; }
.sidebar-link.disabled { opacity: .5; cursor: not-allowed; font-size: .82rem; }
.sidebar-link.disabled:hover { background: transparent; color: var(--ipms-sidebar-fg); }
.sidebar-link .badge { font-size: .6rem; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .65rem 1.5rem; background: #fff; border-bottom: 1px solid #e2e8f0; }
.topbar-title { font-weight: 600; color: #334155; min-width: 0; }
.user-menu { border: 1px solid #e2e8f0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #dbeafe; color: #1e40af; font-weight: 700; font-size: .8rem; flex-shrink: 0; }

/* Page */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.card { border: 1px solid #e2e8f0; border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid #e2e8f0; font-weight: 600; padding: .85rem 1.1rem; border-top-left-radius: .75rem !important; border-top-right-radius: .75rem !important; }
.card-header .small, .card-header small { font-weight: 400; }

/* Stat cards */
.stat-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: row; align-items: center; gap: 1rem; height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; color: #0f172a; }
.stat-label { font-size: .8rem; color: #64748b; margin-top: .25rem; }
.bg-soft-primary { background: #dbeafe; color: #1e40af; }
.bg-soft-success { background: #dcfce7; color: #15803d; }
.bg-soft-danger { background: #fee2e2; color: #b91c1c; }
.bg-soft-warning { background: #fef3c7; color: #b45309; }
.bg-soft-info { background: #cffafe; color: #0e7490; }
.bg-soft-secondary { background: #e2e8f0; color: #334155; }
a.stat-link { text-decoration: none; color: inherit; display: block; height: 100%; }
a.stat-link:hover .card { border-color: #93c5fd; }

/* Tables */
.table-app { margin-bottom: 0; }
.table-app thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; background: #f8fafc; font-weight: 600; white-space: nowrap; border-bottom-width: 1px; }
.table-app td { vertical-align: middle; }
.table-app tbody tr:hover { background: #f8fafc; }
.progress-sm { height: 6px; }
.progress-inline { display: flex; align-items: center; gap: .5rem; min-width: 110px; }
.progress-inline .progress { flex: 1 1 auto; }
.filter-bar { background: #fff; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .85rem; margin-bottom: 1rem; }

/* Empty state */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: #64748b; }
.empty-state > i { font-size: 2.4rem; color: #cbd5e1; display: block; margin-bottom: .5rem; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; border-left: 2px solid #e2e8f0; margin-left: .4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #3b82f6; }
.timeline .time { font-size: .75rem; color: #64748b; }

/* Detail list */
.detail-list dt { font-weight: 500; color: #64748b; font-size: .82rem; }
.detail-list dd { margin-bottom: .75rem; }
.prewrap { white-space: pre-wrap; word-break: break-word; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.photo-grid a { display: block; border-radius: .5rem; overflow: hidden; border: 1px solid #e2e8f0; aspect-ratio: 4 / 3; background: #f8fafc; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }

/* Forms */
.form-label { font-weight: 500; font-size: .875rem; }
.required::after { content: " *"; color: #dc2626; }
.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }

/* Guest */
.guest-body { min-height: 100vh; background: radial-gradient(circle at top left, #1e40af, #0f172a 60%); }
.guest-wrapper { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.guest-card { width: 100%; max-width: 420px; background: #fff; border-radius: 1rem; padding: 2rem; box-shadow: 0 20px 40px rgba(0,0,0,.25); }

@media (max-width: 575.98px) {
    .app-content { padding: 1rem; }
    .topbar { padding: .6rem 1rem; }
    .guest-card { padding: 1.5rem; }
    .stat-value { font-size: 1.35rem; }
}
