﻿/* ================================================================
   wilayah-struktur.css
   Path: public/css/admin/wilayah-struktur.css
   ================================================================ */

/* Spinner untuk tombol submit */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ?? Selector bar ?? */
.wilayah-selector-bar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: .9rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.wilayah-selector-bar label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    white-space: nowrap;
}
.wilayah-selector-bar select { flex: 1; min-width: 180px; max-width: 340px; }

/* ?? Stat cards ?? */
.ws-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-bottom: .75rem;
}
.ws-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: .85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    transition: box-shadow .15s;
}
.ws-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.ws-stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.ws-stat-icon.total  { background: #FFF0F2; color: #C0001D; }
.ws-stat-icon.laki   { background: #dbeafe; color: #2563eb; }
.ws-stat-icon.wanita { background: #fce7f3; color: #db2777; }
.ws-stat-val { font-size: 1.6rem; font-weight: 900; line-height: 1; color: #1a1a2e; }
.ws-stat-val.laki   { color: #2563eb; }
.ws-stat-val.wanita { color: #db2777; }
.ws-stat-label { font-size: .7rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-top: .15rem; }

/* ?? Gender bar ?? */
.ws-gender-bar-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: .65rem 1.1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.ws-gender-bar-wrap .bar-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; white-space: nowrap; }
.ws-gender-bar { flex: 1; min-width: 120px; height: 10px; border-radius: 5px; overflow: hidden; background: #f3f4f6; display: flex; }
.ws-gender-bar .bar-laki      { background: #2563eb; transition: width .6s ease; }
.ws-gender-bar .bar-perempuan { background: #db2777; transition: width .6s ease; }
.ws-gender-bar-legend { display: flex; gap: .85rem; font-size: .72rem; color: #6b7280; white-space: nowrap; }
.ws-gender-bar-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }

/* ================================================================
   ORG CHART ? Struktur Organisasi
   ================================================================ */

.org-chart {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 1rem 0 1.5rem;
    box-sizing: border-box;
}
.org-chart-tree {
    max-width: 100%;
}

/* Label seksi (PEMBINA & PENASEHAT, PIMPINAN UTAMA, dst) */
.org-section-label {
    text-align: center;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
    margin: .35rem 0 .55rem;
}

/* Baris dalam org chart */
.org-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

/* Baris ketua / sekretaris / bendahara utama ? kartu lebih menonjol */
.org-row-leader {
    gap: 1rem;
}

/* Baris wakil ? wrap di dalam lebar kontainer, tanpa scroll samping */
.org-row-deputies {
    gap: .55rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: .35rem .25rem .55rem;
    position: relative;
}
.org-row-deputies::before {
    display: none;
}
.org-row-deputies .org-card {
    width: 132px;
    max-width: calc(50% - .4rem);
    position: relative;
}
.org-row-deputies .org-card::before {
    display: none;
}

/* Saat sedikit item, tetap center */
.org-chart-tree .org-row-deputies {
    justify-content: center;
}

/* Ketua Bidang ? wrap ke beberapa baris, tidak scroll menyamping */
.org-row-bidang {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: .65rem .55rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: .25rem .5rem .5rem;
}
.org-row-bidang .org-card {
    width: 140px;
    max-width: calc(33.333% - .5rem);
    flex: 0 1 auto;
}
.org-row-leader .org-card {
    width: 160px;
    max-width: 100%;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

/* Baris dengan spacing lebih rapat untuk banyak kartu */
.org-row-compact {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Konektor vertikal antar baris */
.org-connector {
    display: flex;
    justify-content: center;
    margin: .15rem 0 .1rem;
}
.org-connector .vline {
    width: 2px;
    height: 28px;
    background: #d1d5db;
    border-radius: 2px;
}

/* Wrapper section dengan padding */
.org-section {
    margin-bottom: .5rem;
}

/* ?? Kartu jabatan ?? */
.org-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .65rem .85rem;
    text-align: center;
    width: 140px;
    max-width: 100%;
    flex-shrink: 1;
    box-sizing: border-box;
    transition: box-shadow .15s, transform .15s;
    border-top: 3px solid #e5e7eb;
}

/* Foto pengurus */
.org-foto {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto .5rem;
    overflow: hidden;
    border: 2px solid #f3f4f6;
}
.org-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.org-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

/* Warna border atas per tier */
.org-card.c-pembina    { border-top-color: #7c3aed; }
.org-card.c-pengawas   { border-top-color: #8b5cf6; }
.org-card.c-ketua      { border-top-color: #C0001D; }
.org-card.c-wakilketua { border-top-color: #8B0012; }
.org-card.c-sekretaris { border-top-color: #2563eb; }
.org-card.c-bendahara  { border-top-color: #16a34a; }
.org-card.c-bidang     { border-top-color: #0ea5e9; }
.org-card.c-okk        { border-top-color: #d97706; }
.org-card.c-bidang     { border-top-color: #0f766e; }
.org-card.c-anggota    { border-top-color: #6b7280; }

/* Ikon */
.org-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto .35rem;
    font-size: .85rem;
}
.c-pembina    .org-icon { background: #ede9fe; color: #7c3aed; }
.c-pengawas   .org-icon { background: #ede9fe; color: #8b5cf6; }
.c-ketua      .org-icon { background: #FFF0F2; color: #C0001D; }
.c-wakilketua .org-icon { background: #FFF0F2; color: #8B0012; }
.c-sekretaris .org-icon { background: #dbeafe; color: #2563eb; }
.c-bendahara  .org-icon { background: #dcfce7; color: #16a34a; }
.c-bidang     .org-icon { background: #e0f2fe; color: #0284c7; }
.c-okk        .org-icon { background: #fef3c7; color: #d97706; }
.c-bidang     .org-icon { background: #ccfbf1; color: #0f766e; }
.c-anggota    .org-icon { background: #f3f4f6; color: #6b7280; }

.org-label {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9ca3af;
    margin-bottom: .2rem;
    line-height: 1.2;
    min-height: 2.1em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.org-nama {
    font-size: .75rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.3;
}
.org-nama.kosong {
    color: #d1d5db;
    font-style: italic;
    font-weight: 400;
    font-size: .72rem;
}

/* Kolom 2 sejajar (sekretaris | bendahara) */
.org-two-col {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: flex-start;
}
.org-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Garis horizontal penghubung 2 kolom */
.org-hline-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: .2rem 0;
    position: relative;
    height: 22px;
}
.org-hline-wrap .hline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 2px;
    background: #d1d5db;
    border-radius: 2px;
    width: 80px;
}
.org-hline-wrap .vline-left,
.org-hline-wrap .vline-right {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #d1d5db;
    border-radius: 2px;
}
.org-hline-wrap .vline-left  { left: calc(50% - 40px); }
.org-hline-wrap .vline-right { right: calc(50% - 40px); }

/* ?? DPC Chips ?? */
.dpc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.dpc-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .35rem .75rem; border-radius: 999px;
    border: 1px solid #e5e7eb; background: #fff;
    font-size: .75rem; font-weight: 500; color: #374151;
    text-decoration: none; transition: all .15s;
}
.dpc-chip:hover, .dpc-chip.active {
    background: #C0001D; color: #fff; border-color: #C0001D; text-decoration: none;
}

/* ?? Soon card ?? */
.soon-card {
    background: #fafafa; border: 2px dashed #e5e7eb;
    border-radius: 12px; padding: 2rem 1rem;
    text-align: center; color: #9ca3af;
}
.soon-card .soon-icon { font-size: 1.5rem; margin-bottom: .35rem; }
.soon-card .soon-text { font-size: .82rem; font-weight: 600; }
.soon-card .soon-sub  { font-size: .72rem; margin-top: .2rem; }

/* ?? Edit pengurus ?? */
.edit-pengurus-table th { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.edit-pengurus-table td { vertical-align: middle; font-size: .83rem; }

/* ?? Responsive ?? */
@media (max-width: 768px) {
    .ws-stat-row { grid-template-columns: 1fr 1fr; }
    .org-card { width: 120px; }
    .org-row-leader .org-card { width: 136px; }
    .org-row-deputies .org-card { width: 118px; }
    .org-row-bidang .org-card { width: 118px; }
    .org-two-col { gap: 1rem; }
}
@media (max-width: 480px) {
    .ws-stat-row { grid-template-columns: 1fr; }
    .wilayah-selector-bar { flex-direction: column; align-items: stretch; }
    .ws-gender-bar-wrap { flex-direction: column; gap: .5rem; }
    .org-row-deputies {
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }
    .org-row-deputies::before,
    .org-row-deputies .org-card::before {
        display: none;
    }
    .org-two-col { flex-direction: column; align-items: center; }
}

/* ================================================================
   SECTION CARD ? DPC list & navigasi
   ================================================================ */
.wil-section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.wil-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    gap: .75rem;
}
.wil-section-header-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.wil-section-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
.wil-section-title {
    font-size: .88rem;
    font-weight: 700;
    color: #1a1a2e;
}
.wil-section-sub {
    font-size: .72rem;
    color: #9ca3af;
    margin-top: .1rem;
}
.wil-section-badge {
    background: #1d4ed8;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .25rem .65rem;
    border-radius: 999px;
    white-space: nowrap;
}
.wil-section-body {
    padding: .85rem 1.1rem;
}

/* ?? DPC Pill Grid ?? */
.dpc-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.dpc-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .75rem .38rem .55rem;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: .76rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all .15s;
    cursor: pointer;
}
.dpc-pill:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59,130,246,.15);
}
.dpc-pill.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
    font-weight: 700;
}
.dpc-pill.active:hover {
    background: #1e40af;
    border-color: #1e40af;
    color: #fff;
    box-shadow: 0 2px 8px rgba(29,78,216,.3);
}
.dpc-pill-icon {
    width: 20px; height: 20px;
    border-radius: 5px;
    background: #eff6ff;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem;
    color: #3b82f6;
    flex-shrink: 0;
    transition: all .15s;
}
.dpc-pill.active .dpc-pill-icon {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.dpc-pill-nama { flex: 1; }
.dpc-pill-arrow {
    font-size: .6rem;
    color: #d1d5db;
    transition: all .15s;
}
.dpc-pill:hover .dpc-pill-arrow { color: #3b82f6; transform: translateX(2px); }
.dpc-pill.active .dpc-pill-arrow { color: rgba(255,255,255,.6); }

/* ================================================================
   SOON CARDS ? PAC & Ranting
   ================================================================ */
.wil-soon-card {
    position: relative;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem 1.25rem 1.25rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.wil-soon-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
.wil-soon-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.wil-soon-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.wil-soon-content { flex: 1; position: relative; }
.wil-soon-label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin-bottom: .2rem;
}
.wil-soon-title {
    font-size: .92rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: .2rem;
}
.wil-soon-desc {
    font-size: .74rem;
    color: #9ca3af;
}
.wil-soon-badge {
    position: relative;
    background: #f3f4f6;
    color: #6b7280;
    font-size: .68rem;
    font-weight: 700;
    padding: .3rem .7rem;
    border-radius: 999px;
    letter-spacing: .04em;
    text-transform: uppercase;
    border: 1.5px dashed #d1d5db;
}

/* ================================================================
   EDIT PENGURUS PAGE
   ================================================================ */

/* ?? Filter Card ?? */
.ep-filter-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.ep-filter-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.1rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    font-size: .82rem;
    font-weight: 700;
    color: #1a1a2e;
}
.ep-filter-body { padding: 1rem 1.1rem; }
.ep-filter-row {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}
.ep-filter-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    min-width: 140px;
}
.ep-filter-group label {
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ep-filter-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 1px;
}
.ep-filter-info {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid #f3f4f6;
    font-size: .76rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.ep-info-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

/* ?? Buttons ?? */
.ep-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .9rem;
    border: none;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    text-decoration: none;
}
.ep-btn-pri {
    background: #C0001D;
    color: #fff;
}
.ep-btn-pri:hover { background: #a93226; color: #fff; }
.ep-btn-sec {
    background: #fff;
    color: #374151;
    border: 1.5px solid #e5e7eb;
}
.ep-btn-sec:hover { border-color: #C0001D; color: #C0001D; text-decoration: none; }
.ep-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .9rem;
    background: #C0001D;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    text-decoration: none;
}
.ep-btn-primary:hover { background: #a93226; color: #fff; }
.ep-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .42rem .9rem;
    background: #fff;
    color: #374151;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    text-decoration: none;
}
.ep-btn-outline:hover { border-color: #C0001D; color: #C0001D; text-decoration: none; }

/* ?? Form Card ?? */
.ep-form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.ep-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
    gap: .75rem;
    flex-wrap: wrap;
}
.ep-form-header-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.ep-form-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #C0001D, #8B0012);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: .95rem;
    flex-shrink: 0;
}
.ep-form-title { font-size: .88rem; font-weight: 700; color: #1a1a2e; }
.ep-form-sub   { font-size: .72rem; color: #9ca3af; margin-top: .1rem; }
.ep-level-badge {
    background: #C0001D;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: .3rem .8rem;
    border-radius: 999px;
    white-space: nowrap;
}
.ep-form-body { padding: 1rem 1.1rem; }
.ep-input-row {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    align-items: flex-start;
}
.ep-input-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    min-width: 120px;
}
.ep-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.ep-input-group label {
    font-size: .72rem;
    font-weight: 600;
    color: #374151;
}

/* ?? Table Card ?? */
.ep-table-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.ep-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid #f3f4f6;
}
.ep-table-title {
    font-size: .9rem;
    font-weight: 700;
    color: #1a1a2e;
}
.ep-count-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .65rem;
    border-radius: 999px;
}

/* ?? Table styles ?? */
.ep-table thead tr {
    background: linear-gradient(135deg, #C0001D 0%, #8B0012 100%);
}
.ep-table thead th {
    background: transparent;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: .75rem 1rem;
    border-bottom: none;
    border-top: none;
    white-space: nowrap;
}
.ep-table tbody td {
    padding: .7rem 1rem;
    font-size: .82rem;
    color: #374151;
    border-color: #f3f4f6;
    vertical-align: middle;
}
.ep-table tbody tr:hover { background: #fffbfb; }
.ep-no { color: #9ca3af; font-size: .78rem; }
.ep-nama { font-weight: 600; color: #1a1a2e; }
.ep-nama-kosong { color: #d1d5db; font-style: italic; font-weight: 400; }
.ep-gelar { font-size: .78rem; color: #6b7280; }
.ep-urutan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 700;
    color: #6b7280;
}
.ep-jabatan-badge {
    display: inline-block;
    padding: .22rem .65rem;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.ep-status-aktif {
    background: #dcfce7; color: #16a34a;
    font-size: .72rem; font-weight: 700;
    padding: .22rem .65rem; border-radius: 20px;
}
.ep-status-nonaktif {
    background: #f3f4f6; color: #6b7280;
    font-size: .72rem; font-weight: 700;
    padding: .22rem .65rem; border-radius: 20px;
}

/* ?? Action buttons ?? */
.ep-btn-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: .82rem;
    transition: all .15s;
}
.ep-btn-icon-edit:hover  { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.ep-btn-icon-del:hover   { border-color: #ef4444; color: #ef4444; background: #fee2e2; }

/* ?? Empty states ?? */
.ep-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}
.ep-empty i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.ep-empty > div:nth-child(2) { font-size: .88rem; font-weight: 600; color: #6b7280; }
.ep-empty-sub { font-size: .78rem; margin-top: .3rem; }

.ep-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #9ca3af;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}
.ep-empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; }
.ep-empty-state > div:nth-child(2) { font-size: .88rem; font-weight: 600; color: #374151; }

/* ?? Modal Overlay ?? */
.ep-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
    padding: 1rem;
}
.ep-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
.ep-modal-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    animation: epModalIn .25s ease;
    display: flex;
    flex-direction: column;
}
.ep-modal-box.closing {
    animation: epModalOut .25s ease forwards;
}
.ep-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    gap: .75rem;
}
.ep-modal-title {
    font-size: .92rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}
.ep-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #9ca3af;
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
    transition: color .15s;
}
.ep-modal-close:hover {
    color: #6b7280;
}
.ep-modal-body {
    padding: 1.1rem;
}
.ep-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .625rem;
    padding: .85rem 1.1rem;
    border-top: 1px solid #e5e7eb;
}
@keyframes epModalIn {
    from {
        transform: scale(.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes epModalOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(.95);
        opacity: 0;
    }
}

/* ?? Responsive ?? */
@media (max-width: 768px) {
    .ep-filter-row { flex-direction: column; }
    .ep-filter-group { min-width: 100%; }
    .ep-input-row { flex-direction: column; }
    .ep-input-group { min-width: 100%; }
}

/* ?? Kader picker ?? */
.kader-search-wrap { position: relative; }
.kader-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    max-height: 240px;
    overflow-y: auto;
}
.kader-search-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .55rem .75rem;
    border: 0;
    background: transparent;
    text-align: left;
}
.kader-search-item:hover { background: #FFF0F2; }
.kader-search-item-foto {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}
.kader-search-item-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.kader-search-item-body strong {
    font-size: .78rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kader-search-item-body small {
    font-size: .68rem;
    color: #9ca3af;
}
.kader-search-empty {
    padding: .75rem;
    font-size: .75rem;
    color: #9ca3af;
    text-align: center;
}
.kader-selected-preview {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .5rem;
    padding: .55rem .65rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fafafa;
}
.kader-preview-foto {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}
.kader-preview-info { flex: 1; min-width: 0; }
.kader-preview-nama {
    font-size: .78rem;
    font-weight: 700;
    color: #1a1a2e;
}
.kader-preview-meta { font-size: .68rem; }
.kader-clear-btn {
    border: 0;
    background: #fee2e2;
    color: #b91c1c;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    line-height: 1;
    font-size: 1rem;
    flex-shrink: 0;
}
.kader-clear-btn:hover { background: #fecaca; }
/* ================================================================
   IPF PENGURUSAN PROVINSI / KABKOTA — bagan 5 kolom (tanpa scroll samping)
   ================================================================ */
.ipf-pv-chart {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: .75rem 0 1.25rem;
    box-sizing: border-box;
}
.ipf-pv-title {
    text-align: center;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #1a1a2e;
    margin-bottom: .9rem;
    padding: 0 .5rem;
    line-height: 1.35;
}
.ipf-pv-top {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    padding: 0 .5rem;
}
.ipf-pv-top .ipf-pv-card {
    width: min(160px, 42vw);
    border-color: #15803d;
    box-shadow: 0 4px 14px rgba(21, 128, 61, .12);
}
.ipf-pv-top .ipf-pv-jabatan {
    background: #15803d;
    color: #fff;
}
.ipf-pv-connector {
    position: relative;
    height: 28px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}
.ipf-pv-vline-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 14px;
    background: #9ca3af;
}
.ipf-pv-hline {
    position: absolute;
    top: 14px;
    left: 6%;
    right: 6%;
    height: 2px;
    background: #9ca3af;
}
.ipf-pv-cols {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .4rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 .35rem;
    position: relative;
    box-sizing: border-box;
}
.ipf-pv-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    position: relative;
    min-width: 0;
}
.ipf-pv-col::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 14px;
    background: #9ca3af;
}
.ipf-pv-card {
    width: 100%;
    max-width: 100%;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    box-sizing: border-box;
}
.ipf-pv-jabatan {
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    padding: .3rem .25rem;
    font-size: clamp(.52rem, 1.05vw, .62rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #111827;
    line-height: 1.2;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    hyphens: auto;
}
.ipf-pv-foto {
    padding: .3rem .25rem 0;
}
.ipf-pv-foto img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}
.ipf-pv-nama {
    padding: .25rem .25rem .4rem;
    font-size: clamp(.55rem, 1.1vw, .68rem);
    font-weight: 600;
    color: #1f2937;
    line-height: 1.25;
    word-break: break-word;
}
.ipf-pv-nama.kosong {
    color: #9ca3af;
    font-weight: 500;
    font-style: italic;
}
@media (max-width: 1100px) {
    .ipf-pv-cols {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: .3rem;
    }
    .ipf-pv-foto img {
        width: 30px;
        height: 30px;
    }
}
@media (max-width: 900px) {
    .ipf-pv-cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .45rem;
    }
    .ipf-pv-hline { left: 8%; right: 8%; }
    .ipf-pv-col:nth-child(n+4)::before {
        display: none;
    }
}
@media (max-width: 560px) {
    .ipf-pv-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ipf-pv-col::before,
    .ipf-pv-hline,
    .ipf-pv-vline-top {
        display: none;
    }
    .ipf-pv-connector { height: 10px; }
    .ipf-pv-jabatan { font-size: .55rem; min-height: 1.85rem; }
}
