:root {
  --fond: #eef1f5;
  --papier: #ffffff;
  --encre: #1f2937;
  --doux: #6b7280;
  --ligne: #e3e7ee;
  --marine: #1e3a5f;
  --accent: #1a56db;
  --vert: #15803d;
  --vert-fond: #e6f4ea;
  --rouge: #c0392b;
  --orange: #c2410c;
  --violet: #7c3aed;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
small { display: block; color: var(--doux); font-size: 11px; }
.muet { color: var(--doux); }
.alerte { color: var(--rouge); }
.inline { display: inline; }

/* En-tête */
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 24px;
  background: var(--papier); border-bottom: 1px solid var(--ligne); position: sticky; top: 0; z-index: 5; }
.marque { font: 600 26px Newsreader, Georgia, serif; color: var(--marine); text-decoration: none; }
.marque span { font-size: 20px; color: var(--encre); }
.onglets { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.onglets a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ligne); color: var(--encre);
  text-decoration: none; font-weight: 500; }
.onglets a small { display: inline; margin-left: 4px; }
.onglets a.actif { background: var(--marine); border-color: var(--marine); color: #fff; }
.onglets a.actif small { color: #cbd5e1; }
.compte { color: var(--doux); }

main { padding: 16px 24px 40px; }

/* Filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filtres input, .filtres select, select, input, textarea { font: inherit; padding: 7px 10px;
  border: 1px solid var(--ligne); border-radius: 6px; background: var(--papier); }
.filtres input[type=search] { min-width: 260px; }
.compte-lignes { margin-left: auto; }

/* Tableau */
.tableau-conteneur { overflow-x: auto; background: var(--papier); border-radius: 10px; border: 1px solid var(--ligne); }
.tableau { border-collapse: collapse; width: 100%; min-width: 1300px; }
.tableau th { position: sticky; top: 0; background: var(--papier); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--doux); padding: 10px 8px; border-bottom: 1px solid var(--ligne);
  cursor: pointer; white-space: nowrap; }
.tableau th[data-sens=asc]::after { content: " ▲"; }
.tableau th[data-sens=desc]::after { content: " ▼"; }
.tableau td { padding: 9px 8px; border-bottom: 1px solid var(--ligne); text-align: center; vertical-align: middle; }
.tableau tr:hover td { background: #f7f9fc; }
.tableau td.nombre { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau td.vide { padding: 40px; color: var(--doux); }
.lien-bien { color: var(--encre); text-decoration: none; }
.lien-bien:hover { text-decoration: underline; }
td.deloc { color: var(--rouge); font-weight: 600; }
td.fort { font-weight: 700; }
.marge.pos { color: var(--vert); font-weight: 700; }
.marge.neg { color: var(--rouge); }

.categorie { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  white-space: nowrap; background: #eef1f5; color: var(--doux); }
.cat-0 { background: var(--vert-fond); color: var(--vert); }
.cat-1 { background: #e8effc; color: var(--accent); }
.cat-2 { background: #f3e8ff; color: var(--violet); }
.cat-4 { background: #fdecea; color: var(--rouge); }
.etiquette { display: inline-block; margin-top: 3px; padding: 1px 6px; border-radius: 4px; font-size: 10px;
  font-weight: 700; background: #fff4e5; color: var(--orange); border: 1px solid #fcd9a8; }
.badge-septeo { background: #0f766e; }
.badge-encheres_immobilieres { background: #475569; }
.coeur { border: 0; background: none; font-size: 18px; color: #cbd5e1; cursor: pointer; padding: 0 4px; }
.coeur.plein { color: var(--marine); }
.etape { display: block; font-size: 11px; color: var(--doux); }

.badge { display: inline-block; margin: 2px; padding: 2px 6px; border-radius: 4px; font-size: 10px;
  font-weight: 700; color: #fff; text-decoration: none; background: #64748b; }
.badge-licitor { background: #2563eb; }
.badge-vench { background: #d97706; }
.badge-avoventes { background: #dc2626; }
.badge-info_encheres { background: var(--violet); }

.score { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 12px; border: 0; }
.score-1 { background: var(--vert); }
.score-2 { background: #2563eb; }
.score-3 { background: var(--orange); }

/* Fiche */
.fil { margin: 0 0 8px; }
.fiche-entete, .bloc, .carte { background: var(--papier); border: 1px solid var(--ligne); border-radius: 10px; }
.fiche-entete { padding: 20px; margin-bottom: 14px; }
.fiche-entete h1 { margin: 0 0 4px; font: 600 26px Newsreader, Georgia, serif; color: var(--marine); }
.sous-titre { color: var(--doux); margin-top: 0; }
.pastille { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 10px; border-radius: 999px;
  background: var(--vert-fond); color: var(--vert); font-size: 12px; font-weight: 600; }
.pastille.deloc { background: #fdecea; color: var(--rouge); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.bouton { font: inherit; padding: 8px 14px; border-radius: 6px; border: 0; background: var(--marine);
  color: #fff; cursor: pointer; }
.bouton.secondaire { background: var(--papier); color: var(--marine); border: 1px solid var(--marine); }
.bouton.petit { padding: 5px 10px; font-size: 13px; }
.lien { background: none; border: 0; color: var(--accent); cursor: pointer; }
.score-choix .score { cursor: pointer; opacity: .35; }
.score-choix .score.choisi { opacity: 1; outline: 2px solid var(--encre); }

.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.carte { padding: 14px 16px; }
.carte span { color: var(--doux); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.carte strong { display: block; font-size: 22px; margin-top: 4px; }
.carte.accent { border-color: var(--marine); }

.colonnes { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; }
.bloc { padding: 16px; margin-bottom: 14px; }
.bloc h2 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.texte { white-space: pre-wrap; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.photos img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; }
.calcul { width: 100%; border-collapse: collapse; }
.calcul td { padding: 3px 0; }
.calcul td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.calcul .total td { border-top: 1px solid var(--ligne); font-weight: 700; padding-top: 6px; }
.ligne { display: flex; gap: 8px; align-items: end; margin-top: 10px; }
.ligne input { width: 120px; }
textarea { width: 100%; margin-bottom: 6px; }
.journal { list-style: none; padding: 0; margin: 0; }
.journal li { padding: 4px 0; border-bottom: 1px solid var(--ligne); }

/* Connexion */
.connexion { max-width: 320px; margin: 12vh auto; background: var(--papier); padding: 32px; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08); display: grid; gap: 12px; }
.connexion h1 { margin: 0; font: 600 28px Newsreader, Georgia, serif; color: var(--marine); }
.connexion label { display: grid; gap: 4px; color: var(--doux); font-size: 13px; }
.connexion button { padding: 10px; background: var(--marine); color: #fff; border: 0; border-radius: 6px; font: inherit; cursor: pointer; }
.erreur { color: var(--rouge); margin: 0; }

@media (max-width: 800px) {
  main { padding: 12px 16px 32px; }
  .entete { padding: 12px 16px; }
  .colonnes { grid-template-columns: 1fr; }
  .filtres input[type=search] { min-width: 0; flex: 1; }
}
