/* ========================================
   Data Sasaran Administrasi PPG 2026
   Modern Professional Theme
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --primary-glow: rgba(79, 70, 229, 0.3);
    --secondary: #7C3AED;
    --accent: #06B6D4;
    --accent-glow: rgba(6, 182, 212, 0.2);

    --bg-dark: #0F172A;
    --bg-dark-2: #1E293B;
    --bg-dark-3: #334155;
    --bg-body: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-white: #F8FAFC;
    --text-on-dark: #CBD5E1;

    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-focus: var(--primary);

    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --info: #3B82F6;
    --info-bg: #EFF6FF;

    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 40px var(--primary-glow);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-dark-3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================
   LOGIN PAGE
   ========================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 40%, #312E81 70%, #4F46E5 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: bgFloat 15s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: cardSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.login-icon i {
    font-size: 32px;
    color: white;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-on-dark);
    opacity: 0.7;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-on-dark);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    transition: var(--transition);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    color: var(--text-white);
    font-family: var(--font);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.input-wrapper input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-wrapper input:focus + i,
.input-wrapper input:focus ~ i {
    color: var(--primary-light);
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: errorShake 0.4s ease;
}

.login-error.show {
    display: flex;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 24px;
    max-width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-icon i {
    color: white;
    font-size: 18px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius);
    color: var(--text-on-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.nav-link i {
    font-size: 15px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar i {
    font-size: 32px;
    color: var(--text-muted);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-white);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    padding-top: 88px;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 32px;
    min-height: 100vh;
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.purple {
    background: rgba(124, 58, 237, 0.1);
    color: var(--secondary);
}

.stat-icon.amber {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- Update Info Badge ---------- */
.update-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--info-bg);
    color: var(--info);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.update-info i {
    font-size: 14px;
}

/* ==========================================
   FILTER PANEL
   ========================================== */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.filter-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-panel-header h3 i {
    color: var(--primary);
}

.btn-reset-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-reset-filter:hover {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Select2 Customization */
.select2-container--default .select2-selection--single {
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    padding: 0 12px;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--primary-light);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    padding: 0;
    line-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.select2-dropdown {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font);
    font-size: 13px;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary);
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--primary);
}

.select2-container--default .select2-results__option--selected {
    background: var(--info-bg);
}

.select2-results__option {
    font-family: var(--font);
    font-size: 13px;
    padding: 8px 12px;
}

/* ==========================================
   DATA TABLE (Metabase-like)
   ========================================== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.table-toolbar .search-box {
    position: relative;
    width: 300px;
}

.table-toolbar .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.table-toolbar .search-box input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    background: var(--bg-card);
}

.table-toolbar .search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.table-info-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.table-info-text strong {
    color: var(--text-primary);
}

/* DataTables Overrides - Metabase Style */
.dataTables_wrapper {
    width: 100%;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: none;
}

.dataTables_wrapper .dataTables_info {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_paginate {
    padding: 12px 20px;
    text-align: right;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm);
    background: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-body) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Table Styling */
.datatable-scroll-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

table.dataTable thead th {
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: relative;
    user-select: none;
}

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    margin-left: 6px;
    color: var(--text-muted);
}

table.dataTable thead th.sorting::after { content: '\f0dc'; }
table.dataTable thead th.sorting_asc::after { content: '\f0de'; color: var(--primary); }
table.dataTable thead th.sorting_desc::after { content: '\f0dd'; color: var(--primary); }

table.dataTable tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

table.dataTable tbody tr {
    transition: background 0.15s ease;
}

table.dataTable tbody tr:hover {
    background: rgba(79, 70, 229, 0.04);
}

table.dataTable tbody tr:nth-child(even) {
    background: var(--bg-card-hover);
}

table.dataTable tbody tr:nth-child(even):hover {
    background: rgba(79, 70, 229, 0.04);
}

/* Sticky first columns (No + Nama) */
table.dataTable thead th:first-child,
table.dataTable tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
    box-shadow: 2px 0 4px rgba(0,0,0,0.04);
}

table.dataTable thead th:first-child {
    background: var(--bg-body);
    z-index: 3;
}

table.dataTable tbody tr:hover td:first-child {
    background: rgba(79, 70, 229, 0.04);
}

table.dataTable thead th:nth-child(2),
table.dataTable tbody td:nth-child(2) {
    position: sticky;
    left: 50px;
    z-index: 2;
    background: inherit;
    box-shadow: 2px 0 4px rgba(0,0,0,0.04);
}

table.dataTable thead th:nth-child(2) {
    background: var(--bg-body);
    z-index: 3;
}

/* Row number column */
table.dataTable tbody td:first-child {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    width: 50px;
    min-width: 50px;
    text-align: center;
}

/* Nama column */
table.dataTable tbody td:nth-child(2) {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 180px;
}

/* ==========================================
   UPDATE / IMPORT PAGE
   ========================================== */
.upload-zone {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.03);
}

.upload-zone.dragover {
    transform: scale(1.01);
    box-shadow: var(--shadow-glow);
}

.upload-zone-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.upload-zone-icon i {
    font-size: 32px;
    color: var(--primary);
}

.upload-zone h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-zone .btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone .btn-browse:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.upload-zone input[type="file"] {
    display: none;
}

/* Progress Bar */
.upload-progress {
    display: none;
    margin-top: 30px;
}

.upload-progress.show {
    display: block;
}

.progress-bar-wrapper {
    background: var(--bg-body);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Upload Result */
.upload-result {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.upload-result.show {
    display: block;
    animation: cardSlideUp 0.4s ease;
}

.upload-result.success {
    border-color: rgba(16, 185, 129, 0.3);
}

.upload-result.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.upload-result-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.upload-result.success .upload-result-icon {
    background: var(--success-bg);
    color: var(--success);
}

.upload-result.error .upload-result-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.upload-result h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-result p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==========================================
   DASHBOARD
   ========================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    max-width: 800px;
    margin: 40px auto;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.dash-card:hover::before {
    opacity: 1;
}

.dash-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.dash-card-icon.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(79, 70, 229, 0.1));
    color: var(--primary);
}

.dash-card-icon.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
    color: var(--success);
}

.dash-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   TOAST / NOTIFICATION
   ========================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
    min-width: 300px;
    max-width: 440px;
}

.toast.success {
    background: var(--success-bg);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.toast.error {
    background: var(--danger-bg);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.toast.info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .navbar-inner {
        padding: 0 12px;
    }
    
    .brand-text {
        display: none;
    }
    
    .nav-link span {
        display: none;
    }
    
    .user-details {
        display: none;
    }
    
    .main-content {
        padding: 76px 12px 24px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-bar {
        gap: 8px;
    }
    
    .stat-card {
        min-width: 140px;
        padding: 14px;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .table-toolbar .search-box {
        width: 100%;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 32px 24px;
    }
}

/* ==========================================
   ADDITIONAL DATA TABLE STYLES
   ========================================== */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    color: var(--text-secondary);
    z-index: 100;
}

.dataTables_empty {
    padding: 40px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-size: 14px !important;
}

/* Row counter */
.row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Badge styles for status columns */
td[data-status="Layak"] {
    color: var(--success);
}

td[data-status="Tidak Layak"] {
    color: var(--danger);
}

/* =========================================
   MODAL STYLES
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.show {
    display: flex;
    opacity: 1;
}
.modal-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
.modal-overlay.show .modal-container {
    transform: translateY(0);
}
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
}
.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.btn-close-modal:hover {
    color: var(--danger);
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 14px;
}
.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: transparent;
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* =========================================
   TABLE STYLES (USERS)
   ========================================= */
.table-simple {
    width: 100%;
    border-collapse: collapse;
}
.table-simple th, .table-simple td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.table-simple th {
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
}
.table-simple tbody tr:hover {
    background: var(--surface-hover);
}
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-admin {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}
.badge-user {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}