/* ============================================================
   CinéAsso — Feuille de styles principale
   Charte : #9E2929 / #000000 / #FFFFFF
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #9E2929;
  --red-dk:     #6B1A1A;
  --red-lt:     #C84444;
  --red-faint:  #fdf0f0;
  --black:      #000000;
  --gray-900:   #111111;
  --gray-700:   #333333;
  --gray-500:   #666666;
  --gray-300:   #CCCCCC;
  --gray-100:   #F5F5F5;
  --white:      #FFFFFF;
  --green:      #1a6b2f;
  --green-bg:   #e8f5e9;
  --font:       'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius:     6px;
  --radius-lg:  10px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 3px 10px rgba(0,0,0,0.1);
  --transition: .15s ease;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--black);
  border-bottom: 2px solid var(--red);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 20px;
  display: flex; align-items: center; gap: 20px;
  height: 52px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--white) !important;
  text-decoration: none !important;
  font-weight: 700; font-size: 1rem; letter-spacing: .02em;
  flex-shrink: 0;
}
.brand-icon {
  width: 30px; height: 30px;
  background: var(--red); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.brand-icon svg { width: 18px; height: 18px; color: var(--white); }
.nav-links {
  display: flex; gap: 4px; flex: 1;
}
.nav-link {
  color: rgba(255,255,255,.6) !important;
  text-decoration: none !important;
  padding: 6px 12px; border-radius: var(--radius);
  font-size: .875rem; transition: var(--transition);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.nav-link:hover { color: var(--white) !important; }
.nav-link.active { color: var(--white) !important; border-bottom-color: var(--red); }
.nav-user {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.user-name { font-size: .8rem; color: rgba(255,255,255,.7); }
.user-role {
  font-size: .7rem; padding: 2px 7px; border-radius: 20px;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.6);
}
.user-role.role-admin, .user-role.role-bureau {
  background: var(--red); color: var(--white); opacity: .9;
}
.nav-icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5) !important; transition: var(--transition);
}
.nav-icon-btn:hover { background: rgba(255,255,255,.1); color: var(--white) !important; text-decoration: none !important; }
.nav-icon-btn svg { width: 18px; height: 18px; }

/* ── Layout ──────────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 28px 20px;
  width: 100%;
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--black); }
.page-subtitle { font-size: .875rem; color: var(--gray-500); margin-top: 2px; }
.site-footer {
  background: var(--black); color: rgba(255,255,255,.3);
  text-align: center; padding: 12px; font-size: .75rem;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card-sm { padding: 14px 18px; }
.card-hover { transition: var(--transition); cursor: pointer; }
.card-hover:hover { border-color: var(--red); box-shadow: var(--shadow-md); }

/* ── Formulaires ─────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: 5px; letter-spacing: .03em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: .875rem; font-family: var(--font);
  background: var(--white); color: var(--gray-900);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(158,41,41,.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--gray-500); margin-top: 4px; }

/* ── Boutons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: var(--transition);
  border: 1.5px solid transparent; text-decoration: none !important;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--red-lt); border-color: var(--red-lt); color: var(--white) !important; }
.btn-secondary { background: transparent; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { border-color: var(--gray-500); color: var(--black) !important; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white) !important; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-icon { padding: 6px 8px; }
.btn svg { width: 15px; height: 15px; }

/* ── Badges & statuts ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
}
.badge-open    { background: #e8f5e9; color: var(--green); }
.badge-closed  { background: #fdecea; color: var(--red-dk); }
.badge-draft   { background: #fff8e1; color: #7a5c00; }
.badge-archive { background: var(--gray-100); color: var(--gray-500); }
.badge-red     { background: var(--red); color: var(--white); }
.badge-dot::before { content: '●'; font-size: .6em; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--black); color: rgba(255,255,255,.75);
  padding: 10px 12px; text-align: left;
  font-size: .75rem; font-weight: 600; letter-spacing: .05em;
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--red-faint); }
.mono { font-family: 'Courier New', monospace; font-size: .78rem; color: var(--gray-500); }

/* ── Alertes ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .875rem; margin-bottom: 16px;
  border-left: 3px solid;
}
.alert-error   { background: #fdecea; color: var(--red-dk); border-color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.alert-info    { background: #e8f0fe; color: #1a3a8a; border-color: #3a5fd9; }
.alert-warn    { background: #fff8e1; color: #7a5c00; border-color: #e8a000; }

/* ── Vote UI ─────────────────────────────────────────────── */
.vote-buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vote-btn {
  padding: 6px 16px; border-radius: 20px;
  font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  border: 1.5px solid var(--gray-300);
  background: transparent; color: var(--gray-700); font-family: var(--font);
}
.vote-btn:hover { border-color: var(--red); color: var(--red); }
.vote-btn.v-pour   { border-color: var(--green); color: var(--green); }
.vote-btn.v-pour.voted, .vote-btn.v-pour:active
                   { background: var(--green); color: var(--white); }
.vote-btn.v-contre { border-color: var(--red); color: var(--red); }
.vote-btn.v-contre.voted, .vote-btn.v-contre:active
                   { background: var(--red); color: var(--white); }
.vote-btn.v-abst.voted { background: var(--gray-300); color: var(--gray-700); }
.vote-btn:disabled { opacity: .5; cursor: not-allowed; }

.vote-bar-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.vote-bar-track {
  flex: 1; height: 6px; background: var(--gray-100);
  border-radius: 3px; overflow: hidden;
}
.vote-bar-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width .4s; }
.vote-count { font-size: .78rem; color: var(--gray-500); white-space: nowrap; }

/* ── Hash pill ───────────────────────────────────────────── */
.hash-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 4px;
  background: var(--gray-100); border: 1px solid var(--gray-300);
  font-family: 'Courier New', monospace; font-size: .72rem; color: var(--gray-500);
}
.hash-pill-ok { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.hash-pill-err { border-color: var(--red); color: var(--red); background: #fdecea; }

/* ── Stat cards ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border: 1px solid var(--gray-300);
  border-radius: var(--radius); padding: 14px 18px;
}
.stat-label { font-size: .75rem; color: var(--gray-500); margin-bottom: 4px; }
.stat-val { font-size: 1.6rem; font-weight: 700; color: var(--black); }
.stat-card-red { border-left: 3px solid var(--red); }

/* ── Upload zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-lg);
  padding: 28px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--white);
}
.upload-zone:hover { border-color: var(--red); background: var(--red-faint); }
.upload-zone input[type=file] { display: none; }
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-label { font-size: .875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.upload-hint  { font-size: .78rem; color: var(--gray-500); }

/* ── Sections & séparateurs ──────────────────────────────── */
.section-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--gray-500); text-transform: uppercase;
  margin-bottom: 12px; margin-top: 4px;
}
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 20px 0; }

/* ── Toast notification ──────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--black); color: var(--white);
  padding: 10px 18px; border-radius: var(--radius);
  font-size: .8rem; border-left: 3px solid var(--red);
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 999;
}
#toast.show { opacity: 1; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--black); padding: 20px;
}
.auth-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 40px; width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.auth-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
}
.auth-logo-icon {
  width: 38px; height: 38px; background: var(--red); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 22px; height: 22px; color: var(--white); }
.auth-title { font-size: 1.1rem; font-weight: 700; }
.auth-subtitle { font-size: .8rem; color: var(--gray-500); }

/* ── Proposition card ────────────────────────────────────── */
.prop-card {
  background: var(--white); border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg); padding: 18px 22px;
  margin-bottom: 14px; transition: var(--transition);
}
.prop-card:hover { border-color: #ccc; box-shadow: var(--shadow); }
.prop-num { font-size: .72rem; color: var(--gray-500); letter-spacing: .06em; margin-bottom: 4px; }
.prop-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.prop-desc { font-size: .85rem; color: var(--gray-700); line-height: 1.5; margin-bottom: 14px; }
.prop-meta-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.avis-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-100); }
.avis-title { font-size: .78rem; font-weight: 600; color: var(--gray-500); margin-bottom: 8px; }
.avis-item {
  background: var(--gray-100); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 6px; font-size: .82rem;
}
.avis-author { font-weight: 600; color: var(--gray-700); margin-bottom: 2px; font-size: .75rem; }

/* ── Doc type tags ───────────────────────────────────────── */
.doc-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: .72rem; font-weight: 600;
}
.tag-statuts             { background: #e8f0fe; color: #1a3a8a; }
.tag-contrat_travail     { background: #fff3e0; color: #7a3d00; }
.tag-contrat_benevolat   { background: #fff3e0; color: #7a3d00; }
.tag-contrat_volontariat { background: #fff3e0; color: #7a3d00; }
.tag-registre_special    { background: #f3e5f5; color: #5a1a7a; }
.tag-comptabilite        { background: var(--green-bg); color: var(--green); }
.tag-compte_rendu_ag     { background: #fce4ec; color: #7a1a3a; }
.tag-reglement_interieur { background: #e0f7fa; color: #00636a; }
.tag-autre               { background: var(--gray-100); color: var(--gray-500); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .main-content { padding: 16px 12px; }
  .auth-card { padding: 24px 20px; }
  .nav-links { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
