/* =========================================
   MyProtec - Système de Design Intégral
   Version : 2.0 (Responsive & Mobile-First)
   ========================================= */

:root {
    /* Couleurs Officielles */
    --blue-pc: #004080;
    --orange-pc: #F08700;
    --white: #FFFFFF;
    
    /* Couleurs d'interface */
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* États */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Effets */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
}

/* --- Base & Reset --- */
*, *::before, *::after { 
    box-sizing: border-box; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* --- Mise en page (Layout) --- */
.hub-container {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeInUp 0.4s ease-out;
}

@media (min-width: 768px) {
    .hub-container { padding: 2rem; }
}

/* --- Header & Navigation Responsive --- */
header {
    background: var(--blue-pc);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-bottom: 4px solid var(--orange-pc);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 1024px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.main-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto; /* Scroll horizontal sur mobile */
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
}

.main-nav::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.main-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    transition: var(--transition);
}

.main-nav a:hover, .main-nav a.active {
    color: white;
    background: var(--orange-pc);
}

/* --- Barre d'état Antenne --- */
.antenne-bar {
    background: var(--white);
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.antenne-bar strong { color: var(--blue-pc); }

/* --- Cartes (Cards) --- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card h2 {
    margin: 0 0 1.25rem 0;
    font-size: 1.1rem;
    color: var(--blue-pc);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Grilles de contenu (Grids) --- */
.staff-grid, .shop-grid, .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .staff-grid, .shop-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
    .staff-grid, .shop-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Boutons Adaptés --- */
.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--orange-pc);
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

@media (min-width: 768px) {
    .btn { 
        width: auto; 
        display: inline-block; 
        padding: 8px 20px; 
    }
}

.btn:active { transform: scale(0.98); }
.btn:hover { opacity: 0.9; }

.btn-blue { background: var(--blue-pc); }
.btn-outline { 
    background: transparent; 
    border: 2px solid var(--blue-pc); 
    color: var(--blue-pc); 
}

/* --- Tables & Scrolling Responsives --- */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}

.agenda-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px; /* Force le scroll horizontal sur mobile */
}

.agenda-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.agenda-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

/* --- Composants Spécifiques --- */

/* Messagerie / Chat IA */
#chat-box {
    height: 350px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 768px) {
    #chat-box { height: 500px; }
}

/* Barres de progression */
.mini-progress-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    transition: width 0.5s ease-out;
}

/* Badges & Pills */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.bg-blue { background: #dbeafe; color: #1e40af; }
.bg-orange { background: #ffedd5; color: #9a3412; }
.bg-green { background: #dcfce7; color: #166534; }

.stat-pill {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--blue-pc);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Utilitaires --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }