/**
 * style.css — Formulir Skrining Batuk RW 010
 * Mobile-first. Prefix .skb- agar tidak konflik dengan GeneratePress/GenerateBlocks.
 * ============================================================================
 */

/* ── Reset / Base ──────────────────────────────────────────────────────────── */
.skb-wrapper *,
.skb-admin-wrap * {
    box-sizing: border-box;
}

/* ── Wrapper Utama (Frontend) ─────────────────────────────────────────────── */
.skb-wrapper {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 12px 32px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #1a1a2e;
}

/* ── Header Form ──────────────────────────────────────────────────────────── */
.skb-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #f0f6ff;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #005ea2;
}

.skb-logo {
    max-height: 80px;
    width: auto;
    flex-shrink: 0;
}

.skb-title {
    margin: 0 0 4px;
    font-size: 1.4rem;
    color: #003a70;
    font-weight: 700;
}

.skb-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
}

/* ── Alert / Notifikasi ───────────────────────────────────────────────────── */
.skb-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.skb-alert-success {
    background: #e6f7ee;
    border: 1px solid #2da55c;
    color: #155724;
}

.skb-alert-error {
    background: #fff3f3;
    border: 1px solid #d9534f;
    color: #721c24;
}

.skb-alert-error ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.skb-alert-error li {
    margin-bottom: 4px;
}

/* ── Section ──────────────────────────────────────────────────────────────── */
.skb-section {
    background: #fff;
    border: 1px solid #dce3ef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 58, 112, 0.06);
}

.skb-section-title {
    margin: 0 0 16px;
    font-size: 1.05rem;
    color: #003a70;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e8f5;
}

.skb-note {
    font-size: 0.85rem;
    color: #666;
    margin: -8px 0 14px;
    font-style: italic;
}

/* ── Form Row & Group ─────────────────────────────────────────────────────── */
.skb-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
}

.skb-form-group {
    flex: 1 1 200px;
    min-width: 0;
}

.skb-full-width {
    flex: 1 1 100% !important;
}

.skb-form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.skb-required {
    color: #d9534f;
    font-weight: 700;
}

.skb-form-group input[type="text"],
.skb-form-group input[type="number"],
.skb-form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccd6e6;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fafcff;
    color: #1a1a2e;
    transition: border-color 0.2s;
    outline: none;
}

.skb-form-group input:focus,
.skb-form-group textarea:focus {
    border-color: #005ea2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 94, 162, 0.12);
}

.skb-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Tabel Gejala ─────────────────────────────────────────────────────────── */
.skb-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #dce3ef;
}

.skb-gejala-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.skb-gejala-table thead tr {
    background: #003a70;
    color: #fff;
}

.skb-gejala-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.skb-col-no     { width: 40px; text-align: center !important; }
.skb-col-gejala { min-width: 240px; }
.skb-col-yn     { width: 60px; text-align: center !important; }

.skb-gejala-row {
    border-bottom: 1px solid #e8eef7;
    transition: background 0.15s;
}

.skb-row-odd  { background: #fff; }
.skb-row-even { background: #f5f8fd; }
.skb-gejala-row:hover { background: #eaf2ff; }

.skb-group-header td {
    background: #e0eeff;
    padding: 7px 12px;
    font-size: 0.88rem;
    color: #003a70;
}

.skb-gejala-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.skb-no    { text-align: center; color: #666; font-size: 0.82rem; }
.skb-label { line-height: 1.5; }

.skb-sub-item {
    padding-left: 16px;
    display: block;
    color: #444;
}

/* Radio Ya/Tidak */
.skb-yn-cell {
    text-align: center !important;
    padding: 6px !important;
}

.skb-radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.skb-radio {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #005ea2;
}

/* ── Tombol Submit ────────────────────────────────────────────────────────── */
.skb-submit-wrapper {
    text-align: center;
    margin-top: 8px;
}

.skb-btn {
    display: inline-block;
    padding: 12px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.skb-btn-primary {
    background: #005ea2;
    color: #fff;
    width: 100%;
    max-width: 340px;
}

.skb-btn-primary:hover {
    background: #00437a;
    color: #fff;
}

.skb-btn-primary:active {
    transform: scale(0.98);
}

/* ══════════════════════════════════════════════════════════════════════════
   HALAMAN KONFIRMASI SUKSES (Google Form Style)
   Menggantikan form setelah submit berhasil — tidak ada popup, tidak ada
   CSS konflik dengan tema GeneratePress.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Card utama konfirmasi ─────────────────────────────────────────────────── */
.skb-sukses-card {
    background: #fff;
    border: 1px solid #dce3ef;
    border-radius: 12px;
    padding: 36px 28px 28px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 58, 112, 0.08);
}

/* ── Lingkaran ikon ────────────────────────────────────────────────────────── */
.skb-sukses-icon-wrap {
    margin-bottom: 18px;
}

.skb-sukses-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 2.4rem;
    line-height: 1;
}

.skb-sukses-icon-obs  { background: #e8f5e9; border: 3px solid #27ae60; }
.skb-sukses-icon-rujuk { background: #fdecea; border: 3px solid #c0392b; }

/* ── Judul & deskripsi ─────────────────────────────────────────────────────── */
.skb-sukses-judul {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: #1a1a2e;
    font-weight: 800;
}

.skb-sukses-desc {
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* ── Badge kesimpulan ──────────────────────────────────────────────────────── */
.skb-sukses-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 10px;
    padding: 12px 24px;
    margin-bottom: 20px;
    min-width: 260px;
}

.skb-badge-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.skb-badge-nilai {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.skb-badge-rujuk {
    background: #fdecea;
    border: 2px solid #c0392b;
    color: #c0392b;
}

.skb-badge-obs {
    background: #e8f5e9;
    border: 2px solid #27ae60;
    color: #1a7a40;
}

/* ── Kotak info penjelasan ─────────────────────────────────────────────────── */
.skb-sukses-infobox {
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #333;
}

.skb-infobox-rujuk {
    background: #fff8f0;
    border: 1px solid #f0a500;
}

.skb-infobox-obs {
    background: #f0f8ff;
    border: 1px solid #90bfe0;
}

.skb-infobox-judul {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 0.95rem;
    margin: 0 0 8px;
}

.skb-infobox-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.skb-infobox-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.88rem;
}

.skb-infobox-list li:last-child {
    border-bottom: none;
}

/* ── Kotak kriteria ────────────────────────────────────────────────────────── */
.skb-sukses-kriteria {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 0.85rem;
    color: #555;
}

.skb-kriteria-obs {
    background: #fffbea;
    border-color: #e0c84a;
    color: #5a4a00;
}

.skb-kriteria-judul {
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
    font-size: 0.88rem;
}

.skb-kriteria-list {
    margin: 0;
    padding: 0 0 0 20px;
}

.skb-kriteria-list li {
    padding: 3px 0;
    line-height: 1.55;
}

/* ── Tombol Isi Lagi ───────────────────────────────────────────────────────── */
.skb-sukses-action {
    margin-top: 4px;
}

.skb-btn-isi-lagi {
    display: inline-block;
    background: #fff;
    color: #005ea2;
    border: 2px solid #005ea2;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.skb-btn-isi-lagi:hover {
    background: #005ea2;
    color: #fff;
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .skb-header {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    .skb-logo           { max-height: 64px; }
    .skb-title          { font-size: 1.15rem; }
    .skb-section        { padding: 14px; }
    .skb-form-group     { flex: 1 1 100%; }
    .skb-radio          { width: 24px; height: 24px; }
    .skb-gejala-table   { font-size: 0.82rem; }
    .skb-col-yn         { width: 50px; }

    /* Sukses card mobile */
    .skb-sukses-card    { padding: 24px 16px 20px; }
    .skb-sukses-icon    { width: 64px; height: 64px; font-size: 2rem; }
    .skb-sukses-judul   { font-size: 1.2rem; }
    .skb-sukses-badge   { min-width: 0; width: 100%; }
    .skb-badge-nilai    { font-size: 0.95rem; }
    .skb-sukses-infobox { font-size: 0.84rem; padding: 12px 14px; }
    .skb-infobox-list li { font-size: 0.82rem; }
    .skb-sukses-kriteria { font-size: 0.8rem; }
}

@media (min-width: 576px) and (max-width: 768px) {
    .skb-form-group { flex: 1 1 45%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD STYLES
   ══════════════════════════════════════════════════════════════════════════ */

.skb-admin-wrap {
    padding: 20px 0;
}

.skb-admin-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f0f6ff;
    border-radius: 10px;
    border-left: 5px solid #005ea2;
}

.skb-admin-logo {
    max-height: 80px;
    width: auto;
    flex-shrink: 0;
}

.skb-admin-title {
    margin: 0 0 4px !important;
    color: #003a70 !important;
    font-size: 1.3rem !important;
}

.skb-admin-subtitle {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

/* Statistik Card */
.skb-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.skb-stat-card {
    flex: 1 1 160px;
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    text-align: center;
    border: 1px solid #dce3ef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.skb-stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.skb-stat-label {
    font-size: 0.82rem;
    color: #666;
    font-weight: 500;
}

.skb-stat-total  .skb-stat-number { color: #003a70; }
.skb-stat-rujuk  .skb-stat-number { color: #c0392b; }
.skb-stat-obs    .skb-stat-number { color: #27ae60; }

/* Action Bar */
.skb-action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.skb-btn-reset {
    color: #c0392b !important;
    border-color: #c0392b !important;
}

.skb-btn-reset:hover {
    background: #c0392b !important;
    color: #fff !important;
}

/* Filter Bar */
.skb-filter-bar {
    background: #f8fafc;
    border: 1px solid #dce3ef;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.skb-filter-bar form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.skb-filter-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skb-filter-bar input[type="text"],
.skb-filter-bar input[type="date"],
.skb-filter-bar select {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.88rem;
    min-width: 130px;
}

/* Tabel Admin */
.skb-table-container {
    overflow-x: auto;
}

.skb-admin-table {
    font-size: 0.88rem !important;
}

.skb-admin-table th {
    white-space: nowrap;
}

.skb-th-no, .skb-th-center {
    text-align: center !important;
}

.skb-td-date   { white-space: nowrap; font-size: 0.8rem; }
.skb-td-nik    { font-family: monospace; font-size: 0.82rem; }
.skb-td-alamat { max-width: 200px; font-size: 0.82rem; }

.skb-total-info {
    color: #666;
    font-size: 0.88rem;
    margin-bottom: 10px;
}

.skb-no-data {
    padding: 40px;
    text-align: center;
    color: #999;
    background: #fafafa;
    border: 1px dashed #ccc;
    border-radius: 8px;
}

/* Badge / Gejala Count */
.skb-gejala-count {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.skb-count-warning { background: #fdecea; color: #c0392b; }
.skb-count-ok      { background: #e8f5e9; color: #27ae60; }

/* Select Kesimpulan */
.skb-kesimpulan-form {
    margin: 0;
}

.skb-select-kesimpulan {
    font-size: 0.8rem !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    border: 1px solid #ccc !important;
    font-weight: 600;
}

.skb-badge-rujuk { color: #c0392b !important; border-color: #c0392b !important; background: #fdecea !important; }
.skb-badge-obs   { color: #27ae60 !important; border-color: #27ae60 !important; background: #e8f5e9 !important; }

/* Hapus Button */
.skb-btn-delete {
    color: #c0392b !important;
    border-color: #c0392b !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
}

.skb-btn-delete:hover {
    background: #c0392b !important;
    color: #fff !important;
}

/* Pagination */
.skb-pagination {
    margin-top: 16px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.skb-pagination .button {
    min-width: 36px;
    text-align: center;
    padding: 4px 10px;
}

/* ── JS-generated error states ────────────────────────────────────────────── */
.skb-input-error {
    border-color: #d9534f !important;
    background: #fff8f8 !important;
}

.skb-field-error {
    display: block;
    color: #d9534f;
    font-size: 0.8rem;
    margin-top: 3px;
}

.skb-row-unanswered {
    background: #fff3f3 !important;
    outline: 2px solid #f5c6cb;
}

/* ═══════════════════════════════════════════════════════════════════════════
   POPUP ADMIN — Notifikasi & Konfirmasi
   ══════════════════════════════════════════════════════════════════════════ */

.skb-admin-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
}

.skb-admin-popup-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    animation: skbSlideUp 0.25s ease;
}

.skb-admin-popup-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 12px;
}

.skb-admin-popup-msg {
    font-size: 1rem;
    color: #1a1a2e;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MANAJEMEN PERTANYAAN
   ══════════════════════════════════════════════════════════════════════════ */

/* Form tambah pertanyaan */
.skb-add-pertanyaan-table input[type="text"] {
    max-width: 100%;
}

/* Tabel daftar pertanyaan */
.skb-pertanyaan-table td {
    vertical-align: top;
}

.skb-inline-edit-form {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #dce3ef;
}

.skb-inline-edit-form input[type="text"] {
    padding: 6px 8px;
    border: 1px solid #ccd6e6;
    border-radius: 4px;
    font-size: 0.85rem;
}

.skb-btn-edit-p {
    margin-bottom: 4px;
}

/* ── Responsive: Form Tambah Pertanyaan & Tabel Pertanyaan ── */
@media (max-width: 700px) {
    /* Form-table "Tambah Pertanyaan" → stack label di atas input */
    .skb-add-pertanyaan-table,
    .skb-add-pertanyaan-table tbody,
    .skb-add-pertanyaan-table tr {
        display: block;
        width: 100%;
    }

    .skb-add-pertanyaan-table th,
    .skb-add-pertanyaan-table td {
        display: block;
        width: 100% !important;
        padding: 6px 0 !important;
        box-sizing: border-box;
    }

    .skb-add-pertanyaan-table th {
        padding-bottom: 2px !important;
        font-weight: 700;
    }

    /* Tabel Daftar Pertanyaan */
    .skb-pertanyaan-table {
        min-width: 640px;
    }

    .skb-pertanyaan-table .skb-inline-edit-form label {
        display: block;
        margin: 4px 0;
    }
}

@media (max-width: 576px) {
    .skb-section[style*="max-width:680px"] {
        padding: 14px !important;
    }
}
