/* Variables CSS pour le thème moderne */
:root {
    /* Couleurs Principales */
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;

    /* Couleurs d'État */
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #ef4444;

    /* Backgrounds & Surfaces */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --glass-card: rgba(30, 41, 59, 0.4);
    --navbar-bg: rgba(15, 23, 42, 0.95);

    /* Typographie */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-accent: linear-gradient(135deg, var(--accent), var(--primary));

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;

    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;

    /* Shadows */
    --shadow-glass: 0 8px 32px rgba(102, 126, 234, 0.15);
    --shadow-hover: 0 20px 40px rgba(102, 126, 234, 0.25);

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;

    /* Sidebar */
    --sidebar-width: 260px;
}

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

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

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 2px;
}

.sidebar-logo {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    flex-shrink: 0;
}

.logo-img {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    position: relative;
    font-family: inherit;
    min-height: 44px;
    border-radius: var(--radius-md);
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.12);
    transform: translateX(4px);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.15);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.link-icon {
    font-size: 1.1rem;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-text {
    flex: 1;
    white-space: nowrap;
}

/* Dropdown */
.sidebar-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    justify-content: space-between;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: var(--transition-fast);
    margin-left: auto;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Support pour sidebar_v2 avec classe .open */
.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    margin: 0.25rem 0.5rem 0.5rem 0.5rem;
    border-radius: var(--radius-md);
}

.dropdown-menu.active,
.sidebar-dropdown.open .dropdown-menu {
    max-height: 400px;
    padding: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-fast);
    min-height: 40px;
    border-radius: var(--radius-sm);
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.15);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
}

.sidebar-footer .sidebar-link {
    margin-bottom: 0;
}

.sidebar-footer .sidebar-link::before {
    display: none !important;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    padding-bottom: 70px;
}

.content-wrapper {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 3rem;
    text-align: center;
    padding: 2rem 0;
}

.welcome-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.welcome-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Section */
.stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-glass);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.4);
}

.stat-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-radius: var(--radius-md);
    flex-shrink: 0;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Quick Actions Section */
.quick-actions-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.action-card {
    padding: 2rem;
    text-align: center;
    transition: var(--transition-smooth);
}

.action-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.action-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.action-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.action-btn {
    padding: 0.75rem 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

/* Recent Bots Section */
.recent-bots-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.see-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.see-all-link:hover {
    color: var(--accent);
    transform: translateX(3px);
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.bot-card {
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.bot-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bot-avatar {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-radius: var(--radius-md);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.bot-info {
    flex: 1;
}

.bot-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.bot-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.bot-status.active {
    color: var(--success);
}

.bot-status.inactive {
    color: var(--text-muted);
}

.bot-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.bot-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bot-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bot-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bot-actions {
    display: flex;
    gap: 0.75rem;
}

.bot-action-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.bot-action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Activity Section */
.activity-section {
    margin-bottom: 3rem;
}

.activity-feed {
    padding: 1.5rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition-fast);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--radius-sm);
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.activity-icon.success {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.activity-icon.info {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary);
}

.activity-icon.warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    padding: 1rem 2rem;
    z-index: 999;
}

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

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

.social-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.social-link {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    text-decoration: none;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Utility Classes */
.glass-card {
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.3);
}

/* ========================================
   SIDEBAR ENHANCEMENTS (Theme Sidebar)
   ======================================== */

/* Sidebar Section Title */
.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem 0.5rem;
    margin-top: 0.5rem;
}

.sidebar-section-title:first-child {
    margin-top: 0;
}

.sidebar-section-title i {
    font-size: 0.7rem;
}

/* Moderator Exit Link */
.sidebar-link.moderator-exit {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.sidebar-link.moderator-exit:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

/* Dropdown Item Enhancements */
.dropdown-item.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.18);
}

/* Dropdown Avatar (for moderator list) */
.dropdown-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* User Info */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(102, 126, 234, 0.08);
    border-radius: var(--radius-sm);
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.sidebar-user .user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

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

.sidebar-user .user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Logout Link */
.sidebar-footer .logout-link {
    color: var(--text-muted);
}

.sidebar-footer .logout-link:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Dev Badge */
.dev-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* ========================================
   NOTIFICATIONS SYSTEM (Global)
   ======================================== */

/* Notification Container */
#notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    border-left: 4px solid var(--primary);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.notification-toast.success {
    border-left-color: var(--success);
}

.notification-toast.error {
    border-left-color: var(--error);
}

.notification-toast.warning {
    border-left-color: var(--warning);
}

.notification-toast.info {
    border-left-color: #3b82f6;
}

.notification-toast i {
    font-size: 1.25rem;
}

.notification-toast.success i {
    color: var(--success);
}

.notification-toast.error i {
    color: var(--error);
}

.notification-toast.warning i {
    color: var(--warning);
}

.notification-toast.info i {
    color: #3b82f6;
}

.notification-toast .toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.notification-toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.notification-toast .toast-close:hover {
    color: var(--text-primary);
}

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

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

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-glass);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

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

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-danger {
    background: var(--error);
    color: var(--text-primary);
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: var(--bg-primary);
}

.btn-warning:hover:not(:disabled) {
    background: #e67e22;
    transform: translateY(-2px);
}

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

.btn-outline-primary:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

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

.btn-outline-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
    min-width: 160px;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.75rem;
    min-width: 80px;
}

/* Icon Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    min-width: auto;
    border-radius: var(--radius-sm);
}

.btn-icon-danger {
    background: var(--error);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon-danger:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.btn-icon-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-icon-danger-small {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: var(--space-4);
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-select {
    width: 100%;
    padding: var(--space-4);
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
    cursor: pointer;
}

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

.form-textarea {
    width: 100%;
    padding: var(--space-4);
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    resize: vertical;
}

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

.form-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--space-2);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-color {
    width: 60px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.form-color-picker {
    width: 60px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    transition: var(--transition-fast);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    transition: var(--transition-fast);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
    box-shadow: var(--shadow-glass);
}

.toggle-switch input:checked + .toggle-slider:before {
    background: var(--text-primary);
    transform: translateX(24px);
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toggle-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   STATUS BADGES
   ======================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background: rgba(46, 213, 115, 0.1);
    border-color: rgba(46, 213, 115, 0.3);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.status-badge i {
    font-size: 0.625rem;
}

/* ========================================
   LOADING & EMPTY STATES
   ======================================== */

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   OLD NOTIFICATIONS (Legacy - kept for compatibility)
   ======================================== */

.notification {
    position: fixed;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification i:first-child {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.notification.error i:first-child {
    color: var(--error);
}

.notification.success {
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.1);
}

.notification.success i:first-child {
    color: var(--success);
}

.notification.warning {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.1);
}

.notification.warning i:first-child {
    color: var(--warning);
}

.notification.info {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(59, 130, 246, 0.1);
}

.notification.info i:first-child {
    color: #3b82f6;
}

.notification span {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

/* Responsive notifications */
@media (max-width: 768px) {
    .notification {
        right: 1rem;
        left: 1rem;
        min-width: auto;
        max-width: none;
    }
}

/* =================================== */
/* Modales */
/* =================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.15);
    flex-shrink: 0;
}

.modal-header.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Scrollbar personnalisée pour les modales */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-sm);
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

/* Scrollbar Firefox */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(15, 23, 42, 0.4);
}

.modal-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.modal-header.danger + .modal-body .modal-icon-wrapper {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    border-color: rgba(239, 68, 68, 0.3);
}

.modal-icon-wrapper i {
    font-size: 2.5rem;
    color: var(--primary);
}

.modal-header.danger + .modal-body .modal-icon-wrapper i {
    color: var(--error);
}

.modal-message {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.modal-submessage {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
    flex-shrink: 0;
}

/* =================================== */
/* Notifications Toast */
/* =================================== */

#notification-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.notification-toast {
    background: var(--glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease forwards;
    pointer-events: auto;
}

.notification-toast.success {
    border-left: 4px solid var(--success);
}

.notification-toast.error {
    border-left: 4px solid var(--error);
}

.notification-toast.warning {
    border-left: 4px solid var(--warning);
}

.notification-toast.info {
    border-left: 4px solid var(--primary);
}

.notification-toast i:first-child {
    font-size: 1.25rem;
}

.notification-toast.success i:first-child {
    color: var(--success);
}

.notification-toast.error i:first-child {
    color: var(--error);
}

.notification-toast.warning i:first-child {
    color: var(--warning);
}

.notification-toast.info i:first-child {
    color: var(--primary);
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.toast-close:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

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

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

/* =================================== */
/* Scrollbars Personnalisées Globales */
/* =================================== */

/* Scrollbar pour les conteneurs avec overflow */
.admin-table-container::-webkit-scrollbar,
.content-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.admin-table-container::-webkit-scrollbar-track,
.content-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-sm);
}

.admin-table-container::-webkit-scrollbar-thumb,
.content-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
}

.admin-table-container::-webkit-scrollbar-thumb:hover,
.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

/* Scrollbar Firefox pour les conteneurs */
.admin-table-container,
.content-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(15, 23, 42, 0.4);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-wrapper {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .link-text,
    .logo-text,
    .dropdown-arrow {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding: 1.5rem 0.5rem;
    }
    
    .sidebar-link {
        justify-content: center;
        padding: 0.875rem 0.5rem;
    }

    .main-content {
        margin-left: 70px;
        width: calc(100% - 70px);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-description {
        font-size: 1rem;
    }

    .content-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .footer {
        left: 70px;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .footer {
        left: 0;
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    /* Modales responsive */
    .modal {
        width: 95%;
        max-width: 100%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Notifications responsive */
    #notification-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .notification-toast {
        min-width: auto;
        max-width: 100%;
    }
}