/* ==========================================================================
   CONCORDIA - DESIGN SYSTEM & GRID DISPATCHER ARCHITECTURE (V6.2)
   ========================================================================== */

:root {
    --primary-color: #3f255b;
    --primary-light: #563975;
    --primary-dark: #27173a;
    --accent-color: #e0be6c;
    --accent-hover: #f1d797;
    --border-color: #d1c7d7;
    --text-muted: #b1a2c4;
    --bg-color: #f4f2f6;
    --text-color: #2d2533;
    --lang-bar-height: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color); color: var(--text-color);
    margin: 0; padding: 0; display: flex; flex-direction: column; 
    height: 100vh; overflow: hidden;
}

/* --- HAUT DE PAGE --- */
.top-lang-bar {
    background-color: #4f346e; height: var(--lang-bar-height);
    display: flex; align-items: center; justify-content: flex-end; padding: 0 20px; box-sizing: border-box; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lang-nav-container { display: flex; gap: 15px; height: 100%; }
.lang-btn { background: none; border: none; color: #cbbad8; font-size: 11px; font-weight: 600; cursor: pointer; height: 100%; padding: 0 4px; display: flex; align-items: center; gap: 6px; }
.lang-btn:hover, .lang-btn.active { color: var(--accent-color); }
.flag-img { height: 14px; max-height: 20px; width: auto; object-fit: contain; }

.main-header {
    background-color: var(--primary-color); color: white; height: 60px; border-bottom: 3px solid var(--accent-color);
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 0; flex-shrink: 0; box-sizing: border-box;
}
.header-left { display: flex; align-items: center; height: 100%; }
.brand-wrapper {
    display: flex; align-items: center; gap: 12px; background-color: var(--primary-dark);
    height: calc(60px + var(--lang-bar-height)); margin-top: calc(-1 * var(--lang-bar-height)); padding: 0 25px; border-right: 1px solid #1a0f28; z-index: 10; box-sizing: border-box;
}
.brand-logo-img { height: 35px; width: auto; object-fit: contain; }
.brand-text-title { font-size: 15px; font-weight: 800; color: white; letter-spacing: 0.5px; }

.top-nav { display: flex; height: 100%; margin-left: 25px; }
.top-nav-btn {
    background: none; border: none; color: var(--text-muted); padding: 0 16px; font-size: 13px; font-weight: 600; cursor: pointer; height: 100%; border-bottom: 4px solid transparent; text-transform: uppercase;
}
.top-nav-btn:hover { color: white; }
.top-nav-btn.active { color: white; border-bottom-color: var(--accent-color); background-color: var(--primary-light); }
.header-right { display: flex; align-items: center; gap: 20px; }
.selector-group { display: flex; align-items: center; gap: 8px; }
.profile-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.role-selector { background: rgba(255, 255, 255, 0.15); color: white; border: 1px solid var(--border-color); padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; outline: none; }
.role-selector option { padding: 6px; background: white; color: var(--text-color); }

/* --- SIDEBAR --- */
.app-body { display: flex; flex: 1; overflow: hidden; height: calc(100vh - 60px - var(--lang-bar-height) - 15px); }
.sidebar { width: 270px; background: var(--primary-dark); border-right: 1px solid #1a0f28; display: flex; flex-direction: column; justify-content: space-between; padding: 20px 0 0 0; flex-shrink: 0; box-sizing: border-box; }
.sidebar-top { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #a494b7; padding: 0 20px 12px 20px; margin: 0 0 15px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-menu { list-style: none; padding: 0 12px; margin: 0; }
.sidebar-btn { width: 100%; text-align: left; background: none; border: none; padding: 10px 15px; font-size: 13px; font-weight: 500; color: #cbd5e0; cursor: pointer; display: flex; align-items: center; gap: 12px; border-radius: 6px; }
.sidebar-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--accent-color); }
.sidebar-btn.active { background: var(--primary-light); color: white; font-weight: 700; }
.holistic-btn { border: 1px dashed rgba(224, 190, 108, 0.4); color: var(--accent-color); font-weight: 600; margin-bottom: 10px; }

.sidebar-footer-filter { background: #1d102b; padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 8px; }
.context-selector { width: 100%; background: rgba(255, 255, 255, 0.08); color: white; border: 1px solid rgba(255, 255, 255, 0.15); padding: 8px 10px; border-radius: 6px; font-size: 12px; }

/* --- CONTENEUR CENTRAL ET EN-TÊTE FIXE --- */
.main-content { flex: 1; padding: 25px; overflow-y: auto; background-color: var(--bg-color); box-sizing: border-box; }

.content-header-box {
    background: white; border: 1px solid var(--border-color); border-left: 4px solid var(--primary-color);
    padding: 15px 20px; margin-bottom: 25px; border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.content-header-box h2 { margin: 0; font-size: 18px; color: var(--primary-color); font-weight: 700; }
.content-header-box p { margin: 4px 0 0 0; font-size: 12px; color: #62556a; }

/* --- GRILLES HOLISTIQUES DYNAMIQUES --- */
.holistic-grid { display: grid; gap: 20px; width: 100%; box-sizing: border-box; }

.layout_2_zones { grid-template-columns: repeat(2, 1fr); }
.layout_3_zones { grid-template-columns: repeat(2, 1fr); }
.layout_3_zones .grid-zone-card:nth-child(3) { grid-column: span 2; }
.layout_4_zones { grid-template-columns: repeat(2, 1fr); }

.layout_5_zones { grid-template-columns: repeat(3, 1fr); }
.layout_5_zones .grid-zone-card:nth-child(4) { grid-column: span 1; }
.layout_5_zones .grid-zone-card:nth-child(5) { grid-column: span 2; }

.layout_6_zones { grid-template-columns: repeat(3, 1fr); }
.layout_7_zones { grid-template-columns: repeat(3, 1fr); }
.layout_7_zones .grid-zone-card:nth-child(7) { grid-column: span 3; }
.layout_10_zones { grid-template-columns: repeat(4, 1fr); }

/* --- CARD STRUCTURES --- */
.grid-zone-card {
    background: white; border: 1px solid var(--border-color); border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03); display: flex; flex-direction: column; overflow: hidden;
}
.zone-card-header { background: #fcfaff; color: var(--primary-color); font-weight: 700; font-size: 11px; padding: 10px 15px; border-bottom: 1px solid var(--border-color); text-transform: uppercase; }
.zone-card-body { padding: 12px; flex: 1; overflow-x: auto; }

/* QUALIFIANTS GÉRÉS DE MANIÈRE COMPACTE (ATTRIBUTS DE CONTROLE) */
.card-role-qualifier { background: #fbfafc; border-style: dashed; }
.qualifier-header { background: #f3eff6; color: #563975; font-weight: 600; }
.qualifier-body { display: flex; flex-direction: column; justify-content: space-between; min-height: 75px; }
.qualifier-mini-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mini-tag { background: white; border: 1px solid #e1dbe6; color: #62556a; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.qualifier-footer-link { font-size: 9px; color: #a494b7; font-style: italic; text-align: right; margin-top: auto; }

/* --- TABLES & ACCESSOIRES --- */
.single-zone-workspace { width: 100%; max-width: 1200px; }
.minimal-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.minimal-table th { text-align: left; padding: 6px 8px; color: #76697f; border-bottom: 2px solid var(--border-color); }
.minimal-table td { padding: 8px; border-bottom: 1px solid #edf2f7; }
.tech-id { font-family: monospace; font-weight: bold; color: var(--primary-light); }
.badge { display: inline-block; padding: 2px 5px; border-radius: 4px; font-size: 10px; font-weight: bold; }
.badge-active { background: #e6fffa; color: #234e52; }
.error-panel { background: white; border: 1px dashed #e53e3e; padding: 30px; text-align: center; color: #e53e3e; font-size: 13px; }

.footer-tech-bar { background-color: var(--primary-dark); color: #76697f; height: 15px; font-size: 9px; font-weight: 500; display: flex; align-items: center; justify-content: center; border-top: 1px solid #1a0f28; flex-shrink: 0; box-sizing: border-box; }
.footer-link { color: var(--accent-color); text-decoration: none; font-weight: 600; margin-left: 5px; }