/* =========================================================
   KLAIM SBS — Design System
   ========================================================= */

:root {
    --sbs-primary: #1d4ed8;
    --sbs-primary-2: #2563eb;
    --sbs-ink: #0f172a;
    --sbs-muted: #64748b;
    --sbs-bg: #f1f5f9;
    --sbs-card: #ffffff;
    --sbs-line: #e2e8f0;
    --sbs-radius: 16px;
    --sbs-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);

    --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --bs-body-color: var(--sbs-ink);
    --bs-body-bg: var(--sbs-bg);
    --bs-primary: var(--sbs-primary);
    --bs-primary-rgb: 29, 78, 216;
    --bs-link-color: var(--sbs-primary);
    --bs-link-color-rgb: 29, 78, 216;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 14px;
}

body {
    background: var(--sbs-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.btn { font-weight: 600; border-radius: 10px; }
.btn-primary { --bs-btn-bg: var(--sbs-primary); --bs-btn-border-color: var(--sbs-primary); --bs-btn-hover-bg: #1e40af; --bs-btn-hover-border-color: #1e40af; --bs-btn-active-bg: #1e3a8a; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--sbs-line); }
.form-control, .form-select, .input-group-text { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { border-color: var(--sbs-primary-2); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.form-label { font-weight: 600; font-size: .875rem; color: #334155; margin-bottom: .35rem; }
.min-w-0 { min-width: 0; }

/* ---------- NAVBAR ---------- */
.app-navbar {
    background: linear-gradient(120deg, #1e3a8a, var(--sbs-primary) 55%, var(--sbs-primary-2));
    padding: .6rem 0;
    box-shadow: 0 2px 12px rgba(30, 58, 138, .25);
}
.app-navbar .navbar-brand { color: #fff; font-size: 1.05rem; }
.app-navbar .brand-logo { background: #fff; border-radius: 10px; padding: 3px; object-fit: contain; }
.app-navbar .brand-sub { color: rgba(255, 255, 255, .7); font-size: .72rem; font-weight: 500; margin-top: 3px; }
.user-chip {
    color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px; padding: .3rem .8rem .3rem .3rem; display: flex; align-items: center; gap: .5rem;
}
.user-chip:hover, .user-chip:focus, .user-chip.show { color: #fff; background: rgba(255, 255, 255, .24); }
.user-chip .avatar {
    width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--sbs-primary);
    display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}

/* ---------- HERO ---------- */
.page-hero {
    background: linear-gradient(120deg, #1e3a8a, var(--sbs-primary) 55%, var(--sbs-primary-2));
    color: #fff;
    padding: 1.75rem 0 4.5rem;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: ""; position: absolute; right: -80px; top: -120px; width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%);
}
.hero-eyebrow { color: rgba(255, 255, 255, .75); font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
.hero-title { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 800; margin: 0 0 .25rem; }
.hero-sub { color: rgba(255, 255, 255, .85); }
.page-body { margin-top: -3rem; position: relative; z-index: 1; padding-bottom: 3rem; }
.page-body.pt-4 { margin-top: 0; }

.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sbs-muted); font-weight: 700; margin-bottom: .75rem; }

/* ---------- STAT CARD ---------- */
.stat-card {
    display: flex; flex-direction: column; gap: .15rem; height: 100%;
    background: var(--sbs-card); border-radius: var(--sbs-radius); padding: 1rem 1.1rem;
    box-shadow: var(--sbs-shadow); text-decoration: none; color: var(--sbs-ink);
    border-top: 4px solid var(--tone); transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); color: var(--sbs-ink); }
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem;
    background: color-mix(in srgb, var(--tone) 14%, white); color: var(--tone); margin-bottom: .35rem;
}
.stat-label { font-size: .8rem; color: var(--sbs-muted); font-weight: 600; }
.stat-label small { font-weight: 500; opacity: .8; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.stat-sub { font-size: .85rem; font-weight: 600; color: #334155; }
.stat-all { font-size: .72rem; color: var(--sbs-muted); margin-top: .25rem; }
.stat-warning { --tone: #d97706; }
.stat-success { --tone: #16a34a; }
.stat-primary { --tone: #2563eb; }
.stat-danger  { --tone: #dc2626; }

.mini-stat {
    background: var(--sbs-card); border-radius: var(--sbs-radius); box-shadow: var(--sbs-shadow);
    padding: .85rem 1rem; height: 100%; display: flex; flex-direction: column; gap: .2rem;
}
.mini-stat span { font-size: .75rem; color: var(--sbs-muted); font-weight: 600; }
.mini-stat strong { font-size: 1.35rem; font-weight: 800; line-height: 1.2; word-break: break-word; }

/* ---------- ACTION TILES ---------- */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.action-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .6rem;
    background: var(--sbs-card); border: 1px solid transparent; border-radius: var(--sbs-radius);
    padding: 1rem; box-shadow: var(--sbs-shadow); color: var(--sbs-ink); font-weight: 700; text-align: left;
    text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.action-tile i {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
    background: color-mix(in srgb, var(--tone) 13%, white); color: var(--tone);
}
.action-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 35%, white); color: var(--sbs-ink); }
.action-tile:active { transform: translateY(0); }
.tone-success { --tone: #16a34a; }
.tone-dark { --tone: #334155; }
.tone-warning { --tone: #d97706; }
.tone-info { --tone: #0891b2; }
.tone-primary { --tone: #2563eb; }
.tone-danger { --tone: #dc2626; }
.tone-secondary { --tone: #64748b; }

/* ---------- TABS & DATA ---------- */
.app-tabs { gap: .5rem; flex-wrap: nowrap; overflow-x: auto; }
.app-tabs .nav-link {
    background: var(--sbs-card); color: #334155; font-weight: 600; border-radius: 999px;
    padding: .5rem 1rem; box-shadow: var(--sbs-shadow); white-space: nowrap;
}
.app-tabs .nav-link.active { background: var(--sbs-primary); color: #fff; }

.data-card, .detail-card { border: 0; border-radius: var(--sbs-radius); box-shadow: var(--sbs-shadow); }
.app-table { --bs-table-hover-bg: #f8fafc; }
.app-table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sbs-muted);
    background: #f8fafc; border-bottom: 1px solid var(--sbs-line); white-space: nowrap; font-weight: 700;
}
.app-table td { border-color: #f1f5f9; }
.thumb {
    width: 48px; height: 48px; object-fit: cover; border-radius: 10px; background: #f1f5f9;
    border: 1px solid var(--sbs-line); flex-shrink: 0;
}
.thumb-empty { display: grid; place-items: center; color: #94a3b8; }
.claim-list .list-group-item { border-color: #f1f5f9; }
.claim-list .list-group-item:hover { background: #f8fafc; }
.pagination { --bs-pagination-border-radius: 8px; --bs-pagination-active-bg: var(--sbs-primary); --bs-pagination-active-border-color: var(--sbs-primary); gap: 4px; }
.pagination .page-link { border-radius: 8px !important; }

/* ---------- DETAIL ---------- */
.detail-card .card-header { background: #fff; border-bottom: 1px solid var(--sbs-line); padding: 1rem 1.25rem; border-radius: var(--sbs-radius) var(--sbs-radius) 0 0; }
.evidence {
    display: block; position: relative; border-radius: 14px; overflow: hidden; background: #0f172a;
    aspect-ratio: 3 / 4; max-height: 560px; margin-inline: auto;
}
@media (max-width: 767.98px) { .evidence { max-height: 420px; } }
.evidence img { width: 100%; height: 100%; object-fit: contain; }
.evidence-zoom {
    position: absolute; right: 10px; bottom: 10px; background: rgba(15, 23, 42, .7); color: #fff;
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
}
.evidence-empty { display: grid; place-content: center; justify-items: center; gap: .5rem; color: #94a3b8; background: #f1f5f9; font-size: .9rem; }
.evidence-empty i { font-size: 2.5rem; }
.amount-box {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    background: linear-gradient(120deg, #eff6ff, #f8fafc); border: 1px solid #dbeafe; border-radius: 14px; padding: 1rem 1.1rem;
}
.amount { font-size: 1.6rem; font-weight: 800; color: var(--sbs-primary); }
.detail-list { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; margin: 0; }
.detail-list dt, .detail-list dd { padding: .6rem 0; border-bottom: 1px solid #f1f5f9; margin: 0; }
.detail-list dt { color: var(--sbs-muted); font-weight: 500; font-size: .875rem; }
.detail-list dd { font-weight: 500; word-break: break-word; }
.faktur-chip { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; border-radius: 8px; padding: .3rem .6rem; font-size: .85rem; }
.map-box { height: 380px; border-radius: 14px; overflow: hidden; border: 1px solid var(--sbs-line); }
.status-form .btn { padding: .65rem 1rem; }

/* ---------- MODAL ---------- */
.sbs-modal .modal-content { border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.sbs-modal .modal-header {
    background: linear-gradient(120deg, #1e3a8a, var(--sbs-primary)); color: #fff; border: 0; gap: .75rem; padding: 1rem 1.25rem;
}
.sbs-modal .modal-title { font-weight: 700; margin: 0; }
.sbs-modal .modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.sbs-modal .modal-body { padding: 1.25rem; }
.sbs-modal .modal-footer { border-top: 1px solid var(--sbs-line); background: #f8fafc; }
@media (max-width: 575.98px) {
    .sbs-modal .modal-content { border-radius: 0; }
    .sbs-modal .modal-footer .btn { flex: 1; }
}

.total-box {
    display: flex; justify-content: space-between; align-items: center;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: .75rem 1rem;
}
.total-box span { color: #166534; font-weight: 600; font-size: .875rem; }
.total-box strong { color: #15803d; font-size: 1.3rem; font-weight: 800; }

.upload-drop {
    display: block; position: relative; cursor: pointer; border: 2px dashed #cbd5e1; border-radius: 14px;
    background: #f8fafc; min-height: 120px; overflow: hidden; transition: border-color .15s, background .15s;
}
.upload-drop:hover { border-color: var(--sbs-primary-2); background: #eff6ff; }
.upload-drop.is-invalid { border-color: var(--bs-danger); background: #fef2f2; }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-hint { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; padding: 1.25rem; color: #475569; font-weight: 600; text-align: center; pointer-events: none; }
.upload-hint i { font-size: 1.8rem; color: var(--sbs-primary-2); }
.upload-hint small { color: var(--sbs-muted); font-weight: 500; }
.upload-preview { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #0f172a; }
.upload-drop.has-file .upload-hint { padding: .6rem; flex-direction: row; gap: .5rem; }
.upload-drop.has-file .upload-hint i { font-size: 1.1rem; }
.upload-drop.has-file .upload-hint small { display: none; }

.camera-box { position: relative; background: #0f172a; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 380px; }
.camera-box video, .camera-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.camera-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #e2e8f0; padding: 1rem; font-size: .9rem; }

.select2-container--default .select2-selection--single { height: 38px; border-color: #cbd5e1; border-radius: 10px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: 12px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.select2-dropdown { border-color: #cbd5e1; border-radius: 10px; overflow: hidden; }

/* ---------- LOGIN ---------- */
.page-login { background: #0f172a; }
.page-login::before {
    content: ""; position: fixed; inset: 0; z-index: -2;
    background: url("../sbsslide1.jpg") center / cover no-repeat; filter: blur(12px); transform: scale(1.08);
}
.page-login::after { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(160deg, rgba(30, 58, 138, .82), rgba(2, 6, 23, .78)); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.login-card {
    width: 100%; max-width: 410px; background: rgba(255, 255, 255, .97); border-radius: 22px;
    padding: 2rem 1.75rem; box-shadow: 0 30px 70px rgba(0, 0, 0, .45); animation: rise .5s ease;
}
.login-logo { width: 76px; height: 76px; margin: 0 auto 1rem; border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(29, 78, 216, .25); display: grid; place-items: center; }
.login-logo img { width: 60px; height: 60px; object-fit: contain; }
.login-card .input-group .form-floating .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------- HALAMAN TENGAH (hasil / pesan) ---------- */
.page-center { display: grid; place-items: center; padding: 1.5rem 1rem; background: linear-gradient(160deg, #e0e7ff, var(--sbs-bg) 45%); }
.result-card { width: 100%; max-width: 460px; border: 0; border-radius: 22px; box-shadow: 0 24px 60px rgba(15, 23, 42, .15); animation: rise .4s ease; }
.result-icon { font-size: 3.5rem; line-height: 1; }
.result-list { display: grid; grid-template-columns: auto 1fr; gap: 0; margin: 0; background: #f8fafc; border-radius: 14px; padding: .25rem 1rem; }
.result-list dt, .result-list dd { padding: .55rem 0; margin: 0; border-bottom: 1px solid var(--sbs-line); }
.result-list dt { color: var(--sbs-muted); font-weight: 500; padding-right: 1rem; }
.result-list dd { text-align: right; font-weight: 600; word-break: break-all; }
.result-list dt:last-of-type, .result-list dd:last-of-type { border-bottom: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
