/* =========================================================
   RESET
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    height: 100%;
}

/* =========================================================
   FOND & TYPO
   ========================================================= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #e8f0ff, #f6f9ff);
    color: #1b2559;
}

/* =========================================================
   LAYOUT (MOBILE FIRST)
   ========================================================= */
.container,
.page {
    max-width: 420px;
    width: 100%;
    margin: 32px auto 40px;
    padding: 24px 20px;
    background: rgba(255,255,255,0.94);
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
    backdrop-filter: blur(8px);
}

/* =========================================================
   TITRES
   ========================================================= */
h1, h2, h3 {
    color: #3A66E8;
    font-weight: 700;
    margin-bottom: 12px;
}
h1 { font-size: 26px; text-align:center; }
h2 { font-size: 22px; text-align:center; }
h3 { font-size: 18px; }

/* Titre commande */
.page-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #3A66E8;
    margin-bottom: 20px;
}

/* =========================================================
   FORMULAIRES (inputs, selects...)
   ========================================================= */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0 12px;
    border-radius: 14px;
    border: 1px solid #d0d7e2;
    background: #f5f8ff;
    font-size: 15px;
    transition: all 0.25s ease;
}
textarea {
    min-height: 80px;
    resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
    border-color: #3A66E8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(58,102,232,0.15);
    outline: none;
}

label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1b2559;
    display: block;
}

/* =========================================================
   BOUTONS
   ========================================================= */
button,
.btn,
.btn-main {
    display: inline-block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    background: #6F8BFA;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
    margin-top: 10px;
}
button:hover,
.btn:hover,
.btn-main:hover {
    background: #5878e0;
}
button:active,
.btn:active,
.btn-main:active {
    transform: scale(0.98);
}

/* Variation verte */
.btn-secondary {
    background: #4CAF7A;
}
.btn-secondary:hover {
    background: #3c9b68;
}

/* Deux boutons côte à côte */
.btn-row {
    display: flex;
    gap: 10px;
}
.btn-row .btn {
    width: 50%;
}

/* =========================================================
   BADGES / STATUTS (pastel)
   ========================================================= */
.badge {
    padding: 7px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display:inline-block;
    margin-top: 10px;
    color: white;
}


/* =========================================================
   CARD – STYLE MODERNE PASTEL (COMMANDE.PHP)
   ========================================================= */
.card {
    background: #ffffff;
    border-radius: 22px;
    padding: 24px 22px;
    margin: 18px 0;
    border: 1px solid rgba(200, 210, 255, 0.45);
    box-shadow: 
        0 6px 14px rgba(0, 0, 0, 0.04),
        0 12px 28px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #2A3D66;
    margin-bottom: 10px;
}
.card p {
    font-size: 14px;
    color: #3d4f77;
    margin-bottom: 6px;
    line-height: 1.35;
}

/* Bouton dans card */
.card .btn {
    border-radius: 16px;
    background: #6F8BFA;
    margin-top: 16px;
    font-size: 15px;
}
.card .btn:hover {
    background: #5878e0;
}

/* =========================================================
   LISTES / TABLES LÉGÈRES
   ========================================================= */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}
th {
    color:#3A66E8;
    font-weight:600;
    padding: 8px;
}
td {
    padding: 8px;
}
tr:nth-child(even) {
    background:#f7f9ff;
}

/* =========================================================
   PETITS TEXTES
   ========================================================= */
.small-text {
    font-size: 13px;
    color:#66739a;
}

/* Pied de page */
footer {
    text-align:center;
    margin: 20px 0;
    color:#999;
    font-size:13px;
}
/* =========================================================
   🎨 CARDS COMMANDE — STYLE PASTEL PREMIUM
   ========================================================= */

.command-card {
    width: 100%;
    border-radius: 26px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    margin: 20px auto;
    border: 1px solid rgba(220,230,255,0.55);
}

/* Bandeau bleu pastel */
.command-card-header {
    background: #dce9ff;
    padding: 22px 18px;
    text-align: center;
}

.command-card-header .ref {
    background: #ffffff;
    padding: 8px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #2a3d66;
    display: inline-block;
    margin-bottom: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.command-card-header .client {
    font-size: 20px;
    font-weight: 700;
    color: #1e2f50;
}

.command-card-header .project {
    font-size: 14px;
    margin-top: 4px;
    color: #3f4d6d;
}

/* Zone blanche */
.command-card-body {
    background: #ffffff;
    padding: 18px 20px;
    font-size: 15px;
    color: #2a3149;
    text-align: center;
}

.command-card-body p {
    margin: 6px 0;
    line-height: 1.35;
}

/* Séparateur fin pastel */
.command-separator {
    width: 70%;
    height: 1px;
    background: #e2e6f5;
    margin: 10px auto 14px;
}

/* Statut sous forme de • texte */
.command-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    color: #3f4d6d;
    font-weight: 600;
}

.command-status .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

/* Couleurs statuts */
.st-realise .dot { background:#7ac987; }
.st-termine .dot { background:#4a9b68; }
.st-partielle .dot { background:#7aa7e9; }
.st-nonfacture .dot { background:#e98a8a; }
.st-facture .dot { background:#c68cd6; }
.st-manquetarifs .dot { background:#d67171; }

/* Bouton */
.command-card-footer {
    padding: 18px;
    text-align: center;
}

.command-card-footer a {
    display: block;
    background: #6d8cf7;
    color: white;
    padding: 14px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
}

.command-card-footer a:hover {
    background: #5876d6;
}


/* =========================================================
   🎨 BULLES TYPES DE PRÉLÈVEMENT (ex: 3Y, 2M, 5X)
   ========================================================= */

.prelv-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 4px;
    flex-wrap: wrap;
}

.prelv-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    background: #e0e7ff;
    color: #1b2559;
    white-space: nowrap;   /* Empêche le retour à la ligne */
    min-width: 48px;       /* Assure une bulle minimum */
}

.ech-line {

    display: flex;
    align-items: center;
    gap: 0px;
    margin-bottom: 14px;
}

.prelv-bubble {
    min-width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    color: #1b2559;
}

.ech-details {
    flex: 1;
    line-height: 1.30;
    font-size: 15px;
}
.ech-line-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 16px;
    text-decoration: none;
    color: #1b2559;
    margin-bottom: 14px;

    border: 1px solid rgba(210,220,255,0.6);
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
width:100%;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.prelv-bubble {
    min-width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    color: #1b2559;
}

.ech-details {
    flex: 1;
    line-height: 1.35;
    font-size: 15px;
}
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
.grid-box {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}
.grid-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
}
.grid-field {
    margin-bottom: 10px;
}
.grid-field .label-small {
    margin-bottom: 4px;
}

.variation-bubble {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    
    background: #e9eef6;
    color: #333;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 10;
    pointer-events: none;
}
.grid-field {
    position: relative; /* obligatoire pour positionner la bulle */
}

.grid-field {
    position: relative;
}

.variation-bubble {
    position: absolute;
    top: 50%;
    left: 100%;               /* positionne à droite de la case POSE */
    transform: translate(-50%, -50%);
    background: #e9eef6;
    color: #333;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    z-index: 20;
    pointer-events: none;
}

.diff-line {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* input – bulle – input */
    align-items: center;
    position: relative;
    margin-bottom: 18px;
}

.diff-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.variation-bubble {
    background: #eef1f7;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 10px;
    color: #333;
    box-shadow: 0px 2px 4px rgba(0,0,0,0.25);
    white-space: nowrap;
    text-align: center;
}

.compare-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: relative;
    margin: 12px 0;
    gap: 10px;
}

.compare-left,
.compare-right {
    width: 100%;
}

.compare-row input,
.compare-row select {
    width: 100%;
}

/* bulle parfaitement centrée */
.variation-bubble {
    background: #e9eef6;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    text-align: center;
    white-space: nowrap;
}

.bubble-placeholder {
    width: 1px; /* occupe la colonne centrale si pas de bulle */
}
/* Chaque ligne de données POSE/DÉPOSE */
.grid-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr; /* gauche | droite */
    gap: 20px;
    margin-bottom: 25px;
}

/* Parent pour centrer les inputs correctement */
.grid-row .cell {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* La bulle de variation centrée entre les cases */
.variation-bubble {
    position: absolute;
    top: 50%;                       /* milieu vertical */
    left: 50%;                      /* milieu horizontal */
    transform: translate(-50%, -50%);
    background: #e9eef6;
    color: #333;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    z-index: 50;
    pointer-events: none;
}

/* TABLEAU POSE / DÉPOSE — OCCUPE 100% */
.grid-wrapper {
    width: 100%;
    margin-top: 25px;
}

/* Range une ligne POSE/DÉPOSE */
.grid-row {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;  /* POSE | DÉPOSE */
    gap: 20px;
    margin-bottom: 10px;
}

/* Cellule */
.grid-cell {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Variation centrée parfaitement */
.variation-bubble {
    position: absolute;
    top: 56%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #e9eef6;
    color: #333;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    pointer-events: none;
    z-index: 100;
}

input[type="datetime-local"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #d0d7e2;
    background: #f5f8ff;
    font-size: 15px;
    color: #1b2559;
    transition: all 0.25s ease;
}

input[type="datetime-local"]:focus {
    border-color: #3A66E8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(58,102,232,0.15);
    outline: none;
}
.periode-container {
    border: 1px solid rgba(220,230,255,0.6);
    padding: 14px 10px;
    margin-bottom: 15px;
    border-radius: 16px;
    background: #f5f8ff;
}

.periode-fields {
    margin-top: 12px;
}
.periode-block {
    background: #ffffff;
    border: 1px solid #e4e8f7;
    border-radius: 16px;
    padding: 18px 16px 2px 16px;
    margin-bottom: 25px;
}

.periode-check {
    font-weight: 600;
    font-size: 16px;
    color: #1b2559;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.periode-fields.hidden {
    display: none;
}

.periode-label {
    font-size: 14px;
    font-weight: 600;
    color: #1b2559;
    margin-top: 4px;
    margin-bottom: 6px;
}

.periode-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #d0d7e2;
    background: #ffffff;
    margin-bottom: 14px;
    font-size: 15px;
}
.periode-input:focus {
    border-color: #3A66E8;
    box-shadow: 0 0 0 3px rgba(58,102,232,0.15);
    outline: none;
}
.alert-success-box {
    background: #dff7df;       /* Vert très pâle */
    border-left: 6px solid #dff7df; /* Liseré vert vif */
    padding: 12px 18px;
    margin: 15px 0 20px 0;
    border-radius: 6px;
    font-size: 16px;
    color: #2b6a2b;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.status-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    pointer-events: none;
}

.status-corner span {
    position: absolute;
    top: 20px;
    right: -40px;
    transform: rotate(45deg);
    width: 180px;
    text-align: center;
    padding: 5px 0 5px 22px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    letter-spacing: 1px;
}

#ok_icon {
    display: none;
}

#ko_icon {
    display: none;
}

#ok_icon span {
    background: green; /* vert conforme */
}

#ko_icon span {
    background: #C40000; /* rouge non conforme */
}

.cause-box {
    margin-top: 10px;
    background: #ffefef;
    border-left: 4px solid #cc0000;
    padding: 10px;
    color: #a00000;
    font-size: 14px;
    border-radius: 6px;
}
.global-wrapper {
    position: relative;
}

.sticky-header {
    position: sticky;
    top: 0px;
    z-index: 2000;
    background: white;
}

.content {
    margin-top: 20px; /* Ajustable si besoin */
}