/* ==========================================
   PLB – Pas Lintas Batas
   CSS Utama – Revisi 3 (Mobile Optimized)
   ========================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --plb-navy: #0b3b82;
    --plb-blue: #1769c2;
    --plb-sky: #eaf4ff;
    --plb-ink: #172b4d;
    --plb-muted: #64748b;
    --plb-border: #dbe7f3;
    --plb-shadow: 0 8px 24px rgba(23, 77, 135, 0.08);
}

/* ---------- Modern surface overrides ---------- */
.content-area {
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
}
.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    text-align: left;
}
.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 12px;
    background: rgba(255,255,255,.13);
    color: #fff;
    font-size: 1.15rem;
}
.agency-name {
    font-size: .68rem !important;
    line-height: 1.55 !important;
    letter-spacing: .01em;
}
.sidebar-brand hr { display: none; }
.nav-label { color: rgba(255,255,255,.55) !important; margin-top: 1.5rem; }
.topbar {
    height: 64px !important;
    box-shadow: 0 1px 0 var(--plb-border), 0 8px 22px rgba(23,77,135,.05) !important;
}
.topbar .navbar-brand { letter-spacing: .02em; }
.content-area > .card,
.content-area .card {
    box-shadow: 0 4px 18px rgba(23,77,135,.055);
}
.card-header.bg-primary,
.card-header.bg-info,
.card-header.bg-success,
.card-header.bg-warning {
    background: linear-gradient(90deg, var(--plb-blue), #3c91dc) !important;
    color: #fff !important;
}
.card-header.bg-white { background: rgba(255,255,255,.88) !important; }
.btn {
    border-radius: .55rem;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-outline-primary { color: var(--plb-blue); border-color: #9ec6ed; }
.btn-outline-primary:hover { background: var(--plb-sky); color: var(--plb-navy); border-color: #72aee3; }
.form-control, .form-select {
    border-color: #d5e2ef;
    border-radius: .55rem;
    background-color: rgba(255,255,255,.92);
}
.table { --bs-table-striped-bg: #f7fbff; }
.table thead th { background: #f3f8fd; color: #42627d; border-bottom: 1px solid #d9e7f3; }
.alert { border: 0; border-radius: .7rem; }
.login-card { border: 1px solid rgba(255,255,255,.7); }

@media (max-width: 767.98px) {
    .content-area { padding: 1rem .75rem !important; }
    .topbar { height: 58px !important; }
    .sidebar { width: 280px; min-width: 280px; }
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f8fbff 0%, #eef5fc 55%, #ffffff 100%);
    color: var(--plb-ink);
    font-size: 0.925rem;
    overflow-x: hidden;
}

/* ---------- Layout ---------- */
.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 256px;
    min-width: 256px;
    background: linear-gradient(180deg, var(--plb-navy) 0%, var(--plb-blue) 62%, #2d86d8 100%);
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 1050;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    box-shadow: 5px 0 24px rgba(11, 59, 130, 0.12);
}

/* Mobile: sidebar offcanvas */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,0.25);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1040;
    }
    .sidebar-overlay.show { display: block; }
}

/* Sidebar Brand */
.sidebar-brand {
    border-bottom: 1px solid rgba(255,255,255,0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
}

/* Sidebar Nav Links */
.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.80);
    padding: 0.6rem 1rem;
    border-radius: 0.65rem;
    font-weight: 500;
    transition: background 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: translateX(3px);
}
.sidebar-nav .nav-link.active {
    background: #fff;
    color: var(--plb-blue) !important;
    box-shadow: 0 5px 14px rgba(7, 48, 106, 0.16);
    font-weight: 600;
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid var(--plb-border);
    height: 60px;
    background: rgba(255,255,255,0.94) !important;
    backdrop-filter: blur(12px);
}

/* ---------- Content Area ---------- */
.content-area {
    flex: 1;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: 0.85rem;
    box-shadow: var(--plb-shadow);
}
.card-header {
    border-radius: 0.85rem 0.85rem 0 0 !important;
    border-bottom: 1px solid var(--plb-border);
    font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn-primary {
    background: linear-gradient(135deg, var(--plb-blue), var(--plb-navy));
    border-color: var(--plb-blue);
    box-shadow: 0 4px 10px rgba(23, 105, 194, 0.18);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #0f5cae, #082e68);
    border-color: #0f5cae;
}
/* Touch-friendly minimum tap target on mobile */
@media (max-width: 767.98px) {
    .btn { min-height: 44px; }
    .btn-sm { min-height: 34px; }
}

/* ---------- Badges ---------- */
.badge { font-weight: 500; font-size: 0.78rem; }

/* ---------- Tables ---------- */
.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: #546e7a;
    border-bottom-width: 1px;
    white-space: nowrap;
}
.table tbody tr:hover { background-color: #f8fafc; }
.table-responsive {
    border-radius: 0 0 0.75rem 0.75rem;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Forms ---------- */
.form-control:focus, .form-select:focus {
    border-color: var(--plb-blue);
    box-shadow: 0 0 0 0.2rem rgba(23,105,194,0.14);
}
.form-label { font-weight: 500; color: #374151; margin-bottom: 0.3rem; }
@media (max-width: 575.98px) {
    .form-control, .form-select { font-size: 0.9rem; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.82rem; }
.breadcrumb-item a { color: #1565c0; text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ---------- Timeline Process ---------- */
.timeline-wrapper {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}
.timeline {
    display: flex;
    align-items: center;
    min-width: 600px;
    position: relative;
    padding: 1rem 0;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 2px;
    background: #e0e7ef;
    transform: translateY(-50%);
    z-index: 0;
}
.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}
.timeline-step .step-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.35em 0.75em;
    border-radius: 999px;
    background: #e0e7ef;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}
.timeline-step.completed .step-badge {
    background: #1565c0;
    color: #fff;
}
.timeline-step.active .step-badge {
    background: #f59e0b;
    color: #1a2533;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.25);
    font-weight: 700;
}

/* ---------- Login Page ---------- */
.login-bg {
    background: linear-gradient(135deg, #eaf4ff 0%, #f9fcff 48%, #e8f2ff 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Sidebar tetap berada dalam viewport; navigasi masih bisa digulir bila perlu
   tanpa menampilkan rel scrollbar yang mengganggu tampilan. */
#mainSidebar .sidebar-navigation {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
}
#mainSidebar .sidebar-navigation::-webkit-scrollbar { width: 0; height: 0; }

/* Desktop: semua menu dibuat selalu terlihat. Dengan begitu perpindahan atau
   refresh halaman tidak dapat menggeser posisi navigasi ke menu aktif. */
@media (min-width: 768px) {
    #mainSidebar .sidebar-navigation {
        overflow: hidden;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    #mainSidebar > .border-b:first-child { padding-top: .8rem; padding-bottom: .8rem; }
    #mainSidebar > .border-b:first-child img { height: 2.75rem; width: 2.75rem; }
    #mainSidebar > .border-b:first-child h1 { font-size: 1.05rem; }
    #mainSidebar > .border-b:nth-child(2) { padding-top: .55rem; padding-bottom: .55rem; line-height: 1.3; }
    #mainSidebar .sidebar-navigation > div { margin-bottom: .5rem; }
    #mainSidebar .sidebar-navigation nav > div { margin-top: .75rem; margin-bottom: .75rem; }
    #mainSidebar .sidebar-navigation nav a { padding-top: .5rem; padding-bottom: .5rem; }
}
.login-bg::before,
.login-bg::after {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(1px);
}
.login-bg::before {
    width: 34rem;
    height: 34rem;
    top: -18rem;
    right: -12rem;
    background: radial-gradient(circle, rgba(22, 105, 194, .22), transparent 68%);
}
.login-bg::after {
    width: 26rem;
    height: 26rem;
    bottom: -15rem;
    left: -11rem;
    background: radial-gradient(circle, rgba(78, 149, 220, .18), transparent 68%);
}
.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
}
.login-card {
    max-width: 29rem;
    padding: 2rem;
    border: 1px solid rgba(207, 221, 237, .9);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 20px 55px rgba(21, 68, 122, .12);
    transition: transform .25s ease, box-shadow .25s ease;
}
.login-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 65px rgba(21, 68, 122, .14);
}
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.login-logo { width: 5.5rem; height: 5.5rem; margin-bottom: .9rem; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(23, 86, 154, .14)); transition: transform .25s ease, filter .25s ease; }
.login-logo-link { display: inline-flex; border-radius: 1rem; outline: none; }
.login-logo-link:focus-visible { outline: 3px solid rgba(23, 105, 194, .32); outline-offset: 4px; }
.login-card .login-logo-link:hover .login-logo { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 12px 14px rgba(23, 86, 154, .24)); }
.login-card:hover .login-logo { transform: translateY(-2px) scale(1.025); filter: drop-shadow(0 11px 12px rgba(23, 86, 154, .20)); }
.login-eyebrow { margin: 0 0 .3rem; color: #3d6e9f; font-size: .66rem; font-weight: 700; letter-spacing: .12em; }
.login-brand h1 { margin: 0; color: #133c70; font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.login-subtitle { margin: .25rem 0 0; color: #6b7c91; font-size: .78rem; }
.login-divider { height: 1px; margin: 1.65rem 0; background: #e7eef6; }
.login-intro { text-align: center; }
.login-intro h2 { margin: 0; color: #1c324d; font-size: 1.15rem; font-weight: 700; }
.login-intro p { margin: .4rem 0 1.4rem; color: #738399; font-size: .86rem; }
.login-form { display: grid; gap: 1rem; }
.login-field label { display: block; margin-bottom: .45rem; color: #39516c; font-size: .78rem; font-weight: 650; }
.login-input-wrap { position: relative; }
.login-input-wrap > i { position: absolute; z-index: 1; top: 50%; left: 1rem; color: #8aa0b9; font-size: .85rem; transform: translateY(-50%); transition: color .2s ease; }
.login-input-wrap input {
    width: 100%;
    height: 3rem;
    padding: .75rem 1rem .75rem 2.65rem;
    border: 1px solid #d8e3ef;
    border-radius: .7rem;
    outline: 0;
    background: #fbfdff;
    color: #1c324d;
    font-size: .9rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.login-input-wrap input::placeholder { color: #a5b3c3; }
.login-input-wrap:focus-within > i { color: var(--plb-blue); }
.login-input-wrap input:focus { border-color: #4b91d7; background: #fff; box-shadow: 0 0 0 4px rgba(32, 117, 203, .12); }
.login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    width: 100%;
    min-height: 3rem;
    margin-top: .25rem;
    border: 0;
    border-radius: .7rem;
    background: #1769c2;
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    box-shadow: 0 7px 14px rgba(23, 105, 194, .20);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.login-submit:hover { transform: translateY(-2px); background: #1059a7; box-shadow: 0 10px 20px rgba(23, 105, 194, .28); }
.login-submit:active { transform: translateY(0); }
.login-submit:focus-visible { outline: 3px solid rgba(23, 105, 194, .28); outline-offset: 3px; }
.login-alert { margin: 0 0 1.15rem; padding: .75rem .9rem; border: 1px solid #f3c7cd; border-radius: .7rem; font-size: .82rem; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: .45rem; margin-top: 1.5rem; color: #8796a9; font-size: .73rem; }
.login-footer i { color: #5c87b6; }
.login-home-link { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; margin-top: .8rem; color: #4d76a0; font-size: .72rem; font-weight: 600; text-decoration: none; transition: color .2s ease, transform .2s ease; }
.login-home-link:hover { color: #1769b6; transform: translateX(-2px); }
.login-home-link:focus-visible { outline: 3px solid rgba(23, 105, 194, .28); outline-offset: 3px; border-radius: .35rem; }
@media (max-width: 480px) {
    .login-page { padding: 1rem; }
    .login-card { padding: 1.5rem; border-radius: 1rem; }
    .login-logo { width: 4.5rem; height: 4.5rem; }
    .login-brand h1 { font-size: 1.1rem; }
}

/* ---------- Form Edit Permohonan ---------- */
.detail-card,
.detail-timeline {
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.detail-card:hover,
.detail-timeline:hover {
    border-color: #b8d5ef !important;
    box-shadow: 0 12px 28px rgba(24, 76, 130, .09) !important;
}
.detail-card table td {
    overflow-wrap: anywhere;
    vertical-align: top;
}
.detail-card table td:first-child {
    width: 40%;
    font-size: .76rem;
    font-weight: 600;
}
.detail-card a,
.detail-card button {
    transition: transform .2s ease, box-shadow .2s ease;
}
.detail-card a:hover,
.detail-card button:hover {
    transform: translateY(-1px);
}
.detail-identity-card .p-6 {
    padding: 1.1rem !important;
}
.detail-identity-card table {
    border-collapse: separate;
    border-spacing: 0 .25rem;
}
.detail-identity-card table tr {
    transition: background-color .18s ease;
}
.detail-identity-card table tr:hover td {
    background: #f4f9ff;
}
.detail-identity-card table td {
    padding: .48rem .55rem !important;
}
.detail-identity-card table td:first-child {
    border-radius: .55rem 0 0 .55rem;
    color: #55708e;
}
.detail-identity-card table td:last-child {
    border-radius: 0 .55rem .55rem 0;
    color: #263b55;
}
.detail-identity-card table tr:has(hr) td {
    background: transparent !important;
    padding: .25rem 0 !important;
}
.detail-process-card .p-6 {
    padding: 1.35rem !important;
}
.detail-process-card .p-6 > .rounded-lg {
    border-radius: .85rem !important;
    padding: 1rem !important;
}
.detail-process-card .p-6 > .flex,
.detail-process-card .p-6 > .flex-col {
    gap: .75rem !important;
}
.detail-process-card .p-6 a {
    min-height: 2.8rem;
    border-radius: .8rem;
}
@media (min-width: 768px) {
    .detail-process-card .p-6 > a {
        width: fit-content !important;
        max-width: 100%;
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }
    .detail-process-card .p-6 > .flex > a,
    .detail-process-card .p-6 > .flex-col > a {
        width: fit-content !important;
        max-width: 100%;
    }
    .detail-process-card .p-6 > .flex-col {
        align-items: flex-start;
    }
}
.detail-process-card .p-6 > .bio-photo-stage {
    align-items: center !important;
    width: 100%;
}
.detail-process-card .p-6 > .bio-action-stack {
    align-items: stretch !important;
}
.detail-timeline .timeline {
    min-width: 0 !important;
    gap: .5rem;
    padding: 0 0 1.25rem;
}
.detail-timeline .timeline::before {
    left: 8%;
    right: 8%;
    background: linear-gradient(90deg, #87bdea, #d4e7f8);
}
.detail-timeline .timeline-step .inline-flex {
    min-width: 5.9rem;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #d9e8f6;
    transition: transform .2s ease, box-shadow .2s ease;
}
.detail-timeline .timeline-step:hover .inline-flex {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(24, 76, 130, .16);
}
.detail-timeline .timeline-step.completed .inline-flex {
    box-shadow: 0 0 0 1px #9cdec0;
}
.detail-timeline .timeline-step.active .inline-flex {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .16);
}
.permohonan-create-form > .rounded-xl:not(#form-action-bar),
.permohonan-edit-form > .rounded-xl:not(#form-action-bar) {
    border-color: rgba(203, 220, 238, .88) !important;
    box-shadow: 0 5px 20px rgba(24, 76, 130, .045) !important;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.permohonan-create-form > .rounded-xl:not(#form-action-bar):hover,
.permohonan-edit-form > .rounded-xl:not(#form-action-bar):hover {
    border-color: #b7d4ef !important;
    box-shadow: 0 12px 28px rgba(24, 76, 130, .09) !important;
}
.permohonan-create-form > .rounded-xl > .rounded-t-xl.bg-brand-600,
.permohonan-edit-form > .rounded-xl > .rounded-t-xl.bg-brand-600 {
    padding: .95rem 1.25rem !important;
    background: linear-gradient(100deg, #1769c2, #2458a6) !important;
    font-size: .78rem;
    letter-spacing: .075em;
}
.permohonan-create-form > .rounded-xl > .rounded-t-xl.bg-amber-50,
.permohonan-edit-form > .rounded-xl > .rounded-t-xl.bg-amber-50 {
    padding: .95rem 1.25rem !important;
    border-color: #fde6aa !important;
    background: linear-gradient(100deg, #fff9e9, #fffdf7) !important;
    font-size: .78rem;
    letter-spacing: .055em;
}
.permohonan-create-form > .rounded-xl > .p-6,
.permohonan-edit-form > .rounded-xl > .p-6 {
    padding: 1.35rem !important;
}
.permohonan-create-form input:not([type="radio"]):not([type="checkbox"]),
.permohonan-create-form select,
.permohonan-create-form textarea,
.permohonan-edit-form input:not([type="radio"]):not([type="checkbox"]),
.permohonan-edit-form select,
.permohonan-edit-form textarea {
    border-color: #d7e3ef !important;
    background-color: #fcfdff !important;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.permohonan-create-form input:not([type="radio"]):not([type="checkbox"]):hover,
.permohonan-create-form select:hover,
.permohonan-create-form textarea:hover,
.permohonan-edit-form input:not([type="radio"]):not([type="checkbox"]):hover,
.permohonan-edit-form select:hover,
.permohonan-edit-form textarea:hover {
    border-color: #aecce9 !important;
    background-color: #fff !important;
}
.permohonan-create-form input:not([type="radio"]):not([type="checkbox"]):focus,
.permohonan-create-form select:focus,
.permohonan-create-form textarea:focus,
.permohonan-edit-form input:not([type="radio"]):not([type="checkbox"]):focus,
.permohonan-edit-form select:focus,
.permohonan-edit-form textarea:focus {
    border-color: #2878ca !important;
    box-shadow: 0 0 0 4px rgba(40, 120, 202, .11) !important;
    background-color: #fff !important;
}
.permohonan-create-form label,
.permohonan-edit-form label {
    color: #3d526b;
}
.permohonan-create-form .create-identity-grid > *,
.permohonan-edit-form .identity-grid > * {
    min-width: 0;
}
.permohonan-create-form .create-identity-section-title,
.permohonan-edit-form .identity-section-title {
    display: flex;
    align-items: center;
    min-height: 3.25rem;
    overflow: visible;
    white-space: normal;
}
.permohonan-create-form .create-identity-section-title > span,
.permohonan-edit-form .identity-section-title > span {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}
.permohonan-edit-form .identity-grid h6 {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
}
.permohonan-create-form select,
.permohonan-edit-form select {
    appearance: none;
    padding-right: 2.8rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234d7199' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-position: right .9rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1rem !important;
}
.permohonan-create-form select:hover,
.permohonan-edit-form select:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231769c2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}
.permohonan-create-form input[type="radio"],
.permohonan-create-form input[type="checkbox"],
.permohonan-edit-form input[type="radio"],
.permohonan-edit-form input[type="checkbox"] {
    accent-color: #1769c2;
}
.permohonan-create-form [id$="_options"],
.permohonan-edit-form [id$="_options"] {
    border-color: #dce9f5 !important;
    background: linear-gradient(135deg, #f8fbff, #fff) !important;
}
.permohonan-create-form #form-action-bar,
.permohonan-edit-form #form-action-bar {
    border-color: #cbdff2 !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 -6px 24px rgba(24, 76, 130, .10) !important;
}
.permohonan-create-form #form-action-bar a,
.permohonan-edit-form #form-action-bar a {
    border-color: #d7e3ef !important;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.permohonan-create-form #form-action-bar a:hover,
.permohonan-edit-form #form-action-bar a:hover {
    transform: translateY(-1px);
    border-color: #aecce9 !important;
    background: #f2f8ff !important;
    color: #155aab !important;
}
.permohonan-create-form #form-action-bar button,
.permohonan-edit-form #form-action-bar button {
    background: linear-gradient(100deg, #1769c2, #2458a6) !important;
    box-shadow: 0 7px 14px rgba(23, 105, 194, .20) !important;
}
.permohonan-create-form #form-action-bar button:hover,
.permohonan-edit-form #form-action-bar button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(23, 105, 194, .28) !important;
}
@media (max-width: 767.98px) {
    .permohonan-detail-hero { padding: 1.25rem !important; }
    .permohonan-detail-hero > div > div:last-child { width: 100%; }
    .permohonan-detail-hero > div > div:last-child > a { flex: 1 1 auto; }
    .detail-card table { font-size: .82rem; }
    .detail-card table td:first-child { width: 38%; }
    .detail-identity-card .p-6,
    .detail-process-card .p-6 { padding: 1rem !important; }
    .detail-process-card .p-6 > a,
    .detail-process-card .p-6 > .flex > a,
    .detail-process-card .p-6 > .flex-col > a {
        width: 100% !important;
    }
    .detail-timeline { padding: 1rem !important; }
    .detail-timeline .timeline {
        align-items: stretch;
        flex-direction: column;
        gap: .65rem;
        padding: .1rem 0 .1rem 0;
    }
    .detail-timeline .timeline::before {
        top: 1rem;
        bottom: 1rem;
        left: 1rem;
        right: auto;
        width: 2px;
        height: auto;
        transform: none;
    }
    .detail-timeline .timeline-step {
        display: flex;
        flex: 0 0 auto;
        padding-left: 2.1rem;
        text-align: left;
    }
    .detail-timeline .timeline-step .inline-flex {
        min-width: 0;
        width: 100%;
        justify-content: flex-start;
        padding: .65rem .85rem;
    }
    .permohonan-create-form > .rounded-xl > .p-6,
    .permohonan-edit-form > .rounded-xl > .p-6 { padding: 1rem !important; }
    .permohonan-create-form > .rounded-xl > .rounded-t-xl.bg-brand-600,
    .permohonan-create-form > .rounded-xl > .rounded-t-xl.bg-amber-50,
    .permohonan-edit-form > .rounded-xl > .rounded-t-xl.bg-brand-600,
    .permohonan-edit-form > .rounded-xl > .rounded-t-xl.bg-amber-50 { padding: .8rem 1rem !important; }
    .permohonan-create-form #form-action-bar,
    .permohonan-edit-form #form-action-bar {
        position: fixed !important;
        right: .75rem;
        bottom: .75rem;
        left: .75rem;
        z-index: 60 !important;
        margin-top: 0 !important;
        border-radius: 1rem !important;
        box-shadow: 0 10px 30px rgba(24, 76, 130, .22) !important;
    }
    .permohonan-create-form #form-action-bar > div,
    .permohonan-edit-form #form-action-bar > div { padding: .65rem .75rem !important; }
    .permohonan-create-form #form-action-bar a,
    .permohonan-edit-form #form-action-bar a,
    .permohonan-create-form #form-action-bar button,
    .permohonan-edit-form #form-action-bar button { min-height: 2.8rem; }
    .permohonan-create-form,
    .permohonan-edit-form { padding-bottom: 5.75rem; }
    .permohonan-create-form .create-identity-section-title,
    .permohonan-edit-form .identity-section-title {
        min-height: 4.5rem;
        padding: .8rem 1rem !important;
        font-size: .78rem !important;
        line-height: 1.45 !important;
        letter-spacing: .02em;
    }
    /* Seluruh kolom form wajib menjadi satu lajur pada ponsel. */
    .permohonan-create-form .grid,
    .permohonan-edit-form .grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .permohonan-create-form .grid > *,
    .permohonan-edit-form .grid > * {
        grid-column: 1 / -1 !important;
        min-width: 0;
    }
    .permohonan-create-form .row,
    .permohonan-edit-form .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem !important;
        margin-left: 0;
        margin-right: 0;
    }
    .permohonan-create-form .row > *,
    .permohonan-edit-form .row > * {
        grid-column: 1 / -1 !important;
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Sebagian WebView perangkat melaporkan lebar CSS besar; tetap paksa form satu kolom pada perangkat ponsel. */
@media (max-device-width: 767px) {
    .permohonan-detail-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .permohonan-detail-grid > * { grid-column: 1 / -1 !important; min-width: 0; }
    .detail-timeline { padding: 1rem !important; }
    .detail-timeline .timeline {
        align-items: stretch;
        flex-direction: column;
        gap: .65rem;
        padding: .1rem 0;
    }
    .detail-timeline .timeline::before {
        top: 1rem;
        bottom: 1rem;
        left: 1rem;
        right: auto;
        width: 2px;
        height: auto;
        transform: none;
    }
    .detail-timeline .timeline-step {
        display: flex;
        flex: 0 0 auto;
        padding-left: 2.1rem;
        text-align: left;
    }
    .detail-timeline .timeline-step .inline-flex {
        min-width: 0;
        width: 100%;
        justify-content: flex-start;
        padding: .65rem .85rem;
    }
    .permohonan-create-form .grid,
    .permohonan-edit-form .grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .permohonan-create-form .grid > *,
    .permohonan-edit-form .grid > * {
        grid-column: 1 / -1 !important;
        min-width: 0;
    }
    .permohonan-create-form .row,
    .permohonan-edit-form .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem !important;
        margin-left: 0;
        margin-right: 0;
    }
    .permohonan-create-form .row > *,
    .permohonan-edit-form .row > * {
        grid-column: 1 / -1 !important;
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ---------- Stat Cards (Dashboard) ---------- */
.stat-card {
    border-radius: 0.75rem;
    border: none;
    overflow: hidden;
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
@media (max-width: 575.98px) {
    .stat-card .card-body {
        padding: 0.75rem !important;
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
    }
    .stat-card .stat-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 0 !important;
        margin-right: 0.75rem !important;
    }
    .stat-card h4 { font-size: 1.2rem; margin-bottom: 0; }
    .stat-card div[style*="font-size:0.75rem"] { font-size: 0.7rem !important; }
}

/* ---------- Detail Permohonan – Two-column stacks on mobile ---------- */
@media (max-width: 767.98px) {
    /* Force full-width cards in detail row */
    /* Removed global col-md-4 override */
    /* Reduce card body padding */
    .card-body { padding: 1rem !important; }
    /* Page header compact */
    h2, h3 { font-size: 1.15rem !important; }
    h4 { font-size: 1rem !important; }
    /* Breadcrumb smaller */
    .breadcrumb { font-size: 0.75rem; }
    /* Content area padding */
    .content-area { padding: 0.75rem !important; }
    /* Row gap tighter on mobile */
    .row.g-4 { --bs-gutter-y: 0.75rem; --bs-gutter-x: 0.75rem; }
    /* Table font */
    .table { font-size: 0.82rem; }
    /* Alert compact */
    .alert { padding: 0.6rem 0.9rem; font-size: 0.85rem; }
    /* Action buttons full width on mobile */
    .d-grid .btn { width: 100%; }
    /* Filter forms stack */
    .row.g-3 > .col-md-2,
    .row.g-3 > .col-md-3,
    .row.g-3 > .col-md-4 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ---------- Biometrik Camera on small screen ---------- */
@media (max-width: 767.98px) {
    .col-md-7.mb-4, .col-md-5.mb-4 { margin-bottom: 0.75rem !important; }
    #webcam, video { max-height: 260px; }
}

/* ---------- Mobile Global Adjustments ---------- */
@media (max-width: 767.98px) {
    .main-content { margin-left: 0; }

    /* Content padding */
    .content-area { padding: 0.75rem !important; }

    /* Page titles */
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.05rem; }

    /* Card body padding */
    .card-body { padding: 0.85rem !important; }

    /* Alert compact */
    .alert { font-size: 0.85rem; }

    /* Table */
    .table { font-size: 0.82rem; }
    .table-responsive { -webkit-overflow-scrolling: touch; }

    /* Action buttons in grid go full width */
    .d-grid > .btn { width: 100%; }

    /* Row gaps tighter */
    .row.g-4 { --bs-gutter-y: 0.75rem; --bs-gutter-x: 0.75rem; }
    .row.g-3 { --bs-gutter-y: 0.6rem; --bs-gutter-x: 0.6rem; }

    /* Filter rows (form inside .card-body > form) — stack all cols */
    .card-body > form .col-md-2,
    .card-body > form .col-md-3,
    .card-body > form .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Touch-friendly buttons */
    .btn:not(.btn-sm) { min-height: 44px; }

    /* Detail page two-column → single column on mobile */
    .detail-row > .col-md-4,
    .detail-row > .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Extra small (phones < 480px) */
@media (max-width: 479.98px) {
    /* Stat cards: 2 per row, compact layout */
    .stat-card .card-body {
        padding: 0.65rem 0.75rem !important;
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
        gap: 0.6rem;
    }
    .stat-card .stat-icon {
        width: 36px !important;
        height: 36px !important;
        margin-bottom: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0;
    }
    .stat-card h4 { font-size: 1.1rem !important; margin-bottom: 0 !important; }

    /* Forms: single column */
    .col-md-6, .col-sm-6 { flex: 0 0 100%; max-width: 100%; }

    /* Table very small */
    .table { font-size: 0.78rem; }
    .btn-sm { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
}

