:root {
    --primary: #00BFA5; /* Hijau tosca yang lebih cerah dan modern */
    --secondary: #80CBC4; /* Hijau tosca soft untuk secondary */
    --success: #26A69A; /* Hijau tosca medium untuk success */
    --info: #B2DFDB; /* Hijau tosca sangat soft untuk info */
    --warning: #FFD166; /* Tetap kuning soft untuk warning */
    --danger: #EF9A9A; /* Merah soft yang harmonis dengan hijau tosca */
    --light: #F8FDFC; /* Putih dengan nuansa hijau sangat soft */
    --dark: #004D40; /* Hijau tosca dark untuk text */
    --sidebar-width: 280px;
    --header-height: 70px;
    --transition-speed: 0.3s;
    --bg-color: #F1FDFC; /* Background color yang lebih soft */
    
    /* Additional color variations */
    --primary-light: #80DEEA;
    --primary-dark: #00897B;
    --accent: #64FFDA;
    --surface: #FFFFFF;
    --border: #E0F2F1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--dark);
    padding-top: var(--header-height);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========== HEADER ========== */
.navbar {
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 20px rgba(0, 191, 165, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-speed) ease;
}

.navbar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin-right: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.navbar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    letter-spacing: 0.5px;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: white;
    transform: translateY(-1px);
}

.navbar-brand i {
    font-size: 1.4rem;
    opacity: 0.9;
}

.navbar-nav {
    display: flex;
    align-items: center;
    margin: 0;
}

/* User Menu Styles */
.nav-item.dropdown {
    position: relative;
}

.nav-link.dropdown-toggle {
    background: none;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-link.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease;
}

.nav-link.dropdown-toggle.show .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 191, 165, 0.15);
    padding: 8px;
    margin-top: 10px;
    background: var(--surface);
    min-width: 200px;
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--dark);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    font-size: 0.9rem;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: var(--border);
}

.dropdown-item.text-danger {
    color: var(--danger) !important;
}

.dropdown-item.text-danger:hover {
    background: linear-gradient(135deg, var(--danger) 0%, #E57373 100%);
    color: white !important;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 4px 0 20px rgba(0, 191, 165, 0.1);
    overflow-y: auto;
    transition: transform var(--transition-speed) ease-in-out;
    z-index: 1035;
}
.sidebar.hide {
    transform: translateX(-100%);
}

.sidebar-profile {
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.15);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.sidebar-profile::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%);
}

.sidebar-profile-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}
.sidebar-profile-img:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}
.sidebar-profile-name {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}
.sidebar-profile-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-divider {
    padding: 20px 25px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 10px;
}

.sidebar-heading {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.sidebar .nav-item {
    margin-bottom: 5px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 25px;
    margin: 2px 15px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    font-size: 0.95rem;
    gap: 12px;
}
.sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}
.sidebar .nav-link.active {
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
    box-shadow: 0 4px 15px rgba(0, 191, 165, 0.2);
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 0 4px 4px 0;
    opacity: 0.8;
}
.sidebar .nav-link i {
    width: 20px;
    font-size: 1.1rem;
    flex-shrink: 0;
    text-align: center;
}
.sidebar .nav-link span {
    flex: 1;
}

/* ========== MAIN ========== */
main {
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: all var(--transition-speed) ease-in-out;
    min-height: 100vh;
    background: var(--bg-color);
    width: calc(100% - var(--sidebar-width));
}
body.sidebar-collapsed main {
    margin-left: 0;
    width: 100%;
}

/* ========== DASHBOARD COMPONENTS ========== */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 191, 165, 0.15);
    border: none;
}

.dashboard-header h1 {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.dashboard-header p {
    opacity: 0.9;
    margin-bottom: 0;
}

/* Stats Card */
.stats-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    height: 100%;
    margin-bottom: 0;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 191, 165, 0.12);
}

.stats-card .card-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 191, 165, 0.15);
}

.stats-card .card-icon.operasional {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.stats-card .card-icon.spd {
    background: linear-gradient(135deg, #81C784 0%, #4CAF50 100%);
    color: white;
}

.stats-card .card-icon.kwitansi {
    background: linear-gradient(135deg, var(--info) 0%, var(--secondary) 100%);
    color: white;
}

.stats-card .card-icon.completed {
    background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
    color: white;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-card .card-title {
    font-size: 0.95rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-card .card-progress {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.08);
    border: 1px solid var(--border);
    height: 100%;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 191, 165, 0.12);
}

.chart-container .card-header {
    background: none;
    border: none;
    padding: 0 0 20px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.chart-container .card-header h5 {
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
    font-size: 1.2rem;
}

/* ========== CARD ========== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.08);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 191, 165, 0.12);
}
.card-header {
    background: var(--surface);
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border);
    padding: 20px 25px;
    font-weight: 600;
    font-size: 1.1rem;
}
.card-body {
    padding: 25px;
}

/* ========== TABLE ========== */
/* ========== TABLE ENHANCEMENTS ========== */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.08);
    position: relative;
}

/* Horizontal scroll untuk tabel */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 0 0 10px 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--dark) 100%);
}

/* Untuk Firefox */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--light);
}

/* Styling untuk tabel dengan banyak kolom */
.table-responsive.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Indikator scroll untuk mobile */
.table-responsive.table-scroll::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(0, 191, 165, 0.1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-responsive.table-scroll.scrolling::after {
    opacity: 1;
}

/* Sticky header untuk tabel panjang */
.table-responsive.sticky-header {
    max-height: 600px;
    overflow-y: auto;
}

.table-responsive.sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, var(--light) 0%, var(--info) 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Sticky kolom pertama untuk tabel lebar */
.table-responsive.sticky-first-col td:first-child,
.table-responsive.sticky-first-col th:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.table-responsive.sticky-first-col th:first-child {
    background: linear-gradient(135deg, var(--light) 0%, var(--info) 100%);
    z-index: 15;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
    }
    
    .table-responsive.table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Force horizontal scroll pada mobile */
    .table-responsive.table-scroll .table {
        min-width: 600px; /* Minimum width untuk memaksa scroll */
    }
    
    /* Hide scrollbar secara default, show saat scroll */
    .table-responsive.table-scroll::-webkit-scrollbar {
        height: 6px;
    }
    
    .table-responsive.table-scroll:hover::-webkit-scrollbar {
        height: 8px;
    }
}

/* Table container dengan kontrol scroll */
.table-container {
    position: relative;
    margin-bottom: 1rem;
}

.table-scroll-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 191, 165, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.table-responsive.scrolling .table-scroll-indicator {
    opacity: 1;
}

/* Enhanced table styling untuk data yang kompleks */
.table-compact {
    font-size: 0.85rem;
}

.table-compact th,
.table-compact td {
    padding: 10px 12px;
}

.table-hover tbody tr:hover {
    background-color: var(--light);
    transform: none; /* Remove transform on hover untuk konsistensi */
}

/* Zebra striping untuk readability */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 191, 165, 0.02);
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: var(--surface);
}

/* Table dengan fixed layout untuk performa */
.table-fixed {
    table-layout: fixed;
}

.table-fixed th,
.table-fixed td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Kolom dengan lebar spesifik */
.col-action {
    width: 120px;
    min-width: 120px;
}

.col-status {
    width: 100px;
    min-width: 100px;
}

.col-number {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

.col-date {
    width: 120px;
    min-width: 120px;
}

.col-amount {
    width: 150px;
    min-width: 150px;
    text-align: right;
}

/* Responsive text dalam tabel */
.table-responsive .table td {
    word-wrap: break-word;
}

/* Untuk sel dengan konten panjang */
.table-responsive .table td.text-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile specific table styles */
@media (max-width: 575.98px) {
    .table-responsive {
        border: 1px solid var(--border);
        border-radius: 8px;
    }
    
    .table-responsive .table {
        font-size: 0.8rem;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 8px 10px;
    }
    
    /* Hide some columns on mobile */
    .table-responsive .table .d-none-mobile {
        display: none;
    }
    
    /* Show important columns only */
    .table-responsive .table .d-mobile-priority {
        display: table-cell;
    }
}

/* Print styles untuk tabel */
@media print {
    .table-responsive {
        overflow: visible !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .table-responsive .table {
        width: 100% !important;
        min-width: auto !important;
    }
}

/* ========== BADGE & STATUS ========== */
.badge {
    border-radius: 10px;
    font-weight: 600;
    padding: 6px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 191, 165, 0.1);
}

.badge-status {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-block;
    min-width: 85px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 191, 165, 0.1);
}

.badge-operasional { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: white; 
}
.badge-spd { 
    background: linear-gradient(135deg, #81C784 0%, #4CAF50 100%); 
    color: white; 
}
.badge-kwitansi { 
    background: linear-gradient(135deg, var(--info) 0%, var(--secondary) 100%); 
    color: white; 
}

/* Status Colors */
.status-0 { background: linear-gradient(135deg, #B0BEC5 0%, #78909C 100%); color: white; }
.status-1 { background: linear-gradient(135deg, var(--info) 0%, var(--secondary) 100%); color: white; }
.status-2 { background: linear-gradient(135deg, var(--warning) 0%, #FFB74D 100%); color: var(--dark); }
.status-3 { background: linear-gradient(135deg, var(--success) 0%, var(--primary) 100%); color: white; }
.status-4 { background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%); color: white; }
.status-5 { background: linear-gradient(135deg, #CE93D8 0%, #AB47BC 100%); color: white; }
.status-6 { background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%); color: var(--dark); }
.status-7 { background: linear-gradient(135deg, #FFAB91 0%, #FF7043 100%); color: white; }

/* ========== BUTTONS ========== */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.15);
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 191, 165, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--primary-dark) 100%);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, var(--secondary) 100%);
    color: var(--dark);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FFB74D 100%);
    color: var(--dark);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #E57373 100%);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ========== PROGRESS BAR ========== */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: var(--info);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(135deg, var(--success) 0%, var(--primary) 100%);
    transition: width 0.6s ease;
}

/* ========== RECENT ACTIVITY ========== */
.recent-activity {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-activity li {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.recent-activity li:hover {
    background-color: var(--light);
    border-radius: 10px;
    padding-left: 10px;
    padding-right: 10px;
}

.recent-activity li:last-child {
    border-bottom: none;
}

.recent-activity .activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px rgba(0, 191, 165, 0.15);
    flex-shrink: 0;
}

.recent-activity .activity-content {
    flex: 1;
}

.recent-activity .activity-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.recent-activity .activity-meta {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 500;
}

/* ========== FORM CONTROLS ========== */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: var(--surface);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 191, 165, 0.15);
    transform: translateY(-2px);
}

.form-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* ========== PAGINATION ========== */
.pagination {
    margin: 20px 0;
}

.page-link {
    border-radius: 10px;
    margin: 0 3px;
    border: 1px solid var(--border);
    color: var(--primary-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
}

/* ========== LOADING ========== */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== SCROLLBAR & EFFECTS ========== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--dark) 100%);
}

/* Smooth scrolling for sidebar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========== TEXT GRADIENT ========== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== ANIMATION ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stats-card, .chart-container {
    animation: fadeIn 0.6s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.sidebar .nav-link {
    animation: slideIn 0.4s ease-out;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1199.98px) {
    html {
        font-size: 13.5px;
    }
    
    .stats-card {
        padding: 20px;
    }
    
    .chart-container {
        padding: 20px;
    }
}

@media (max-width: 991.98px) {
    html {
        font-size: 13px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        top: var(--header-height);
        z-index: 1040;
        width: 280px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 20px;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .stats-card .card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stats-card h3 {
        font-size: 1.7rem;
    }
    
    .user-details {
        display: none;
    }
    
    .user-info {
        gap: 8px;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    /* Tampilkan tombol toggle mobile */
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 25px;
        right: 25px;
        z-index: 1045;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        color: white;
        border: none;
        box-shadow: 0 6px 20px rgba(0, 191, 165, 0.3);
        transition: all 0.3s ease;
        font-size: 1.2rem;
    }
    
    .sidebar-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 8px 25px rgba(0, 191, 165, 0.4);
    }
    
    /* Backdrop untuk mobile */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100% - var(--header-height));
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
        z-index: 1035;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-speed) ease;
    }
    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 767.98px) {
    html {
        font-size: 12.5px;
    }
    
    .navbar {
        padding: 0 0.75rem;
    }
    .navbar-brand {
        font-size: 1.1rem;
        max-width: 200px;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .navbar-toggle-btn {
        width: 40px;
        height: 40px;
        margin-right: 10px;
        font-size: 1.2rem;
    }
    
    main {
        padding: 15px;
    }
    .card-body {
        padding: 20px;
    }
    .card-header {
        padding: 15px 20px;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .dashboard-header {
        padding: 20px;
        text-align: center;
    }
    
    .table th,
    .table td {
        padding: 12px 15px;
    }
    
    .recent-activity .activity-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .dropdown-menu {
        min-width: 180px;
        right: 0 !important;
        left: auto !important;
    }
}

@media (max-width: 575.98px) {
    :root {
        --header-height: 60px;
        --sidebar-width: 100%;
    }
    body {
        padding-top: 60px;
    }
    
    .sidebar-profile-img {
        width: 60px;
        height: 60px;
    }
    
    .navbar-toggle-btn {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    main {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .sidebar .nav-link {
        padding: 10px 20px;
        margin: 4px 10px;
        font-size: 0.9rem;
    }
    
    .stats-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .chart-container {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .sidebar-toggle {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.1rem;
    }
    
    .dropdown-menu {
        min-width: 160px;
    }
    
    .dropdown-item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 12px;
    }
    
    .navbar-brand {
        font-size: 1rem;
        max-width: 150px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .sidebar-profile {
        padding: 20px 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .dropdown-menu {
        min-width: 140px;
    }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== TOUCH FRIENDLY ========== */
@media (hover: none) {
    .card:hover,
    .stats-card:hover,
    .chart-container:hover,
    .sidebar .nav-link:hover,
    .table tbody tr:hover,
    .btn:hover {
        transform: none;
    }
    
    .form-control:focus, .form-select:focus {
        transform: none;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .navbar, .sidebar, .sidebar-toggle {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .card, .stats-card, .chart-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .btn {
        display: none !important;
    }
}

/* Bootstrap dropdown override */
.dropdown-menu.show {
    display: block;
}

/* Ensure proper z-index */
.navbar-nav .dropdown-menu {
    z-index: 1021;
}

/* Smooth transitions for all interactive elements */
.navbar-toggle-btn,
.navbar-brand,
.nav-link,
.dropdown-item,
.user-avatar {
    transition: all 0.3s ease;
}