/* ===== VARIABLES ===== */
:root {
  --header-h: 108px; /* topbar (~62px) + subbar (~46px) */
}

/* ===== LAYOUT FIXE ===== */

/* Header collé en haut, toujours visible */
.mbsh-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1030;
}

/* Le body ne scroll pas — seuls sidebar et content scrollent */
body#page-top {
  overflow: hidden;
  padding-top: var(--header-h); /* pousse #wrapper sous le header */
}

/* Wrapper occupe exactement la hauteur restante */
#wrapper {
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* Sidebar : repositionnée sous le header, scroll vertical propre */
.sidebar {
  top: var(--header-h) !important;
  height: calc(100vh - var(--header-h)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: none !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}

/* Content wrapper : hauteur bornée, pas de scroll propre */
#content-wrapper {
  height: 100%;
  overflow: hidden;
}

/* #content : scroll vertical indépendant */
#content {
  flex: 1 1 auto;
  overflow-y: auto !important;
  height: calc(100% - 42px); /* 42px = hauteur footer sticky */
}

/* ===== ===== */

.tabPaiement{
    font-size: 10px;
    color: black;
}

/* ===== MBSH HEADER ===== */
.mbsh-topbar {
  background: linear-gradient(135deg, #003366 0%, #005599 100%) !important;
  padding-top: .6rem;
  padding-bottom: .6rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.25) !important;
}

.mbsh-logo {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}

.mbsh-brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff !important;
  text-transform: uppercase;
}

/* Lien guide utilisateur */
.mbsh-guide-link {
  color: rgba(255,255,255,.85) !important;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: .4rem;
  padding: .35rem .75rem !important;
  transition: background .2s, color .2s;
  font-size: .85rem;
}
.mbsh-guide-link:hover {
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.4);
}
.mbsh-guide-link i { font-size: .9rem; }

/* Dropdown utilisateur */
.mbsh-topbar .nav-link {
  color: rgba(255,255,255,.9) !important;
  transition: color .2s;
}
.mbsh-topbar .nav-link:hover {
  color: #fff !important;
}
.mbsh-topbar .dropdown-menu {
  border: none;
  border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  min-width: 180px;
}
.mbsh-topbar .dropdown-item {
  font-size: .88rem;
  padding: .55rem 1rem;
  transition: background .15s;
}
.mbsh-topbar .dropdown-item:hover {
  background-color: #e8f0fe;
  color: #003366;
}

/* ===== SUBBAR ===== */
.mbsh-subbar {
  background: linear-gradient(90deg, #0b4f8a 0%, #1565c0 100%);
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.mbsh-subnav .nav-link {
  color: rgba(255,255,255,.88);
  padding: .5rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  border-radius: .3rem;
  transition: background .2s, color .2s;
}

.mbsh-subnav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.15);
  text-decoration: none;
}

.mbsh-subnav .nav-link.active {
  color: #fff;
  font-weight: 700;
  background: rgba(255,255,255,.2);
  border-bottom: 2px solid #fff;
}

/* ===== SIDEBAR ===== */
.sidebar {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(100vh - 108px) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.3);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

/* Sidebar background modernisé */
.sidebar.sidebar-dark {
  background: linear-gradient(180deg, #003366 0%, #004a8f 60%, #0b5ea8 100%) !important;
}

/* Nav items sidebar */
.sidebar .nav-item .nav-link {
  padding: .75rem 1rem;
  border-radius: .4rem;
  margin: .1rem .5rem;
  transition: background .2s, transform .1s;
  font-size: .9rem;
}

.sidebar .nav-item .nav-link:hover {
  background: rgba(255,255,255,.12);
  transform: translateX(2px);
}

.sidebar .nav-item .nav-link i {
  color: rgba(255,255,255,.75);
}

/* Sous-menu (collapse items) */
.collapse-inner {
  border-radius: .5rem !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: .4rem !important;
}

.collapse-item {
  border-radius: .35rem;
  padding: .45rem .85rem !important;
  font-size: .85rem !important;
  color: #2d4a7a !important;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: background .15s, color .15s;
}

.collapse-item i {
  width: 16px;
  text-align: center;
  color: #0b4f8a;
  font-size: .8rem;
}

.collapse-item:hover {
  background: #e8f0fe !important;
  color: #003366 !important;
}

.collapse-item.active {
  background: #d0e4ff !important;
  color: #003366 !important;
  font-weight: 600;
}

/* ===== CARD CONTENT ===== */
.card {
  border: none !important;
  border-radius: .75rem !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.08) !important;
}

.card-header {
  background: linear-gradient(90deg, #f8f9ff, #eef3ff) !important;
  border-bottom: 1px solid #dde8ff !important;
  border-radius: .75rem .75rem 0 0 !important;
  padding: .9rem 1.25rem !important;
}

.card-header h6 {
  color: #003366;
  font-weight: 700;
  font-size: .95rem;
}

/* ===== PAGE HEADING ===== */
#content .h3 {
  color: #003366;
  font-weight: 700;
}

/* ===== FOOTER ===== */
.sticky-footer {
  background: linear-gradient(90deg, #f4f7ff, #eef3ff) !important;
  border-top: 1px solid #dde8ff;
  font-size: .82rem;
  color: #555;
}

/* ===== SCROLL TO TOP ===== */
.scroll-to-top {
  background: linear-gradient(135deg, #003366, #0b5ea8);
  box-shadow: 0 3px 10px rgba(0,51,102,.4);
  transition: transform .2s;
}
.scroll-to-top:hover {
  transform: translateY(-2px);
}

/* ===== FOND FILIGRANE ===== */
.fond-mbsh {
  position: relative;
  background-color: #ffffff;
}

.fond-mbsh::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url('img/MBSH.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
  opacity: 0.05;
  pointer-events: none;
}

/* ===== LOGIN PAGE ===== */
.bg-login-image {
  background: url("../img/mn_logo.jpg");
  background-position: center;
  background-size: cover;
}

.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #001f4d 0%, #003d8f 50%, #0b5ea8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  border: none !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.3) !important;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
}

.login-left-panel {
  background: linear-gradient(160deg, #002b5e 0%, #0057b8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
}

.login-left-panel::before {
  content: "";
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  top: -80px; right: -80px;
}

.login-left-panel::after {
  content: "";
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  bottom: -50px; left: -50px;
}

.login-logo {
  width: 90px;
  height: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
  position: relative;
  z-index: 1;
}

.login-brand {
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.login-tagline {
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  text-align: center;
  margin-top: .5rem;
  position: relative;
  z-index: 1;
}

.login-right-panel {
  padding: 2.5rem 2.5rem;
  background: #fff;
}

.login-right-panel h2 {
  color: #003366;
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: .4rem;
}

.login-right-panel .login-subtitle {
  color: #888;
  font-size: .88rem;
  margin-bottom: 1.8rem;
}

.login-right-panel .form-control {
  border-radius: .5rem;
  border: 1.5px solid #d0d8e8;
  padding: .65rem 1rem;
  font-size: .92rem;
  transition: border-color .2s, box-shadow .2s;
}

.login-right-panel .form-control:focus {
  border-color: #0057b8;
  box-shadow: 0 0 0 .2rem rgba(0,87,184,.15);
}

.login-right-panel label {
  font-size: .85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: .3rem;
}

.login-right-panel .input-group-text {
  background: #f0f4ff;
  border: 1.5px solid #d0d8e8;
  border-radius: .5rem 0 0 .5rem;
  color: #0057b8;
}

.btn-login {
  background: linear-gradient(135deg, #003366, #0057b8);
  color: #fff;
  border: none;
  border-radius: .55rem;
  padding: .7rem 1.5rem;
  font-weight: 700;
  font-size: .95rem;
  width: 100%;
  letter-spacing: .5px;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 14px rgba(0,51,102,.3);
}

.btn-login:hover {
  opacity: .92;
  transform: translateY(-1px);
  color: #fff;
}

.login-footer-note {
  text-align: center;
  font-size: .78rem;
  color: #aaa;
  margin-top: 2rem;
}

/* ================================================================
   CRUD — STYLES GLOBAUX
   ================================================================ */

/* ── Message de confirmation flash ── */
.mbsh-flash {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1.1rem;
  border-radius: .55rem;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: none;
}
.mbsh-flash-success {
  background: #d1f5e0;
  color: #0a5c30;
  border-left: 4px solid #1aaf5d;
}
.mbsh-flash-warning {
  background: #fff4d6;
  color: #7a5000;
  border-left: 4px solid #f5a623;
}
.mbsh-flash-error {
  background: #fde8e8;
  color: #7a1a1a;
  border-left: 4px solid #e53935;
}

/* ── Carte filtre (border-left-warning) ── */
.card.border-left-warning {
  border-left: 4px solid #f6c23e !important;
  border-radius: .75rem !important;
}
.card.border-left-primary {
  border-left: 4px solid #4e73df !important;
  border-radius: .75rem !important;
}
.card.border-left-success {
  border-left: 4px solid #1cc88a !important;
  border-radius: .75rem !important;
}

/* ── En-têtes de carte filtre ── */
.card-header h6.text-warning { color: #b8860b !important; }
.card-header h6.text-success { color: #0a6640 !important; }

/* ── Formulaires CRUD ── */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label.control-label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: #3a4a6b;
  margin-bottom: .3rem;
  letter-spacing: .2px;
}

.form-group label.control-label .text-danger {
  font-size: .9rem;
  margin-right: .2rem;
}

.form-control {
  border: 1.5px solid #d0d8ee !important;
  border-radius: .45rem !important;
  font-size: .88rem !important;
  padding: .5rem .85rem !important;
  color: #2d3a55 !important;
  background-color: #fafbff !important;
  transition: border-color .2s, box-shadow .2s !important;
}

.form-control:focus {
  border-color: #4e73df !important;
  box-shadow: 0 0 0 .2rem rgba(78,115,223,.15) !important;
  background-color: #fff !important;
}

select.form-control {
  appearance: auto;
}

/* Zone pièce jointe */
input[type="file"].form-control {
  padding: .4rem .65rem !important;
  background: #f4f6ff !important;
  border-style: dashed !important;
  cursor: pointer;
}
input[type="file"].form-control:hover {
  border-color: #4e73df !important;
  background: #eef1ff !important;
}

/* Note sous le file input */
.form-group p {
  font-size: .77rem;
  color: #888;
  margin-top: .25rem;
  margin-bottom: 0;
}

/* Erreur de validation */
.form-group .text-danger {
  font-size: .78rem;
  display: block;
  margin-top: .2rem;
}

/* ── Boutons d'action du formulaire ── */
.crud-actions {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding-top: .8rem;
  border-top: 1px solid #e8edf8;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

/* Boutons généraux */
.btn-ar {
  border-radius: .45rem !important;
  font-size: .85rem !important;
  font-weight: 600 !important;
  padding: .48rem 1.1rem !important;
  letter-spacing: .2px;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-ar:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.btn-ar.btn-primary {
  background: linear-gradient(135deg, #4e73df, #224abe) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(78,115,223,.35);
}
.btn-ar.btn-warning {
  background: linear-gradient(135deg, #f6c23e, #d4a017) !important;
  border: none !important;
  color: #fff !important;
}
.btn-ar.btn-info {
  background: linear-gradient(135deg, #36b9cc, #1a8a9b) !important;
  border: none !important;
  color: #fff !important;
}
.btn-ar.btn-success {
  background: linear-gradient(135deg, #1cc88a, #0f8a5f) !important;
  border: none !important;
  color: #fff !important;
}
.btn-ar.btn-danger {
  background: linear-gradient(135deg, #e74a3b, #b52a1d) !important;
  border: none !important;
  color: #fff !important;
}

/* ── Boutons action dans les tableaux ── */
.btn-circle {
  border-radius: .4rem !important;
  width: auto !important;
  height: auto !important;
  padding: .3rem .55rem !important;
  font-size: .75rem !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: transform .1s, box-shadow .15s;
}
.btn-circle:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.btn-circle.btn-success  { background: linear-gradient(135deg,#1cc88a,#0f8a5f)!important; border:none!important; color:#fff!important; }
.btn-circle.btn-primary  { background: linear-gradient(135deg,#4e73df,#224abe)!important; border:none!important; color:#fff!important; }
.btn-circle.btn-warning  { background: linear-gradient(135deg,#f6c23e,#c89a00)!important; border:none!important; color:#fff!important; }
.btn-circle.btn-danger   { background: linear-gradient(135deg,#e74a3b,#b52a1d)!important; border:none!important; color:#fff!important; }
.btn-circle.btn-info     { background: linear-gradient(135deg,#36b9cc,#1a8a9b)!important; border:none!important; color:#fff!important; }

/* Groupe de boutons action dans les cellules */
td .btn-circle + .btn-circle { margin-left: .2rem; }

/* ── Tableaux CRUD ── */
.table {
  font-size: .85rem !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.table thead th {
  background: linear-gradient(135deg, #3a5abf, #4e73df) !important;
  color: #fff !important;
  font-size: .78rem !important;
  font-weight: 700 !important;
  letter-spacing: .4px !important;
  text-transform: uppercase !important;
  border: none !important;
  padding: .65rem .85rem !important;
  white-space: nowrap;
}

.table thead th:first-child { border-radius: .5rem 0 0 0; }
.table thead th:last-child  { border-radius: 0 .5rem 0 0; }

.table tbody tr {
  transition: background .12s;
}
.table tbody tr:hover td {
  background-color: #f0f4ff !important;
}

.table tbody td {
  vertical-align: middle !important;
  border-color: #e8edf5 !important;
  padding: .55rem .85rem !important;
  color: #2d3a55;
}

.table-bordered {
  border: 1px solid #e8edf5 !important;
  border-radius: .5rem;
  overflow: hidden;
}

/* Badge statut dans les tableaux */
.badge-statut {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 2rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .3px;
}

/* État vide */
.mbsh-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #8a9bb5;
}
.mbsh-empty-state i {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
  opacity: .4;
}
.mbsh-empty-state p {
  font-size: .9rem;
  margin: 0;
}

/* ── Bouton "Ajouter" dans le sous-titre de carte ── */
.card-header .btn {
  font-size: .8rem !important;
  padding: .3rem .8rem !important;
  border-radius: .4rem !important;
  font-weight: 600 !important;
}

/* ── Séparateur de formulaire ── */
form hr {
  border-color: #e8edf8;
  margin: 1.2rem 0;
}

/* ── Alerte globale dans les formulaires ── */
.alert-danger {
  border-radius: .5rem !important;
  border: none !important;
  border-left: 4px solid #e53935 !important;
  background: #fde8e8 !important;
  color: #7a1a1a !important;
  font-size: .88rem !important;
  padding: .7rem 1rem !important;
}
