/* =====================================================
   MLM Admin Panel - Custom Styles
   Modern Material Design with Light/Dark Theme
   ===================================================== */

:root {
    /* Light Theme Colors */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Light Theme */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-topbar: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #e2e8f0;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Sidebar Width */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 70px;
    
    /* Transitions */
    --transition-speed: 0.3s;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-topbar: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-sidebar: #e2e8f0;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-speed);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* =====================================================
   Layout Structure
   ===================================================== */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: var(--topbar-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 22px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-toggle i {
    transition: transform var(--transition-speed);
}

.sidebar.collapsed .sidebar-toggle {
    position: absolute;
    right: -16px;
    top: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: var(--shadow);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 80px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-sidebar);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-speed);
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: white;
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-link .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-link .nav-text {
    flex: 1;
    overflow: hidden;
}

.nav-link .nav-badge {
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    overflow: hidden;
}

.sidebar-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar.collapsed .user-info {
    display: none;
}

/* =====================================================
   Main Content Area
   ===================================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    transition: margin-left var(--transition-speed), max-width var(--transition-speed);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
    max-width: calc(100vw - var(--sidebar-collapsed-width));
}

/* Topbar Styles */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

.breadcrumb-wrapper {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Box */
.search-box {
    position: relative;
    margin-right: 16px;
}

.search-box input {
    width: 280px;
    height: 42px;
    padding: 0 16px 0 44px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-speed);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* Topbar Icons */
.topbar-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--bg-body);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-speed);
}

.topbar-icon:hover {
    background: var(--primary-color);
    color: white;
}

.topbar-icon .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
    border: 2px solid var(--bg-topbar);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all var(--transition-speed);
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* User Dropdown */
.user-dropdown {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-body);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 1px solid var(--border-color);
}

.user-dropdown:hover {
    border-color: var(--primary-color);
}

.user-dropdown .avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

.user-dropdown .user-info {
    line-height: 1.3;
}

.user-dropdown .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown .user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* =====================================================
   Page Content
   ===================================================== */

.page-content {
    padding: 24px;
    overflow-x: hidden;
    max-width: 100%;
}

/* Page Header */
.page-header h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header p {
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-speed);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: all var(--transition-speed);
}

.stat-card .stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-card .stat-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-card .stat-icon.info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.1;
}

.stat-card .stat-change {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-change.positive {
    color: var(--success-color);
}

.stat-card .stat-change.negative {
    color: var(--danger-color);
}

/* Member View Stat Cards - Compact horizontal */
.member-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    transition: all var(--transition-speed);
}

.member-stat-card:hover {
    box-shadow: var(--shadow);
}

.member-stat-card .stat-icon-sm {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.member-stat-card .stat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.member-stat-card .stat-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-stat-card .stat-title {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Background light colors */
.bg-primary-light { background: rgba(99, 102, 241, 0.1); }
.bg-success-light { background: rgba(34, 197, 94, 0.1); }
.bg-warning-light { background: rgba(245, 158, 11, 0.1); }
.bg-danger-light { background: rgba(239, 68, 68, 0.1); }
.bg-info-light { background: rgba(6, 182, 212, 0.1); }
.bg-secondary-light { background: rgba(100, 116, 139, 0.1); }

/* Text colors */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-purple { color: #8b5cf6 !important; }

/* Business Volume Cards */
.bv-card {
    background: var(--bg-body);
    border-radius: 10px;
    padding: 12px 8px;
}

.bv-card .bv-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.bv-card .bv-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Member Profile Avatar */
.member-avatar {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* Account Control Toggle List */
.control-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-body);
    border-radius: 10px;
    gap: 10px;
}

.control-toggle-item .fw-500 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.control-toggle-item small {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    line-height: 1.3;
}

.control-toggle-item i {
    font-size: 16px;
    flex-shrink: 0;
}

.control-toggle-item .form-check-input {
    width: 40px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
}

.control-toggle-item .form-check-input:checked {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.control-toggle-item .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
}

.control-toggle-item .d-flex {
    min-width: 0;
    flex: 1;
}

.control-toggle-item .d-flex > div {
    min-width: 0;
    overflow: hidden;
}

/* Quick Actions */
.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.quick-action-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-action-card .action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.quick-action-card .action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin: 0;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-body);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Compact Table Variant */
.data-table.compact th {
    padding: 8px 10px;
    font-size: 10px;
}

.data-table.compact td {
    padding: 8px 10px;
    font-size: 12px;
}

.data-table.compact .user-cell .avatar {
    width: 28px;
    height: 28px;
}

.data-table.compact .user-cell .user-info .name {
    font-size: 12px;
}

.data-table.compact .user-cell .user-info .email {
    font-size: 10px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-body);
}

/* Compact user cell for tables */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell .avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.user-cell .user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.user-cell .user-info .email {
    font-size: 11px;
    color: var(--text-muted);
}

/* Mobile table card style */
.table-mobile-card {
    display: none;
}

/* Responsive column visibility */
.table-col-hide-sm { display: table-cell; }
.table-col-hide-md { display: table-cell; }
.table-col-hide-lg { display: table-cell; }

/* Nav Tabs Responsive */
.nav-tabs.card-header-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

/* Card header search and filter inputs */
.search-input {
    min-width: 150px;
    max-width: 200px;
}

.filter-select {
    min-width: 120px;
    max-width: 150px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-badge.blocked {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Action Badges for History */
.action-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.action-badge.created { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.action-badge.approved { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.action-badge.rejected { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.action-badge.edited { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.action-badge.deleted { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.action-badge.remarks { background: rgba(168, 85, 247, 0.1); color: #a855f7; }

/* Table Row Highlights */
.table-success-light { background: rgba(34, 197, 94, 0.05) !important; }
.table-warning-light { background: rgba(245, 158, 11, 0.05) !important; }
.table-danger-light { background: rgba(239, 68, 68, 0.05) !important; }
.table-info-light { background: rgba(6, 182, 212, 0.05) !important; }

/* User Avatar in Table */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell .avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.user-cell .user-info .name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-cell .user-info .email {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chart Card */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    min-height: 200px;
}

.chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* Chart responsive wrapper */
.chart-responsive {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Progress Bars */
.progress-custom {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-body);
    overflow: hidden;
}

.progress-custom .progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Activity List */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.activity-item .activity-content {
    flex: 1;
}

.activity-item .activity-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.activity-item .activity-text strong {
    font-weight: 600;
}

.activity-item .activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Dropdown Menu */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
}

.dropdown-item {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-speed);
}

.dropdown-item:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 20px;
    color: var(--text-muted);
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 8px 0;
}

/* =====================================================
   Auth Pages
   ===================================================== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 48px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 15px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-form .form-control {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-speed);
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-form .input-group {
    position: relative;
}

.auth-form .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.auth-form .input-group .form-control {
    padding-left: 48px;
}

.auth-form .password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.auth-form .form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-form .form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.auth-form .form-check-input:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.auth-form .form-check-label {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-form .forgot-link {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

.auth-form .forgot-link:hover {
    text-decoration: underline;
}

.auth-form .btn-auth {
    width: 100%;
    height: 50px;
    font-size: 16px;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Social Login */
.social-login {
    margin-top: 24px;
}

.social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.social-divider span {
    font-size: 13px;
    color: var(--text-muted);
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.btn-social {
    flex: 1;
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-social:hover {
    background: var(--bg-body);
    border-color: var(--primary-color);
}

/* =====================================================
   Responsive Styles
   ===================================================== */

/* Extra Large Devices (Large Desktops) */
@media (max-width: 1400px) {
    .search-box input {
        width: 220px;
    }
    
    .stat-card .stat-value {
        font-size: 26px;
    }
    
    .chart-container {
        height: 280px;
    }
}

/* Large Devices (Desktops) */
@media (max-width: 1200px) {
    .search-box input {
        width: 180px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
    
    .quick-action-card .action-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .chart-container {
        height: 260px;
    }
    
    .table-col-hide-lg {
        display: none;
    }
}

/* Medium Devices (Tablets) */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px !important;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.collapsed {
        width: 280px !important;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0) !important;
    }
    
    .sidebar.active.collapsed {
        transform: translateX(0) !important;
    }
    
    .sidebar-toggle {
        display: none !important;
    }
    
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .nav-badge,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .user-info {
        display: block !important;
        opacity: 1 !important;
    }
    
    .sidebar.collapsed .nav-link {
        justify-content: flex-start !important;
        padding: 12px 16px !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }
    
    .mobile-toggle {
        display: flex !important;
    }
    
    .search-box {
        display: none !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
    
    .sidebar-overlay.active {
        display: block !important;
    }
    
    .topbar-right {
        gap: 4px;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-header .d-flex {
        width: 100%;
    }
    
    .card-header input,
    .card-header select {
        flex: 1;
    }
    
    /* Table Responsive */
    .data-table {
        font-size: 12px;
        min-width: 400px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .user-cell {
        gap: 8px;
    }
    
    .user-cell .avatar {
        width: 30px;
        height: 30px;
        border-radius: 6px;
    }
    
    .user-cell .user-info .name {
        font-size: 12px;
    }
    
    .user-cell .user-info .email {
        font-size: 10px;
    }
    
    .status-badge {
        padding: 2px 8px;
        font-size: 10px;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    /* Quick Actions Grid */
    .quick-action-card {
        padding: 16px 12px;
        min-height: 100px;
    }
    
    .quick-action-card .action-title {
        font-size: 12px;
    }
    
    /* Stat cards - keep horizontal on tablet */
    .stat-card {
        flex-direction: row;
        text-align: left;
        gap: 12px;
        padding: 18px;
    }
    
    .stat-card .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .chart-container {
        height: 240px;
    }
    
    .table-col-hide-md {
        display: none;
    }
    
    /* Search and filter inputs */
    .search-input,
    .filter-select {
        flex: 1;
        min-width: 100px;
        max-width: none;
    }
}

/* Small Devices (Landscape Phones) */
@media (max-width: 768px) {
    :root {
        --topbar-height: 60px;
    }
    
    .topbar {
        padding: 0 12px;
        height: var(--topbar-height);
    }
    
    .page-content {
        padding: 16px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .user-dropdown {
        padding: 4px 8px 4px 4px;
    }
    
    .user-dropdown .avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-dropdown .user-info {
        display: none;
    }
    
    .user-dropdown .bi-chevron-down {
        display: none !important;
    }
    
    .topbar-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    /* Stat Cards - Compact horizontal */
    .stat-card {
        padding: 14px;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .stat-card .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-radius: 10px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    /* Member Stat Cards Responsive */
    .member-stat-card {
        padding: 10px;
        gap: 8px;
    }
    
    .member-stat-card .stat-icon-sm {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 16px;
    }
    
    .member-stat-card .stat-amount {
        font-size: 14px;
    }
    
    .member-stat-card .stat-title {
        font-size: 10px;
    }
    
    /* BV Cards Responsive */
    .bv-card {
        padding: 10px 6px;
    }
    
    .bv-card .bv-value {
        font-size: 14px;
    }
    
    .bv-card .bv-label {
        font-size: 10px;
    }
    
    .stat-card .stat-change {
        font-size: 10px;
    }
    
    /* Auth Page */
    .auth-card {
        padding: 28px 20px;
        border-radius: 20px;
    }
    
    .auth-logo .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .auth-logo h1 {
        font-size: 24px;
    }
    
    .auth-form .form-control {
        height: 46px;
    }
    
    .auth-form .btn-auth {
        height: 46px;
    }
    
    /* Cards */
    .card {
        border-radius: 12px;
    }
    
    .card-header,
    .card-body {
        padding: 14px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    /* Activity List */
    .activity-item {
        padding: 12px 0;
        gap: 12px;
    }
    
    .activity-item .activity-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .activity-item .activity-text {
        font-size: 13px;
    }
    
    /* Control Toggle - Small Screens */
    .control-toggle-list {
        gap: 10px;
    }
    
    .control-toggle-item {
        padding: 10px;
    }
    
    .control-toggle-item .fw-500 {
        font-size: 12px;
    }
    
    .control-toggle-item small {
        font-size: 10px;
    }
    
    .control-toggle-item .form-check-input {
        width: 38px;
        height: 19px;
    }
    
    /* Table Responsive */
    .table-wrapper {
        margin: 0 -14px;
        padding: 0 14px;
    }
    
    .data-table {
        min-width: 320px;
        font-size: 11px;
    }
    
    .data-table th {
        padding: 8px 6px;
        font-size: 10px;
    }
    
    .data-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    .user-cell {
        gap: 6px;
    }
    
    .user-cell .avatar {
        width: 28px;
        height: 28px;
    }
    
    .user-cell .user-info .name {
        font-size: 11px;
    }
    
    .user-cell .user-info .email {
        font-size: 9px;
    }
    
    .status-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    code.small {
        font-size: 10px;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .btn-icon {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    
    .btn-group .btn-icon {
        width: 24px;
        height: 24px;
    }
    
    /* Dropdown */
    .dropdown-menu {
        min-width: 180px;
    }
    
    /* Page Headers */
    .d-flex.flex-wrap.justify-content-between {
        gap: 12px !important;
    }
    
    .d-flex.flex-wrap.justify-content-between > div:first-child h4 {
        font-size: 18px;
    }
    
    .d-flex.flex-wrap.justify-content-between > div:first-child p {
        font-size: 13px;
    }
    
    /* Charts */
    .chart-container {
        height: 220px;
        min-height: 180px;
    }
    
    /* Quick Actions - 3 columns */
    .quick-action-card {
        padding: 12px 8px;
        min-height: 90px;
    }
    
    .quick-action-card .action-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .quick-action-card .action-title {
        font-size: 11px;
    }
    
    /* Progress */
    .progress-custom {
        height: 6px;
    }
    
    /* Badge */
    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .status-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Settings Nav */
    .nav-pills .nav-link {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Form Elements */
    .form-control,
    .form-select {
        font-size: 14px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    /* News Items */
    .d-flex.gap-3.p-3.rounded-lg img {
        width: 80px !important;
        height: 60px !important;
    }
    
    .table-col-hide-sm {
        display: none;
    }
    
    /* Search and filter full width on small screens */
    .search-input,
    .filter-select {
        flex: 1;
        min-width: 80px;
        max-width: none;
        font-size: 13px;
    }
    
    /* Member Distribution Card */
    .chart-container[style*="height: 250px"] {
        height: 200px !important;
    }
}

/* Extra Small Devices (Portrait Phones) */
@media (max-width: 576px) {
    .breadcrumb-wrapper {
        display: none;
    }
    
    .topbar-left {
        gap: 12px;
    }
    
    .mobile-toggle {
        font-size: 22px;
        padding: 6px;
    }
    
    .topbar-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .topbar-icon .badge-dot {
        width: 6px;
        height: 6px;
        top: 6px;
        right: 6px;
    }
    
    .page-content {
        padding: 12px;
    }
    
    /* Stat Cards - Compact mobile */
    .stat-card {
        padding: 12px;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .stat-card .stat-value {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .stat-card .stat-label {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .stat-card .stat-change {
        font-size: 9px;
    }
    
    .stat-card .stat-content {
        min-width: 0;
    }
    
    /* Quick Actions - 2 columns compact */
    .quick-action-card {
        padding: 12px 8px;
        min-height: 80px;
    }
    
    .quick-action-card .action-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .quick-action-card .action-title {
        font-size: 10px;
        line-height: 1.2;
    }
    
    /* Cards */
    .card {
        border-radius: 10px;
    }
    
    .card-header,
    .card-body {
        padding: 12px;
    }
    
    .card-title {
        font-size: 13px;
    }
    
    .card-title i {
        font-size: 14px;
    }
    
    /* Member Stat Cards - Extra Small */
    .member-stat-card {
        padding: 8px;
        gap: 6px;
        border-radius: 10px;
    }
    
    .member-stat-card .stat-icon-sm {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .member-stat-card .stat-amount {
        font-size: 13px;
    }
    
    .member-stat-card .stat-title {
        font-size: 9px;
    }
    
    /* BV Cards - Extra Small */
    .bv-card {
        padding: 8px 4px;
        border-radius: 8px;
    }
    
    .bv-card .bv-value {
        font-size: 12px;
    }
    
    .bv-card .bv-label {
        font-size: 9px;
    }
    
    /* Control Toggle - Extra Small */
    .control-toggle-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .control-toggle-item .fw-500 {
        font-size: 12px;
    }
    
    .control-toggle-item small {
        font-size: 10px;
    }
    
    .control-toggle-item i {
        font-size: 14px;
    }
    
    .control-toggle-item .form-check-input {
        width: 36px;
        height: 18px;
    }
    
    /* Member Avatar Responsive */
    .member-avatar {
        width: 60px;
        height: 60px;
    }
    
    /* Nav Tabs Responsive */
    .nav-tabs .nav-link {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    /* Tables - Minimal with scroll */
    .table-wrapper {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .data-table {
        min-width: 280px;
        font-size: 10px;
    }
    
    .data-table .hide-mobile {
        display: none;
    }
    
    .data-table th {
        padding: 6px 4px;
        font-size: 9px;
        letter-spacing: 0;
    }
    
    .data-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .user-cell {
        gap: 4px;
    }
    
    .user-cell .avatar {
        width: 24px;
        height: 24px;
        border-radius: 4px;
    }
    
    .user-cell .user-info .name {
        font-size: 10px;
    }
    
    .user-cell .user-info .email {
        font-size: 8px;
    }
    
    .status-badge {
        padding: 1px 4px;
        font-size: 8px;
        border-radius: 4px;
    }
    
    code.small {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .btn-icon {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    
    .btn-group .btn-icon {
        width: 20px;
        height: 20px;
    }
    
    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    /* Auth Page */
    .auth-wrapper {
        padding: 16px;
    }
    
    .auth-card {
        padding: 24px 16px;
        border-radius: 16px;
    }
    
    .auth-logo {
        margin-bottom: 24px;
    }
    
    .auth-logo .logo-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .auth-logo h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .auth-logo p {
        font-size: 13px;
    }
    
    .auth-form .form-group {
        margin-bottom: 16px;
    }
    
    .auth-form label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .auth-form .form-control {
        height: 44px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .auth-form .btn-auth {
        height: 44px;
        font-size: 14px;
    }
    
    .auth-form .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .btn-social {
        height: 42px;
    }
    
    .auth-footer {
        margin-top: 20px;
        padding-top: 20px;
    }
    
    /* Activity List */
    .activity-item .activity-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .activity-item .activity-text {
        font-size: 12px;
    }
    
    .activity-item .activity-time {
        font-size: 10px;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    .btn i {
        font-size: 14px;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
    }
    
    /* Page Headers */
    .page-header h4 {
        font-size: 16px;
    }
    
    .page-header p {
        font-size: 12px;
    }
    
    .d-flex.flex-wrap.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .d-flex.flex-wrap.justify-content-between > .d-flex.gap-2 {
        justify-content: stretch;
    }
    
    .d-flex.flex-wrap.justify-content-between > .d-flex.gap-2 .btn {
        flex: 1;
    }
    
    /* Charts - Smaller for mobile */
    .chart-container {
        height: 200px;
        min-height: 160px;
    }
    
    /* Member Distribution chart in dashboard */
    .chart-container[style*="height: 250px"] {
        height: 180px !important;
    }
    
    /* Distribution legend */
    .d-flex.justify-content-between.align-items-center.mb-2 {
        font-size: 12px;
    }
    
    /* Dropdown Notifications */
    .dropdown-menu[style*="width: 320px"] {
        width: 280px !important;
        right: -50px !important;
    }
    
    /* Wallet Cards */
    .rounded-circle[style*="width: 80px"] {
        width: 60px !important;
        height: 60px !important;
    }
    
    .rounded-circle[style*="width: 80px"] i {
        font-size: 1.5rem !important;
    }
    
    /* Settings Page */
    .nav.flex-column.nav-pills {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 16px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-pills .nav-link {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* List Group */
    .list-group-item {
        padding: 12px;
    }
    
    .list-group-item h6 {
        font-size: 13px;
    }
    
    .list-group-item small {
        font-size: 11px;
    }
    
    /* News Item */
    .d-flex.gap-3.p-3.rounded-lg {
        flex-direction: column;
        gap: 12px !important;
        padding: 12px !important;
    }
    
    .d-flex.gap-3.p-3.rounded-lg img {
        width: 100% !important;
        height: 120px !important;
    }
    
    /* Form Controls in Tables */
    .data-table input[type="number"] {
        width: 60px !important;
        padding: 4px 6px;
        font-size: 11px;
    }
    
    /* Footer */
    .card-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .card-footer span {
        font-size: 12px;
    }
    
    /* Row gap adjustments */
    .row.g-4 {
        --bs-gutter-y: 12px;
        --bs-gutter-x: 12px;
    }
    
    .row.g-3 {
        --bs-gutter-y: 10px;
        --bs-gutter-x: 10px;
    }
    
    /* Badge in tables */
    .data-table .badge {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    .data-table .status-badge {
        font-size: 8px;
        padding: 1px 6px;
    }
}

/* Very Small Devices (< 400px) */
@media (max-width: 400px) {
    .topbar-icon:not(.theme-toggle) {
        display: none;
    }
    
    .topbar-icon.theme-toggle {
        display: flex;
    }
    
    .user-dropdown {
        padding: 4px;
        border-radius: 10px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .stat-card .stat-value {
        font-size: 16px;
    }
    
    .stat-card .stat-label {
        font-size: 9px;
    }
    
    .stat-card .stat-change {
        display: none;
    }
    
    .page-content {
        padding: 8px;
    }
    
    .row.g-4 {
        --bs-gutter-y: 8px;
        --bs-gutter-x: 8px;
    }
    
    .row.g-3 {
        --bs-gutter-y: 6px;
        --bs-gutter-x: 6px;
    }
    
    .auth-card {
        padding: 18px 12px;
    }
    
    .auth-logo h1 {
        font-size: 20px;
    }
    
    /* Quick Actions ultra compact */
    .quick-action-card {
        padding: 10px 6px;
        min-height: 70px;
    }
    
    .quick-action-card .action-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .quick-action-card .action-title {
        font-size: 9px;
    }
    
    /* Cards ultra compact */
    .card-header,
    .card-body {
        padding: 10px;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    /* Chart ultra compact */
    .chart-container {
        height: 160px;
        min-height: 140px;
    }
    
    /* Activity ultra compact */
    .activity-item {
        padding: 8px 0;
        gap: 8px;
    }
    
    .activity-item .activity-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .activity-item .activity-text {
        font-size: 11px;
    }
    
    /* Table ultra compact */
    .data-table {
        min-width: 240px;
    }
    
    .data-table th {
        padding: 4px 3px;
        font-size: 8px;
    }
    
    .data-table td {
        padding: 4px 3px;
        font-size: 9px;
    }
    
    .user-cell .avatar {
        width: 20px;
        height: 20px;
    }
    
    .user-cell .user-info .name {
        font-size: 9px;
    }
    
    .user-cell .user-info .email {
        display: none;
    }
    
    .btn-icon {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }
    
    code.small {
        font-size: 8px;
    }
    
    /* Table ultra compact */
    .data-table {
        min-width: 350px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .user-cell .avatar {
        width: 24px;
        height: 24px;
    }
    
    .user-cell .user-info .name {
        font-size: 10px;
    }
    
    .user-cell .user-info .email {
        display: none;
    }
}

/* Landscape Mode for Phones */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-wrapper {
        padding: 10px;
    }
    
    .auth-card {
        padding: 20px;
        max-width: 500px;
    }
    
    .auth-logo {
        margin-bottom: 16px;
    }
    
    .auth-logo .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .auth-logo h1 {
        font-size: 20px;
    }
    
    .auth-logo p {
        display: none;
    }
    
    .social-login {
        margin-top: 16px;
    }
    
    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .dropdown-item,
    .topbar-icon,
    .quick-action-card {
        min-height: 44px;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .data-table td,
    .data-table th {
        padding: 12px 8px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .topbar,
    .sidebar-overlay,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */

.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary-light { background: rgba(99, 102, 241, 0.1) !important; }
.bg-success-light { background: rgba(34, 197, 94, 0.1) !important; }
.bg-warning-light { background: rgba(245, 158, 11, 0.1) !important; }
.bg-danger-light { background: rgba(239, 68, 68, 0.1) !important; }
.bg-info-light { background: rgba(6, 182, 212, 0.1) !important; }

.rounded-xl { border-radius: 16px !important; }
.rounded-lg { border-radius: 12px !important; }

.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }

/* =====================================================
   Sidebar Submenu Styles
   ===================================================== */

.nav-item.has-submenu .nav-link {
    position: relative;
}

.nav-item.has-submenu .submenu-arrow {
    margin-left: auto;
    transition: transform var(--transition-speed);
}

.nav-item.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.15);
}

.nav-item.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 52px;
    color: var(--text-sidebar);
    font-size: 13px;
    opacity: 0.8;
    transition: all var(--transition-speed);
}

.submenu li a:hover,
.submenu li a.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.submenu li a.active {
    border-left: 3px solid var(--primary-color);
}

.submenu li a i {
    font-size: 14px;
    width: 18px;
}

.sidebar.collapsed .submenu {
    display: none;
}

.sidebar.collapsed .submenu-arrow {
    display: none;
}

/* =====================================================
   Toast Notification Styles
   ===================================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--info-color);
    position: relative;
    overflow: hidden;
}

.toast-notification.toast-success {
    border-left-color: var(--success-color);
}

.toast-notification.toast-error {
    border-left-color: var(--danger-color);
}

.toast-notification.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-notification.toast-info {
    border-left-color: var(--info-color);
}

.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--danger-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--info-color); }

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.toast-progress-bar {
    height: 100%;
    background: var(--primary-color);
    animation: toastProgress linear forwards;
}

.toast-success .toast-progress-bar { background: var(--success-color); }
.toast-error .toast-progress-bar { background: var(--danger-color); }
.toast-warning .toast-progress-bar { background: var(--warning-color); }
.toast-info .toast-progress-bar { background: var(--info-color); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* =====================================================
   Loading Overlay
   ===================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    background: var(--bg-card);
    padding: 32px 48px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Confirm Dialog
   ===================================================== */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.confirm-dialog {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
}

.confirm-icon.confirm-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.confirm-icon.confirm-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.confirm-icon.confirm-info {
    background: rgba(6, 182, 212, 0.1);
    color: var(--info-color);
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .btn {
    min-width: 100px;
}

/* =====================================================
   Progress Bar Styles
   ===================================================== */

.progress-bar-wrapper {
    background: var(--bg-body);
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

.progress-bar-fill.success {
    background: linear-gradient(90deg, var(--success-color), #34d399);
}

.progress-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
}

.progress-bar-fill.danger {
    background: linear-gradient(90deg, var(--danger-color), #f87171);
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-label span:first-child {
    color: var(--text-secondary);
}

.progress-label span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 80px;
    height: 80px;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress .progress-bg {
    fill: none;
    stroke: var(--bg-body);
    stroke-width: 8;
}

.circular-progress .progress-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    transition: stroke-dashoffset 0.5s ease;
}

.circular-progress .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   Animation Classes
   ===================================================== */

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.3s ease forwards;
}

.animate-slideOutRight {
    animation: slideOutRight 0.3s ease forwards;
}

.animate-slideInUp {
    animation: slideInUp 0.3s ease forwards;
}

.animate-slideOutDown {
    animation: slideOutDown 0.3s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease forwards;
}

.animate-scaleOut {
    animation: scaleOut 0.3s ease forwards;
}

.animate-bounce {
    animation: bounce 0.5s ease;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Staggered animations for lists */
.animate-stagger > * {
    opacity: 0;
    animation: slideInUp 0.3s ease forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.animate-stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* Hover animations */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-color) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile toast positioning */
@media (max-width: 576px) {
    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .toast-notification {
        padding: 12px;
    }
    
    .confirm-dialog {
        padding: 24px;
        margin: 16px;
    }
}

