/* MALCO Business — connexion, portail et administration.
   Direction validée avec le propriétaire : blanc épuré, beaucoup d'espace, un seul accent bleu franc,
   textes noirs et grands, bordures fines, coins légèrement arrondis. Pas d'or, pas de bleu nuit. */

:root {
  --texte: #0b0f19;
  --texte-2: #4b5563;
  --texte-3: #6b7280;
  --filet: #e5e7eb;
  --filet-fort: #d1d5db;
  --fond: #ffffff;
  --fond-doux: #f8fafc;
  --accent: #1f4fd8;
  --accent-fonce: #1a43b8;
  --accent-pale: #eef3ff;
  --danger: #c0262d;
  --danger-pale: #fdf1f1;
  --ok: #16794a;
  --ok-pale: #ecf8f1;
  --attention: #a15c07;
  --attention-pale: #fdf6e7;

  --rayon: 10px;
  --rayon-petit: 8px;
  --ombre: 0 1px 2px rgba(11, 15, 25, .05);
  --ombre-survol: 0 8px 24px rgba(11, 15, 25, .08);
  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--texte);
  background: var(--fond);
  min-height: calc(100vh / var(--zoom));
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 650; margin-bottom: 12px; }
.mono, code { font-family: var(--mono); }
.note { color: var(--texte-3); font-size: .95rem; }
:focus-visible { outline: 3px solid rgba(31, 79, 216, .35); outline-offset: 2px; }

/* ---------- Barre supérieure ---------- */
/* Fond bleu plein ; tout tient sur une ligne (les liens ne passent jamais à la ligne). */
.barre { background: var(--accent); color: #fff; }
.barre-int {
  max-width: 1280px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: nowrap;
}
.marque {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  color: var(--texte); font-weight: 750; font-size: 1.2rem; letter-spacing: -.01em; white-space: nowrap;
}
.marque:hover { text-decoration: none; color: var(--texte); }
.marque span { font-weight: 400; color: var(--texte-3); }
.marque .marque-carre {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: 0;
}
.barre .marque, .barre .marque:hover { color: #fff; }
.barre .marque span { color: rgba(255, 255, 255, .75); }
.barre .marque .marque-carre { background: #fff; color: var(--accent); }
.nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a, .compte a {
  color: rgba(255, 255, 255, .86); padding: 8px 12px; border-radius: var(--rayon-petit);
  font-weight: 550; font-size: 1rem; white-space: nowrap; flex: none;
}
.nav a:hover, .compte a:hover { background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; }
.nav a.actif, .compte a.actif { background: #fff; color: var(--accent); }
.compte { display: flex; align-items: center; gap: 4px; flex: none; }
.compte .qui { color: #fff; font-weight: 600; padding-right: 10px; margin-right: 4px; border-right: 1px solid rgba(255, 255, 255, .3); white-space: nowrap; }
.compte form { margin: 0; }
.lien-clair {
  background: none; border: 0; color: rgba(255, 255, 255, .86); font: inherit; font-weight: 550; cursor: pointer;
  padding: 8px 12px; border-radius: var(--rayon-petit); white-space: nowrap;
}
.lien-clair:hover { background: rgba(255, 255, 255, .14); color: #fff; }
@media (max-width: 1180px) {
  .compte .qui { display: none; }
  .barre-int { gap: 16px; padding: 0 18px; }
  .nav a, .compte a, .lien-clair { padding: 8px 9px; }
}

/* Dans une application : seul le retour au portail est visible. */
.barre-application .barre-int { min-height: 56px; }
.retour-portail { color: #fff; font-weight: 600; padding: 8px 0; }
.retour-portail:hover { color: #fff; }

/* ---------- Barre d'icônes flottante (portail, administration) ----------
   Remplace la barre de navigation : à gauche, masquable, déplaçable (position mémorisée). */
.dock {
  position: fixed; z-index: 50; left: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px; background: var(--accent); border: 1px solid var(--accent-fonce); border-radius: 16px;
  box-shadow: 0 12px 32px rgba(31, 79, 216, .28);
}
.dock.place { transform: none; }
.dock.deplacement { cursor: grabbing; box-shadow: 0 18px 40px rgba(11, 15, 25, .2); }
.dock form { margin: 0; }
.dock svg { width: 21px; height: 21px; }
.dock-poignee {
  display: grid; place-items: center; width: 44px; height: 18px; padding: 0;
  border: 0; background: none; color: rgba(255, 255, 255, .6); cursor: grab; touch-action: none;
}
.dock-poignee svg { width: 16px; height: 16px; transform: rotate(90deg); }
.dock-poignee:hover { color: #fff; }
.dock-marque {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px;
  border-radius: 10px; background: #fff; color: var(--accent); font-weight: 800; font-size: 1.05rem;
}
.dock-bouton {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 11px; background: none; color: rgba(255, 255, 255, .88); cursor: pointer; font: inherit;
}
.dock-bouton:hover { background: rgba(255, 255, 255, .16); color: #fff; text-decoration: none; }
.dock-bouton.actif { background: #fff; color: var(--accent); }
.dock-filet { width: 28px; height: 1px; background: rgba(255, 255, 255, .3); margin: 2px 0; }
.dock-masquer { color: rgba(255, 255, 255, .7); }
/* Libellé au survol, à droite de l'icône. */
.dock-bouton[data-info]::after {
  content: attr(data-info); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  padding: 6px 10px; border-radius: 8px; background: var(--texte); color: #fff;
  font-size: .9rem; font-weight: 600; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .12s ease;
}
.dock-bouton[data-info]:hover::after, .dock-bouton[data-info]:focus-visible::after { opacity: 1; }
.dock.a-droite .dock-bouton[data-info]::after { left: auto; right: calc(100% + 12px); }
.dock-rappel {
  position: fixed; z-index: 50; left: 14px; top: 14px;
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--accent-fonce); border-radius: 12px; background: var(--accent); color: #fff;
  box-shadow: 0 8px 24px rgba(31, 79, 216, .28); cursor: pointer;
}
.dock-rappel svg { width: 22px; height: 22px; }
.dock-rappel:hover { background: var(--accent-fonce); }
.dock[hidden], .dock-rappel[hidden] { display: none !important; }
@media print { .dock, .dock-rappel { display: none !important; } }

/* ---------- Page ---------- */
.page { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 48px 28px 64px; }
.avec-dock .page, .avec-dock .pied { padding-left: 96px; }
.pied {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  max-width: 1280px; width: 100%; margin: 0 auto; padding: 20px 28px;
  border-top: 1px solid var(--filet); color: var(--texte-3); font-size: .9rem;
}

.entete-page { margin-bottom: 32px; }
.entete-page h1 { font-size: 2.3rem; font-weight: 700; letter-spacing: -.025em; }
.surtitre { margin: 0 0 6px; font-size: .95rem; font-weight: 600; color: var(--accent); }
.surtitre.chemin { font-family: var(--mono); font-size: .95rem; }
.chapeau { font-size: 1.2rem; color: var(--texte-2); margin: 10px 0 0; }

/* ---------- Portail ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.tuile {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--fond); color: var(--texte);
  border: 1px solid var(--filet); border-radius: 14px; padding: 28px; min-height: 250px;
  box-shadow: var(--ombre);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tuile:hover { text-decoration: none; color: var(--texte); border-color: var(--accent); box-shadow: var(--ombre-survol); transform: translateY(-1px); }
.tuile-icone {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-pale); color: var(--accent);
}
.tuile-icone svg { width: 26px; height: 26px; }
/* Logo de l'application : en petit dans l'en-tête de la carte, en grand et très pâle au fond. */
.tuile-logo { position: relative; overflow: hidden; isolation: isolate; }
.tuile-filigrane {
  position: absolute; z-index: -1; right: -36px; top: 50%; transform: translateY(-50%);
  width: 330px; max-width: none; opacity: .13; pointer-events: none; user-select: none;
  transition: opacity .2s ease;
}
.tuile-logo:hover .tuile-filigrane { opacity: .2; }
/* Fond de chaque carte teinté d'après son logo. */
.app-facturation { background: #f0f4ff; border-color: #d3ddf7; }
.app-facturation:hover { border-color: #1f4fd8; }
.app-depot { background: #ecf7f3; border-color: #cbe6dc; }
.app-depot:hover { border-color: #0e7c70; }
.app-depot .ouvrir { color: #0e7c70; }
.app-admin { background: #f2f4f7; border-color: #dde1e8; }
.app-admin:hover { border-color: #334155; }
.app-admin .ouvrir { color: #334155; }
.app-admin .tuile-filigrane { width: 220px; right: -18px; opacity: .1; }
.app-admin:hover .tuile-filigrane { opacity: .16; }
.tuile-logo .tuile-pied { border-top-color: rgba(11, 15, 25, .08); }
.app-depot .tuile-filigrane { width: 230px; right: -24px; opacity: .2; }
.app-depot:hover .tuile-filigrane { opacity: .24; }
.tuile-icone-logo { width: auto; min-width: 48px; padding: 0; background: none; justify-content: start; }
.tuile-icone-logo img { height: 48px; width: auto; display: block; }
.tuile-nom { font-size: 1.55rem; font-weight: 700; letter-spacing: -.015em; }
.tuile-desc { color: var(--texte-2); font-size: 1.08rem; flex: 1; }
.tuile-pied {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--filet); padding-top: 16px; color: var(--texte-3); font-size: .98rem;
}
.tuile-pied b { color: var(--texte); font-weight: 600; }
.ouvrir { font-weight: 650; color: var(--accent); }

.vide { background: var(--fond-doux); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 40px; }
.vide h2 { margin-bottom: 8px; }

/* ---------- Cartes et formulaires ---------- */
.carte { background: var(--fond); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 28px 30px; margin-bottom: 24px; box-shadow: var(--ombre); }
.carte h2:first-child { margin-top: 0; }
.formulaire h2 { margin-top: 28px; }
.formulaire > input[type=hidden]:first-child + h2 { margin-top: 0; }
.etroit { max-width: 560px; }
.bandeau-app { border-left: 4px solid var(--accent); }

.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; }
.champ { margin-bottom: 18px; }
.champ label { display: block; font-weight: 600; margin-bottom: 6px; }
.champ input[type=text], .champ input[type=email], .champ input[type=password], .champ input[type=date], .champ select {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--texte);
  background: var(--fond); border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit);
  padding: 11px 13px; min-height: 48px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.champ input:focus, .champ select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 79, 216, .14); }
.champ.en-erreur input, .champ.en-erreur select { border-color: var(--danger); }
.erreur { color: var(--danger); font-weight: 600; font-size: .95rem; margin: 6px 0 0; }
.champ .note { margin: 6px 0 0; }

.champ-mdp { display: flex; }
.champ-mdp input { flex: 1; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.voir-mdp {
  font: inherit; font-size: .95rem; font-weight: 600; background: var(--fond-doux); color: var(--texte-2);
  border: 1px solid var(--filet-fort); border-left: 0; border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0;
  padding: 0 14px; cursor: pointer; min-width: 92px;
}
.voir-mdp:hover { color: var(--texte); }

.case { display: flex; gap: 12px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; padding: 6px 0; }
.case input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }

.groupes-permissions { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 8px 0 12px; }
.groupes-permissions fieldset { border: 1px solid var(--filet); border-radius: var(--rayon); margin: 0; padding: 14px 18px; }
.groupes-permissions legend { font-weight: 650; padding: 0 6px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions form { margin: 0; }
.barre-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.barre-actions h2 { margin: 0; }
.barre-actions .note { margin: 0; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 1.02rem; cursor: pointer;
  padding: 11px 20px; min-height: 48px; border: 1px solid transparent; border-radius: var(--rayon-petit);
  transition: background-color .12s ease, border-color .12s ease;
}
.bouton:hover { text-decoration: none; }
.bouton.principal { background: var(--accent); color: #fff; }
.bouton.principal:hover { background: var(--accent-fonce); color: #fff; }
.bouton.secondaire { background: var(--fond); color: var(--texte); border-color: var(--filet-fort); }
.bouton.secondaire:hover { background: var(--fond-doux); color: var(--texte); }
.bouton.danger { background: var(--fond); color: var(--danger); border-color: #efc6c8; }
.bouton.danger:hover { background: var(--danger-pale); }
.bouton.large { width: 100%; }
.bouton.petit { min-height: 38px; padding: 6px 14px; font-size: .95rem; }
.lien, .lien-danger { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--accent); }
.lien:hover, .lien-danger:hover { text-decoration: underline; text-underline-offset: 3px; }
.lien-danger { color: var(--danger); }
form.en-ligne { display: inline; margin-left: 14px; }

/* ---------- Alertes ---------- */
.alerte { padding: 14px 18px; margin-bottom: 20px; border: 1px solid; border-radius: var(--rayon); font-weight: 500; }
.alerte-succes { border-color: #bfe5cf; background: var(--ok-pale); color: #0f5132; }
.alerte-erreur { border-color: #efc6c8; background: var(--danger-pale); color: var(--danger); }
.alerte-info { border-color: #c9d6fb; background: var(--accent-pale); color: #1b3a9c; }
.alerte-mdp { border-color: #c9d6fb; background: var(--accent-pale); color: var(--texte); }
.alerte-mdp p { margin: 8px 0; }
.mdp-ligne { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mdp-code {
  font-size: 1.6rem; font-weight: 700; letter-spacing: 2px; padding: 6px 14px;
  background: var(--fond); border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit);
}

/* ---------- Tableaux ---------- */
.tableau-cadre { overflow-x: auto; background: var(--fond); border: 1px solid var(--filet); border-radius: var(--rayon); margin-bottom: 24px; }
.tableau { width: 100%; border-collapse: collapse; font-size: 1rem; }
.tableau th {
  text-align: left; font-size: .9rem; font-weight: 600; color: var(--texte-3);
  padding: 12px 16px; background: var(--fond-doux); border-bottom: 1px solid var(--filet); white-space: nowrap;
}
.tableau td { padding: 13px 16px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: #fbfcfe; }
.tableau tr.inactif td { color: var(--texte-3); }
.tableau tr.alerte-ligne td { background: var(--attention-pale); }
.tableau .droite { text-align: right; white-space: nowrap; }
.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; }
.tableau .details { font-size: .92rem; color: var(--texte-2); max-width: 380px; }

.badge {
  display: inline-block; font-size: .85rem; font-weight: 600; padding: 2px 10px; margin-left: 6px;
  border-radius: 999px; background: var(--accent-pale); color: var(--accent); white-space: nowrap;
}
td > .badge:first-child { margin-left: 0; }
.badge-admin { background: #f1f5f9; color: var(--texte); }
.badge-ok { background: var(--ok-pale); color: var(--ok); }
.badge-attente { background: var(--attention-pale); color: var(--attention); }
.badge-gris { background: #f1f5f9; color: var(--texte-3); }

/* ---------- Onglets, filtres, pagination ---------- */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--filet); margin-bottom: 28px; flex-wrap: wrap; }
.onglets a { padding: 10px 16px; font-weight: 600; color: var(--texte-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets a:hover { color: var(--texte); text-decoration: none; }
.onglets a.actif { color: var(--accent); border-bottom-color: var(--accent); }

.filtres { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: flex-end; padding: 22px 24px 4px; }
.filtres .champ { flex: 1 1 170px; }
.filtres .actions { flex: 0 0 auto; flex-wrap: nowrap; margin: 0 0 18px; }
.section-app { margin-bottom: 40px; }
.pagination { display: flex; gap: 12px; justify-content: center; }
.liste-filets { list-style: none; padding: 0; margin: 0; }
.liste-filets li { padding: 10px 0; border-bottom: 1px solid var(--filet); }
.liste-filets li:last-child { border-bottom: 0; }
.zone-sensible { border-color: #efc6c8; }

.page-erreur { max-width: 640px; margin: 40px auto; }
.code-erreur { font-size: 4.5rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; letter-spacing: -.03em; }
.page-erreur h1 { font-size: 2rem; margin: 12px 0; }
.page-erreur .bouton { margin-top: 24px; }

/* ---------- Connexion ---------- */
/* Tout tient dans la hauteur de l'écran : en-tête mince, formulaire visible sans défiler. */
.ecran-connexion { background: var(--fond-doux); min-height: calc(100vh / var(--zoom)); }
.connexion-centre { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 20px 16px; }
.boite {
  width: 100%; max-width: 420px; background: var(--fond);
  border: 1px solid var(--filet); border-radius: 16px; padding: 28px 32px 22px; box-shadow: 0 10px 30px rgba(11, 15, 25, .06);
}
.boite-titre { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.boite-texte { color: var(--texte-2); font-size: 1rem; margin: 0 0 18px; }
.boite .champ { margin-bottom: 14px; }
.boite .note { margin: 12px 0 0; }
.boite .page-erreur { margin: 0; }
.connexion-pied {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--texte-3); font-size: .85rem; padding: 4px 20px 16px;
}
.connexion-pied .marque { font-size: 1.05rem; }

@media (max-width: 760px) {
  .page { padding: 32px 20px 48px; }
  .barre-int { padding: 0 20px; gap: 16px; }
  .entete-page h1 { font-size: 1.9rem; }
  .compte .qui { display: none; }
  .boite { padding: 28px 24px; }
}

/* Grands écrans de bureau : tout est agrandi proportionnellement (même design, plus lisible).
   --zoom vaut 1 sur portable ; les hauteurs liées à l'écran se divisent par --zoom. Jamais à l'impression. */
:root { --zoom: 1; }
@media screen and (min-width: 1800px) and (min-height: 880px) { :root { --zoom: 1.1; } }
@media screen and (min-width: 2000px) and (min-height: 980px) { :root { --zoom: 1.2; } }
@media screen and (min-width: 2200px) and (min-height: 1080px) { :root { --zoom: 1.3; } }
@media screen and (min-width: 2400px) and (min-height: 1180px) { :root { --zoom: 1.4; } }
@media screen and (min-width: 2600px) and (min-height: 1280px) { :root { --zoom: 1.5; } }
@media screen and (min-width: 3000px) and (min-height: 1500px) { :root { --zoom: 1.75; } }
@media screen and (min-width: 3400px) and (min-height: 1700px) { :root { --zoom: 2; } }
@media screen { body { zoom: var(--zoom); } }
/* Grand écran : la colonne du portail et de l'administration s'élargit aussi. */
@media screen and (min-width: 2000px) and (min-height: 980px) { .page, .pied { max-width: 1480px; } }
