:root {
    --form-header-bg: #00a6c7;
}

/* Hauteur globale */
html, body {
    height: 100%;
}

body {
    font-size: 14px;
}

/* Zone principale */
.main-row {
    min-height: calc(100vh - 90px);
}

/* Colonne opérateur du planning */
.operator-col {
    width: 130px;
}

/* -----------------------------------------
   LISTE DES MISSIONS
   ----------------------------------------- */

.mission-table {
    font-size: 13px;
    border-collapse: collapse;
    margin-left: 0;
}

.mission-table th,
.mission-table td {
    padding: 0.45rem 0.55rem;
}

/* ligne mission */
.mission-row {
    cursor: pointer;
    transition: background 0.15s;
}

.mission-row:hover {
    background: #f9fafb;
}

/* colonne couleur (bandeau état) */
.mission-color-header {
    width: 8px !important;
    padding: 0 !important;
}

.mission-color-cell {
    width: 8px !important;
    padding: 0 !important;
    border-right: none !important;
    position: relative;      /* pour la barre en position absolue */
}

.mission-color-bar {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    border-radius: 3px;
    background: #e5e7eb; /* défaut */
}

/* couleurs bandeau selon état */
.mission-color-a_commander { background: #ef4444; }       /* rouge */
.mission-color-en_cours { background: #8b5cf6; }          /* violet */
.mission-color-receptionnee { background: #22c55e; }      /* vert */
.mission-color-non_receptionnee { background: #111827; }  /* noir */

/* ligne d'en-tête de groupe (type de chantier) */
.mission-group-row {
    background: #f3f4f6;
    font-weight: 600;
    font-size: 12px;
}

.mission-group-row td {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    border-top: 1px solid #e5e7eb;
}

/* on enlève la bordure droite inutile sur la col. couleur */
.mission-group-row .mission-color-cell {
    border-right: none !important;
}

/* Camembert */
.mission-chart-block {
    padding: 0.5rem 0.4rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

#missionChart {
    width: 100%;
    max-height: 180px;
}


/* -----------------------------------------
   PLANNING
   ----------------------------------------- */

#planningTable {
    table-layout: fixed;
    font-size: 13px;
}

#planningTable th,
#planningTable td {
    border-color: #e5e7eb;
    padding: 4px 5px;
}

/* en-têtes jours */
.day-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.day-name {
    font-size: 11px;
    text-transform: capitalize;
    color: #6b7280;
}

.day-date {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

/* jour courant */
th.is-today {
    background-color: #e0f2fe !important;
    border-bottom: 2px solid #2563eb !important;
}

td.is-today {
    background-color: #f9fafb;
}

/* cellules planning */
.planning-cell {
    position: relative;
    height: 72px;
    cursor: pointer;
    background: #ffffff;
    transition: background-color 0.12s ease-out, box-shadow 0.12s ease-out;
    vertical-align: top;
}

.planning-cell:hover {
    background-color: #f3f4ff;
    box-shadow: inset 0 0 0 1px #c7d2fe;
}

.planning-cell-empty {
    font-size: 10px;
    color: #9ca3af;
}

/* légende ronds */
.legend-dot-empty,
.legend-dot-filled {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.legend-dot-empty {
    border: 1px dashed #d1d5db;
}

.legend-dot-filled {
    background: #2563eb;
}

/* mission dans le planning */
.assignment-chip {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    border-radius: 6px;
    padding: 4px 6px;
    margin-bottom: 4px;
    border: 1px solid #bae6fd;
    font-size: 11px;
}

/* bandeau couleur dans le planning (repose sur les classes mission-color-*) */
.assignment-color-bar {
    width: 4px;
    border-radius: 3px;
    background: #e5e7eb;
    align-self: stretch;
}

/* Couleurs de la barre dans le planning (assignment) */
.assignment-color-bar.mission-color-a_commander {
    background: #ef4444;
}

.assignment-color-bar.mission-color-en_cours {
    background: #8b5cf6;
}

.assignment-color-bar.mission-color-receptionnee {
    background: #22c55e;
}

.assignment-color-bar.mission-color-non_receptionnee {
    background: #111827;
}


/* contenu texte du chip */
.assignment-content {
    flex: 1;
    min-width: 0;
}

.assignment-title {
    font-weight: 600;
    color: #111827;
}

.assignment-time {
    font-size: 10px;
    color: #6b7280;
}


/* -----------------------------------------
   DRAG & DROP — Overlay déplacer/copier
   ----------------------------------------- */

.cell-drop-actions {
    position: absolute;
    inset: 3px;
    display: none;
    z-index: 5;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.6);
    background: rgba(255, 255, 255, 0.9);
}

.cell-drop-actions.visible {
    display: flex;
}

.cell-drop-actions .drop-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    user-select: none;
    padding: 2px;
    text-align: center;
}

.drop-zone-move {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    border-right: 1px solid rgba(148, 163, 184, 0.6);
}

.drop-zone-copy {
    background: rgba(34, 197, 94, 0.08);
    color: #15803d;
}

.drop-zone.drag-target {
    background: rgba(30, 64, 175, 0.15);
}

/* état visuel quand drag au-dessus */
.planning-cell.drag-over {
    background: #e0f2fe;
    box-shadow: inset 0 0 0 1px #60a5fa;
}


/* -----------------------------------------
   MODALES
   ----------------------------------------- */

.modal-header-custom {
    background: var(--form-header-bg);
    color: #ffffff;
}

.modal-header-custom .modal-title {
    font-size: 16px;
}

.modal-header-custom .small {
    font-size: 11px;
}

/* Contexte affectation */
#assignmentContext {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px 10px;
}

/* Bloc progression mission */
.mission-progress-block {
    padding: 0.75rem 0.5rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-top: 1rem;
}


/* -----------------------------------------
   RESPONSIVE
   ----------------------------------------- */

@media (max-width: 768px) {
    .operator-col {
        width: 100px;
    }
}
