/* CRM Copropriété — feuille de style autonome (aucune ressource externe) */

:root {
  --sidebar: #1a1d29;
  --sidebar-clair: #262a3a;
  --accent: #4f7cff;
  --accent-fonce: #3a63d8;
  --fond: #f2f4fa;
  --carte: #ffffff;
  --texte: #23263a;
  --muted: #7a7f96;
  --bordure: #e3e6f0;
  --rouge: #c0392b;
  --vert: #1e8e4f;
  --orange: #d98e04;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Calibri", "Arial", sans-serif;
  background: var(--fond);
  color: var(--texte);
  font-size: 15px;
}

.layout { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: #cdd1e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--sidebar-clair);
}
.logo-icone {
  font-size: 26px;
  background: var(--accent);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.logo-titre { font-weight: 700; color: #fff; font-size: 16px; }
.logo-sous-titre { font-size: 11.5px; color: var(--muted); }

.sidebar-nav { padding: 14px 10px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin: 3px 0;
  border-radius: 9px;
  color: #b9bdd4;
  text-decoration: none;
  font-size: 14.5px;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--sidebar-clair); color: #fff; }
.sidebar-nav a.actif { background: var(--accent); color: #fff; }
.nav-icone { width: 18px; text-align: center; }

.sidebar-pied {
  padding: 16px 20px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--sidebar-clair);
  line-height: 1.5;
}

.sidebar-bas { padding: 8px 10px; border-top: 1px solid var(--sidebar-clair); }
.sidebar-bas a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 2px 0;
  border-radius: 9px;
  color: #b9bdd4;
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.sidebar-bas a:hover { background: var(--sidebar-clair); color: #fff; }
.sidebar-bas a.actif { background: var(--accent); color: #fff; }

/* ---- Page de connexion ---- */
.page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1d29 0%, #26304d 100%);
}
.carte-login {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .35);
  padding: 38px 42px;
  width: 380px;
  max-width: 92vw;
  text-align: center;
}
.carte-login h1 { font-size: 22px; margin: 12px 0 4px; }
.carte-login .formulaire { text-align: left; margin-top: 18px; }
.login-logo {
  font-size: 28px;
  background: var(--accent);
  color: #fff;
  width: 58px; height: 58px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.btn-plein { display: block; width: 100%; text-align: center; padding: 11px; }

/* ---- Documents ---- */
.encadre-aide {
  border-left: 4px solid var(--accent);
  font-size: 14px;
  line-height: 1.6;
}
.grille-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.doc-carte {
  border: 1px solid var(--bordure);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.doc-apercu {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: #f4f6fb;
  overflow: hidden;
}
.doc-apercu img { width: 100%; height: 100%; object-fit: cover; }
.doc-icone { font-size: 44px; }
.doc-infos { padding: 10px 12px; font-size: 13px; }
.doc-nom { font-weight: 600; word-break: break-all; margin-bottom: 6px; }
.doc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.doc-note { color: var(--texte); margin-bottom: 4px; }
.doc-date { font-size: 12px; margin-bottom: 8px; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-attente { background: #fdf1e0; color: var(--orange); }
.badge-integre { background: #e6f7ee; color: var(--vert); }

/* ---- Contenu ---- */
.contenu { flex: 1; padding: 28px 34px 60px; max-width: 1200px; }

.page-entete {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.page-entete h1 { margin: 0 0 4px; font-size: 26px; }
.entete-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nav-annees { display: flex; gap: 6px; }

.muted { color: var(--muted); }
.fort { font-weight: 700; }

/* ---- Flash ---- */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash-succes { background: #e3f5ea; color: var(--vert); border: 1px solid #bfe6cd; }
.flash-erreur { background: #fdecea; color: var(--rouge); border: 1px solid #f5c6c0; }

/* ---- Cartes statistiques ---- */
.cartes-stats { display: flex; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.carte-stat {
  background: var(--carte);
  border-radius: 14px;
  padding: 18px 24px;
  box-shadow: 0 2px 10px rgba(26, 29, 41, .06);
  flex: 1;
  min-width: 180px;
  border-left: 4px solid var(--accent);
}
.carte-stat.stat-vert { border-left-color: var(--vert); }
.carte-stat.stat-rouge { border-left-color: var(--rouge); }
.stat-valeur { font-size: 22px; font-weight: 700; }
.stat-libelle { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---- Cartes génériques ---- */
.carte {
  background: var(--carte);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 10px rgba(26, 29, 41, .06);
  margin-bottom: 22px;
}
.carte h2 { font-size: 16px; margin: 4px 0 12px; }
.carte h2:not(:first-child) { margin-top: 22px; }

.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.carte-copro { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
a.carte-copro:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,29,41,.12); }
.carte-copro h3 { margin: 10px 0 4px; font-size: 16px; }
.carte-copro p { margin: 3px 0; font-size: 13.5px; }
.carte-copro-tete { display: flex; justify-content: space-between; align-items: center; }
.tantiemes { color: var(--muted); font-size: 13px; }
.contact { color: var(--texte); }

.deux-colonnes { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .deux-colonnes { grid-template-columns: 1fr; } }

.fiche { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 10px; }
.fiche dt { color: var(--muted); font-size: 13px; }
.fiche dd { margin: 0; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-bat-a { background: #e8f0ff; color: var(--accent-fonce); }
.badge-bat-b { background: #e6f7ee; color: var(--vert); }
.badge-bat-c { background: #fdf1e0; color: var(--orange); }
.badge-cle { background: #eef1fb; color: var(--accent-fonce); }
.badge-manuel { background: #f3e9fb; color: #7a3ea8; }

/* ---- Tableaux ---- */
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--bordure);
}
.tableau td { padding: 9px 10px; border-bottom: 1px solid var(--bordure); }
.tableau tbody tr:nth-child(even):not(.detail) { background: #fafbfe; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; }
.tableau .actions { text-align: right; white-space: nowrap; }
.ligne-total td { font-weight: 700; background: #f2f4fa; }
.ligne-cliquable { cursor: pointer; }
.ligne-cliquable:hover td { background: #f4f6ff; }
tr.detail { display: none; }
tr.detail.ouvert { display: table-row; }
tr.detail > td { background: #f8f9fd; padding: 10px 18px; }
.tableau-detail { font-size: 13px; }
.solde-du { color: var(--rouge); }
.solde-ok { color: var(--vert); }
.lien-nom { color: var(--texte); font-weight: 600; text-decoration: none; }
.lien-nom:hover { color: var(--accent); }

/* ---- Boutons ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid var(--bordure);
  background: #fff;
  color: var(--texte);
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #f0f2fa; }
.btn-principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-principal:hover { background: var(--accent-fonce); }
.btn-petit { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { color: var(--rouge); border-color: #f0c6c0; }
.btn-danger:hover { background: #fdecea; }

/* ---- Formulaires ---- */
.formulaire label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.formulaire input, .formulaire select, .formulaire textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--texte);
  background: #fff;
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .15);
}
.form-ligne { display: flex; gap: 14px; flex-wrap: wrap; }
.form-ligne label { flex: 1; min-width: 140px; }
.form-ligne label.grand { flex: 2; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.carte-form { max-width: 760px; }
.form-inline { display: inline-flex; gap: 6px; align-items: center; }
.champ-petit {
  width: 90px;
  padding: 5px 8px;
  border: 1px solid var(--bordure);
  border-radius: 7px;
  font-size: 13px;
  text-align: right;
}
.fieldset-manuel {
  border: 1px dashed var(--bordure);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.fieldset-manuel legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.grille-manuel { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; }
.grille-manuel label { margin-bottom: 6px; }

.selecteur-annee { display: flex; align-items: center; gap: 8px; }
.selecteur-annee select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--bordure);
  font-size: 14px;
  background: #fff;
}

/* ---- Document appel de charges ---- */
.document {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(26, 29, 41, .06);
  padding: 34px 40px;
  max-width: 880px;
}
.doc-entete {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.doc-titre { font-size: 20px; font-weight: 700; }
.doc-dest { text-align: right; font-size: 14px; line-height: 1.55; }
.doc-h2 {
  font-size: 15px;
  background: #eef1fb;
  border-left: 4px solid var(--accent);
  padding: 7px 12px;
  border-radius: 0 8px 8px 0;
  margin: 26px 0 10px;
}
.encadre {
  background: #f6f8ff;
  border: 1px solid #dde4fb;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}
.tableau-synthese td:first-child { font-weight: 600; }
.ligne-solde td { font-size: 16px; padding: 12px 10px; }
.doc-pied { margin-top: 26px; font-size: 12.5px; }

/* ---- Impression ---- */
@media print {
  .sidebar, .page-entete .entete-actions, .flash { display: none !important; }
  .contenu { padding: 0; max-width: none; }
  .document { box-shadow: none; border-radius: 0; padding: 10px; }
  body { background: #fff; }
}

@media (max-width: 760px) {
  .sidebar { width: 64px; }
  .sidebar-logo div, .sidebar-pied { display: none; }
  .sidebar-nav a, .sidebar-bas a { justify-content: center; font-size: 0; gap: 0; }
  .sidebar-nav .nav-icone, .sidebar-bas .nav-icone { font-size: 16px; }
  .contenu { padding: 18px; }
}
