:root {
    /* Refined Color Palette - Professional & Harmonious */
    --primary-color: #1a3a3a;
    --primary-hover: #2c5252;
    --primary-light: rgba(26, 58, 58, 0.05);

    --success-color: #2fb344;
    --success-light: rgba(47, 179, 68, 0.1);

    --danger-color: #d63939;
    --danger-light: rgba(214, 57, 57, 0.1);

    --warning-color: #f7b000;
    --warning-light: rgba(247, 176, 0, 0.1);

    --info-color: #206bc4;
    --info-light: rgba(32, 107, 196, 0.1);

    --light-bg: #f8fafc;
    --lighter-bg: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 76px;
    --navbar-height: 70px;
    --transition-speed: 0.25s;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR STYLES - Sticky Collapsible
   ============================================ */
.sidebar-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-right: 1px solid var(--border-color);
    z-index: 1030;
    transition: width var(--transition-speed) ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
    /* Remove hidden to allow scripts to work better */
}

.sidebar-nav.collapsed,
.sidebar-is-collapsed .sidebar-nav {
    width: var(--sidebar-collapsed-width);
}

.sidebar-is-collapsed .sidebar-brand .sidebar-text,
.sidebar-is-collapsed .sidebar-link .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-is-collapsed .sidebar-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 12px 0;
}


.sticky-action {
    position: sticky;
    right: 0;
    background: white;
    z-index: 2;
}


/* Toggle Button */
.sidebar-toggle-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.sidebar-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.sidebar-toggle-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 15px 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 1px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Brand */
.sidebar-brand {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/*.sidebar-brand .sidebar-icon {
    font-size: 24px;
    min-width: 30px;
    transition: all var(--transition-speed) ease;
}*/

.sidebar-brand sidebar-text {
    font-size: 15px;
    font-weight: 700;
}

.sidebar-nav.collapsed .sidebar-brand .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Sidebar Links */
.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-links li {
    margin: 5px 0;
}

.sidebar-link {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}


.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-brand .sidebar-icon {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-link .sidebar-text {
    margin-left: 15px;
    opacity: 1;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-nav.collapsed .sidebar-link .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav.collapsed .sidebar-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 12px 0;
}

/* ============================================
   TOP NAVBAR
   ============================================ */
.top-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: linear-gradient(90deg, #ffffff 0%, #f9fafb 100%);
    border-bottom: 1px solid var(--border-color);
    z-index: 1020;
    transition: left var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sidebar-nav.collapsed~.top-navbar {
    left: var(--sidebar-collapsed-width);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 30px;
}

.navbar-left .page-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: -0.02em;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-time {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Toggle Button (Navbar) */
.mobile-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-toggle-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.mobile-toggle-btn i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .mobile-toggle-btn {
        display: flex;
    }
}

.navbar-user {
    display: flex;
    align-items: center;
    color: var(--text-dark);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.navbar-user:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
}

.user-dropdown {
    min-width: 250px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 0;
    margin-top: 10px;
}

.user-dropdown .dropdown-item {
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.user-dropdown .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    padding: 30px;
    min-height: calc(100vh - var(--navbar-height) - 60px);
    transition: margin-left var(--transition-speed) ease;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
    margin-left: var(--sidebar-width);
    padding: 20px 30px;
    background: var(--lighter-bg);
    border-top: 1px solid var(--border-color);
    text-align: center;
    transition: margin-left var(--transition-speed) ease;
}

.main-content.sidebar-collapsed~.app-footer {
    margin-left: var(--sidebar-collapsed-width);
}

.footer-divider {
    margin: 0 10px;
    color: var(--border-color);
}

/* ============================================
   LOGIN WRAPPER (No Sidebar)
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    padding: 20px;
}

/*.login-wrapper .card {
    max-width: 450px;
    width: 100%;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}*/

.login-wrapper .card-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%) !important;
    color: white;
    padding: 2rem;
    border-bottom: none;
}

.login-wrapper .card-body {
    padding: 2rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card:hover {
    /*transform: translateY(-4px);*/
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    font-weight: 700;
    padding: 1rem 1.5rem;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 10px;
    padding: 0.6rem 1.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    /*transform: translateY(-2px);*/
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #317048 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background-color: var(--light-bg);
    color: var(--text-dark);
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--light-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    color: var(--text-dark);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* ============================================
   TABLES - Redesigned for Alignment & Clarity
   ============================================ */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    /* Changed from auto to hidden to let table-responsive handle it */
    margin-bottom: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table.text-nowrap th,
.table.text-nowrap td {
    white-space: nowrap !important;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

.table thead th {
    background: var(--light-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    color: var(--text-dark);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background-color: var(--primary-light);
}

/* Specific Cell Alignments */
.text-trim {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-trim-2 {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   BADGES - Refined Modern Style
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.7rem;
    line-height: 1;
    text-transform: capitalize;
}

.bg-success {
    background-color: var(--success-light) !important;
    color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-light) !important;
    color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-light) !important;
    color: var(--warning-color) !important;
}

.bg-info {
    background-color: var(--info-light) !important;
    color: var(--info-color) !important;
}

.bg-primary {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    animation: slideInDown 0.4s ease;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--lighter-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ============================================
   RESPONSIVE DESIGN - Enhanced for all screen sizes
   ============================================ */

/* Intermediate screens (e.g., small laptops, tablets) */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 76px;
    }

    .sidebar-text {
        display: none;
    }

    .sidebar-nav {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .top-navbar {
        left: var(--sidebar-width);
    }
}

/* Specific fix for ~800px as requested by user */
@media (max-width: 820px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-right .navbar-time {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar-nav {
        transform: translateX(-100%);
        width: 280px;
        z-index: 2000;
        box-shadow: none;
        position: fixed;
    }

    .sidebar-nav.show {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar-toggle-btn {
        display: none !important;
        /* Hide collapse btn on mobile, use menu toggle instead */
    }

    .top-navbar {
        left: 0 !important;
        padding-left: 0;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 15px;
    }

    .app-footer {
        margin-left: 0 !important;
    }

    .navbar-content {
        padding: 0 15px;
    }

    .page-title {
        font-size: 16px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navbar-right {
        gap: 10px;
    }

    .navbar-time,
    .navbar-divider {
        display: none !important;
    }

    /* Backdrop for mobile sidebar */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1045;
        display: none;
        backdrop-filter: blur(2px);
    }

    .sidebar-backdrop.show {
        display: block;
    }
}

/* ============================================
   ADDITIONAL UTILITY CLASSES
   ============================================ */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}


.dropdown-submenu {
    position: relative;
}

/* Desktop & tablet: open on left */
@media (min-width: 576px) {
    .dropdown-submenu > .dropdown-menu {
        top: 0;
        right: 100%;
        left: auto;
        min-width: 220px;
        max-width: 300px;
        white-space: normal;       /* allow wrapping */
        word-break: break-word;
        display: none;
    }

    .dropdown-submenu.show > .dropdown-menu {
        display: block;
    }
}

/* Mobile: stack submenu below */
@media (max-width: 575.98px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;          /* IMPORTANT */
        float: none;
        width: 100%;
        max-width: 100%;
        margin-top: .25rem;
        box-shadow: none;
        display: none;
    }

    .dropdown-submenu.show > .dropdown-menu {
        display: block;
    }
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    --light-bg: #0f172a;
    --lighter-bg: #020617;
    --card-bg: #020617;
    --text-dark: #e5e7eb;
    --text-muted: #9ca3af;
    --border-color: #1e293b;
    --primary-color: #215e37;
    --primary-hover: #30784a;
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}

    /* Global dark fixes */
    [data-theme="dark"] body {
        background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    }

    [data-theme="dark"] .sidebar-nav,
    [data-theme="dark"] .top-navbar,
    [data-theme="dark"] .card,
    [data-theme="dark"] .user-dropdown {
        background: #020617;
        border-color: #1e293b;
    }

    [data-theme="dark"] .sidebar-link:hover,
    [data-theme="dark"] .dropdown-item:hover {
        background: rgba(34, 197, 94, 0.15);
    }

    [data-theme="dark"] .table thead {
        background: #020617;
    }

    [data-theme="dark"] .alert {
        box-shadow: none;
    }

    /* ============================================
   DARK THEME – TABLE FIXES
   ============================================ */
    [data-theme="dark"] .table {
        color: var(--text-dark);
    }

        [data-theme="dark"] .table thead th {
            color: var(--text-dark);
            background-color: #020617 !important;
            border-color: var(--border-color);
        }

        [data-theme="dark"] .table tbody td {
            color: var(--text-dark);
        }

    [data-theme="dark"] .table-hover tbody tr:hover {
        background-color: rgba(34, 197, 94, 0.08);
    }

    [data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
        background-color: rgba(255, 255, 255, 0.03);
    }

    /* Neutralize bg-light in dark mode */
    [data-theme="dark"] .bg-light {
        background-color: #020617 !important;
        color: var(--text-dark) !important;
    }

    [data-theme="dark"] .card {
        background-color: var(--card-bg);
        color: var(--text-dark);
    }

    [data-theme="dark"] .card-header {
        background-color: #020617;
        border-bottom: 1px solid var(--border-color);
    }

    [data-theme="dark"] .badge {
        color: #fff;
    }

    [data-theme="dark"] a.text-info {
        color: #60a5fa !important;
    }

    /* ============================================
   DARK THEME – LIST GROUP
   ============================================ */
    [data-theme="dark"] .list-group-item {
        color: var(--text-dark);
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }

        /* Hover state */
        [data-theme="dark"] .list-group-item:hover {
            background-color: rgba(34, 197, 94, 0.12);
        }

        /* Active item */
        [data-theme="dark"] .list-group-item.active {
            background: linear-gradient( 135deg, var(--primary-color) 0%, var(--primary-hover) 100% );
            border-color: var(--primary-color);
            color: #ffffff;
        }

        /* Disabled item */
        [data-theme="dark"] .list-group-item.disabled,
        [data-theme="dark"] .list-group-item:disabled {
            background-color: #020617;
            color: var(--text-muted);
        }

    [data-theme="dark"] .modal-content {
        color: var(--card-bg);
        background-color: var(--text-muted);
        border-color: var(--border-color);
    }

   

    /* ============================================
   DARK THEME – DROPDOWN FIX (MISSING)
   ============================================ */

    [data-theme="dark"] .dropdown-menu {
        background-color: var(--card-bg);
        border-color: var(--border-color);
    }

    [data-theme="dark"] .dropdown-item {
        color: var(--text-dark) !important;
    }

    [data-theme="dark"] .dropdown-item-text {
        color: var(--text-dark) !important;
    }

    [data-theme="dark"] .dropdown-item-text .fw-bold {
            color: var(--text-dark) !important;
    }

    [data-theme="dark"] .dropdown-item-text small,
    [data-theme="dark"] .dropdown-item-text .text-muted {
            color: var(--text-muted) !important;
    }

        /* Hover */
        [data-theme="dark"] .dropdown-item:hover,
        [data-theme="dark"] .dropdown-item:focus {
            background-color: rgba(34, 197, 94, 0.15);
            color: var(--text-dark) !important;
        }

        /* Active */
        [data-theme="dark"] .dropdown-item.active,
        [data-theme="dark"] .dropdown-item:active {
            background: linear-gradient( 135deg, var(--primary-color) 0%, var(--primary-hover) 100% );
            color: #ffffff !important;
        }

    /* Divider */
    [data-theme="dark"] .dropdown-divider {
        border-color: var(--border-color);
    }

    [data-theme="dark"] .form-check-label {
        color: var(--text-dark);
    }
    [data-theme="dark"].form-control,
    .form-select {
        border-radius: 10px;
        border: 2px solid var(--border-color);
        background-color: var( --card-bg);
        color: var(--text-light);
        padding: 0.6rem 1rem;
        transition: all 0.3s ease;
    }
    .form-switch .form-check-input {
        width: 4em;
        height: 1.5em;
    }
.form-check-input:checked {
    background-color: #30784a;
    border-color: #30784a;
}
.form-check-input:focus {
    border-color: #30784a;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(48, 120, 74, .25);
}

.navbar-user img {
    transition: transform 0.2s ease;
}

.navbar-user:hover img {
    transform: scale(1.05);
}

.profile-avatar {
    border: 2px solid #ddd;
}

.edit-avatar {
    position: absolute;
    bottom: 12px;
    right: 50%;
    transform: translateX(50%);
    background: #000;
    color: #fff;
    border-radius: 50%;
    padding: 6px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-user:hover .edit-avatar {
    opacity: 1;
}

.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}
.cropper-wrapper {
    width: 100%;
    height: 70vh; 
    min-height: 400px;
    background: #444;
}


/*inhence styling */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    height: 100%;
    text-decoration: none;
}

.stat-card .card-body {
    display: flex;
    flex-direction: row;
    justify-content: center;
    text-align: center;
    min-height: 120px;
}

/* Font sizing (responsive + consistent) */
.stat-title {
    font-size: clamp(0.75rem, 1vw, 0.85rem);
    color: #6c757d;
    margin-bottom: 0.25rem;
    /* Trim text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.1;
}

.stat-sub {
    font-size: clamp(0.65rem, 0.9vw, 0.75rem);
    color: #6c757d;
    /* Trim text on small space */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}