:root {
    --bleu: #0B6BA7;
    /*#c62828 */
    --noir: #111;
    --gris: #f4f5f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #fff;
    color: var(--noir);
}

header {
    padding: 18px 22px;
    border-bottom: 3px solid var(--bleu);
    display: flex;
    align-items: center;
    gap: 12px;
}

header img {
    width: auto;
    height: 65px;
}

header h1 {
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

header .badge {
    background: var(--bleu);
    color: #fff;
    padding: 20px 10px;
    border-radius: 999px;
    font-size: 12px;
}

main {
    padding: 22px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(12, 1fr);
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
    padding: 16px;
}

.card header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card header h2 {
    font-size: 16px;
    margin: 0;
}

label {
    font-size: 12px;
    color: #555;
    display: block;
    margin-bottom: 6px;
}

select,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
}

.btn {
    background: var(--bleu);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn:hover {
    background: #0066A5;
    transform: scale(1.1);
}

.btn.secondary {
    background: #222;
}

.muted {
    color: #6b7280;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 10px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-bottom: 2px solid var(#0B6BA7);
}

.pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fafafa;
    font-size: 12px;
}

.hint {
    font-size: 12px;
    color: #666;
}

.kpi {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.kpi .pill {
    background: #fff1f1;
    border-color: #ffcaca;
}

footer {
    padding: 18px 22px;
    color: #666;
    font-size: 12px;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tooltip */
.box[title] {
    position: relative;
    cursor: help;
}

.box[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 110%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: pre-line;
    z-index: 10;
    width: max-content;
    max-width: 280px;
    text-align: left;
    font-size: 0.9em;
}

.box[title]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.8) transparent;
    z-index: 10;
}

/* Two columns layout */
.two-columns {
    display: flex;
    gap: 30px;
    flex-wrap: nowrap;
    /* empêcher le wrapping */
    align-items: flex-start;
}

.form-column {
    flex: 1 1 400px;
}

.synoptique-column {
    flex: 1 1 350px;
}

/* =========================
   Synoptique – Flowchart
   ========================= */
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    position: relative;
}

.flowchart .box {
    /*padding: 12px 20px;*/
    padding: 3% 0;
    border-radius: 12px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    width: 320px;
    height: 60px;
    vertical-align: middle;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* État actif */
.flowchart .box.active {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* Couleurs par type */
.flowchart .gc {
    background: #1E90FF;
}

/* Bleu GC */
.flowchart .pr {
    background: #28A745;
}

/* Vert PR-AR */
.flowchart .manchon {
    background: #FFC107;
}

/* Jaune Manchon */
.flowchart .bretelle {
    background: #9C27B0;
}

/* Violet Bretelle */
.flowchart .baguette {
    background: #FF5722;
}

/* Orange Baguette */

/* Flèches entre cases */
.flowchart .box::after {
    /*content: "↓";*/
    display: block;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: #666;
}

.flowchart .box:last-child::after {
    content: "";
}


/* Responsive tweaks */
@media (max-width: 800px) {

    .form-column,
    .synoptique-column {
        flex: 1 1 100%;
    }
}

.form-columns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-columns .column {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-columns button {
    max-width: 300px;
    margin: 0 auto;
}