/* ============================================================================
 *  style.css  —  Habillage « BIMA — Réservation de documents sur place »
 * ----------------------------------------------------------------------------
 *  S'appuie sur Bootstrap 5 ; ne contient que les surcharges et le thème.
 * ==========================================================================*/

:root {
  --bd-primary: #0f9d84;
  --bd-primary-dark: #0b4f4a;
  --bd-navy: #063a37;
  --bd-accent: #b8860b;
  --bd-surface: #ffffff;
  --bd-surface-2: #f8fafc;
  --bd-border: #bfe3dd;
  --bd-text: #1f2a2a;
}

body {
  background: linear-gradient(135deg, #063a37 0%, #0b4f4a 50%, #128a76 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--bd-text);
  font-size: 0.92rem;
}

/* ----------------------------- Navbar ----------------------------- */
.app-navbar {
  background: linear-gradient(90deg, var(--bd-navy), var(--bd-primary-dark));
}
.app-navbar .navbar-brand {
  font-size: 1.02rem;
  white-space: normal;
}
.navbar-logo {
  height: 40px;
  width: auto;
  filter: invert(1);
  flex-shrink: 0;
}
.navbar-title-block { display: flex; flex-direction: column; line-height: 1.25; }
.navbar-title-main { font-size: 1rem; }
.navbar-title-sub { font-size: 0.72rem; font-weight: 400; opacity: 0.8; }

/* ----------------------------- Cartes ----------------------------- */
.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(6, 58, 55, 0.18);
}
.card-header {
  background: linear-gradient(90deg, #e9fbf7, #e3f6f0);
  font-weight: 600;
  color: var(--bd-primary-dark);
  border-bottom: 1px solid var(--bd-border);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}
.card-footer { background: var(--bd-surface-2); border-top: 1px solid var(--bd-border); }

main > .d-flex .btn { box-shadow: 0 4px 12px rgba(6, 58, 55, 0.18); font-weight: 500; }

/* ----------------------------- Tableau ----------------------------- */
#dataTable { background-color: #e7f7f3; }
#dataTable thead th {
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--bd-primary-dark);
  background-color: #aee9dc !important;
}
#dataTable tbody td {
  font-size: 0.85rem; vertical-align: middle;
  background-color: #e7f7f3 !important;
}
#dataTable tbody tr:nth-child(even) td { background-color: #d7f1ea !important; }
#dataTable tbody tr:hover td { background-color: #aee9dc !important; }
#dataTable tbody tr { cursor: pointer; }

/* ----------------------------- Badges statut ----------------------------- */
.badge-active   { background-color: #0f9d84; }
.badge-expired  { background-color: #c92a2a; }
.badge-soon     { background-color: #b8860b; }

/* ----------------------------- Boutons d'action de ligne ----------------------------- */
.row-actions .btn {
  --bs-btn-padding-y: 0.1rem;
  --bs-btn-padding-x: 0.4rem;
  --bs-btn-font-size: 0.78rem;
}

/* ----------------------------- Formulaire (modale fiche) ----------------------------- */
#resaForm label { font-weight: 600; font-size: 0.82rem; margin-bottom: 0.15rem; }
.rule-banner {
  background: #fff8e6;
  border: 1px solid #f0dca0;
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  color: #6b5200;
}
.rule-banner strong { color: #5a4400; }
.doc-block {
  border: 1px dashed var(--bd-border);
  border-radius: 0.6rem;
  padding: 0.75rem;
  background: var(--bd-surface-2);
}
.doc-block .doc-num {
  font-weight: 700;
  color: var(--bd-primary-dark);
}
.niveau-check .form-check-input { width: 1.3em; height: 1.3em; }
.niveau-check .form-check-label { font-weight: 700; font-size: 1rem; padding-left: .2rem; }

/* ----------------------------- Divers ----------------------------- */
.warn-note {
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: #7a1f1f;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

/* ----------------------------- Overrides boutons Bootstrap ----------------------------- */
.btn-primary {
  --bs-btn-bg: var(--bd-primary);
  --bs-btn-border-color: var(--bd-primary);
  --bs-btn-hover-bg: #0c7d6a;
  --bs-btn-hover-border-color: #0c7d6a;
  --bs-btn-active-bg: #0a6a5a;
}
.btn-success {
  --bs-btn-bg: var(--bd-accent);
  --bs-btn-border-color: var(--bd-accent);
  --bs-btn-hover-bg: #96700a;
  --bs-btn-hover-border-color: #96700a;
  --bs-btn-active-bg: #7d5d08;
}
.btn-outline-primary {
  --bs-btn-color: var(--bd-primary);
  --bs-btn-border-color: var(--bd-primary);
  --bs-btn-hover-bg: var(--bd-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-border-color: var(--bd-primary);
}
.btn-outline-danger {
  --bs-btn-color: #c92a2a;
  --bs-btn-border-color: #c92a2a;
  --bs-btn-hover-bg: #c92a2a;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-border-color: #c92a2a;
}

/* ============================================================================
 *  FICHE IMPRIMABLE  (reproduit fidèlement le formulaire papier)
 * ==========================================================================*/
.fiche {
  background: #fff;
  color: #12343b;
  border: 2px solid #1b5e6b;
  max-width: 720px;
  margin: 0 auto;
  font-family: "Segoe UI", Arial, sans-serif;
}
.fiche .fiche-row { border-bottom: 1px solid #1b5e6b; padding: 6px 10px; }
.fiche .fiche-head { text-align: center; padding: 8px 10px 4px; }
.fiche .fiche-head .brand { font-weight: 700; color: #1b5e6b; letter-spacing: .05em; }
.fiche .fiche-title { font-size: 1.25rem; font-weight: 700; color: #12343b; }
.fiche .lbl { color: #1b5e6b; font-weight: 700; }
.fiche .fiche-niveaux { display: flex; justify-content: space-around; }
.fiche .niveau-box {
  border: 1px solid #12343b; border-radius: 3px; padding: 0 10px;
  min-width: 46px; text-align: center; font-weight: 700;
}
.fiche .niveau-box.on { background: #12343b; color: #fff; }
.fiche .doc-line { display: flex; }
.fiche .doc-line .k { color: #1b5e6b; width: 70px; flex-shrink: 0; }
.fiche .doc-line .v { border-bottom: 1px dotted #9bbfc7; flex: 1; min-height: 1.2em; }
.fiche .fiche-warn {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; padding: 6px 10px;
}
.fiche .fiche-warn .tri { color: #b8860b; font-size: 1.4rem; }

/* ----------------------------- Impression ----------------------------- */
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .modal, .modal-backdrop { position: static !important; }
  #printArea, #printArea * { visibility: visible; }
  .fiche { border-color: #000; }
}
