/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: #f4f6f9;
}

.app {
    display: flex;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: visible;
}

.sidebar.hide {
    width: 70px;
}

/* LOGO */
.logo {
    padding: 22px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    color: #fff;
}

.logo-text {
    transition: 0.2s;
}

.auth-logo {
    width: 80px;
    margin-bottom: 20px;

    /* efek elegan */
    border-radius: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.15);

    /* glass effect */
    backdrop-filter: blur(6px);

    /* shadow halus */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* MENU */
.sidebar ul {
    list-style: none;
    margin-top: 10px;
}

.sidebar ul li {
    margin: 5px 10px;
}

/* LINK */
.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #cbd5f5;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
}

/* ICON */
.sidebar ul li a i {
    font-size: 18px;
    min-width: 20px;
    text-align: center;
}

/* TEXT */
.menu-text {
    white-space: nowrap;
    transition: 0.2s;
}

/* HOVER */
.sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar.hide ul li a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 80px;
    background: #111;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* ACTIVE MENU */
.sidebar ul li a.active {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
}

/* GARIS INDIKATOR KIRI */
.sidebar ul li a.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: #3b82f6;
    border-radius: 4px;
}

/* ICON ACTIVE */
.sidebar ul li a.active i {
    color: #3b82f6;
}

/* HOVER (BIAR MATCH) */
.sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* COLLAPSE MODE */
.sidebar.hide .menu-text,
.sidebar.hide .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.hide ul li a {
    justify-content: center;
}

/* NAV RIGHT */
.nav-right {
    margin-left: auto;
}

/* USER BOX */
.user-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* USER INFO */
.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: #888;
}

/* AVATAR */
.user-avatar {
    width: 35px;
    height: 35px;
    background: #3b82f6;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* HEADER UPGRADE */
.header {
    background: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* LEFT */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* BUTTON */
.menu-btn {
    border: none;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

/* USER */
.user-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: 0.2s;
}

.user-trigger:hover {
    background: #f1f5f9;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: #888;
}

/* AVATAR */
.user-avatar {
    width: 38px;
    height: 38px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* DROPDOWN */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 55px;
    width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    padding: 10px 0;
    display: none;
    z-index: 9999;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
}

.dropdown-header small {
    color: #888;
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.dropdown-item {
    width: 100%;
    padding: 10px 15px;
    background: none;
    border: none;
    display: flex;
    gap: 10px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f9fafb;
}

.dropdown-item.logout {
    color: #ef4444;
}

/* LOGOUT */
.logout-btn {
    border: none;
    background: #ef4444;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}

/* CARD HEADER */
.users-card {
    padding: 0;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 20px;
}

.total {
    font-size: 13px;
    color: #888;
}

/* TABLE WRAPPER */
.table-wrapper {
    overflow-x: auto;
}

/* TABLE MODERN */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead {
    background: #fafafa;
}

.table-modern th {
    padding: 15px 20px;
    font-size: 13px;
    color: #888;
    text-align: left;
}

.table-modern td {
    padding: 18px 20px;
    border-top: 1px solid #f1f1f1;
    font-size: 14px;
}

/* ROW HOVER */
.table-modern tbody tr:hover {
    background: #f9fafb;
}

.table {
    width: 100%;
    min-width: 500px;
    /* biar tidak gepeng */
}

/* NAME */
.name {
    font-weight: 500;
}

/* EMAIL */
.email {
    color: #666;
}

/* ROLE BADGE */
.badge-role {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* ROLE COLOR */
.badge-role.member {
    background: #ecfdf5;
    color: #059669;
}

.badge-role.user {
    background: #eff6ff;
    color: #2563eb;
}

.badge-role.admin {
    background: #fef2f2;
    color: #dc2626;
}

/* DELETE BUTTON */
.btn-delete {
    background: #fee2e2;
    border: none;
    color: #dc2626;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-delete:hover {
    background: #fecaca;
}

/* CENTER */
.text-center {
    text-align: center;
}

/* ================= MAIN ================= */
.main {
    margin-left: 250px;
    width: 100%;
    transition: margin-left 0.3s ease;
    position: relative;
    z-index: 1;
}

.main.full {
    margin-left: 70px;
}

/* HEADER */
.header {
    background: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
}

/* HEADER ACTION */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* BUTTON TAMBAH */
.btn-primary-add {
    background: #3b82f6;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.btn-primary-add:hover {
    background: #2563eb;
}

/* STATUS BADGE */
.badge-status {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* ACTIVE */
.badge-status.active {
    background: #ecfdf5;
    color: #059669;
}

/* INACTIVE */
.badge-status.inactive {
    background: #fef2f2;
    color: #dc2626;
}

/* CONTENT */
.content {
    padding: 20px;
}

/* ================= COMPONENT ================= */

/* CARD */
.card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* BUTTON */
.btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

/* BADGE */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    color: #fff;
}

.badge-success {
    background: #22c55e;
}

.badge-primary {
    background: #3b82f6;
}

/* ================= DASHBOARD ================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 16px;
    color: #fff;

    /* 🔥 DEPTH */
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.05);

    /* SMOOTH */
    transition: all 0.25s ease;
    backdrop-filter: blur(6px);
}

/* HOVER HALUS */
.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.08);
}

.dashboard-card h2 {
    font-size: 32px;
    font-weight: 600;
}

.dashboard-card p {
    font-size: 14px;
    opacity: 0.85;
}

.card-icon {
    font-size: 26px;
    opacity: 0.9;
}

/* ICON BULAT SOFT */
.card-icon i {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px;
    border-radius: 10px;
}

/* COLOR */
.blue {
    background: linear-gradient(135deg, #4f8dfd, #3b82f6);
}

.green {
    background: #22c55e;
}

.orange {
    background: #f97316;
}

.purple {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.teal {
    background: #14b8a6;
}

.pink {
    background: #ec4899;
}

/* BOTTOM */
/* BOTTOM SECTION */
.dashboard-bottom {
    margin-top: 30px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.activity-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    overflow-x: auto;
}

/* MODAL BACKDROP */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

/* CONTENT */
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 14px;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

/* HEADER */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* BODY */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-body input,
.modal-body select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* BUTTON */
.btn-submit {
    background: #3b82f6;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-text {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4f46e5;
    /* warna default */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* container avatar */
.avatar-wrapper {
    width: 42px;
    height: 42px;
    position: relative;
}

/* paksa semua img dalam avatar */
.avatar-wrapper img {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* fallback huruf */
.avatar-fallback {
    width: 42px;
    height: 42px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 600;
    color: white;

    position: absolute;
    top: 0;
    left: 0;

    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* biar tabel rapi */
td {
    vertical-align: middle;
}

/* ANIMATION */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================= RESPONSIVE ================= */

/* ================= MOBILE SIDEBAR ================= */
@media (max-width: 768px) {

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 250px;
        height: 100%;
        z-index: 9999;
        transition: 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    /* BACKDROP */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9998;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }



    /* MAIN FULL */
    .main {
        margin-left: 0 !important;
    }

    .content {
        padding: 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}
