/* =========================================================
   SWAMEDIKASI - style.css
   Tema: Biru Muda, Putih, Abu-abu | Responsif (HP & Laptop)
   ========================================================= */

:root {
    --biru-tua: #1565c0;      /* header/sidebar - biru sedang, tidak gelap */
    --biru: #2f8fe5;          /* aksen utama / tombol */
    --biru-muda: #64b5f6;     /* aksen sekunder */
    --biru-pucat: #eaf4fd;    /* background lembut */
    --putih: #ffffff;
    --abu-100: #f5f7fa;
    --abu-200: #e7eaed;
    --abu-400: #b8c0c8;
    --abu-600: #6b7580;
    --abu-800: #37414a;
    --merah: #d64545;
    --hijau: #2e9e5b;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(21, 101, 192, 0.08);
    --topbar-h: 62px;
    --sidebar-w: 240px;
    --bottomnav-h: 62px;
}

html { -webkit-tap-highlight-color: transparent; }

* { box-sizing: border-box; min-width: 0; }

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--abu-100);
    color: var(--abu-800);
    font-size: 15px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; }

/* ============ LOGIN PAGE (split-screen) ============ */
.login-body { margin: 0; overflow-x: hidden; }
.login-page { min-height: 100vh; display: flex; }

/* Panel kiri: branding */
.login-brand-panel {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, #0d3d78 0%, var(--biru-tua) 45%, var(--biru) 85%, var(--biru-muda) 130%);
    display: flex;
    align-items: center;
    padding: 60px;
    color: #fff;
}
.login-brand-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    background: var(--biru-muda);
}
.login-brand-blob-1 { width: 340px; height: 340px; top: -90px; right: -90px; }
.login-brand-blob-2 { width: 260px; height: 260px; bottom: -80px; left: -60px; background: #ffffff; opacity: 0.12; }
.login-brand-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.16) 1.5px, transparent 1.5px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 40%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 40%, transparent 75%);
}
.login-brand-content { position: relative; z-index: 1; max-width: 440px; margin: 0 auto; }
.login-brand-logo-img {
    width: 62px; height: 62px; object-fit: contain; border-radius: 16px;
    background: #fff; padding: 8px; margin-bottom: 22px;
}
.login-brand-logo-icon {
    width: 62px; height: 62px; border-radius: 16px;
    background: rgba(255,255,255,0.14);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 22px;
}
.login-brand-panel h1 {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 32px; font-weight: 800; line-height: 1.15;
    margin: 0 0 14px;
}
.login-brand-tagline { font-size: 14.5px; line-height: 1.7; color: rgba(255,255,255,0.88); margin: 0 0 34px; max-width: 380px; }
.login-brand-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.login-brand-features li { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: rgba(255,255,255,0.95); }
.login-brand-features li i {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px;
    background: rgba(255,255,255,0.14);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}

/* Panel kanan: form */
.login-form-panel { flex: 1 1 440px; max-width: 480px; background: var(--putih); display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.login-form-wrap { width: 100%; max-width: 320px; }
.login-form-logo-mobile { display: none; }

/* Header kompak khusus HP (logo + nama apotek di atas gradasi) */
.login-mobile-header { display: none; }

@media (max-width: 900px) {
    .login-brand-panel { display: none; }
    .login-page { display: block; }
    .login-form-panel {
        display: flex; flex-direction: column;
        min-height: 100vh; max-width: none; padding: 0;
        background: linear-gradient(160deg, #0d3d78, var(--biru-tua) 55%, var(--biru));
    }

    .login-mobile-header {
        display: flex; flex-direction: column; align-items: center;
        padding: 56px 24px 34px;
        color: #fff;
        flex-shrink: 0;
    }
    .login-mobile-header img {
        width: 56px; height: 56px; object-fit: contain; border-radius: 14px;
        background: #fff; padding: 8px; margin-bottom: 14px;
    }
    .login-mobile-header .logo-circle {
        width: 56px; height: 56px; border-radius: 50%;
        background: rgba(255,255,255,0.16); color: #fff;
        display: flex; align-items: center; justify-content: center; font-size: 24px;
        margin-bottom: 14px;
    }
    .login-mobile-name {
        font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
        font-size: 19px; font-weight: 800; margin-bottom: 4px; text-align: center;
    }
    .login-mobile-tagline { font-size: 12px; color: rgba(255,255,255,0.82); }

    .login-form-wrap {
        background: var(--putih);
        border-radius: 26px 26px 0 0;
        box-shadow: 0 -8px 30px rgba(0,0,0,0.12);
        padding: 34px 26px 40px;
        flex: 1;
        max-width: none;
        margin: 0;
    }
    .login-form-heading h2 { font-size: 21px; }
}
@media (max-width: 480px) {
    .login-mobile-header { padding: 44px 20px 28px; }
    .login-form-wrap { padding: 30px 20px 36px; }
}

.login-form-heading { margin-bottom: 26px; }
.login-form-heading h2 {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 24px; font-weight: 700; color: var(--biru-tua); margin: 0 0 6px;
}
.login-form-heading .subtitle { font-size: 13px; color: var(--abu-600); margin: 0; line-height: 1.5; }

.login-submit-btn { margin-top: 6px; padding: 12px; font-size: 14.5px; }
.login-footnote { text-align: center; font-size: 12px; color: var(--abu-600); margin: 22px 0 0; }

/* ============ FORM ELEMENTS ============ */
.form-group { margin-bottom: 16px; min-width: 0; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13.5px; color: var(--abu-800); }
label .req { color: var(--merah); }
input[type=text], input[type=password], input[type=date],
input[type=number], input[type=tel], input[type=email],
input[type=file], select, textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--abu-400);
    border-radius: 8px;
    font-size: 14px;
    background: var(--putih);
    color: var(--abu-800);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--biru);
    box-shadow: 0 0 0 3px rgba(47, 143, 229, 0.15);
}
textarea { resize: vertical; min-height: 70px; width: 100%; }
.form-hint { font-size: 12px; color: var(--abu-600); margin-top: 4px; }
.field-narrow-260 { max-width: 260px; }
.field-narrow-400 { max-width: 400px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; min-width: 0; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; min-width: 0; }
fieldset {
    border: 1px solid var(--abu-200);
    border-radius: var(--radius);
    margin-bottom: 20px;
    padding: 18px;
    min-width: 0;
}
legend { font-weight: 700; color: var(--biru-tua); padding: 0 8px; font-size: 14.5px; }

/* Ceklis skrining/penjelasan/persetujuan */
.checklist-list { display: flex; flex-direction: column; gap: 12px; }
.checklist-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px;
    background: var(--abu-100);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--abu-800);
}
.checklist-item input[type=checkbox] {
    width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px;
    accent-color: var(--biru);
}
.checklist-item:has(input:checked) { background: #e2f6ea; }

/* Pad tanda tangan digital */
.ttd-pad-wrap { position: relative; border: 1.5px dashed var(--abu-400); border-radius: 10px; overflow: hidden; background: #fff; }
.ttd-pad { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.ttd-pad-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--abu-400); font-size: 13px; pointer-events: none;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--biru); color: var(--putih); }
.btn-primary:hover { background: var(--biru-tua); }
.btn-secondary { background: var(--abu-200); color: var(--abu-800); }
.btn-secondary:hover { background: var(--abu-400); }
.btn-danger { background: var(--merah); color: var(--putih); }
.btn-danger:hover { background: #b23434; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }

/* ============ APP LAYOUT ============ */
.app { display: flex; min-height: 100vh; max-width: 100%; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--biru-tua);
    color: var(--putih);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.sidebar .brand .icon {
    width: 34px; height: 34px;
    background: var(--biru);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.sidebar .brand span { font-weight: 700; font-size: 15px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 12px 22px; font-size: 14px; color: rgba(255,255,255,0.85); border-left: 3px solid transparent; }
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: var(--putih); }
.sidebar nav a.active { background: rgba(255,255,255,0.14); border-left-color: var(--putih); color: var(--putih); font-weight: 600; }
.sidebar nav .group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,0.55); padding: 14px 22px 6px; }

/* Main content */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    height: var(--topbar-h);
    background: var(--putih);
    border-bottom: 1px solid var(--abu-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow);
    gap: 10px;
}
.topbar .hamburger { display: none; background: none; border: none; font-size: 22px; color: var(--biru-tua); cursor: pointer; flex-shrink: 0; }
.topbar .page-title { font-size: 17px; font-weight: 700; color: var(--biru-tua); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .user-menu { position: relative; flex-shrink: 0; }
.topbar .user-menu-btn {
    display: flex; align-items: center; gap: 12px;
    background: none; border: none; cursor: pointer; padding: 4px; border-radius: 10px;
}
.topbar .user-menu-btn:hover { background: var(--abu-100); }
.topbar .user-menu .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--biru-pucat);
    color: var(--biru);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.topbar .user-menu .info { text-align: right; line-height: 1.2; }
.topbar .user-menu .info .name { font-size: 13.5px; font-weight: 700; color: var(--abu-800); }
.topbar .user-menu .info .role { font-size: 11.5px; color: var(--abu-600); }

.user-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--putih);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    min-width: 220px;
    overflow: hidden;
    z-index: 950;
}
.user-dropdown.show { display: block; }
.user-dropdown-header { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--abu-200); }
.user-dropdown-header .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--biru-pucat); color: var(--biru);
    display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.user-dropdown-header .name { font-size: 13.5px; font-weight: 700; color: var(--abu-800); }
.user-dropdown-header .role { font-size: 11.5px; color: var(--abu-600); }
.user-dropdown-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 14px; font-size: 13.5px; font-weight: 600; color: var(--merah);
}
.user-dropdown-logout:hover { background: #fbe6e6; }

.content { padding: 24px; flex: 1; min-width: 0; max-width: 100%; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(21,101,192,0.35); z-index: 999; }

/* ============ CARDS / DASHBOARD ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
    background: var(--putih);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid var(--biru);
    min-width: 0;
}
.stat-card .stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    background: var(--biru-pucat);
    color: var(--biru);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-card .stat-value { font-size: 24px; font-weight: 800; color: var(--biru-tua); }
.stat-card .stat-label { font-size: 12.5px; color: var(--abu-600); }

.card { background: var(--putih); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.card-header h2 { font-size: 16.5px; color: var(--biru-tua); margin: 0; }

/* ============ TABLE (desktop: tabel biasa | mobile: kartu bertumpuk) ============ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table-wide { min-width: 980px; }
thead th { background: var(--biru-pucat); color: var(--biru-tua); text-align: left; padding: 11px 12px; white-space: nowrap; font-weight: 700; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--abu-200); vertical-align: middle; word-break: break-word; }
tbody tr:hover { background: var(--abu-100); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* Baris registrasi yang dibatalkan -> tampil merah */
tr.row-batal { background: #fdeaea; }
tr.row-batal:hover { background: #fbdcdc; }
table.table-responsive-cards tr.row-batal { border-color: #f0bcbc; background: #fdeaea; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--abu-200); }
.pagination .btn-sm { min-width: 34px; padding: 6px 10px; }
.pagination .btn.disabled { opacity: 0.4; pointer-events: none; }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge-aktif { background: #e2f6ea; color: var(--hijau); }
.badge-nonaktif { background: #fbe6e6; color: var(--merah); }
.badge-menunggu { background: #fdf1de; color: #b8860b; }
.badge-diproses { background: #eaf4fd; color: var(--biru-tua); }
.badge-selesai { background: #e2f6ea; color: var(--hijau); }

/* Indikator progres ringkas (Pemeriksaan/Vital/Obat) dalam 1 kolom */
.progress-dots { display: flex; gap: 6px; }
.progress-dots .dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    background: var(--abu-200);
    color: var(--abu-600);
    flex-shrink: 0;
}
.progress-dots .dot.done { background: #e2f6ea; color: var(--hijau); }

/* Search / filter bar */
.toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { max-width: 280px; }
.toolbar select { max-width: 220px; }
.toolbar .spacer { flex: 1; }
.toolbar-date-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-date-group input[type=date] { width: auto; min-width: 140px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px; word-break: break-word; }
.alert-success { background: #e2f6ea; color: #1c6b3d; border: 1px solid #b6e3c6; }
.alert-error { background: #fbe6e6; color: #a52f2f; border: 1px solid #f0bcbc; }

/* Photo preview */
.photo-preview { width: 100px; height: 100px; border-radius: 10px; object-fit: cover; border: 1px solid var(--abu-200); background: var(--abu-100); }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--abu-600); }
.empty-state .icon { font-size: 40px; margin-bottom: 10px; color: var(--abu-400); }

/* ============ FORM LAYOUT (2 KOLOM) - memanfaatkan ruang kosong di layar lebar ============ */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; min-width: 0; }
.form-main { min-width: 0; }
.form-side { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.side-card { background: var(--putih); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.side-card h3 { font-size: 13.5px; color: var(--biru-tua); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.side-card .preview-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--biru-pucat);
    color: var(--biru);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    font-weight: 700;
    margin: 0 auto 12px;
    object-fit: cover;
}
.side-card .preview-name { text-align: center; font-weight: 700; color: var(--abu-800); font-size: 15px; margin-bottom: 2px; word-break: break-word; }
.side-card .preview-sub { text-align: center; color: var(--abu-600); font-size: 12.5px; margin-bottom: 14px; word-break: break-word; }
.side-card .preview-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--abu-200); font-size: 12.5px; }
.side-card .preview-row span:first-child { color: var(--abu-600); flex-shrink: 0; }
.side-card .preview-row span:last-child { font-weight: 600; color: var(--abu-800); text-align: right; word-break: break-word; }
.side-card ul.tips { margin: 0; padding: 0; list-style: none; }
.side-card ul.tips li { display: flex; gap: 8px; font-size: 12.5px; color: var(--abu-600); padding: 6px 0; line-height: 1.5; }
.side-card ul.tips li i { color: var(--biru); margin-top: 2px; flex-shrink: 0; }
.badge-rekam { display: block; background: var(--biru-pucat); color: var(--biru-tua); font-weight: 700; padding: 6px 12px; border-radius: 8px; font-size: 13px; text-align: center; width: 100%; }

/* Sticky action bar khusus mobile (muncul hanya di layar kecil) */
.sticky-actions { display: none; }
.form-actions-desktop { display: flex; gap: 10px; justify-content: flex-end; }

/* ============ BOTTOM NAVIGATION (mobile, ala aplikasi Android) ============ */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--putih);
    border-top: 1px solid var(--abu-200);
    z-index: 950;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(21,101,192,0.10);
}
.bottom-nav ul { display: flex; }
.bottom-nav li { flex: 1; min-width: 0; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 2px 7px; font-size: 10.5px; color: var(--abu-600); font-weight: 600; text-align: center; }
.bottom-nav a i { font-size: 19px; }
.bottom-nav a.active { color: var(--biru); }
.bottom-nav a.active i { background: var(--biru-pucat); border-radius: 50%; padding: 4px 10px; }

/* ============ RESPONSIVE ============ */

/* Tablet (kecil s/d 992px): stat 2 kolom, form jadi 1 kolom, sidebar tetap tapi lewat overlay hamburger */
@media (max-width: 992px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .form-row, .form-row-3 { grid-template-columns: minmax(0,1fr); }
    .form-layout { grid-template-columns: minmax(0,1fr); }
    .form-side { position: static; }
}

/* HP / Mobile (<=768px): sidebar diganti bottom navigation ala aplikasi Android */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .overlay { display: none !important; }
    .main { margin-left: 0; min-width: 0; }
    .app { display: block; }

    body { padding-bottom: 0; }
    .bottom-nav { display: block; }
    .content { padding-bottom: calc(var(--bottomnav-h) + 24px); }

    .topbar { height: 54px; padding: 0 14px; }
    .topbar .hamburger { display: none; }
    .topbar .page-title { font-size: 15.5px; }
    .topbar .user-menu .info { display: none; }
    .topbar .user-menu .avatar { width: 32px; height: 32px; font-size: 13px; }

    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
    .stat-card { padding: 14px; gap: 10px; border-radius: 12px; }
    .stat-card .stat-icon { width: 38px; height: 38px; font-size: 16px; }
    .stat-card .stat-value { font-size: 19px; }
    .stat-card .stat-label { font-size: 11px; }

    .content { padding: 12px; }
    .card {
        padding: 14px;
        margin: 0 -12px 10px;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid var(--abu-200);
        border-bottom: 1px solid var(--abu-200);
    }
    .card-header h2 { font-size: 15px; }
    .side-card {
        padding: 14px;
        margin: 0 -12px;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid var(--abu-200);
        border-bottom: 1px solid var(--abu-200);
    }
    .form-main > .alert, .form-layout > .alert { margin: 0 0 12px; }

    .form-row, .form-row-3 { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .field-narrow-260, .field-narrow-400 { max-width: 100%; }
    fieldset { padding: 14px; margin-bottom: 14px; }
    legend { font-size: 13.5px; }

    input[type=text], input[type=password], input[type=date],
    input[type=number], input[type=tel], input[type=email],
    input[type=file], select, textarea {
        padding: 12px 14px;
        font-size: 16px; /* mencegah auto-zoom di Android/iOS */
        border-radius: 10px;
    }
    .btn { padding: 12px 18px; border-radius: 10px; font-size: 14.5px; }

    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar input[type=text], .toolbar select { max-width: 100%; }
    .toolbar-date-group { width: 100%; }
    .toolbar-date-group input[type=date] { flex: 1; min-width: 0; }
    .toolbar .spacer { display: none; }

    /* ---- Tabel jadi kartu bertumpuk (tidak ada scroll horizontal lagi) ---- */
    .table-wrapper { overflow-x: visible; }
    table.table-wide { min-width: 0; }
    table.table-responsive-cards { border: none; }
    table.table-responsive-cards thead { display: none; }
    table.table-responsive-cards, table.table-responsive-cards tbody, table.table-responsive-cards tr, table.table-responsive-cards td {
        display: block;
        width: 100%;
    }
    table.table-responsive-cards tr {
        background: var(--putih);
        border: 1px solid var(--abu-200);
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 6px 14px;
        box-shadow: var(--shadow);
    }
    table.table-responsive-cards tr:hover { background: var(--putih); }
    table.table-responsive-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 9px 0;
        border-bottom: 1px solid var(--abu-200);
        text-align: right;
    }
    table.table-responsive-cards td:last-child { border-bottom: none; }
    table.table-responsive-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--abu-600);
        font-size: 12px;
        text-align: left;
        flex-shrink: 0;
        margin-right: 10px;
    }
    table.table-responsive-cards td.actions-cell { justify-content: flex-end; }
    table.table-responsive-cards td.actions-cell::before { display: none; }
    table.table-responsive-cards td.no-label { justify-content: flex-start; }
    table.table-responsive-cards td.no-label::before { display: none; }

    /* Form desktop 2 kolom -> full width di HP, panel info dipindah ke bawah form */
    .form-layout { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 110px; }
    .form-side { order: 2; width: 100%; }
    .form-main { order: 1; width: 100%; }

    /* Tombol Simpan/Batal jadi sticky di bawah layar, mudah dijangkau jempol */
    .form-actions-desktop { display: none; }
    .sticky-actions {
        display: flex;
        gap: 10px;
        position: fixed;
        left: 0; right: 0; bottom: var(--bottomnav-h);
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
        background: var(--putih);
        border-top: 1px solid var(--abu-200);
        z-index: 940;
        box-shadow: 0 -2px 10px rgba(21,101,192,0.08);
    }
    .sticky-actions .btn { flex: 1; }
}