/* Importation d'une typographie moderne et premium */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variables globales de conception (Design System) */
:root {
    /* Palette de Couleurs Premium */
    --primary-color: #4F46E5; /* Indigo vibrant pour l'accentuation */
    --primary-hover: #4338CA;
    --sidebar-bg: #111827; /* Noir profond / Gris très foncé pour le côté pro */
    --sidebar-text: #9CA3AF; /* Gris clair pour contraster sans flasher */
    --sidebar-text-hover: #FFFFFF;
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);

    --bg-color: #F3F4F6; /* Gris très très clair, presque blanc, pour reposer l'oeil */
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    
    --border-color: #E5E7EB;
    
    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;

    /* Ombres (Profondeur) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Bordures arrondies */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    display: flex; 
    height: 100vh; 
    background-color: var(--bg-color); 
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================
   Barre Latérale (Sidebar) - Look "SaaS Premium"
   ========================================= */
.sidebar { 
    width: 270px; 
    background-color: var(--sidebar-bg); 
    color: var(--sidebar-text); 
    display: flex; 
    flex-direction: column; 
    padding: 24px 20px; 
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Scrollbar personnalisée pour la sidebar (si besoin) */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 10px; }

.sidebar h2 { 
    color: #FFFFFF; 
    font-size: 1.25rem; 
    font-weight: 600;
    margin-bottom: 35px; 
    text-align: left; /* Plus pro que centré */
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar a { 
    color: var(--sidebar-text); 
    text-decoration: none; 
    padding: 12px 16px; 
    border-radius: var(--radius-md); 
    margin-bottom: 8px; 
    font-weight: 500;
    transition: all var(--transition-fast); 
    display: flex;
    align-items: center;
}

.sidebar a:hover { 
    background-color: var(--sidebar-active-bg); 
    color: var(--sidebar-text-hover); 
    transform: translateX(4px); /* Petit effet de mouvement très sympa */
}

.sidebar a.active { 
    background-color: var(--primary-color); 
    color: #FFFFFF; 
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3); /* Lueur autour de l'élément actif */
}

/* Séparateur de section dans le sidebar */
.sidebar-sep {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    margin: 14px 0 4px 4px;
    padding: 0;
    pointer-events: none;
    user-select: none;
}

/* Style spécifique pour le bouton déconnexion */
.sidebar a[href="/logout"] {
    margin-top: auto !important;
    background-color: rgba(239, 68, 68, 0.1);
    color: #FCA5A5 !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sidebar a[href="/logout"]:hover {
    background-color: var(--danger-color);
    color: #FFF !important;
    border-color: var(--danger-color);
    transform: translateY(-2px); /* Mouvement vers le haut au lieu de la droite */
}

/* =========================================
   Topbar & Profile Dropdown
   ========================================= */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 260px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 28px;
    z-index: 100;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-subtle);
}

.profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 24px;
    transition: background 0.2s;
}
.profile-badge:hover {
    background: rgba(79, 70, 229, 0.08);
}

.profile-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 48px;
    right: 24px;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    border: 1px solid var(--border-subtle);
    padding: 0;
    overflow: hidden;
    z-index: 200;
}
.profile-dropdown.show {
    display: block;
}

.profile-dropdown-header {
    padding: 16px 18px 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-subtle);
}

.profile-dropdown-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 18px;
    font-size: 13px;
    color: var(--text-main);
}
.profile-dropdown-row .profile-label {
    font-weight: 600;
    color: #6b7280;
}

.profile-logout {
    display: block;
    text-align: center;
    padding: 12px 18px;
    margin: 6px 12px 12px;
    background: var(--danger-color);
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}
.profile-logout:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* =========================================
   Contenu Principal (Main Content)
   ========================================= */
.main-content { 
    flex: 1; 
    padding: 40px;
    padding-top: 72px;
    overflow-y: auto; 
    position: relative;
}

.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 35px; 
}

h1, h2, h3 {
    color: var(--text-main);
    letter-spacing: -0.025em;
}

/* =========================================
   Cartes (Cards)
   ========================================= */
.card { 
    background: var(--card-bg); 
    padding: 30px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-md); 
    border: 1px solid rgba(0,0,0,0.03); /* Bordure très subtile */
    margin-bottom: 25px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* =========================================
   Boutons (Génériques)
   ========================================= */
button, .btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background-color var(--transition-fast), transform 0.1s;
    box-shadow: var(--shadow-sm);
}

button:hover, .btn:hover {
    background-color: var(--primary-hover);
}

button:active, .btn:active {
    transform: scale(0.98);
}

/* =========================================
   Tableaux standards
   ========================================= */
table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    margin-top: 20px; 
    border-radius: var(--radius-md);
    overflow: hidden; /* Pour que les coins arrondis "coupent" le contenu */
    border: 1px solid var(--border-color);
}

th { 
    background-color: #F9FAFB; 
    color: var(--text-muted); 
    text-align: left; 
    padding: 14px 16px; 
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color); 
}

td { 
    padding: 14px 16px; 
    border-bottom: 1px solid var(--border-color); 
    color: var(--text-main);
    background-color: var(--card-bg);
}

/* Effet très subtil au survol des lignes */
tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover td {
    background-color: #F8FAFC;
}

tbody tr:last-child td {
    border-bottom: none; /* Pas de ligne tout en bas */
}

/* Badges de statut */
.status-bad, .badge-danger { 
    background: rgba(239, 68, 68, 0.1); 
    color: var(--danger-color); 
    padding: 4px 10px; 
    border-radius: 999px; /* Forme de pilule */
    font-weight: 600; 
    font-size: 0.75rem;
    display: inline-block;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =========================================
   Tableaux Type Excel (Projets complexes)
   ========================================= */
.table-hint {
    margin: 6px 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.table-scroll.project-table-scroll {
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    max-height: 65vh;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.02); /* Légère ombre interne */
}

.project-table {
    width: 100%;
    min-width: 1500px;
    margin-top: 0;
    border-collapse: separate;
    border-spacing: 0;
    border: none; /* Reset du border standard car on scrolle */
}

.project-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-right: 1px solid var(--border-color);
    border-bottom: 2px solid var(--border-color); /* Ligne plus épaisse sous les headers */
    user-select: none;
    box-shadow: 0 1px 0 var(--border-color); /* Sécurité pour le sticky */
}

.project-table td {
    padding: 10px 16px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
    background-color: #FFFFFF;
}

.project-table tr:hover td {
    background-color: #F1F5F9; /* Highlight bleu-gris très clair */
}

.project-table td:first-child,
.project-table th:first-child {
    border-left: none; /* On ne veut pas double bordure à gauche */
}

.project-table td:last-child,
.project-table th:last-child {
    border-right: none;
}

/* Champs de saisie dans le tableau (Inputs/Selects) */
.project-table input,
.project-table select {
    width: 100%;
    min-width: 110px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.project-table input:focus,
.project-table select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); /* Ring focus élégant */
}

/* Inputs en erreur */
.project-table input:invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Poignée de redimensionnement colonnes */
.project-table th .col-resize-handle {
    position: absolute;
    top: 0;
    right: -3px; /* Légèrement décalé */
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 4;
    transition: background-color var(--transition-fast);
}

.project-table th .col-resize-handle:hover {
    background: var(--primary-color);
    opacity: 0.5;
}

/* Curseur forcé pendant le redimensionnement */
body.is-col-resizing,
body.is-col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

/* =========================================
   Utilitaires
   ========================================= */
/* Si jamais vous avez des formulaires classiques, voici un style de base */
input[type="text"], input[type="search"], input[type="password"], input[type="email"] {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* =========================================
   Dashboard – Synthèse & Filtres réutilisables
   ========================================= */
.dash-section { margin-bottom: 24px; }
.dash-title-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.dash-title-bar h3 { margin:0; font-size:20px; font-weight:700; display:flex; align-items:center; gap:8px; }
.dash-refresh { display:flex; align-items:center; gap:5px; font-size:12px; color:#94a3b8; }
.dash-refresh svg { width:14px; height:14px; }

/* Filtres réutilisables */
.dash-filters { background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:18px 20px; margin-bottom:22px; }
.dash-filters-row { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; }
.dash-filter-group { display:flex; flex-direction:column; gap:4px; flex:1; min-width:180px; }
.dash-filter-group label { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:0.5px; }
.dash-filter-group select,
.dash-filter-group input[type="text"],
.dash-filter-group input[type="date"],
.dash-filter-group input[type="week"] {
    padding:8px 12px; border:1px solid #cbd5e1; border-radius:8px; font-size:13px;
    background:#fff; color:#1e293b; transition:border-color .2s, box-shadow .2s;
}
.dash-filter-group select {
    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='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 10px center; padding-right:30px;
}
.dash-filter-group select:focus,
.dash-filter-group input[type="text"]:focus,
.dash-filter-group input[type="date"]:focus,
.dash-filter-group input[type="week"]:focus { outline:none; border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(79,70,229,.12); }
.dash-filters-actions { display:flex; gap:8px; align-items:flex-end; padding-top:18px; }
.dash-btn-primary { padding:8px 22px; background:var(--primary-color); color:#fff; border:none; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; transition:background .2s, transform .15s, box-shadow .2s; }
.dash-btn-primary:hover { background:#4338ca; transform:translateY(-1px); box-shadow:0 4px 12px rgba(79,70,229,.25); }
.dash-btn-secondary { padding:8px 22px; background:#e2e8f0; color:#475569; border:none; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-block; transition:background .2s; }
.dash-btn-secondary:hover { background:#cbd5e1; }

/* KPI Cards */
.dash-kpi-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; margin-bottom:24px; }
@media (max-width:1024px) { .dash-kpi-grid { grid-template-columns:repeat(2, 1fr); } }
@media (max-width:600px) { .dash-kpi-grid { grid-template-columns:1fr; } }
.dash-kpi { background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:20px; display:flex; align-items:flex-start; gap:14px; transition:transform .2s, box-shadow .2s; animation:kpiFadeIn .5s ease both; position:relative; overflow:hidden; }
.dash-kpi:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.07); }
.dash-kpi:nth-child(1) { animation-delay:.05s; }
.dash-kpi:nth-child(2) { animation-delay:.1s; }
.dash-kpi:nth-child(3) { animation-delay:.15s; }
.dash-kpi:nth-child(4) { animation-delay:.2s; }
@keyframes kpiFadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.dash-kpi-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.dash-kpi-body { flex:1; min-width:0; }
.dash-kpi-label { font-size:12px; font-weight:600; color:#94a3b8; text-transform:uppercase; letter-spacing:0.3px; margin-bottom:4px; }
.dash-kpi-value { font-size:28px; font-weight:800; line-height:1.1; }
.dash-kpi-link { font-size:11px; color:var(--primary-color); text-decoration:none; font-weight:600; margin-top:6px; display:inline-flex; align-items:center; gap:3px; opacity:.7; transition:opacity .2s; }
.dash-kpi-link:hover { opacity:1; text-decoration:underline; }
.dash-kpi-link svg { width:12px; height:12px; }
[data-tooltip] { position:relative; cursor:help; }
[data-tooltip]:hover::after { content:attr(data-tooltip); position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); background:#1e293b; color:#fff; font-size:11px; font-weight:500; padding:5px 10px; border-radius:6px; white-space:nowrap; z-index:50; pointer-events:none; animation:ttFade .15s ease; }
@keyframes ttFade { from { opacity:0; transform:translateX(-50%) translateY(3px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* Charts */
.dash-charts-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(420px,1fr)); gap:18px; margin-bottom:22px; }
@media (max-width:900px) { .dash-charts-grid { grid-template-columns:1fr; } }
.dash-chart-card { background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:22px; text-align:center; }
.dash-chart-card h4 { margin:0 0 2px 0; font-size:15px; font-weight:700; color:#1e293b; display:flex; align-items:center; justify-content:center; gap:6px; }
.dash-chart-card .dash-chart-sub { margin:0 0 16px 0; color:#94a3b8; font-size:12px; }
.dash-chart-table { font-size:13px; margin:14px auto 0; text-align:left; border-collapse:collapse; }
.dash-chart-table th { font-size:11px; text-transform:uppercase; color:#94a3b8; font-weight:600; padding:4px 10px; border-bottom:1px solid #e2e8f0; }
.dash-chart-table td { padding:4px 10px; }

/* Risques */
.dash-risk-card { background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:22px; }
.dash-risk-card h4 { margin:0 0 14px 0; font-size:15px; font-weight:700; display:flex; align-items:center; gap:6px; }
.dash-risk-card h4 a { color:inherit; text-decoration:none; }
.dash-risk-card h4 a:hover { text-decoration:underline; }
.dash-risk-table { width:100%; border-collapse:collapse; font-size:13px; }
.dash-risk-table th { font-size:11px; text-transform:uppercase; color:#94a3b8; font-weight:600; padding:8px 10px; border-bottom:2px solid #e2e8f0; text-align:left; }
.dash-risk-table td { padding:8px 10px; border-bottom:1px solid #f1f5f9; }
.dash-risk-table tr:hover { background:#f8fafc; }

/* Annuaire – Liste éditable */
.dash-annuaire-list { display:flex; flex-direction:column; gap:12px; }
.dash-annuaire-row .dash-filters { transition:box-shadow .2s, transform .15s; }
.dash-annuaire-row .dash-filters:hover { box-shadow:0 4px 16px rgba(0,0,0,.06); transform:translateY(-1px); }
.dash-annuaire-row .dash-filters-actions { display:flex; gap:8px; align-items:center; padding-top:10px; }

/* Filter badge */
.dash-filter-badge { display:inline-flex; align-items:center; gap:4px; background:#4f46e5; color:#fff; font-size:12px; font-weight:600; padding:4px 10px; border-radius:12px; white-space:nowrap; }

/* Generic reusable form input (number) */
.dash-filter-group input[type="number"] {
    padding:8px 12px; border:1px solid #cbd5e1; border-radius:8px; font-size:13px;
    background:#fff; color:#1e293b; transition:border-color .2s, box-shadow .2s;
}
.dash-filter-group input[type="number"]:focus { outline:none; border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(79,70,229,.12); }

/* Shared layout helpers */
.table-scroll { overflow-x:auto; }
.project-table { border-collapse:collapse; width:100%; font-size:13px; }
.project-table th, .project-table td { padding:6px 8px; border:1px solid #e5e7eb; white-space:nowrap; }
.project-table th { background:#f8fafc; color:#374151; font-weight:600; position:sticky; top:0; z-index:2; }
.project-table tr:hover { background:#f1f5f9; }
.table-hint { font-size:12px; color:#6b7280; margin-bottom:10px; }
.card { background:#fff; border-radius:12px; padding:20px; box-shadow:0 1px 4px rgba(0,0,0,.06); }

/* ── Échéancier design system ── */
.ech-info-card { display:flex; gap:20px; flex-wrap:wrap; background:#f0f9ff; border:1px solid #bae6fd; border-radius:12px; padding:12px 20px; margin-bottom:14px; align-items:center; }
.ech-info-item { font-size:13px; color:#0c4a6e; }
.ech-info-item strong { font-weight:700; }
.ech-info-item.ech-info-total { border-left:2px solid #4f46e5; padding-left:14px; }
.ech-info-item .ech-info-empty { color:#9ca3af; }

.ech-toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:10px; }
.ech-toolbar-btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border:1px solid #cbd5e1; background:#fff; border-radius:8px; cursor:pointer; font-size:13px; font-weight:500; color:#1e293b; transition:all .15s; }
.ech-toolbar-btn:hover { background:#f8fafc; border-color:#94a3b8; transform:translateY(-1px); box-shadow:0 2px 6px rgba(0,0,0,.06); }
.ech-toolbar-btn.ech-btn-danger { border-color:#fca5a5; color:#991b1b; background:#fff5f5; }
.ech-toolbar-btn.ech-btn-danger:hover { background:#fee2e2; border-color:#f87171; }

.ech-btn-success { padding:8px 20px; background:#16a34a; color:#fff; border:none; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; transition:background .2s, transform .15s; }
.ech-btn-success:hover { background:#15803d; transform:translateY(-1px); box-shadow:0 3px 10px rgba(22,163,74,.2); }

.ech-btn-save { padding:10px 22px; background:var(--primary-color); color:#fff; border:none; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; margin-top:12px; transition:background .2s, transform .15s; }
.ech-btn-save:hover { background:#4338ca; transform:translateY(-1px); box-shadow:0 3px 10px rgba(79,70,229,.25); }

.ech-hint { font-size:12px; color:#6b7280; margin:0 0 10px 0; }

/* Échéancier table */
#echeancier-table { border-collapse:collapse; width:100%; font-size:13px; }
#echeancier-table th { background:#f8fafc; color:#374151; font-weight:600; padding:8px 10px; border:1px solid #e2e8f0; white-space:nowrap; position:sticky; top:0; z-index:2; }
#echeancier-table td { padding:4px 6px; border:1px solid #e2e8f0; vertical-align:middle; }
#echeancier-table tr:hover { background:#f8fafc; }
#echeancier-table tr[data-index] { transition:background .1s; }
#echeancier-table input,
#echeancier-table select { padding:6px 8px; border:1px solid #cbd5e1; border-radius:6px; font-size:12px; background:#fff; color:#1e293b; transition:border-color .15s; }
#echeancier-table input:focus,
#echeancier-table select:focus { outline:none; border-color:var(--primary-color); box-shadow:0 0 0 2px rgba(79,70,229,.1); }
#echeancier-table input[readonly] { background:#f1f5f9; color:#64748b; }

.ech-level-badge { display:inline-block; min-width:34px; text-align:center; padding:3px 8px; border-radius:12px; font-size:12px; font-weight:600; }

/* Tree-grid: chevron toggle */
.ech-chevron { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; cursor:pointer; font-size:10px; color:#64748b; transition:transform .2s ease, color .15s; user-select:none; flex-shrink:0; border-radius:4px; }
.ech-chevron:hover { color:#1e293b; background:#e2e8f0; }
.ech-chevron-open { transform:rotate(90deg); }
.ech-wbs-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; font-family:'Inter',monospace; letter-spacing:.3px; }
.ech-parent-row td { font-weight:500; }
.ech-hidden { display:none !important; }

/* Drag visual */
#echeancier-table tr[draggable="true"] { cursor:default; }
#echeancier-table tr[draggable="true"] td:first-child { cursor:grab; }

/* Overdue alert card */
.ech-alert-card { border-left:4px solid #dc2626; margin-bottom:14px; }
.ech-alert-card h4 { margin:0 0 8px 0; font-size:14px; }
.ech-alert-card table { border-collapse:collapse; width:100%; font-size:13px; }
.ech-alert-card th { background:#fef2f2; padding:6px 10px; text-align:left; font-weight:600; color:#991b1b; border-bottom:1px solid #fecaca; }
.ech-alert-card td { padding:6px 10px; border-bottom:1px solid #f1f5f9; }

/* ── Affectation Ressources ── */
.aff-grid { display:grid; grid-template-columns:1.6fr 1fr; gap:16px; align-items:start; }
@media (max-width:900px) { .aff-grid { grid-template-columns:1fr; } }
.aff-helper-text { font-size:12px; color:#64748b; margin-bottom:10px; }
.aff-scroll-list { max-height:520px; overflow:auto; padding-right:4px; }
.aff-target-form { display:flex; flex-direction:column; gap:12px; }
.aff-target-form .dash-filter-group { min-width:auto; }
.aff-resource-card { display:block; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; margin-bottom:8px; cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.aff-resource-card:hover { border-color:#94a3b8; box-shadow:0 2px 8px rgba(0,0,0,.04); }
.aff-resource-card:has(input:checked) { border-color:var(--primary-color); background:#eef2ff; }
.aff-resource-row { display:flex; align-items:flex-start; gap:10px; }
.aff-resource-row input[type="checkbox"] { margin-top:4px; accent-color:var(--primary-color); width:16px; height:16px; }
.aff-resource-info { flex:1; }
.aff-resource-name { font-weight:600; font-size:13px; color:#1e293b; }
.aff-resource-email { font-size:12px; color:#64748b; }
.aff-resource-meta { font-size:12px; color:#94a3b8; margin-top:3px; }

/* Tabs bar */
.aff-tabs-bar { display:flex; gap:6px; margin-bottom:18px; border-bottom:2px solid #e2e8f0; padding-bottom:0; }
.aff-tab-btn { background:none; border:none; border-bottom:3px solid transparent; padding:10px 18px; font-size:14px; font-weight:600; color:#64748b; cursor:pointer; transition:all .15s; border-radius:6px 6px 0 0; }
.aff-tab-btn:hover { color:#1e293b; background:#f8fafc; }
.aff-tab-btn.aff-tab-active { color:var(--primary-color); border-bottom-color:var(--primary-color); background:#eef2ff; }

/* Search input */
.aff-search-input { width:100%; padding:8px 12px; border:1px solid #e2e8f0; border-radius:8px; font-size:13px; margin-bottom:10px; box-sizing:border-box; transition:border-color .15s; }
.aff-search-input:focus { border-color:var(--primary-color); outline:none; box-shadow:0 0 0 3px rgba(99,102,241,.1); }

/* KPI indicators */
.aff-indicators { display:flex; gap:14px; margin-bottom:18px; flex-wrap:wrap; }
.aff-kpi { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:14px 20px; display:flex; flex-direction:column; align-items:center; min-width:120px; box-shadow:0 1px 4px rgba(0,0,0,.03); }
.aff-kpi-val { font-size:26px; font-weight:700; color:var(--primary-color); }
.aff-kpi-label { font-size:11px; color:#64748b; margin-top:2px; text-transform:uppercase; letter-spacing:.5px; }

/* Equipe badges */
.aff-equipe-panel { display:flex; flex-wrap:wrap; gap:8px; max-height:260px; overflow:auto; }
.aff-empty-team { font-size:13px; color:#94a3b8; font-style:italic; }
.aff-badge { position:relative; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:10px 30px 10px 12px; min-width:140px; transition:box-shadow .15s; }
.aff-badge:hover { box-shadow:0 2px 8px rgba(0,0,0,.06); }
.aff-badge-name { font-weight:600; font-size:13px; color:#1e293b; }
.aff-badge-role { font-size:11px; color:#64748b; }
.aff-badge-taux { font-size:11px; color:var(--primary-color); font-weight:600; }
.aff-badge-remove { position:absolute; top:4px; right:6px; background:none; border:none; font-size:16px; color:#ef4444; cursor:pointer; line-height:1; padding:2px; }
.aff-badge-remove:hover { color:#b91c1c; }
.aff-count-badge { display:inline-block; background:var(--primary-color); color:#fff; font-size:12px; font-weight:700; padding:2px 9px; border-radius:20px; margin-left:6px; vertical-align:middle; }

/* Cartes ressources */
.aff-cartes-filters { display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; align-items:center; }
.aff-filter-select { padding:8px 12px; border:1px solid #e2e8f0; border-radius:8px; font-size:13px; min-width:180px; }
.aff-cartes-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; }
.aff-carte { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:18px; box-shadow:0 1px 6px rgba(0,0,0,.03); transition:box-shadow .15s, transform .15s; }
.aff-carte:hover { box-shadow:0 4px 16px rgba(0,0,0,.07); transform:translateY(-2px); }
.aff-carte-header { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.aff-carte-avatar { width:40px; height:40px; border-radius:50%; background:linear-gradient(135deg, var(--primary-color), #818cf8); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; text-transform:uppercase; flex-shrink:0; }
.aff-carte-name { font-weight:700; font-size:14px; color:#1e293b; }
.aff-carte-profil { font-size:12px; color:#64748b; }
.aff-carte-charge { display:flex; justify-content:space-between; align-items:center; padding:6px 10px; background:#f1f5f9; border-radius:8px; margin-bottom:10px; font-size:12px; color:#475569; }
.aff-carte-taux-val { font-weight:700; color:var(--primary-color); font-size:14px; }
.aff-carte-comps { margin-bottom:10px; }
.aff-comp-section { display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin-bottom:6px; }
.aff-comp-label { font-size:10px; font-weight:700; color:#94a3b8; text-transform:uppercase; margin-right:4px; letter-spacing:.5px; }
.aff-comp-tag { display:inline-block; padding:2px 8px; border-radius:12px; font-size:11px; font-weight:500; }
.aff-comp-tech { background:#eef2ff; color:#4f46e5; }
.aff-comp-func { background:#ecfdf5; color:#059669; }
.aff-no-comp { font-size:12px; color:#94a3b8; font-style:italic; margin:0; }
.aff-carte-actions { text-align:right; }
.aff-btn-detail { background:none; border:1px solid #e2e8f0; border-radius:6px; padding:5px 12px; font-size:12px; color:#475569; cursor:pointer; transition:all .15s; }
.aff-btn-detail:hover { background:#f1f5f9; border-color:#94a3b8; }
.aff-btn-small { background:var(--primary-color); color:#fff; border:none; border-radius:6px; padding:5px 10px; font-size:12px; cursor:pointer; }
.aff-btn-small:hover { opacity:.85; }
.aff-carte-detail { margin-top:12px; padding-top:12px; border-top:1px solid #e2e8f0; }
.aff-detail-section { margin-bottom:10px; font-size:12px; color:#475569; }
.aff-detail-comp { display:flex; align-items:center; gap:6px; margin:3px 0; }
.aff-niveau { font-size:11px; font-weight:600; padding:1px 8px; border-radius:10px; }
.aff-niveau-expert { background:#dcfce7; color:#15803d; }
.aff-niveau-intermediaire { background:#fef9c3; color:#a16207; }
.aff-niveau-debutant { background:#fee2e2; color:#b91c1c; }

/* Matrice compétences */
.aff-matrice-controls { display:flex; gap:16px; margin-bottom:12px; align-items:center; }
.aff-radio-label { display:flex; align-items:center; gap:4px; font-size:13px; color:#475569; cursor:pointer; }
.aff-radio-label input[type="radio"] { accent-color:var(--primary-color); }
.aff-matrix-legend { display:flex; align-items:center; gap:6px; margin-bottom:14px; font-size:12px; color:#64748b; }
.aff-ml-box { display:inline-block; width:18px; height:18px; border-radius:4px; vertical-align:middle; }
.aff-matrix-wrap { overflow-x:auto; border:1px solid #e2e8f0; border-radius:10px; }
.aff-matrix-table { width:100%; border-collapse:collapse; font-size:12px; }
.aff-matrix-table th, .aff-matrix-table td { padding:6px 8px; text-align:center; border:1px solid #f1f5f9; }
.aff-matrix-corner { text-align:left; font-weight:700; background:#f8fafc; position:sticky; left:0; z-index:2; min-width:140px; }
.aff-matrix-name { text-align:left; font-weight:600; color:#1e293b; background:#fff; position:sticky; left:0; z-index:1; white-space:nowrap; min-width:140px; }
.aff-matrix-header { font-weight:600; background:#f8fafc; font-size:10px; white-space:nowrap; writing-mode:vertical-lr; transform:rotate(180deg); padding:12px 4px; min-width:28px; }
.aff-mh-tech { color:#4f46e5; }
.aff-mh-func { color:#059669; }
.aff-matrix-cell { min-width:28px; height:28px; }
.aff-matrix-expert { background:#dcfce7; color:#15803d; font-weight:700; }
.aff-matrix-intermediaire { background:#fef9c3; color:#a16207; font-weight:600; }
.aff-matrix-debutant { background:#fee2e2; color:#b91c1c; }
.aff-matrix-empty { background:#fafafa; color:#e2e8f0; }

/* ── Feuille de Temps ── */
.fdt-msg-card { margin-bottom:12px; border-left:4px solid #16a34a; }
.fdt-error-text { margin-bottom:12px; color:#b91c1c; }
.fdt-scope-banner { margin-bottom:12px; padding:8px 10px; border-radius:6px; font-size:13px; }
.fdt-scope-banner--admin { border-left:4px solid #2563eb; background:#eff6ff; color:#1e3a8a; }
.fdt-scope-banner--collab { border-left:4px solid #16a34a; background:#ecfdf5; color:#14532d; }
.fdt-scope-banner--user { border-left:4px solid #0ea5e9; background:#ecfeff; color:#0f172a; }
.fdt-scope-banner--all { border-left:4px solid #7c3aed; background:#f5f3ff; color:#4c1d95; }
.fdt-history-card { margin:12px 0; border-left:4px solid #7c3aed; }
.fdt-planning-card { margin:12px 0; border-left:4px solid #2563eb; }
.fdt-card-title { margin:0 0 8px 0; }
.fdt-status-counter { font-size:13px; color:#4c1d95; margin-bottom:8px; }
.fdt-info-text { font-size:13px; color:#1e3a8a; }
.fdt-info-text--muted { color:#6b7280; }
.fdt-section-title { margin-top:14px; }
.fdt-status-label { font-size:12px; color:#4b5563; margin:4px 0 8px 0; }
.fdt-locked-warning { margin-bottom:10px; background:#fff7ed; border-left:4px solid #ea580c; color:#9a3412; padding:8px 10px; border-radius:6px; font-size:13px; }
.fdt-hours-input { width:70px; padding:4px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; transition:border-color .2s; }
.fdt-hours-input:focus { outline:none; border-color:var(--primary-color); box-shadow:0 0 0 3px rgba(79,70,229,.12); }
.fdt-total-row { background:#f3f4f6; font-weight:700; }
.fdt-btn-bar { margin-top:10px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.fdt-btn-save { background:#16a34a; color:#fff; border:none; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; font-weight:600; transition:background .2s; }
.fdt-btn-save:hover { background:#15803d; }
.fdt-btn-submit { background:#2563eb; color:#fff; border:none; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; font-weight:600; transition:background .2s; }
.fdt-btn-submit:hover { background:#1d4ed8; }
.fdt-btn--disabled { background:#9ca3af !important; cursor:not-allowed !important; }
.fdt-hint { font-size:12px; color:#4b5563; }
.fdt-badge { font-size:11px; }
.fdt-badge--horsprojet { color:#7c3aed; }
.fdt-badge--planned { color:#2563eb; }
.fdt-label--horsprojet { color:#7c3aed; font-weight:600; }
.fdt-approval-form { display:flex; gap:6px; align-items:center; }
.fdt-approval-select { padding:6px 8px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; background:#fff; }
.fdt-approval-select:focus { outline:none; border-color:var(--primary-color); }
.fdt-btn-validate { background:#16a34a; color:#fff; border:none; padding:6px 8px; border-radius:4px; cursor:pointer; font-size:13px; font-weight:600; transition:background .2s; }
.fdt-btn-validate:hover { background:#15803d; }

/* ── Vision Ressources ── */
.vr-kpi-banner { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:10px; padding:12px 16px; border-radius:8px; border-width:1px; border-style:solid; }
.vr-kpi-name { font-size:18px; font-weight:700; color:#1e293b; }
.vr-kpi-details { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.vr-kpi-text { font-size:13px; color:#4b5563; }
.vr-kpi-sep { font-size:13px; color:#64748b; }
.vr-kpi-taux { font-size:15px; font-weight:700; background:#fff; padding:3px 10px; border-radius:12px; border-width:1px; border-style:solid; }
.vr-kpi-surcharge { font-size:12px; background:#fecaca; color:#991b1b; padding:2px 8px; border-radius:8px; font-weight:600; }
.vr-chart-card { margin-top:10px; }
.vr-chart-box { position:relative; width:100%; max-height:calc(100vh - 220px); min-height:250px; }
.vr-aff-card { margin-top:16px; }
.vr-aff-title { margin:0 0 10px 0; }
.vr-link { color:#2563eb; text-decoration:underline; }

/* ── Vision Projet (Gantt) ── */
.vp-info-banner { display:flex; gap:16px; flex-wrap:wrap; background:#f0f9ff; border:1px solid #bae6fd; border-radius:8px; padding:10px 16px; margin-bottom:14px; align-items:center; }
.vp-info-item { font-size:13px; color:#0c4a6e; }
.vp-info-item span.vp-na { color:#9ca3af; }
.vp-empty { color:#6b7280; padding:20px 0; }
.vp-gantt-outer { overflow-x:auto; border:1px solid #e5e7eb; border-radius:8px; }
.vp-gantt-inner { min-width:900px; }
.vp-gantt-header { display:flex; border-bottom:2px solid #cbd5e1; background:#f0f9ff; }
.vp-gantt-task-col { flex:0 0 320px; min-width:320px; padding:6px 8px; font-size:12px; font-weight:700; color:#1e3a8a; border-right:1px solid #e5e7eb; }
.vp-gantt-months { flex:1; display:flex; position:relative; }
.vp-gantt-month { text-align:center; font-size:11px; font-weight:600; color:#1e3a8a; border-right:1px solid #e5e7eb; padding:4px 0; white-space:nowrap; overflow:hidden; }
.vp-gantt-row { display:flex; min-height:28px; border-bottom:1px solid #f3f4f6; }
.vp-gantt-label { flex:0 0 320px; min-width:320px; padding:4px 8px; display:flex; align-items:center; border-right:1px solid #e5e7eb; font-size:12px; overflow:hidden; }
.vp-gantt-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vp-gantt-wbs { color:#9ca3af; margin-right:6px; }
.vp-gantt-area { flex:1; position:relative; min-height:28px; }
.vp-gantt-bar { position:absolute; opacity:0.85; }
.vp-phase-badge { font-size:10px; padding:1px 6px; border-radius:4px; margin-left:6px; }
.vp-ressource-badge { font-size:10px; color:#6b7280; margin-left:4px; }
.vp-charge-badge { font-size:10px; color:#4b5563; margin-left:4px; }
.vp-legend { display:flex; gap:12px; flex-wrap:wrap; margin-top:12px; padding:8px; background:#f9fafb; border-radius:6px; }
.vp-legend-item { display:flex; align-items:center; gap:4px; font-size:12px; }
.vp-legend-swatch { width:14px; height:14px; border-radius:3px; }
.vp-today-wrapper { position:absolute; top:0; bottom:0; left:0; right:0; display:flex; pointer-events:none; z-index:10; }
.vp-today-spacer { flex:0 0 320px; min-width:320px; }
.vp-today-inner { flex:1; position:relative; }
.vp-today-line { position:absolute; top:0; bottom:0; width:2px; background:#dc2626; opacity:0.7; }

/* ── Reporting ── */
.rpt-col-card { margin-bottom:12px; }
.rpt-col-title { margin:0 0 8px 0; }
.rpt-col-actions { display:flex; gap:8px; margin-bottom:10px; flex-wrap:wrap; }
.rpt-col-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:8px; margin-bottom:10px; }
.rpt-col-label { display:flex; align-items:center; gap:8px; border:1px solid #e5e7eb; border-radius:8px; padding:8px; background:#fff; cursor:pointer; transition:border-color .2s, box-shadow .15s; }
.rpt-col-label:hover { border-color:#94a3b8; }
.rpt-col-label:has(input:checked) { border-color:var(--primary-color); background:#eef2ff; }
.rpt-btn-check { background:#1f2937; color:#fff; border:none; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; font-weight:600; transition:background .2s; }
.rpt-btn-check:hover { background:#374151; }
.rpt-btn-uncheck { background:#6b7280; color:#fff; border:none; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:13px; font-weight:600; transition:background .2s; }
.rpt-btn-uncheck:hover { background:#4b5563; }
.rpt-btn-export { background:#0ea5e9; color:#fff; border:none; padding:10px 14px; border-radius:6px; cursor:pointer; font-size:13px; font-weight:600; transition:background .2s; }
.rpt-btn-export:hover { background:#0284c7; }

/* ── Simulateur ── */
.sim-fieldset { border:1px solid #d1d5db; border-radius:8px; padding:12px 14px; }
.sim-fieldset legend { font-weight:700; }
.sim-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:14px; }
.sim-row { display:flex; justify-content:space-between; align-items:center; padding:5px 0; border-bottom:1px solid #f3f4f6; }
.sim-row:last-child { border-bottom:none; }
.sim-row label { flex:1; font-size:13px; color:#374151; }
.sim-row input[type="number"] { width:72px; padding:5px 6px; border:1px solid #d1d5db; border-radius:4px; text-align:right; font-size:13px; }
.sim-row input[type="checkbox"] { width:18px; height:18px; cursor:pointer; }
.sim-row select { padding:5px 6px; border:1px solid #d1d5db; border-radius:4px; font-size:13px; min-width:160px; }
.sim-btn-bar { margin-top:14px; display:flex; gap:10px; align-items:center; }
.sim-btn-calc { background:#2563eb; color:#fff; border:none; padding:10px 18px; border-radius:6px; font-size:14px; font-weight:600; cursor:pointer; transition:background .2s; }
.sim-btn-calc:hover { background:#1d4ed8; }
.sim-btn-reset { background:#6b7280; color:#fff; border:none; padding:10px 14px; border-radius:6px; font-size:14px; font-weight:600; cursor:pointer; transition:background .2s; }
.sim-btn-reset:hover { background:#4b5563; }
.sim-result { display:none; margin-top:16px; }
.sim-result-highlight { color:#2563eb; }
.sim-result-value { color:#2563eb; font-size:16px; }

/* Simulateur — Project Selector & Metadata */
.sim-project-selector { margin-bottom:16px; }
.sim-project-selector .dash-filter-group { margin-bottom:10px; }
.sim-project-selector select { min-width:320px; }
.sim-project-meta { display:flex; gap:16px; flex-wrap:wrap; background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px 18px; align-items:center; }
.sim-meta-item { display:flex; flex-direction:column; gap:2px; }
.sim-meta-label { font-size:11px; color:#9ca3af; text-transform:uppercase; letter-spacing:.5px; font-weight:600; }
.sim-meta-value { font-size:14px; color:#1f2937; font-weight:500; }
.sim-meta-badge { display:inline-block; background:#eef2ff; color:var(--primary-color); padding:3px 10px; border-radius:20px; font-size:12px; font-weight:600; }

/* Simulateur — Save / Edit / Read-only */
.sim-btn-save { background:#16a34a; color:#fff; border:none; padding:10px 18px; border-radius:6px; font-size:14px; font-weight:600; cursor:pointer; transition:background .2s; }
.sim-btn-save:hover { background:#15803d; }
.sim-btn-edit { background:#d97706; color:#fff; border:none; padding:10px 14px; border-radius:6px; font-size:14px; font-weight:600; cursor:pointer; transition:background .2s; }
.sim-btn-edit:hover { background:#b45309; }
.sim-readonly-badge { display:inline-flex; align-items:center; gap:4px; background:#fef3c7; color:#92400e; padding:6px 14px; border-radius:6px; font-size:13px; font-weight:600; }

/* Simulateur — History Panel */
.sim-history-panel { margin-bottom:18px; background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:16px; }
.sim-history-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.sim-history-header h4 { margin:0; font-size:15px; color:#1f2937; }
.sim-btn-toggle-hist { background:#f3f4f6; border:1px solid #d1d5db; padding:5px 12px; border-radius:6px; font-size:12px; cursor:pointer; transition:background .2s; }
.sim-btn-toggle-hist:hover { background:#e5e7eb; }
.sim-version-badge { display:inline-block; background:#eef2ff; color:var(--primary-color); padding:2px 10px; border-radius:12px; font-size:12px; font-weight:700; }
.sim-hist-actions { display:flex; gap:4px; flex-wrap:wrap; }
.sim-btn-consult { background:#2563eb; color:#fff; border:none; padding:4px 10px; border-radius:4px; font-size:11px; cursor:pointer; font-weight:600; transition:background .2s; }
.sim-btn-consult:hover { background:#1d4ed8; }
.sim-btn-recalc { background:#d97706; color:#fff; border:none; padding:4px 10px; border-radius:4px; font-size:11px; cursor:pointer; font-weight:600; transition:background .2s; }
.sim-btn-recalc:hover { background:#b45309; }
.sim-btn-del-hist { background:#ef4444; color:#fff; border:none; padding:4px 8px; border-radius:4px; font-size:11px; cursor:pointer; transition:background .2s; }
.sim-btn-del-hist:hover { background:#dc2626; }

/* ── WBS Workspace ── */

/* Kanban board */
.wbs-kanban-board { display:flex; gap:10px; overflow-x:auto; margin-bottom:16px; }
.wbs-kanban-col { flex:1; min-width:240px; background:#f9fafb; border-radius:8px; padding:10px; border:2px solid transparent; transition:border-color .2s; }
.wbs-kanban-col.drag-over { border-color:#2563eb !important; background:#eff6ff !important; }
.wbs-kanban-col-title { margin:0 0 10px 0; text-align:center; font-size:14px; }
.wbs-kanban-drop { min-height:60px; }

/* Kanban card */
.wbs-card { background:#fff; border:1px solid #e5e7eb; border-radius:8px; padding:10px; margin-bottom:8px; cursor:grab; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.wbs-card.dragging { opacity:0.5; }
.wbs-card-title { font-weight:600; font-size:13px; margin-bottom:4px; }
.wbs-card-desc { font-size:12px; color:#6b7280; margin-bottom:4px; }
.wbs-card-badges { display:flex; gap:6px; flex-wrap:wrap; font-size:11px; margin-bottom:4px; }
.wbs-badge-sp { background:#ede9fe; color:#7c3aed; padding:2px 6px; border-radius:4px; }
.wbs-badge-duration { background:#e0f2fe; color:#0369a1; padding:2px 6px; border-radius:4px; }
.wbs-badge-comment { background:#fef3c7; color:#92400e; padding:2px 6px; border-radius:4px; }
.wbs-badge-attach { background:#f0fdf4; color:#166534; padding:2px 6px; border-radius:4px; }
.wbs-card-wbs { font-size:11px; color:#9ca3af; }
.wbs-card-assigned { font-size:11px; color:#4b5563; margin-top:2px; }
.wbs-card-date { font-size:10px; color:#9ca3af; margin-top:3px; }
.wbs-card-actions { margin-top:6px; display:flex; gap:4px; }
.wbs-btn-detail { background:#2563eb; color:#fff; border:none; padding:3px 8px; border-radius:4px; font-size:11px; cursor:pointer; transition:background .2s; }
.wbs-btn-detail:hover { background:#1d4ed8; }
.wbs-btn-delete { background:#dc2626; color:#fff; border:none; padding:3px 8px; border-radius:4px; font-size:11px; cursor:pointer; transition:background .2s; }
.wbs-btn-delete:hover { background:#b91c1c; }

/* WBS item card */
.wbs-item { margin-bottom:8px; border-left:4px solid #2563eb; }
.wbs-item-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.wbs-item-subtache { font-size:12px; color:#6b7280; }
.wbs-item-dates { font-size:11px; color:#9ca3af; margin-left:8px; }
.wbs-item-resource { font-size:11px; color:#4b5563; margin-left:8px; }
.wbs-btn-add-subtask { background:#0ea5e9; color:#fff; border:none; padding:4px 10px; border-radius:4px; font-size:12px; cursor:pointer; transition:background .2s; }
.wbs-btn-add-subtask:hover { background:#0284c7; }

/* Subtask row in WBS item */
.wbs-sub-row { padding:4px 8px; font-size:12px; color:#374151; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid #f3f4f6; }
.wbs-sub-status { color:#9ca3af; }
.wbs-sub-meta { color:#6b7280; }

/* Add subtask form */
.wbs-add-form { display:none; margin-top:8px; padding:8px; background:#f0f9ff; border-radius:6px; }
.wbs-add-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:6px; }
.wbs-add-grid input, .wbs-add-grid select { padding:6px; border:1px solid #d1d5db; border-radius:4px; font-size:13px; }
.wbs-add-grid select[multiple] { min-height:60px; }
.wbs-btn-create { background:#16a34a; color:#fff; border:none; padding:6px 12px; border-radius:4px; font-size:12px; cursor:pointer; font-weight:600; transition:background .2s; }
.wbs-btn-create:hover { background:#15803d; }

/* Section headings */
.wbs-section-title { margin:0 0 10px 0; }
.wbs-section-title-mt { margin:16px 0 10px 0; }
.wbs-empty { color:#6b7280; }

/* Modal */
.wbs-modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.5); z-index:9999; align-items:center; justify-content:center; }
.wbs-modal.active { display:flex; }
.wbs-modal-content { background:#fff; border-radius:12px; padding:20px; max-width:700px; width:90%; max-height:85vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.wbs-modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.wbs-modal-header h4 { margin:0; }
.wbs-modal-close { background:none; border:none; font-size:20px; cursor:pointer; }

/* Modal body (JS-rendered) */
.wbs-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.wbs-detail-desc { margin-bottom:12px; }
.wbs-detail-desc-text { color:#374151; }
.wbs-detail-assigned { margin-bottom:8px; }
.wbs-transition-box { margin-bottom:12px; padding:10px; background:#f9fafb; border-radius:8px; border:1px solid #e5e7eb; }
.wbs-transition-box h5 { margin:0 0 8px 0; color:#374151; }
.wbs-transition-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; font-size:12px; }
.wbs-trans-todo { padding:4px 8px; background:#f3f4f6; border-radius:4px; }
.wbs-trans-todo span { color:#6b7280; }
.wbs-trans-progress { padding:4px 8px; background:#dbeafe; border-radius:4px; }
.wbs-trans-progress span { color:#2563eb; }
.wbs-trans-testing { padding:4px 8px; background:#fef3c7; border-radius:4px; }
.wbs-trans-testing span { color:#d97706; }
.wbs-trans-done { padding:4px 8px; background:#dcfce7; border-radius:4px; }
.wbs-trans-done span { color:#16a34a; }
.wbs-comment-row { border-bottom:1px solid #f3f4f6; padding:6px 0; font-size:12px; }
.wbs-comment-date { color:#9ca3af; }
.wbs-attach-link { font-size:12px; padding:4px 0; }
.wbs-no-data { color:#9ca3af; font-size:12px; }
.wbs-comment-form { margin-top:8px; }
.wbs-comment-form textarea { width:100%; padding:6px; border:1px solid #d1d5db; border-radius:4px; font-size:12px; resize:vertical; }
.wbs-btn-send { background:#2563eb; color:#fff; border:none; padding:5px 10px; border-radius:4px; font-size:12px; cursor:pointer; margin-top:4px; transition:background .2s; }
.wbs-btn-send:hover { background:#1d4ed8; }
.wbs-attach-form { margin-top:8px; }
.wbs-attach-form input[type="file"] { font-size:12px; }
.wbs-btn-attach { background:#0ea5e9; color:#fff; border:none; padding:5px 10px; border-radius:4px; font-size:12px; cursor:pointer; margin-top:4px; transition:background .2s; }
.wbs-btn-attach:hover { background:#0284c7; }
.wbs-modal-section-title { margin:12px 0 6px 0; }
