/* Portail LMNP : charte GEXPERTEAM (marine #083085, fond #f0f4ff,
   zones de dépôt sur le modèle de Gestion plannings). */
:root {
  --navy: #083085;
  --nuit: #04173f;
  --bleu: #1565c0;
  --vif: #0087ff;
  --fond: #f0f4ff;
  --carte: #ffffff;
  --txt: #1e2a4a;
  --gris: #54627a;
  --bord: #d8e2f2;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --rayon: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--txt);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
h1 { font-size: 24px; margin: 0 0 8px; color: var(--nuit); line-height: 1.25; }
h2 { font-size: 18px; margin: 0; color: var(--nuit); }
a { color: var(--bleu); }

.bandeau { background: linear-gradient(110deg, var(--nuit), var(--navy) 55%, #0b4fb3); color: #fff; }
.bandeau-int { max-width: 980px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { height: 30px; width: auto; display: block; }
.bandeau-titre { font-weight: 600; letter-spacing: .3px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.35); }
.bandeau-droite { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.qui { font-size: 13px; opacity: .9; }
.btn-bandeau { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.btn-bandeau:hover { background: rgba(255,255,255,.22); }
.demo { background: #fff7e6; color: #7a4a00; text-align: center; font-size: 13px; padding: 6px 16px; border-bottom: 1px solid #f3d9a6; }

.page { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.page.etroite { max-width: 560px; }
.pied { text-align: center; color: var(--gris); font-size: 12px; padding: 18px 16px 24px; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px; box-shadow: 0 6px 22px rgba(8,48,133,.06); margin-bottom: 18px; }
.intro { color: var(--gris); margin: 0 0 18px; }
.aide { color: var(--gris); font-size: 13px; margin: 6px 0 0; }
.surtitre { text-transform: uppercase; letter-spacing: .8px; font-size: 12px; color: var(--bleu); font-weight: 600; margin: 0 0 4px; }

.form-col { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
label { font-weight: 600; font-size: 14px; }
input[type=text], input:not([type]), input[inputmode] {
  font: inherit; padding: 11px 13px; border: 1px solid #c3d6ee; border-radius: 10px; background: #fff; color: var(--txt); width: 100%;
}
input:focus-visible, button:focus-visible, .drop-zone:focus-visible, a:focus-visible { outline: 3px solid rgba(0,135,255,.35); outline-offset: 1px; }
input.invalide { border-color: var(--err); }
input:disabled { background: #f5f7fb; color: var(--txt); }
.champ-code { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; }

.btn-principal {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  background: linear-gradient(100deg, var(--navy), var(--vif)); color: #fff; border: 0;
  border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 600;
}
.btn-principal:hover { filter: brightness(1.08); }
.btn-principal:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-large { width: 100%; padding: 14px 24px; font-size: 16px; margin-top: 8px; }
.btn-secondaire { background: #fff; color: var(--navy); border: 1px solid #c3d6ee; border-radius: 999px; padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.btn-lien { background: none; border: 0; color: var(--bleu); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; padding: 4px 0; }
.btn-danger { background: #fff; color: var(--err); border: 1px solid #f0b4b4; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn-ajout { background: #eef4ff; color: var(--navy); border: 1px dashed #9db8e6; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn-ajout:hover { background: #e2ecff; }
.btn-icone { margin-left: auto; background: none; border: 0; color: var(--gris); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.btn-icone:hover { color: var(--err); }
.btn-x { background: none; border: 0; color: var(--gris); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.btn-x:hover { color: var(--err); }

.alerte { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.alerte.erreur { background: #fdecec; color: #8a1c1c; border: 1px solid #f5c2c2; }
.alerte.info { background: #eef4ff; color: var(--navy); border: 1px solid #c9dafc; }
.alerte.succes { background: #eaf7ee; color: #14532d; border: 1px solid #bfe3cb; }

/* Formulaire */
.entete-dossier { margin-bottom: 18px; }
.cat-tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.badge { flex-shrink: 0; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.badge-oblig { background: #fff1e6; color: #9a4b00; }
.badge-facul { background: #eef2f7; color: var(--gris); }
.mention { background: #fff7e6; border-left: 4px solid var(--warn); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; color: #6b3d00; }
.mention strong { letter-spacing: .3px; margin-right: 4px; }
.lignes { display: flex; flex-direction: column; gap: 12px; }
.lignes:not(:empty) { margin-bottom: 12px; }
.ligne { border: 1px solid var(--bord); border-radius: 12px; padding: 14px; background: #fbfcff; }
.ligne.a-revoir { border-color: var(--err); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.ligne-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ligne-num { font-weight: 600; color: var(--nuit); font-size: 14px; }
.pastille { font-size: 12px; border-radius: 999px; padding: 2px 9px; }
.pastille:empty { display: none; }
.pastille-manque { background: #fdecec; color: #8a1c1c; }
.pastille-ok { background: #eaf7ee; color: #14532d; }
.ligne-champs { display: flex; gap: 12px; flex-wrap: wrap; }
.champ { display: flex; flex-direction: column; gap: 4px; font-weight: 400; flex: 0 1 200px; }
.champ-large { flex: 1 1 280px; }
.etiquette { font-size: 12px; color: var(--gris); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.montant { text-align: right; font-variant-numeric: tabular-nums; }
.case { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; margin-top: 10px; cursor: pointer; }
.case input { width: 18px; height: 18px; accent-color: var(--navy); }
.cat-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cat-total { font-weight: 600; color: var(--nuit); font-variant-numeric: tabular-nums; }

/* Zone de dépôt : modèle Gestion plannings */
.drop-zone {
  margin-top: 12px; border: 2px dashed #c3d6ee; border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f6f9ff); padding: 18px 16px 16px 92px; position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer; min-height: 90px; justify-content: center;
}
.drop-zone::before {
  content: ""; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 58px; height: 58px; border-radius: 19px; background: linear-gradient(135deg, #5abfdd, #b8f7b5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304173f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M12 17v-6'/%3E%3Cpath d='m9 13 3-3 3 3'/%3E%3C/svg%3E"), linear-gradient(135deg, #5abfdd, #b8f7b5);
  background-repeat: no-repeat; background-position: center; background-size: 28px, cover;
}
.drop-zone.survol { border-color: var(--vif); background: #eef6ff; }
.drop-zone.envoi { opacity: .65; pointer-events: none; }
.drop-titre { font-size: 16px; font-weight: 700; color: var(--nuit); }
.drop-aide { font-size: 13px; color: var(--gris); }
.browse-btn { margin-top: 8px; background: linear-gradient(100deg, #083085, #0087ff); color: #fff; border: 0; border-radius: 999px; padding: 11px 24px; font: inherit; font-weight: 600; cursor: pointer; }
.fichiers { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fichiers:empty { display: none; }
.fichier { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.fichier a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.fichier-taille { color: var(--gris); font-size: 12px; flex-shrink: 0; }

/* Dossier transmis : lecture seule, catégories vides masquées */
.verrouille .categorie.vide { display: none; }

.recap h2 { margin-bottom: 12px; }
.recap-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.recap-chiffres > div { background: #f6f9ff; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.chiffre { font-size: 22px; font-weight: 700; color: var(--nuit); font-variant-numeric: tabular-nums; }
.problemes { background: #fdecec; border: 1px solid #f5c2c2; border-radius: 10px; padding: 10px 14px 10px 30px; margin: 0 0 8px; color: #8a1c1c; font-size: 14px; }
.problemes a { color: #8a1c1c; }

.voile { position: fixed; inset: 0; background: rgba(4,23,63,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.voile[hidden] { display: none; }
.modale { background: #fff; border-radius: 18px; max-width: 520px; width: 100%; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modale h2 { font-size: 20px; margin-bottom: 10px; }
.modale p { margin: 0 0 10px; }
.modale-resume { background: #f6f9ff; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--nuit); margin: 12px 0 4px; }
.modale-boutons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--nuit); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast-erreur { background: #8a1c1c; }

/* Espace expert */
.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 18px; }
.fiche dt { color: var(--gris); }
.fiche dd { margin: 0; font-weight: 600; }
.tableau { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 14px; }
.tableau th, .tableau td { padding: 8px 6px; border-bottom: 1px solid var(--bord); text-align: left; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; }
.rouvrir { margin-top: 22px; border-top: 1px solid var(--bord); padding-top: 14px; }
.rouvrir summary { cursor: pointer; color: var(--gris); font-size: 14px; }
.rouvrir p { color: var(--gris); font-size: 14px; }

@media (max-width: 600px) {
  .carte { padding: 16px; }
  h1 { font-size: 21px; }
  .cat-tete { flex-direction: column; }
  .bandeau-titre { border: 0; padding: 0; }
  .qui { display: none; }
  .drop-zone { padding-left: 16px; padding-top: 84px; }
  .drop-zone::before { top: 16px; transform: none; }
  .recap-chiffres { grid-template-columns: 1fr; }
  .champ { flex: 1 1 100%; }
}
.verrouille .entete-dossier .intro { display: none; }
