/* =====================================================================
   Sistem Dokumentasi Kegiatan Personel - Bid TIK Polda Sumsel
   Tema biru: latar biru, kontainer putih membulat, sidebar biru melengkung
   ===================================================================== */

:root {
    --blue-900: #0F2F6B;
    --blue-800: #163F8C;
    --blue-700: #0059fe;   /* hover / teks judul */
    --blue-600: #bfdaf1;   /* warna utama */
    --blue-500: #3B7BE8;
    --blue-100: #E4ECFA;   /* baris terpilih / tombol lembut */
    --blue-50:  #F1F5FC;   /* kartu abu-biru */
    --bg-outer: #f5f6f9;   /* latar di luar kontainer */
    --white: #FFFFFF;
    --text: #225db0;
    --muted: #225db0;
    --border: #E6ECF5;

    --sidebar-width: 250px;
    --sidebar-collapsed-width: 88px;
    --topbar-height: 84px;
    --shell-radius: 36px;
    --radius: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 47, 107, .04), 0 2px 8px rgba(15, 47, 107, .05);
    --shadow-md: 0 10px 24px rgba(37, 99, 208, .18);

    --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: var(--text);
    --bs-link-color: var(--blue-600);
    --bs-link-color-rgb: 37, 99, 208;
    --bs-link-hover-color: var(--blue-800);
    --bs-link-hover-color-rgb: 22, 63, 140;
    --bs-primary: var(--blue-600);
    --bs-primary-rgb: 37, 99, 208;
    --bs-border-radius: 0.6rem;
}

body {
    font-family: var(--bs-body-font-family);
    color: var(--text);
    font-size: 0.9rem;
}

.text-blue { color: var(--blue-600) !important; }
.min-w-0 { min-width: 0; }

/* ---------- Bootstrap overrides ---------- */
.btn-primary {
    --bs-btn-bg: var(--blue-600);
    --bs-btn-border-color: var(--blue-600);
    --bs-btn-hover-bg: var(--blue-700);
    --bs-btn-hover-border-color: var(--blue-700);
    --bs-btn-active-bg: var(--blue-800);
    --bs-btn-active-border-color: var(--blue-800);
    --bs-btn-disabled-bg: var(--blue-600);
    --bs-btn-disabled-border-color: var(--blue-600);
    --bs-btn-focus-shadow-rgb: 37, 99, 208;
}
.btn-outline-primary {
    --bs-btn-color: var(--blue-600);
    --bs-btn-border-color: var(--blue-600);
    --bs-btn-hover-bg: var(--blue-600);
    --bs-btn-hover-border-color: var(--blue-600);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--blue-700);
    --bs-btn-active-border-color: var(--blue-700);
}
.btn-light-blue {
    background: var(--blue-100);
    color: var(--blue-700);
    border: 0;
    border-radius: 10px;
    font-weight: 500;
}
.btn-light-blue:hover { background: var(--blue-600); color: #fff; }
.form-control, .form-select { border-color: #D8E1EF; }
.form-control:focus, .form-select:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 208, .15);
}
.form-check-input:checked { background-color: var(--blue-600); border-color: var(--blue-600); }
.form-check-input:focus { box-shadow: 0 0 0 0.2rem rgba(37, 99, 208, .15); }
.breadcrumb { font-size: 0.8rem; --bs-breadcrumb-divider-color: var(--muted); }
.breadcrumb a { text-decoration: none; }
.breadcrumb-item.active { color: var(--muted); }
.alert { border: 0; border-radius: 14px; }
.dropdown-menu { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); }

/* =====================================================================
   SHELL: latar biru + kontainer putih membulat (seperti referensi)
   ===================================================================== */
.app-body { background: var(--bg-outer); }
.app-shell {
    background: var(--white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.app-frame {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}
.app-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-content {
    flex: 1 0 auto;
    padding: 1.5rem 2rem 2rem;
}
.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem 1.25rem;
    font-size: 0.75rem;
    color: var(--muted);
}

@media (min-width: 992px) {
    .app-body {
        padding: 28px;
        background:
            radial-gradient(circle at 8% 0%, rgba(255, 255, 255, .14), transparent 32%),
            radial-gradient(circle at 100% 100%, rgba(15, 47, 107, .35), transparent 40%),
            var(--bg-outer);
    }
    .app-shell {
        height: calc(100vh - 56px);
        min-height: 560px;
        border-radius: var(--shell-radius);
        overflow: hidden;
        box-shadow: 0 30px 60px rgba(9, 30, 80, .35);
    }
    .app-main { overflow-y: auto; }
}

/* ---------- Top header ---------- */
.topbar {
    flex: 0 0 auto;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 2rem 0 0;
    background: var(--white);
    z-index: 1020;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding-left: 1.75rem;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 0;
}
.brand-logo { height: 42px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 700; font-size: 1.15rem; color: var(--blue-600); letter-spacing: .02em; }
.brand-sub { font-size: 0.68rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; white-space: nowrap; }

.topbar-search {
    flex: 0 1 420px;
    align-items: center;
    gap: 0.6rem;
    background: var(--blue-50);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0 1.1rem;
    height: 44px;
    margin-left: 2rem;
    color: var(--muted);
    transition: border-color .15s, background .15s;
}
.topbar-search:focus-within { background: #fff; border-color: var(--blue-500); }
.topbar-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text);
}
.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.topbar-date {
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}
.btn-icon, .btn-icon-plain {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    color: var(--text);
    border: 0;
    background: transparent;
}
.btn-icon { background: var(--blue-50); color: var(--blue-600); }
.btn-icon:hover, .btn-icon-plain:hover { background: var(--blue-100); color: var(--blue-600); }
.user-menu { border: 0; padding: 0.25rem; border-radius: 999px; }
.user-menu:hover, .user-menu[aria-expanded="true"] { background: var(--blue-50); }
.user-name { font-weight: 600; font-size: 0.82rem; }
.user-role { font-size: 0.7rem; color: var(--muted); }
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-600);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}
.role-badge { font-weight: 500; }
.role-admin { background: var(--blue-800); }
.role-operator { background: var(--blue-600); }
.role-pimpinan { background: #5B6B86; }

/* ---------- Sidebar biru melengkung ---------- */
.sidebar {
    --bs-offcanvas-width: 280px;
    --bs-offcanvas-bg: var(--blue-600);
    /* background-image dipakai karena offcanvas-lg memaksa background-color transparan di desktop */
    background-image: linear-gradient(180deg, var(--blue-600) 0%, var(--blue-700) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-width);
        flex: 0 0 var(--sidebar-width);
        border-top-right-radius: 56px;
        overflow-y: auto;
        overflow-x: hidden;
        transition: width .2s ease, flex-basis .2s ease;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .3) transparent;
    }
}
.sidebar-mobile-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.1rem 0.5rem;
    font-size: 0.85rem;
}
.sidebar-action { padding: 2.25rem 1.5rem 1.25rem; }
.btn-sidebar-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: #fff;
    color: var(--blue-600);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 0.7rem 1rem;
    border: 0;
    box-shadow: 0 6px 16px rgba(9, 30, 80, .18);
    white-space: nowrap;
}
.btn-sidebar-action:hover { background: var(--blue-50); color: var(--blue-700); }
.sidebar-nav { flex: 1 1 auto; padding: 0.25rem 1rem 0; }
.sidebar-section {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .6);
    padding: 1rem 1rem 0.35rem;
    white-space: nowrap;
}
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: rgba(255, 255, 255, .85);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    margin-bottom: 2px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 0;
    background: transparent;
    text-align: left;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.1rem; width: 1.3rem; text-align: center; flex-shrink: 0; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--blue-600); font-weight: 600; }

.sidebar-storage {
    margin: 1rem 1.5rem 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .2);
}
.storage-heading {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .7);
    margin-bottom: 0.75rem;
}
.storage-item { margin-bottom: 0.85rem; }
.storage-label { font-size: 0.78rem; display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.35rem; }
.storage-item .progress { height: 4px; background: rgba(255, 255, 255, .25); }
.storage-item .progress-bar { background: #fff; }
.storage-meta { font-size: 0.68rem; color: rgba(255, 255, 255, .7); margin-top: 0.3rem; }
.sidebar-footer { padding: 0.5rem 1rem 1.25rem; }
.sidebar .nav-logout:hover { background: rgba(255, 255, 255, .15); }

/* Sidebar diciutkan (desktop) */
@media (min-width: 992px) {
    .sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); flex-basis: var(--sidebar-collapsed-width); border-top-right-radius: 32px; }
    .sidebar-collapsed .nav-text,
    .sidebar-collapsed .sidebar-storage { display: none; }
    .sidebar-collapsed .sidebar-action { padding: 2rem 0.9rem 1rem; }
    .sidebar-collapsed .btn-sidebar-action { padding: 0.7rem 0; }
    .sidebar-collapsed .sidebar-nav { padding-inline: 0.9rem; }
    .sidebar-collapsed .sidebar .nav-link { justify-content: center; padding-inline: 0; }
    .sidebar-collapsed .sidebar-section { font-size: 0; padding: 0; margin: 0.75rem 0.5rem; border-top: 1px solid rgba(255, 255, 255, .25); }
}

/* ---------- Judul halaman ---------- */
.page-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--blue-600);
}
.page-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-600);
    color: #fff;
    font-size: 1.1rem;
}
.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text);
    margin-bottom: 1rem;
}

/* =====================================================================
   KOMPONEN
   ===================================================================== */
.card-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}
.card-panel > .card-header {
    background: transparent;
    border-bottom: 0;
    padding: 1.1rem 1.25rem 0.5rem;
}
.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text);
    margin: 0;
}

/* Kartu ringkasan berbentuk folder (Quick Access) */
.folder-card {
    position: relative;
    display: block;
    height: 100%;
    padding: 1.25rem 1.25rem 1.1rem;
    margin-top: 12px;
    background: var(--blue-50);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}
.folder-card::before {
    /* tab folder di kiri atas */
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    width: 46%;
    height: 14px;
    background: inherit;
    border-radius: 12px 16px 0 0;
}
a.folder-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); }
.folder-card-primary { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-md); }
a.folder-card-primary:hover { color: #fff; }
.folder-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.folder-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #fff;
    color: var(--blue-600);
}
.folder-go { color: var(--muted); }
.folder-card-primary .folder-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.folder-card-primary .folder-go { color: rgba(255, 255, 255, .8); }
.folder-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.folder-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 0.15rem; }
.folder-note { font-size: 0.75rem; color: var(--blue-600); margin-top: 0.35rem; }
.folder-card-primary .folder-note { color: rgba(255, 255, 255, .85); }

/* Tabel bergaya "All Files" */
.table-modern { --bs-table-hover-bg: var(--blue-100); --bs-table-bg: transparent; }
.table-modern thead th {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    white-space: nowrap;
}
.table-modern td { padding: 0.75rem 1.25rem; border-color: var(--border); font-size: 0.85rem; }
.table-modern tbody tr { transition: background .15s; }
.row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--badge-color, var(--blue-600));
}

/* Badge kategori (warna dari database) */
.badge-category {
    background: var(--badge-color, var(--blue-600));
    color: #fff;
    font-weight: 500;
    padding: 0.4em 0.75em;
    border-radius: 999px;
}

/* Thumbnail dokumentasi */
.thumb-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--blue-50);
    cursor: zoom-in;
}
.thumb-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.thumb-card:hover img { transform: scale(1.05); }
.thumb-card:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.thumb-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.2rem 0.6rem 0.45rem;
    background: linear-gradient(180deg, transparent, rgba(15, 47, 107, .88));
    color: #fff;
    text-align: left;
    display: flex;
    flex-direction: column;
}
.thumb-title { font-size: 0.72rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-date { font-size: 0.66rem; color: rgba(255, 255, 255, .8); }

.chart-box { position: relative; height: 300px; }

/* Empty state & placeholder */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; color: #B8C6DC; }
.empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--blue-600);
    background: var(--blue-100);
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, .14), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(15, 47, 107, .35), transparent 40%),
        var(--bg-outer);
}
.login-shell {
    width: 100%;
    max-width: 1040px;
    min-height: 600px;
    display: flex;
    background: #fff;
    border-radius: var(--shell-radius);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(9, 30, 80, .35);
}
.login-brand {
    flex: 0 0 46%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3rem;
    color: #fff;
    background-image: linear-gradient(160deg, var(--blue-600) 0%, var(--blue-700) 100%);
    border-top-right-radius: 80px;
    border-bottom-right-radius: 80px;
}
.login-logos { display: flex; gap: 1rem; align-items: center; margin-bottom: 2rem; }
.login-logo {
    height: 110px;
    width: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .3));
}
.login-unit { font-size: 2.4rem; font-weight: 700; letter-spacing: .04em; line-height: 1.1; margin: 0; }
.login-unit span {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: .14em;
    color: rgba(255, 255, 255, .8);
    margin-top: 0.5rem;
}
.login-divider { width: 56px; height: 4px; border-radius: 2px; background: #fff; margin: 1.5rem 0; opacity: .9; }
.login-tagline { font-size: 1.05rem; font-weight: 500; margin-bottom: 1.5rem; }
.login-points { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; color: rgba(255, 255, 255, .88); }
.login-points li { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.6rem; }
.login-points i {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .16);
}
.login-form-side {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
}
.login-form-box { width: 100%; max-width: 380px; }
.login-title { font-size: 1.9rem; font-weight: 700; color: var(--blue-600); letter-spacing: .06em; margin-bottom: 0.2rem; }
.login-subtitle { color: var(--muted); margin-bottom: 1.75rem; }
.input-pill {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.input-pill > i {
    position: absolute;
    left: 1.1rem;
    top: 22px;
    transform: translateY(-50%);
    color: var(--muted);
    z-index: 2;
}
.input-pill .form-control {
    height: 44px;
    border-radius: 999px;
    background: var(--blue-50);
    border-color: transparent;
    padding-left: 2.8rem;
    padding-right: 3rem;
}
.input-pill .form-control:focus { background: #fff; }
.input-pill .invalid-feedback { padding-left: 1.1rem; }
.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 4px;
    height: 36px;
    width: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    z-index: 3;
}
.btn-toggle-password:hover { background: var(--blue-100); color: var(--blue-600); }
.btn-login { height: 46px; border-radius: 999px; font-weight: 600; letter-spacing: .08em; box-shadow: var(--shadow-md); }
.login-copy { margin: 2rem 0 0; font-size: 0.75rem; color: var(--muted); text-align: center; }
.login-logos-mobile { display: flex; justify-content: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.login-logos-mobile img { height: 64px; }

@media (max-width: 991.98px) {
    .login-body { padding: 16px; }
    .login-shell { min-height: 0; border-radius: 28px; }
    .login-brand { display: none; }
    .login-form-side { padding: 2rem 1.25rem; }
    .login-title, .login-subtitle { text-align: center; }
}

/* =====================================================================
   RESPONSIVE (tablet & mobile)
   ===================================================================== */
@media (max-width: 991.98px) {
    .topbar {
        position: sticky;
        top: 0;
        height: 68px;
        padding: 0 1rem;
        gap: 0.75rem;
        border-bottom: 1px solid var(--border);
    }
    .topbar-brand { width: auto; padding-left: 0; }
    .topbar-search { margin-left: 0; }
    .app-content { padding: 1.25rem 1rem; }
    .app-footer { padding: 1rem; }
    .brand-logo { height: 36px; }
}
@media (max-width: 575.98px) {
    .page-title { font-size: 1.3rem; }
    .brand-sub { display: none; }
    .chart-box { height: 240px; }
    .page-heading nav { display: none; }
}

/* =====================================================================
   PRINT (dipakai lebih lanjut pada modul laporan)
   ===================================================================== */
@media print {
    .sidebar, .topbar, .app-footer, .btn, .breadcrumb, form { display: none !important; }
    .app-body { background: #fff; padding: 0; }
    .app-shell { height: auto; box-shadow: none; border-radius: 0; }
    .app-main { overflow: visible; }
}

/* Lambang Polda Sumsel lebih ramping dari logo TIK POLRI, jadi dibuat sedikit
   lebih tinggi agar keduanya tampak seimbang. */
.brand-logo.is-polda { height: 47px; }
.login-logo.is-polda { height: 124px; }
.login-logos-mobile img.is-polda { height: 72px; }
@media (max-width: 991.98px) {
    .brand-logo.is-polda { height: 40px; }
}

/* =====================================================================
   MODUL (kegiatan, dokumentasi, galeri, laporan, pengguna, pengaturan)
   ===================================================================== */
.avatar-sm { width: 34px; height: 34px; font-size: 0.75rem; flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.text-prewrap { white-space: pre-line; }
.detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: 0.3rem;
}
.filter-bar .form-label { color: var(--muted); }
/* Teks .visually-hidden (position:absolute) di dalam tabel tidak boleh melebarkan halaman di HP. */
.table-responsive { position: relative; }
.pagination {
    --bs-pagination-color: var(--blue-700);
    --bs-pagination-active-bg: var(--blue-700);
    --bs-pagination-active-border-color: var(--blue-700);
    --bs-pagination-hover-color: var(--blue-800);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(37, 99, 208, .15);
}
.row-thumb {
    width: 48px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--blue-50);
}

/* Personel pelaksana (form kegiatan) */
.personnel-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1.2fr) auto;
    gap: 0.4rem;
    align-items: center;
}
@media (max-width: 575.98px) {
    .personnel-row {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.6rem;
        border: 1px solid var(--border);
        border-radius: 12px;
    }
    .personnel-row input:first-child { grid-column: 1 / 2; }
    .personnel-row input:nth-child(2),
    .personnel-row input:nth-child(3) { grid-column: 1 / 2; }
    .personnel-row button { grid-column: 2; grid-row: 1; }
}

/* Dokumentasi pada detail kegiatan */
.doc-group + .doc-group { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1.25rem; }

/* Kartu file PDF */
.file-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    aspect-ratio: 4 / 3;
    padding: 0.75rem;
    border-radius: 14px;
    background: var(--blue-50);
    border: 1px dashed #C9D6EC;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    transition: background .15s;
}
.file-card:hover { background: var(--blue-100); color: var(--text); }
.file-card > i { font-size: 1.8rem; color: #C2410C; line-height: 1; }
.file-card-name { font-size: 0.75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-meta { font-size: 0.68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.photo-modal-img { max-height: 75vh; object-fit: contain; }

/* Upload dokumentasi */
.upload-zone {
    text-align: center;
    padding: 1.5rem 1rem;
    border: 2px dashed #C9D6EC;
    border-radius: 18px;
    background: var(--blue-50);
    transition: border-color .15s, background .15s;
}
.upload-zone.is-dragover { border-color: var(--blue-500); background: var(--blue-100); }
.upload-zone-icon { font-size: 2.4rem; color: var(--blue-500); display: block; line-height: 1; margin-bottom: 0.5rem; }
.upload-zone .btn { position: relative; overflow: hidden; min-height: 44px; display: inline-flex; align-items: center; }
/* Input file disembunyikan di dalam label tombol, tetap dapat diakses keyboard */
.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    cursor: pointer;
    font-size: 0;
}
.upload-zone .btn:focus-within { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.upload-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.upload-summary { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.upload-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.upload-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-50);
    color: #C2410C;
    font-size: 1.5rem;
}
.upload-info { flex: 1 1 auto; min-width: 0; }
.upload-name { font-size: 0.82rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-meta { font-size: 0.72rem; color: var(--muted); }
.upload-progress { margin-top: 1rem; }
.upload-progress .progress { height: 10px; }
.upload-progress .progress-bar { background-color: var(--blue-700); }

/* File tersimpan (form ubah dokumentasi) */
.existing-file {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--blue-50);
    cursor: pointer;
    aspect-ratio: 4 / 3;
}
.existing-file img { width: 100%; height: 100%; object-fit: cover; }
.existing-file .form-check-input { position: absolute; top: 8px; left: 8px; z-index: 2; width: 1.3em; height: 1.3em; }
.existing-file-pdf { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.2rem; color: #C2410C; }
.existing-file-name {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
    color: #fff;
    background: linear-gradient(180deg, transparent, rgba(15, 47, 107, .85));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.existing-file-flag {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: #DC2626;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}
.existing-file.is-deleted { border-color: #DC2626; }
.existing-file.is-deleted img { opacity: .4; }
.existing-file.is-deleted .existing-file-flag { display: inline-block; }

/* Profil & pengaturan */
.profile-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; font-size: 0.82rem; }
.profile-meta dt { font-weight: 500; color: var(--muted); }
.profile-meta dd { margin: 0; }
.check-list .list-group-item { padding: 0.7rem 1rem; }
.backup-cmd {
    background: var(--blue-50);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    word-break: break-all;
    color: var(--blue-800);
}
.role-help { border-top: 1px solid var(--border); padding-top: 0.75rem; }

/* Tombol simpan selalu terlihat di HP (form panjang) */
@media (max-width: 767.98px) {
    .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: 1rem -1rem -1.25rem;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, .96);
        border-top: 1px solid var(--border);
        backdrop-filter: blur(4px);
    }
    .form-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .table-modern td, .table-modern thead th { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* =====================================================================
   KETERBACAAN (kontras teks) - warna latar tema tidak diubah.
   Warna utama (--blue-600) sangat muda sehingga teks putih di atasnya sulit
   dibaca, terutama di layar HP di luar ruangan. Blok ini membuat teks di atas
   warna muda menjadi gelap dan teks berwarna memakai --blue-700 (sesuai
   komentar ":root" untuk teks judul). Hapus blok ini untuk kembali ke tampilan lama.
   ===================================================================== */
.btn-primary {
    --bs-btn-color: var(--blue-900);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: var(--blue-900);
    font-weight: 500;
}
.btn-outline-primary {
    --bs-btn-color: var(--blue-700);
    --bs-btn-border-color: var(--blue-700);
    --bs-btn-hover-bg: var(--blue-700);
    --bs-btn-hover-border-color: var(--blue-700);
}
.page-title, .brand-title, .login-title { color: var(--blue-700); }
.page-title-icon, .avatar { color: var(--blue-900); }
.sidebar .nav-link.active, .btn-sidebar-action { color: var(--blue-700); }
.folder-card-primary,
a.folder-card-primary:hover,
.folder-card-primary .folder-note,
.folder-card-primary .folder-go,
.folder-card-primary .folder-icon { color: var(--blue-900); }
.upload-zone-icon { color: var(--blue-700); }

/* Lupa password & kode pemulihan */
.login-link { font-size: 0.875rem; font-weight: 500; color: var(--blue-700); text-decoration: none; }
.login-link:hover { text-decoration: underline; }
.login-help { margin: 1.25rem 0 0; font-size: 0.8rem; color: var(--muted); text-align: center; line-height: 1.8; }
.recovery-code {
    display: inline-block;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .12em;
    padding: 0.6rem 1.2rem;
    border: 2px dashed var(--blue-500);
    border-radius: 12px;
    background: var(--blue-50);
    color: var(--blue-900);
    user-select: all;
}

/* Kalender pemilih tanggal (flatpickr) mengikuti tema biru */
.flatpickr-calendar { font-family: inherit; border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 47, 107, .18); }
.flatpickr-months { padding: 6px 4px 0; }
.flatpickr-months .flatpickr-month { height: 40px; color: var(--blue-900); }
.flatpickr-current-month { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 6px; font-size: 1rem; }
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-yearDropdown {
    appearance: auto;
    font: inherit;
    font-weight: 600;
    color: var(--blue-900);
    background: var(--blue-50);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px 4px;
    margin: 0;
    height: 30px;
    cursor: pointer;
}
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { top: 8px; color: var(--blue-700); fill: var(--blue-700); }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--blue-900); }
span.flatpickr-weekday { color: var(--blue-800); font-weight: 600; }
.flatpickr-day { border-radius: 10px; color: var(--blue-900); }
.flatpickr-day:hover, .flatpickr-day:focus { background: var(--blue-100); border-color: var(--blue-100); }
.flatpickr-day.today { border-color: var(--blue-500); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover { color: #c3cbd8; background: transparent; }
.flatpickr-footer { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; border-top: 1px solid var(--border); }
.flatpickr-btn { flex: 1; border: 0; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: .85rem; background: var(--blue-100); color: var(--blue-700); }
.flatpickr-btn:hover { background: var(--blue-700); color: #fff; }
.flatpickr-btn.is-muted { background: transparent; color: var(--muted); }
.flatpickr-btn.is-muted:hover { background: var(--blue-50); color: var(--blue-900); }
input.flatpickr-input[readonly] { background-color: var(--bs-body-bg, #fff); cursor: pointer; }
