:root {
    --primary: #4e73df;
    --primary-light: #7a9ef8;
    --primary-dark: #2653d4;
    --secondary: #858796;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --light: #f8f9fc;
    --dark: #5a5c69;
    --sidebar-bg: #ffffff;
    --sidebar-text: #6e707e;
    --sidebar-active: #f8f9fc;
    --sidebar-hover: #eaecf4;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --body-bg: #f8f9fc;
    --border-color: #e3e6f0;
}

/* Base Styles */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--body-bg);
    color: var(--dark);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    position: relative;
}

.main {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s ease;
    margin-left: 250px;
    transition: all 0.3s ease;
    width: calc(100% - 250px);
}

.main.active {
	width: calc(100% - 80px);
    margin-left: 80px;
}

.content {
    padding: 20px;
    padding-top: 80px;
    overflow-x: hidden; /* Mencegah scroll horizontal */
    width: 100%;
    box-sizing: border-box;
}

.pagination {
    --pagination-color: #4e73df;
    --pagination-hover: #e9ecef;
    --pagination-active-bg: #4e73df;
    --pagination-active-border: #4e73df;
}

.page-item {
    margin: 0 3px;
}

.page-link {
    color: var(--pagination-color);
    border: 1px solid #dddfeb;
    border-radius: 4px !important;
    padding: 0.5rem 0.75rem;
    min-width: 38px;
    text-align: center;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: var(--pagination-hover);
    border-color: #dddfeb;
}

.page-item.active .page-link {
    background-color: var(--pagination-active-bg);
    border-color: var(--pagination-active-border);
}

.page-item.disabled .page-link {
    color: #b7b9cc;
    pointer-events: none;
    background-color: #fff;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s ease;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    bottom: 0;
}

.sidebar.active {
    width: 80px;
}

.sidebar.mobile-active {
    left: 0 !important;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 0.5rem;
    background: var(--sidebar-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--dark);
    white-space: nowrap;
}

.brand i {
    margin-right: 10px;
    color: var(--primary);
}

.sidebar.active .brand span:last-child,
.sidebar.active .menu-text,
.sidebar.active .logout-text {
    display: none;
}

.sidebar-menu {
    padding: 1rem 0;
    overflow-y: auto;
    height: calc(100vh - 180px);
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.2rem;
}

.sidebar-menu li a {
    padding: 0.75rem 1.5rem;
    display: block;
    color: var(--sidebar-text);
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sidebar-menu li a:hover {
    color: var(--primary);
    background-color: var(--sidebar-hover);
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li.active a {
    color: var(--primary);
    background-color: var(--sidebar-active);
    border-left: 3px solid var(--primary);
}

.sidebar.active .sidebar-menu li a {
    text-align: center;
    padding: 0.75rem 1rem;
}

.sidebar.active .sidebar-menu li a i {
    margin-right: 0;
    font-size: 1.2rem;
}

.sidebar.active .sidebar-menu li.active a {
    border-left: none;
    border-radius: 5px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem;
    background-color: var(--sidebar-active);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    min-width: 0;
}

.user-info img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
}

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

.user-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    color: var(--secondary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Top Navbar */
.navbar {
    height: 70px;
    padding: 0 20px;
    background-color: var(--header-bg) !important;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    position: fixed;
    top: 0;
    right: 0;
    left: 250px;
    z-index: 999;
    transition: all 0.3s ease;
}

.main.active .navbar {
    left: 80px;
}

.btn-toggle {
    background: transparent;
    border: none;
    color: var(--secondary);
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-toggle:hover {
    color: var(--primary);
}

.search-form {
    width: 300px;
    max-width: 100%;
}

.search-form .form-control {
    border-radius: 20px 0 0 20px;
    border-right: none;
    padding-left: 20px;
    background-color: var(--light);
    border-color: var(--border-color);
    min-width: 150px;
}

.search-form .btn-search {
    border-radius: 0 20px 20px 0;
    background-color: var(--light);
    border-color: var(--border-color);
    color: var(--secondary);
}

.notifications .btn-notification {
    background: transparent;
    border: none;
    color: var(--secondary);
    font-size: 1.2rem;
    position: relative;
    padding: 0.25rem 0.5rem;
}

.notifications .badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.4rem;
}

.user-dropdown .btn-user {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.user-dropdown img {
    width: 35px;
    height: 35px;
    margin-right: 10px;
    flex-shrink: 0;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.35rem;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    color: var(--dark);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    color: var(--secondary);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.2);
}

.card-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
}

.card-body {
    padding: 1.35rem;
}

.stat-card {
    border-left: 0.25rem solid var(--primary);
}

.stat-card .card-body {
    padding: 1rem;
}

.stat-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--secondary);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

/* Tables */
.table {
    color: var(--dark);
    margin-bottom: 0;
}

.table th {
    border-top: none;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: var(--light);
}

.badge {
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.35rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-view-all {
    background-color: transparent;
    color: var(--primary);
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-view-all:hover {
    color: var(--primary-dark);
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    font-weight: 600;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--secondary);
}

.breadcrumb-item.active {
    color: var(--primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '>';
    color: var(--secondary);
}

/* Todo List */
.todo-list {
    margin-bottom: 1rem;
}

.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.todo-item:last-child {
    border-bottom: none;
}

.form-check-label {
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
}

.form-check-input:checked + .form-check-label {
    color: var(--secondary);
    text-decoration: line-through;
}

.todo-date {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* Activity Feed */
.activity-feed {
    margin-bottom: 1rem;
}

.feed-item {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.feed-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feed-text {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.feed-time {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        left: -250px;
        z-index: 1001;
    }
    
    .sidebar.mobile-active {
        left: 0;
    }
    
    .main, .main.active {
        width: 100%;
        margin-left: 0;
    }
    
    .navbar {
        left: 0 !important;
    }
    
    .search-form {
        width: auto;
        flex-grow: 1;
        margin-left: 15px;
    }
    
    .notifications {
        margin-right: 0.5rem !important;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 15px;
        padding-top: 70px;
    }
    
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 0 10px;
    }
    
    .user-dropdown .btn-user span {
        display: none;
    }
    
    .search-form .form-control {
        min-width: 120px;
    }
    
    .page-link {
        padding: 0.35rem 0.5rem;
        min-width: 32px;
    }
    
    .page-item {
        margin: 0 1px;
    }
}