/* =========================================================
   SIPESAT - Tampilan aplikasi
   Bootstrap 5.3 + gaya tambahan
   ========================================================= */
:root {
    --app-primary: #1450a3;
    --app-primary-dark: #0d3b7a;
    --app-primary-soft: #e8f0fc;
    --app-sidebar: #0f2240;
    --app-sidebar-2: #13294d;
    --app-sidebar-text: #b9c6dc;
    --app-bg: #f3f5f9;
    --app-border: #e4e8ef;
    --app-text: #1d2939;
    --app-muted: #667085;
    --app-purple: #6d3fd1;
    --app-radius: 14px;
    --sidebar-w: 264px;
    --bs-primary: #1450a3;
    --bs-primary-rgb: 20, 80, 163;
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: #1d2939;
    --bs-border-color: #e4e8ef;
    --bs-link-color: #1450a3;
    --bs-link-hover-color: #0d3b7a;
}

body.app-body {
    background: var(--app-bg);
    color: var(--app-text);
    font-size: .925rem;
}

.tiny { font-size: .72rem; }
.min-w-0 { min-width: 0; }
.text-purple { color: var(--app-purple) !important; }
.fw-semibold { font-weight: 600 !important; }

/* ---------- Tombol ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary { background: var(--app-primary); border-color: var(--app-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--app-primary-dark); border-color: var(--app-primary-dark); }
.btn-outline-primary { color: var(--app-primary); border-color: var(--app-primary); }
.btn-outline-primary:hover { background: var(--app-primary); border-color: var(--app-primary); }
.btn-purple { background: var(--app-purple); color: #fff; border-color: var(--app-purple); }
.btn-purple:hover { background: #5a2fb8; color: #fff; }
.btn-light { background: #f2f4f7; border-color: #eaecf0; }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--app-text); background: transparent; border: 0; }
.btn-icon:hover { background: #eef1f6; }
.btn-xs { padding: .2rem .5rem; font-size: .75rem; border-radius: 8px; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }
.app-sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--app-sidebar) 0%, var(--app-sidebar-2) 100%);
    color: var(--app-sidebar-text);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.app-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-logo { width: 42px; height: 42px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 5px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.logo-card { display: inline-block; background: #fff; border-radius: 14px; padding: .65rem 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.logo-card img { height: 64px; width: auto; display: block; }
.brand-name { color: #fff; font-weight: 800; letter-spacing: .5px; font-size: 1.1rem; line-height: 1.1; }
.brand-sub { font-size: .72rem; color: var(--app-sidebar-text); }
.sidebar-nav { padding: .75rem; overflow-y: auto; flex: 1; }
.nav-head { text-transform: uppercase; font-size: .66rem; letter-spacing: 1px; font-weight: 700; color: #7f8fab; padding: 1rem .75rem .4rem; }
.nav-item-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: var(--app-sidebar-text); text-decoration: none; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.nav-item-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item-link.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 #f5b000; }
.nav-item-link i { opacity: .9; }
.sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255,255,255,.06); }
.text-danger-soft { color: #ff9b9b !important; }
.sidebar-backdrop { display: none; }

.app-topbar { height: 66px; background: #fff; border-bottom: 1px solid var(--app-border); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 1030; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .3rem .6rem .3rem .3rem; border: 1px solid var(--app-border); border-radius: 999px; background: #fff; }
.user-chip:hover { background: #f8f9fb; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--app-primary-soft); color: var(--app-primary); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.notif-dot { position: absolute; top: 3px; right: 1px; background: #e5484d; color: #fff; border-radius: 999px; font-size: .62rem; font-weight: 700; padding: 1px 5px; line-height: 1.3; border: 2px solid #fff; }
.notif-menu { width: 340px; padding: 0; border-radius: 12px; overflow: hidden; }
.notif-item { display: flex; gap: .7rem; padding: .7rem 1rem; white-space: normal; border-bottom: 1px solid #f2f4f7; }
.notif-item:last-of-type { border-bottom: 0; }

.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .8rem; color: var(--app-muted); border-top: 1px solid var(--app-border); background: #fff; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.45rem; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.page-subtitle { color: var(--app-muted); margin: .25rem 0 0; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { font-size: .8rem; }
.breadcrumb a { text-decoration: none; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-main { margin-left: 0; }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,34,64,.45); z-index: 1035; }
    .app-content { padding: 1rem; }
    .app-topbar { padding: 0 1rem; }
}

/* ---------- Kartu ---------- */
.card { border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--app-border); padding: 1rem 1.25rem; border-radius: var(--app-radius) var(--app-radius) 0 0 !important; }
.card-header h5, .card-header h6, .card-title { font-weight: 700; margin: 0; }
.card-body { padding: 1.25rem; }
.card-footer { background: #fcfcfd; border-top: 1px solid var(--app-border); border-radius: 0 0 var(--app-radius) var(--app-radius) !important; }

.stat-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; height: 100%; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.08); color: inherit; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-label { color: var(--app-muted); font-size: .8rem; font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; }
.stat-sub { font-size: .75rem; color: var(--app-muted); }

.bg-soft-primary { background: #e8f0fc; color: #1450a3; }
.bg-soft-success { background: #e3f6ec; color: #0f8a4f; }
.bg-soft-warning { background: #fff4db; color: #b46a00; }
.bg-soft-danger  { background: #fdeaea; color: #c4282d; }
.bg-soft-info    { background: #e2f5fb; color: #0b7d9c; }
.bg-soft-purple  { background: #efe8fd; color: #6d3fd1; }
.bg-soft-secondary { background: #f2f4f7; color: #475467; }

/* ---------- Badge ---------- */
.badge { font-weight: 600; border-radius: 6px; padding: .38em .6em; }
.badge-soft-primary { background: #e8f0fc; color: #1450a3; }
.badge-soft-success { background: #e3f6ec; color: #0f8a4f; }
.badge-soft-warning { background: #fff4db; color: #a35f00; }
.badge-soft-danger  { background: #fdeaea; color: #c4282d; }
.badge-soft-info    { background: #e2f5fb; color: #0b7d9c; }
.badge-soft-purple  { background: #efe8fd; color: #6d3fd1; }
.badge-soft-secondary { background: #f2f4f7; color: #475467; }

/* ---------- Tabel ---------- */
.table { --bs-table-hover-bg: #f8fafc; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .9rem; border-color: #eef0f4; vertical-align: middle; }
.table thead th { background: #f8f9fc; color: #475467; font-size: .74rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--app-border); }
.table-card { border-radius: var(--app-radius); overflow: hidden; }
.cell-title { font-weight: 600; color: var(--app-text); }
.cell-sub { font-size: .78rem; color: var(--app-muted); }
.row-attention { background: #fffaf0; }
.row-attention > td:first-child { box-shadow: inset 3px 0 0 #f5b000; }
.row-resubmit > td:first-child { box-shadow: inset 3px 0 0 var(--app-purple); }
code.kode { background: #f2f4f7; color: #344054; padding: .1rem .4rem; border-radius: 5px; font-size: .78rem; }

/* ---------- Filter & tab ---------- */
.filter-bar { background: #fff; border: 1px solid var(--app-border); border-radius: var(--app-radius); padding: 1rem; margin-bottom: 1rem; }
.nav-tabs-pill { gap: .4rem; border: 0; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-pill .nav-link { border: 1px solid var(--app-border); background: #fff; color: #475467; border-radius: 999px; padding: .45rem 1rem; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: .4rem; }
.nav-tabs-pill .nav-link.active { background: var(--app-primary); color: #fff; border-color: var(--app-primary); }
.nav-tabs-pill .nav-link .count { background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 .5rem; font-size: .72rem; }
.nav-tabs-pill .nav-link.active .count { background: rgba(255,255,255,.22); }

/* ---------- Form ---------- */
.form-label { font-weight: 600; font-size: .85rem; color: #344054; margin-bottom: .35rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d0d5dd; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: #82a7e0; box-shadow: 0 0 0 .2rem rgba(20,80,163,.12); }
.form-text { font-size: .76rem; }
.input-group-text { border-radius: 10px; border-color: #d0d5dd; background: #f9fafb; }
.form-section { scroll-margin-top: 90px; }
.form-section .card-header { display: flex; align-items: center; gap: .75rem; }
.section-num { width: 30px; height: 30px; border-radius: 50%; background: var(--app-primary-soft); color: var(--app-primary); font-weight: 800; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.req::after { content: ' *'; color: #d92d20; }
.form-steps { position: sticky; top: 86px; }
.form-steps .step-link { display: flex; gap: .65rem; align-items: center; padding: .55rem .75rem; border-radius: 10px; color: #475467; text-decoration: none; font-weight: 600; font-size: .85rem; }
.form-steps .step-link:hover { background: #f2f4f7; }
.form-steps .step-link .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d0d5dd; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; }
.form-steps .step-link.done .dot { background: #12b76a; border-color: #12b76a; color: #fff; }
.rekening-row { display: flex; gap: .5rem; align-items: flex-start; padding: .6rem; border: 1px dashed #d0d5dd; border-radius: 10px; margin-bottom: .5rem; background: #fcfcfd; }
.rekening-row .rek-no { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: #fff; border: 1px solid var(--app-border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; margin-top: 4px; }
.rekening-row .rek-select { flex: 1; min-width: 0; }
.file-drop { border: 2px dashed #c7d2e3; border-radius: 12px; padding: 1rem; background: #fafbfe; }
.file-current { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--app-border); border-radius: 10px; background: #fff; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { border-radius: 10px !important; border-color: #d0d5dd !important; padding: .5rem .8rem !important; min-height: 40px; }
.ts-dropdown { border-radius: 10px; }
.ts-dropdown .option .opt-sub { display: block; font-size: .75rem; color: var(--app-muted); }

/* ---------- Kotak info ---------- */
.callout { border-radius: 12px; padding: 1rem 1.1rem; display: flex; gap: .8rem; border: 1px solid; }
.callout i.c-icon { font-size: 1.1rem; margin-top: .1rem; }
.callout-danger { background: #fff5f5; border-color: #fbd0d0; color: #7a1f22; }
.callout-warning { background: #fffbeb; border-color: #fde7a8; color: #7a4a00; }
.callout-info { background: #f0f6ff; border-color: #cfe0fb; color: #173d73; }
.callout-success { background: #effbf4; border-color: #c4ecd5; color: #0d5c37; }
.callout-purple { background: #f6f1ff; border-color: #ddcffb; color: #43218f; }

.jadwal-banner { border-radius: var(--app-radius); padding: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; border: 1px solid; }
.jadwal-banner.open { background: linear-gradient(90deg, #effbf4, #fff); border-color: #c4ecd5; }
.jadwal-banner.closed { background: linear-gradient(90deg, #fff5f5, #fff); border-color: #fbd0d0; }
.progress-thin { height: 6px; border-radius: 99px; background: #e9edf3; }

/* ---------- Detail ---------- */
.dl-grid { display: grid; grid-template-columns: 180px 1fr; gap: .55rem 1rem; margin: 0; }
.dl-grid dt { color: var(--app-muted); font-weight: 600; font-size: .82rem; }
.dl-grid dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dd { margin-bottom: .5rem; } }
.price-big { font-size: 1.6rem; font-weight: 800; color: var(--app-primary); letter-spacing: -.5px; }
.doc-tile { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border: 1px solid var(--app-border); border-radius: 12px; text-decoration: none; color: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.doc-tile:hover { border-color: #9bb8e6; box-shadow: 0 4px 12px rgba(20,80,163,.08); color: inherit; }
.doc-tile .doc-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.doc-preview { width: 100%; height: 520px; border: 1px solid var(--app-border); border-radius: 12px; background: #f8f9fb; }
.doc-preview-img { max-width: 100%; max-height: 520px; border-radius: 12px; border: 1px solid var(--app-border); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: #e4e8ef; }
.timeline li { position: relative; padding: 0 0 1.15rem 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-icon { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; border: 3px solid #fff; box-shadow: 0 0 0 1px #e4e8ef; }
.timeline .tl-title { font-weight: 700; font-size: .88rem; }
.timeline .tl-meta { font-size: .75rem; color: var(--app-muted); }
.timeline .tl-note { margin-top: .4rem; background: #f8f9fb; border: 1px solid #eef0f4; border-radius: 10px; padding: .55rem .75rem; font-size: .84rem; white-space: pre-line; }
.timeline .tl-note.danger { background: #fff5f5; border-color: #fbd0d0; }

.diff-table td { font-size: .82rem; }
.diff-old { color: #b42318; text-decoration: line-through; text-decoration-color: rgba(180,35,24,.4); }
.diff-new { color: #067647; font-weight: 600; }

/* ---------- Keputusan verifikasi ---------- */
.decision-card { position: relative; }
.decision-option { border: 2px solid var(--app-border); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; display: flex; gap: .75rem; align-items: center; transition: border-color .15s, background .15s; margin-bottom: .6rem; }
.decision-option:hover { border-color: #c7d2e3; }
.decision-option input { display: none; }
.decision-option .d-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.decision-option.selected-terima { border-color: #12b76a; background: #f3fcf7; }
.decision-option.selected-tolak { border-color: #f04438; background: #fff7f7; }
.reason-chip { display: inline-block; border: 1px solid var(--app-border); background: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .76rem; margin: 0 .3rem .4rem 0; cursor: pointer; font-weight: 500; }
.reason-chip:hover { border-color: #f04438; color: #b42318; }

/* ---------- Kosong ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--app-muted); }
.empty-state .es-icon { width: 72px; height: 72px; border-radius: 50%; background: #f2f4f7; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #98a2b3; margin-bottom: 1rem; }

.confirm-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--app-primary-soft); color: var(--app-primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.modal-content { border-radius: 16px; border: 0; }
.modal-header { border-bottom: 1px solid var(--app-border); }
.dropdown-menu { border-radius: 12px; border-color: var(--app-border); }
.alert { border-radius: 12px; }

.bar-row { margin-bottom: .85rem; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .3rem; }
.bar-track { height: 8px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--app-primary); }

/* ---------- Auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-hero { background: radial-gradient(circle at 20% 20%, #1d5fbf 0%, #0f2240 65%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: rgba(245,176,0,.12); }
.auth-hero h1 { font-weight: 800; font-size: 2.3rem; letter-spacing: -.5px; }
.auth-hero .feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; color: #d6e2f5; }
.auth-hero .feature i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: #f5b000; flex-shrink: 0; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form { width: 100%; max-width: 420px; }
@media (max-width: 991.98px) { .auth-page { grid-template-columns: 1fr; } .auth-hero { display: none; } }

/* ---------- Cetak ---------- */
@media print {
    .app-sidebar, .app-topbar, .app-footer, .page-actions, .filter-bar, .no-print, .btn, .pagination { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 0 !important; }
    body.app-body { background: #fff; }
}
