/* Halaman Anggota: tampilan pengurus lama (tab, kartu, modal) dengan data dan fitur terbaru. */
:root {
  --hc-border: #e2e8f0; --hc-green: #15a256; --hc-red: #d30e14;
  --c-siswa: #1a4787; --c-guru: #0f8a94; --c-alumni: #F97316; --c-non32: #475569;
  --c-sembunyikan: #64748b; --c-nonaktif: #b91c1c;
  --role-pembina: #2e2e2e; --role-pelatih: #2e5eab;
  --role-ketua: #0f8a94; --role-wakil: #1a4787; --role-divisi: #d30e14;
}
main { padding: 30px; margin-left: 260px; min-height: 60vh; padding-bottom: 100px; color: #334155; }
@media (max-width: 900px) { main { margin-left: 0; padding: 20px 16px 100px; } }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hc-toska); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: not-allowed; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--hc-dark); margin: 0; }
.page-subtitle { font-size: 14px; color: #64748b; margin: 4px 0 0; }
.page-note { font-size: 12px; color: #64748b; margin: 0 0 12px; }
.page-feedback { font-size: 13px; color: #475569; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }
.page-feedback:empty { display: none; }
.page-count { font-size: 12px; color: #94a3b8; margin: 12px 0 8px; }

/* TABS */
.tabs-container { display: flex; gap: 10px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.tabs-container::-webkit-scrollbar { display: none; }
.tab-btn { padding: 10px 20px; border: 1px solid var(--hc-border); border-radius: 999px; background: white; color: #64748b; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: .2s; }
.tab-btn:hover { background: #f1f5f9; }
.tab-btn.active#tab-siswa-aktif { background: var(--c-siswa); border-color: var(--c-siswa); color: white; }
.tab-btn.active#tab-alumni { background: var(--c-alumni); border-color: var(--c-alumni); color: white; }
.tab-btn.active#tab-guru { background: var(--c-guru); border-color: var(--c-guru); color: white; }
.tab-btn.active#tab-non-32 { background: var(--c-non32); border-color: var(--c-non32); color: white; }
.tab-btn.active#tab-sembunyikan { background: var(--c-sembunyikan); border-color: var(--c-sembunyikan); color: white; }
.tab-btn.active#tab-nonaktif { background: var(--c-nonaktif); border-color: var(--c-nonaktif); color: white; }

/* FILTER & ALAT */
.tool-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: white; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--hc-border); box-shadow: 0 2px 4px rgba(0,0,0,.02); }
.filter-input { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-family: inherit; background: #f8fafc; color: #334155; outline: none; transition: .2s; box-sizing: border-box; }
.filter-input:focus { border-color: var(--hc-blue); background: white; box-shadow: 0 0 0 3px rgba(26,71,135,.1); }
#am-search { flex: 1 1 200px; min-width: 180px; }
.btn-tool { padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; background: white; color: #475569; display: inline-flex; align-items: center; gap: 6px; transition: .2s; font-family: inherit; }
.btn-tool:hover { background: #f1f5f9; }
.btn-tool.active { background: var(--hc-blue); color: white; border-color: var(--hc-blue); }

/* KARTU ANGGOTA */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.member-card { background: white; border-radius: 16px; border: 1px solid var(--hc-border); padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 2px 4px rgba(0,0,0,.02); transition: .2s; position: relative; cursor: pointer; }
.member-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,.06); border-color: #cbd5e1; }
.select-indicator { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #cbd5e1; display: none; align-items: center; justify-content: center; background: white; z-index: 5; color: transparent; transition: .2s; }
.select-mode-on .member-card .select-indicator { display: flex; }
.member-card.selected { border-color: var(--hc-blue); box-shadow: 0 0 0 2px var(--hc-blue); }
.member-card.selected .select-indicator { background: var(--hc-blue); border-color: var(--hc-blue); color: white; }
.mc-header { display: flex; gap: 14px; align-items: center; }
.avatar { display: flex; align-items: center; justify-content: center; overflow: hidden; background: #f1f5f9; color: var(--hc-blue); font-weight: 700; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-foto { width: 56px; height: 56px; border-radius: 50%; border: 2px solid #e2e8f0; font-size: 20px; }
.mc-info { flex: 1; overflow: hidden; padding-right: 25px; }
.mc-nama { font-weight: 700; color: var(--hc-dark); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.mc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-body { font-size: 12px; color: #64748b; display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--hc-border); }
.mc-row { display: flex; justify-content: space-between; gap: 8px; }
.mc-row span:last-child { font-weight: 600; color: var(--hc-dark); text-align: right; overflow-wrap: anywhere; }
.mc-mono { font-family: monospace; font-weight: 700 !important; color: var(--hc-toska) !important; }
.pending-warn { margin-top: 2px; background: #fffbeb; color: #b45309; border: 1px solid #fde68a; padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 40px; color: #94a3b8; background: white; border-radius: 16px; }

/* BADGE */
.badge { font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 6px; text-transform: uppercase; }
.badge-tipe.siswa-aktif { background: var(--c-siswa); color: white; }
.badge-tipe.guru { background: var(--c-guru); color: white; }
.badge-tipe.alumni { background: var(--c-alumni); color: white; }
.badge-tipe.non-32 { background: var(--c-non32); color: white; }
.badge-tipe.sembunyikan { background: var(--c-sembunyikan); color: white; }
.badge-tipe.nonaktif { background: var(--c-nonaktif); color: white; }
.badge-jabatan { background: white; border: 1px solid currentColor; }
.role-pembina { color: var(--role-pembina); } .role-pelatih { color: var(--role-pelatih); }
.role-ketua { color: var(--role-ketua); } .role-wakil { color: var(--role-wakil); } .role-divisi { color: var(--role-divisi); }

/* BAR AKSI MASSAL */
.bulk-bar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: white; padding: 10px 16px; border-radius: 100px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 4000; display: flex; align-items: center; gap: 10px; border: 1px solid var(--hc-border); flex-wrap: wrap; justify-content: center; width: max-content; max-width: 90%; }
.bulk-bar[hidden] { display: none !important; }
.bulk-count { font-size: 13px; font-weight: 700; color: var(--hc-dark); padding: 0 10px; }
.bulk-sep { width: 1px; height: 20px; background: #e2e8f0; }
.bulk-btn { background: none; border: none; cursor: pointer; font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; transition: .2s; padding: 8px 12px; border-radius: 8px; }
.bulk-btn:hover { background: #f8fafc; }
.bulk-sync { color: var(--hc-toska); } .bulk-type { color: var(--hc-blue); } .bulk-promote { color: var(--hc-green); }
.bulk-hide { color: #64748b; } .bulk-deactivate { color: var(--hc-red); } .bulk-recover { color: var(--hc-green); }
.bulk-close { background: #f1f5f9; border-radius: 50%; width: 30px; height: 30px; justify-content: center; padding: 0; }

/* MODAL (elemen dialog) */
dialog.modal-box { border: 0; padding: 0; background: white; border-radius: 24px; width: min(600px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,.2); box-sizing: border-box; color: #334155; }
dialog.modal-box::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
dialog.modal-box[open] { animation: modalPop .3s ease; }
dialog.modal-small { width: min(420px, calc(100vw - 32px)); }
@keyframes modalPop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-pad { padding: 24px; }
.modal-title { margin: 0 0 12px; font-size: 18px; color: var(--hc-dark); }
.md-header { background: linear-gradient(135deg, var(--hc-blue), var(--hc-toska)); padding: 35px 24px 25px; color: white; text-align: center; position: relative; }
.md-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.2); border: none; color: white; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .2s; font-size: 16px; }
.md-close:hover { background: rgba(255,255,255,.4); transform: scale(1.1); }
.md-foto { width: 90px; height: 90px; border-radius: 50%; border: 4px solid white; margin: 0 auto 12px; font-size: 34px; background: #fff; }
.md-nama { font-size: 22px; font-weight: 800; margin: 0 0 10px; overflow-wrap: anywhere; }
.md-badges-container { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.md-badges-container .badge { font-size: 12px; padding: 6px 14px; }
.md-body { padding: 24px; background: #f8fafc; }
.md-section-title { font-size: 12px; font-weight: 800; color: #94a3b8; text-transform: uppercase; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.md-item { background: white; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--hc-border); }
.md-wide { grid-column: 1 / -1; }
.md-label { font-size: 11px; color: #64748b; margin-bottom: 4px; }
.md-val { font-size: 14px; font-weight: 600; color: var(--hc-dark); overflow-wrap: anywhere; }
.md-mono { font-family: monospace; color: var(--hc-toska); }
.md-ttd-box { margin-top: 6px; background: white; border-radius: 8px; padding: 8px; border: 1px solid #e2e8f0; text-align: center; }
#am-ttd { max-height: 80px; max-width: 200px; object-fit: contain; }
#am-ttd-empty { color: #94a3b8; font-size: 13px; }
.md-future-panel { background: white; border: 1px dashed #cbd5e1; border-radius: 16px; padding: 16px; margin-bottom: 24px; }
.md-future-note { font-size: 11px; color: #64748b; text-align: center; }
.future-stats { display: flex; gap: 12px; margin-top: 12px; }
.f-stat-box { flex: 1; background: #f1f5f9; padding: 12px; border-radius: 10px; text-align: center; border: 1px solid var(--hc-border); }
.f-stat-val { font-size: 20px; font-weight: 800; color: var(--hc-blue); }
.f-stat-label { font-size: 11px; color: #64748b; }
.md-warn { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 15px; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-start; }
.md-warn i { color: #d97706; font-size: 20px; }
.md-warn h4 { margin: 0 0 4px; color: #b45309; font-size: 13px; font-weight: 800; }
.md-warn p { margin: 0 0 10px; font-size: 12px; color: #92400e; line-height: 1.4; }
.md-warn a { background: #d97706; color: white; padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.md-edit { background: white; border: 1px solid var(--hc-border); border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.md-edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, #am-new-type-label, #am-year-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #475569; }
.form-grid input, .form-grid select { width: 100%; padding: 10px; font: inherit; font-size: 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; color: #334155; box-sizing: border-box; }
.full { grid-column: 1/-1; }
.md-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-md { padding: 12px; border: none; border-radius: 10px; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: .2s; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; text-align: center; }
.btn-md:hover { transform: translateY(-2px); }
.btn-perbaikan { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.btn-struktur { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.btn-sync { background: var(--hc-toska); color: white; border: 1px solid var(--hc-toska); }
.btn-outline { background: white; color: #475569; border: 1px solid #cbd5e1; }
.btn-danger { background: #fee2e2; color: var(--hc-red); border: 1px solid #fecaca; }
.btn-recover { background: var(--hc-green); color: white; border: 1px solid var(--hc-green); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.dialog-actions .btn-md { flex: 1; }
.chosen-list { margin: 14px 0; padding: 12px; background: #f8fafc; border-radius: 8px; max-height: 220px; overflow: auto; font-size: 13px; }
.chosen-list p { margin: 7px 0; overflow-wrap: anywhere; }
#am-bulk-message { font-size: 13px; color: #64748b; margin: 0; line-height: 1.6; }

@media (max-width: 600px) { .md-actions, .md-grid, .form-grid { grid-template-columns: 1fr; } .modal-pad, .md-body { padding: 16px; } .bulk-bar { border-radius: 20px; bottom: 12px; } }

.btn-md:disabled, .btn-md.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: auto; }
.btn-md:disabled:hover, .btn-md.is-disabled:hover { transform: none; }
.btn-md.is-disabled { pointer-events: none; }

/* Pratinjau privat tetap berada di kartu detail anggota. */
#am-d-sign { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.am-signature-preview { display: block; width: 100%; max-width: 440px; max-height: 240px; object-fit: contain; background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; box-sizing: border-box; }
.am-signature-button { white-space: normal; text-align: left; }
