/* ============================================================================
   PLC DESK Conciergerie : app.css
   Source unique de style de l'application (CONTEXTE section 5, mission UX 7.1).
   Organisation :
     1. Tokens (:root)             : mission UX section 1 (valeurs maquette intouchables)
     2. Base + layout maquette     : CSS repris de maquettes/back-office.html (tel quel)
     3. Composants c-*             : bibliotheque UI (mission UX section 3)
     4. Shell (login, sidebar+)    : ecrans du socle
     5. Accessibilite / motion     : focus-visible, prefers-reduced-motion
   Regles : classes maquette jamais renommees (RG-UX-17), z-index via --z-* (RG-UX-21),
   aucune couleur de statut hors registre UI.STATUS + .c-badge--<famille> (RG-UX-2).
   ============================================================================ */

:root {
    /* == Layout (maquette) == */
    --sidebar-w: 220px;
    --sidebar-collapsed-w: 60px;
    --topbar-h: 56px;

    /* == Surfaces (maquette) == */
    --bg-app: #F5F4F1;
    --bg-sidebar: #1A1A1C;
    --bg-sidebar-hover: rgba(255,255,255,0.06);
    --bg-sidebar-active: rgba(255,255,255,0.10);
    --bg-card: #FFFFFF;
    --bg-input: #FAFAF8;

    /* == Texte (maquette) == */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #AEAEB2;
    --text-sidebar: #8E8E93;
    --text-sidebar-active: #FFFFFF;

    /* == Bordures et accent (maquette) == */
    --border: #E5E5EA;
    --border-light: #F2F2F7;
    --accent: #B8976A;
    --accent-hover: #A07D52;
    --accent-light: rgba(184,151,106,0.08);
    --accent-soft: rgba(184,151,106,0.12); /* utilise par comm-avatar-sm / prov-* (implicite maquette) */

    /* == Couleurs semantiques (maquette, base des statuts) == */
    --green: #34C759;
    --orange: #FF9F0A;
    --red: #FF3B30;
    --blue: #5E5CE6;
    --purple: #AF52DE;
    --gray: #8E8E93;

    /* == Paires tint/ink : fond teinte + texte fonce lisible (mission UX) == */
    --green-ink:  #1B7A34;  --green-tint:  rgba(52,199,89,.10);
    --orange-ink: #CC7F08;  --orange-tint: rgba(255,159,10,.10);
    --red-ink:    #CC2D25;  --red-tint:    rgba(255,59,48,.08);
    --blue-ink:   #4B49B8;  --blue-tint:   rgba(94,92,230,.08);
    --purple-ink: #7B3FA8;  --purple-tint: rgba(175,82,222,.08);
    --gray-ink:   #6E6E73;  --gray-tint:   rgba(142,142,147,.10);
    --accent-ink: #8B6F47;  --accent-tint: rgba(184,151,106,.10);

    /* == Typographie == */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'SF Mono', ui-monospace, 'Menlo', monospace;
    --fs-2xs: 10px;
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-md: 13px;   /* taille UI par defaut */
    --fs-base: 14px;
    --fs-lg: 16px;
    --fs-xl: 18px;
    --fs-2xl: 22px;
    --fs-3xl: 26px;

    /* == Echelle d'espacement 4px == */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-7: 28px;  --sp-8: 32px;
    /* Exceptions maquette a ne pas corriger : gap grille 14px, padding kpi 18px 20px, padding content 28px. */

    /* == Radius et ombres (maquette) == */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.08);
    --shadow-modal: 0 24px 48px rgba(0,0,0,.12);

    /* == Mouvement (jamais de transition > 250ms) == */
    --ease: cubic-bezier(.4,0,.2,1);
    --dur-fast: 150ms;
    --dur: 200ms;
    --dur-slow: 250ms;

    /* == Z-index layers (echelle unique) == */
    --z-sticky: 10;
    --z-sidebar: 100;
    --z-dropdown: 500;
    --z-modal: 1000;
    --z-palette: 1500;
    --z-toast: 2000;

    /* == Densite de table == */
    --row-h: 41px;
    --row-h-compact: 33px;

    /* == Hauteur unique des controles (inputs, selects, boutons) == */
    --control-h: 38px;
}

/* ============================================================================
   2. BASE + LAYOUT MAQUETTE (repris de maquettes/back-office.html, adapte :
      z-index re-bases sur les tokens, bk-booked.confirmed passe au vert)
   ============================================================================ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: var(--font);
    background: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}

.app { display:flex; height:100vh; overflow:hidden; }

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s var(--ease);
}
.sidebar::-webkit-scrollbar { width:0; }

.sidebar-brand-row {
    display: flex;
    align-items: center;
    padding: 20px 12px 24px 16px;
    gap: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    flex: 1; min-width: 0;
}
.sidebar-brand svg { flex-shrink:0; }
.sidebar-brand span {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.sidebar-section {
    padding: 0 8px;
    margin-bottom: 4px;
}
.sidebar-section-label {
    padding: 16px 12px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #58585D;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s var(--ease);
    position: relative;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: #C7C7CC; }
.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.nav-item svg { width:18px; height:18px; flex-shrink:0; opacity:.7; }
.nav-item.active svg { opacity:1; }

.sidebar-footer {
    margin-top: auto;
    padding: 12px 8px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
}

/* === Sidebar Toggle === */
.sidebar-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: none; border-radius: 6px;
    background: rgba(255,255,255,.06); color: #8E8E93; cursor: pointer;
    flex-shrink: 0; transition: all .2s var(--ease);
}
.sidebar-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }

/* === Sidebar Collapsed State === */
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .nav-item span {
    opacity: 0; width: 0; overflow: hidden; white-space: nowrap;
    transition: opacity .15s var(--ease), width .15s var(--ease);
}
.sidebar.collapsed .sidebar-brand-row {
    flex-direction: column; align-items: center;
    padding: 16px 0 12px; gap: 8px;
}
.sidebar.collapsed .sidebar-brand { justify-content: center; gap: 0; flex: none; }
.sidebar.collapsed .sidebar-section { padding: 0 6px; }
.sidebar.collapsed .sidebar-section-label { height: 0; padding: 0; margin: 4px 0; }
.sidebar.collapsed .nav-item { padding: 10px; justify-content: center; gap: 0; }
.sidebar.collapsed .nav-item.active::before { left: -6px; }
.sidebar.collapsed .sidebar-footer { padding: 12px 6px 16px; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* Tooltip on hover when collapsed */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--bg-sidebar); color: #fff; font-size: 12px; font-weight: 500;
    padding: 4px 10px; border-radius: 6px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s;
    box-shadow: 0 2px 8px rgba(0,0,0,.3); z-index: var(--z-sidebar);
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }

/* === MAIN === */
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }

/* === TOPBAR === */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.topbar-left { display:flex; align-items:center; gap:16px; }
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.topbar-breadcrumb .separator { color: var(--text-tertiary); font-weight:400; }

.event-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-input);
    cursor: pointer;
    transition: all .15s var(--ease);
}
.event-selector:hover { border-color: var(--accent); }
.event-selector .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.topbar-right { display:flex; align-items:center; gap:8px; }

.search-input {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.search-input svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 1;
}
/* Selecteurs [type] en plus : la regle unifiee des controles (padding 0 12px,
   plus loin dans le fichier) ne doit JAMAIS remettre le texte sous la loupe. */
.search-input input,
.search-input input[type="text"],
.search-input input[type="search"] {
    height: var(--control-h);
    box-sizing: border-box;
    padding: 0 12px 0 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    min-width: 180px;
    transition: all .15s var(--ease);
}
.search-input input:focus { border-color: var(--accent); background: #fff; }
.search-input input::placeholder { color: var(--text-tertiary); }

.topbar-btn {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all .15s var(--ease);
    position: relative;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.topbar-btn svg { width:16px; height:16px; }
.topbar-btn .badge-dot {
    position:absolute; top:5px; right:5px;
    width:8px; height:8px;
    border-radius:50%;
    background: var(--red);
    border: 2px solid var(--bg-card);
}

.user-avatar {
    width:32px; height:32px;
    border-radius:50%;
    background: linear-gradient(135deg, var(--accent), #8B6F47);
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-weight:600; font-size:12px;
    cursor:pointer;
}

/* === CONTENT AREA === */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}
.content::-webkit-scrollbar { width:6px; }
.content::-webkit-scrollbar-track { background:transparent; }
.content::-webkit-scrollbar-thumb { background:#D1D1D6; border-radius:3px; }
.content::-webkit-scrollbar-thumb:hover { background:#8E8E93; }

.page { display:none; animation: fadeIn .2s var(--ease); }
.page.active { display:block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header-left {}
.page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.3;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* === KPI CARDS === */
.kpi-grid {
    display: grid;
    /* UX-12 : auto-fit borne, la grille se dimensionne au nombre de cartes,
       plus de rangee orpheline 3+2 ou 3+1. */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all .15s var(--ease);
    border-left: 3px solid transparent;
}
.kpi-card:hover { box-shadow: var(--shadow); cursor: pointer; transform: translateY(-1px); }
.kpi-card.kpi-guests { border-left-color: var(--accent); }
.kpi-card.kpi-requests { border-left-color: var(--orange); }
.kpi-card.kpi-bookings { border-left-color: var(--green); }
.kpi-card.kpi-transfers { border-left-color: var(--blue); }
.kpi-card.kpi-lifestyle { border-left-color: var(--purple); }
.kpi-card.kpi-flights { border-left-color: #FF6B6B; }

.kpi-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon svg { width:20px; height:20px; }
.kpi-guests .kpi-icon { background: var(--accent-light); color: var(--accent); }
.kpi-requests .kpi-icon { background: rgba(255,159,10,.08); color: var(--orange); }
.kpi-bookings .kpi-icon { background: rgba(52,199,89,.08); color: var(--green); }
.kpi-transfers .kpi-icon { background: rgba(94,92,230,.08); color: var(--blue); }

.kpi-info {}
.kpi-value {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text-primary);
}
.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .15s var(--ease);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title svg { width:16px; height:16px; color: var(--text-secondary); }
.card-title .count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-app);
    padding: 2px 8px;
    border-radius: 10px;
}
.card-action {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.card-action:hover { text-decoration: underline; }
.card-body { padding: 16px 20px; }
.card-body.no-pad { padding: 0; }

/* === GRID LAYOUTS === */
.grid-3 { display:grid; grid-template-columns: repeat(3,1fr); gap:14px; margin-bottom:24px; }
.grid-2 { display:grid; grid-template-columns: repeat(2,1fr); gap:14px; margin-bottom:24px; }
.grid-responsive { display:grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap:14px; margin-bottom:20px; }

/* === GUEST LIST IN DASHBOARD === */
.dash-guest {
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}
.dash-guest:last-child { border-bottom: none; }
.dash-guest-info { display:flex; flex-direction:column; }
.dash-guest-name { font-size:13px; font-weight:500; color: var(--text-primary); }
.dash-guest-detail { font-size:12px; color: var(--text-secondary); }
.dash-guest-time { font-size:11px; color: var(--text-tertiary); font-weight:500; }

/* === ACTIVITY LIST === */
.activity-row {
    padding: 12px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background .1s;
}
.activity-row:last-child { border-bottom:none; }
.activity-row:hover { background: var(--bg-app); }
.activity-icon {
    width:30px; height:30px;
    border-radius: var(--radius-sm);
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0;
    background: var(--bg-app);
}
.activity-icon svg { width:14px; height:14px; color: var(--text-secondary); }
.activity-body { flex:1; min-width:0; }
.activity-text { font-size:13px; color: var(--text-primary); line-height:1.4; }
.activity-text strong { font-weight:600; }
.activity-text .by { color: var(--text-secondary); font-weight:400; }
.activity-meta { font-size:12px; color: var(--text-tertiary); margin-top:2px; display:flex; gap:8px; align-items:center; }
.activity-time { font-size:12px; color: var(--text-tertiary); flex-shrink:0; white-space:nowrap; }

.status-badge {
    display:inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}
.status-badge.old { background: rgba(255,59,48,.1); color: var(--red); text-decoration: line-through; }
.status-badge.new { background: rgba(52,199,89,.1); color: var(--green); }

/* === TABLE === */
.table-wrap { overflow-x: auto; }
table { width:100%; border-collapse:collapse; }
thead { background: var(--bg-app); }
th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}
th.sortable:hover { color: var(--text-primary); }
th.sortable .sort-icon {
    font-size: 14px;
    opacity: 0;
    margin-left: 4px;
    display: inline-block;
    transition: opacity .15s;
    vertical-align: middle;
}
th.sortable:hover .sort-icon { opacity: .45; }
th.sortable.asc .sort-icon { opacity:1; }
th.sortable.asc .sort-icon::after { content:'↑'; }
th.sortable.desc .sort-icon { opacity:1; }
th.sortable.desc .sort-icon::after { content:'↓'; }
th.sortable.asc .sort-icon,
th.sortable.desc .sort-icon { font-size:0; }
th.sortable.asc .sort-icon::after,
th.sortable.desc .sort-icon::after { font-size:14px; }
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}
tbody tr { transition: background .1s; }
tbody tr:hover { background: rgba(0,0,0,.015); }
#masterlistTable tbody tr { cursor:pointer; transition:background .1s; }
#masterlistTable tbody tr:hover { background:rgba(184,151,106,.05); }
.td-portal { width:40px; text-align:center; padding:0 !important; }
.portal-btn {
    width:30px; height:30px; border:none; background:none; border-radius:6px;
    cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
    color:var(--text-tertiary); transition:all .15s;
}
.portal-btn:hover { background:rgba(184,151,106,.1); color:var(--accent); }
.portal-btn svg { width:15px; height:15px; }

.guest-name-cell {
    font-weight: 500;
    color: var(--text-primary);
}
.guest-name-cell .sub { font-weight:400; font-size:12px; color: var(--text-secondary); }
.guest-link { color: var(--text-primary); text-decoration:none; }
.guest-link:hover { color: var(--accent); }

/* service count pill */
.svc-pill {
    display:inline-flex; align-items:center; gap:3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: #2C2C2E;
    color: #fff;
}
.svc-pill.empty { background:transparent; color: var(--text-tertiary); }
.svc-pill .svc-dot { width:5px; height:5px; border-radius:50%; background:currentColor; }

/* hotel badge */
.hotel-badge {
    display:inline-flex; align-items:center; gap:4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--accent-light);
    color: var(--accent);
}
.hotel-badge .dot { width:5px; height:5px; border-radius:50%; background: var(--accent); flex-shrink:0; }
/* UX-103 : nom complet ellipse en CSS (jamais de coupe seche slice), tooltip en place */
.hotel-badge .hb-name { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* status ready / incomplete */
.status-pill {
    display:inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.status-pill.ready { background: rgba(52,199,89,.1); color: var(--green); }
.status-pill.incomplete { background: rgba(255,59,48,.08); color: var(--red); }
.status-pill.pending { background: rgba(255,159,10,.08); color: var(--orange); }

/* === On the Road === */
tr.on-road { animation: onRoadPulse 3s ease-in-out infinite; }
@keyframes onRoadPulse {
    0%, 100% { background: transparent; }
    50% { background: rgba(52,199,89,.06); }
}
tr.on-road td:first-child::before {
    content: ''; display: inline-block; width: 7px; height: 7px;
    background: var(--green); border-radius: 50%; margin-right: 8px; vertical-align: middle;
    animation: onRoadDot 1.5s ease-in-out infinite;
}
@keyframes onRoadDot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.onroad-dot-icon {
    width: 7px; height: 7px; border-radius: 50%; background: var(--green);
    display: inline-block; animation: onRoadDot 1.5s ease-in-out infinite;
}
.btn-onroad.active {
    background: var(--green); color: #fff; border-color: var(--green);
}
.btn-onroad.active .onroad-dot-icon { background: #fff; }

.btn-eticket {
    width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-card); color: var(--accent); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: all .15s var(--ease);
}
.btn-eticket:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent-hover); }

/* === Custom select styling === */
select, .custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
select:hover { border-color: var(--accent); }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); outline: none; }
select option { padding: 8px 12px; background: var(--bg-card); color: var(--text-primary); }

/* Request type tags */
.req-type-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: var(--accent-light);
    color: var(--accent-hover);
    text-transform: capitalize;
}

/* Leaflet map fix */
#guestMap .leaflet-control-zoom a { color: var(--text-primary); }
.map-cluster {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    border: 2px solid #fff;
}
.map-marker {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    font-family: var(--font);
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    border: 2px solid #fff;
}
.loc-row { cursor: pointer; }
.loc-row:hover { background: var(--accent-light); }

/* Heatmap cells */
.hm-cell {
    width: 28px; height: 28px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: transform .1s var(--ease);
}
.hm-cell:hover { transform: scale(1.3); z-index: 1; }

/* Stat cards responsive : la grille KPI est en auto-fit (UX-12), plus d'override. */
@media (max-width:700px) {
    .grid-responsive { grid-template-columns:1fr; }
}
@media (max-width:1000px) {
    #page-location > div:last-child { grid-template-columns:1fr; }
}

/* type badges */
.type-badge {
    display:inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.type-badge.bus { background: var(--accent-light); color: var(--accent); }
.type-badge.mle { background: rgba(94,92,230,.08); color: var(--blue); }
.type-badge.pub { background: rgba(174,174,178,.1); color: var(--text-secondary); }
.type-badge.vip { background: var(--accent-light); color: var(--accent); }

/* === FILTER BAR === */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}
.filter-bar label { font-size:12px; color: var(--text-secondary); font-weight:500; }
.filter-select {
    height: var(--control-h);
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-primary);
    background-color: var(--bg-input);
    cursor:pointer;
}
.filter-bar .spacer { flex:1; }
.filter-count { font-size:12px; color: var(--text-tertiary); }

/* === TABS === */
.tabs {
    display:flex; gap:0;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    margin-bottom: 16px; /* espace sous le trait des onglets (retour utilisateur 2026-07-04) */
}
.tab {
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s var(--ease);
    display:flex; align-items:center; gap:6px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.tab svg { width:14px; height:14px; }
.tab .tab-count {
    font-size:11px; background: var(--bg-app); color: var(--text-tertiary);
    padding:1px 6px; border-radius:8px;
}

/* === GANTT TIMELINE === */
.gantt {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--border-light);
}
.gantt::-webkit-scrollbar { height: 8px; }
.gantt::-webkit-scrollbar-track { background: var(--border-light); border-radius: 4px; }
.gantt::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; min-width: 40px; }
.gantt::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
.gantt-header {
    display:flex; align-items:center; justify-content:space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}
.gantt-nav { display:flex; align-items:center; gap:6px; }
.gantt-nav-btn {
    width:26px; height:26px;
    border:1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    color: var(--text-secondary);
    font-size:13px;
    transition: all .15s;
}
.gantt-nav-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.gantt-period { font-size:13px; font-weight:500; color: var(--text-primary); min-width:90px; text-align:center; }
.gantt-actions { display:flex; gap:8px; align-items:center; }
.gantt-actions .btn-sm {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-secondary);
    cursor:pointer;
    display:flex; align-items:center; gap:4px;
    transition: all .15s;
}
.gantt-actions .btn-sm:hover { border-color: var(--accent); color: var(--text-primary); }
.gantt-actions .btn-sm svg { width:12px; height:12px; }

.gantt-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}
.gantt-table th {
    padding: 10px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 3;
}
.gantt-table th:first-child {
    text-align: left;
    padding-left: 16px;
    width: 100px;
    min-width: 100px;
}
.gantt-table th .g-date {
    display: block;
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 10px;
    margin-top: 1px;
}
.gantt-table th.g-today {
    background: rgba(255,59,48,.04);
    position: relative;
}
.gantt-table th.g-today .g-date { color: var(--red); font-weight: 600; }
.gantt-table th.g-today .g-now {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.gantt-table td {
    border-bottom: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    padding: 6px 5px;
    vertical-align: top;
    position: relative;
}
.gantt-table td:first-child { border-left: none; }
.gantt-table td.g-today-col { background: rgba(255,59,48,.015); }
.gantt-table td.g-today-col::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 1px;
    background: rgba(255,59,48,.12);
    z-index: 1;
}
.gantt-table .g-row-label {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    vertical-align: top;
    white-space: nowrap;
    border-left: none;
}
.gantt-table .g-row-label .g-row-inner {
    display: flex;
    align-items: center;
    gap: 6px;
}
.gantt-table .g-row-label svg { width:14px; height:14px; flex-shrink:0; }

/* Timeline filter pills */
.tl-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s var(--ease);
}
.tl-filter:hover { border-color: var(--accent); color: var(--text-primary); }
.tl-filter.active {
    background: var(--text-primary);
    color: #fff;
    border-color: var(--text-primary);
}
.tl-filter svg { flex-shrink:0; }

/* Timeline avatar */
.tl-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8B6F47);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 9px;
    flex-shrink: 0;
}

/* Gantt blocks */
.gb {
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.35;
    cursor: pointer;
    transition: all .15s;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}
.gb:last-child { margin-bottom: 0; }
.gb:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.gb-head { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
.gb .gb-title { font-weight:500; flex:1; }
.gb .gb-status {
    font-size: 9px;
    /* UX-32 : sentence case comme tous les badges (plus de CHECKED IN en capitales) */
    text-transform: none;
    letter-spacing: .4px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 1px;
}
.gb .gb-detail { font-size: 10px; opacity:.7; margin-top:1px; }
.gb .gb-time { font-size: 10px; opacity:.65; }

.gb.confirmed { background:rgba(52,199,89,.08); color:#1B7A34; border-left:3px solid var(--green); }
.gb.delayed { background:rgba(255,59,48,.07); color:#CC2D25; border-left:3px solid var(--red); }
.gb.scheduled { background:rgba(94,92,230,.07); color:#4B49B8; border-left:3px solid var(--blue); }
.gb.requested { background:rgba(255,159,10,.07); color:#CC7F08; border-left:3px solid var(--orange); }
.gb.hotel-span {
    background: rgba(184,151,106,.10);
    color: #8B6F47;
    border-left: 3px solid var(--accent);
    padding: 8px 10px;
}
.gb.hotel-span .gb-status { float:right; }

/* Connection dot */
.gb-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 2px solid;
    position: absolute;
    z-index: 3;
}
.gb-dot.dot-start { left:-4px; top:12px; }
.gb-dot.dot-end { right:-4px; top:12px; }
.gb-dot.dot-green { border-color: var(--green); background: rgba(52,199,89,.3); }
.gb-dot.dot-red { border-color: var(--red); background: rgba(255,59,48,.3); }
.gb-dot.dot-orange { border-color: var(--orange); background: rgba(255,159,10,.3); }
.gb-dot.dot-accent { border-color: var(--accent); background: rgba(184,151,106,.3); }

/* Conflict bar */
.gantt-conflicts {
    padding: 10px 20px;
    background: rgba(255,59,48,.04);
    border-top: 1px solid rgba(255,59,48,.12);
    display:flex; align-items:flex-start; gap:8px;
}
.gantt-conflicts svg { width:14px; height:14px; color: var(--red); flex-shrink:0; margin-top:2px; }
.gantt-conflicts .conflict-title { font-size:12px; font-weight:600; color: var(--red); margin-bottom:2px; }
.gantt-conflicts .conflict-item { font-size:12px; color: var(--text-secondary); line-height:1.6; }

/* === EVENT CARDS === */
.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all .15s var(--ease);
    cursor: pointer;
}
.event-card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.event-card.active-event { border-color: var(--accent); border-left: 3px solid var(--accent); }
.event-card-info { flex:1; }
.event-card-title { font-size:15px; font-weight:600; color: var(--text-primary); margin-bottom:2px; }
.event-card-code { font-size:12px; color: var(--text-tertiary); margin-bottom:8px; }
.event-card-meta { display:flex; gap:16px; font-size:12px; color: var(--text-secondary); }
.event-card-meta span { display:flex; align-items:center; gap:4px; }
.event-card-meta svg { width:13px; height:13px; }
.event-card-actions { display:flex; gap:6px; }
.event-card-actions button {
    width:28px; height:28px;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    background:var(--bg-card);
    cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    color:var(--text-secondary);
}
.event-card-actions button:hover { border-color:var(--accent); color:var(--text-primary); }
.event-card-actions button svg { width:13px; height:13px; }

.event-status-tabs {
    display:flex; gap:20px; margin-bottom:20px;
}
.event-status-tab {
    display:flex; align-items:center; gap:6px;
    font-size:13px; font-weight:500; color: var(--text-secondary);
}
.event-status-tab .dot { width:7px; height:7px; border-radius:50%; }
.event-status-tab .dot.preparing { background: var(--orange); }
.event-status-tab .dot.active { background: var(--green); }
.event-status-tab .dot.done { background: var(--text-tertiary); }

/* === BUTTONS === */
.btn {
    display:inline-flex; align-items:center; gap:6px;
    height: var(--control-h);
    box-sizing: border-box;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s var(--ease);
    border: 1px solid transparent;
}
.btn svg { width:14px; height:14px; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-hover); }
.btn-secondary { background:var(--bg-card); color:var(--text-primary); border:1px solid var(--border); }
.btn-secondary:hover { border-color:var(--accent); }
.btn-accent { background: var(--accent); color:#fff; }
.btn-accent:hover { background: var(--accent-hover); }

/* === MASTERLIST ACTIONS BAR === */
.ml-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.ml-actions .search-input,
.ml-actions .search-input input,
.ml-actions .btn {
    height: var(--control-h);
}

/* === BOOKING GRID === */
/* UX-101 : le wrapper scrolle sur les 2 axes ; colonnes jour a largeur fixe
   (voir colgroup pose par accommodation.js), Hotel/Room/Type sticky a gauche,
   header dates sticky en haut. */
.bk-scroll { max-height: calc(100vh - 250px); min-height: 260px; overflow: auto; }
.booking-grid { min-width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.booking-grid th {
    padding:8px 6px; font-size:11px; font-weight:600; color:var(--text-secondary);
    text-align:center; white-space:nowrap; border-bottom:1px solid var(--border);
    background:var(--bg-card); position:sticky; top:0; z-index:3;
}
.booking-grid th.bg-sticky { text-align:left; padding-left:16px; }
.booking-grid .bk-col-1 { position:sticky; left:0; background:var(--bg-card); z-index:2; }
.booking-grid .bk-col-2 { position:sticky; left:150px; background:var(--bg-card); z-index:2; }
.booking-grid .bk-col-3 {
    position:sticky; left:214px; background:var(--bg-card); z-index:2;
    border-right:1px solid var(--border);
    box-shadow:4px 0 6px -3px rgba(0,0,0,.08); /* indicateur de scroll horizontal */
}
.booking-grid th.bk-col-1, .booking-grid th.bk-col-2, .booking-grid th.bk-col-3 { z-index:4; }
/* le nom de l'hotel reste lisible pendant le scroll horizontal */
.bk-row-label { position:sticky; left:16px; display:inline-block; max-width:calc(100vw - 420px); }
.booking-grid th.bg-today {
    background:rgba(184,151,106,.08); color:var(--accent);
    border-bottom:2px solid var(--accent);
}
/* white-space normal : le nowrap global des td ferait deborder les cellules
   colspan (chips Unassigned) et exploserait la largeur scrollable (UX-101) */
.booking-grid td { padding:0; height:40px; border-bottom:1px solid var(--border); font-size:12px; white-space:normal; }
.booking-grid .bk-hotel-header td { border-bottom:none; }
.bk-hotel-name {
    padding:14px 16px 6px !important; font-size:12px; font-weight:700;
    color:var(--text-primary); letter-spacing:.02em; text-transform:uppercase;
    background:var(--bg-app);
}
.bk-hotel-count { font-weight:400; color:var(--text-tertiary); margin-left:8px; text-transform:none; letter-spacing:0; }
.bk-cell-hotel { padding:0 6px 0 16px !important; color:var(--text-secondary); font-size:11px; }
.bk-cell-room { padding:0 6px !important; font-weight:600; color:var(--text-primary); text-align:center; }
.bk-cell-type { padding:0 6px !important; color:var(--text-secondary); font-size:11px; }
.bk-free {
    background:repeating-linear-gradient(
        45deg, transparent, transparent 4px,
        rgba(0,0,0,.015) 4px, rgba(0,0,0,.015) 5px
    );
    border-left:1px solid var(--border);
}
.bk-booked {
    border-left:1px solid var(--border);
    position:relative; text-align:center; vertical-align:middle;
}
.bk-booked.confirmed { background:var(--green-tint); } /* decision UX : confirmed = vert partout */
.bk-booked.pending { background:rgba(255,159,10,.08); }
.bk-booked.requested { background:rgba(94,92,230,.07); }
.bk-guest-name {
    font-size:11px; font-weight:600; white-space:nowrap; padding:0 8px;
    overflow:hidden; text-overflow:ellipsis;
}
.bk-booked.confirmed .bk-guest-name { color:var(--green-ink); }
.bk-booked.pending .bk-guest-name { color:#CC7F08; }
.bk-booked.requested .bk-guest-name { color:#4B49B8; }

/* === DETAIL MODAL === */
.modal-overlay {
    position:fixed; inset:0; z-index:var(--z-modal);
    background:rgba(0,0,0,.35); backdrop-filter:blur(4px);
    display:flex; align-items:center; justify-content:center;
    opacity:0; visibility:hidden; transition:opacity .2s, visibility .2s;
}
.modal-overlay.open { opacity:1; visibility:visible; }
.detail-modal {
    background:var(--bg-card); border-radius:14px; box-shadow:0 24px 80px rgba(0,0,0,.18);
    width:480px; max-width:92vw; max-height:85vh; overflow-y:auto;
    animation: modalIn .2s var(--ease);
}
@keyframes modalIn { from { opacity:0; transform:translateY(12px) scale(.97); } to { opacity:1; transform:none; } }
.detail-modal .dm-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:20px 24px 0; gap:12px;
}
.detail-modal .dm-header h3 { font-size:16px; font-weight:600; color:var(--text-primary); margin:0; }
.detail-modal .dm-close {
    width:30px; height:30px; border-radius:8px; border:none; background:rgba(0,0,0,.04);
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    color:var(--text-secondary); transition:all .15s;
}
.detail-modal .dm-close:hover { background:rgba(0,0,0,.08); color:var(--text-primary); }
.detail-modal .dm-body { padding:16px 24px 24px; }
.dm-row {
    display:flex; justify-content:space-between; align-items:flex-start;
    padding:10px 0; border-bottom:1px solid var(--border); font-size:13px;
}
.dm-row:last-child { border-bottom:none; }
.dm-label { color:var(--text-secondary); font-weight:500; min-width:100px; }
.dm-value { color:var(--text-primary); text-align:right; font-weight:400; }
.dm-status {
    display:inline-flex; align-items:center; gap:6px;
    padding:4px 10px; border-radius:6px; font-size:12px; font-weight:600;
}
.dm-status.st-confirmed { background:rgba(52,199,89,.08); color:#1B7A34; }
.dm-status.st-delayed { background:rgba(255,59,48,.07); color:#CC2D25; }
.dm-status.st-scheduled { background:rgba(94,92,230,.07); color:#4B49B8; }
.dm-status.st-requested { background:rgba(255,159,10,.07); color:#CC7F08; }
.dm-status.st-hotel { background:rgba(184,151,106,.10); color:#8B6F47; }
.detail-modal .dm-actions { display:flex; gap:8px; padding:0 24px 20px; }
.detail-modal .dm-actions .btn { flex:1; justify-content:center; }

/* === ETICKET MODAL === */
.et-guest { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.et-guest-avatar { width:36px; height:36px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:600; flex-shrink:0; }
.et-guest-name { font-size:14px; font-weight:600; color:var(--text-primary); }
.et-guest-co { font-size:12px; color:var(--text-secondary); }
.et-pnr { display:inline-block; font-family:monospace; font-size:13px; font-weight:600; letter-spacing:1px; background:var(--accent-light); color:var(--accent-hover); padding:4px 10px; border-radius:var(--radius-sm); margin-bottom:16px; }
.et-leg { background:var(--bg-app); border-radius:var(--radius); padding:14px 16px; margin-bottom:10px; }
.et-leg-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.et-leg-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--text-tertiary); }
.et-leg-status { font-size:11px; font-weight:600; padding:3px 8px; border-radius:4px; }
.et-leg-status.confirmed { background:rgba(52,199,89,.1); color:#1B7A34; }
.et-leg-status.delayed { background:rgba(255,59,48,.08); color:#CC2D25; }
.et-leg-status.scheduled { background:rgba(255,159,10,.08); color:#CC7F08; }
.et-route { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.et-airport { text-align:center; }
.et-airport-code { font-size:18px; font-weight:700; color:var(--text-primary); }
.et-airport-city { font-size:11px; color:var(--text-secondary); }
.et-flight-line { flex:1; display:flex; align-items:center; gap:0; position:relative; }
.et-flight-line::before { content:''; position:absolute; top:50%; left:0; right:0; height:1px; background:var(--border); }
.et-flight-line svg { position:relative; z-index:1; background:var(--bg-app); color:var(--accent); margin:0 auto; }
.et-leg-details { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.et-detail { font-size:12px; }
.et-detail-label { color:var(--text-tertiary); font-size:11px; }
.et-detail-value { color:var(--text-primary); font-weight:500; }

/* === GUEST PROFILE TABS === */
.profile-back {
    display:flex; align-items:center; gap:4px;
    font-size:12px; color:var(--text-secondary); cursor:pointer;
    margin-bottom:12px; text-decoration:none;
}
.profile-back:hover { color: var(--accent); }
.profile-back svg { width:14px; height:14px; }

.profile-header {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:20px;
}
.profile-header-left { display:flex; align-items:center; gap:12px; }
.profile-avatar {
    width:44px; height:44px;
    border-radius:50%;
    background: linear-gradient(135deg, var(--accent), #8B6F47);
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-weight:600; font-size:16px;
}
.profile-name { font-size:20px; font-weight:600; color:var(--text-primary); }
.profile-company { font-size:13px; color:var(--text-secondary); }

/* === FORM === */
.form-section { margin-bottom:20px; }
.form-section-title {
    font-size:11px; font-weight:600; text-transform:uppercase;
    color:var(--text-secondary); letter-spacing:.5px; margin-bottom:12px;
}
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.form-row.full { grid-template-columns:1fr; }
.form-group { display:flex; flex-direction:column; }
/* Les controles heritent de la regle unifiee globale (hauteur --control-h,
   fond --bg-input, radius, padding) : plus de styles disperses ici. */
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-label { font-size:12px; font-weight:500; color:var(--text-primary); margin-bottom:6px; }
.form-label .req { color:var(--red); }
.form-label .opt { color:var(--text-tertiary); font-weight:400; }
.form-value { font-size:13px; color:var(--text-primary); padding:8px 0; }

/* Regle unique des controles de saisie : MEME hauteur (--control-h = .btn),
   meme fond --bg-input, meme radius, meme padding horizontal partout (modales,
   barres de filtres, Settings). background-color (jamais le shorthand) pour ne
   pas ecraser le chevron SVG des selects (regle "Custom select styling"). */
input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
input[type="password"], input[type="number"], input[type="url"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"],
input:not([type]), select, textarea {
    height: var(--control-h);
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text-primary);
    background-color: var(--bg-input);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea { height:auto; min-height:80px; padding:8px 12px; resize:vertical; }

/* === MODAL === */
.modal {
    display:none; position:fixed; inset:0;
    background:rgba(0,0,0,.25);
    backdrop-filter:blur(4px);
    z-index:var(--z-modal);
    align-items:center; justify-content:center;
}
.modal.active { display:flex; }
.modal-content {
    background:var(--bg-card);
    border-radius:var(--radius-lg);
    max-width:560px; width:92%;
    max-height:85vh; overflow-y:auto;
    box-shadow: 0 24px 48px rgba(0,0,0,.12);
}
.modal-header {
    padding:18px 24px;
    border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between;
}
.modal-title { font-size:16px; font-weight:600; display:flex; align-items:center; gap:10px; min-width:0; }
.modal-close {
    width:28px; height:28px; border:none; background:none;
    cursor:pointer; color:var(--text-secondary);
    display:flex; align-items:center; justify-content:center;
    border-radius:var(--radius-sm);
}
.modal-close:hover { background:var(--bg-app); color:var(--text-primary); }
.modal-body { padding:24px; }
.modal-footer {
    padding:16px 24px;
    border-top:1px solid var(--border);
    display:flex; gap:10px; justify-content:flex-end;
}

/* === TOAST === */
.toast-container { position:fixed; top:16px; right:16px; z-index:var(--z-toast); }
.toast {
    background:var(--bg-card); border:1px solid var(--border);
    border-radius:var(--radius); padding:12px 16px;
    margin-bottom:8px; min-width:280px;
    box-shadow:var(--shadow-lg);
    animation: slideIn .25s var(--ease);
    font-size:13px;
}
.toast.success { border-left:3px solid var(--green); }
.toast.error { border-left:3px solid var(--red); }
@keyframes slideIn { from { transform:translateX(120%); opacity:0; } to { transform:none; opacity:1; } }

/* === COMMUNICATIONS === */
.comm-layout { display:grid; grid-template-columns:320px 1fr; gap:0; height:calc(100vh - 180px); min-height:500px; }
.comm-sidebar { border-right:1px solid var(--border-light); display:flex; flex-direction:column; overflow:hidden; }
.comm-sidebar-header { padding:12px 16px; border-bottom:1px solid var(--border-light); }
.comm-tabs { display:flex; gap:2px; background:var(--bg-app); border-radius:var(--radius); padding:3px; }
.comm-tab { flex:1; padding:6px 4px; font-size:11px; font-weight:500; text-align:center; border:none; background:transparent; color:var(--text-tertiary); cursor:pointer; border-radius:var(--radius-sm); transition:all .15s; white-space:nowrap; font-family:var(--font); }
.comm-tab.active { background:var(--bg-card); color:var(--text-primary); box-shadow:0 1px 2px rgba(0,0,0,.06); }
.comm-tab .ctab-count { display:inline-block; font-size:10px; background:var(--accent); color:#fff; border-radius:8px; padding:0 5px; margin-left:3px; min-width:16px; line-height:16px; }
.comm-search { padding:8px 12px; border-bottom:1px solid var(--border-light); }
.comm-search input { width:100%; border:1px solid var(--border); border-radius:var(--radius-sm); padding:0 10px 0 30px; font-size:12px; font-family:var(--font); background-color:var(--bg-input); color:var(--text-primary); outline:none; }
.comm-search input:focus { border-color:var(--accent); }
.comm-search-wrap { position:relative; }
.comm-search-wrap svg { position:absolute; left:8px; top:50%; transform:translateY(-50%); width:14px; height:14px; color:var(--text-tertiary); }
.comm-list { flex:1; overflow-y:auto; }
.comm-item { display:flex; gap:10px; padding:10px 16px; border-bottom:1px solid var(--border-light); cursor:pointer; transition:background .15s; align-items:flex-start; }
.comm-item:hover { background:rgba(184,151,106,.04); }
.comm-item.active { background:rgba(184,151,106,.08); border-left:3px solid var(--accent); }
.comm-item.unread { font-weight:600; }
.comm-item.unread::before { content:''; display:block; width:6px; height:6px; border-radius:50%; background:var(--accent); margin-top:6px; flex-shrink:0; }
.comm-avatar-sm { width:32px; height:32px; border-radius:50%; background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; flex-shrink:0; }
.comm-avatar-sm.unmatched { background:#FEF3CD; color:#856404; }
.comm-item-body { flex:1; min-width:0; }
.comm-item-top { display:flex; justify-content:space-between; align-items:center; gap:6px; }
.comm-item-from { font-size:12px; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.comm-item-date { font-size:10px; color:var(--text-tertiary); white-space:nowrap; flex-shrink:0; }
.comm-item-subject { font-size:12px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.comm-item-preview { font-size:11px; color:var(--text-tertiary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.comm-labels { display:flex; gap:3px; margin-top:3px; }
.comm-label { font-size:9px; padding:1px 6px; border-radius:8px; font-weight:500; }
.comm-label.lbl-vip { background:rgba(184,151,106,.15); color:var(--accent); }
.comm-label.lbl-urgent { background:rgba(220,53,69,.1); color:#DC3545; }
.comm-label.lbl-logistics { background:rgba(23,162,184,.1); color:#17A2B8; }
.comm-label.lbl-lifestyle { background:rgba(111,66,193,.1); color:#6F42C1; }
.comm-label.lbl-sms { background:rgba(40,167,69,.1); color:#28A745; }
.comm-label.lbl-alert { background:rgba(255,193,7,.15); color:#856404; }
.comm-match-warn { display:inline-flex; align-items:center; gap:3px; font-size:10px; color:#856404; background:#FEF3CD; padding:1px 6px; border-radius:8px; margin-left:4px; }
.comm-match-warn svg { width:10px; height:10px; }
.comm-detail { display:flex; flex-direction:column; overflow:hidden; }
.comm-detail-header { padding:16px 20px; border-bottom:1px solid var(--border-light); }
.comm-detail-subject { font-size:16px; font-weight:600; color:var(--text-primary); margin-bottom:8px; }
.comm-detail-meta { display:flex; align-items:center; gap:12px; font-size:12px; color:var(--text-secondary); flex-wrap:wrap; }
.comm-detail-meta strong { color:var(--text-primary); font-weight:500; }
.comm-detail-actions { display:flex; gap:6px; margin-left:auto; }
.comm-detail-actions .btn { padding:5px 10px; font-size:11px; }
.comm-detail-body { flex:1; overflow-y:auto; padding:20px; font-size:13px; line-height:1.7; color:var(--text-primary); }
.comm-detail-body .email-body { background:var(--bg-app); border-radius:var(--radius); padding:16px 20px; margin-top:12px; }
.comm-detail-reply { padding:12px 20px; border-top:1px solid var(--border-light); background:var(--bg-app); }
.comm-detail-reply textarea { width:100%; min-height:60px; border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px; font-size:12px; font-family:var(--font); resize:vertical; background:var(--bg-card); color:var(--text-primary); outline:none; }
.comm-detail-reply textarea:focus { border-color:var(--accent); }
.comm-reply-bar { display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
.comm-reply-bar select { font-size:11px; padding:0 8px; border:1px solid var(--border); border-radius:var(--radius-sm); background-color:var(--bg-input); font-family:var(--font); color:var(--text-secondary); }
.comm-reply-bar .reply-actions { display:flex; gap:6px; align-items:center; }
.btn-ai { display:inline-flex; align-items:center; gap:6px; height:38px; box-sizing:border-box; padding:0 16px; font-size:13px; font-weight:500; font-family:var(--font); border:1px solid transparent; border-radius:var(--radius-sm); cursor:pointer; transition:all .2s; background:linear-gradient(135deg,#6366F1,#8B5CF6); color:#fff; box-shadow:0 1px 3px rgba(99,102,241,.3); }
.btn-ai:hover { background:linear-gradient(135deg,#4F46E5,#7C3AED); box-shadow:0 2px 8px rgba(99,102,241,.4); transform:translateY(-1px); }
.btn-ai svg { flex-shrink:0; }
.btn-ai.ai-loading { pointer-events:none; opacity:.8; }
.btn-ai.ai-loading .ai-sparkle { animation:aiSpin .8s linear infinite; }
@keyframes aiSpin { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
.ai-typing { display:none; font-size:11px; color:#6366F1; font-style:italic; margin-top:4px; }
.ai-typing.visible { display:flex; align-items:center; gap:6px; }
.ai-typing-dots span { display:inline-block; width:4px; height:4px; border-radius:50%; background:#6366F1; animation:aiDot 1.2s infinite; }
.ai-typing-dots span:nth-child(2) { animation-delay:.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay:.4s; }
@keyframes aiDot { 0%,80%,100% { opacity:.3; transform:scale(.8); } 40% { opacity:1; transform:scale(1.2); } }
.comm-empty { display:flex; align-items:center; justify-content:center; height:100%; color:var(--text-tertiary); font-size:13px; }
.comm-compose-overlay { position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:var(--z-modal); display:flex; align-items:center; justify-content:center; }
.comm-compose { background:var(--bg-card); border-radius:var(--radius-lg); width:640px; max-height:80vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lg); }
.comm-compose-header { padding:16px 20px; border-bottom:1px solid var(--border-light); display:flex; justify-content:space-between; align-items:center; }
.comm-compose-header h3 { font-size:15px; font-weight:600; color:var(--text-primary); }
.comm-compose-body { padding:16px 20px; flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:10px; }
.comm-compose-body input, .comm-compose-body textarea, .comm-compose-body select { width:100%; border:1px solid var(--border); border-radius:var(--radius-sm); padding:0 10px; font-size:12px; font-family:var(--font); background-color:var(--bg-input); color:var(--text-primary); outline:none; }
.comm-compose-body textarea { padding:8px 10px; }
.comm-compose-body input:focus, .comm-compose-body textarea:focus { border-color:var(--accent); }
.comm-compose-body textarea { min-height:120px; resize:vertical; }
.comm-compose-body label { font-size:11px; font-weight:500; color:var(--text-secondary); }
.comm-compose-footer { padding:12px 20px; border-top:1px solid var(--border-light); display:flex; justify-content:space-between; align-items:center; }
.comm-type-indicator { display:inline-flex; align-items:center; gap:4px; font-size:10px; font-weight:600; padding:2px 8px; border-radius:10px; }
.comm-type-indicator.type-email { background:rgba(184,151,106,.12); color:var(--accent); }
.comm-type-indicator.type-sms { background:rgba(40,167,69,.1); color:#28A745; }
.comm-type-indicator.type-alert { background:rgba(255,193,7,.15); color:#856404; }
.profile-email-row { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border-light); align-items:flex-start; font-size:12px; }
.profile-email-row:last-child { border-bottom:none; }
.profile-email-dir { font-size:10px; font-weight:600; padding:2px 6px; border-radius:4px; white-space:nowrap; }
.profile-email-dir.dir-in { background:rgba(23,162,184,.1); color:#17A2B8; }
.profile-email-dir.dir-out { background:rgba(184,151,106,.12); color:var(--accent); }

/* === PROVIDERS === */
.prov-layout { display:grid; grid-template-columns:360px 1fr; gap:0; height:calc(100vh - 180px); min-height:500px; }
.prov-sidebar { border-right:1px solid var(--border-light); display:flex; flex-direction:column; overflow:hidden; }
.prov-sidebar-header { padding:12px 16px; border-bottom:1px solid var(--border-light); display:flex; flex-direction:column; gap:8px; }
.prov-cats { display:flex; gap:4px; flex-wrap:wrap; }
.prov-cat { padding:4px 10px; font-size:11px; font-weight:500; border:1px solid var(--border); border-radius:14px; background:transparent; color:var(--text-secondary); cursor:pointer; font-family:var(--font); transition:all .15s; white-space:nowrap; }
.prov-cat.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.prov-cat:hover:not(.active) { border-color:var(--accent); color:var(--accent); }
.prov-cat .cat-count { font-size:10px; opacity:.7; margin-left:2px; }
.prov-search { padding:8px 12px; border-bottom:1px solid var(--border-light); }
.prov-search-wrap { position:relative; }
.prov-search-wrap svg { position:absolute; left:8px; top:50%; transform:translateY(-50%); width:14px; height:14px; color:var(--text-tertiary); }
.prov-search-wrap input { width:100%; border:1px solid var(--border); border-radius:var(--radius-sm); padding:0 10px 0 30px; font-size:12px; font-family:var(--font); background-color:var(--bg-input); color:var(--text-primary); outline:none; box-sizing:border-box; }
.prov-search-wrap input:focus { border-color:var(--accent); }
.prov-search-scope { display:flex; gap:4px; margin-top:6px; }
.prov-scope-btn { padding:2px 8px; font-size:10px; font-weight:500; border:1px solid var(--border); border-radius:10px; background:transparent; color:var(--text-tertiary); cursor:pointer; font-family:var(--font); transition:all .12s; }
.prov-scope-btn.active { background:var(--text-primary); color:var(--bg-card); border-color:var(--text-primary); }
.prov-list { flex:1; overflow-y:auto; }
.prov-item { display:flex; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border-light); cursor:pointer; transition:background .15s; align-items:center; }
.prov-item:hover { background:rgba(184,151,106,.04); }
.prov-item.active { background:rgba(184,151,106,.08); border-left:3px solid var(--accent); }
.prov-item-logo { width:40px; height:40px; border-radius:var(--radius-sm); background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:600; flex-shrink:0; overflow:hidden; }
.prov-item-body { flex:1; min-width:0; }
.prov-item-top { display:flex; justify-content:space-between; align-items:center; gap:6px; }
.prov-item-name { font-size:13px; font-weight:500; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.prov-item-cat { font-size:10px; color:var(--text-tertiary); }
.prov-item-meta { font-size:11px; color:var(--text-secondary); margin-top:2px; display:flex; gap:8px; align-items:center; }
.prov-stars { color:var(--accent); font-size:11px; letter-spacing:1px; }
.prov-badge { font-size:9px; font-weight:600; padding:1px 6px; border-radius:8px; }
.prov-badge.preferred { background:rgba(184,151,106,.12); color:var(--accent); }
.prov-badge.active-b { background:rgba(40,167,69,.1); color:#28A745; }
.prov-badge.new-b { background:rgba(23,162,184,.1); color:#17A2B8; }
.prov-detail { display:flex; flex-direction:column; overflow:hidden; }
.prov-detail-header { padding:20px 24px; border-bottom:1px solid var(--border-light); }
.prov-detail-top { display:flex; align-items:center; gap:16px; margin-bottom:12px; }
.prov-detail-logo { width:56px; height:56px; border-radius:var(--radius); background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:700; flex-shrink:0; }
.prov-detail-title { font-size:18px; font-weight:600; color:var(--text-primary); }
.prov-detail-subtitle { font-size:12px; color:var(--text-secondary); margin-top:2px; }
.prov-detail-badges { display:flex; gap:6px; margin-top:4px; }
.prov-detail-tabs { display:flex; gap:0; border-bottom:1px solid var(--border-light); }
.prov-dtab { padding:10px 20px; font-size:12px; font-weight:500; color:var(--text-tertiary); border:none; background:transparent; cursor:pointer; font-family:var(--font); border-bottom:2px solid transparent; transition:all .15s; }
.prov-dtab.active { color:var(--accent); border-bottom-color:var(--accent); }
.prov-dtab:hover:not(.active) { color:var(--text-primary); }
.prov-detail-body { flex:1; overflow-y:auto; padding:20px 24px; }
.prov-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.prov-info-item { }
.prov-info-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--text-tertiary); margin-bottom:4px; }
.prov-info-value { font-size:13px; color:var(--text-primary); line-height:1.5; }
.prov-desc { font-size:13px; line-height:1.7; color:var(--text-secondary); margin-top:16px; padding-top:16px; border-top:1px solid var(--border-light); }
.prov-catalog-search { display:flex; gap:8px; margin-bottom:12px; align-items:center; }
.prov-catalog-search input { flex:1; border:1px solid var(--border); border-radius:var(--radius-sm); padding:0 10px; font-size:12px; font-family:var(--font); background-color:var(--bg-input); color:var(--text-primary); outline:none; }
.prov-catalog-search input:focus { border-color:var(--accent); }
.prov-product { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--border-light); gap:12px; }
.prov-product:last-child { border-bottom:none; }
.prov-product-info { flex:1; min-width:0; }
.prov-product-name { font-size:13px; font-weight:500; color:var(--text-primary); }
.prov-product-desc { font-size:11px; color:var(--text-tertiary); margin-top:2px; }
.prov-product-price { font-size:14px; font-weight:600; color:var(--accent); white-space:nowrap; }
.prov-product-unit { font-size:10px; color:var(--text-tertiary); font-weight:400; }
.prov-product-tag { display:inline-block; font-size:9px; padding:1px 6px; border-radius:8px; background:rgba(184,151,106,.08); color:var(--accent); margin-top:3px; }
.prov-empty { display:flex; align-items:center; justify-content:center; height:100%; color:var(--text-tertiary); font-size:13px; }
.prov-contact-row { display:flex; align-items:center; gap:10px; padding:8px 0; font-size:13px; border-bottom:1px solid var(--border-light); }
.prov-contact-row:last-child { border-bottom:none; }
.prov-contact-icon { width:28px; height:28px; border-radius:50%; background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.prov-contact-icon svg { width:14px; height:14px; }
.prov-product-results { font-size:11px; color:var(--text-tertiary); padding:4px 0; }

/* === RESPONSIVE === */
/* .kpi-grid : auto-fit minmax (UX-12), les breakpoints fixes 3/2 colonnes sont retires. */
@media (max-width:1024px) { .grid-3 { grid-template-columns:repeat(2,1fr); } }
@media (max-width:768px) {
    .sidebar { position:fixed; left:-220px; z-index:var(--z-sidebar); height:100%; }
    .sidebar.open { left:0; }
    .kpi-grid, .grid-3, .grid-2 { grid-template-columns:1fr; }
    .content { padding:16px; }
}

/* ============================================================================
   3. COMPOSANTS c-* (mission UX section 3)
   ============================================================================ */

/* ---- Spinner generique (14px dans les boutons/inputs) ---- */
.c-spin {
    width: 14px; height: 14px;
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: cSpin .7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}
@keyframes cSpin { to { transform: rotate(360deg); } }

/* ---- Boutons complementaires ---- */
.btn:disabled, .btn.is-busy { opacity: .6; pointer-events: none; }
.btn .c-spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.btn-secondary .c-spin { border-color: rgba(0,0,0,.15); border-top-color: var(--text-secondary); }
.c-btn--danger { background: var(--red); color: #fff; border-color: var(--red); }
.c-btn--danger:hover { background: #E0352B; }

/* ---- Badges de statut : .c-badge (pattern status-pill / dm-status maquette) ---- */
.c-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.c-badge--green  { background: var(--green-tint);  color: var(--green-ink); }
.c-badge--orange { background: var(--orange-tint); color: var(--orange-ink); }
.c-badge--red    { background: var(--red-tint);    color: var(--red-ink); }
.c-badge--blue   { background: var(--blue-tint);   color: var(--blue-ink); }
.c-badge--purple { background: var(--purple-tint); color: var(--purple-ink); }
.c-badge--gray   { background: var(--gray-tint);   color: var(--gray-ink); }
.c-badge--accent { background: var(--accent-tint); color: var(--accent-ink); }
.c-badge--code {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    background: var(--bg-app);
    color: var(--text-secondary);
    padding: 3px 8px;
}
.c-badge--dot { background: none; padding: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12px; }
.c-badge--dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.c-badge--dot.c-badge--green  { color: var(--green-ink); }
.c-badge--dot.c-badge--orange { color: var(--orange-ink); }
.c-badge--dot.c-badge--red    { color: var(--red-ink); }
.c-badge--dot.c-badge--blue   { color: var(--blue-ink); }
.c-badge--dot.c-badge--purple { color: var(--purple-ink); }
.c-badge--dot.c-badge--gray   { color: var(--gray-ink); }
.c-badge--dot.c-badge--accent { color: var(--accent-ink); }

/* ---- Modales : .c-modal-* (style modal/modal-content maquette) ---- */
.c-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.25);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn var(--dur) var(--ease);
}
.c-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    width: 560px; max-width: 92vw; max-height: 85vh;
    display: flex; flex-direction: column;
    animation: modalIn var(--dur) var(--ease);
}
.c-modal--sm { width: 480px; }
.c-modal--md { width: 560px; }
.c-modal--lg { width: 720px; }
.c-modal--xl { width: 960px; }
.c-modal .modal-body { overflow-y: auto; flex: 1; }
.c-modal .modal-footer { flex-shrink: 0; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- Erreurs / warnings de formulaire ---- */
.c-form-error {
    background: var(--red-tint);
    color: var(--red-ink);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.c-form-warn {
    background: var(--orange-tint);
    color: var(--orange-ink);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex; align-items: flex-start; gap: 8px;
}
.c-field-error { font-size: 11px; color: var(--red-ink); margin-top: 4px; }
.c-field-warn { font-size: 11px; color: var(--orange-ink); margin-top: 4px; }
.form-group input.is-invalid, .form-group select.is-invalid, .form-group textarea.is-invalid {
    border-color: var(--red);
}

/* ---- Toasts (style maquette, enrichi action + close) ---- */
.toast {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-primary);
}
.toast.info { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--orange); }
.toast .toast-msg { flex: 1; }
.toast .toast-action {
    border: none; background: none; cursor: pointer;
    font-family: var(--font); font-size: 12px; font-weight: 600;
    color: var(--accent); padding: 2px 4px; border-radius: 4px;
}
.toast .toast-action:hover { color: var(--accent-hover); text-decoration: underline; }
.toast .toast-close {
    border: none; background: none; cursor: pointer;
    color: var(--text-tertiary); font-size: 14px; line-height: 1;
    padding: 2px; border-radius: 4px; flex-shrink: 0;
}
.toast .toast-close:hover { color: var(--text-primary); }

/* ---- DataTable : footer, barre de rechargement, bulkbar, densite ---- */
.c-table-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid var(--border-light);
    font-size: 12px; color: var(--text-secondary);
}
.c-table-pager { display: flex; align-items: center; gap: 6px; }
.c-table-pager button {
    padding: 4px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text-secondary);
    font-family: var(--font); font-size: 12px; cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
}
.c-table-pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--text-primary); }
.c-table-pager button:disabled { opacity: .4; cursor: default; }
.c-table-pager input {
    width: 52px; height: 28px; padding: 0 6px; font-size: 12px; text-align: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input);
}
.c-table-wrap { position: relative; }
/* UX-11 : thead sticky des tables standard. Le scroll vertical est porte par
   le wrapper (max-height viewport), le thead colle en haut du conteneur
   scrollable. Robuste a 500 lignes (Masterlist) : aucune ligne ne passe
   au-dessus des intitules. */
.c-table-wrap .table-wrap { max-height: max(320px, calc(100vh - 290px)); overflow: auto; }
.c-table-wrap thead th {
    position: sticky; top: 0; z-index: var(--z-sticky);
    background: var(--bg-app);
    box-shadow: 0 1px 0 var(--border);
}
.c-table-progress {
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--accent-light); overflow: hidden; z-index: var(--z-sticky);
}
.c-table-progress::after {
    content: ''; display: block; height: 100%; width: 35%;
    background: var(--accent);
    animation: cProgress 1s var(--ease) infinite;
}
@keyframes cProgress { from { transform: translateX(-120%); } to { transform: translateX(340%); } }
.c-table-wrap tbody.is-reloading { opacity: .5; pointer-events: none; }
.c-table-wrap tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.c-table-wrap tbody tr.is-selected { background: var(--accent-light); }
table.is-compact td { padding: 8px 12px; }
table.is-compact th { padding: 10px 12px; }
th.c-th-check, td.c-td-check { width: 36px; padding-right: 0; }
td[data-mono="1"] { font-family: var(--font-mono); font-size: 12px; }
.c-bulkbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    background: var(--accent-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px; color: var(--text-primary);
}
.c-bulkbar .c-bulkbar-count { font-weight: 600; }
.c-table-error { text-align: center; padding: var(--sp-8) var(--sp-5); color: var(--text-secondary); font-size: 13px; }
.c-table-error .btn { margin-top: 12px; }
/* Colonnes responsives par priorite (mission UX 3.3 + UX-1).
   Les media queries viewport ne suffisent pas : a 1280px la sidebar (220px)
   ampute la table qui coupait sa colonne Status. On mesure donc la LARGEUR
   DISPONIBLE de la table (container query sur .c-table-wrap) ; les media
   queries restent en filet de securite pour les navigateurs sans @container. */
.c-table-wrap { container-type: inline-size; }
/* Seuils cales sur le reel (QA round 1, reliquats) : a 1280px de viewport la table
   dispose d'environ 1000px. Priority 3 masquee des 1160px de largeur disponible
   ET densite resserree (padding 16 -> 10) pour que Status reste TOUJOURS visible. */
@container (max-width: 1160px) {
    th[data-priority="3"], td[data-priority="3"] { display: none; }
    th, td { padding-left: 10px; padding-right: 10px; }
}
@container (max-width: 900px)  { th[data-priority="2"], td[data-priority="2"] { display: none; } }
@media (max-width: 1280px) { th[data-priority="3"], td[data-priority="3"] { display: none; } }
@media (max-width: 980px)  { th[data-priority="2"], td[data-priority="2"] { display: none; } }

/* ---- SearchSelect / GuestPicker : .c-ss-* ---- */
.c-ss { position: relative; display: flex; flex-direction: column; }
.c-ss input { width: 100%; box-sizing: border-box; }
.c-ss .c-ss-spin {
    position: absolute; right: 10px; top: 10px;
    color: var(--text-tertiary);
}
.c-ss-panel {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 280px; overflow-y: auto;
    z-index: var(--z-dropdown);
    padding: 4px;
}
.c-ss-item {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    display: flex; flex-direction: column; gap: 1px;
}
.c-ss-item:hover, .c-ss-item--active { background: var(--accent-light); }
.c-ss-sub { font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.c-ss-hint { padding: 10px 12px; font-size: 12px; color: var(--text-tertiary); }
.c-ss-retry { color: var(--accent); cursor: pointer; font-weight: 500; }
.c-ss-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.c-ss-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px;
    background: var(--accent-light);
    color: var(--accent-ink);
    border-radius: 12px;
    font-size: 12px; font-weight: 500;
}
.c-ss-chip button {
    border: none; background: none; cursor: pointer;
    color: inherit; font-size: 13px; line-height: 1; padding: 0;
    opacity: .7;
}
.c-ss-chip button:hover { opacity: 1; }
.c-ss-badge {
    display: inline-flex; align-self: flex-start;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 600;
    background: var(--bg-app); color: var(--text-secondary);
    padding: 2px 8px; border-radius: 4px;
}
.c-ss-clear {
    position: absolute; right: 8px; top: 8px;
    width: 20px; height: 20px; border: none; border-radius: 50%;
    background: var(--bg-app); color: var(--text-secondary);
    cursor: pointer; font-size: 12px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.c-ss-clear:hover { background: var(--border); color: var(--text-primary); }

/* ---- Tabs : variante segmentee (style comm-tabs) ---- */
.c-tabs-seg { display: flex; gap: 2px; background: var(--bg-app); border-radius: var(--radius); padding: 3px; }
.c-tabs-seg .tab {
    flex: 1; padding: 6px 10px; font-size: 12px; text-align: center;
    border: none; border-bottom: none; background: transparent;
    color: var(--text-tertiary); border-radius: var(--radius-sm);
    justify-content: center;
}
.c-tabs-seg .tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.06); border-bottom: none; }

/* ---- Kanban : .c-kb-* ---- */
.c-kb { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding: 16px 20px; }
.c-kb-col {
    flex: 1; min-width: 240px; max-width: 340px;
    background: var(--bg-app);
    border: 1px solid transparent;
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.c-kb-col.is-over { background: var(--accent-light); border: 1px dashed var(--accent); }
.c-kb-col-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px 6px;
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .4px;
}
.c-kb-col-count {
    font-size: 11px; font-weight: 500;
    background: var(--bg-card); color: var(--text-tertiary);
    padding: 1px 7px; border-radius: 8px;
}
.c-kb-cards { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.c-kb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    cursor: grab;
    transition: box-shadow var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
    position: relative;
}
.c-kb-card:hover { box-shadow: var(--shadow); }
.c-kb-card.is-dragging { opacity: .4; }
.c-kb-card.is-saving { opacity: .6; pointer-events: none; }
.c-kb-card.is-saving::after {
    content: ''; position: absolute; top: 8px; right: 8px;
    width: 12px; height: 12px;
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: cSpin .7s linear infinite;
}
.c-kb-more {
    margin: 0 8px 8px; padding: 6px;
    border: 1px dashed var(--border); border-radius: var(--radius-sm);
    background: none; color: var(--text-secondary);
    font-family: var(--font); font-size: 12px; cursor: pointer;
}
.c-kb-more:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Skeletons : .c-skel (shimmer opacite, sobre) ---- */
.c-skel { animation: cSkel 1.2s ease-in-out infinite; }
@keyframes cSkel { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.c-skel-block { background: var(--border-light); border-radius: 4px; }
.c-skel-row { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--border-light); height: var(--row-h); box-sizing: border-box; }
.c-skel-row .c-skel-block { height: 12px; }
.c-skel-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.c-skel-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.c-skel-circle { border-radius: 50%; background: var(--border-light); flex-shrink: 0; }

/* ---- Empty states : .c-empty ---- */
.c-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
    gap: 4px;
}
.c-empty svg { width: 40px; height: 40px; color: var(--text-tertiary); margin-bottom: 8px; }
.c-empty-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.c-empty-text { font-size: 13px; color: var(--text-secondary); max-width: 360px; }
.c-empty .btn { margin-top: 12px; }

/* ---- Command palette : .c-palette ---- */
.c-palette-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.25);
    backdrop-filter: blur(4px);
    z-index: var(--z-palette);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 15vh;
    animation: fadeIn var(--dur) var(--ease);
}
.c-palette {
    width: 560px; max-width: 92vw;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    animation: modalIn var(--dur) var(--ease);
}
.c-palette input {
    width: 100%; box-sizing: border-box;
    border: none; border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    padding: 16px 20px;
    font-size: 15px; font-family: var(--font);
    background: var(--bg-card); color: var(--text-primary);
    outline: none;
}
.c-palette-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.c-palette-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-primary);
    cursor: pointer;
}
.c-palette-item svg { width: 15px; height: 15px; color: var(--text-secondary); flex-shrink: 0; }
.c-palette-item .c-ss-sub { margin-left: auto; }
.c-palette-item:hover, .c-palette-item--active { background: var(--accent-light); }
.c-palette-group {
    padding: 8px 12px 2px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-tertiary);
}
.c-palette-foot {
    display: flex; gap: 14px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 11px; color: var(--text-tertiary);
}
.c-palette-foot kbd {
    font-family: var(--font-mono); font-size: 10px;
    background: var(--bg-app); border: 1px solid var(--border);
    border-radius: 3px; padding: 0 4px;
}

/* ---- Dropdown menu generique (user menu, event selector) ---- */
.c-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px; max-height: 320px; overflow-y: auto;
    z-index: var(--z-dropdown);
    padding: 4px;
}
.c-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-primary);
    cursor: pointer; white-space: nowrap;
}
.c-menu-item:hover, .c-menu-item--active { background: var(--accent-light); }
.c-menu-item svg { width: 14px; height: 14px; color: var(--text-secondary); }
.c-menu-item .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.c-menu-sep { height: 1px; background: var(--border-light); margin: 4px 0; }
.c-menu-head { padding: 8px 10px 4px; font-size: 11px; color: var(--text-tertiary); }
.c-menu-head strong { display: block; font-size: 13px; color: var(--text-primary); font-weight: 600; }

/* ============================================================================
   4. SHELL : login, complements sidebar / topbar
   ============================================================================ */

/* ---- Badge de navigation sidebar (mission UX 5.5) ---- */
.c-nav-badge {
    margin-left: auto;
    font-size: 11px; font-weight: 600;
    background: var(--accent); color: #fff;
    padding: 0 6px; border-radius: 9px;
    min-width: 18px; height: 18px; line-height: 18px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar.collapsed .c-nav-badge {
    position: absolute; top: 3px; right: 3px; margin: 0;
    min-width: 14px; height: 14px; line-height: 14px;
    font-size: 9px; padding: 0 4px;
}

/* ---- Event selector dans la sidebar ---- */
.sidebar-event { padding: 0 12px 14px; }
.event-selector--sidebar {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: #C7C7CC;
    justify-content: flex-start;
}
.event-selector--sidebar:hover { border-color: var(--accent); }
.event-selector--sidebar .ev-label {
    flex: 1; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: 500; color: #fff;
}
.sidebar.collapsed .sidebar-event { padding: 0 6px 12px; }
.sidebar.collapsed .event-selector--sidebar { padding: 5px 0; justify-content: center; }
.sidebar.collapsed .event-selector--sidebar .ev-label,
.sidebar.collapsed .event-selector--sidebar svg { display: none; }

/* ---- Ecran de login ---- */
.login-screen {
    position: fixed; inset: 0;
    z-index: var(--z-modal);
    background: var(--bg-sidebar);
    background-image: radial-gradient(ellipse at 50% -20%, rgba(184,151,106,.14), transparent 60%);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font);
}
.login-card {
    width: 360px; max-width: 90vw;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    padding: 40px 36px 32px;
    text-align: center;
    animation: modalIn var(--dur) var(--ease);
}
.login-logo { margin-bottom: 14px; }
.login-brand {
    font-size: 22px; font-weight: 600; letter-spacing: 4px;
    color: var(--text-primary);
}
.login-sub {
    font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent);
    margin: 4px 0 28px;
}
.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-card .form-group input {
    padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 13px;
    background: var(--bg-input); color: var(--text-primary);
    outline: none;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.login-card .form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.login-error {
    background: var(--red-tint); color: var(--red-ink);
    font-size: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
}
.login-btn { width: 100%; justify-content: center; margin-top: 4px; }
.login-foot { margin-top: 24px; font-size: 11px; color: var(--text-tertiary); }

/* ---- Placeholders "Coming soon" ---- */
.c-placeholder { min-height: 320px; display: flex; align-items: center; justify-content: center; }

/* L'attribut hidden gagne toujours, meme sur les conteneurs display:flex. */
[hidden] { display: none !important; }

/* ============================================================================
   5. ACCESSIBILITE / MOTION
   ============================================================================ */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sidebar :focus-visible, .login-screen :focus-visible { outline-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .page, .c-modal, .c-palette, .toast, .login-card { animation: none !important; }
    tr.on-road { animation: none !important; }
    tr.on-road td:first-child::before, .onroad-dot-icon { animation: none !important; }
    .kpi-card:hover, .gb:hover { transform: none; }
    /* Les transitions d'opacite restent (decision mission UX section 1). */
}

/* ============================================================================
   Lot 3 : Requests / Communications / Activity (composants additifs)
   ============================================================================ */

/* pills type / priorite de la popup New Request (slide 30) */
.req-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.req-pill {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px;
    background: var(--bg-card); font-family: var(--font); font-size: 12px;
    color: var(--text-secondary); cursor: pointer; transition: all .15s;
}
.req-pill:hover { border-color: var(--accent); }
.req-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.req-pill:disabled { opacity: .55; cursor: not-allowed; }

/* commutateur liste / kanban */
.req-view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.req-view-switch button {
    border: none; background: var(--bg-card); padding: 7px 10px; cursor: pointer;
    color: var(--text-secondary); display: inline-flex; align-items: center;
}
.req-view-switch button + button { border-left: 1px solid var(--border); }
.req-view-switch button.active { background: var(--accent); color: #fff; }

/* avatars assignes (initiales, max 3 + compteur) */
.req-avatars { display: inline-flex; }
.req-avatar {
    width: 22px; height: 22px; border-radius: 50%; background: var(--accent-light);
    color: var(--accent); font-size: 9px; font-weight: 600; display: inline-flex;
    align-items: center; justify-content: center; border: 1.5px solid var(--bg-card);
    margin-left: -6px;
}
.req-avatar:first-child { margin-left: 0; }
.req-avatar.more { background: var(--bg-app); color: var(--text-secondary); }

/* jauge roll-up "2/3 tasks" (RG-REQ-8) */
.req-progress { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.req-progress-bar { width: 42px; height: 4px; border-radius: 2px; background: var(--border-light); overflow: hidden; }
.req-progress-bar span { display: block; height: 100%; background: var(--green); border-radius: 2px; }

/* pastille SLA (mission service-excellence 3.4) */
.sla-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 9px; }
.sla-chip.ok { background: rgba(52,199,89,.1); color: var(--green); min-width: 8px; min-height: 8px; }
.sla-chip.ok:empty { padding: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sla-chip.at-risk { background: rgba(255,159,10,.12); color: var(--orange); }
.sla-chip.breached { background: rgba(255,59,48,.1); color: var(--red); }

/* mise en evidence urgent (RG-REQ-15) */
.req-urgent-row { border-left: 3px solid var(--red); padding-left: 8px; }
.c-kb-card.req-urgent-card { border: 1px solid var(--red); }

.req-take-btn { height: 22px; padding: 0 8px; font-size: 10px; margin-left: 4px; }

/* kanban lot 3 : contenu de carte, colonnes grisees pendant le drag, repli Done/Cancelled */
.c-kb-card .kb-line { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.c-kb-card .kb-title { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.c-kb-card .kb-guest { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
/* UX-36 : les metadonnees secondaires (ID, type, departement, avatars)
   n'apparaissent qu'au survol ou au focus clavier de la carte. */
.c-kb-card .kb-hover { display: none; margin-top: 6px; margin-bottom: 0; }
.c-kb-card:hover .kb-hover, .c-kb-card:focus-visible .kb-hover, .c-kb-card:focus-within .kb-hover { display: flex; }
.c-kb-col.is-disabled { opacity: .35; pointer-events: none; }
.c-kb.kb-collapse-done .c-kb-col[data-col="done"] .c-kb-cards,
.c-kb.kb-collapse-done .c-kb-col[data-col="done"] .c-kb-more,
.c-kb.kb-collapse-cancelled .c-kb-col[data-col="cancelled"] .c-kb-cards,
.c-kb.kb-collapse-cancelled .c-kb-col[data-col="cancelled"] .c-kb-more { display: none; }
.c-kb.kb-collapse-done .c-kb-col[data-col="done"],
.c-kb.kb-collapse-cancelled .c-kb-col[data-col="cancelled"] { min-width: 130px; flex: 0 0 130px; opacity: .8; }
.c-kb-col[data-col="done"] .c-kb-col-head, .c-kb-col[data-col="cancelled"] .c-kb-col-head { cursor: pointer; }

/* timeline SLA de la popup detail */
.sla-timeline { display: flex; gap: 0; margin: 12px 0 4px; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.sla-step { flex: 1; padding: 8px 10px; font-size: 11px; border-left: 1px solid var(--border-light); }
.sla-step:first-child { border-left: none; }
.sla-step-label { display: block; font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; }
.sla-step-val { display: block; color: var(--text-primary); }
.sla-step-due { display: block; color: var(--text-tertiary); font-size: 10px; }
.sla-step.good { background: rgba(52,199,89,.06); }
.sla-step.bad { background: rgba(255,59,48,.06); }
.sla-step.bad .sla-step-val { color: var(--red); font-weight: 600; }

/* chip dore guest epingle + chip request liee (slides 25 et 33) */
.guest-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
    background: rgba(184,151,106,.12); border: 1px solid rgba(184,151,106,.35);
    color: var(--accent); border-radius: 14px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.guest-chip button { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 10px; padding: 0 2px; }
.guest-chip.req { background: rgba(94,92,230,.08); border-color: rgba(94,92,230,.3); color: var(--blue); }

/* panneau IA du detail email + fil */
.comm-ai-panel {
    display: flex; gap: 8px; align-items: center; margin-top: 14px; padding: 10px 12px;
    background: var(--bg-app); border: 1px dashed var(--border); border-radius: 8px;
}
.comm-ai-panel .btn { padding: 4px 10px; font-size: 11px; }
.comm-thread-item {
    display: flex; gap: 8px; align-items: center; font-size: 11px; padding: 5px 8px;
    border-left: 2px solid var(--border); margin-bottom: 2px; cursor: pointer; color: var(--text-secondary);
}
.comm-thread-item:hover { background: rgba(184,151,106,.05); border-left-color: var(--accent); }
.comm-pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px; font-size: 11px; color: var(--text-secondary); }
.comm-pager .btn { padding: 3px 10px; font-size: 11px; }

/* JSON before/after (popup Activity) */
.act-json {
    background: var(--bg-app); border: 1px solid var(--border-light); border-radius: 8px;
    padding: 10px 12px; font-size: 11px; font-family: var(--font-mono, monospace);
    white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
}

/* ==================== Lot Transverse : Timeline / Location / Exports ==== */

/* bloc Gantt annule (RG-TML-4 : visible quand active_only=0) */
.gb.cancelled {
    background: var(--border-light);
    color: var(--text-tertiary);
    border-left: 3px solid var(--text-tertiary);
    text-decoration: line-through;
}
/* cellule cible pendant le drag d'un transfert (RG-TML-5/6) */
td.tg-cell.tg-drop { background: rgba(184,151,106,.12); outline: 2px dashed var(--accent); outline-offset: -2px; }
/* colonne guest sticky (scroll horizontal 2 axes) */
.gantt-table .g-row-label { position: sticky; left: 0; background: var(--bg-card); z-index: 2; }
.gantt-table th:first-child { position: sticky; left: 0; z-index: 4; }

/* Location : liste des points */
.loc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.loc-dot--hotel { background: var(--accent); }
.loc-dot--venue { background: var(--blue); }
.loc-dot--supplier { background: var(--green); }
.loc-dot--airport { background: var(--text-tertiary); }
.loc-row { cursor: pointer; }
.loc-row:hover { background: rgba(184,151,106,.05); }
.loc-row.active { background: rgba(184,151,106,.10); }
.loc-banner {
    padding: 10px 16px; font-size: 12px; color: var(--orange);
    background: rgba(255,159,10,.07); border: 1px solid rgba(255,159,10,.25);
    border-radius: var(--radius-sm); margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
}

/* ==================== Round 1 QA : polish core / CRM ==================== */

/* UX-9 : cases a cocher et radios aux couleurs de la palette (plus de bleu systeme) */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* UX-23 : famille rouge pour les KPI d'alerte (SLA breaches, glitches) */
.kpi-card.kpi-alert { border-left-color: var(--red); }
.kpi-card.kpi-alert .kpi-value { color: var(--red-ink); }

/* UX-21 : actions des cartes evenement revelees au survol (25 poubelles rouges en moins) */
.event-card .ev-actions { opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.event-card:hover .ev-actions, .event-card:focus-within .ev-actions { opacity: 1; }

/* UX-15/16 : menu du selecteur d'evenement (recherche + clavier + scroll) */
.c-menu--events { min-width: 240px; max-height: 60vh; display: flex; flex-direction: column; }
.c-menu--events .c-menu-list { overflow-y: auto; }
.c-menu-filter { padding: 4px 4px 8px; border-bottom: 1px solid var(--border-light); margin-bottom: 4px; }
.c-menu-filter input { width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: 12.5px; background: var(--bg-input); }
.c-menu-current {
    margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .4px;
    text-transform: uppercase; color: var(--accent-ink);
    background: var(--accent-tint); border-radius: 4px; padding: 2px 6px;
}

/* UX-32 : les tabs longues (fiche guest 10 onglets) scrollent sur UNE ligne */
.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.tabs .tab { white-space: nowrap; flex: none; }

/* ==== PROFILE SHEET v2 ==== */
/* Fiches profil en LECTURE (guests.js / GuestView, partage masterlist.js).
   Lignes condensees "label a gauche, valeur a droite" sur une grille 2
   colonnes, en-tete de section avec bouton Edit compact colle au titre.
   Prototype de reference valide avant generalisation aux autres fiches. */

.ps-section { margin-bottom: var(--sp-5); }
.ps-section:last-child { margin-bottom: 0; }

/* En-tete : titre petites capitales + Edit immediatement a sa droite, trait dessous */
.ps-head {
    display: flex; align-items: center; gap: var(--sp-3);
    padding-bottom: var(--sp-2); margin-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
}
.ps-title {
    font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-secondary); margin: 0;
}
.ps-edit {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 var(--sp-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text-secondary);
    font-family: var(--font); font-size: var(--fs-xs); font-weight: 500;
    line-height: 1; cursor: pointer; flex: none;
    transition: color var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                background var(--dur-fast) var(--ease);
}
.ps-edit:hover {
    color: var(--accent-ink); border-color: var(--accent); background: var(--accent-light);
}

/* Grille de paires : 2 colonnes de dl >900px, labels des 2 colonnes alignes
   sur la meme grille (largeur label fixe 180px dans chaque colonne) */
.ps-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    column-gap: var(--sp-8); row-gap: 0; align-items: start;
}
.ps-row {
    display: grid; grid-template-columns: 180px 1fr; column-gap: var(--sp-3);
    align-items: baseline; min-height: 32px;
    padding: 6px var(--sp-2); margin: 0 calc(-1 * var(--sp-2));
    border-radius: var(--radius-sm);
    transition: background var(--dur-fast) var(--ease);
}
.ps-row:hover { background: var(--accent-light); }
.ps-row--full { grid-column: 1 / -1; }
.ps-label {
    font-size: 11px; font-weight: 500; letter-spacing: .4px;
    text-transform: uppercase; color: var(--text-tertiary);
    line-height: 20px; text-align: left;
}
.ps-value {
    font-size: 13px; color: var(--text-primary);
    line-height: 20px; min-width: 0; overflow-wrap: anywhere;
}
.ps-value.is-empty { color: var(--text-tertiary); }
.ps-value.is-danger { color: var(--red); font-weight: 500; }

@media (max-width: 900px) {
    .ps-grid { grid-template-columns: 1fr; }
    .ps-row { grid-template-columns: 140px 1fr; }
}

/* ==== MODAL FOCUS (retour utilisateur 2026-07-04) ==== */
/* Le focus initial va au conteneur de la modale (aucun champ active) :
   pas d'anneau de focus visible sur le conteneur lui-meme. */
.c-modal:focus { outline: none; }

/* ==== CHAT WIDGET ==== */
/* Widget chat interne (RG-CHT-1 a 5) : icone topbar + bulle flottante.
   Section additive en fin de fichier, tokens uniquement. */

#btn-chat .chat-count {
    position: absolute; top: -5px; right: -5px;
    min-width: 15px; height: 15px; padding: 0 4px;
    border-radius: 8px;
    background: var(--red); color: #fff;
    font-size: var(--fs-2xs); font-weight: 600; line-height: 15px;
    text-align: center;
    border: 2px solid var(--bg-card);
    box-sizing: content-box;
}

.chat-panel {
    position: fixed;
    top: calc(var(--topbar-h) + 8px); right: 16px;
    width: 380px; height: 560px;
    max-height: calc(100vh - var(--topbar-h) - 24px);
    display: flex; flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    z-index: var(--z-dropdown); /* au-dessus du contenu, sous les modales */
    overflow: hidden;
    animation: fadeIn .15s var(--ease);
}

.chat-head {
    background: var(--bg-sidebar);
    padding: var(--sp-3) var(--sp-4) 0;
    flex-shrink: 0;
}
.chat-head-title {
    display: flex; align-items: center; gap: var(--sp-2);
    color: #fff; font-size: var(--fs-base); font-weight: 600;
    padding-bottom: var(--sp-2);
}
.chat-head-title svg { width: 16px; height: 16px; color: var(--accent); }
.chat-head-event {
    margin-left: auto;
    color: var(--text-sidebar); font-size: var(--fs-xs); font-weight: 500;
}
.chat-tabs { display: flex; gap: var(--sp-4); }
.chat-tab {
    background: none; border: none; cursor: pointer;
    padding: var(--sp-2) 0 10px;
    color: var(--text-sidebar); font-size: var(--fs-sm); font-weight: 500;
    border-bottom: 2px solid transparent;
}
.chat-tab:hover { color: #fff; }
.chat-tab.active { color: #fff; border-bottom-color: var(--accent); }

.chat-pane-chat, .chat-pane-users {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
}
.chat-pane-chat[hidden], .chat-pane-users[hidden] { display: none; }

.chat-messages {
    flex: 1; overflow-y: auto;
    padding: var(--sp-3) var(--sp-4);
    display: flex; flex-direction: column; gap: var(--sp-3);
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #D1D1D6; border-radius: 3px; }

.chat-day {
    align-self: center;
    font-size: var(--fs-2xs); font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: .04em;
    padding: 2px var(--sp-2);
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    margin-top: var(--sp-1);
}

.chat-msg { display: flex; gap: var(--sp-2); align-items: flex-start; }
.chat-msg-avatar {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--gray-tint); color: var(--gray-ink);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-2xs); font-weight: 600;
}
.chat-msg--own .chat-msg-avatar { background: var(--accent-tint); color: var(--accent-ink); }
.chat-msg-main { flex: 1; min-width: 0; }
.chat-msg-head { display: flex; align-items: baseline; gap: var(--sp-2); }
.chat-msg-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text-primary); }
.chat-msg--own .chat-msg-name { color: var(--accent-ink); }
.chat-msg-time { font-size: var(--fs-2xs); color: var(--text-tertiary); }
.chat-msg-body {
    font-size: var(--fs-md); color: var(--text-primary);
    line-height: 1.45; word-wrap: break-word;
    background: var(--bg-app);
    border-radius: 4px 10px 10px 10px;
    padding: 6px 10px; margin-top: 2px;
    display: inline-block; max-width: 100%;
}
.chat-msg--own .chat-msg-body {
    background: var(--accent-tint);
    border: 1px solid rgba(184,151,106,.22);
}

.chat-empty {
    padding: var(--sp-6) var(--sp-4);
    text-align: center;
    color: var(--text-tertiary); font-size: var(--fs-sm);
}

.chat-input {
    flex-shrink: 0;
    display: flex; align-items: flex-end; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
}
.chat-input textarea {
    flex: 1; resize: none;
    max-height: 120px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    padding: 7px 10px;
    font-family: var(--font); font-size: var(--fs-md); color: var(--text-primary);
    line-height: 1.4;
}
.chat-input textarea:focus { outline: none; border-color: var(--accent); }
.chat-send {
    width: 32px; height: 32px; flex-shrink: 0;
    border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s var(--ease);
}
.chat-send:hover { background: var(--accent-hover); }
.chat-send svg { width: 15px; height: 15px; }

.chat-users { flex: 1; overflow-y: auto; padding: var(--sp-2) 0; }
.chat-user {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-4);
    cursor: pointer;
}
.chat-user:hover { background: var(--accent-light); }
.chat-user .chat-msg-avatar { width: 30px; height: 30px; font-size: var(--fs-xs); }
.chat-user-main { flex: 1; min-width: 0; }
.chat-user-name { font-size: var(--fs-md); font-weight: 500; color: var(--text-primary); }
.chat-user-role {
    margin-left: var(--sp-1);
    font-size: var(--fs-2xs); font-weight: 600;
    color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .03em;
}
.chat-user-meta {
    display: flex; align-items: center; gap: 5px;
    font-size: var(--fs-xs); color: var(--text-secondary);
}
.chat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chat-dot--online { background: var(--green); }
.chat-dot--recent { background: var(--gray); }

@media (max-width: 480px) {
    .chat-panel { right: 8px; left: 8px; width: auto; }
}

/* === Round 5 : correctifs UI ============================================= */

/* Bug 6 : respiration entre la barre de sub-tabs segmentee et le contenu des
   fiches profil (Client profile / Contacts / Preferences, guests + masterlist). */
.gp-sub { margin-top: 16px; }

/* Bug 8 : bouton discret "Reset filters", visible uniquement quand des filtres
   persistes existent pour l'ecran (UI.persistFilters). */
.c-filters-reset {
    border: none; background: none; cursor: pointer;
    font-size: 11px; color: var(--text-tertiary);
    padding: 4px 6px; border-radius: var(--radius-sm);
    text-decoration: underline; text-underline-offset: 2px;
}
.c-filters-reset:hover { color: var(--text-secondary); background: var(--bg-app); }
