/* ============================================================
   SIRUNA - Sistem Informasi Rusunawa
   ============================================================ */
:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --sidebar-w: 258px;
    --bg: #f3f6f9;
}

body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.btn-brand { background: var(--brand); color: #fff; border: none; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }

/* ---------------- Landing ---------------- */
.landing { background: #fff; }
.landing-nav { transition: background .25s, box-shadow .25s; }
.landing-nav.scrolled { background: var(--brand); box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.hero { padding: 140px 0 90px; background: linear-gradient(135deg, var(--brand) 0%, #134e4a 60%, #0b3b37 100%); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero-stat { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 1rem; padding: 1.1rem; backdrop-filter: blur(4px); }
.hero-stat i { font-size: 1.5rem; opacity: .85; }
.feature-card { border: 1px solid #e5e7eb; border-radius: 1rem; padding: 1.25rem; background: #fff; }
.feature-card i { font-size: 1.8rem; color: var(--brand); }
.flow-step { background: #fff; border-radius: 1rem; padding: 1.5rem 1rem; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,.04); height: 100%; }
.flow-num { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; }

/* ---------------- Dashboard Layout ---------------- */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: #0f172a; color: #cbd5e1; overflow-y: auto; z-index: 1040; transition: transform .25s; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.2rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand small { display: block; font-size: .7rem; color: #94a3b8; font-weight: 400; }
.sidebar .menu-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem 1.2rem .35rem; }
.sidebar .nav-link { color: #cbd5e1; padding: .5rem 1.2rem; display: flex; align-items: center; gap: .65rem; font-size: .9rem; border-left: 3px solid transparent; }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar .nav-link.active { color: #fff; background: rgba(20,184,166,.15); border-left-color: #14b8a6; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: .6rem 1.25rem; position: sticky; top: 0; z-index: 1030; }
.content { padding: 1.25rem; flex: 1; }
.footer-app { padding: .9rem 1.25rem; font-size: .8rem; color: #6b7280; border-top: 1px solid #e5e7eb; background: #fff; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
    .main { margin-left: 0; }
}

.card { border: none; border-radius: .9rem; box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04); }
.grid-margin { margin-bottom: 1.25rem; }
.page-breadcrumb .breadcrumb { background: transparent; padding: 0; margin-bottom: 1rem; font-size: .85rem; }
.page-breadcrumb a { text-decoration: none; }
.nav-tabs-line .nav-link { border: none; border-bottom: 2px solid transparent; color: #64748b; }
.nav-tabs-line .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.table > :not(caption) > * > * { vertical-align: middle; font-size: .875rem; }
.table thead th { white-space: nowrap; background: #f8fafc; font-weight: 600; color: #334155; }

/* Stat cards */
.stat-card { border-radius: .9rem; padding: 1.1rem 1.2rem; color: #fff; position: relative; overflow: hidden; height: 100%; }
.stat-card .stat-icon { position: absolute; right: 12px; top: 10px; font-size: 2.6rem; opacity: .25; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: .82rem; opacity: .9; }
.bg-g1 { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.bg-g2 { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.bg-g3 { background: linear-gradient(135deg, #15803d, #22c55e); }
.bg-g4 { background: linear-gradient(135deg, #b45309, #f59e0b); }
.bg-g5 { background: linear-gradient(135deg, #7e22ce, #a855f7); }
.bg-g6 { background: linear-gradient(135deg, #be123c, #f43f5e); }
.bg-g7 { background: linear-gradient(135deg, #0e7490, #06b6d4); }
.bg-g8 { background: linear-gradient(135deg, #334155, #64748b); }

/* Denah unit */
.denah-row { display: flex; align-items: stretch; gap: .4rem; margin-bottom: .4rem; }
.denah-lantai { width: 70px; flex-shrink: 0; background: #e2e8f0; border-radius: .5rem; font-size: .75rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.denah-unit { flex: 1; min-width: 64px; border-radius: .5rem; padding: .45rem .3rem; text-align: center; font-size: .75rem; color: #fff; cursor: pointer; transition: transform .1s; }
.denah-unit:hover { transform: scale(1.05); }
.denah-unit.Kosong { background: #22c55e; }
.denah-unit.Terisi { background: #3b82f6; }
.denah-unit.Renovasi { background: #f59e0b; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }

/* Kartu ID QR */
.id-card { width: 340px; max-width: 100%; border-radius: 1rem; overflow: hidden; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.id-card .id-head { background: linear-gradient(135deg, var(--brand), #134e4a); color: #fff; padding: .8rem 1rem; }
.id-card .id-body { padding: 1rem; display: flex; gap: 1rem; align-items: center; }

.timeline { list-style: none; padding-left: 1rem; border-left: 2px solid #e2e8f0; }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -1.43rem; top: .25rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand); }

.berkas-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: .5rem; border: 1px solid #e5e7eb; }
.notif-item.unread { background: #f0fdfa; }

@media print {
    .sidebar, .topbar, .footer-app, .no-print { display: none !important; }
    .main { margin: 0; }
}
