/* ============================================
   TAMTAM MONITORING - CHARTE GRAPHIQUE UNIFIÉE
   ============================================ */

/* 1. IMPORTATION FONTS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* 2. VARIABLES DE DESIGN */
:root {
    /* Palette Officielle TamTam */
    --primary: #282248;        /* Bleu Nuit Profond */
    --secondary: #E4BD62;      /* Or / Doré */
    --white: #FFFFFF;
    --bg-light: #F8F9FA;
    --dark-bg: #0e305a;
    
    /* Hiérarchie d'Opacité */
    --text-main: rgba(40, 34, 72, 1);
    --text-muted: rgba(40, 34, 72, 0.6);
    
    /* États */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Bordures & Ombres */
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 30px rgba(40, 34, 72, 0.08);
    --shadow-hover: 0 20px 40px rgba(40, 34, 72, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.02);
    
    /* Animation Signature */
    --transition-smooth: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-base: all 0.2s ease;
}

/* 3. RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ============================================
   SIDEBAR NAVIGATION (Version TamTam Officielle)
   ============================================ */
.sidebar {
    width: 280px;
    min-width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    z-index: 1001;
    box-shadow: var(--shadow-soft);
}

.sidebar-logo {
    padding: 2rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--secondary);
    border-bottom: 1px solid rgba(228, 189, 98, 0.2);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo i {
    width: 32px;
    height: 32px;
    color: var(--secondary);
}

.sidebar-logo span {
    background: linear-gradient(135deg, var(--secondary) 0%, #f5d98c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    font-size: 0.9rem;
}

.nav-link i {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.nav-link:hover {
    background: rgba(228, 189, 98, 0.15);
    color: var(--secondary);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--secondary);
    color: var(--primary);
}

.nav-link.active i {
    color: var(--primary);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.logout {
    margin-top: auto;
    margin-bottom: 2rem;
    color: #ff6b6b;
}

.logout:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

/* Menu Toggle Button (Mobile) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1002;
    padding: 0.75rem;
    background: var(--primary);
    color: var(--secondary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.menu-toggle i {
    width: 20px;
    height: 20px;
}

.menu-toggle:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    max-width: 1400px;
    min-height: 100vh;
}

/* ============================================
   KPI GRID
   ============================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-base);
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary);
}

.kpi-info {
    flex: 1;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-trend {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--secondary) 0%, #f5d98c 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.kpi-icon i {
    width: 24px;
    height: 24px;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* ============================================
   CARDS (Version Human-Centric)
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition-base);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.card:last-child {
    margin-bottom: 0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.card-header h2 i {
    width: 18px;
    height: 18px;
    color: var(--secondary);
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   HEADER STATS
   ============================================ */
.header-stats {
    margin-bottom: 2rem;
}

.header-stats h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-stats h1 i {
    width: 28px;
    height: 28px;
    color: var(--secondary);
}

.header-stats p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.last-update {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ============================================
   LIST STYLES
   ============================================ */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: #fafbfc;
    border: 1px solid transparent;
    transition: var(--transition-base);
}

.list-item:hover {
    background: var(--white);
    border-color: var(--border);
    transform: translateX(4px);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.item-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--secondary) 0%, #f5d98c 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.item-avatar i {
    width: 18px;
    height: 18px;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.item-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-active {
    background: #ecfdf5;
    color: var(--success);
}

.badge-pending {
    background: #fffbeb;
    color: var(--warning);
}

.badge-diffuse {
    background: #eef2ff;
    color: var(--info);
}

.badge-success {
    background: #ecfdf5;
    color: var(--success);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), #f5d98c);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: var(--transition-base);
}

.stat-card:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   EMPTY STATE & LOADING
   ============================================ */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   UTILITIES
   ============================================ */
.price-tag {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1rem;
}

.text-small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .kpi-grid {
        gap: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 4rem;
    }
    
    .header-stats h1 {
        font-size: 1.25rem;
    }
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}