/* --- STYLE iOS DARK DÉFINITIF --- */
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: #000000; 
    color: #ffffff; 
    margin: 0; 
    padding: 15px; 
}

.container { 
    max-width: 500px; 
    margin: 0 auto; 
    position: relative; /* FIX : Indispensable pour le bouton HUB */
    padding-top: 60px;  /* FIX : Espace pour le bouton HUB */
}

.main-card {
    background: #1c1c1e; 
    border-radius: 25px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.header-section {
    font-size: 14px; 
    font-weight: 700;
    color: #0a84ff; 
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

label { 
    display: block; 
    font-size: 13px; 
    color: #0a84ff;
    margin: 15px 0 6px 5px; 
    font-weight: 600;
}

input, select {
    width: 100%;
    background: #000000; 
    color: white; 
    border: 1px solid #3a3a3c;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    box-sizing: border-box;
    outline: none;
    transition: 0.3s;
}

input:focus { border-color: #0a84ff; }

/* --- FIX INTERVENANTS (Alignement horizontal) --- */
.tech-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 15px !important;
    background: #000000;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #3a3a3c;
    margin-bottom: 8px;
}

.tech-row input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    flex-shrink: 0;
}

.tech-row label {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

/* --- FIX BOUTON RETOUR HUB --- */
.btn-back-hub {
    position: absolute !important;
    top: 0px;
    left: 0px;
    background: #2c2c2e;
    color: #0a84ff;
    padding: 8px 15px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    border: 1px solid #3a3a3c;
    z-index: 100;
}

.btn-back-hub:active {
    transform: scale(0.95);
    background: #3a3a3c;
}

/* --- LE RESTE DE TON CODE (INCHANGÉ) --- */

.op-orange { background: #4d2d1b !important; color: #ffb347 !important; border-color: #ffb347; }
.op-bouygues { background: #1a2a3a !important; color: #90caf9 !important; border-color: #90caf9; }
.op-sfr { background: #3a1a1a !important; color: #ef9a9a !important; border-color: #ef9a9a; }
.op-mtm-orange { background: #3e2718 !important; color: #ffb347 !important; border-style: dashed; }
.op-mtm-bouygues { background: #231a35 !important; color: #b3b3e6 !important; border-style: dashed; }
.op-mtm-sfr { background: #3a1a1a !important; color: #ef9a9a !important; border-style: dashed; }

.st-ok { background: #1b3d29 !important; color: #a5d6a7 !important; border-color: #30d158; }
.st-ko { background: #421c1c !important; color: #ef9a9a !important; border-color: #ff453a; }
.st-attente { background: #1c1c1e !important; color: #8e8e93 !important; border-color: #3a3a3c; }

.sim-row { display: flex; gap: 10px; align-items: center; }
.sim-row select { flex: 1.2; min-width: 120px; }
.sim-row input { flex: 2; }

.button-group { display: flex; gap: 12px; margin-top: 10px; }

.btn-prev {
    flex: 1; background: #3a3a3c; color: white; border: none; padding: 18px;
    border-radius: 50px; font-weight: 700; font-size: 14px; text-align: center;
    text-decoration: none; display: flex; align-items: center; justify-content: center;
}

.btn-next {
    flex: 3; background: #007aff; color: white; border: none; padding: 18px;
    border-radius: 50px; font-weight: 700; font-size: 16px; cursor: pointer;
}

.icon-flip { display: inline-block; transform: rotate(180deg); }

/* PAGES LOGIN / ACCUEIL / PIECES (TES CODES EXACTS) */
/* ============================================================
   SECTION LOGIN (VERSION COMPACTE)
   ============================================================ */

   .page-login { 
    background-color: #000000 !important; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    margin: 0; 
}

/* On réduit la largeur de la carte */
.page-login .login-card {
    width: 100%;
    max-width: 300px; /* Plus serré */
    text-align: center;
}

/* Réduction de la capsule logo */
.page-login .logo-container { 
    background: #ffffff !important; 
    padding: 10px 15px; /* Moins de hauteur */
    border-radius: 15px; 
    margin-bottom: 20px; 
    display: inline-block; 
}

.page-login .logo-container img {
    max-width: 130px; /* Logo plus petit */
    height: auto;
}

/* Réduction des boutons de sélection */
.page-login .btn-new { 
    display: flex !important; 
    align-items: center; 
    justify-content: center; 
    width: 100%; 
    padding: 12px; /* Passage de 18px à 12px (beaucoup plus fin) */
    margin-bottom: 12px; 
    border-radius: 12px; /* Moins "ballon", plus carré arrondi */
    font-weight: 700; 
    font-size: 14px; /* Texte plus discret */
    text-decoration: none !important; 
    color: #ffffff !important; 
    background-color: #007aff; 
    border: none; 
    box-sizing: border-box; 
    transition: transform 0.2s; 
}

/* Réduction des inputs de la page login */
.page-login input {
    padding: 10px !important; 
    font-size: 14px !important;
    margin-bottom: 10px;
    border-radius: 10px !important;
}

.page-login label {
    font-size: 11px !important;
    margin: 10px 0 4px 5px !important;
    text-align: left;
}

.page-accueil .logo-header { color: #0a84ff; font-weight: 800; font-size: 24px; margin-bottom: 25px; letter-spacing: 1px; text-align: center; width: 100%; }
.page-accueil .grid-constructeurs { display: grid; grid-template-columns: 1fr; gap: 15px; max-width: 450px; margin: 20px auto; }
.page-accueil .card-img { background: #1c1c1e; border-radius: 20px; padding: 15px; border: 1px solid #3a3a3c; transition: transform 0.2s; text-decoration: none; display: block; }
.page-accueil .card-img img { width: 100%; height: 100px; object-fit: contain; background: #ffffff; border-radius: 12px; padding: 5px; }
.page-accueil .btn-new { display: flex !important; align-items: center; justify-content: center; gap: 10px; background-color: #007aff !important; color: #ffffff !important; padding: 18px; border-radius: 50px; font-weight: 700; font-size: 16px; text-decoration: none; margin: 30px auto 0 auto; width: 100%; max-width: 450px; box-sizing: border-box; border: none; }
.page-pieces table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: 10px; }
.page-pieces td { background: #1c1c1e; padding: 10px; color: white; }
.st-rouge { background-color: #ff3b30 !important; color: #ffffff !important; border: none; }
.st-vert { background-color: #34c759 !important; color: #ffffff !important; border: none; }

/* --- FIX ACCÈS PANEL (UNIQUEMENT) --- */
.btn-admin {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1c1c1e !important;
    color: #0a84ff !important; /* Bleu iOS */
    padding: 12px;
    border-radius: 15px;
    border: 1px solid #0a84ff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 30px;
}

.btn-admin:active {
    background: #0a84ff !important;
    color: #ffffff !important;
}

/* Bouton Déconnexion */
.btn-logout {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    margin: 40px auto 20px auto; /* Centré en bas */
    padding: 12px;
    background: #1c1c1e !important;
    color: #ff453a !important; /* Rouge iOS */
    border: 1px solid #3a3a3c !important;
    border-radius: 15px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none !important;
    transition: 0.2s;
}

.btn-logout:active {
    background: #ff453a !important;
    color: #ffffff !important;
}

/* ============================================================
   STYLE CIBLÉ : ÉTAPE CONTRÔLES (Tableau Dark iOS)
   ============================================================ */
/* --- LE STYLE EXACT IMAGE 996A7D (Labels bleus + Box noires empilées) --- */

.page-check { background-color: #000000 !important; }

.page-check .main-card {
    background: #1c1c1e !important;
    border-radius: 25px !important;
    padding: 20px !important;
    border: none !important;
}

/* On casse le tableau pour que tout s'empile verticalement */
.page-check table, .page-check tbody, .page-check tr {
    display: block !important;
    width: 100% !important;
}

/* Chaque cellule devient un bloc */
.page-check td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Le texte (Sticker, Nettoyage...) devient le label bleu au-dessus */
.page-check td:first-child {
    color: #0a84ff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-top: 20px !important; /* Espace entre les groupes */
    margin-bottom: 8px !important;
    padding-left: 5px !important;
    text-align: left !important;
}

/* La boîte noire du Select */
.page-check td:last-child {
    background: #000000 !important;
    border-radius: 15px !important;
    padding: 18px 15px !important;
    border: 1px solid #3a3a3c !important;
}

/* Le texte "En attente" à l'intérieur */
.page-check .status-select {
    width: 100% !important;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    appearance: none;
    -webkit-appearance: none;
}

/* On vire les couleurs bg-sticker, etc. */
.bg-sticker, .bg-nettoyage, .bg-test { background: transparent !important; }

textarea.textarea-ios {

    width: 100%;
    height: 250px;
    
    background: #000000;
    color: white;
    
    border: 1px solid #3a3a3c;
    border-radius: 12px;
    
    padding: 15px;
    
    font-size: 15px;
    font-family: inherit;
    
    resize: none;
    outline: none;
    
    box-sizing: border-box;
    
    transition: 0.3s;
    
    }
    
    textarea.textarea-ios:focus {
    
    border-color: #0a84ff;
    
    }

    /* bouton ajout photo */

    .btn-photo {
        display: block;
        width: 100%;
        box-sizing: border-box;
    
        text-align: center;
        background: #000000;
        color: #30d158;
        border: 2px solid #30d158;
        border-radius: 14px;
        padding: 16px 18px;
    
        font-weight: 700;
        font-size: 15px;
        cursor: pointer;
        transition: 0.2s;
    }
    
    .btn-photo:active {
        transform: scale(0.98);
    }
    
    
    /* grille photos */
    
    #preview-container{
    
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    
    margin-top:20px;
    
    }
    
    
    /* miniature */
    
    .thumb-wrapper{
    
    position:relative;
    
    border-radius:12px;
    overflow:hidden;
    
    height:120px;
    
    border:1px solid #3a3a3c;
    
    }
    
    .thumb-wrapper img{
    
    width:100%;
    height:100%;
    
    object-fit:cover;
    
    }
    
    
    /* bouton supprimer */
    
    .remove-btn{
    
    position:absolute;
    top:6px;
    right:6px;
    
    background:#ff453a;
    
    border:none;
    
    color:white;
    
    width:24px;
    height:24px;
    
    border-radius:50%;
    
    font-weight:bold;
    
    cursor:pointer;
    
    }

    .input-readonly {
        background: #2c2c2e !important;
        color: #8e8e93 !important;
        border: 1px solid #3a3a3c !important;
        font-weight: 600;
    }
    
    .titre-final-box {
        width: 100%;
        box-sizing: border-box;
        background: #000000;
        color: #30d158;
        border: 1px solid #30d158;
        border-radius: 12px;
        padding: 16px;
        font-size: 18px;
        font-weight: 700;
        text-align: center;
        margin-top: 6px;
        word-break: break-word;
    }
    
    .btn-save-ios {
        background: #30d158 !important;
        color: #000000 !important;
    }

    .page-pieces table{
        width:100%;
        border-collapse:separate;
        border-spacing:0 14px; /* espace entre les cartes */
    }
    
    .page-pieces thead th{
        font-size:12px;
        font-weight:700;
        color:#8e8e93;
        padding:6px 8px;
    }
    
    /* CARTE */
    
    .page-pieces tbody tr{
        background:#1c1c1e;
        border:1px solid #3a3a3c; /* contour gris */
        border-radius:18px;
        box-shadow:0 8px 25px rgba(0,0,0,0.45);
    }
    
    .page-pieces td{
        padding:14px 12px;
    }
    
    /* texte pièce */
    
    .label-piece{
        font-size:13px;
        color:#ffffff;
        font-weight:600;
    }
    
    /* reconditionné */
    
    .reconditionne{
        color:#8e8e93;
        font-size:11px;
    }
    
    /* selects */
    
    .page-pieces select{
        width:100%;
        max-width:110px;
    }
    
    /* petit effet tactile */
    
    .page-pieces tbody tr:active{
        transform:scale(0.98);
    }

    .rapport-list {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-top: 10px;
    }
    
    .rapport-card-ios {
        background: #2c2c2e;
        border: 1px solid #3a3a3c;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }
    
    .rapport-link-ios {
        display: block;
        text-decoration: none;
        color: inherit;
    }
    
    .rapport-main {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: #1c1c1e;
    }
    
    .rapport-icon {
        font-size: 20px;
        flex-shrink: 0;
    }
    
    .rapport-infos {
        flex: 1;
        min-width: 0;
    }
    
    .rapport-nom {
        color: #ffffff;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
        word-break: break-word;
        margin-bottom: 8px;
    }
    
    .rapport-badge {
        display: inline-block;
        background: #007aff;
        color: #ffffff;
        font-size: 11px;
        font-weight: 700;
        padding: 5px 10px;
        border-radius: 999px;
    }
    
    .rapport-actions {
        padding: 12px 16px 16px 16px;
        background: #2c2c2e;
    }
    
    .btn-delete-ios {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    
        background: #421c1c;
        color: #ff453a;
        border: 1px solid #ff453a;
        border-radius: 12px;
        padding: 12px;
    
        text-decoration: none;
        font-size: 13px;
        font-weight: 700;
        box-sizing: border-box;
        transition: 0.2s;
    }
    
    .btn-delete-ios:active {
        transform: scale(0.98);
    }
    
    .empty-state-ios {
        background: #000000;
        border: 1px solid #3a3a3c;
        color: #8e8e93;
        border-radius: 14px;
        padding: 16px;
        text-align: center;
        font-size: 14px;
    }
    
    .btn-back-text {
        flex: 1 !important;
        text-decoration: none;
        font-size: 14px;
    }

    .label-piece{
        font-size:10px;
        color:#0a84ff;
        font-weight:600;
    
        max-width:100px;      /* limite largeur */
        line-height:1.2;      /* texte plus compact */
    }

    .page-pieces td:first-child{
        width:30%;
    }

    .page-pieces td:nth-child(2),
.page-pieces td:nth-child(3){
    width:32%;
}