/*
* custom-modern.css
* Modern UI/UX Theme for Preventivi App
* Version: 2.0 - Redesigned
******************************************************************************/

/* =============================================================================
   ROOT VARIABLES - Modern Color Palette
   ============================================================================= */
:root {
    /* Primary Gradient */
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --primary: #696cff;
    
    /* Secondary Colors */
    --secondary: #8592a3;
    --success: #10b981;
    --success-light: #d1fae5;
    --info: #06b6d4;
    --info-light: #cffafe;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    /* Neutral Colors */
    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-800: #1e293b;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    
    /* Background & Surface */
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-primary: 0 4px 14px 0 rgba(102, 126, 234, 0.39);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --navbar-height: 70px;
}

/* =============================================================================
   BASE STYLES
   ============================================================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Google Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--gray-700);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   LAYOUT WRAPPER - Modern Sidebar Layout
   ============================================================================= */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.layout-container {
    display: flex;
    flex: 1;
    width: 100%;
}

/* =============================================================================
   SIDEBAR - Modern Dark Sidebar
   ============================================================================= */
.layout-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    z-index: 1050;
    transition: all var(--transition-slow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Sidebar Gradient Overlay - Uses theme colors */
.layout-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        color-mix(in srgb, var(--primary-start) 10%, transparent) 0%, 
        color-mix(in srgb, var(--primary-end) 5%, transparent) 50%,
        transparent 100%);
    pointer-events: none;
}

/* Sidebar Brand/Logo */
.sidebar-brand {
    padding: 24px 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-primary);
    margin-right: 8px;
}

.sidebar-brand-logo svg,
.sidebar-brand-logo i {
    color: white;
    font-size: 22px;
}

.sidebar-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /*filter: brightness(0) invert(1);*/
}

.form-check .form-check-input{
    margin-left:0;
}

.sidebar-brand-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.sidebar-brand-text span {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sidebar Menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
}

/* Menu Section */
.menu-section {
    margin-bottom: 8px;
}

.menu-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    padding: 12px 16px 8px;
}

/* Menu Items */
.sidebar-menu .menu-item {
    margin-bottom: 4px;
}

.sidebar-menu .menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-weight: 500;
    font-size: 0.925rem;
}

.sidebar-menu .menu-link:hover {
    color: white;
    transform: translateX(4px);
}

.sidebar-menu .menu-link.active{
    color: white;
    box-shadow: var(--shadow-primary);
}

.sidebar-menu .menu-item.active > .menu-link {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: var(--shadow-primary);
}

.sidebar-menu .menu-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0.85;
}

.sidebar-menu .menu-link.active .menu-icon,
.sidebar-menu .menu-item.active > .menu-link .menu-icon {
    opacity: 1;
}

.sidebar-menu .menu-text {
    flex: 1;
}

/* Menu Toggle Arrow */
.sidebar-menu .menu-toggle::after {
    content: '\ea50';
    font-family: 'boxicons';
    font-size: 18px;
    transition: transform var(--transition);
    margin-left: auto;
}

.sidebar-menu .menu-item.open > .menu-toggle::after {
    transform: rotate(90deg);
}

/* Submenu */
.sidebar-menu .menu-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    padding-left: 20px;
}

.sidebar-menu .menu-item.open > .menu-sub {
    max-height: 500px;
}

.sidebar-menu .menu-sub .menu-link {
    padding: 10px 16px;
    font-size: 0.875rem;
}

.sidebar-menu .menu-sub .menu-link::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--gray-500);
    border-radius: 50%;
    margin-right: 12px;
    transition: all var(--transition);
}

.sidebar-menu .menu-sub .menu-link:hover::before,
.sidebar-menu .menu-sub .menu-link.active::before {
    background: white;
    box-shadow: 0 0 8px var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.08);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* =============================================================================
   MAIN CONTENT AREA
   ============================================================================= */
.layout-page {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
}

/* =============================================================================
   TOP NAVBAR - Modern Sticky Header
   ============================================================================= */
.layout-navbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
}

/* Mobile Menu Toggle */
.navbar-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition);
}

.navbar-nav-toggle:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Breadcrumb / Page Title Area */
.navbar-page-info {
    flex: 1;
}

.navbar-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.navbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--gray-500);
    flex-wrap: wrap;
}

.navbar-breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition);
    font-weight: 500;
}

.navbar-breadcrumb a:hover {
    color: var(--primary);
}

.navbar-breadcrumb .separator {
    font-size: 12px;
    color: var(--gray-400);
}

.navbar-breadcrumb .current {
    color: var(--gray-800);
    font-weight: 600;
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.navbar-action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.navbar-action-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* User Dropdown in Navbar */
.navbar-user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition);
}

.navbar-user-dropdown .dropdown-toggle:hover {
    background: var(--gray-200);
}

.navbar-user-dropdown .dropdown-toggle::after {
    display: none;
}

.navbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.navbar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* =============================================================================
   CONTENT WRAPPER
   ============================================================================= */
.content-wrapper {
    flex: 1;
    padding: 24px;
    max-width: 100%;
}

.container-fluid {
    max-width: 1600px;
    margin: 0 auto;
}

/* =============================================================================
   CARDS - Modern Design
   ============================================================================= */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: visible;
    transition: all var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Card with clipped content (images, etc.) */
.card-overflow-hidden {
    overflow: hidden;
}

/* Ensure dropdowns inside cards are visible */
.card .dropdown {
    position: static;
}

.card .dropdown-menu {
    position: absolute;
    z-index: 1050;
}

/* Row Spacing for Cards */
.row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.row.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.row.g-5 {
    --bs-gutter-x: 2rem;
    --bs-gutter-y: 2rem;
}

.row.g-6 {
    --bs-gutter-x: 2.5rem;
    --bs-gutter-y: 2.5rem;
}

/* Remove extra margin from cards inside .row */
.row > [class*="col"] > .card {
    margin-bottom: 0;
}

/* Card height utility */
.card.h-100 {
    height: 100%;
}

/* Content spacing */
.content-wrapper > .row:not(:last-child) {
    margin-bottom: 1.5rem;
}

/* Section spacing between card groups */
.row + .row {
    margin-top: 0;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 20px 24px;
}

.card-header h5,
.card-header .card-title {
    margin: 0;
    font-weight: 700;
    color: var(--gray-800);
    font-size: 1.125rem;
}

.card-body {
    padding: 24px;
}

.card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    padding: 16px 24px;
}

/* Stats Cards */
.stats-card {
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(102, 126, 234, 0.1);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--primary-start), transparent);
    opacity: 0.08;
    border-radius: 50%;
    transform: translate(30%, -30%);
    transition: all var(--transition-slow);
}

.stats-card:hover::before {
    width: 180px;
    height: 180px;
    opacity: 0.12;
}

.stats-card .stats-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

.stats-card:hover .stats-icon {
    transform: scale(1.08);
}

.stats-card .stats-icon.primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: var(--shadow-primary);
}

.stats-card .stats-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.stats-card .stats-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.stats-card .stats-icon.info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.stats-card .stats-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.stats-card .stats-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
    margin-bottom: 4px;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stats-card .stats-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    margin-top: 12px;
}

.stats-card .stats-change.positive {
    background: var(--success-light);
    color: var(--success);
}

.stats-card .stats-change.negative {
    background: var(--danger-light);
    color: var(--danger);
}

/* =============================================================================
   BUTTONS - Modern Style
   ============================================================================= */
.btn {
    font-weight: 600;
    border-radius: var(--radius);
    padding: 10px 20px;
    transition: all var(--transition);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6edb, #6a429a);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* =============================================================================
   FORMS - Modern Input Styles
   ============================================================================= */
.form-control,
.form-select {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: all var(--transition);
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--gray-300);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.form-text {
    color: var(--gray-500);
    font-size: 0.8125rem;
    margin-top: 6px;
}

/* Floating Labels */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 4px);
    padding: 1rem 1rem;
}

.form-floating > label {
    padding: 1rem;
    color: var(--gray-500);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--primary);
}

/* Input Groups */
.input-group .form-control {
    border-radius: 0;
}

.input-group > :first-child {
    border-top-left-radius: var(--radius) !important;
    border-bottom-left-radius: var(--radius) !important;
}

.input-group > :last-child {
    border-top-right-radius: var(--radius) !important;
    border-bottom-right-radius: var(--radius) !important;
}

.input-group-text {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-500);
}

/* Checkbox & Radio */
.form-check-input {
    width: 1.25em;
    height: 1.25em;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    transition: all var(--transition);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* =============================================================================
   TABLES - Modern Style
   ============================================================================= */
.table {
    margin-bottom: 0;
}

.table > thead {
    background: var(--gray-50);
}

.table > thead > tr > th {
    font-weight: 700;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border: none;
}

.table > tbody > tr > td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

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

.table > tbody > tr:hover {
    background: var(--gray-50);
}

.table-hover > tbody > tr {
    transition: background var(--transition);
}

/* Fix dropdown overflow in tables and cards */
.card-body {
    overflow: visible;
}

/* Ensure dropdown menus are visible in last column */
.table td .dropdown-menu {
    z-index: 1060;
}

/* =============================================================================
   BADGES - Modern Style
   ============================================================================= */
.badge {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bg-label-primary {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
}

.bg-label-success {
    background: var(--success-light);
    color: var(--success);
}

.bg-label-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.bg-label-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.bg-label-info {
    background: var(--info-light);
    color: var(--info);
}

.bg-label-secondary {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* =============================================================================
   ALERTS - Modern Style
   ============================================================================= */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-info {
    background: var(--info-light);
    color: #155e75;
}

.alert-dismissible .btn-close {
    padding: 20px;
}

/* =============================================================================
   DROPDOWNS - Modern Style
   ============================================================================= */
.dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    min-width: 200px;
}

.dropdown-item {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition);
    color: var(--gray-700);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--gray-100);
    color: var(--gray-900);
}

.dropdown-item.active,
.dropdown-item:active {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
}

.dropdown-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: var(--gray-100);
}

/* =============================================================================
   FOOTER - Modern Style
   ============================================================================= */
.content-footer {
    background: white;
    border-top: 1px solid var(--gray-100);
    padding: 20px 24px;
    margin-top: auto;
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-text {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-link:hover {
    color: var(--primary);
}

/* =============================================================================
   AVATARS
   ============================================================================= */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
}

.avatar-md {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
}

.avatar-xl {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
}

.avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-radius: inherit;
}

.avatar-online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border: 2px solid white;
    border-radius: 50%;
}

/* =============================================================================
   EMPTY STATES
   ============================================================================= */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-state-icon i {
    font-size: 36px;
    color: var(--gray-400);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-state-description {
    color: var(--gray-500);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================================================
   PAGE HEADER - Modern Enhanced
   ============================================================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-start), var(--primary-end));
}

.page-header-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0;
    line-height: 1.2;
}

.page-header-subtitle {
    color: var(--gray-500);
    margin-top: 4px;
    font-size: 0.9375rem;
}

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

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */
@media (max-width: 1199.98px) {
    .layout-sidebar {
        transform: translateX(-100%);
    }
    
    .layout-sidebar.show {
        transform: translateX(0);
    }
    
    .layout-page {
        margin-left: 0;
    }
    
    .navbar-nav-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1049;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding: 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .page-header-title {
        font-size: 1.5rem;
    }
    
    .stats-card .stats-value {
        font-size: 1.5rem;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

/* =============================================================================
   UTILITIES
   ============================================================================= */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-start), var(--primary-end)) border-box;
}

.shadow-primary {
    box-shadow: var(--shadow-primary);
}

.hover-lift {
    transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* =============================================================================
   LOADING STATES & SKELETONS
   ============================================================================= */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius);
}

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

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
}

.toast-modern {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =============================================================================
   MODAL IMPROVEMENTS
   ============================================================================= */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-100);
    padding: 20px 24px;
}

.modal-title {
    font-weight: 700;
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--gray-100);
    padding: 16px 24px;
}

/* =============================================================================
   TABS MODERN STYLE
   ============================================================================= */
.nav-tabs {
    border-bottom: 2px solid var(--gray-200);
    gap: 8px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 20px;
    font-weight: 600;
    color: var(--gray-600);
    transition: all var(--transition);
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-color: var(--primary);
    background: transparent;
}

/* Pills Style */
.nav-pills {
    gap: 8px;
}

.nav-pills .nav-link {
    border-radius: var(--radius);
    padding: 10px 18px;
    font-weight: 600;
    color: var(--gray-600);
    transition: all var(--transition);
}

.nav-pills .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: var(--shadow-primary);
}

/* =============================================================================
   PROGRESS BARS
   ============================================================================= */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

/* =============================================================================
   PAGINATION
   ============================================================================= */
.pagination {
    gap: 4px;
}

.page-item .page-link {
    border: none;
    border-radius: var(--radius);
    padding: 8px 14px;
    color: var(--gray-600);
    font-weight: 500;
    transition: all var(--transition);
}

.page-item .page-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: var(--shadow-primary);
}

.page-item.disabled .page-link {
    background: transparent;
    color: var(--gray-400);
}

/* =============================================================================
   SWITCH / TOGGLE
   ============================================================================= */
.form-switch .form-check-input {
    width: 48px;
    height: 26px;
    border-radius: var(--radius-full);
    border: none;
    background-color: var(--gray-300);
    cursor: pointer;
    transition: all var(--transition);
}

.form-switch .form-check-input:checked {
    background-color: var(--primary);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* =============================================================================
   SELECT2 OVERRIDES (for compatibility)
   ============================================================================= */
.select2-container--default .select2-selection--single {
    border: 2px solid var(--gray-200) !important;
    border-radius: var(--radius) !important;
    height: auto !important;
    padding: 10px 14px !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0 !important;
    line-height: normal !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
}

.select2-dropdown {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.select2-results__option {
    padding: 10px 14px !important;
    transition: all var(--transition);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end)) !important;
}

/* =============================================================================
   DATATABLES OVERRIDES (for compatibility)
   ============================================================================= */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px 12px;
    transition: all var(--transition);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius) !important;
    border: none !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end)) !important;
    color: white !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--gray-100) !important;
    color: var(--gray-800) !important;
    border: none !important;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */
@media print {
    .layout-sidebar,
    .layout-navbar,
    .content-footer,
    .page-header-actions,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .layout-page {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid var(--gray-200) !important;
    }
}