:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-info: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --primary-color: #0ea5e9;
    --secondary-color: #2563eb;
    --hover-bg: #f0f9ff;
    --ui-font: "Google Sans", "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--ui-font);
    background: #f8fafc;
    color: var(--dark);
    padding-bottom: 70px;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* Mobile Header */
.mobile-header {
    background: var(--gradient-primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Dropdown/menu - ensure good contrast */
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: none;
    min-width: 250px;
    background-color: #ffffff;
    color: #212529;
}

.dropdown-header {
    padding: 12px 16px;
    background-color: #f1f3f5;
    /* light gray header inside menu */
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: #212529;
    border-radius: 12px 12px 0 0;
    margin: -8px 0 0 0;
}

.dropdown-header .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
    background-color: #e9ecef;
    /* slightly darker than header */
    color: #495057 !important;
    /* dark icon */
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.dropdown-header .fw-bold {
    color: #212529;
}

.dropdown-header small {
    color: #495057;
    /* stronger muted color for role label */
    display: block;
    margin-top: 2px;
}

.dropdown-item {
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    margin: 8px 0;
}

/* Mobile header avatar override for contrast */
.mobile-header .user-avatar {
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Small responsive tweak: increase dropdown z-index on mobile to avoid clipping */
@media (max-width: 767.98px) {
    .dropdown-menu {
        z-index: 1200;
    }
}

/* Main Content */
.main-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
    min-height: calc(100vh - 140px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.5rem;
    transition: all 0.3s;
    flex: 1;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-fab {
    position: relative;
    top: -20px;
    background: var(--gradient-primary);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    flex: 0 0 auto;
}

.bottom-nav-fab i {
    font-size: 1.5rem;
    margin: 0;
}

.bottom-nav-fab:hover {
    color: white;
    transform: scale(1.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    padding: 1rem;
    font-size: 0.95rem;
}

.card-body {
    padding: 1rem;
}

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.user-avatar-36 {
    width: 36px;
    height:36px;
    text-align: center;
}

/* Gradient Cards */
.gradient-primary {
    background: var(--gradient-primary);
    color: white;
}

.gradient-success {
    background: var(--gradient-success);
    color: white;
}

.gradient-warning {
    background: var(--gradient-warning);
    color: white;
}

.gradient-danger {
    background: var(--gradient-danger);
    color: white;
}

.gradient-info {
    background: var(--gradient-info);
    color: white;
}

/* Buttons */
.btn {
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s;
}

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

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    padding: 0.75rem;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Tables - Mobile Optimized */
.table-responsive {
    /*    border-radius: 1rem;*/
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead {
    background: var(--gradient-primary);
    /*    color: white;*/
}

.table thead th {
    border: none;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Hide columns on mobile */
@media (max-width: 576px) {
    .table .hide-mobile {
        display: none;
    }
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Offcanvas Menu */
.offcanvas-body {
    padding: 0;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem 1.5rem;
    transition: all 0.3s;
}

.list-group-item:hover {
    background: #f9fafb;
    padding-left: 2rem;
}

.list-group-item i {
    width: 20px;
    text-align: center;
}

/* Page Headers */
h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    color: var(--dark);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 1.125rem;
}

/* Desktop Footer */
.desktop-footer {
    background: var(--dark);
    color: white;
    margin-top: 3rem;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .main-content {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Mobile-specific improvements */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn {
        width: auto;
    }
}