:root {
    --sidebar-width: 240px;
    --bg-body: #f8fafc;
    --bg-soft: #f0f9ff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --ocean-primary: #0284c7;
    --ocean-dark: #0369a1;
    --orange-primary: #f97316;
    --emerald-primary: #10b981;
    --purple-primary: #8b5cf6;
    --text-dark: #0f172a;
    --text-muted: #64748b;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

body { 
    background: var(--bg-body); 
    color: var(--text-dark); 
    display: flex; 
    min-height: 100vh; 
    overflow-x: hidden; 
    font-size: 0.9rem; 
}

/* SIDEBAR COMPACT LIGHT ELEGANT */
.sidebar {
    width: var(--sidebar-width); 
    background: #ffffff;
    border-right: 1px solid var(--card-border);
    position: fixed; 
    height: 100vh; 
    padding: 16px 12px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    z-index: 100;
    box-shadow: 2px 0 15px rgba(0,0,0,0.02);
}

.brand {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 0 8px 14px;
    font-size: 1.15rem; 
    font-weight: 800; 
    color: var(--text-dark); 
    border-bottom: 1px solid var(--card-border);
}

.brand span { color: var(--ocean-primary); }

.sidebar-menu { 
    list-style: none; 
    margin-top: 12px; 
    overflow-y: auto; 
    max-height: calc(100vh - 140px); 
}

.sidebar-menu li { margin-bottom: 3px; }

.sidebar-menu a {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 9px 12px; 
    color: var(--text-muted);
    text-decoration: none; 
    font-weight: 600; 
    border-radius: 10px; 
    transition: all 0.2s ease; 
    font-size: 0.85rem;
}

.sidebar-menu a i { font-size: 0.9rem; color: var(--ocean-primary); }

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    background: var(--bg-soft); 
    color: var(--ocean-primary);
}

.btn-logout {
    background: #fef2f2; 
    color: #ef4444; 
    padding: 10px; 
    border-radius: 10px; 
    border: 1px solid #fecaca;
    text-decoration: none; 
    text-align: center; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    transition: 0.2s; 
    font-size: 0.85rem;
}

.btn-logout:hover { background: #ef4444; color: white; }

/* MAIN WRAPPER & HEADER */
.main-wrapper { 
    margin-left: var(--sidebar-width); 
    flex: 1; 
    padding: 20px 24px; 
    min-width: 0; 
}

.top-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
    background: #ffffff; 
    border: 1px solid var(--card-border);
    padding: 12px 20px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.header-title h2 { font-size: 1.15rem; font-weight: 800; color: var(--text-dark); }
.header-title p { font-size: 0.78rem; color: var(--text-muted); }
.user-profile { display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    background: var(--ocean-primary);
    color: white; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 800; 
    font-size: 0.95rem;
}

/* WIDGET STATISTIK PADAT */
.widget-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    gap: 12px; 
    margin-bottom: 20px; 
}

.widget-card {
    background: #ffffff; 
    border: 1px solid var(--card-border);
    padding: 14px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    transition: 0.2s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.widget-card:hover { 
    transform: translateY(-3px); 
    border-color: var(--ocean-primary); 
}

.widget-icon {
    width: 40px; 
    height: 40px; 
    border-radius: 10px; 
    display: flex;
    align-items: center; 
    justify-content: center; 
    font-size: 1.1rem; 
    color: white; 
    flex-shrink: 0;
}

.w-1 .widget-icon { background: var(--ocean-primary); }
.w-2 .widget-icon { background: var(--emerald-primary); }
.w-3 .widget-icon { background: var(--purple-primary); }
.w-4 .widget-icon { background: var(--orange-primary); }
.w-5 .widget-icon { background: #ef4444; }

.widget-info h4 { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.widget-info h2 { font-size: 1.3rem; font-weight: 800; color: var(--text-dark); margin-top: 2px; }

/* STATISTIK PROGRAM KERJA */
.program-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.prog-stat-card {
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.prog-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.prog-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* TABLE & CONTENT CARDS */
.content-card {
    background: #ffffff; 
    border: 1px solid var(--card-border);
    padding: 20px; 
    border-radius: 14px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.02); 
    margin-bottom: 20px;
}

.content-card h3 {
    font-size: 1rem; 
    font-weight: 700; 
    color: var(--text-dark); 
    margin-bottom: 14px; 
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 10px; 
    flex-wrap: wrap;
}

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.search-box { 
    position: relative; 
    width: 240px; 
    display: flex;
    align-items: center;
}
.search-box input {
    width: 100%; 
    padding: 8px 12px 8px 36px !important; 
    border-radius: 8px; 
    border: 1px solid var(--card-border);
    background: #f8fafc; 
    color: var(--text-dark); 
    font-size: 0.82rem; 
    outline: none;
}
.search-box i { 
    position: absolute; 
    left: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    pointer-events: none;
    z-index: 2;
}

table { width: 100%; border-collapse: collapse; margin-top: 5px; font-size: 0.85rem; }
table th { padding: 9px 12px; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; text-align: left; background: #f8fafc; border-bottom: 1px solid var(--card-border); }
table td { padding: 10px 12px; color: var(--text-dark); border-bottom: 1px solid var(--card-border); vertical-align: middle; }

.img-thumb { width: 45px; height: 35px; object-fit: cover; border-radius: 6px; border: 1px solid var(--card-border); }
.badge { padding: 3px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

.btn-gradient {
    background: var(--ocean-primary); 
    color: white; 
    border: none; 
    padding: 7px 16px;
    border-radius: 8px; 
    font-weight: 700; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px;
    transition: 0.2s; 
    font-size: 0.82rem; 
    text-decoration: none;
}
.btn-gradient:hover { background: var(--ocean-dark); }

.btn-edit { background: var(--bg-soft); color: var(--ocean-primary); border: 1px solid rgba(2, 132, 199, 0.2); padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-delete { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; text-decoration: none; }

/* FORMS */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.82rem; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
    width: 100%; 
    padding: 8px 12px; 
    border: 1px solid var(--card-border); 
    border-radius: 8px;
    background: #ffffff; 
    color: var(--text-dark); 
    font-size: 0.85rem; 
    outline: none; 
    transition: 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ocean-primary); box-shadow: 0 0 10px rgba(2, 132, 199, 0.15); }

/* FILE UPLOAD BOX */
.file-upload-box {
    border: 2px dashed #cbd5e1; 
    border-radius: 10px; 
    padding: 15px;
    text-align: center; 
    background: #f8fafc; 
    cursor: pointer; 
    position: relative;
}
.file-upload-box input[type="file"] { position: absolute; width: 100%; height: 100%; top:0; left:0; opacity:0; cursor:pointer; }
.file-upload-box i { font-size: 1.8rem; color: var(--ocean-primary); margin-bottom: 4px; }
.file-upload-box p { font-size: 0.78rem; color: var(--text-muted); }
.preview-container img { max-height: 80px; border-radius: 6px; margin-top: 8px; border: 1px solid var(--card-border); }

/* FRAME FOTO KETUA (SUDUT MELENGKUNG) */
.img-ketua-frame {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--card-border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* MODAL POPUP */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(4px);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000;
    opacity: 0; 
    pointer-events: none; 
    transition: 0.3s ease; 
    padding: 15px;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
    background: #ffffff; 
    border-radius: 16px; 
    width: 100%; 
    max-width: 600px;
    padding: 22px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.15); 
    max-height: 85vh; 
    overflow-y: auto;
}

.modal-card.modal-large {
    max-width: 95vw !important;
    width: 95vw !important;
    max-height: 92vh;
}

.modal-extra-large {
    max-width: 950px !important;
    width: 92vw !important;
}

.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    border-bottom: 1px solid var(--card-border); 
    padding-bottom: 8px; 
}
.modal-header h3 { font-size: 1.05rem; color: var(--text-dark); font-weight: 700; }
.modal-close { background: none; border: none; color: #ef4444; font-size: 1.2rem; cursor: pointer; }

/* TOGGLE BUTTON DUAL MODE EDITOR */
.editor-toggle-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.editor-toggle-btn:hover { 
    opacity: 0.9;
    transform: translateY(-1px);
}

/* === CKEDITOR JUSTIFY & ALIGNMENT STYLING === */
.ck-editor__editable_inline { 
    min-height: 240px; 
    line-height: 1.7;
    font-size: 0.92rem;
}

/* Style Perataan Teks (Justify, Left, Center, Right) di CKEditor & Output Frontend */
.ck-content p[style*="text-align: justify"],
.ck-content [style*="text-align: justify"],
.post-article p[style*="text-align: justify"],
.content-section p[style*="text-align: justify"],
[style*="text-align: justify"],
.text-justify {
    text-align: justify !important;
    text-justify: inter-word;
}

.ck-content p[style*="text-align: center"],
.ck-content [style*="text-align: center"],
[style*="text-align: center"],
.text-center {
    text-align: center !important;
}

.ck-content p[style*="text-align: right"],
.ck-content [style*="text-align: right"],
[style*="text-align: right"],
.text-right {
    text-align: right !important;
}

.ck-content p[style*="text-align: left"],
.ck-content [style*="text-align: left"],
[style*="text-align: left"],
.text-left {
    text-align: left !important;
}

/* Responsif untuk Layar Handphone */
@media screen and (max-width: 768px) {
  .p2uwm-welcome-wrapper table, 
  .p2uwm-welcome-wrapper tbody, 
  .p2uwm-welcome-wrapper tr, 
  .p2uwm-welcome-wrapper td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .p2uwm-welcome-wrapper td {
    margin-bottom: 15px !important;
  }
}

/* ==========================================================================
   MODAL, TOAST, PAGER & EXTRA COMPONENTS (MODERN DASHBOARD)
   ========================================================================== */

/* Toast Notification Styling */
.custom-toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 100;
}

@keyframes toastSlideDown {
    0% { opacity: 0; transform: translateY(-20px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-toast-success {
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(209, 250, 229, 0.9));
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #065f46;
}

.custom-toast-danger {
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(254, 226, 226, 0.9));
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #991b1b;
}

.toast-badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.custom-toast-success .toast-badge-icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.custom-toast-danger .toast-badge-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.toast-text-body { flex-grow: 1; }
.toast-text-title { font-size: 0.92rem; font-weight: 800; margin-bottom: 2px; letter-spacing: -0.2px; }
.toast-text-desc { font-size: 0.85rem; font-weight: 600; opacity: 0.9; }

.toast-btn-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: currentColor;
    opacity: 0.5;
    transition: all 0.2s ease;
    padding: 4px;
}
.toast-btn-close:hover { opacity: 1; transform: scale(1.15); }

.toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    animation: toastProgress 5s linear forwards;
}
.custom-toast-success .toast-progress-bar { background: linear-gradient(90deg, #34d399, #059669); }
.custom-toast-danger .toast-progress-bar { background: linear-gradient(90deg, #f87171, #dc2626); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Modal Global */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-card {
    background: #ffffff; width: 90%; max-width: 500px;
    border-radius: 20px; padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px); transition: all 0.3s ease;
    max-height: 90vh; overflow-y: auto;
}
.modal-card.modal-large { max-width: 750px; }
.modal-overlay.active .modal-card { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header h3 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b; }

/* Modal Hapus Custom */
.delete-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.delete-modal-overlay.active { opacity: 1; visibility: visible; }
.delete-modal-card {
    background: #ffffff; width: 90%; max-width: 420px; padding: 30px 24px;
    border-radius: 24px; text-align: center;
    box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.25);
    transform: scale(0.85) translateY(20px); transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.delete-modal-overlay.active .delete-modal-card { transform: scale(1) translateY(0); }
.delete-icon-pulse-wrapper { position: relative; width: 80px; height: 80px; margin: 0 auto 20px auto; display: flex; align-items: center; justify-content: center; }
.delete-icon-pulse-wrapper .pulse-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; background: rgba(239, 68, 68, 0.18); animation: pulseGlow 1.8s ease-out infinite; }
@keyframes pulseGlow { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.delete-icon-box { width: 70px; height: 70px; border-radius: 50%; background: linear-gradient(135deg, #ef4444, #b91c1c); color: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 2rem; box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4); position: relative; z-index: 2; }
.delete-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-cancel-delete { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid #cbd5e1; background: #f8fafc; color: #475569; font-weight: 700; cursor: pointer; }
.btn-confirm-delete { flex: 1; padding: 12px; border-radius: 12px; border: none; background: linear-gradient(135deg, #ef4444, #dc2626); color: #ffffff; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Periode Pair & Editor Styling */
.periode-pair-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 15px; }
.periode-pair-card { background: #ffffff; border-radius: 16px; border: 1px solid #e2e8f0; padding: 18px; }
.periode-header-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed #f1f5f9; padding-bottom: 10px; margin-bottom: 14px; }
.periode-year-badge { background: linear-gradient(135deg, #0284c7, #0369a1); color: white; font-size: 0.85rem; font-weight: 800; padding: 4px 12px; border-radius: 20px; }
.pair-members-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member-mini-card { background: #f8fafc; border-radius: 12px; padding: 10px; text-align: center; border: 1px solid #f1f5f9; }
.member-mini-thumb { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; margin: 0 auto 6px auto; border: 2px solid #38bdf8; }

/* Pagination Controls */
.pagination-container { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 18px; }
.page-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid #cbd5e1; background: #ffffff; color: #475569; font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.page-btn.active { background: #0284c7; color: #ffffff; border-color: #0284c7; }

/* Dual Editor Component */
.editor-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.editor-toggle-btn { background: #f1f5f9; border: 1px solid #cbd5e1; color: #0284c7; font-size: 0.76rem; font-weight: 700; padding: 5px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.html-code-textarea { width: 100%; min-height: 180px; font-family: 'Courier New', Courier, monospace; font-size: 0.85rem; background: #0f172a; color: #38bdf8; border: 1px solid #334155; border-radius: 8px; padding: 12px; box-sizing: border-box; line-height: 1.5; resize: vertical; display: block; }
.ck-editor__editable_inline { min-height: 180px; border-bottom-left-radius: 8px !important; border-bottom-right-radius: 8px !important; }

/* Program Stats Card Grid */
.program-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.prog-stat-card { background: #ffffff; padding: 16px; border-radius: 16px; border: 1px solid #e2e8f0; display: flex; align-items: center; gap: 12px; }
.prog-stat-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }