/* ============================================================
   20. DIALOG SERAGAM, FOKUS TERLIHAT, TARGET SENTUH, PWA (1.12.1)
   ============================================================ */
.dlg-overlay { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(3px); animation: dlg-masuk 0.15s ease-out; }
.dlg-box { background: #fff; color: #0f172a; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 18px; padding: 22px 22px 18px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35); box-sizing: border-box; }
.dlg-box h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.3; border: none; padding: 0; }
.dlg-pesan { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #334155; white-space: pre-line; overflow-wrap: anywhere; }
.dlg-medan { width: 100%; box-sizing: border-box; padding: 11px 12px; font: inherit; font-size: 14px; border: 1.5px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f172a; resize: vertical; margin: 0; }
.dlg-medan:focus { outline: 2px solid var(--primary, #2563eb); outline-offset: 1px; border-color: transparent; }
.dlg-galat { min-height: 18px; margin: 6px 0 4px; font-size: 12px; font-weight: 600; color: #b91c1c; }
.dlg-aksi { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dlg-btn { min-height: 44px; padding: 10px 18px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border: 1.5px solid transparent; }
.dlg-batal { background: #fff; color: #334155; border-color: #cbd5e1; }
.dlg-ya { background: var(--primary, #2563eb); color: #fff; }
.dlg-bahaya .dlg-ya { background: #dc2626; }
.dlg-btn:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
@keyframes dlg-masuk { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .dlg-aksi { flex-direction: column-reverse; } .dlg-btn { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .dlg-overlay { animation: none; } }
body.dark-mode .dlg-box { background: #1e293b; color: #f1f5f9; }
body.dark-mode .dlg-pesan { color: #cbd5e1; }
body.dark-mode .dlg-medan { background: #0f172a; color: #f1f5f9; border-color: #475569; }
body.dark-mode .dlg-batal { background: transparent; color: #e2e8f0; border-color: #475569; }
body.dark-mode .dlg-galat { color: #fca5a5; }

/* Fokus keyboard yang terlihat di semua kontrol (tidak mengganggu klik mouse) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--primary, #2563eb); outline-offset: 2px;
}

/* Target sentuh minimal 44 px pada layar sentuh (tombol ikon dan tombol kecil di kartu) */
@media (pointer: coarse) {
    .btn-more, .btn-close { min-width: 44px; min-height: 44px; }
    .dropdown-menu button { min-height: 44px; }
    .btn-saas, .wa-link-btn { min-height: 40px; }
}

/* Tombol pasang aplikasi (PWA) dan banner versi baru */
.btn-pasang-app { width: auto !important; margin: 0 !important; padding: 6px 12px !important; font-size: 12px !important; border-radius: 10px !important; }
.btn-pasang-app.hidden { display: none !important; }
.pwa-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9980; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; max-width: 520px; margin: 0 auto; padding: 12px 14px; border-radius: 14px; background: #0f172a; color: #fff; font-size: 13px; line-height: 1.4; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35); }
.pwa-banner button { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.pwa-banner .pwa-ya { background: #fff; color: #0f172a; }
.pwa-banner .pwa-nanti { background: transparent; color: #cbd5e1; border: 1px solid #475569; }

/* Menu ⋮ yang terbuka harus tampil di atas kartu di bawahnya (kartu beranimasi membuat lapisan tumpukan sendiri) */
.item-card-saas:has(.dropdown-menu.show),
.jd-session:has(.dropdown-menu.show) { position: relative; z-index: 40; }

/* Kartu jadwal siswa di HP: badge mode (Online/Offline) tidak terpotong, tombol aksi rapi dan mudah ditekan */
.info-saas p.card-subtitle-saas { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.6; }
.card-subtitle-saas .jd-mode { white-space: nowrap; margin-left: 4px; }
@media (max-width: 520px) {
    .card-body-saas { flex-wrap: wrap; gap: 8px; }
    .card-body-saas .btn-saas, .card-body-saas .btn-saas-link { flex: 1 1 calc(50% - 8px); min-height: 44px; justify-content: center; text-align: center; box-sizing: border-box; }
    .card-body-saas .btn-saas-link:first-of-type:nth-last-of-type(1) { flex-basis: 100%; }
}

/* 1.13.0: catatan tutor di absensi */
.abs-catatan-btn { margin-top: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; background: transparent; color: var(--primary, #2563eb); cursor: pointer; font-family: inherit; width: auto; }
.abs-catatan-isi { font-style: italic; margin-top: 4px; }
