@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark);
    font-size: 14px;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}
.modern-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin: 30px 0;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    .page-box {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        padding: 0 15px;
        text-decoration: none;
        color: #555;
        background: #ffffff;
        border: 1px solid #ddd;
        border-radius: 8px; /* Sudut kotak rounded */
        font-weight: 600;
        font-size: 14px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .page-box:hover {
        background: #f8f9fa;
        border-color: #007bff;
        color: #007bff;
        transform: translateY(-2px);
    }

    .page-box.active {
        background: #007bff;
        color: white;
        border-color: #007bff;
        box-shadow: 0 4px 10px rgba(0,123,255,0.3);
    }

    .page-box.disabled {
        color: #ccc;
        pointer-events: none;
        background: #fdfdfd;
        border-color: #eee;
        box-shadow: none;
    }
.menu-label {
    padding: 10px 24px 5px;
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.menu-item i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.1rem;
    color: var(--secondary);
}

.menu-item:hover,
.menu-item.active {
    background: #eff6ff;
    color: var(--primary);
    border-left-color: var(--primary);
}

.menu-item:hover i,
.menu-item.active i {
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.btn-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
text-transform: uppercase !important;
}

.user-role {
    font-size: 0.75rem;
    color: var(--secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    object-fit: cover;
}

/* Content Area */
.content-wrapper {
    padding: 30px;
    flex: 1;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    border: none;
    font-size: 0.9rem;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--light);
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-danger {
    border: 1px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Ensure table doesn't squash too much */
}

.table th,
.table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--light);
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-end {
    justify-content: flex-end;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.w-100 {
    width: 100%;
}

.ml-auto {
    margin-left: auto;
}

.mr-2 {
    margin-right: 0.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end; 
}


.filter-item {
    flex: 1; 
    min-width: 200px; 
}

.filter-action {
    flex: 0 0 auto; 
    display: flex;
    gap: 8px;
}

/* Responsif untuk HP */
@media (max-width: 600px) {
    .filter-item {
        flex: 1 0 100%; 
    }
    .filter-action {
        width: 100%;
    }
    .filter-action .btn {
        flex: 1;
    }
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.bg-light {
    background: var(--light) !important;
}

.bg-transparent {
    background: transparent !important;
}

.shadow-none {
    box-shadow: none !important;
}

.p-0 {
    padding: 0 !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.rounded {
    border-radius: 0.375rem;
}

.small {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--secondary) !important;
}

.text-white {
    color: white !important;
}

.text-dark {
    color: var(--dark) !important;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.bg-primary {
    background-color: var(--primary) !important;
    color: white;
}

.bg-secondary {
    background-color: var(--secondary) !important;
    color: white;
}

.bg-success {
    background-color: var(--success) !important;
    color: white;
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 950;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsiveness */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .btn-toggle {
        display: block !important;
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 0 20px;
    }

    .content-wrapper {
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .user-info {
        display: none;
    }

    /* Hide user info name on mobile to save space, avatar remains */
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #dbeafe;
}

/* Stat Cards */
.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--primary);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--secondary);
    font-size: 0.9rem;
}