* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ========================================
   🎨 ENHANCED ANIMATIONS & EFFECTS
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(118, 75, 162, 0.6);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    color: var(--text-dark);
    position: relative;
    overflow-x: hidden;
}

/* Removed heavy background particles for better performance */

.container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: var(--white);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

header h1:hover {
    transform: scale(1.02);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.controls {
    padding: 25px 30px;
    background: var(--light-bg);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
    align-content: flex-start;
}

/* helper to make each filter compact and horizontal */
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    flex: 1 1 auto;
    max-width: 250px;
}

/* Force horizontal layout for filters inside projection header */
.projection-header .filter-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 16px;
}

.projection-header .filter-item {
    flex: 0 1 220px !important;
    min-width: 160px;
}

/* Strong overrides to ensure filters stay horizontal on wide screens */
@media (min-width: 721px) {
    .projection-header .filter-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 16px !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .projection-header .filter-item {
        flex: 0 0 auto !important;
        min-width: 180px !important;
        margin-right: 8px !important;
    }

    .projection-header .filter-item select {
        width: 220px !important;
    }
}

/* When viewport is small, stack filters vertically */
@media (max-width: 720px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-item {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.filter-item label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9em;
}

.filter-item select {
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.98em;
    background: var(--white);
    cursor: pointer;
    transition: all 0.18s ease;
    width: 100%;
}

#projSearch {
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.98em;
    background: var(--white);
    width: 220px;
}

/* Background progress bar for non-blocking load */
.bg-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 30px;
    background: #f6f8fa;
    border-top: 1px solid #e6e9ee;
}

.bg-progress-bar {
    flex: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.bg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 300ms ease;
}

.bg-progress-text {
    min-width: 110px;
    text-align: right;
    font-size: 0.95em;
    color: #4b5563;
}

.filter-item select:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* Search Input Styling */
.filter-item input[type="text"],
.filter-item input[type="search"],
.filter-item input[type="number"],
.filter-item select {
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
    background: white;
    width: 100%;
    position: relative;
}

.filter-item input[type="text"]:focus,
.filter-item input[type="search"]:focus,
.filter-item input[type="number"]:focus,
.filter-item select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Sekolah Dropdown */
.sekolah-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.sekolah-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sekolah-dropdown-item:last-child {
    border-bottom: none;
}

.sekolah-dropdown-item:hover {
    background: #f8f9fa;
}

.sekolah-dropdown-item.active {
    background: #e3f2fd;
}

.sekolah-dropdown-item .sekolah-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.sekolah-dropdown-item .sekolah-info {
    font-size: 0.85em;
    color: #6c757d;
}

.sekolah-dropdown-item .sekolah-npsn {
    font-size: 0.8em;
    color: #95a5a6;
    font-family: monospace;
}

.sekolah-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Search Sekolah Section (Below Chart) */
.search-sekolah-section {
    margin: 30px 0;
    animation: fadeIn 0.5s ease-in;
}

.search-sekolah-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    border: 2px solid #f0f0f0;
}

.search-sekolah-header {
    text-align: center;
    margin-bottom: 25px;
}

.search-sekolah-header h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 700;
}

.search-sekolah-header p {
    color: #7f8c8d;
    font-size: 0.95em;
    margin: 0;
}

.search-sekolah-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-sekolah-input-wrapper input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.05em;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-sekolah-input-wrapper input[type="text"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

.selected-sekolah-info {
    margin-top: 20px;
    text-align: center;
}

.selected-sekolah-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1em;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.clear-sekolah-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.clear-sekolah-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Search PTK Section (Similar to Sekolah Search) */
.search-ptk-section {
    margin: 30px 0;
    animation: fadeIn 0.5s ease-in;
}

.search-ptk-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    border: 2px solid #f0f0f0;
}

.search-ptk-header {
    text-align: center;
    margin-bottom: 25px;
}

.search-ptk-header h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 700;
}

.search-ptk-header p {
    color: #7f8c8d;
    font-size: 0.95em;
    margin: 0;
}

.search-ptk-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-ptk-input-wrapper input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.05em;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-ptk-input-wrapper input[type="text"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

/* PTK Dropdown */
.ptk-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.ptk-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ptk-dropdown-item:last-child {
    border-bottom: none;
}

.ptk-dropdown-item:hover {
    background: #f8f9fa;
}

.ptk-dropdown-item.active {
    background: #e3f2fd;
}

.ptk-dropdown-item .ptk-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.ptk-dropdown-item .ptk-info {
    font-size: 0.85em;
    color: #6c757d;
}

.ptk-dropdown-item .ptk-nik {
    font-size: 0.8em;
    color: #95a5a6;
    font-family: monospace;
}

.ptk-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.selected-ptk-info {
    margin-top: 20px;
    text-align: center;
}

.selected-ptk-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1em;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.clear-ptk-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.clear-ptk-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}


/* Checkbox Filter */
.checkbox-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1.5px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.checkbox-filter-item:hover {
    background: #e9ecef;
    border-color: var(--secondary-color);
}

.checkbox-filter-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.checkbox-filter-item.checked {
    background: #e3f2fd;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    font-weight: 600;
}

/* Search Section */
.search-section {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

#searchInput {
    width: 100%;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#searchStats {
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

/* Chart Section */
.chart-section {
    padding: 30px;
    background: white;
    margin: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.chart-header h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.chart-container {
    position: relative;
    height: 500px;
    margin-top: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.chart-container:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
}

#chartJabatanFilter {
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#chartJabatanFilter:focus {
    border-color: var(--secondary-color);
    outline: none;
}

/* Projection Section */
.projection-section {
    padding: 30px;
    background: white;
    margin: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.projection-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #f093fb;
}

.projection-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.projection-header h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 8px;
}

.projection-subtitle {
    color: #7f8c8d;
    font-size: 0.95em;
    margin-top: 5px;
}

.projection-summary {
    display: grid;
}

.projection-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.projection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.projection-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.projection-card.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.projection-card.info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.projection-card-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.projection-card-value {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.projection-card-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.projection-card-sublabel {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
}

/* Modal styles for PTK list */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-header .btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    padding: 8px 16px;
    font-size: 0.9em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.modal-header .btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-header #modalDownloadCSVHeader {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.modal-header #modalDownloadCSVHeader:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

.modal-header #modalDownloadXLSXHeader {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.modal-header #modalDownloadXLSXHeader:hover {
    background: linear-gradient(135deg, #00d4fe 0%, #00b8d4 100%);
}

.modal-header #modalToggleMode {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.modal-header #modalToggleMode:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

#modalControls {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.modal-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.modal-body-wrapper {
    padding: 24px 32px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    will-change: scroll-position;
}

/* Custom scrollbar untuk wrapper horizontal */
.modal-body-wrapper::-webkit-scrollbar {
    height: 10px;
}

.modal-body-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.modal-body-wrapper::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.modal-body table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    min-width: 800px;
}

/* Custom scrollbar untuk modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63407d 100%);
}

.modal-footer {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to top, #f8f9fa 0%, #ffffff 100%);
    border-top: 2px solid #e9ecef;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.modal-close {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 26px;
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: white;
    font-weight: 700;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Center PTK table inside modal and make it proportional */
.modal-table-content .modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 36px;
}

.modal-table-content .modal-body table {
    width: auto;
    max-width: 1000px;
    border-collapse: collapse;
    margin: 0 auto;
}

.modal-table-content .modal-body th,
.modal-table-content .modal-body td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.modal-table-content .modal-body th:first-child,
.modal-table-content .modal-body td:first-child {
    text-align: center;
}

.modal-table-content .modal-body thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-table-content .modal-body tbody tr {
    transition: all 0.2s ease;
}

.modal-table-content .modal-body table tr:hover td {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: scale(1.01);
}

.modal-table-content .modal-body tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.modal-table-content .modal-body tbody td {
    color: #2c3e50;
    font-weight: 500;
}

/* Banded columns - alternating column colors for better readability */
.modal-table-content .modal-body tbody td:nth-child(even) {
    background: rgba(102, 126, 234, 0.04);
}

.modal-table-content .modal-body tbody tr:nth-child(even) td:nth-child(even) {
    background: rgba(102, 126, 234, 0.08);
}

.modal-table-content .modal-body tbody tr:hover td {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%) !important;
}

/* Make modal footer buttons centered and spaced proportionally */
.modal-footer {
    gap: 12px;
}

.modal-footer>div {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 1024px) {
    .modal-content {
        width: 92%;
        max-width: 950px;
    }

    .detail-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 900px) {
    .modal-content {
        width: 95%;
        max-width: 900px;
    }

    .modal-table-content .modal-body table {
        max-width: 820px;
    }
}

@media (max-width: 600px) {
    .modal-content {
        width: 98%;
        max-width: 520px;
    }

    .modal-table-content .modal-body {
        padding: 12px;
    }

    .modal-table-content .modal-body table {
        font-size: 0.95em;
    }

    .modal-header,
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

/* Sticky header so controls remain visible while scrolling table - only for table modal */
.modal-table-content .modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 4;
    border-bottom: 1px solid #f0f0f0;
}

/* virtual mode header table sticky */
.modal-header-table thead th {
    position: sticky;
    top: 48px;
    background: #fff;
    z-index: 6;
}

/* Column picker styles */
.column-picker {
    position: relative;
}

.column-picker .btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.column-picker .btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.column-list {
    min-width: 220px;
    max-width: 320px;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}

.column-list.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.column-list label {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    color: #2c3e50;
    font-weight: 500;
}

.column-list label:hover {
    background: #f0f2f5;
}

.column-list input {
    transform: scale(1.1);
    cursor: pointer;
}

/* Pagination controls */
.modal-pagination {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.modal-pagination .btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border: none;
    min-width: 36px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-pagination .btn:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.modal-pagination select {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #16a085 0%, #138d75 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-pagination #modalPageInfo {
    color: white;
    font-weight: 600;
    padding: 0 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Fixed table layout and ellipsis for modal tables to keep columns aligned */
.modal-body-wrapper table {
    table-layout: auto;
    width: 100%;
    min-width: 800px;
}

.modal-body-wrapper .pensiunan-table {
    width: 100%;
    min-width: 800px;
}

.modal-body-wrapper th,
.modal-body-wrapper td {
    overflow: visible;
    white-space: nowrap;
    padding: 12px 16px;
}

.modal-body-wrapper th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: #2c3e50 !important;
    font-weight: 600;
}

.modal-body-wrapper table thead {
    background: white;
}

.modal-body-wrapper table thead th {
    color: #2c3e50 !important;
    font-weight: 700;
}

/* Banded columns for modal-body-wrapper tables */
.modal-body-wrapper table tbody td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.03);
}

.modal-body-wrapper table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.modal-body-wrapper table tbody tr:nth-child(even) td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.06);
}

.modal-body-wrapper table tbody tr:hover td {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%) !important;
}

/* Small projection buttons */
.year-item .btn {
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Yearly Breakdown */
.yearly-breakdown {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.year-item {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.year-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.year-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-header.high-urgency {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.year-header.medium-urgency {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.year-header.low-urgency {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.year-title {
    font-size: 1.2em;
    font-weight: 700;
}

.year-count {
    font-size: 1.5em;
    font-weight: 700;
}

.year-details {
    padding: 20px;
    display: none;
}

.year-details.active {
    display: block;
}

.urgency-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 10px;
}

.urgency-badge.high {
    background: #e74c3c;
    color: white;
}

.urgency-badge.medium {
    background: #f39c12;
    color: white;
}

.urgency-badge.low {
    background: #27ae60;
    color: white;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.breakdown-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.breakdown-card h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1em;
}

/* Scrollable breakdown card */
.breakdown-card>div[style*="max-height"] {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f1f1f1;
}

.breakdown-card>div[style*="max-height"]::-webkit-scrollbar {
    width: 6px;
}

.breakdown-card>div[style*="max-height"]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.breakdown-card>div[style*="max-height"]::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.breakdown-card>div[style*="max-height"]::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-name {
    color: #555;
    font-size: 0.9em;
}

.breakdown-value {
    color: #2c3e50;
    font-weight: 700;
}

.pensiunan-list {
    margin-top: 20px;
}

.pensiunan-list h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.pensiunan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.pensiunan-table thead {
    background: #667eea;
    color: white;
}

.pensiunan-table th,
.pensiunan-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.pensiunan-table tbody tr:hover {
    background: #f8f9fa;
}

/* Banded columns for pensiunan table */
.pensiunan-table tbody td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.03);
}

.pensiunan-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.pensiunan-table tbody tr:nth-child(even) td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.06);
}

.pensiunan-table tbody tr:hover td {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%) !important;
}

.recommendation-box {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #f39c12;
}

.recommendation-box h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.recommendation-box ul {
    margin-left: 20px;
    color: #555;
}

.recommendation-box li {
    margin-bottom: 5px;
}

#projectionYears {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: var(--success-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.loading {
    text-align: center;
    padding: 60px 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 5px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-right-color: #764ba2;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 3px solid transparent;
    border-top-color: rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    font-size: 1.2em;
    color: var(--text-light);
}

.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px;
    background: var(--white);
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.summary-card[onclick] {
    cursor: pointer;
}

.summary-card[onclick]:active {
    transform: translateY(-2px);
}

.summary-card.status-kurang {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
}

.summary-card.status-sesuai {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.summary-card.status-lebih {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.summary-icon {
    font-size: 3em;
}

.summary-content h3 {
    font-size: 2.5em;
    margin-bottom: 5px;
}

.summary-content p {
    font-size: 1em;
    opacity: 0.9;
}

.error {
    margin: 20px 30px;
    padding: 15px 20px;
    background: #fadbd8;
    border-left: 4px solid var(--danger-color);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #922b21;
    white-space: pre-wrap;
    line-height: 1.6;
}

.error-icon {
    font-size: 1.5em;
}

.results {
    padding: 30px;
}

.result-item {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.result-item:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.result-header {
    padding: 20px;
    background: var(--light-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.result-header:hover {
    background: #d5dbdb;
}

.result-header.status-KURANG {
    border-left: 5px solid var(--danger-color);
}

.result-header.status-SESUAI {
    border-left: 5px solid var(--success-color);
}

.result-header.status-LEBIH {
    border-left: 5px solid var(--secondary-color);
}

.result-info {
    flex: 1;
}

.result-info h3 {
    font-size: 1.3em;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.result-info p {
    color: var(--text-light);
    margin-bottom: 5px;
}

.result-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat {
    text-align: center;
    padding: 10px 20px;
    background: var(--white);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-light);
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
}

.status-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95em;
    text-transform: uppercase;
}

.status-badge.KURANG {
    background: var(--danger-color);
    color: var(--white);
}

.status-badge.SESUAI {
    background: var(--success-color);
    color: var(--white);
}

.status-badge.LEBIH {
    background: var(--secondary-color);
    color: var(--white);
}

.result-details {
    padding: 20px;
    display: none;
    background: #f8f9fa;
}

.result-details.active {
    display: block;
}

.ptk-list {
    margin-top: 15px;
}

.ptk-list h4 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.1em;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

.ptk-table {
    width: 100%;
    min-width: 800px;
    /* Minimum width to trigger scroll */
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    box-shadow: none;
    /* Shadow on wrapper instead */
}

.ptk-table thead {
    background: white;
    color: var(--text-dark);
    border-bottom: 3px solid var(--primary-color);
}

.ptk-table th,
.ptk-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    /* Prevent text wrapping */
}

.ptk-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    background: white;
    color: var(--text-dark);
}

.ptk-table tbody tr {
    transition: background-color 0.2s ease;
}

.ptk-table tbody tr:hover {
    background: var(--light-bg);
}

.ptk-table tbody tr:last-child td {
    border-bottom: none;
}

/* Banded columns for ptk-table */
.ptk-table tbody td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.03);
}

.ptk-table tbody tr:nth-child(even) td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.06);
}

.ptk-table tbody tr:hover td {
    background: rgba(102, 126, 234, 0.1) !important;
}

.similarity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    background: var(--success-color);
    color: var(--white);
}

.similarity-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
    margin-right: 5px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1em;
}

.expand-icon {
    font-size: 1.5em;
    transition: transform 0.3s ease;
}

.expand-icon.active {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-section {
        width: 100%;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .button-group {
        width: 100%;
    }

    .button-group button {
        flex: 1;
    }

    /* Mobile sekolah dropdown */
    .sekolah-dropdown {
        max-height: 250px;
        font-size: 0.9em;
    }

    .sekolah-dropdown-item {
        padding: 10px 12px;
    }

    /* Mobile search sekolah section */
    .search-sekolah-card {
        padding: 20px;
    }

    .search-sekolah-header h3 {
        font-size: 1.3em;
    }

    .search-sekolah-header p {
        font-size: 0.9em;
    }

    .search-sekolah-input-wrapper input[type="text"] {
        padding: 14px 16px;
        font-size: 1em;
    }

    .selected-sekolah-badge {
        font-size: 0.9em;
        padding: 10px 16px;
    }

    .summary {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .result-stats {
        width: 100%;
        justify-content: space-between;
    }

    .ptk-table {
        font-size: 0.85em;
    }

    .ptk-table th,
    .ptk-table td {
        padding: 8px 10px;
    }
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--white);
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Detail Section Styles */
.detail-section {
    margin-bottom: 0;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
}

.detail-section:last-of-type {
    border-bottom: none;
}

.detail-section-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-section-title span {
    font-size: 1.3em;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.detail-item {
    background: #f8f9fa;
    padding: 16px 18px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.detail-label {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-value {
    font-size: 1em;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.5;
}

.detail-value.highlight {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1em;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.btn-modal {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.btn-download {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: var(--white);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

.btn-close-modal {
    background: #6c757d;
    color: white;
}

.btn-close-modal:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.btn-close-modal {
    background: var(--text-light);
    color: var(--white);
}

.btn-close-modal:hover {
    background: var(--text-dark);
}

.ptk-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.ptk-clickable:hover {
    background-color: #e3f2fd !important;
    transform: scale(1.01);
}

.loading-modal {
    text-align: center;
    padding: 40px;
}

.loading-modal .spinner {
    margin: 0 auto 20px;
}

/* Pagination Buttons */
.btn-pagination {
    padding: 8px 12px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-pagination:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card Detail Table Styles */
#cardDetailTable {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#cardDetailTable thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    background: var(--white) !important;
    color: var(--text-dark) !important;
    border-bottom: 3px solid #667eea;
}

#cardDetailTable tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* Banded columns for card detail table */
#cardDetailTable tbody td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.03);
}

#cardDetailTable tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

#cardDetailTable tbody tr:nth-child(even) td:nth-child(odd) {
    background: rgba(102, 126, 234, 0.06);
}

#cardDetailTable tbody tr:hover td {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%) !important;
}

/* Bottom Navigation Menu */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(10px);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 5px 8px 5px;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    padding: 8px 4px;
    font-size: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: transparent;
    position: relative;
    min-width: 60px;
}

.bottom-nav-item.active {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    transform: translateY(-2px);
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.15);
}

.bottom-nav-item:active {
    transform: scale(0.92);
}

.bottom-nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        padding-bottom: 70px;
    }

    .container {
        margin: 0;
        border-radius: 0;
        padding-bottom: 20px;
    }

    /* Show bottom navigation on mobile */
    .bottom-nav {
        display: block;
    }

    /* Header adjustments */
    header {
        padding: 20px 15px;
        border-radius: 0;
    }

    header h1 {
        font-size: 1.4em;
        margin-bottom: 5px;
        word-break: break-word;
    }

    header .subtitle {
        font-size: 0.8em;
        line-height: 1.4;
    }

    header>div {
        flex-direction: column !important;
        gap: 15px !important;
    }

    header>div>div:first-child {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 12px !important;
    }

    header>div>div:first-child img {
        height: 50px !important;
    }

    header>div>div:last-child {
        text-align: center !important;
        width: 100%;
    }

    header>div>div:last-child p {
        font-size: 11px !important;
        margin-bottom: 3px !important;
    }

    header>div>div:last-child button {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* Controls section */
    .controls {
        padding: 20px 15px;
        flex-direction: column;
        gap: 15px;
        background: #f8f9fa;
    }

    .filter-section {
        width: 100%;
        gap: 15px;
    }

    .filter-row {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .filter-item {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .filter-item label {
        font-size: 0.9em;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 0;
    }

    .filter-item select {
        padding: 12px 14px;
        font-size: 0.95em;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        background: white;
        color: #2c3e50;
        width: 100%;
        transition: all 0.3s ease;
    }

    .filter-item select:focus {
        border-color: #667eea;
        outline: none;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .button-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 10px;
    }

    .button-group .btn {
        width: 100%;
        padding: 12px 10px;
        font-size: 0.85em;
        justify-content: center;
        border-radius: 8px;
        font-weight: 600;
        white-space: nowrap;
    }

    .button-group .btn .btn-icon {
        font-size: 1.1em;
    }

    .btn {
        transition: all 0.3s ease;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .btn:active {
        transform: scale(0.97);
    }

    /* Summary cards */
    .summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 15px;
    }

    .summary-card {
        padding: 16px 12px;
        gap: 10px;
        min-height: 100px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .summary-icon {
        font-size: 2em;
    }

    .summary-content h3 {
        font-size: 1.6em;
        margin-bottom: 4px;
        font-weight: 700;
    }

    .summary-content p {
        font-size: 0.8em;
        line-height: 1.3;
        font-weight: 500;
    }

    /* Results section */
    .results {
        padding: 15px;
    }

    .result-item {
        margin-bottom: 15px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    .result-header {
        flex-direction: column;
        padding: 16px 14px;
        gap: 12px;
    }

    .result-info h3 {
        font-size: 1.05em;
        word-break: break-word;
        line-height: 1.4;
        font-weight: 600;
    }

    .result-info p {
        font-size: 0.85em;
        line-height: 1.5;
        margin-top: 4px;
    }

    .result-stats {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }

    .stat {
        text-align: center;
        padding: 8px;
        background: rgba(102, 126, 234, 0.05);
        border-radius: 8px;
    }

    .stat-label {
        font-size: 0.75em;
        margin-bottom: 4px;
        display: block;
    }

    .stat-value {
        font-size: 1.3em;
        font-weight: 700;
    }

    .status-badge {
        padding: 5px 10px;
        font-size: 0.75em;
        font-weight: 600;
        border-radius: 8px;
    }

    .expand-icon {
        font-size: 1em;
        padding: 8px;
    }

    /* PTK Table */
    .ptk-table {
        font-size: 0.75em;
        overflow-x: auto;
    }

    .ptk-table th,
    .ptk-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .ptk-table th {
        position: sticky;
        top: 0;
        background: white;
        color: var(--text-dark);
        z-index: 1;
    }

    /* Modal adjustments */
    .modal-content {
        max-height: 95vh;
        width: 96%;
        margin: 10px auto;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    .modal-header {
        padding: 18px 16px;
        border-radius: 16px 16px 0 0;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .modal-header h2,
    .modal-header h3 {
        font-size: 1.15em;
        line-height: 1.4;
        word-break: break-word;
    }

    .modal-close {
        font-size: 26px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .modal-close:active {
        transform: scale(0.9);
    }

    .modal-body {
        max-height: calc(95vh - 180px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-body-wrapper {
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-body-wrapper table {
        font-size: 0.75em;
        min-width: 700px;
    }

    .modal-body-wrapper th,
    .modal-body-wrapper td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    .modal-body-wrapper th {
        color: #2c3e50 !important;
        font-weight: 700;
    }

    .detail-section {
        padding: 20px 16px;
    }

    .detail-section-title {
        font-size: 1.05em;
        padding: 10px 12px;
        margin-bottom: 15px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .detail-item {
        padding: 14px 16px;
    }

    .detail-label {
        font-size: 0.75em;
    }

    .detail-value {
        font-size: 0.95em;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 16px 20px;
    }

    .btn-modal {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 0.9em;
    }

    /* Card Detail Modal Mobile */
    #modalCardDetail .modal-content {
        max-width: 95%;
    }

    #cardSearchInput {
        width: 100%;
        font-size: 0.85em;
        padding: 8px;
    }

    #cardKecamatanFilter,
    #cardJabatanFilter {
        width: 100%;
        font-size: 0.85em;
        padding: 8px;
    }

    #cardDetailTable {
        font-size: 0.7em;
    }

    #cardDetailTable th,
    #cardDetailTable td {
        padding: 6px 4px;
        white-space: nowrap;
    }

    .btn-pagination {
        padding: 6px 8px;
        font-size: 12px;
    }

    #cardPageSelect,
    #cardRowsPerPage {
        padding: 4px 6px;
        font-size: 12px;
    }

    /* Loading and error */
    .loading,
    .error {
        margin: 15px;
        padding: 15px;
        font-size: 0.9em;
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    /* No data message */
    .no-data {
        padding: 30px 15px;
        font-size: 0.9em;
    }

    /* Search section mobile */
    .search-section {
        padding: 15px;
        margin: 0 15px;
        border-radius: 12px;
    }

    #searchInput {
        font-size: 0.95em;
        padding: 12px 14px;
        min-width: 100%;
        border: 2px solid #e0e0e0;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    #searchInput:focus {
        border-color: #667eea;
        outline: none;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    #searchStats {
        font-size: 0.85em;
        padding: 8px 12px;
        border-radius: 8px;
        margin-top: 10px;
    }

    /* Chart section mobile */
    .chart-section {
        padding: 20px 15px;
        margin: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .chart-header h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .chart-header>div {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    #chartJabatanFilter {
        width: 100%;
        font-size: 0.95em;
        padding: 12px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
    }

    .chart-container {
        height: 350px;
        padding: 15px 5px;
        margin-top: 10px;
    }

    #chartTypeBtn {
        font-size: 0.9em;
        padding: 10px 16px;
        border-radius: 8px;
        margin-top: 10px;
    }

    /* Projection section mobile */
    .projection-section {
        padding: 20px 15px;
        margin: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .projection-header {
        margin-bottom: 20px;
    }

    .projection-header h2 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }

    .projection-subtitle {
        font-size: 0.85em;
        line-height: 1.5;
        margin-bottom: 15px;
    }

    .projection-controls {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .projection-control-item {
        width: 100%;
    }

    .projection-control-item label {
        font-size: 0.9em;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 6px;
    }

    .projection-control-item select,
    .projection-control-item input[type="number"] {
        width: 100%;
        font-size: 0.95em;
        padding: 12px 14px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        background: white;
        transition: all 0.3s ease;
    }

    .projection-control-item select:focus,
    .projection-control-item input[type="number"]:focus {
        border-color: #667eea;
        outline: none;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .projection-control-item>div {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .projection-control-item input[type="number"] {
        width: 80px;
        text-align: center;
        font-weight: 600;
    }

    .projection-action-btn {
        width: 100%;
        padding: 12px 16px !important;
        font-size: 0.9em;
        font-weight: 600;
        border-radius: 8px;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        transition: all 0.3s ease;
    }

    .projection-action-btn:active {
        transform: scale(0.97);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    /* Container untuk action buttons dalam 1 row */
    .projection-controls {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .projection-actions-wrapper {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .projection-actions-wrapper .btn {
        flex: 1;
        font-size: 0.85em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .projection-actions-wrapper .btn .btn-icon {
        margin-right: 4px;
    }

    .projection-summary {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 20px;
    }

    .projection-card {
        padding: 18px 16px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .projection-card-icon {
        font-size: 2.2em;
        margin-bottom: 8px;
    }

    .projection-card-value {
        font-size: 2em;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .projection-card-label {
        font-size: 0.9em;
        font-weight: 500;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 80px;
    }

    /* Ensure content doesn't hide behind bottom nav */
    main {
        padding-bottom: 80px;
    }

    /* Override projection header filters for mobile */
    .projection-header .filter-row {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .projection-header .filter-item {
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 1 auto !important;
    }

    .projection-header .filter-item select {
        width: 100% !important;
        padding: 12px 14px !important;
        font-size: 0.95em !important;
        border: 2px solid #e0e0e0 !important;
        border-radius: 8px !important;
    }

    .projection-header .filter-item label {
        font-size: 0.9em !important;
        font-weight: 600 !important;
    }

    /* Style untuk controls section di mobile */
    .projection-header {
        padding: 0 15px;
    }

    .projection-controls {
        background: white;
        padding: 18px;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        border: 1px solid #e8e8e8;
    }

    .projection-control-item span {
        color: #666;
        font-size: 0.85em;
        font-weight: 500;
    }

    /* Group retirement age inputs dengan background berbeda */
    .retirement-age-group {
        width: 100%;
        background: #f8f9fa;
        padding: 14px;
        border-radius: 10px;
        border: 1px solid #e8e8e8;
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .retirement-age-group::before {
        content: "⚙️ Pengaturan Usia Pensiun";
        display: block;
        font-size: 0.85em;
        font-weight: 600;
        color: #667eea;
        margin-bottom: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .retirement-age-group .projection-control-item {
        margin: 0;
    }

    .retirement-age-group .projection-control-item input[type="number"] {
        background: white;
        font-weight: 700;
        color: #667eea;
        border-color: #d0d0d0;
    }

    .retirement-age-group .projection-control-item label {
        font-size: 0.85em;
        color: #555;
    }

    /* Responsive button text for very small screens */
    @media (max-width: 380px) {
        .projection-actions-wrapper .btn {
            font-size: 0.75em;
            padding: 10px 8px !important;
        }

        .projection-actions-wrapper .btn span:not(.btn-icon) {
            display: none;
        }

        .projection-actions-wrapper .btn .btn-icon {
            margin-right: 0;
            font-size: 1.3em;
        }

        .projection-control-item label {
            font-size: 0.82em;
        }

        .retirement-age-group::before {
            font-size: 0.75em;
        }
    }

    .pensiunan-table {
        font-size: 0.8em;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .pensiunan-table th,
    .pensiunan-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    .year-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .year-title {
        font-size: 1.05em;
        font-weight: 600;
    }

    .year-count {
        font-size: 1.4em;
        font-weight: 700;
    }

    .recommendation-box {
        padding: 15px;
        border-radius: 10px;
        margin: 10px 0;
    }

    .recommendation-box h4 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .recommendation-box ul {
        font-size: 0.9em;
        line-height: 1.6;
    }

    /* Table wrapper with scroll indicator */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
}

/* ========================================
   🎨 ADDITIONAL VISUAL EFFECTS
======================================== */

/* Optimized transitions for interactive elements */
a,
button {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input,
select,
textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Performance optimization */
.btn,
.summary-card,
.chart-container {
    will-change: transform;
}

.btn:hover,
.summary-card:hover {
    will-change: auto;
}

/* Parallax effect for sections */
.parallax-section {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Glassmorphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animated gradient background for special cards */
.gradient-animated {
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
}

/* Hover lift effect */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Pulse animation for notifications */
.pulse-notification {
    animation: pulse 2s ease-in-out infinite;
}

/* Shimmer loading effect */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Badge bounce effect */
.badge-bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* Tooltip enhancement */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.85em;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Icon animations */
.icon-spin {
    animation: spin 2s linear infinite;
}

.icon-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.icon-float {
    animation: float 3s ease-in-out infinite;
}

/* Status indicator with pulse */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.active {
    background: #27ae60;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

.status-indicator.inactive {
    background: #95a5a6;
}

/* Enhanced focus states */
*:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   END OF VISUAL EFFECTS
======================================== */

/* ========================================
   🎨 SIDEBAR NAVIGATION
======================================== */

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle span {
    display: block;
    line-height: 1;
}

/* Sidebar Container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Sidebar collapsed state */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.sidebar-logo-icon {
    font-size: 32px;
    line-height: 1;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 15px;
    font-weight: 500;
}

.sidebar-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: white;
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding-left: 30px;
}

.sidebar-menu-item:hover::before {
    height: 35px;
}

.sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-menu-item.active::before {
    height: 40px;
}

.sidebar-menu-icon {
    font-size: 22px;
    line-height: 1;
    min-width: 22px;
}

.sidebar-menu-text {
    white-space: nowrap;
}

/* Sidebar Overlay (for mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Main Content Wrapper */
.main-content {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop view: Add margin when sidebar is open */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 280px;
    }

    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
}

/* Mobile view: Sidebar hidden by default */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar:not(.collapsed)~.sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
    }

    /* Show toggle button on mobile */
    .sidebar-toggle {
        display: flex;
    }
}

/* Scrollbar for sidebar menu */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Animation for sidebar entrance */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {

        .sidebar-toggle span {
            display: block;
            line-height: 1;
        }

        /* Sidebar Container */
        .sidebar {
            position: fixed;
            top: 0;
            left: 0;
            width: 280px;
            height: 100vh;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
            box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
        }

        /* Sidebar collapsed state */
        .sidebar.collapsed {
            transform: translateX(-100%);
        }

        /* Sidebar Header */
        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            color: white;
        }

        .sidebar-logo-icon {
            font-size: 32px;
            line-height: 1;
        }

        .sidebar-menu-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 16px 25px;
            color: rgba(255, 255, 255, 0.85);
            text-decoration: none;
            transition: all 0.3s ease;
            position: relative;
            font-size: 15px;
            font-weight: 500;
        }

        .sidebar-menu-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 0;
            background: white;
            border-radius: 0 4px 4px 0;
            transition: height 0.3s ease;
        }

        .sidebar-menu-item:hover {
            background: rgba(255, 255, 255, 0.15);
            color: white;
            padding-left: 30px;
        }

        .sidebar-menu-item:hover::before {
            height: 35px;
        }

        .sidebar-menu-item.active {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            font-weight: 600;
            box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1);
        }

        .sidebar-menu-item.active::before {
            height: 40px;
        }

        .sidebar-menu-icon {
            font-size: 22px;
            line-height: 1;
            min-width: 22px;
        }

        .sidebar-menu-text {
            white-space: nowrap;
        }

        /* Sidebar Overlay (for mobile) */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 9998;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        /* Main Content Wrapper */
        .main-content {
            transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Desktop view: Add margin when sidebar is open */
        @media (min-width: 769px) {
            .sidebar {
                transform: translateX(0);
            }

            .sidebar.collapsed {
                transform: translateX(-100%);
            }

            .main-content {
                margin-left: 280px;
            }

            .main-content.sidebar-collapsed {
                margin-left: 0;
            }
        }

        /* Mobile view: Sidebar hidden by default */
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar:not(.collapsed) {
                transform: translateX(0);
            }

            .sidebar:not(.collapsed)~.sidebar-overlay {
                display: block;
                opacity: 1;
            }

            .main-content {
                margin-left: 0;
            }

            /* Show toggle button on mobile */
            .sidebar-toggle {
                display: flex;
            }
        }

        /* Scrollbar for sidebar menu */
        .sidebar-menu::-webkit-scrollbar {
            width: 6px;
        }

        .sidebar-menu::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.1);
        }

        .sidebar-menu::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.3);
            border-radius: 3px;
        }

        .sidebar-menu::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.5);
        }

        /* Animation for sidebar entrance */
        @keyframes slideInFromLeft {
            from {
                transform: translateX(-100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        /* ========================================
   END OF SIDEBAR NAVIGATION
======================================== */

        gap: 20px;
    }

    /* Individual Ranking Card */
    .ranking-card {
        background: white;
        border-radius: 16px;
        padding: 24px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        border-left: 6px solid transparent;
    }

    .ranking-card.top {
        border-left-color: #27ae60;
    }

    .ranking-card.bottom {
        border-left-color: #e74c3c;
    }

    .ranking-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    /* Ranking Header */
    .ranking-header {
        display: flex;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 20px;
    }

    .rank-badge {
        font-size: 32px;
        font-weight: 800;
        min-width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .rank-badge.top-badge {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        color: white;
    }

    .rank-badge.bottom-badge {
        background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
        color: #2c3e50;
    }

    .school-info {
        flex: 1;
    }

    .school-info h3 {
        margin: 0 0 8px 0;
        font-size: 1.3em;
        color: #2c3e50;
        font-weight: 700;
    }

    .school-info p {
        margin: 0 0 8px 0;
        color: #7f8c8d;
        font-size: 0.95em;
    }

    .npsn-badge {
        display: inline-block;
        padding: 4px 12px;
        background: #ecf0f1;
        border-radius: 6px;
        font-size: 0.85em;
        color: #7f8c8d;
        font-family: monospace;
    }

    /* Completion Section */
    .completion-section {
        margin: 20px 0;
    }

    .completion-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
    }

    .completion-header span:first-child {
        font-weight: 600;
        color: #2c3e50;
    }

    .completion-pct {
        font-size: 1.5em;
        font-weight: 800;
    }

    .completion-pct.success {
        color: #27ae60;
    }

    .completion-pct.warning {
        color: #f39c12;
    }

    .completion-pct.orange {
        color: #e67e22;
    }

    .completion-pct.danger {
        color: #e74c3c;
    }

    /* Progress Bar */
    .progress-bar {
        width: 100%;
        height: 20px;
        background: #ecf0f1;
        border-radius: 10px;
        overflow: hidden;
        margin-bottom: 15px;
    }

    .progress-fill {
        height: 100%;
        transition: width 0.5s ease;
        background: linear-gradient(90deg, #667eea, #764ba2);
    }

    .progress-fill.success {
        background: linear-gradient(90deg, #27ae60, #2ecc71);
    }

    .progress-fill.warning {
        background: linear-gradient(90deg, #f39c12, #f1c40f);
    }

    .progress-fill.orange {
        background: linear-gradient(90deg, #e67e22, #f39c12);
    }

    .progress-fill.danger {
        background: linear-gradient(90deg, #e74c3c, #c0392b);
    }

    /* Stats Row */
    .stats-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        margin-top: 15px;
    }

    .stat-item {
        text-align: center;
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
    }

    .stat-label {
        display: block;
        font-size: 0.8em;
        color: #7f8c8d;
        margin-bottom: 4px;
    }

    .stat-value {
        display: block;
        font-size: 1.3em;
        font-weight: 700;
        color: #2c3e50;
    }

    .text-danger {
        color: #e74c3c;
    }

    .text-success {
        color: #27ae60;
    }

    /* Status Badge */
    .status-badge {
        position: absolute;
        top: 20px;
        right: 20px;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 0.85em;
        font-weight: 700;
    }

    .status-lengkap {
        background: #d4edda;
        color: #27ae60;
    }

    .status-kurang {
        background: #f8d7da;
        color: #e74c3c;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .stats-row {
            grid-template-columns: repeat(2, 1fr);
        }

        .ranking-header {
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .status-badge {
            position: static;
            margin-top: 15px;
        }
    }

    /* ========================================
   END OF RANKING PAGE STYLES
======================================== */