/* Aplikasi Peminjaman Warkah — tampilan disamakan dengan aplikasi Kartu Kendali Berkas.
   Palet, tipografi, dan struktur diambil dari assets/justisia.css (yang juga ditulis
   untuk menyamakan tampilan dengan Kartu Kendali). Berkas asli tidak diubah. */

:root {
    --primary: #1a4f8b;
    --primary-hover: #133c6e;
    --primary-light: #dbeafe;
    --secondary: #d4a017;
    --bg-body: #f8fafc;
    --surface: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, .08);
    --transition: all .25s cubic-bezier(.4, 0, .2, 1);
    font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Outfit', system-ui, sans-serif; background: var(--bg-body); color: var(--text-dark); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; line-height: 1.25; }
h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
p { margin-bottom: 14px; }
small { font-size: .85rem; }
:focus-visible { outline: 3px solid rgba(26, 79, 139, .35); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 15px; top: -80px; z-index: 200; padding: 12px 20px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.skip-link:focus { top: 12px; }

/* ── Kerangka: sidebar tetap + area kerja ─────────────── */
.app-shell { display: block; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 50;
    background: linear-gradient(180deg, #1e3a62 0%, #0f2b48 100%);
    color: #f8fafc; border-right: 1px solid rgba(255, 255, 255, .06);
    display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .05); text-decoration: none; color: #f8fafc; }
.brand img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .4)); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0; border-radius: var(--radius-md); background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; font-size: 20px; }
.brand strong { display: block; font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand small { display: block; font-size: 11px; color: #cbd5e1; margin-top: 3px; font-weight: 400; }
.nav-caption { display: block; padding: 20px 20px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: #94a3b8; text-transform: uppercase; }
#module-nav { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.nav-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    padding: 12px 14px; border: 1px solid transparent; border-radius: var(--radius-md);
    background: transparent; color: #cbd5e1; font-size: 14px; font-weight: 500; text-align: left;
    transition: var(--transition); white-space: nowrap; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.is-active { background: var(--primary); color: #fff; box-shadow: 0 4px 15px rgba(26, 79, 139, .5); }
.nav-symbol { font-size: 11px; font-weight: 600; color: #94a3b8; font-variant-numeric: tabular-nums; }
.nav-item.is-active .nav-symbol { color: rgba(255, 255, 255, .8); }
.sidebar-footer { margin-top: auto; padding: 24px 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-footer p { font-size: 12px; line-height: 1.7; color: #94a3b8; margin-bottom: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: #e2e8f0; font-size: 13px; font-weight: 500; text-decoration: none; }
.back-link:hover { color: #fff; text-decoration: underline; }

.workspace { margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    height: 70px; background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .03);
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 0 32px; position: sticky; top: 0; z-index: 40;
}
.institution-label { font-size: 13px; font-weight: 700; color: var(--text-dark); letter-spacing: -.01em; }
.user-summary { display: flex; align-items: center; gap: 14px; min-width: 0; }
.user-profile { display: flex; align-items: center; gap: 12px; padding: 6px 14px; border-radius: 40px; background: #f8fafc; border: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #3b82f6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; box-shadow: 0 2px 8px rgba(37, 99, 235, .3); }
.user-info { display: flex; flex-direction: column; min-width: 0; }
#user-name { font-weight: 600; font-size: 13px; color: var(--text-dark); overflow-wrap: anywhere; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 500; letter-spacing: .5px; }
.logout-btn { color: var(--danger); font-size: 13px; font-weight: 600; text-decoration: none; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; transition: var(--transition); }
.logout-btn:hover { background: #fef2f2; border-color: #fecaca; }
main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 32px; flex: 1; outline-offset: -3px; }
.workspace-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 32px; font-size: 12.5px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Judul halaman ────────────────────────────────────── */
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading p { margin: 0; max-width: 760px; color: var(--text-muted); }
.eyebrow { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--primary); text-transform: uppercase; overflow-wrap: anywhere; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-top: 20px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 24px 0 12px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; font-size: 18px; }
.form-section-heading { font-size: 15px; font-weight: 700; color: #334155; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-section-heading:first-child { margin-top: 0; }

/* ── Tombol ───────────────────────────────────────────── */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 40px; padding: 9px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none;
    transition: var(--transition); white-space: nowrap;
}
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(26, 79, 139, .25); }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26, 79, 139, .3); }
.button.secondary { background: #fff; border-color: var(--border); color: var(--text-dark); }
.button.secondary:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.button.danger-quiet { background: #fff; border-color: #fca5a5; color: var(--danger); }
.button.danger-quiet:hover:not(:disabled) { background: #fef2f2; }
.button.compact { min-height: 32px; padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.button.text-button { display: block; padding: 0; min-height: 0; border: 0; border-radius: 2px; background: none; text-align: left; font-size: 14px; font-weight: 600; color: var(--primary); overflow-wrap: anywhere; }
.button.text-button:hover { color: var(--primary-hover); text-decoration: underline; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text-muted); font-size: 19px; line-height: 1; }
.icon-button:hover { background: #f8fafc; color: var(--text-dark); border-color: #cbd5e1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ── Kartu, notice, keadaan ───────────────────────────── */
.notice { padding: 13px 16px; margin-bottom: 18px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius-md); color: var(--text-muted); background: var(--surface); font-size: 13.5px; line-height: 1.65; }
.notice.warning { background: #fffbeb; border-color: #fde68a; border-left-color: var(--warning); color: #92400e; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-md); border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; font-size: 13.5px; font-weight: 500; }
.banner.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.modal-banner { margin: 0 24px 4px; }
.state-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 44px 32px; text-align: center; }
.state-card h1 { font-size: 22px; }
.state-card p { color: var(--text-muted); max-width: 620px; margin: 0 auto 18px; }
.loading-mark { display: block; width: 30px; height: 30px; margin: 0 auto 16px; border: 3px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.empty-state h3 { color: var(--text-dark); }
.empty-inline { color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ── Statistik ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 28px; }
.stat-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px 24px 22px 30px; overflow: hidden; transition: var(--transition); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--primary); }
.stat-card.stat-pending::before { background: var(--warning); }
.stat-card.stat-active::before { background: var(--info); }
.stat-card.stat-done::before { background: var(--success); }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.01em; color: var(--text-dark); }

/* ── Filter & formulir ────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: #475569; }
.field input, .field select, .field textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #f8fafc; color: var(--text-dark); font-size: 13.5px; font-family: inherit; outline: none;
    transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26, 79, 139, .1); }
.field textarea { min-height: 90px; resize: vertical; }
.field input[readonly], .field select[disabled], .field textarea[readonly] { background: #f1f5f9; color: #475569; }
.field-help { font-size: 12px; color: var(--text-muted); margin: 0; }
.search-field { flex: 1 1 260px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.inset-form { background: #f8fafc; border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 18px; margin-top: 18px; }
.repeatable-list { display: flex; flex-direction: column; gap: 12px; }
.repeatable-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.repeatable-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.structured-section { margin-top: 22px; }

/* ── Tabel ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; background: #f8fafc; color: #475569; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid var(--border); white-space: nowrap; text-align: left; }
td { padding: 12px 16px; font-size: .855rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: #f0f7ff; }
tbody tr:last-child td { border-bottom: none; }
.case-table td { vertical-align: top; }
.case-name { font-weight: 600; color: var(--text-dark); }
.case-code { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.metadata-list { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; margin: 10px 0 0; }
.metadata-list:empty { display: none; }
.metadata-list dt { font-size: 12.5px; font-weight: 600; color: #475569; }
.metadata-list dd { margin: 0; font-size: 13.5px; }
.assignment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 16px 0 0; }
.assignment-grid dt { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.assignment-grid dd { margin: 3px 0 0; font-weight: 600; font-size: 13.5px; }

/* ── Lencana ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; border: 1px solid var(--border); background: #f1f5f9; color: #475569; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.neutral { background: #f1f5f9; color: #475569; border-color: var(--border); }
.badge.pending { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge.approved { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.badge.done { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.version-label { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.capability-guide { font-size: 12.5px; color: var(--text-muted); }
.capability-guide strong { color: var(--primary); }

/* ── Modal ────────────────────────────────────────────── */
.modal { border: none; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--surface); color: var(--text-dark); width: min(720px, 94vw); max-height: 92vh; }
.modal-wide { width: min(980px, 96vw); }
.modal-detail { width: min(1180px, 97vw); }
.modal-small { width: min(520px, 94vw); }
.modal::backdrop { background: rgba(15, 43, 72, .55); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); background: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-content { padding: 22px 24px; overflow-y: auto; max-height: calc(92vh - 150px); }

/* ── Ringkasan detail & tab ───────────────────────────── */
.detail-summary { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.current-stage { margin: 0; font-size: 14px; }
.current-stage strong { color: var(--text-dark); }
.detail-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding: 14px 0 4px; border-top: 1px solid var(--border); background: var(--surface); }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0 0; }
.tab-button { position: relative; padding: 11px 16px; border: 0; background: none; color: var(--text-muted); font-size: 13.5px; font-weight: 600; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab-button:hover { background: #f8fafc; color: var(--text-dark); }
.tab-button.is-active { color: var(--primary); }
.tab-button.is-active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; background: var(--primary); border-radius: 2px; }
.tab-panel { padding-top: 20px; }

/* ── Tahapan ──────────────────────────────────────────── */
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stage-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 14px; }
.stage-item.is-current { border-color: var(--primary); background: #eff6ff; font-weight: 600; box-shadow: var(--shadow-xs); }
.stage-number { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #f1f5f9; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.stage-item.is-current .stage-number { background: var(--primary); color: #fff; }
.stage-label { flex: 1; min-width: 0; }
.workflow-box { margin-top: 22px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #f8fafc; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Dokumen, kegiatan, riwayat ───────────────────────── */
.document-group { margin-bottom: 20px; }
.document-group h4 { font-size: 13px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.document-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid #f1f5f9; }
.document-row:last-child { border-bottom: none; }
.document-info { min-width: 0; }
.document-info strong { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.document-info small { display: block; color: var(--text-muted); margin-top: 3px; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-card { padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius-md); background: var(--surface); }
.timeline-card h4 { margin-bottom: 4px; font-size: 14px; }
.timeline-meta { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); }
.timeline-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.document-row .row-actions { flex: 0 0 auto; }
.tingkat-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.tingkat-card { padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--secondary); border-radius: var(--radius-md); background: var(--surface); }
.tingkat-card h4 { margin: 0; font-size: 14px; }
.entry-form { display: block; }
.audit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.audit-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f8fafc; font-size: 13px; }
.audit-list strong { font-weight: 600; }

/* ── Agenda ───────────────────────────────────────────── */
.agenda-list { display: flex; flex-direction: column; gap: 10px; }
.agenda-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.agenda-date { flex-shrink: 0; min-width: 96px; font-size: 13px; font-weight: 700; color: var(--primary); }
.agenda-main { min-width: 0; }

/* ── Hak akses ────────────────────────────────────────── */
.access-list { display: flex; flex-direction: column; gap: 10px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.access-row:last-child { border-bottom: 1px solid var(--border); }
.access-person { min-width: 0; }
.access-person strong { display: block; font-size: 14px; }
.access-person small { color: var(--text-muted); }
.access-row select { min-width: 180px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f8fafc; }

/* ── Cetak ────────────────────────────────────────────── */
#print-sheet { display: none; }
.print-record { display: block; }
.print-note { font-size: 12px; color: var(--text-muted); }
.print-metadata { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 6px 18px; }

@media print {
    .sidebar, .topbar, .heading-actions, .detail-tools, .detail-savebar, .tab-list, .filter-bar, .workspace-footer, .notice, .banner { display: none !important; }
    .workspace { margin-left: 0; }
    main { padding: 0; max-width: none; }
    #print-sheet { display: block; }
    .modal { position: static; width: auto; max-height: none; box-shadow: none; border: none; }
    body { background: #fff; }
}

@media (max-width: 1024px) {
    .sidebar { position: static; width: 100%; height: auto; }
    .workspace { margin-left: 0; }
    .nav-caption { padding-top: 14px; }
    #module-nav { flex-direction: row; flex-wrap: wrap; }
    .nav-item { width: auto; }
    .sidebar-footer { margin-top: 0; }
    main { padding: 22px 18px; }
    .topbar { padding: 0 18px; height: auto; min-height: 64px; flex-wrap: wrap; }
    .page-heading { flex-direction: column; }
    .heading-actions { padding-top: 0; }
}

/* ── Tambahan Peminjaman Warkah ─────────────────────────────────────────────
   Bagian ini milik aplikasi ini; bagian di atas disalin dari Kartu Kendali. */

.nav-item.is-disabled { color: #7c8b9b; cursor: default; opacity: .75; }
.nav-item.is-disabled:hover { background: transparent; color: #7c8b9b; }
.nav-item.is-disabled .nav-symbol { color: #64748b; }

/* Lencana status aplikasi ini */
.badge.dipinjam      { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.badge.jatuh-tempo   { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.badge.terlambat     { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.badge.dikembalikan  { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.badge.di-rak        { background: #f1f5f9; border-color: var(--border); color: #475569; }

/* ── Halaman masuk / daftar / ganti sandi ──────────────────────────────────
   Gaya dokumen dinas: bidang putih, garis rambut, satu aksen emas.
   Tanpa gradien menyala, tanpa bayangan berlebih. */

.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 28px;
    background: #eef1f6;
    background-image: linear-gradient(180deg, #e9eef5 0%, #eef1f6 45%, #f2f5f8 100%);
}

.auth-frame {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 40% 60%;
    background: var(--surface);
    border: 1px solid #dbe3ec;
    border-top: 3px solid var(--secondary);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 43, 72, .04), 0 12px 32px rgba(15, 43, 72, .07);
    overflow: hidden;
}

/* Panel identitas */
.auth-side {
    padding: 40px 34px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #ffffff;
    border-right: 1px solid #e6ecf3;
}

.auth-logo { width: 106px; height: 106px; margin-bottom: 24px; }
.auth-identitas { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.auth-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.auth-kementerian {
    margin: 0 0 16px;
    font-size: 10.5px;
    line-height: 1.85;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #6b7c90;
}

.auth-rule {
    width: 44px;
    height: 2px;
    background: var(--secondary);
    margin: 0 0 16px;
    border-radius: 1px;
}

.auth-kantor {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #14375e;
}

.auth-aplikasi {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #7b8b9d;
    letter-spacing: .02em;
}

.auth-side-foot {
    width: 100%;
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid #eef2f6;
    font-size: 10.5px;
    line-height: 1.7;
    color: #9aa8b7;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Panel formulir */
.auth-main {
    padding: 44px 46px 34px;
    background: #fbfcfe;
    display: flex;
    flex-direction: column;
}

.auth-main h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.015em;
    margin: 0 0 6px;
    color: var(--text-dark);
}

.auth-sub {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.auth-main .field { margin-bottom: 16px; }
.auth-main .field label {
    font-size: 12px;
    font-weight: 600;
    color: #45566a;
    letter-spacing: .01em;
}
.auth-main .field input {
    height: 42px;
    padding: 0 13px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
}
.auth-main .field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 79, 139, .12);
    background: #fff;
}
.auth-main .field-help { font-size: 11.5px; line-height: 1.5; color: #8b98a8; }

.auth-submit {
    width: 100%;
    height: 44px;
    margin-top: 8px;
    border-radius: 5px;
    font-size: 14px;
    letter-spacing: .01em;
    box-shadow: 0 1px 2px rgba(26, 79, 139, .18);
}

.auth-alt {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e6ecf3;
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.auth-alt a { font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

.auth-note {
    margin-top: 18px;
    padding: 11px 13px;
    border: 1px solid #e6ecf3;
    border-left: 2px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
    font-size: 11.5px;
    line-height: 1.65;
    color: #6b7c90;
}

.auth-legal {
    margin-top: auto;
    padding-top: 26px;
    font-size: 11px;
    line-height: 1.7;
    color: #98a5b4;
    letter-spacing: .01em;
}

.auth-copyright {
    margin: 18px 0 0;
    font-size: 11px;
    color: #93a1b1;
    text-align: center;
    letter-spacing: .02em;
}

/* Peringatan galat di halaman masuk — tegas, bukan merah menyala */
.auth-main .banner {
    margin-bottom: 18px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 500;
    padding: 10px 13px;
}

/* Layar sempit: panel identitas menjadi kepala ringkas */
@media (max-width: 760px) {
    .auth-page { padding: 20px 14px; justify-content: flex-start; }
    .auth-frame { grid-template-columns: 1fr; max-width: 460px; }
    .auth-side {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 16px 20px;
        border-right: 0;
        border-bottom: 1px solid #e6ecf3;
    }
    .auth-identitas { align-items: flex-start; flex: 1 1 auto; }
    .auth-logo { width: 44px; height: 44px; margin: 0; flex-shrink: 0; }
    .auth-kementerian { display: none; }
    .auth-rule { display: none; }
    .auth-kantor { font-size: 13.5px; margin: 0; }
    .auth-aplikasi { font-size: 11.5px; }
    .auth-side-foot { display: none; }
    .auth-main { padding: 26px 22px 24px; }
    .auth-legal { padding-top: 18px; }
}

/* Varian lebar: formulir panjang (pendaftaran) memakai satu kolom */
.auth-frame.lebar { grid-template-columns: 1fr; max-width: 600px; }
.auth-side.ringkas {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 18px 24px;
    border-right: 0;
    border-bottom: 1px solid #e6ecf3;
}
.auth-side.ringkas .auth-logo { width: 44px; height: 44px; margin: 0; flex-shrink: 0; }
.auth-side.ringkas .auth-identitas { align-items: flex-start; flex: 1 1 auto; }
.auth-side.ringkas .auth-kementerian,
.auth-side.ringkas .auth-rule,
.auth-side.ringkas .auth-side-foot { display: none; }
.auth-side.ringkas .auth-kantor { font-size: 13.5px; margin: 0; }
.auth-side.ringkas .auth-aplikasi { font-size: 11.5px; }
.auth-frame.lebar .auth-main { padding: 30px 32px 26px; }

/* Logo resmi pada sidebar: kotak putih tipis supaya lambang tetap terbaca
   di atas latar gelap. */
.brand-logo {
    width: 42px; height: 42px; flex-shrink: 0;
    background: #fff; border-radius: 8px; padding: 3px;
    object-fit: contain; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* Penjaga lebar: halaman masuk tidak boleh menimbulkan gulir mendatar
   di layar ponsel. */
html, body { max-width: 100%; }
.auth-page { width: 100%; overflow-x: hidden; }
.auth-frame, .auth-main, .auth-side, .auth-identitas { min-width: 0; }
@media (max-width: 760px) {
    .auth-frame { max-width: 100%; }
    .auth-main .form-grid { grid-template-columns: 1fr; }
}

/* Pemilih berkas bergaya tombol — teksnya Indonesia, bukan "Choose File" */
.file-pick { position: relative; display: inline-flex; align-items: center; }
.file-pick input[type="file"] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; margin: 0; padding: 0;
}
.file-pick > span {
    display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
    color: var(--text-dark); font-size: 12px; font-weight: 600;
}
.file-pick:hover > span { background: #f8fafc; border-color: #cbd5e1; }
.file-pick input[type="file"]:focus-visible + span { outline: 3px solid rgba(26, 79, 139, .35); outline-offset: 2px; }
