:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --bg: #f8fafc;
    --card: rgba(255, 255, 255, 0.78);
    --border: rgba(255, 255, 255, 0.45);
    --text: #0f172a;
    --muted: #64748b;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.08), transparent 30%),
        var(--bg);
    font-family: 'Segoe UI', sans-serif;
    color: var(--text);
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 24px 16px;
    position: sticky;
    top: 0;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 20px 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(59,130,246,0.25);
}

.brand-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

.menu-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin: 18px 10px 12px;
}

.sidebar a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    margin-bottom: 10px;
    transition: all 0.28s ease;
    font-weight: 500;
}

.sidebar a .menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.95;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
}

.sidebar a.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.35), rgba(6,182,212,0.28));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.navbar-modern {
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding: 18px 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.page-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.8);
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    font-size: 0.92rem;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.content-wrap {
    padding: 28px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.card-stat {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.card-stat::after {
    content: "";
    position: absolute;
    right: -10px;
    top: -10px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(37,99,235,0.07);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(6,182,212,0.12));
    color: var(--primary);
}

.card-stat h6 {
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.card-stat h2,
.card-stat h4 {
    margin: 0;
    font-weight: 800;
}

.section-title {
    font-weight: 700;
    margin-bottom: 18px;
    font-size: 1.1rem;
}

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid #dbe2ea;
    padding: 12px 14px;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12) !important;
}

.btn {
    border-radius: 14px;
    padding: 10px 16px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
}

.btn-success {
    border: none;
}

.btn-warning {
    border: none;
}

.btn-danger {
    border: none;
}

.table-modern {
    overflow: hidden;
    border-radius: 18px;
}

.table-modern table {
    margin-bottom: 0;
}

.table-modern thead th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    border-bottom: none;
}

.table-modern td,
.table-modern th {
    vertical-align: middle;
    padding: 14px 12px;
}

.preview-img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: 0.2s ease;
}

.preview-img:hover {
    transform: scale(1.04);
}

.alert {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow);
}

.badge {
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.quick-actions .btn {
    min-width: 180px;
}

@media (max-width: 991px) {
    .sidebar {
        min-height: auto;
        position: relative;
    }

    .content-wrap {
        padding: 18px;
    }

    .navbar-modern {
        padding: 16px 18px;
    }

    .quick-actions .btn {
        min-width: unset;
        width: 100%;
    }
}
/* ========================= */
/* MOBILE SIDEBAR (HAMBURGER) */
/* ========================= */

.sidebar {
    transition: transform 0.3s ease;
}

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        height: 100%;
        z-index: 999;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 998;
        display: none;
    }

    .overlay.show {
        display: block;
    }
}
@media (max-width: 991px) {
    .navbar-modern {
        padding-left: 16px;
        padding-right: 16px;
    }
}
/* ========================= */
/* RESPONSIVE IMPROVEMENT */
/* ========================= */

.container-fluid {
    overflow-x: hidden;
}

.content-wrap {
    padding: 24px;
}

.table-modern {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-modern table {
    min-width: 900px;
}

@media (max-width: 991px) {
    .content-wrap {
        padding: 16px;
    }

    .navbar-modern {
        padding: 16px;
        border-radius: 0 0 20px 20px;
    }

    .page-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }

    .user-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .card {
        border-radius: 18px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .btn {
        width: auto;
    }

    .btn-sm {
        padding: 8px 14px;
    }

    .table-modern table {
        min-width: 850px;
    }

    .preview-img {
        width: 80px;
        height: 60px;
    }
}

/* ========================= */
/* MOBILE USER CARD VIEW */
/* ========================= */

.user-mobile-card {
    display: none;
}

@media (max-width: 768px) {
    .desktop-user-table {
        display: none !important;
    }

    .user-mobile-card {
        display: block;
    }

    .mobile-user-item {
        background: rgba(255,255,255,0.85);
        border: 1px solid rgba(255,255,255,0.55);
        border-radius: 20px;
        padding: 18px;
        margin-bottom: 16px;
        box-shadow: var(--shadow);
    }

    .mobile-user-item .top {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 14px;
    }

    .mobile-user-item .meta {
        font-size: 0.92rem;
        color: var(--muted);
        margin-bottom: 6px;
    }

    .mobile-user-item .actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 14px;
    }

    .mobile-user-item .actions .btn {
        flex: 1;
        min-width: 120px;
    }

    .search-stack .btn {
        width: 100%;
    }

    .top-action-stack {
        flex-direction: column;
        align-items: stretch !important;
    }

    .top-action-stack a {
        width: 100%;
        text-align: center;
    }
}
/* ========================= */
/* PAGE TRANSITION */
/* ========================= */

.content-wrap {
    animation: fadeSlideIn 0.35s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}