/**
 * ITsense Dashboard 2.0 - Nouveau Branding
 * Couleurs : Bleu Marine + Or/Doré
 */

:root {
    /* Nouvelles couleurs branding ITsense */
    --bg-primary: #0a1628;
    --bg-secondary: #0d1b2a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: #a8b4c0;
    --text-muted: #5a6a7a;
    
    /* Couleur dorée principale */
    --color-gold: #C9A227;
    --color-gold-light: #D4B84B;
    --color-gold-dark: #9A7B1A;
    
    /* Couleurs des objectifs */
    --color-support: #1B4F72;
    --color-croissance: #82C341;
    --color-autonomie: #C9A227;
    
    /* Couleurs d'état */
    --color-success: #82C341;
    --color-warning: #D4A84B;
    --color-danger: #e74c3c;
    --color-info: #5DADE2;
    
    --border-color: rgba(201, 162, 39, 0.15);
    --border-color-light: rgba(201, 162, 39, 0.25);
    --sidebar-width: 260px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary) !important;
    background-image: none !important;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Force suppression de tout watermark/background */
body::before, body::after,
.app-container::before, .app-container::after,
.main-content::before, .main-content::after {
    display: none !important;
    background: none !important;
    background-image: none !important;
}

/* LAYOUT */
.app-container { 
    display: flex; 
    min-height: 100vh; 
    background: var(--bg-primary) !important;
    background-image: none !important;
    position: relative;
}

/* Suppression forcée de tout watermark */
.app-container > *:not(.sidebar):not(.main-content) {
    display: none !important;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(201, 162, 39, 0.08) 0%, rgba(10, 22, 40, 0.95) 100%);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-width: 0;
    background: var(--bg-primary) !important;
    background-image: none !important;
}

/* MOBILE MENU */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(90deg, var(--bg-secondary), var(--bg-primary));
    border-bottom: 1px solid var(--border-color);
    z-index: 200;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header img { height: 35px; }
.mobile-header .version { font-size: 0.6rem; color: var(--color-gold); letter-spacing: 1px; font-weight: 600; }

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 300;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--color-gold);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* LOGIN */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.login-box { 
    background: var(--bg-card); 
    border-radius: 20px; 
    padding: 40px; 
    width: 100%; 
    max-width: 400px; 
    border: 1px solid var(--border-color); 
    backdrop-filter: blur(10px); 
}
.login-logo { text-align: center; margin-bottom: 25px; }
.login-logo img { max-width: 180px; display: block; margin: 0 auto; }
.login-title { font-size: 1.4rem; font-weight: 300; letter-spacing: 3px; text-align: center; margin-bottom: 5px; }
.login-subtitle { font-size: 0.75rem; color: var(--color-gold); letter-spacing: 2px; text-align: center; margin-bottom: 25px; font-weight: 600; }

/* COUNTDOWN */
.countdown-banner {
    background: linear-gradient(90deg, var(--bg-secondary), var(--color-gold-dark));
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--color-gold);
}
.countdown-banner strong { color: var(--color-gold-light); }
.countdown-timer { 
    background: rgba(201, 162, 39, 0.3); 
    padding: 5px 15px; 
    border-radius: 20px; 
    font-weight: bold; 
    color: #fff;
    border: 1px solid var(--color-gold);
}

/* NAVIGATION */
.nav-brand { 
    padding: 15px 0 20px; 
    border-bottom: 1px solid var(--border-color); 
    margin-bottom: 20px; 
    text-align: center; 
}
.nav-brand img { max-width: 140px; display: block; margin: 0 auto 10px; }
.nav-brand .version { 
    font-size: 0.7rem; 
    color: var(--color-gold); 
    letter-spacing: 2px; 
    font-weight: 600;
    text-transform: uppercase;
}

.nav-section { margin-bottom: 20px; }
.nav-section-title { 
    font-size: 0.65rem; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    color: var(--color-gold); 
    margin-bottom: 10px; 
    padding-left: 10px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    font-size: 0.9rem;
}
.nav-link:hover { 
    background: rgba(201, 162, 39, 0.1); 
    color: #fff; 
}
.nav-link.active { 
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.2), transparent); 
    color: var(--color-gold); 
    border-left: 3px solid var(--color-gold); 
}
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }

.user-info { 
    margin-top: 20px; 
    padding: 15px; 
    background: rgba(201, 162, 39, 0.08); 
    border-radius: 10px; 
    border: 1px solid var(--border-color);
}
.user-name { font-weight: 600; font-size: 0.9rem; color: #fff; }
.user-role { font-size: 0.75rem; color: var(--color-gold); }
.logout-link { display: block; margin-top: 10px; color: var(--text-muted); text-decoration: none; font-size: 0.8rem; }
.logout-link:hover { color: var(--color-danger); }

/* PAGE HEADER */
.page-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 25px; 
    flex-wrap: wrap; 
    gap: 15px; 
}
.page-title { 
    font-size: 1.5rem; 
    font-weight: 300; 
    letter-spacing: 2px; 
    margin-bottom: 5px; 
}
.page-subtitle { color: var(--text-muted); font-size: 0.85rem; }

/* CARDS */
.card { 
    background: var(--bg-card); 
    border-radius: 16px; 
    padding: 20px; 
    border: 1px solid var(--border-color); 
    margin-bottom: 20px; 
    transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-color-light); }
.card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
    gap: 10px; 
}
.card-title { font-size: 1.1rem; font-weight: 600; margin: 0; color: var(--color-gold); }

/* OBJECTIVES */
.objectives-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 20px; 
    margin-bottom: 25px; 
}
.objective-card { 
    position: relative; 
    padding: 20px; 
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.2s;
}
.objective-card:hover { border-color: var(--border-color-light); }
.objective-card.support { border-top: 4px solid var(--color-support); }
.objective-card.croissance { border-top: 4px solid var(--color-croissance); }
.objective-card.autonomie { border-top: 4px solid var(--color-gold); }
.objective-number { position: absolute; top: 10px; right: 15px; font-size: 2rem; font-weight: 700; opacity: 0.1; }
.objective-title { font-size: 1rem; font-weight: 600; margin-bottom: 5px; }
.objective-title.support { color: #5DADE2; }
.objective-title.croissance { color: var(--color-croissance); }
.objective-title.autonomie { color: var(--color-gold); }
.objective-baseline { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 15px; }

/* KPI */
.kpi-list { list-style: none; }
.kpi-item { 
    background: rgba(0, 0, 0, 0.3); 
    border-radius: 10px; 
    padding: 12px; 
    margin-bottom: 10px; 
    border: 1px solid transparent;
    transition: border-color 0.2s;
}
.kpi-item:hover { border-color: var(--border-color); }
.kpi-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 5px; }
.kpi-name { font-size: 0.8rem; color: var(--text-secondary); }
.kpi-target { font-size: 0.7rem; padding: 3px 8px; border-radius: 10px; background: rgba(201, 162, 39, 0.15); }
.kpi-target.support { color: #5DADE2; }
.kpi-target.croissance { color: var(--color-croissance); }
.kpi-target.autonomie { color: var(--color-gold); }
.kpi-value { font-size: 1.3rem; font-weight: 700; }
.kpi-value.success { color: var(--color-success); }
.kpi-value.warning { color: var(--color-warning); }
.kpi-value.danger { color: var(--color-danger); }
.kpi-value.placeholder { color: var(--text-muted); font-size: 1rem; }
.progress-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.progress-fill.support { background: linear-gradient(90deg, #1B4F72, #5DADE2); }
.progress-fill.croissance { background: linear-gradient(90deg, #5a9c2e, #82C341); }
.progress-fill.autonomie { background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold-light)); }

/* MILESTONES */
.milestone-section { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border-color); }
.milestone-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.milestone-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.85rem; color: var(--text-secondary); }
.milestone-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; flex-shrink: 0; }
.milestone-check.done { background: var(--color-success); border-color: var(--color-success); color: #0d1b2a; }

/* REFERENTS */
.referents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.referent-card { 
    background: rgba(0,0,0,0.3); 
    border-radius: 10px; 
    padding: 15px; 
    text-align: center; 
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.referent-card:hover { border-color: var(--color-gold); }
.referent-domain { font-size: 0.65rem; color: var(--color-gold); text-transform: uppercase; margin-bottom: 5px; letter-spacing: 1px; font-weight: 600; }
.referent-name { font-size: 0.9rem; color: #fff; font-weight: 500; }
.referent-backup { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }

/* PROCESS */
.process-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.process-item { 
    background: rgba(0,0,0,0.3); 
    border-radius: 10px; 
    padding: 12px 15px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-left: 3px solid var(--color-gold); 
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-gold);
    transition: all 0.2s;
}
.process-item:hover { border-color: var(--color-gold); }
.process-number { 
    background: rgba(201, 162, 39, 0.2); 
    color: var(--color-gold); 
    width: 28px; 
    height: 28px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.8rem; 
    font-weight: 600; 
    flex-shrink: 0; 
}
.process-content { flex: 1; min-width: 0; }
.process-name { font-size: 0.9rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.process-owner { font-size: 0.75rem; color: var(--color-gold); }
.process-status { width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.process-status.validated { background: var(--color-success); }
.process-status.submitted { background: var(--color-info); }
.process-status.in_progress { background: var(--color-warning); }

/* SUMMARY */
.summary-bar { 
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.05)); 
    border-radius: 12px; 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-around; 
    flex-wrap: wrap; 
    gap: 15px; 
    border: 1px solid var(--border-color); 
    margin-top: 20px; 
}
.summary-item { text-align: center; min-width: 80px; }
.summary-label { font-size: 0.65rem; color: var(--color-gold); text-transform: uppercase; margin-bottom: 5px; font-weight: 600; }
.summary-value { font-size: 1.1rem; font-weight: 600; }

/* FORMS */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; }
.form-control { 
    width: 100%; 
    padding: 12px 15px; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid var(--border-color); 
    border-radius: 10px; 
    color: #fff; 
    font-size: 0.95rem; 
    transition: border-color 0.2s; 
}
.form-control:focus { outline: none; border-color: var(--color-gold); }
.form-control::placeholder { color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }

/* BUTTONS */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    padding: 10px 20px; 
    border-radius: 10px; 
    font-weight: 600; 
    font-size: 0.9rem; 
    border: none; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    text-decoration: none; 
    white-space: nowrap; 
}
.btn-primary { 
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold)); 
    color: #0a1628; 
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--color-gold); }
.btn-success { background: var(--color-success); color: #0a1628; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-warning { background: var(--color-warning); color: #0a1628; }
.btn-info { background: var(--color-info); color: #0a1628; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 15px 30px; font-size: 1rem; }

/* BADGES */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: rgba(130, 195, 65, 0.2); color: var(--color-success); }
.badge-warning { background: rgba(212, 168, 75, 0.2); color: var(--color-warning); }
.badge-danger { background: rgba(231, 76, 60, 0.2); color: var(--color-danger); }
.badge-info { background: rgba(93, 173, 226, 0.2); color: var(--color-info); }
.badge-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }

/* ALERTS */
.alert { padding: 15px 20px; border-radius: 10px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(130, 195, 65, 0.15); border: 1px solid rgba(130, 195, 65, 0.3); color: var(--color-success); }
.alert-error, .alert-danger { background: rgba(231, 76, 60, 0.15); border: 1px solid rgba(231, 76, 60, 0.3); color: var(--color-danger); }
.alert-warning { background: rgba(212, 168, 75, 0.15); border: 1px solid rgba(212, 168, 75, 0.3); color: var(--color-warning); }
.alert-info { background: rgba(93, 173, 226, 0.15); border: 1px solid rgba(93, 173, 226, 0.3); color: var(--color-info); }

/* TABLES */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 500px; }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--color-gold); font-weight: 600; white-space: nowrap; }
.table td { font-size: 0.9rem; color: var(--text-secondary); }
.table tbody tr:hover { background: rgba(201, 162, 39, 0.05); }

/* MODALS */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); display: none; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(5px); padding: 20px; }
.modal-backdrop.show { display: flex; }
.modal { background: var(--bg-secondary); border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border-color); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--border-color); }
.modal-title { font-size: 1.1rem; font-weight: 600; color: var(--color-gold); }
.btn-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }
.btn-close:hover { color: #fff; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 20px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }

/* UTILITY */
.update-date { text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.8rem; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-gold { color: var(--color-gold) !important; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* RESPONSIVE - TABLET */
@media screen and (max-width: 1024px) {
    .objectives-grid { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: 1fr; }
}

/* RESPONSIVE - MOBILE */
@media screen and (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); width: 280px; min-width: 280px; padding-top: 80px; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 80px 15px 20px; }
    .countdown-banner { font-size: 0.75rem; padding: 8px 15px; }
    .countdown-timer { padding: 4px 10px; font-size: 0.75rem; }
    .page-header { flex-direction: column; align-items: stretch; }
    .page-title { font-size: 1.3rem; }
    .card { padding: 15px; }
    .referents-grid { grid-template-columns: repeat(2, 1fr); }
    .summary-bar { padding: 15px; }
    .summary-item { flex: 1 1 40%; }
    .btn { padding: 10px 16px; font-size: 0.85rem; }
    .btn-sm { padding: 6px 10px; font-size: 0.75rem; }
    .table { min-width: 450px; }
    .form-row { grid-template-columns: 1fr; }
}

/* PRINT */
@media print {
    body { background: white !important; color: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sidebar, .no-print, .countdown-banner, .mobile-header { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; width: 100% !important; }
    .card { background: #f8f8f8 !important; border-color: #ddd !important; page-break-inside: avoid; }
    @page { size: A4; margin: 1cm; }
}
