@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 292px;
    --primary: #0f2f57;
    --primary-2: #143f73;
    --accent: #f97316;
    --body-bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #e6eaf0;
    --shadow: 0 16px 40px rgba(15, 47, 87, .08);
}

* { letter-spacing: -.01em; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--body-bg);
    color: var(--text);
    font-size: .94rem;
}
.app-wrapper { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b2442 0%, #10365f 58%, #0f2f57 100%);
    color: #fff;
    padding: 1.05rem .95rem;
    overflow-y: auto;
    z-index: 1030;
    box-shadow: 12px 0 40px rgba(15, 47, 87, .14);
}
.sidebar-brand {
    display: flex;
    gap: .8rem;
    align-items: center;
    padding: .9rem .65rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: .85rem;
}
.brand-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    font-size: 1.35rem;
    box-shadow: 0 12px 22px rgba(249,115,22,.28);
}
.brand-title { font-weight: 800; line-height: 1.1; font-size: 1.05rem; }
.sidebar-brand small { color: rgba(255,255,255,.72); }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .72rem;
    color: rgba(255,255,255,.82);
    text-decoration: none;
    padding: .74rem .78rem;
    border-radius: 14px;
    margin-bottom: .22rem;
    font-size: .91rem;
    font-weight: 600;
    transition: .16s ease;
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,.14);
    color: #fff;
    transform: translateX(2px);
}
.sidebar-nav a span { margin-left: auto; font-size: .68rem; opacity: .66; }
.disabled-link { pointer-events: none; opacity: .56; }
.topbar, .content-area, .footer { margin-left: var(--sidebar-width); }
.topbar {
    min-height: 76px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.6rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar h1 { font-weight: 800; }
.content-area { padding: 1.6rem; }
.footer {
    padding: 1rem 1.6rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .86rem;
}
.card, .modal-content {
    border: 1px solid rgba(230,234,240,.75) !important;
    border-radius: 20px !important;
    box-shadow: var(--shadow);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    border-radius: 20px 20px 0 0 !important;
    font-weight: 700;
}
.stat-card {
    border: none !important;
    border-radius: 22px !important;
    box-shadow: var(--shadow);
    height: 100%;
    overflow: hidden;
}
.stat-card .icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eef5ff;
    color: var(--primary);
    font-size: 1.22rem;
}
.btn { border-radius: 12px; font-weight: 700; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.form-control, .form-select, .input-group-text {
    border-radius: 12px;
    border-color: #d9e0ea;
    min-height: 42px;
}
.input-group .form-control { border-radius: 0 12px 12px 0; }
.input-group .input-group-text { border-radius: 12px 0 0 12px; }
.form-label { font-weight: 700; color: #344054; font-size: .88rem; }
.table { --bs-table-hover-bg: #f7faff; }
.table th {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475467;
    font-weight: 800;
    background: #f8fafc !important;
    border-bottom: 1px solid var(--border);
}
.table td { vertical-align: middle; color: #1f2937; }
.badge { font-weight: 700; letter-spacing: 0; }
.alert { border-radius: 16px; }
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(249,115,22,.34) 0, transparent 30%),
        radial-gradient(circle at bottom right, rgba(20,63,115,.36) 0, transparent 33%),
        linear-gradient(135deg, #0f2f57 0%, #071526 100%);
    display: grid;
    place-items: center;
    padding: 1rem;
}
.login-card {
    width: min(440px, 100%);
    border: none !important;
    border-radius: 28px !important;
    box-shadow: 0 28px 78px rgba(0,0,0,.28);
}
.page-title h1, .content-area h1.h3 { font-weight: 800; }
@media print {
    body { background: #fff; font-size: 11pt; }
    .sidebar, .topbar, .footer, .no-print, .btn { display: none !important; }
    .content-area { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: none !important; }
}
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.show { transform: translateX(0); }
    .topbar, .content-area, .footer { margin-left: 0; }
    .content-area { padding: 1rem; }
}

.dashboard-hero {
    background:
        radial-gradient(circle at top right, rgba(249,115,22,.10) 0, transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}
.dashboard-logo-wrap {
    width: 92px;
    height: 92px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 16px 34px rgba(15, 47, 87, .10);
    display: grid;
    place-items: center;
    padding: .65rem;
}
.dashboard-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.dashboard-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-size: 2rem;
}
@media (max-width: 575.98px) {
    .dashboard-logo-wrap { width: 72px; height: 72px; border-radius: 20px; }
    .dashboard-hero .h3 { font-size: 1.25rem; }
}

/* Panel brand memakai identitas dari Setting Kwitansi */
.brand-logo-wrap {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.24);
    box-shadow: 0 12px 22px rgba(0,0,0,.14);
    padding: .42rem;
    overflow: hidden;
}
.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.brand-icon.brand-icon-fallback {
    min-width: 46px;
}
.sidebar-brand .brand-title {
    max-width: 185px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.sidebar-brand .brand-subtitle {
    display: block;
    max-width: 185px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.topbar-brand-logo {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(15,47,87,.08);
    padding: .35rem;
    overflow: hidden;
}
.topbar-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.topbar-brand-logo .fallback-icon {
    color: var(--primary);
    font-size: 1.3rem;
}
.topbar-subtitle {
    display: block;
    max-width: min(60vw, 620px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .topbar-brand-logo { display: none; }
    .topbar-subtitle { max-width: 56vw; }
}

/* Patch Profesionalisasi Modul Pinjaman, Kas, dan WhatsApp */
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.app-card {
    border: 0 !important;
    border-radius: 1.1rem !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07) !important;
    overflow: hidden;
}
.metric-card {
    border-radius: 1.1rem;
    padding: 1.1rem 1.2rem;
    min-height: 122px;
    color: #0f172a;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .07);
    border: 1px solid rgba(148, 163, 184, .18);
}
.metric-label {
    color: #64748b;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.metric-value {
    margin-top: .35rem;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.02em;
}
.metric-note {
    margin-top: .35rem;
    color: #64748b;
    font-size: .82rem;
}
.metric-primary { border-left: 5px solid #2563eb; }
.metric-success { border-left: 5px solid #16a34a; }
.metric-danger { border-left: 5px solid #dc2626; }
.metric-neutral { border-left: 5px solid #64748b; }
.professional-table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .035em;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.professional-table tbody td {
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px dashed #e2e8f0;
}
.summary-line span { color: #64748b; }
.summary-line strong { text-align: right; }
.feature-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-size: 1.35rem;
}
.feature-icon.success { background: #dcfce7; color: #15803d; }
.feature-icon.primary { background: #dbeafe; color: #1d4ed8; }
.feature-icon.danger { background: #fee2e2; color: #b91c1c; }
@media (max-width: 768px) {
    .metric-value { font-size: 1.1rem; }
    .page-heading { align-items: flex-start; }
}

/* Patch role/login identity */
.login-card-modern .login-logo-wrap {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
    overflow: hidden;
}
.login-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.topbar-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 3px;
}
