/* Polices Locales */
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./vendor/fonts/raleway/raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('./vendor/fonts/outfit/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Palette SEMI (Grupo SEMI) */
    --primary-color: #65B32E;    /* Vert SEMI */
    --secondary-color: #682480;  /* Violet SEMI */
    --bg-main: #F8F9FA;          /* Fond clair */
    --bg-card: #FFFFFF;
    --sidebar-bg: #1A1C1E;       /* Sidebar sombre pour le contraste */
    --sidebar-hover: rgba(101, 179, 46, 0.1);
    --text-main: #212529;
    --text-muted: #6C757D;
    --border-color: #DEE2E6;
    --success: #65B32E;
    --warning: #FFC107;
    --danger: #DC3545;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition-speed: 0.25s;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Raleway', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
}

/* Layout Container */
#app {
    display: grid;
    grid-template-areas: 
        "sidebar header"
        "sidebar main";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    z-index: 100;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding: 0 25px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Bloc Profil en bas */
.sidebar-user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
    margin-top: auto; /* Pousse vers le bas */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 10px rgba(101, 179, 46, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    color: var(--danger);
    transform: translateX(3px);
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    text-decoration: none;
    color: #ADB5BD;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
}

/* Header */
.header {
    grid-area: header;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 90;
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
}

.search-bar {
    background: #F1F3F5;
    border-radius: 20px;
    padding: 8px 18px;
    width: 350px;
    display: flex;
    align-items: center;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-family: inherit;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 30px;
/*    padding-top: calc(var(--header-height) + 30px);
    margin-left: var(--sidebar-width);
*/    overflow-y: auto;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-soft);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Buttons SEMI Style */
.glass-btn {
    border-radius: 25px !important;
    padding: 10px 22px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #559926;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(101, 179, 46, 0.3);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Table Style */
table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

table td {
    padding: 18px 15px !important;
    border-bottom: 1px solid #F1F3F5;
}

/* Form Elements SEMI Style */
select, input[type="text"], input[type="number"], input[type="password"] {
    background: #FFFFFF !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 10px 15px;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

select:focus, input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(101, 179, 46, 0.1);
}

select option {
    background-color: #fff;
    color: var(--text-main);
}

/* Material Card Actions */
.material-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 20px 25px !important;
    border-left: 6px solid var(--primary-color) !important;
    transition: all 0.3s ease;
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.material-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0;
    height: 70px;
    width: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-material-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.material-info {
    flex-grow: 1;
}

.material-info h4 {
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.material-info p {
    margin: 0 0 8px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.material-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.material-card:hover .material-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-btn.edit {
    color: var(--primary-color);
}

.action-btn.delete {
    color: var(--danger-color);
}

.action-btn:hover {
    transform: scale(1.1);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Material Hierarchy Styles */
.material-card.family-card {
    border: 1px solid var(--primary-color) !important;
    position: relative;
    overflow: hidden;
}

.family-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(101, 179, 46, 0.2);
}

.view-details-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-details-hint i {
    transition: transform 0.2s ease;
}

.family-card:hover .view-details-hint i {
    transform: translateX(4px);
}

.material-stock.low-stock .stock-value {
    color: var(--danger-color);
    font-weight: 700;
}

.tracking-indicator {
    position: absolute;
    bottom: 12px;
    right: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: rgba(255, 255, 255, 0.8);
    padding: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tracking-indicator img {
    width: 40px !important;
    height: 40px !important;
}

.material-card:hover .tracking-indicator {
    opacity: 1;
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.project-modal-card {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 950px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: var(--bg-main);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Nouveau Chantier Form Specifics */
.import-mcla-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.btn-mcla {
    background: white !important;
    color: #004F9F !important; /* RTE Blue */
    border: 2px solid #004F9F !important;
    display: flex;
    align-items: center;
    font-weight: 700;
}

.btn-mcla:hover {
    background: rgba(0, 79, 159, 0.05) !important;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(101, 179, 46, 0.1);
    outline: none;
}

.technical-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.tech-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    border-top-width: 8px; /* Accent border on top */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.border-gc { border-top-color: #8CC63F !important; }
.border-asm { border-top-color: #FFF200 !important; }
.border-cons { border-top-color: #ED1C24 !important; }
.border-der { border-top-color: #C1272D !important; }
.border-dep { border-top-color: #93278F !important; }

/* Table de modulation V19 */
.staff-modulation-container {
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.staff-modulation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.staff-modulation-table th {
    background: #f8f9fa;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
}

.staff-modulation-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.staff-modulation-table input {
    width: 70px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.staff-modulation-table input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.tech-card h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.grid-inputs.size-2 {
    grid-template-columns: 1fr 1fr;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.input-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    background: white;
}

.date-input {
    font-size: 0.8rem;
    padding: 6px 8px !important;
}

/* Staff Suggestion Area */
.staff-suggestion-area {
    background: linear-gradient(135deg, var(--bg-main) 0%, #f0f7eb 100%);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 20px;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.badge-auto {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.suggestion-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.staff-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.staff-manual-override {
    width: 120px;
    padding: 10px 15px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    text-align: center;
    background: white;
}

.staff-input-wrapper .unit {
    margin-left: 10px;
    font-weight: 600;
    color: var(--text-main);
}

.staff-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Matériels par phase */
.material-section {
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
    margin-top: 5px;
}

.material-section h5 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.material-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.material-row {
    display: grid;
    grid-template-columns: 1fr 80px 40px;
    gap: 10px;
    align-items: center;
}

.material-row select, .material-row input {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.btn-remove-mat {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
}

.btn-remove-mat:hover {
    transform: scale(1.2);
}

.add-material-btn {
    background: rgba(101, 179, 46, 0.1);
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.add-material-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Planning Hebdomadaire Custom */
/* ... (existing custom planning styles) ... */

/* Matériel Hiérarchique */
.material-row-hierarchical {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 60px 30px;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.material-row-hierarchical select {
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
    width: 100%;
}

.material-row-hierarchical .mat-qty {
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
    width: 60px;
}

/* Tooltip Planning */
.wrms-tooltip {
    position: fixed;
    z-index: 9999;
    background: rgba(30, 31, 34, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: none;
    font-size: 0.85rem;
    max-width: 300px;
    border: 1px solid rgba(255,255,255,0.1);
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.wrms-tooltip h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.wrms-tooltip .tooltip-row {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.wrms-tooltip .tooltip-label {
    color: var(--text-muted);
    font-weight: 500;
}

.wrms-tooltip .mat-list {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dotted rgba(255,255,255,0.2);
}

.wrms-tooltip .mat-item {
    font-size: 0.8rem;
    color: #e0e0e0;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
}
/* Planning Hebdomadaire Custom */
.weekly-timeline-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    padding: 10px;
}

.weekly-grid {
    display: grid;
    grid-template-columns: 200px repeat(52, minmax(30px, 1fr));
    border: 1px solid var(--border-color);
    position: relative;
    background: #fff;
}

.weekly-header-row {
    display: contents;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-muted);
}

.weekly-month-row {
    display: contents;
}

.weekly-month-cell {
    padding: 8px 5px;
    background: #f8faff;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weekly-header-cell {
    padding: 10px 5px;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid #f0f0f0;
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 5;
}

.weekly-header-cell.project-col {
    position: sticky;
    left: 0;
    z-index: 10;
    text-align: left;
    padding-left: 15px;
}

.weekly-project-row {
    display: contents;
}

.weekly-project-name {
    grid-column: 1;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weekly-cells-row {
    grid-column: 2 / span 52;
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    min-height: 50px;
    background: repeating-linear-gradient(
        to right,
        transparent,
        transparent calc(100% / 52 - 1px),
        #f0f0f0 calc(100% / 52 - 1px),
        #f0f0f0 calc(100% / 52)
    );
}

.phase-block {
    position: absolute;
    height: 24px;
    border-radius: 0 !important;
    top: 13px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 8px;
}

.phase-block:hover {
    transform: scaleY(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 3;
}

.phase-block span {
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
/* View Switchers */
.view-switchers {
    display: flex;
    background: rgba(0,0,0,0.05);
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
}

.switch-btn {
    border: none;
    background: none;
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.switch-btn:hover {
    background: rgba(255,255,255,0.5);
    color: var(--primary-color);
}

.switch-btn.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* Material Image Preview Popup */
.material-preview-popup {
    position: fixed;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.material-preview-popup.active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.material-preview-popup img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.material-preview-popup i {
    font-size: 150px;
    color: var(--primary-color);
}

.badge-week {
    background: #eef2ff;
    color: #4338ca;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid #c7d2fe;
}

/* Stats Rows (V17) */
.stats-row {
    border-top: 2px solid var(--border-color);
}
.stats-label {
    background-color: #f8f9fa !important;
    font-size: 0.8rem !important;
    color: #333 !important;
    font-weight: 700 !important;
}
.stats-cells {
    height: 35px !important;
    min-height: 35px !important;
}
.weekly-cell-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border-right: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: default;
}
.weekly-cell-stat[onclick] {
    cursor: pointer;
}
.weekly-cell-stat[onclick]:hover {
    background: rgba(0,0,0,0.05);
}

.row-white .weekly-cell-stat { background: #fff; color: #000; }
.row-blue .weekly-cell-stat { background: #DAEEF3; color: #000; }
.row-yellow .weekly-cell-stat { background: #FFFF99; color: #000; }
.row-cyan .weekly-cell-stat { background: #92CDDC; color: #000; }
.row-orange .weekly-cell-stat { background: #FCD5B4; color: #000; }

/* --- Détection des Conflits (Priority 1) --- */
.event-conflict {
    border: 2px solid #DC3545 !important;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.3) !important;
}

.conflict-badge-ui {
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    text-transform: uppercase;
}

.dashboard-alerts-section {
    margin-bottom: 30px;
}

.alert-card {
    background: #FFF5F5;
    border: 1px solid #FED7D7;
    border-left: 5px solid var(--danger);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    animation: slideInRight 0.3s ease-out;
}

.alert-icon {
    color: var(--danger);
    font-size: 1.2rem;
    margin-top: 2px;
}

.alert-content h4 {
    margin: 0 0 5px 0;
    color: #9B2C2C;
    font-size: 0.95rem;
    font-weight: 700;
}

.alert-content p {
    margin: 0;
    color: #C53030;
    font-size: 0.85rem;
    line-height: 1.4;
}

.alert-actions {
    margin-top: 10px;
}

.btn-alert-fix {
    font-size: 0.75rem !important;
    padding: 5px 12px !important;
    background: white !important;
    border: 1px solid var(--danger) !important;
    color: var(--danger) !important;
}

.btn-alert-fix:hover {
    background: var(--danger) !important;
    color: white !important;
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Animation de clignotement pour les conflits dans le tooltip (Priority 1) */
.mat-conflict-blink {
    background-color: rgba(220, 53, 69, 0.4);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 800;
    color: #DC3545 !important;
    animation: blink-danger 1s infinite;
}

@keyframes blink-danger {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Styles pour le Gantt Interactif */
.gantt .bar-label {
    fill: #fff; /* Texte blanc par défaut comme sur le dashboard */
    font-weight: 600;
    font-size: 11px;
}

.gantt-bar-gc rect.bar { fill: #8CC63F !important; }
.gantt-bar-asm rect.bar { fill: #FFF200 !important; }
.gantt-bar-asm .bar-label { fill: #000 !important; } /* Noir sur jaune pour l'ASM */
.gantt-bar-cons rect.bar { fill: #ED1C24 !important; }
.gantt-bar-der rect.bar { fill: #C1272D !important; }
.gantt-bar-dep rect.bar { fill: #93278F !important; }

.gantt .bar-progress {
    fill: rgba(0, 0, 0, 0.1);
}

.gantt .handle {
    fill: rgba(0, 0, 0, 0.2);
}

/* Import MCLA Overlay (V20) */
.modal-mcla {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* Above project-modal */
    animation: fadeIn 0.3s ease;
}

.import-step {
    padding: 10px 0;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(101, 179, 46, 0.05);
}

.mcla-date {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.upload-area.drag-active {
    border-color: var(--primary-color);
    background: rgba(101, 179, 46, 0.1);
    transform: scale(1.01);
}

/* KPI Thermometer */
.thermometer-container {
    width: 100%;
    height: 14px;
    background: #e5e7eb;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.thermometer-bar {
    height: 100%;
    transition: width 0.5s ease-out, background-color 0.3s;
    border-radius: 7px;
}

.load-low { background-color: #10b981; }      /* Vert < 80% */
.load-medium { background-color: #f59e0b; }   /* Orange 80-100% */
.load-high { background-color: #ef4444; }     /* Rouge > 100% */

.surcharge-blink {
    animation: pulse-danger 1.5s infinite;
}

@keyframes pulse-danger {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.weekly-cell-stat:hover .thermometer-container {
    transform: scaleY(1.2);
    cursor: help;
}


/* Badges d'état pour les tooltips */
.badge-status-commande {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status-consultation {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status-attente {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tooltip-client, .tooltip-status {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.tooltip-client b {
    color: var(--white);
}
