/* THOR Immo — charte THOR : bleu #0B3D91, ambre #F0A808 */
:root {
  --bleu: #0B3D91; --bleu-f: #082c6b; --ambre: #F0A808; --encre: #0f172a; --gris: #475569;
  --trait: #e2e8f0; --fond: #f4f6fb; --carte: #fff; --vert: #15803d; --rouge: #b91c1c;
  --rayon: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--encre); background: var(--fond); }
a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; color: var(--bleu); }
h1 small { color: var(--gris); font-weight: 500; font-size: .95rem; margin-left: .4rem; }
h2 { font-size: 1.05rem; margin: 0 0 .7rem; color: var(--bleu); display: flex; justify-content: space-between; align-items: baseline; }
h3 { font-size: .95rem; color: var(--bleu); margin: 1.2rem 0 .4rem; }

.entete { background: var(--bleu); border-bottom: 4px solid var(--ambre); color: #fff; }
.barre { max-width: 1280px; margin: auto; padding: .55rem 16px; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.logo { font-size: 1.25rem; letter-spacing: .5px; color: #fff; }
.logo b { font-weight: 900; } .logo span { color: var(--ambre); font-weight: 700; margin-left: .25rem; }
.logo.grand { font-size: 2rem; color: var(--bleu); text-align: center; } .logo.grand b { color: var(--bleu); }
.nav { display: flex; flex-wrap: wrap; gap: .15rem; flex: 1; }
.nav a { color: #dbe4ff; padding: .35rem .6rem; border-radius: 6px; font-size: .9rem; }
.nav a:hover { background: var(--bleu-f); text-decoration: none; }
.nav a.actif { background: var(--ambre); color: var(--encre); font-weight: 700; }
.moi { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.moi a { color: #fff; font-weight: 700; } .moi small { color: var(--ambre); }
.moi form { margin: 0; } .moi .lien { color: #dbe4ff; }

.page { max-width: 1280px; margin: 0 auto; padding: 1.2rem 16px 2rem; }
.pied { text-align: center; color: var(--gris); font-size: .75rem; padding: 1rem 16px 2rem; }
.titre-page { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem 1.1rem; margin-bottom: 1rem; }
table.carte { padding: 0; display: table; width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.carte.etroite { max-width: 400px; margin: 8vh auto; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.deux > .carte { margin-bottom: 0; } .deux { margin-bottom: 1rem; }
@media (max-width: 860px) { .deux { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--gris); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; padding: .5rem .6rem; border-bottom: 2px solid var(--trait); background: #fafbfe; }
td { padding: .5rem .6rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.neg { color: var(--rouge); }
tr.rouge td { background: #fef2f2; } tr.ambre td { background: #fffbeb; }
.nowrap { white-space: nowrap; }
@media (max-width: 700px) { table.carte, .carte table { display: block; overflow-x: auto; } }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 45%), 1fr)); gap: .8rem; margin-bottom: 1rem; }
.tuile { background: var(--carte); border: 1px solid var(--trait); border-left: 4px solid var(--bleu); border-radius: var(--rayon); padding: .7rem .9rem; display: flex; flex-direction: column; }
.tuile span { color: var(--gris); font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; }
.tuile b { font-size: 1.35rem; color: var(--bleu); font-variant-numeric: tabular-nums; }
.tuile b.txt { font-size: 1.05rem; }
.tuile small { color: var(--gris); font-size: .8rem; }
.tuile.alerte { border-left-color: var(--rouge); } .tuile.alerte b { color: var(--rouge); }
.ambre { color: #a16207; font-weight: 700; }

form { margin: 0; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem 1rem; }
.grille .large { grid-column: 1 / -1; }
.ligne { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin: .4rem 0; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--gris); font-weight: 600; }
label.case { flex-direction: row; align-items: center; gap: .5rem; }
input, select, textarea { font: inherit; color: var(--encre); padding: .5rem .6rem; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ambre); border-color: var(--bleu); }
.filtre { display: flex; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.filtre input[name=q] { flex: 1; max-width: 380px; }
.mini { display: flex; flex-direction: column; gap: .3rem; margin-top: .3rem; min-width: 200px; }

.btn { display: inline-block; background: var(--bleu); color: #fff; border: 0; border-radius: 7px; padding: .55rem 1rem; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--bleu-f); text-decoration: none; }
.btn:disabled { opacity: .5; }
.btn.discret { background: #fff; color: var(--bleu); border: 1px solid var(--bleu); }
.btn.petit, .petit { font-size: .8rem; } .btn.petit { padding: .3rem .6rem; }
.lien { background: none; border: 0; padding: 0; color: var(--bleu); font: inherit; cursor: pointer; text-decoration: underline; }
summary { cursor: pointer; color: var(--bleu); }
.discret { color: var(--gris); }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }
.flash.ok { background: #dcfce7; color: #14532d; }
.flash.erreur { background: #fee2e2; color: #7f1d1d; }
.flash.info { background: #fef3c7; color: #713f12; }

.pastille { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #e2e8f0; color: var(--gris); }
.pastille.libre { background: #dcfce7; color: #166534; }
.pastille.occ { background: #dbeafe; color: var(--bleu); }
.pastille.ambre { background: #fef3c7; color: #92400e; }
.pastille.rouge { background: #fee2e2; color: #991b1b; }
.rev-propose { background: #fef3c7; color: #92400e; } .rev-valide { background: #dbeafe; color: var(--bleu); }
.rev-paye { background: #dcfce7; color: #166534; } .rev-rejete { background: #fee2e2; color: #991b1b; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--gris); font-size: .85rem; } .kv dd { margin: 0; }

body.accueil { min-height: 100vh; background: linear-gradient(160deg, var(--bleu) 0 35%, var(--fond) 35%) no-repeat fixed; }

/* documents imprimables : reçu, quittance, compte rendu de gestion */
.doc { background: #fff; max-width: 800px; margin: 0 auto 1rem; padding: 2rem 2.2rem; border-top: 8px solid var(--bleu); box-shadow: 0 0 0 1px var(--trait); }
.doc-entete { display: flex; justify-content: space-between; align-items: start; border-bottom: 2px solid var(--ambre); padding-bottom: .8rem; margin-bottom: 1.2rem; font-size: .85rem; color: var(--gris); }
.doc-agence { font-size: 1.2rem; font-weight: 800; color: var(--bleu); }
.doc-titre { font-size: 1.3rem; letter-spacing: .5px; } .doc-titre span { font-size: .9rem; color: var(--gris); margin-left: .5rem; font-weight: 600; }
.doc-montant { font-size: 1.3rem; font-weight: 800; color: var(--bleu); }
.doc-signature { margin: 2rem 0 1rem auto; width: 300px; text-align: center; font-size: .9rem; min-height: 90px; }
.doc table { margin: .5rem 0 1rem; }
tr.total td { font-weight: 800; border-top: 2px solid var(--bleu); color: var(--bleu); }
table.recap { max-width: 420px; margin-left: auto; }

@media print {
  .entete, .pied, .imprimer, .sans-impression, .flash { display: none !important; }
  body { background: #fff; } .page { padding: 0; }
  .doc { box-shadow: none; margin: 0; max-width: none; }
}

.vignettes { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .7rem; }
.vignettes img { width: 110px; height: 82px; object-fit: cover; border-radius: 6px; border: 1px solid var(--trait); }
.alerte-bord { border-left: 4px solid var(--rouge); }
details { margin: .5rem 0; } details > form { margin-top: .5rem; }
.deux-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; min-height: 110px; text-align: center; font-size: .9rem; }
#lignes input, #lignes select { width: 100%; }
.bandeau-demo { background: var(--ambre); color: var(--encre); text-align: center; padding: 6px 12px; font-weight: 800; font-size: .85rem; }
@media print { .bandeau-demo { display: none; } }
.choix-agence select { background: var(--bleu-f); color: #fff; border-color: #3b5fae; padding: .3rem .5rem; font-size: .85rem; }
.choix-agence span { color: var(--ambre); font-weight: 700; font-size: .85rem; }
.apercu { max-width: 180px; max-height: 90px; object-fit: contain; background: #fff; border: 1px dashed var(--trait); padding: 4px; }
.imprimer { display: flex; gap: .4rem; }
.doc-logo { max-height: 60px; max-width: 160px; display: block; margin-bottom: .4rem; }
.sous-nav { display: flex; gap: .3rem; flex-wrap: wrap; margin: -.4rem 0 1rem; border-bottom: 2px solid var(--trait); }
.sous-nav a { padding: .45rem .8rem; color: var(--gris); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.sous-nav a.actif { color: var(--bleu); border-bottom-color: var(--ambre); text-decoration: none; }
tr.debut-ecriture td { border-top: 2px solid var(--trait); }
