@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette Istiqlal Green */
    --primary: #0b5e4e;
    --primary-dark: #064e3b;
    --primary-light: #10b981;
    --primary-soft: #d1fae5;
    --primary-ultra-light: #ecfdf5;
    --secondary: #2dd4bf;
    --secondary-dark: #14b8a6;
    --success: #059669;
    --success-dark: #047857;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --white: #ffffff;
    
    /* Gradients Istiqlal Green */
    --gradient-primary: linear-gradient(135deg, #0b5e4e 0%, #10b981 100%);
    --gradient-primary-hover: linear-gradient(135deg, #064e3b 0%, #0b5e4e 100%);
    --gradient-secondary: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-bg: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.16);
    --shadow-hover: 0 10px 30px rgba(11, 94, 78, 0.25);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    color: var(--dark);
    min-height: 100vh;
}

/* ==================== SIDEBAR ISTIQLAL GREEN ==================== */
.main-sidebar {
    background: linear-gradient(180deg, #064e3b 0%, #0b5e4e 100%) !important;
    box-shadow: var(--shadow-xl);
}

.brand-link {
    background: linear-gradient(135deg, #0b5e4e 0%, #059669 100%);
    border-bottom: none !important;
    padding: 1rem 1rem;
}

.brand-link .brand-text {
    font-weight: 700;
    font-size: 1rem;
    color: white;
    letter-spacing: 1px;
}

.brand-image {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-panel {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem !important;
}

.user-panel .info a {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.user-panel .info small {
    font-size: 0.7rem;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.9);
}

.nav-sidebar .nav-item .nav-link {
    padding: 0.7rem 1rem;
    margin: 0.2rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.85);
}

.nav-sidebar .nav-item .nav-link:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: translateX(8px);
    color: white;
}

.nav-sidebar .nav-item .nav-link.active {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
    color: white;
}

.nav-sidebar .nav-item .nav-link i {
    width: 28px;
    font-size: 1rem;
}

.nav-header {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    padding: 1rem 1rem 0.5rem !important;
}

/* ==================== NAVBAR ==================== */
.main-header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--primary);
}

.main-header .nav-link {
    color: var(--gray);
    transition: all 0.3s ease;
    margin: 0 4px;
    border-radius: var(--radius-sm);
}

.main-header .nav-link:hover {
    color: var(--primary);
    background: rgba(11, 94, 78, 0.08);
    transform: translateY(-2px);
}

/* ==================== CARD ==================== */
.card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: var(--white);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    background: white;
    border-bottom: 2px solid #f0fdf4;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger {
    background: var(--gradient-primary) !important;
    color: white;
    border: none;
}

/* ==================== SMALL BOX (DASHBOARD STATS) ==================== */
.small-box {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.small-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.small-box .inner {
    padding: 1.2rem;
}

.small-box .inner h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: white;
}

.small-box .inner p {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.small-box .icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    opacity: 0.25;
    color: white;
}

.small-box.bg-info {
    background: var(--gradient-primary) !important;
}

.small-box.bg-success {
    background: var(--gradient-success) !important;
}

.small-box.bg-warning {
    background: var(--gradient-warning) !important;
}

.small-box.bg-danger {
    background: var(--gradient-danger) !important;
}

.small-box .small-box-footer {
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.05);
}

.small-box .small-box-footer:hover {
    color: white;
    background: rgba(0, 0, 0, 0.1);
}

/* ==================== TABLE ==================== */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: none;
    padding: 1rem 0.8rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 100%);
    transform: scale(1.01);
}

.table tbody td {
    padding: 0.8rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0fdf4;
}

/* ==================== BUTTON ==================== */
.btn {
    border-radius: var(--radius-md);
    padding: 0.55rem 1.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-success {
    background: var(--gradient-success);
    border: none;
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: var(--gradient-danger);
    border: none;
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: var(--gradient-warning);
    border: none;
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    border: none;
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.3);
}

/* ==================== MODAL ==================== */
.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.2rem 1.5rem;
}

.modal-header .btn-close {
    background: none;
    font-size: 1.5rem;
    color: white;
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* ==================== FORM ==================== */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 2px solid #e2e8f0;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 94, 78, 0.15);
    background: white;
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--dark);
}

/* ==================== BADGE ==================== */
.badge {
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

.badge-primary,
.badge-success,
.badge-info {
    background: var(--gradient-primary);
    color: white;
}

.badge-warning {
    background: var(--gradient-warning);
    color: white;
}

.badge-danger {
    background: var(--gradient-danger);
    color: white;
}

/* ==================== ALERT ==================== */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.2rem;
}

.alert-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--success);
    color: var(--success-dark);
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid var(--warning);
    color: #b45309;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid var(--danger);
    color: #b91c1c;
}

.alert-info {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid var(--primary);
    color: var(--primary-dark);
}

/* ==================== UPLOAD AREA ==================== */
.upload-area {
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #ffffff 100%);
    transform: scale(1.01);
}

/* ==================== STATS CARD ==================== */
.stats-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
}

.stats-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.stats-number {
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stats-label {
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.stats-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    color: var(--primary);
    opacity: 0.5;
}

/* ==================== PROGRESS BAR ==================== */
.progress {
    border-radius: 20px;
    background: #e2e8f0;
    height: 10px;
}

.progress-bar {
    background: var(--gradient-primary);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

/* ==================== PAGINATION ==================== */
.page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary);
}

.page-link {
    color: var(--primary);
    border-radius: var(--radius-sm);
    margin: 0 4px;
}

.page-link:hover {
    color: var(--primary-dark);
    background: rgba(11, 94, 78, 0.1);
}

/* ==================== DROPDOWN ==================== */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:active,
.dropdown-item:hover {
    background: var(--gradient-primary);
    color: white;
}

/* ==================== NAV TABS ==================== */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--gray);
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    transition: all 0.3s;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
}

/* ==================== ANIMATION ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.content-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

.card {
    animation: slideInLeft 0.5s ease-out;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .small-box .inner h3 {
        font-size: 1.5rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .card-header {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
    }
}

/* ==================== WELCOME CARD ==================== */
.welcome-card {
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-card::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* ==================== NOTIFICATION BADGE ==================== */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* ==================== PRINT STYLE ==================== */
@media print {
    .main-sidebar, .main-header, .footer, .btn, .card-header .btn-tool {
        display: none !important;
    }
    .content-wrapper {
        margin-left: 0 !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}