:root {
    --primary: #198754;
    --primary-dark: #146c43;
    --sidebar-width: 280px;
    --bg-soft: #f5f7fb;
}

body {
    background: var(--bg-soft);
    min-height: 100vh;
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #e9f7ef, #ffffff 55%, #edf4ff);
}

.login-card {
    max-width: 430px;
    width: 100%;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
}

.app-wrapper {
    min-height: calc(100vh - 58px);
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: #0f172a;
    color: #fff;
    z-index: 1030;
}

.sidebar-brand {
    min-height: 73px;
    padding: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.sidebar-menu {
    padding: 14px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.86);
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 12px;
    margin-bottom: 4px;
    transition: .15s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.09);
    color: #fff;
}

.sidebar-link.disabled {
    opacity: .72;
    cursor: not-allowed;
}

.mobile-menu .sidebar-link {
    color: #1f2937;
}

.mobile-menu .sidebar-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.navbar,
.footer,
.main-content {
    margin-left: var(--sidebar-width);
}

.main-content {
    padding: 24px;
}

.stat-card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9f7ef;
    font-size: 22px;
}

.content-card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

@media (max-width: 991.98px) {
    .navbar,
    .footer,
    .main-content {
        margin-left: 0;
    }

    .main-content {
        padding: 16px;
    }
}


.table-photo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: #e9ecef;
}

.detail-photo {
    width: 140px;
    height: 180px;
    border-radius: 16px;
    object-fit: cover;
    background: #e9ecef;
}

.form-help {
    font-size: .85rem;
    color: #6c757d;
}

.required::after {
    content: ' *';
    color: #dc3545;
}

.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table-cover {
    width: 52px;
    height: 68px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.preview-cover {
    max-width: 120px;
    max-height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.detail-cover {
    width: 220px;
    max-width: 100%;
    min-height: 280px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.empty-cover {
    height: 280px;
    margin-left: auto;
    margin-right: auto;
}

/* Tahap 7 - E-Library */
.ebook-card {
    overflow: hidden;
}
.ebook-cover {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f3f6f4;
    border-bottom: 1px solid #e7ece9;
}
.ebook-reader iframe {
    border: 1px solid #dfe7e2;
    border-radius: 12px;
    background: #fff;
}

/* Tahap 9 - Laporan dan print-friendly */
.laporan-table th, .laporan-table td { font-size: 0.86rem; }
.print-header h1 { font-size: 18px; margin-bottom: 4px; }
.print-header h2 { font-size: 16px; margin-top: 8px; }
@media print {
    .no-print, .sidebar, .navbar, .offcanvas, .btn { display: none !important; }
    .main-content { margin: 0 !important; padding: 0 !important; }
    .content-card, .card { border: none !important; box-shadow: none !important; }
    .card-body { padding: 0 !important; }
    body { background: #fff !important; font-size: 12px; }
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }
}

/* Tahap 10 - Kartu Anggota dan Label Buku */
.print-hint {
    border-left: 4px solid #198754;
    background: #f0fdf4;
    padding: 12px 14px;
    border-radius: 8px;
}

/* Tahap 11C - Identitas madrasah pada dashboard/sidebar/navbar */
.dashboard-identity-card {
    background: linear-gradient(135deg, #ffffff 0%, #f4fff8 100%);
}
.dashboard-logo {
    width: 78px;
    height: 78px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    padding: 8px;
}
.dashboard-logo-placeholder {
    width: 78px;
    height: 78px;
    border-radius: 14px;
    background: #198754;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.35rem;
}
.brand-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #ffffff;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.35);
}
.brand-name {
    max-width: 145px;
    white-space: normal;
    line-height: 1.15;
}
.min-w-0 { min-width: 0; }

/* Tahap 11D - Format Formal Laporan */
.laporan-formal-screen {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
}
.laporan-kop { margin-bottom: 12px; color: #111; }
.laporan-kop-table { width: 100%; border-collapse: collapse; border: none; margin: 0; }
.laporan-kop-table td { border: none !important; padding: 0; vertical-align: middle; }
.laporan-kop-logo { width: 86px; text-align: left; }
.laporan-kop-logo img { width: 76px; height: 76px; object-fit: contain; }
.laporan-kop-identitas { text-align: center; padding-right: 86px !important; }
.laporan-kop-kementerian { font-size: 13px; font-weight: 700; letter-spacing: .4px; }
.laporan-kop-nama { font-size: 20px; font-weight: 800; text-transform: uppercase; line-height: 1.2; margin-top: 2px; }
.laporan-kop-meta, .laporan-kop-alamat, .laporan-kop-kontak { font-size: 11px; line-height: 1.35; }
.laporan-kop-garis { border-top: 3px solid #111; border-bottom: 1px solid #111; height: 5px; margin-top: 8px; }
.laporan-judul-wrap { text-align: center; margin: 14px 0 10px; }
.laporan-judul { font-size: 15px; font-weight: 800; text-decoration: underline; }
.laporan-deskripsi { font-size: 11px; color: #444; margin-top: 3px; }
.laporan-info { font-size: 11px; margin: 8px 0 10px; }
.laporan-table-formal { width: 100%; border-collapse: collapse; margin-top: 8px; }
.laporan-table-formal th, .laporan-table-formal td { border: 1px solid #222 !important; padding: 5px; vertical-align: top; font-size: 10.5px; }
.laporan-table-formal th { background: #f0f0f0 !important; text-align: center; font-weight: 700; }
.laporan-summary { font-size: 11px; margin: 8px 0; }
.laporan-ttd { margin-top: 28px; page-break-inside: avoid; font-size: 11px; }
.laporan-ttd-table { width: 100%; border-collapse: collapse; border: none; margin-top: 4px; table-layout: fixed; }
.laporan-ttd-table td { width: 33.33%; border: none !important; text-align: center; vertical-align: top; padding: 0 10px; }
.laporan-ttd-table-11g .laporan-ttd-row-tempat td { height: 18px; vertical-align: bottom; }
.laporan-ttd-table-11g .laporan-ttd-tempat { text-align: center; padding-bottom: 4px; }
.laporan-ttd-table-11g .laporan-ttd-row-jabatan td { height: 20px; vertical-align: top; }
.laporan-ttd-space { height: 58px; }
.laporan-ttd-row-nama td { vertical-align: bottom; }
.laporan-ttd-nama { font-weight: 700; text-decoration: underline; }
.laporan-ttd-row-nip td { font-size: 10.5px; }
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    .laporan-formal-screen { display: none !important; }
    .laporan-formal-print { display: block !important; }
    .laporan-table-formal th, .laporan-table-formal td { font-size: 9.5px; padding: 4px; }
}
