﻿/* =============================================================================
   Mission Report Plugin — mr.css
   Brand: #292746 navy · #ff914d orange
   ============================================================================= */

/* ─── Reset / Base ────────────────────────────────────────────────────────── */
.mr-form-wrap,
.mr-portal-wrap,
.mr-report-detail {
  max-width: 960px;
  margin: 0 auto;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: #1a1a2e;
}

.mr-form-wrap *,
.mr-portal-wrap *,
.mr-report-detail * {
  box-sizing: border-box;
}

/* ─── Scoped reset: neutralize hello-elementor / Elementor global colours ── */
/* hello-elementor/reset.css sets [type="button"] { border: 1px solid #cc3366 */
/* color: #cc3366 } and a { color: #cc3366 } with specificity (0,1,0).        */
/* Our plugin CSS loads BEFORE the theme, so equal-specificity rules lose.    */
/* Fix A — unstyled elements (no mr- class): `:not` selector, same priority. */
/* Fix B — styled elements (.mr-btn etc.): scoped prefix lifts to (0,2,0).   */

/* Fix A: naked buttons and links inherit our palette, not #cc3366 */
.mr-portal-wrap button:not([class*="mr-"]),
.mr-portal-wrap [type="button"]:not([class*="mr-"]),
.mr-portal-wrap [type="submit"]:not([class*="mr-"]) {
  border: none;
  color: inherit;
  background: none;
  border-radius: 0;
}
.mr-portal-wrap button:not([class*="mr-"]):hover,
.mr-portal-wrap button:not([class*="mr-"]):focus,
.mr-portal-wrap [type="button"]:not([class*="mr-"]):hover,
.mr-portal-wrap [type="button"]:not([class*="mr-"]):focus,
.mr-portal-wrap [type="submit"]:not([class*="mr-"]):hover,
.mr-portal-wrap [type="submit"]:not([class*="mr-"]):focus {
  background: none;
  color: inherit;
}
.mr-portal-wrap a:not([class*="mr-"]) {
  color: inherit;
  text-decoration: none;
}

/* Fix B: our styled buttons — raised to (0,2,0) to beat [type="button"] */
/* Also overrides: font-size (reset.css: 1rem), hover bg (#cc3366)        */
.mr-portal-wrap .mr-btn {
  border: 2px solid transparent;
  color: inherit;
  background: none;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
}
.mr-portal-wrap .mr-btn-primary {
  border-color: #ff914d;
  background: #ff914d;
  color: #fff;
}
.mr-portal-wrap .mr-btn-primary:hover,
.mr-portal-wrap .mr-btn-primary:focus {
  border-color: #e07a3a;
  background: #e07a3a;
  color: #fff;
}
.mr-portal-wrap .mr-btn-secondary {
  border-color: #4c4882;
  background: #4c4882;
  color: #fff;
}
.mr-portal-wrap .mr-btn-secondary:hover,
.mr-portal-wrap .mr-btn-secondary:focus {
  border-color: #393669;
  background: #393669;
  color: #fff;
}
.mr-portal-wrap .mr-btn-ghost {
  border-color: #d0cfdd;
  color: #292746;
  background: transparent;
}
.mr-portal-wrap .mr-btn-ghost:hover,
.mr-portal-wrap .mr-btn-ghost:focus {
  background: #f2f1f8;
  border-color: #b0aec8;
  color: #292746;
}
.mr-portal-wrap .mr-tab-btn {
  border: none;
  border-bottom: 3px solid transparent;
  color: #666;
  background: none;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
}
.mr-portal-wrap .mr-tab-btn:hover,
.mr-portal-wrap .mr-tab-btn:focus {
  background: rgba(41, 39, 70, 0.05);
  color: #292746;
}
.mr-portal-wrap .mr-tab-active,
.mr-portal-wrap .mr-tab-active:focus {
  border-bottom-color: #ff914d;
  color: #292746;
  background: none;
}
/* Fix: add/remove buttons — prevent theme pink on hover/focus */
.mr-portal-wrap .mr-btn-add:hover,
.mr-portal-wrap .mr-btn-add:focus {
  background: transparent;
  border-color: #ff914d;
  color: #ff914d;
}
.mr-portal-wrap .mr-btn-add-card:hover,
.mr-portal-wrap .mr-btn-add-card:focus {
  background: transparent;
  border-color: #292746;
  color: #292746;
}
.mr-portal-wrap .mr-btn-add-line:hover,
.mr-portal-wrap .mr-btn-add-line:focus {
  background: transparent;
  border-color: #292746;
  color: #292746;
}
.mr-portal-wrap .mr-line-remove:hover,
.mr-portal-wrap .mr-line-remove:focus {
  background: #fdecea;
  color: #e57373;
}
.mr-portal-wrap .mr-card-remove:hover,
.mr-portal-wrap .mr-card-remove:focus {
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Auth card ───────────────────────────────────────────────────────────── */
body:has(.mr-auth-wrap) {
  background: #f3f2f9;
}

.mr-auth-wrap {
  display: flex;
  justify-content: center;
  padding: 3.5rem 1rem 6rem;
  background: #f3f2f9;
  min-height: 100vh;
}

.mr-auth-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(41, 39, 70, 0.14);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

/* Gradient accent strip at top of card */
.mr-auth-card::before {
  content: "";
  display: none;
}

.mr-auth-logo {
  text-align: center;
  padding: 2rem 2.5rem 0.75rem;
  margin-bottom: 0;
}

.mr-auth-logo img {
  max-width: 160px;
  height: auto;
}

.mr-auth-site-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #292746;
}

.mr-auth-heading {
  text-align: center;
  padding: 0.25rem 2.5rem 1.5rem;
  border-bottom: 1px solid #f0eef8;
}

.mr-auth-heading h2 {
  color: #292746;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.mr-auth-subtitle {
  color: #8886a8;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.5;
}

/* ─── Notices ─────────────────────────────────────────────────────────────── */
.mr-notice {
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  border-left: 4px solid;
}

.mr-notice-success {
  background: #e8f8f2;
  border-color: #27ae60;
  color: #1a7a45;
}

.mr-notice-error {
  background: #fdecea;
  border-color: #e74c3c;
  color: #922b21;
}

.mr-notice-warning {
  background: #fef9e6;
  border-color: #f39c12;
  color: #7d6608;
}

/* ─── Field groups ────────────────────────────────────────────────────────── */
.mr-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.mr-field-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #292746;
}

.mr-field-group .required {
  color: #e74c3c;
}

.mr-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mr-auth-form .mr-field-group {
  margin-bottom: 1rem;
}

/* ─── Expense breakdown (per-category reconciliation) ────────────────────── */
.mr-breakdown-section {
  margin-top: 0.15rem;
  margin-bottom: 1.5rem;
  padding: 0.6rem 0.75rem 0.5rem;
  background: #f8f7fc;
  border-left: 3px solid #d0cfdd;
  border-radius: 0 6px 6px 0;
}
.mr-breakdown-tally {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mr-tally-badge {
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.78rem;
}
.mr-tally-ok {
  background: #d4edda;
  color: #1e6630;
}
.mr-tally-warn {
  background: #fff3cd;
  color: #7a5800;
}
.mr-tally-error {
  background: #f8d7da;
  color: #721c24;
}

/* ─── Auth form inner padding ─────────────────────────────────────────────── */
.mr-auth-form {
  padding: 1.5rem 2.5rem 0;
}

/* ─── Entity type toggle (segmented control) ──────────────────────────────── */
.mr-entity-toggle {
  display: flex;
  border: 2px solid #292746;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.mr-toggle-option {
  flex: 1;
  cursor: pointer;
}

.mr-toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mr-toggle-option span {
  display: block;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #292746;
  background: #fff;
  transition:
    background 0.15s,
    color 0.15s;
  user-select: none;
}

.mr-toggle-option:not(:last-child) span {
  border-right: 2px solid #292746;
}

.mr-toggle-option input[type="radio"]:checked + span {
  background: #292746;
  color: #fff;
}

/* ─── Auth footer note ────────────────────────────────────────────────────── */
.mr-auth-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  font-size: 0.76rem;
  color: #b8b4d0;
  padding: 1.25rem 2.5rem 1.75rem;
  margin: 0;
  border-top: 1px solid #f0eef8;
}

/* ─── Full-width button variants ─────────────────────────────────────────── */
.mr-btn-block,
.mr-portal-wrap .mr-btn-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* ─── SMBEH / alternate-portal link footer ───────────────────────────────── */
.mr-auth-footer {
  border-top: 1px solid #f0eef8;
  padding: 1rem 2.5rem 1.5rem;
  text-align: center;
}

.mr-portal-wrap .mr-auth-alt-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: #292746;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.75;
  transition:
    opacity 0.15s,
    color 0.15s;
}

.mr-portal-wrap .mr-auth-alt-link:hover,
.mr-portal-wrap .mr-auth-alt-link:focus {
  opacity: 1;
  color: #ff914d;
  text-decoration: none;
}

/* ─── Entity type radio (legacy — kept for compatibility) ─────────────────── */
.mr-entity-type-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.mr-radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-weight: 500;
}

/* ─── Inputs ──────────────────────────────────────────────────────────────── */
input[type="text"].mr-text-input,
input[type="text"].mr-text-input-sm,
input[type="text"].mr-text-input-inline,
input[type="text"].mr-text-input-full,
input[type="number"].mr-num-input,
input[type="number"].mr-num-input-small,
input[type="date"].mr-date-input,
select,
textarea.mr-textarea {
  border: 1.5px solid #ccc;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.95rem;
  color: #1a1a2e;
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}

input[type="text"].mr-text-input-sm,
input[type="number"].mr-num-input-small {
  width: 80px;
}

input[type="text"].mr-text-input-inline {
  width: auto;
  display: inline;
}

input[type="number"].mr-num-input {
  width: 110px;
}

input[type="text"].mr-text-input,
input[type="date"].mr-date-input,
select {
  width: auto;
  min-width: 120px;
}

input[type="text"].mr-text-input-full,
textarea.mr-textarea {
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #ff914d;
  box-shadow: 0 0 0 3px rgba(255, 145, 77, 0.18);
}

.mr-readonly-display {
  padding: 0.45rem 0.65rem;
  background: #f4f4f8;
  border-radius: 6px;
  color: #444;
  font-weight: 600;
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.mr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.mr-btn-primary {
  background: #ff914d;
  color: #fff;
  border-color: #ff914d;
}

.mr-btn-primary:hover {
  background: #e07a3a;
  border-color: #e07a3a;
}

.mr-btn-ghost {
  background: transparent;
  color: #292746;
  border-color: #ccc;
}

.mr-btn-ghost:hover {
  background: #f4f4f8;
}

.mr-btn-add {
  background: transparent;
  color: #292746;
  border: 1.5px dashed #aaa;
  margin-top: 0.5rem;
}

.mr-btn-add:hover {
  border-color: #ff914d;
  color: #ff914d;
}

/* ─── Leadership tab ──────────────────────────────────────────────────────── */
.mr-ministry-block {
  border: 1px solid #d0cfdd;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.mr-ministry-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #292746;
  padding: 0.7rem 1rem;
}

.mr-ministry-icon {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.mr-ministry-name-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.mr-ministry-name-group label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.mr-ministry-name-group input[data-field="ministere"] {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  width: 100%;
}

.mr-ministry-name-group input[data-field="ministere"]::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.mr-ministry-remove {
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Higher specificity to beat .mr-portal-wrap .mr-btn-ghost overrides */
.mr-portal-wrap .mr-ministry-header .mr-ministry-remove,
.mr-portal-wrap .mr-ministry-header .mr-ministry-remove:focus {
  color: rgba(255, 255, 255, 0.65);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
}

.mr-portal-wrap .mr-ministry-header .mr-ministry-remove:hover,
.mr-portal-wrap .mr-ministry-header .mr-ministry-remove:active {
  color: #fff;
  background: rgba(220, 53, 69, 0.35);
  border-color: rgba(220, 53, 69, 0.65);
}

.mr-leader-list {
  padding: 0.75rem 1rem 0.25rem;
  background: #f9f8ff;
}

.mr-leader-add {
  display: inline-block;
  margin: 0.25rem 1rem 0.85rem;
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
}

.mr-leader-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 0.65rem;
  align-items: end;
  background: #fff;
  border: 1px solid #eeedf5;
  border-radius: 7px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
}

.mr-leader-row:last-child {
  margin-bottom: 0;
}

.mr-leader-remove {
  align-self: flex-end;
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 6px;
  margin-bottom: 0.1rem;
}

@media (max-width: 780px) {
  .mr-ministry-header {
    flex-wrap: wrap;
  }
  .mr-leader-row {
    grid-template-columns: 1fr 1fr;
  }
  .mr-leader-remove {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.mr-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.mr-btn-large {
  padding: 0.8rem 2.5rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.mr-row-remove {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  line-height: 1;
}

.mr-row-remove:disabled {
  color: #ccc;
  cursor: default;
}

/* ─── Portal nav ──────────────────────────────────────────────────────────── */
.mr-portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(160deg, #292746 0%, #1f1d3a 100%);
  box-shadow: 0 2px 10px rgba(41, 39, 70, 0.3);
  margin-bottom: 2rem;
  margin-left: calc(-50vw + 50%);
  width: 100vw;
}

.mr-portal-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  min-height: 64px;
}

.mr-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.mr-nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.mr-nav-link {
  color: #d4d2e8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mr-nav-link:hover,
.mr-nav-active {
  background: rgba(255, 145, 77, 0.15);
  color: #ff914d;
}

.mr-nav-entity {
  color: #a8a4cc;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mr-nav-signout {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.85rem;
}

.mr-nav-signout:hover {
  color: #fff;
  text-decoration: none;
}

/* ─── Form selector (card grid) ───────────────────────────────────────────── */
.mr-form-selector {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.mr-selector-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.mr-form-selector h2,
.mr-selector-title {
  color: #292746;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.mr-selector-subtitle {
  color: #ff914d;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.mr-selector-prompt {
  color: #8886a8;
  font-size: 0.88rem;
  margin: 0;
}

.mr-selector-cards {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.mr-selector-card {
  background: #fff;
  border: 1px solid #e0dff0;
  border-radius: 14px;
  padding: 2.25rem 1.75rem 2rem;
  text-align: center;
  text-decoration: none;
  color: #292746;
  width: 240px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.15s;
  box-shadow: 0 2px 8px rgba(41, 39, 70, 0.06);
}

.mr-selector-card:hover {
  border-color: #ff914d;
  box-shadow: 0 6px 24px rgba(255, 145, 77, 0.2);
  transform: translateY(-2px);
}

.mr-selector-card-icon,
.mr-selector-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  display: block;
  color: #ff914d;
}

.mr-selector-card h3,
.mr-selector-label {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  color: #292746;
}

.mr-selector-desc {
  font-size: 0.78rem;
  color: #777;
  margin: 0;
  line-height: 1.4;
}

.mr-selector-card.mr-card-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ─── Section structure ───────────────────────────────────────────────────── */
.mr-section {
  background: #fff;
  border: 1px solid #e4e4ef;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 70px;
}

.mr-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #292746;
  border-bottom: 2px solid #f0eff8;
  padding-bottom: 0.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.mr-section-desc {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ─── Sticky section nav ──────────────────────────────────────────────────── */
.mr-section-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #f4f4f8;
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0 0 8px 8px;
  border: 1px solid #e4e4ef;
  border-top: none;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.mr-section-nav a {
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  color: #292746;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}

.mr-section-nav a:hover,
.mr-section-nav a.mr-nav-active {
  background: #292746;
  color: #fff;
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.mr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.mr-table th,
.mr-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.mr-table th {
  background: #f4f4f8;
  font-weight: 700;
  color: #292746;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mr-table tbody tr:last-child td {
  border-bottom: none;
}

.mr-subtotal-row td {
  background: #f0f0f7;
  font-weight: 600;
  border-top: 1px solid #d0d0e8;
  white-space: nowrap;
}

.mr-total-row td {
  background: #f9f9fc;
  font-weight: 700;
  border-top: 2px solid #e4e4ef;
  white-space: nowrap;
}

/* Higher specificity to beat hello-elementor reset.css zebra-stripe rule
   (table tbody > tr:nth-child(2n+1) > td = 0,1,4) */
.mr-report-detail table.mr-table tbody > tr.mr-final-balance > td,
.mr-smbeh-fin-wrap table.mr-table tbody > tr.mr-final-balance > td {
  background: #292746;
  color: #fff;
  border-radius: 4px;
}

.mr-final-balance strong {
  color: #ff914d;
}

.mr-calc-row td {
  background: #fef9f3;
}

.mr-field-calc {
  color: #292746;
  font-weight: 600;
  font-style: italic;
  white-space: nowrap;
}

.mr-sommaire-block .mr-fin-table td:first-child {
  white-space: nowrap;
  min-width: 290px;
}

/* ─── Effectif table ──────────────────────────────────────────────────────── */
.mr-effectif-table {
  max-width: 600px;
}

/* ─── Financier grid (Rentrées + Dépenses side-by-side) ───────────────────── */
.mr-financier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.mr-detail-financier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.mr-fin-block h3,
.mr-detail-financier-grid h3,
.mr-detail-financier-grid h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #292746;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.mr-fin-table {
  font-size: 0.88rem;
}

.mr-sommaire-block,
.mr-sommaire-table {
  max-width: 480px;
  margin-top: 0.5rem;
}

/* Value column in detail financial/sommaire tables: right-align, no wrap */
.mr-report-detail .mr-fin-table td:last-child,
.mr-report-detail .mr-sommaire-table td:last-child {
  white-space: nowrap;
  text-align: right;
}

/* Breakdown sub-rows in school report detail */
.mr-report-detail .mr-detail-subrow td:first-child {
  padding-left: 1.5rem;
  font-size: 0.82rem;
  color: #555;
}
.mr-report-detail .mr-detail-subrow td {
  background: #f8f7fc;
  font-size: 0.82rem;
  color: #555;
}

/* ─── ÉD dynamic rows ─────────────────────────────────────────────────────── */
.mr-dynamic-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.mr-row-template {
  display: none !important;
}

/* ─── Études bibliques sessions ───────────────────────────────────────────── */
.mr-eb-sessions {
  margin-bottom: 1rem;
}

.mr-eb-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

/* ─── Counts grid ─────────────────────────────────────────────────────────── */
.mr-counts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem 1rem;
}

/* ─── USD display ─────────────────────────────────────────────────────────── */
.mr-usd-display {
  display: inline-block;
  color: #888;
  font-size: 0.8rem;
  margin-left: 0.4rem;
  font-style: italic;
}

/* ─── HTG input with USD sibling ─────────────────────────────────────────── */
.mr-htg-input {
  width: 110px;
  vertical-align: middle;
}

/* ─── Form submit row ─────────────────────────────────────────────────────── */
.mr-form-submit {
  text-align: right;
  padding: 1.5rem 0;
  border-top: 2px solid #e4e4ef;
  margin-top: 1rem;
}

/* ─── Admin styles ────────────────────────────────────────────────────────── */
.mr-admin h1 {
  color: #292746;
}

.mr-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: #f4f4f8;
  border-radius: 8px;
}

.mr-report-table {
  background: #fff;
}

.mr-actions a {
  margin-right: 0.5rem;
  text-decoration: none;
  font-size: 0.85rem;
}

.mr-delete-link {
  color: #e74c3c !important;
}

/* ─── Missing reports grid ────────────────────────────────────────────────── */
.mr-missing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 780px) {
  .mr-missing-grid {
    grid-template-columns: 1fr;
  }
}

.mr-missing-col h3 {
  color: #292746;
  font-size: 1rem;
  border-bottom: 2px solid #e4e4ef;
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
}

.mr-ok {
  color: #ff914d;
}

.mr-warn {
  color: #e67e22;
}

/* ─── Entity admin form ───────────────────────────────────────────────────── */
.mr-entity-form-wrap {
  background: #fff;
  border: 1px solid #e4e4ef;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

/* ─── Portal / my reports ─────────────────────────────────────────────────── */
.mr-portal-title {
  font-size: 1.5rem;
  color: #292746;
  margin-bottom: 0.25rem;
}

.mr-portal-entity {
  color: #888;
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* Tabs */
.mr-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e4e4ef;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.mr-tab {
  padding: 0.65rem 1.2rem;
  text-decoration: none;
  color: #666;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s;
}

.mr-tab:hover {
  color: #292746;
}

.mr-tab-active {
  color: #292746;
  border-bottom-color: #ff914d;
}

.mr-tab-count {
  display: inline-block;
  background: #e4e4ef;
  color: #555;
  border-radius: 20px;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.mr-tab-active .mr-tab-count {
  background: #ff914d;
  color: #fff;
}

.mr-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}

.mr-reports-list-table {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

/* ─── Report detail ───────────────────────────────────────────────────────── */
.mr-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.mr-detail-title-block {
  margin-bottom: 1.5rem;
}

.mr-detail-title-block h2 {
  color: #292746;
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
}

.mr-detail-meta {
  color: #666;
  font-size: 0.9rem;
}

.mr-detail-rate {
  color: #888;
  font-size: 0.82rem;
}

/* Detail view tab panels */
.mr-dtab-panel[hidden] {
  display: none !important;
}
.mr-dtab-panel {
  padding-top: 0.5rem;
}
.mr-detail-empty {
  color: #888;
  font-style: italic;
  margin: 1rem 0;
}

.mr-detail-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #292746;
  margin-top: 1.5rem;
  border-bottom: 1px solid #e4e4ef;
  padding-bottom: 0.35rem;
}

.mr-detail-table {
  margin-bottom: 1rem;
}

.mr-detail-amount {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  white-space: nowrap;
}

.mr-detail-htg {
  font-weight: 600;
}

.mr-detail-usd {
  color: #888;
  font-size: 0.82rem;
  font-style: italic;
}

/* USD text must stay legible on the dark navy BALANCE FINALE row */
.mr-final-balance .mr-detail-usd {
  color: rgba(255, 255, 255, 0.65);
}

.mr-detail-counts {
  display: grid;
  grid-template-columns: max-content auto;
  gap: 0.3rem 1rem;
  font-size: 0.9rem;
}

.mr-detail-counts dt {
  font-weight: 600;
  color: #555;
}

/* ─── Print styles ────────────────────────────────────────────────────────── */
@media print {
  .mr-portal-nav,
  .mr-section-nav,
  .mr-btn,
  .mr-form-submit,
  .mr-no-print {
    display: none !important;
  }

  .mr-report-detail {
    max-width: 100%;
    font-size: 12px;
  }

  .mr-final-balance td {
    background: #eee !important;
    color: #000 !important;
  }

  .mr-section {
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
  }

  table {
    page-break-inside: avoid;
  }
}

/* =============================================================================
   Church Tab Form
   ============================================================================= */

/* ─── Church form wrapper ─────────────────────────────────────────────────── */
.mr-church-form-wrap {
  max-width: 900px;
  margin: 0 auto;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: #1a1a2e;
}
.mr-church-form-wrap * {
  box-sizing: border-box;
}

/* ─── Period bar ──────────────────────────────────────────────────────────── */
.mr-period-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem 1.25rem;
  background: #292746;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px 10px 0 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.mr-period-entity {
  font-weight: 700;
  font-size: 1rem;
  flex: 1 1 160px;
  letter-spacing: 0.01em;
}
.mr-period-selects {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mr-period-bar label {
  font-size: 0.85rem;
  opacity: 0.8;
  white-space: nowrap;
}
.mr-period-bar select {
  padding: 0.3rem calc(0.6rem + 5px);
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}
.mr-period-bar select option {
  color: #1a1a2e;
  background: #fff;
}

/* ─── Draft banner ────────────────────────────────────────────────────────── */
.mr-draft-banner {
  background: #f0eff8;
  border: 1px solid #d0cfdd;
  border-radius: 8px;
  padding: 0.9rem 1.25rem;
  margin: 0.75rem 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.mr-draft-banner p {
  margin: 0;
  flex: 1 1 200px;
  font-size: 0.9rem;
}
.mr-draft-banner .mr-draft-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mr-draft-continue {
  background: #292746;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}
.mr-draft-continue:hover {
  background: #3d3a6b;
}
.mr-draft-discard {
  background: transparent;
  color: #b71c1c;
  border: 1px solid #b71c1c;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.mr-draft-discard:hover {
  background: #fdecea;
}

/* ─── Tab navigation ──────────────────────────────────────────────────────── */
.mr-tab-nav {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  gap: 0;
  background: #f5f5f8;
  border-bottom: 2px solid #ddd;
}
.mr-tab-btn {
  flex: 1 1 auto;
  padding: 0.75rem 1.15rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666 !important;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition:
    color 0.15s,
    border-color 0.15s;
  position: relative;
}
.mr-tab-btn:hover {
  color: #292746 !important;
}
.mr-tab-active {
  color: #292746 !important;
  border-bottom-color: #ff914d !important;
  font-weight: 700;
}
.mr-tab-status {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: #ff914d;
  font-weight: 700;
}

/* ─── Tab panels ──────────────────────────────────────────────────────────── */
.mr-tab-panel {
  padding: 2rem 1.75rem;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-top: none;
  border-radius: 0 0 10px 10px;
  min-height: 280px;
}
.mr-tab-header {
  margin: 0 0 1.5rem 0;
}
.mr-tab-header h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #292746;
  margin: 0 0 0.4rem 0;
  line-height: 1.2;
}
.mr-tab-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #777;
  line-height: 1.5;
}

/* ─── Instructions box (Culte / ED / EB 4-card requirement) ─────────────── */
.mr-instructions {
  background: #f0f4ff;
  border-left: 4px solid #292746;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  font-size: 0.87rem;
  color: #333;
  line-height: 1.6;
}
.mr-instructions strong {
  color: #292746;
}
.mr-instructions ul {
  margin: 0.4rem 0 0 1.1rem;
  padding: 0;
}
.mr-instructions ul li {
  margin-bottom: 0.2rem;
}
.mr-instructions .mr-min-badge {
  display: inline-block;
  background: #292746;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.1em 0.55em;
  border-radius: 3px;
  margin-left: 0.3em;
}

/* ─── Alert box (submit incomplete) ─────────────────────────────────────── */
.mr-alert {
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.mr-alert-error {
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  border-left: 4px solid #d9534f;
  color: #7b2020;
}
.mr-alert-error strong {
  color: #c0392b;
}
.mr-alert-error ul {
  margin: 0.4rem 0 0 1.1rem;
  padding: 0;
}
.mr-alert-error ul li {
  margin-bottom: 0.2rem;
}

/* ─── Tab footer (save row) ──────────────────────────────────────────────── */
.mr-tab-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}
.mr-save-tab {
  background: #292746;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.mr-save-tab:hover {
  background: #3d3a6b;
}
.mr-save-status {
  font-size: 0.82rem;
  color: #777;
  font-style: italic;
}

/* ─── Effectif table ─────────────────────────────────────────────────────── */
.mr-effectif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.mr-effectif-table th,
.mr-effectif-table th,
.mr-effectif-table td {
  padding: 0.5rem 0.6rem;
  border: 1px solid #e0e0e0;
  text-align: center;
}
.mr-effectif-table th {
  background: #f5f5f8;
  font-weight: 600;
  color: #292746;
  white-space: nowrap;
}
.mr-effectif-table td:first-child,
.mr-effectif-table th:first-child {
  text-align: left;
  font-weight: 500;
  min-width: 200px;
  white-space: nowrap;
}
.mr-effectif-table .mr-eff-input {
  width: 70px;
  padding: 0.3rem 0.4rem;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
}
.mr-eff-total {
  font-weight: 700;
  background: #fafafa;
}
.mr-grand-total-row td {
  background: #292746 !important;
  color: #fff !important;
  font-weight: 700;
}

/* ─── Service cards (Culte / ÉD / ÉB) ───────────────────────────────────── */
.mr-service-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.mr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #292746;
  color: #fff;
  padding: 0.7rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.mr-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mr-card-num-label {
  opacity: 0.7;
  font-weight: 400;
}
.mr-card-remove {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 5px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
}
.mr-card-remove:hover {
  background: rgba(255, 255, 255, 0.15);
}
.mr-card-body {
  padding: 1.1rem;
}
.mr-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.85rem 1.1rem;
  padding: 1.1rem 1.1rem 0.5rem;
}
/* École du Dimanche: 4-col grid with 2-col spans for first two rows */
.mr-ed-grid {
  grid-template-columns: repeat(4, 1fr);
}
.mr-ed-span2 {
  grid-column: span 2;
}
.mr-card-field label,
.mr-field-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.2rem;
}
.mr-card-field input,
.mr-card-field textarea,
.mr-field-group input,
.mr-field-group textarea,
.mr-field-group select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.88rem;
  background: #fff;
  transition: border-color 0.15s;
}
.mr-card-field input:focus,
.mr-card-field textarea:focus,
.mr-field-group input:focus,
.mr-field-group textarea:focus {
  outline: none;
  border-color: #292746;
}
.mr-card-field.mr-card-field-wide,
.mr-field-group.mr-field-wide {
  grid-column: 1 / -1;
}
.mr-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: #f5f5f8;
  font-size: 0.88rem;
  border-top: 1px solid #e8e8e8;
}
.mr-card-foot-label {
  color: #555;
}
.mr-card-total {
  font-weight: 700;
  color: #292746;
}

/* ─── Section totals bar ─────────────────────────────────────────────────── */
.mr-section-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  background: #292746;
  color: #fff;
  padding: 0.8rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
  font-size: 0.88rem;
}
.mr-section-totals span {
  font-weight: 400;
}
.mr-section-totals strong {
  font-weight: 700;
}

/* ─── Card add button ─────────────────────────────────────────────────────── */
.mr-btn-add-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1.5px dashed #bbb;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  color: #666;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.mr-btn-add-card:hover {
  border-color: #292746;
  color: #292746;
}

/* ─── Financial tab ──────────────────────────────────────────────────────── */
.mr-fin-section {
  margin-bottom: 1.5rem;
}
.mr-fin-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #292746;
  margin: 0 0 0.6rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #ff914d;
}
.mr-fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.mr-fin-table th,
.mr-fin-table td {
  padding: 0.5rem 0.7rem;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
}
.mr-fin-table th {
  background: #f5f5f8;
  font-weight: 600;
  color: #555;
  text-align: left;
}
.mr-fin-table .mr-fin-auto {
  background: #f9f9fc;
  font-weight: 700;
  color: #292746;
  text-align: right;
}
.mr-fin-table .mr-fin-input {
  width: 130px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  text-align: right;
}
.mr-fin-table tfoot td {
  background: #292746;
  color: #fff;
  font-weight: 700;
  text-align: right;
}
.mr-fin-table tfoot tr:last-child td {
  font-size: 1rem;
}

/* ─── Dynamic line items (autres rentrees/depenses) ──────────────────────── */
.mr-line-items {
  margin-bottom: 0.5rem;
}
.mr-line-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.mr-line-item input[data-field="libelle"] {
  flex: 1 1 auto;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.88rem;
}
.mr-line-item input[data-field="montant"] {
  width: 120px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.88rem;
  text-align: right;
}
.mr-line-remove {
  background: transparent;
  border: 1px solid #e57373;
  color: #e57373;
  border-radius: 5px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.mr-line-remove:hover {
  background: #fdecea;
}
.mr-btn-add-line {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px dashed #bbb;
  border-radius: 5px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  color: #666;
  cursor: pointer;
  margin-top: 0.2rem;
}
.mr-btn-add-line:hover {
  border-color: #292746;
  color: #292746;
}

/* ─── Financial summary ──────────────────────────────────────────────────── */
.mr-fin-summary {
  background: #f5f5f8;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}
.mr-fin-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 0.9rem;
}
.mr-fin-summary-row:last-child {
  border-bottom: none;
}
.mr-fin-summary-row.mr-fin-final {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 2px solid #292746;
  border-bottom: none;
}
.mr-fin-summary-val {
  font-weight: 600;
}

/* ─── Submit / Checklist tab ─────────────────────────────────────────────── */
.mr-submit-checklist {
  list-style: none;
  margin: 0 0 1.5rem 0;
  padding: 0;
}
.mr-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 7px;
  margin-bottom: 0.3rem;
  background: #f9f9fc;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.mr-check-done {
  background: rgba(255, 145, 77, 0.07) !important;
}
.mr-check-done .mr-check-icon {
  color: #ff914d;
  font-weight: 700;
}
.mr-check-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}
.mr-check-label {
  flex: 1;
}

/* ─── Auth fields on submit tab ──────────────────────────────────────────── */
.mr-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.mr-auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.2rem;
}
.mr-auth-field input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}
.mr-auth-field input.mr-input-error {
  border-color: #e53935;
  background: #fdecea;
}

/* ─── Final submit button ────────────────────────────────────────────────── */
.mr-final-submit {
  background: #ff914d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  display: block;
  width: 100%;
  text-align: center;
}
.mr-final-submit:hover {
  background: #e07a35;
}

/* ─── Selector card primary variant ─────────────────────────────────────── */
.mr-selector-card-primary {
  border: 1px solid #ff914d;
  position: relative;
}
.mr-selector-card-primary::before {
  content: "Rapport mensuel";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff914d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* ─── Autres Informations tab ────────────────────────────────────────────── */
.mr-autres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.mr-autres-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.2rem;
}
.mr-autres-field input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: center;
}

/* ─── NB classes input ───────────────────────────────────────────────────── */
.mr-nb-classes-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.mr-nb-classes-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #555;
}
.mr-nb-classes-row input {
  width: 80px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: center;
}

/* ─── Études Bibliques sujet ─────────────────────────────────────────────── */
.mr-eb-sujet-row {
  margin-bottom: 1rem;
}
.mr-eb-sujet-row label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.3rem;
}
.mr-eb-sujet-row input {
  width: 100%;
  max-width: 480px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* ─── Submit tab extras ─────────────────────────────────────────────────── */
.mr-field-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.mr-field-inline label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
  margin: 0;
}
.mr-inline-input {
  width: 80px !important;
  text-align: center;
}
.mr-section-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
  margin: 1.75rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e8e8e8;
}
.mr-submit-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #999;
  font-style: italic;
  text-align: center;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mr-period-bar {
    padding: 0.6rem 0.8rem;
  }
  .mr-tab-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }
  .mr-tab-panel {
    padding: 1.5rem 1rem;
  }
  .mr-card-grid {
    grid-template-columns: 1fr 1fr;
    padding: 0.75rem;
  }
  .mr-auth-grid {
    grid-template-columns: 1fr;
  }
  .mr-autres-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mr-line-item input[data-field="montant"] {
    width: 90px;
  }
  .mr-financier-grid {
    grid-template-columns: 1fr;
  }
  /* Auth card */
  .mr-auth-logo,
  .mr-auth-heading,
  .mr-auth-form,
  .mr-auth-footer-note {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  /* Portal nav on small screens */
  .mr-portal-nav {
    position: relative;
    margin-left: 0;
    width: 100%;
  }
  .mr-portal-nav-inner {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    min-height: auto;
  }
  .mr-nav-right {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.35rem;
  }
  .mr-nav-entity {
    max-width: 180px;
  }
}

/* --- Portal page: hide WP title, add footer breathing room --------------- */
.mr-portal-page .entry-title,
.mr-portal-page .page-title {
  display: none;
}
.mr-portal-wrap {
  padding-bottom: 4rem;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.mr-dashboard {
  padding: 1.5rem 0;
}
.mr-dashboard-header {
  margin-bottom: 1.5rem;
  text-align: center;
}
.mr-dashboard-welcome {
  background: #f3f2f9;
  border-left: 3px solid #ff914d;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  color: #4a4870;
  font-size: 0.9rem;
  line-height: 1.7;
}
.mr-dashboard-welcome p {
  margin: 0;
}
.mr-dashboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #292746;
  margin: 0;
  letter-spacing: 0.05em;
}
.mr-dashboard-entity {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
}
.mr-dashboard-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  margin-bottom: 0.75rem;
}
.mr-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.mr-dash-card {
  background: #fff;
  border: 1px solid #e0dff0;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(41, 39, 70, 0.06);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.mr-dash-card:hover {
  box-shadow: 0 4px 16px rgba(41, 39, 70, 0.12);
  transform: translateY(-2px);
}
.mr-dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f0eeff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #292746;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.mr-dash-icon-rapport {
  background: #fff4ed;
  color: #ff914d;
}
.mr-dash-card-body {
  flex: 1;
  min-width: 0;
}
.mr-dash-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 0 0 0.35rem;
}
.mr-dash-card-stat {
  font-size: 1.5rem;
  font-weight: 700;
  color: #292746;
  margin: 0 0 0.2rem;
  line-height: 1.1;
}
.mr-dash-card-stat span {
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
}
.mr-dash-card-meta {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
}
.mr-dash-card-empty {
  font-size: 0.9rem;
  color: #aaa;
  font-style: italic;
  margin: 0;
}
.mr-dash-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  text-align: center;
  margin-top: auto;
  text-decoration: none;
}
.mr-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}
.mr-status-draft {
  background: #fff4e0;
  color: #b06000;
}
.mr-status-none {
  background: #f2f1f8;
  color: #888;
}
.mr-status-submitted {
  background: #e6f4ec;
  color: #1a7a3c;
}
.mr-dashboard-footer-links {
  margin-top: 1.75rem;
  text-align: center;
}
.mr-link-subtle {
  font-size: 0.85rem;
  color: #888;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-link-subtle:hover {
  color: #292746;
}

@media (max-width: 720px) {
  .mr-dashboard-cards {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Standalone forms (effectif-form.php / leadership-form.php)
   ========================================================================== */

.mr-standalone-wrap {
  padding: 0.5rem 0 2.5rem;
}
/* Raised specificity to beat .page-content a { text-decoration: underline } */
.mr-portal-wrap .mr-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #292746;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1.5rem;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.mr-portal-wrap .mr-back-link:hover {
  opacity: 1;
  text-decoration: none;
}

/* Icon-only delete/remove buttons (effectif rows, leadership groups) */
.mr-portal-wrap .mr-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(41, 39, 70, 0.25);
  border-radius: 4px;
  color: rgba(41, 39, 70, 0.45);
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.mr-portal-wrap .mr-btn-icon:hover {
  border-color: #a33;
  color: #a33;
  background: #fff5f5;
}
.mr-rapport-back {
  margin-bottom: 0.5rem;
}
.mr-standalone-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eeedf5;
}

/* ─── School Dashboard ────────────────────────────────────────────────────── */
.mr-dashboard-back {
  margin-bottom: 0.75rem;
}

/* ─── School Effectif Table ──────────────────────────────────────────────── */
.mr-school-eff-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.mr-school-eff-table th,
.mr-school-eff-table td {
  padding: 0.45rem 0.5rem;
  border: 1px solid #ddd;
  font-size: 0.9rem;
}
.mr-school-eff-table th {
  background: #292746;
  color: #fff;
  font-weight: 600;
  text-align: left;
}
.mr-school-eff-table .mr-col-nb {
  width: 90px;
  text-align: center;
}
.mr-school-eff-table .mr-col-age {
  width: 110px;
}
.mr-school-eff-table .mr-col-action {
  width: 44px;
  text-align: center;
}
.mr-school-eff-table .mr-nb-input {
  text-align: center;
  width: 100%;
}
.mr-eff-total-row td {
  background: #f5f4fc;
  font-size: 0.95rem;
}

/* ─── School Leadership ──────────────────────────────────────────────────── */
.mr-leader-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.mr-leader-group-name {
  flex: 1;
  font-weight: 600;
}
.mr-leader-member-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 36px;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}
.mr-leader-member-row .mr-col-tel {
  width: 120px;
}
.mr-leader-add-member {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.mr-leadership-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ─── School Financial Form ──────────────────────────────────────────────── */
.mr-school-financial-wrap {
  max-width: 840px;
  margin: 0 auto;
}
.mr-form-title-block {
  margin-bottom: 1.25rem;
}
.mr-form-title-block h2 {
  margin: 0 0 0.25rem;
  color: #292746;
}
.mr-form-subtitle {
  color: #555;
  margin: 0;
}

.mr-section-label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #292746;
  border-bottom: 1px solid #eeedf5;
  padding-bottom: 0.25rem;
  margin: 1.25rem 0 0.5rem;
}

.mr-dynamic-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.mr-dynamic-row {
  display: grid;
  grid-template-columns: 1fr 150px auto 36px;
  gap: 0.4rem;
  align-items: center;
}
.mr-subtotal-row,
.mr-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-top: 1px solid #eeedf5;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.mr-grand-total {
  font-weight: 700;
  font-size: 1rem;
  border-top: 2px solid #292746;
  margin-top: 1rem;
  padding-top: 0.75rem;
}

.mr-tab-save-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eeedf5;
}
.mr-save-feedback {
  font-size: 0.9rem;
  color: #28a745;
  font-weight: 500;
}

/* Submit checklist */
.mr-submit-checklist {
  background: #f9f8ff;
  border: 1px solid #e5e3f5;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.mr-submit-checklist .mr-checklist-title {
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #292746;
}
.mr-submit-checklist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.mr-submit-checklist li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #888;
}
.mr-submit-checklist li.mr-check-done {
  color: #28a745;
  font-weight: 600;
}
.mr-submit-checklist li i.fa-check-circle {
  color: #28a745;
}

/* Checklist bar (tab-level) */
.mr-checklist-bar {
  display: flex;
  gap: 1.25rem;
  padding: 0.5rem 1rem;
  background: #f5f4fc;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.mr-check-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #999;
}
.mr-check-item.mr-check-done {
  color: #28a745;
  font-weight: 600;
}

/* Financial summary table */
.mr-submit-summary {
  background: #f9f8ff;
  border: 1px solid #e5e3f5;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.mr-submit-summary h4 {
  margin: 0 0 0.75rem;
  color: #292746;
  font-size: 0.95rem;
}
.mr-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.mr-summary-table th {
  text-align: left;
  padding: 0.3rem 0.5rem;
  color: #555;
  font-weight: 500;
  width: 55%;
}
.mr-summary-table td {
  padding: 0.3rem 0.5rem;
  text-align: right;
  font-weight: 600;
  color: #292746;
}
.mr-summary-table .mr-summary-balance th,
.mr-summary-table .mr-summary-balance td {
  border-top: 2px solid #292746;
  padding-top: 0.5rem;
}
.mr-summary-table .mr-summary-finale th,
.mr-summary-table .mr-summary-finale td {
  font-size: 1.05rem;
  color: #ff914d;
}

/* Auth block */
.mr-auth-block {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e3f5;
  border-radius: 8px;
}
.mr-auth-block h4 {
  margin: 0 0 0.75rem;
  color: #292746;
}

.mr-btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .mr-dynamic-row {
    grid-template-columns: 1fr 110px 36px;
  }
  .mr-dynamic-row .mr-usd-display {
    display: none;
  }
  .mr-leader-member-row {
    grid-template-columns: 1fr 1fr 36px;
  }
  .mr-leader-member-row .mr-col-tel {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SMBEH BOARD PORTAL
   Scoped under .mr-smbeh-wrap to avoid collisions with church/school styles.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Full-bleed breakout — escape hello-elementor's 600px page-content ─── */
.mr-portal-wrap.mr-smbeh-wrap {
  width: 100vw;
  max-width: none; /* override base .mr-portal-wrap { max-width: 960px } */
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  box-sizing: border-box;
  overflow-x: hidden; /* prevent 100vw scrollbar-width bleed */
  padding-bottom: 4rem; /* breathing room before footer */
}

/* ─── Login — SMBEH variant ──────────────────────────────────────────────── */
.mr-auth-card--smbeh {
  border-top: 4px solid #292746;
}
.mr-auth-card--smbeh .mr-auth-heading h2 {
  color: #292746;
}
.mr-auth-card--smbeh .mr-auth-subtitle {
  color: #5a5880;
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

/* ─── Board nav bar ──────────────────────────────────────────────────────── */
.mr-smbeh-wrap .mr-smbeh-nav {
  background: #292746;
  border-bottom: 3px solid #ff914d;
  margin-bottom: 0; /* kill .mr-portal-nav base margin-bottom: 2rem */
}
.mr-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-size: 1rem;
}
.mr-nav-brand strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.mr-nav-brand .fi {
  color: #ff914d;
  font-size: 1.1rem;
}
.mr-smbeh-wrap .mr-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-size: 1rem;
}
.mr-smbeh-wrap .mr-nav-brand .fa-landmark {
  color: #ff914d;
  font-size: 1.1rem;
}
.mr-nav-period-badge {
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #e8e6ff;
}

/* ─── Stats bar ──────────────────────────────────────────────────────────── */
.mr-smbeh-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: #1e1d38;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mr-smbeh-stat {
  padding: 1rem 1.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}
.mr-smbeh-stat:last-child {
  border-right: none;
}
.mr-smbeh-stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.mr-smbeh-stat-value small {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.55;
}
.mr-smbeh-stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.2rem;
}
.mr-smbeh-stat--ok .mr-smbeh-stat-value {
  color: #6ee7b7;
}
.mr-smbeh-stat--warn .mr-smbeh-stat-value {
  color: #fbbf24;
}

/* ─── Filter bar ─────────────────────────────────────────────────────────── */
.mr-smbeh-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background: #f7f6fc;
  border-bottom: 1px solid #e5e3f5;
}
.mr-smbeh-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.mr-smbeh-filter-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5a5880;
}
.mr-smbeh-filter-group select,
.mr-smbeh-filter-group input[type="number"],
.mr-smbeh-filter-group input[type="search"] {
  height: 36px;
  padding: 0 0.6rem;
  border: 1px solid #d0cde8;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #292746;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.mr-smbeh-filter-group select:focus,
.mr-smbeh-filter-group input:focus {
  border-color: #292746;
}
.mr-smbeh-period-inputs {
  display: flex;
  gap: 0.4rem;
}
.mr-smbeh-filter-group--search input {
  min-width: 180px;
}
.mr-smbeh-filter-actions {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

/* ─── Inner content area (filters + groups) — centered with max-width ─────── */
.mr-smbeh-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── Group list ─────────────────────────────────────────────────────────── */
.mr-smbeh-groups {
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.mr-smbeh-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #9997bb;
}
.mr-smbeh-empty .fi {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

/* ─── Church group card ──────────────────────────────────────────────────── */
.mr-smbeh-group {
  background: #fff;
  border: 1px solid #e5e3f5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(41, 39, 70, 0.06);
}
.mr-smbeh-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f0eefa;
  border-bottom: 1px solid #e5e3f5;
}
.mr-smbeh-group-icon {
  color: #292746;
  font-size: 1rem;
  flex-shrink: 0;
}
.mr-smbeh-group-name {
  font-weight: 700;
  color: #292746;
  font-size: 0.95rem;
  flex: 1;
}
.mr-smbeh-header-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mr-smbeh-header-badge--ok {
  background: #d1fae5;
  color: #065f46;
}
.mr-smbeh-header-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

/* ─── 3-card grid ────────────────────────────────────────────────────────── */
.mr-smbeh-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.mr-smbeh-cards > .mr-smbeh-card:not(:last-child) {
  border-right: 1px solid #e5e3f5;
}

/* School card grid has a slight indent */
.mr-smbeh-cards--school {
  background: #faf9fe;
}

/* ─── Individual card ────────────────────────────────────────────────────── */
.mr-smbeh-card {
  padding: 1rem 1.1rem 1.1rem;
  min-height: 100px;
  transition: background 0.15s;
}
.mr-smbeh-card--empty {
  background: #fafaf9;
}
.mr-smbeh-card--data {
  background: #fff;
}
.mr-smbeh-card--submitted {
  background: #f0fdf4;
}
.mr-smbeh-card--missing {
  background: #fffbeb;
}

.mr-smbeh-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.4rem;
  row-gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #292746;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mr-smbeh-card-head .fi {
  grid-column: 1;
  grid-row: 1;
  color: #6c68a0;
  font-size: 0.88rem;
}
.mr-smbeh-card-head > span:first-of-type {
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mr-smbeh-card-head .mr-smbeh-badge {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
}

/* ─── Status badge ───────────────────────────────────────────────────────── */
.mr-smbeh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  flex-shrink: 0;
}
.mr-smbeh-badge--ok {
  background: #d1fae5;
  color: #065f46;
}
.mr-smbeh-badge--missing {
  background: #fef3c7;
  color: #92400e;
}
.mr-smbeh-badge--none {
  background: #f0eefa;
  color: #9997bb;
  font-size: 0.8rem;
}

/* ─── Expandable card details (<details>/<summary>) ─────────────────────── */
.mr-smbeh-card-details {
  margin-top: 0.3rem;
}
.mr-smbeh-card-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #e5e3f5;
  user-select: none;
}
.mr-smbeh-card-summary::-webkit-details-marker {
  display: none;
}
.mr-smbeh-card-summary strong {
  font-size: 1.5rem;
  font-weight: 700;
  color: #292746;
  line-height: 1;
}
.mr-smbeh-card-summary span {
  font-size: 0.8rem;
  color: #5a5880;
}
.mr-smbeh-card-details[open] .mr-smbeh-card-summary {
  margin-bottom: 0.5rem;
}

/* ─── Card body rows ─────────────────────────────────────────────────────── */
.mr-smbeh-card-body {
  padding-top: 0.4rem;
}
.mr-smbeh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0;
  font-size: 0.8rem;
  color: #292746;
  border-bottom: 1px solid #f0eefa;
}
.mr-smbeh-row:last-child {
  border-bottom: none;
}
.mr-smbeh-row--footer {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid #e5e3f5;
  color: #9997bb;
  font-size: 0.75rem;
}
.mr-smbeh-card-empty {
  font-size: 0.8rem;
  color: #9997bb;
  margin: 0.25rem 0 0;
  font-style: italic;
}

/* ─── Financial report card inline layout ────────────────────────────────── */
.mr-smbeh-card-body--inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.mr-smbeh-balance {
  display: flex;
  flex-direction: column;
}
.mr-smbeh-balance-htg {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
}
.mr-smbeh-balance-usd {
  font-size: 0.75rem;
  color: #6c68a0;
}

/* ─── School nested block ────────────────────────────────────────────────── */
.mr-smbeh-school-block {
  border-top: 2px solid #e5e3f5;
  background: #faf9fe;
}
.mr-smbeh-school-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem 0.65rem 2rem;
  background: #f0eefa;
  border-bottom: 1px solid #e5e3f5;
}
.mr-smbeh-school-header .fa-graduation-cap {
  color: #6c68a0;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.mr-smbeh-school-name {
  font-weight: 600;
  color: #292746;
  font-size: 0.875rem;
  flex: 1;
}
.mr-smbeh-cards--school .mr-smbeh-card {
  padding-left: 2rem;
}

/* ─── Ghost button (used in SMBEH cards) ────────────────────────────────── */
.mr-portal-wrap .mr-btn-ghost {
  background: transparent;
  border: 1px solid #d0cde8;
  color: #292746;
  padding: 0.3rem 0.75rem;
}
.mr-portal-wrap .mr-btn-ghost:hover {
  background: #f0eefa;
  border-color: #292746;
}
.mr-portal-wrap .mr-btn-sm {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 5px;
}

/* ─── Responsive — board portal ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .mr-smbeh-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .mr-smbeh-cards {
    grid-template-columns: 1fr;
  }
  .mr-smbeh-cards > .mr-smbeh-card:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid #e5e3f5;
  }
}
@media (max-width: 600px) {
  .mr-smbeh-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .mr-smbeh-filters {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .mr-smbeh-filter-actions {
    margin-left: 0;
  }
  .mr-smbeh-groups {
    padding: 0.75rem;
  }
  .mr-smbeh-school-header {
    padding-left: 1.25rem;
  }
  .mr-smbeh-cards--school .mr-smbeh-card {
    padding-left: 1.1rem;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   SMBEH DASHBOARD — TABS · ENTITY CARDS · FINANCES · ASSETS
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Tab navigation ─────────────────────────────────────────────────────── */
.mr-smbeh-tab-nav {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-bottom: 2px solid #e8e6f0;
  padding: 0 1.5rem;
  position: sticky;
  top: 56px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(41, 39, 70, 0.06);
  margin-top: 0;
  margin-bottom: 1.5rem;
}
.mr-smbeh-wrap .mr-smbeh-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1.1rem;
  font-size: 0.87rem;
  font-weight: 500;
  color: #6b6990;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mr-smbeh-tab span {
  text-decoration: none;
}
.mr-smbeh-wrap .mr-smbeh-tab:hover {
  color: #292746;
  text-decoration: none;
  border-bottom-color: #c4c1e0;
}
.mr-smbeh-wrap .mr-smbeh-tab--active {
  color: #292746;
  border-bottom-color: #ff914d;
  font-weight: 600;
}

/* ─── Period filter bar ──────────────────────────────────────────────────── */
.mr-smbeh-period-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 2rem;
  background: #f9f8fe;
  border-bottom: 1px solid #ece9f8;
  flex-wrap: wrap;
}
.mr-smbeh-period-bar label {
  font-weight: 500;
  font-size: 0.87rem;
  color: #4a4870;
}
.mr-smbeh-period-bar select,
.mr-smbeh-period-bar input[type="number"] {
  padding: 0.35rem 0.65rem;
  border: 1px solid #d4d0ed;
  border-radius: 6px;
  font-size: 0.87rem;
  background: #fff;
  color: #292746;
  width: auto;
  flex: 0 0 auto;
}

/* ─── Entity list (reports tabs) ─────────────────────────────────────────── */
.mr-smbeh-entity-list {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mr-smbeh-entity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #ece9f8;
  border-left: 4px solid #c4c1e0;
  box-shadow: 0 1px 4px rgba(41, 39, 70, 0.05);
  gap: 1rem;
  flex-wrap: wrap;
}
.mr-smbeh-entity-card--ok {
  border-left-color: #22c55e;
}
.mr-smbeh-entity-card--warn {
  border-left-color: #f59e0b;
}
.mr-smbeh-entity-card-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.mr-smbeh-entity-card-info .fi {
  color: #292746;
  font-size: 1rem;
}
.mr-smbeh-entity-card-name {
  font-weight: 600;
  color: #292746;
  font-size: 0.95rem;
}
.mr-smbeh-no-report {
  font-size: 0.82rem;
  color: #aaa;
  font-style: italic;
  white-space: nowrap;
}

/* ─── Drill-down (one entity's report history) ───────────────────────────── */
.mr-smbeh-drill {
  padding: 1.5rem 2rem;
}
.mr-smbeh-drill-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}
.mr-smbeh-drill-header .fi {
  font-size: 1.4rem;
  color: #ff914d;
}
.mr-smbeh-drill-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #292746;
  margin: 0;
}
.mr-smbeh-report-history {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.mr-smbeh-report-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border: 1px solid #ece9f8;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(41, 39, 70, 0.04);
  flex-wrap: wrap;
}
.mr-smbeh-report-period {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #292746;
  min-width: 160px;
}
.mr-smbeh-report-balance {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

/* ─── Sub-tabs (Leadership & Effectif) ───────────────────────────────────── */
.mr-smbeh-sub-tabs {
  display: flex;
  background: #f5f4fc;
  border-bottom: 1px solid #ece9f8;
  padding: 0 2rem;
}
.mr-smbeh-sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #6b6990;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.mr-smbeh-sub-tab:hover {
  color: #292746;
  text-decoration: none;
}
.mr-smbeh-sub-tab--active {
  color: #292746;
  border-bottom-color: #292746;
  font-weight: 600;
}

/* ─── Leadership & Effectif ─────────────────────────────────────────────── */
.mr-smbeh-le-list {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ─── Entity filter (L&E tab) ─────────────────────────────────────────────── */
.mr-smbeh-le-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: #f8f7fc;
  border-bottom: 1px solid #ece9f8;
}
.mr-smbeh-le-filter label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #292746;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-smbeh-le-filter select {
  flex: 1;
  max-width: 420px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #d0cce8;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #292746;
  background: #fff;
  cursor: pointer;
}

/* ─── Entity view: Effectif/Leadership panel tabs ─────────────────────────── */
.mr-smbeh-le-entity-view {
  padding: 1.5rem 2rem;
}
.mr-smbeh-le-ptabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.mr-portal-wrap .mr-smbeh-le-ptab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid #d0cce8;
  border-radius: 6px;
  background: #fff;
  color: #292746;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.mr-portal-wrap .mr-smbeh-le-ptab:hover,
.mr-portal-wrap .mr-smbeh-le-ptab:focus {
  background: #ece9f8;
  color: #292746;
}
.mr-portal-wrap .mr-smbeh-le-ptab--active,
.mr-portal-wrap .mr-smbeh-le-ptab--active:hover,
.mr-portal-wrap .mr-smbeh-le-ptab--active:focus {
  background: #292746;
  color: #fff;
  border-color: #292746;
}
.mr-smbeh-le-panel-content[hidden] {
  display: none !important;
}
.mr-smbeh-le-empty-hint {
  padding: 2rem 2rem;
  color: #888;
  font-style: italic;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mr-smbeh-le-group {
  border: 1px solid #ece9f8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 5px rgba(41, 39, 70, 0.05);
}
.mr-smbeh-le-group-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  background: #292746;
  color: #fff;
}
.mr-smbeh-le-group-header .fi {
  color: #ff914d;
}
.mr-smbeh-le-group-header h3 {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 600;
  color: #fff;
}
.mr-smbeh-le-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.mr-smbeh-le-panel {
  padding: 1.1rem 1.25rem;
  border-right: 1px solid #ece9f8;
}
.mr-smbeh-le-panel:last-child {
  border-right: none;
}
.mr-smbeh-le-panel--empty {
  opacity: 0.65;
}
.mr-smbeh-le-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #292746;
  margin-bottom: 0.85rem;
}
.mr-smbeh-le-total {
  margin-left: auto;
  font-size: 0.83rem;
  font-weight: 500;
  color: #ff914d;
  background: #fff5ee;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}
.mr-smbeh-le-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.mr-smbeh-le-table th,
.mr-smbeh-le-table td {
  padding: 0.3rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #f0eef8;
  color: #292746;
}
.mr-smbeh-le-table th {
  font-weight: 600;
  background: #f9f8fe;
  color: #4a4870;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mr-smbeh-le-ministere {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0eef8;
}
.mr-smbeh-le-ministere:last-child {
  border-bottom: none;
}
.mr-smbeh-le-ministere-name {
  font-weight: 600;
  font-size: 0.87rem;
  color: #292746;
  margin-bottom: 0.3rem;
}
.mr-smbeh-le-leaders {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.mr-smbeh-le-leader {
  font-size: 0.8rem;
  background: #f0eef8;
  color: #292746;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}
.mr-smbeh-le-nodata {
  font-size: 0.83rem;
  color: #9490bb;
  font-style: italic;
}
.mr-smbeh-le-updated {
  font-size: 0.75rem;
  color: #9490bb;
  margin-top: 0.65rem;
}
.mr-smbeh-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.mr-smbeh-section-title .fi {
  color: #ff914d;
}

/* ─── Finances table ─────────────────────────────────────────────────────── */
.mr-smbeh-fin-wrap {
  padding: 1.5rem 2rem;
}
.mr-smbeh-fin-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #ece9f8;
  box-shadow: 0 1px 5px rgba(41, 39, 70, 0.05);
}
.mr-smbeh-fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  background: #fff;
}
.mr-smbeh-fin-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  background: #292746;
  color: #e8e6ff;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.mr-smbeh-fin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0eef8;
  color: #292746;
  vertical-align: middle;
}
.mr-smbeh-fin-row--school td {
  background: #fafafe;
}
.mr-smbeh-fin-row--missing td {
  opacity: 0.65;
}
.mr-smbeh-fin-entity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  white-space: nowrap;
}
.mr-smbeh-fin-entity--school {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  font-weight: 400;
}
.mr-smbeh-fin-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mr-smbeh-fin-num small {
  display: block;
  font-size: 0.75rem;
  color: #9490bb;
}
.mr-smbeh-fin-num--pos {
  color: #16a34a;
}
.mr-smbeh-fin-num--neg {
  color: #dc2626;
}
.mr-smbeh-fin-num--bal {
  font-weight: 600;
}
.mr-smbeh-fin-missing {
  text-align: center;
  font-style: italic;
  color: #9490bb;
}
.mr-smbeh-fin-total td {
  background: #f0eef8;
  font-weight: 700;
  border-top: 2px solid #d4d0ed;
}

/* ─── Finances tab — redesigned ─────────────────────────────────────────── */

/* SMBEH Due Banner */
.mr-smbeh-fin-due-banner {
  display: flex;
  align-items: center;
  gap: 0;
  background: #292746;
  color: #fff;
  border-radius: 0;
  overflow: hidden;
}
.mr-smbeh-fin-due-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.75rem;
  flex: 1;
}
.mr-smbeh-fin-due-item + .mr-smbeh-fin-due-item {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}
.mr-smbeh-fin-due-item--paid {
  background: rgba(46, 160, 109, 0.18);
}
.mr-smbeh-fin-due-item--remaining {
  background: rgba(230, 126, 34, 0.18);
}
.mr-smbeh-fin-due-label {
  font-size: 0.78rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mr-smbeh-fin-due-total {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.mr-smbeh-fin-due-val {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Detail wrapper */
.mr-smbeh-fin-detail {
  padding: 1.5rem 2rem;
}
.mr-smbeh-fin-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #ece9f8;
}
.mr-smbeh-fin-detail-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #292746;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Two-column table layout */
.mr-smbeh-fin-detail-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 700px) {
  .mr-smbeh-fin-detail-tables {
    grid-template-columns: 1fr;
  }
}

/* Section card */
.mr-smbeh-fin-section {
  background: #fff;
  border: 1px solid #ece9f8;
  border-radius: 10px;
  overflow: hidden;
}
.mr-smbeh-fin-section--sommaire {
  margin-bottom: 1.25rem;
}
.mr-smbeh-fin-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a4870;
  background: #f5f4fc;
  padding: 0.6rem 1rem;
  margin: 0;
  border-bottom: 1px solid #ece9f8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Breakdown table */
.mr-smbeh-fin-breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.mr-smbeh-fin-breakdown td {
  padding: 0.45rem 1rem;
  border-bottom: 1px solid #f0eef8;
  color: #292746;
}
.mr-smbeh-fin-breakdown td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mr-smbeh-fin-breakdown tr:last-child td {
  border-bottom: none;
}
.mr-smbeh-fin-row-highlight td {
  background: #f8f7fc;
}
.mr-smbeh-fin-row-smbeh td {
  background: #fff8e6;
  font-weight: 600;
  color: #8a5f00;
}
.mr-smbeh-fin-row-total td {
  background: #f0eef8;
  font-weight: 700;
  border-top: 2px solid #d4d0ed;
}
.mr-smbeh-fin-row-finale td:last-child {
  font-size: 1rem;
}
.mr-smbeh-fin-num--pos {
  color: #2ea06d;
}
.mr-smbeh-fin-num--neg {
  color: #c0392b;
}

/* Contribution SMBEH card */
.mr-smbeh-fin-contrib-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: #fff8e6;
  border: 1px solid #f0d080;
  border-radius: 10px;
  margin-top: 0.5rem;
}
.mr-smbeh-fin-contrib-card--paid {
  background: #f0faf5;
  border-color: #a8e0c2;
}
.mr-smbeh-fin-contrib-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.mr-smbeh-fin-contrib-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #292746;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-smbeh-fin-contrib-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #292746;
  font-variant-numeric: tabular-nums;
}
.mr-smbeh-fin-contrib-status {
  font-size: 0.87rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.mr-smbeh-fin-contrib-card--paid .mr-smbeh-fin-contrib-status {
  color: #2ea06d;
}
.mr-smbeh-fin-contrib-card:not(.mr-smbeh-fin-contrib-card--paid)
  .mr-smbeh-fin-contrib-status {
  color: #e67e22;
}

/* Toggle buttons: override theme pink reset */
.mr-portal-wrap .mr-smbeh-fin-contrib-card .mr-btn-primary,
.mr-portal-wrap .mr-smbeh-fin-contrib-card .mr-btn-primary:hover,
.mr-portal-wrap .mr-smbeh-fin-contrib-card .mr-btn-primary:focus {
  background: #292746;
  color: #fff;
  border-color: #292746;
}
.mr-portal-wrap .mr-smbeh-fin-contrib-card .mr-btn-ghost,
.mr-portal-wrap .mr-smbeh-fin-contrib-card .mr-btn-ghost:hover,
.mr-portal-wrap .mr-smbeh-fin-contrib-card .mr-btn-ghost:focus {
  background: transparent;
  color: #292746;
  border-color: #d0cce8;
}

/* ─── Assets tab ─────────────────────────────────────────────────────────── */
.mr-smbeh-assets-wrap {
  padding: 1.5rem 2rem;
}
.mr-smbeh-assets-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.mr-smbeh-asset-filter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.mr-smbeh-asset-filter label {
  font-size: 0.87rem;
  font-weight: 500;
  color: #4a4870;
  white-space: nowrap;
}
.mr-smbeh-asset-filter select {
  padding: 0.35rem 0.65rem;
  border: 1px solid #d4d0ed;
  border-radius: 6px;
  font-size: 0.87rem;
  background: #fff;
  color: #292746;
  max-width: 340px;
}
.mr-smbeh-asset-group {
  background: #fff;
  border: 1px solid #ece9f8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(41, 39, 70, 0.05);
  margin-bottom: 1.25rem;
}
.mr-smbeh-asset-group-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  background: #f5f4fc;
  border-bottom: 1px solid #ece9f8;
  flex-wrap: wrap;
}
.mr-smbeh-asset-group-header .fi {
  color: #292746;
}
.mr-smbeh-asset-group-name {
  font-weight: 600;
  color: #292746;
  font-size: 0.93rem;
  flex: 1;
}
.mr-smbeh-asset-count {
  font-size: 0.8rem;
  color: #6b6990;
  background: #ece9f8;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}
.mr-smbeh-asset-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  color: #9490bb;
  font-style: italic;
  font-size: 0.87rem;
}
.mr-smbeh-asset-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0eef8;
}
.mr-smbeh-asset-card:last-child {
  border-bottom: none;
}
.mr-smbeh-asset-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f0eef8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #292746;
  font-size: 1rem;
  flex-shrink: 0;
}
.mr-smbeh-asset-card-body {
  flex: 1;
  min-width: 0;
}
.mr-smbeh-asset-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.mr-smbeh-asset-type {
  font-size: 0.78rem;
  background: #ece9f8;
  color: #292746;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  font-weight: 500;
}
.mr-asset-etat {
  font-size: 0.78rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  font-weight: 500;
}
.mr-asset-etat--ok {
  background: #dcfce7;
  color: #16a34a;
}
.mr-asset-etat--warn {
  background: #fef3c7;
  color: #d97706;
}
.mr-asset-etat--bad {
  background: #fee2e2;
  color: #dc2626;
}
.mr-smbeh-asset-desc {
  font-size: 0.85rem;
  color: #4a4870;
  margin: 0.2rem 0 0.4rem;
}
.mr-smbeh-asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #6b6990;
}
.mr-smbeh-asset-meta .fi {
  color: #9490bb;
  margin-right: 0.2rem;
}
.mr-smbeh-asset-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ─── Asset form ─────────────────────────────────────────────────────────── */
.mr-smbeh-asset-form-wrap {
  margin: 0.5rem 1.25rem 1rem;
  padding: 1.25rem;
  background: #f9f8fe;
  border: 1px solid #d4d0ed;
  border-radius: 10px;
}
.mr-smbeh-asset-form-wrap h4 {
  font-size: 0.93rem;
  font-weight: 700;
  color: #292746;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-smbeh-asset-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.mr-smbeh-asset-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.mr-smbeh-asset-field--wide {
  grid-column: 1 / -1;
}
.mr-smbeh-asset-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a4870;
}
.mr-smbeh-asset-field input,
.mr-smbeh-asset-field select,
.mr-smbeh-asset-field textarea {
  padding: 0.45rem 0.75rem;
  border: 1px solid #d4d0ed;
  border-radius: 7px;
  font-size: 0.87rem;
  color: #292746;
  background: #fff;
  transition: border-color 0.15s;
  width: 100%;
}
.mr-smbeh-asset-field input:focus,
.mr-smbeh-asset-field select:focus,
.mr-smbeh-asset-field textarea:focus {
  outline: none;
  border-color: #292746;
  box-shadow: 0 0 0 3px rgba(41, 39, 70, 0.1);
}
.mr-smbeh-asset-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ─── Danger button ──────────────────────────────────────────────────────── */
.mr-btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.mr-btn-danger:hover,
.mr-btn-danger:focus {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mr-smbeh-tab-nav {
    top: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.5rem;
  }
  .mr-smbeh-tab {
    padding: 0.75rem 0.8rem;
    font-size: 0.8rem;
  }
  .mr-smbeh-le-panels {
    grid-template-columns: 1fr;
  }
  .mr-smbeh-le-panel {
    border-right: none;
    border-bottom: 1px solid #ece9f8;
  }
  .mr-smbeh-le-panel:last-child {
    border-bottom: none;
  }
  .mr-smbeh-entity-list,
  .mr-smbeh-le-list,
  .mr-smbeh-fin-wrap,
  .mr-smbeh-assets-wrap {
    padding: 1rem;
  }
  .mr-smbeh-period-bar {
    padding: 0.75rem 1rem;
  }
  .mr-smbeh-asset-form-grid {
    grid-template-columns: 1fr;
  }
  .mr-smbeh-assets-header {
    flex-direction: column;
  }
  .mr-smbeh-asset-card {
    flex-wrap: wrap;
  }
  .mr-smbeh-report-period {
    min-width: unset;
  }
}

/* ???????????????????????????????? ACCUEIL / APER�U TAB ???????????????????? */

/* Period bar label */
.mr-apercu-period-bar {
  align-items: center;
}
.mr-apercu-period-label {
  font-weight: 600;
  color: #292746;
  margin-right: 0.25rem;
}

/* Missing-reports alert */
.mr-apercu-alert {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff8e6;
  border: 1px solid #f5c518;
  border-left: 4px solid #f5c518;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.mr-apercu-alert-icon {
  font-size: 1.4rem;
  color: #d48b00;
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.mr-apercu-alert-body strong {
  display: block;
  font-size: 0.95rem;
  color: #7a5900;
  margin-bottom: 0.5rem;
}
.mr-apercu-alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
}
.mr-apercu-alert-list li {
  font-size: 0.875rem;
  color: #7a5900;
}
.mr-apercu-alert-list li i {
  margin-right: 0.3em;
  opacity: 0.75;
}

/* Dashboard cards grid */
.mr-apercu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Individual card */
.mr-apercu-card {
  background: #fff;
  border: 1px solid #e5e3f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(41, 39, 70, 0.07);
}
.mr-apercu-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f3f1fb;
  border-bottom: 1px solid #e5e3f0;
  padding: 0.75rem 1rem;
}
.mr-apercu-card-header i {
  color: #6c63a8;
  font-size: 1rem;
}
.mr-apercu-card-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #292746;
}
.mr-apercu-card-body {
  padding: 1rem;
  flex: 1;
}
.mr-apercu-card-footer {
  border-top: 1px solid #edeaf8;
  padding: 0.65rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Stat rows inside a card */
.mr-apercu-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f4f2fc;
  font-size: 0.9rem;
}
.mr-apercu-stat-row:last-of-type {
  border-bottom: none;
}
.mr-apercu-stat-label {
  color: #5e5a7a;
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.mr-apercu-stat-val {
  font-weight: 700;
  color: #292746;
}
.mr-apercu--ok {
  color: #2e7d32;
}
.mr-apercu--warn {
  color: #b45309;
}

/* Progress bar */
.mr-apercu-progress {
  height: 6px;
  background: #e5e3f0;
  border-radius: 99px;
  margin: 0.75rem 0 0.25rem;
  overflow: hidden;
}
.mr-apercu-progress-bar {
  height: 100%;
  background: #2e7d32;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.mr-apercu-progress-label {
  font-size: 0.78rem;
  color: #6c63a8;
  text-align: right;
  margin-bottom: 0.25rem;
}

/* Footer link-style CTAs */
.mr-apercu-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #292746;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  transition:
    background 0.15s,
    color 0.15s;
}
.mr-apercu-link:hover {
  background: #ece9f8;
  color: #ff914d;
}

/* Quick nav tiles grid */
.mr-apercu-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
.mr-apercu-nav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  border: 1px solid #e5e3f0;
  border-radius: 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #292746;
  text-decoration: none;
  background: #fafafe;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.mr-apercu-nav-tile i {
  font-size: 1.35rem;
  color: #6c63a8;
  transition: color 0.15s;
}
.mr-apercu-nav-tile:hover {
  background: #ece9f8;
  border-color: #b8b2e8;
  color: #ff914d;
}
.mr-apercu-nav-tile:hover i {
  color: #ff914d;
}

@media (max-width: 640px) {
  .mr-apercu-grid {
    grid-template-columns: 1fr;
  }
}

/* -- Cumulative arrears strip (below monthly banner) ---------------------- */
.mr-smbeh-fin-cumul-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  background: #1e1c38;
  border-top: 2px solid #ff914d;
  padding: 0.6rem 1.25rem;
  font-size: 0.84rem;
  color: #c8c5e8;
  margin-bottom: 1rem;
}
.mr-smbeh-fin-cumul-label {
  font-weight: 600;
  color: #a89fd8;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}
.mr-smbeh-fin-cumul-vals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
}
.mr-smbeh-fin-cumul-vals strong {
  color: #fff;
}
.mr-smbeh-fin-cumul-sep {
  color: #4a4870;
  font-size: 0.9rem;
}
.mr-smbeh-fin-cumul--warn strong {
  color: #ffb347;
}
.mr-smbeh-fin-cumul--ok strong {
  color: #6ee76e;
}

/* -- Entity cumulative section inside contrib card ------------------------ */
.mr-smbeh-fin-entity-cumul {
  border-top: 1px solid #e8e4f8;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}
.mr-smbeh-fin-entity-cumul-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c63a8;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  width: 100%;
  margin-bottom: 0.25rem;
}
.mr-smbeh-fin-entity-cumul-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.875rem;
  color: #4a4870;
}
.mr-smbeh-fin-entity-cumul-row strong {
  color: #292746;
}
.mr-smbeh-fin-entity-cumul-row .mr-smbeh-fin-cumul--warn strong {
  color: #b45309;
}
.mr-smbeh-fin-entity-cumul-row .mr-smbeh-fin-cumul--ok strong {
  color: #2e7d32;
}

/* -- Church / school entity summary panel (below picker) ----------------- */
.mr-smbeh-fin-entity-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid #e5e3f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(41, 39, 70, 0.06);
}
.mr-smbeh-fin-entity-panel-item {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1.25rem;
  border-right: 1px solid #e5e3f0;
}
.mr-smbeh-fin-entity-panel-item:last-child {
  border-right: none;
}
.mr-smbeh-fin-entity-panel-item--cumul {
  flex: 2 1 340px;
  background: #f8f7fd;
}
.mr-smbeh-fin-entity-panel-label {
  font-size: 0.77rem;
  font-weight: 700;
  color: #6c63a8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.mr-smbeh-fin-entity-panel-amount {
  font-size: 1.3rem;
  font-weight: 800;
  color: #292746;
  line-height: 1.2;
}
.mr-smbeh-fin-entity-panel-status {
  font-size: 0.82rem;
  font-weight: 600;
}
.mr-smbeh-fin-entity-panel-cumul-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  font-size: 0.875rem;
  color: #4a4870;
  margin-top: 0.15rem;
}
.mr-smbeh-fin-entity-panel-cumul-row strong {
  color: #292746;
  font-size: 0.95rem;
}
.mr-smbeh-fin-entity-panel-cumul-row .mr-smbeh-fin-cumul--warn strong {
  color: #b45309;
}
.mr-smbeh-fin-entity-panel-cumul-row .mr-smbeh-fin-cumul--ok strong {
  color: #2e7d32;
}

@media (max-width: 600px) {
  .mr-smbeh-fin-entity-panel {
    flex-direction: column;
  }
  .mr-smbeh-fin-entity-panel-item {
    border-right: none;
    border-bottom: 1px solid #e5e3f0;
  }
  .mr-smbeh-fin-entity-panel-item:last-child {
    border-bottom: none;
  }
}

/* ?????????????????????????????????????????????? TR�SORERIE DU CONSEIL ??? */

/* Summary banner */
.mr-tres-summary {
  display: flex;
  align-items: center;
  background: #292746;
  color: #fff;
  border-radius: 10px;
  padding: 1.25rem 2rem;
  margin-bottom: 1.75rem;
  gap: 0;
  flex-wrap: wrap;
}
.mr-tres-summary-item {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
}
.mr-tres-summary-val {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.mr-tres-summary-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.mr-tres-summary-sep {
  width: 1px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  flex: 0 0 1px;
}
.mr-tres--pos {
  color: #5ecf8e;
}
.mr-tres--neg {
  color: #ff7b7b;
}

/* Form layout */
.mr-tres-form {
  max-width: 860px;
}
.mr-tres-section {
  background: #fff;
  border: 1px solid #e8e6f0;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.mr-tres-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #292746;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f0eeff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mr-tres-section-title i {
  color: #9490bb;
}

/* Individual row */
.mr-tres-row {
  padding: 0.65rem 0;
  border-bottom: 1px solid #f5f4fc;
}
.mr-tres-row:last-child {
  border-bottom: none;
}
.mr-tres-row-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #3d3b5c;
  margin-bottom: 0.45rem;
}
.mr-tres-row-label i {
  color: #9490bb;
  width: 16px;
  text-align: center;
}
.mr-tres-row-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.mr-tres-amount {
  width: 140px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}
.mr-tres-currency {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}
.mr-tres-details {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid #e0dff0;
  border-radius: 6px;
  font-size: 0.83rem;
  color: #555;
  font-family: inherit;
  background: #faf9fe;
}
.mr-tres-details--note {
  display: block;
  font-size: 0.8rem;
  color: #9490bb;
  font-style: italic;
  padding: 0;
  border: none;
  background: none;
  width: auto;
}

/* Auto-calculated row */
.mr-tres-row--auto {
  background: #f8f7fd;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px dashed #c8c4e8;
}
.mr-tres-auto-badge {
  display: inline-block;
  background: #292746;
  color: #fff;
  font-size: 0.68rem;
  padding: 0.1em 0.5em;
  border-radius: 20px;
  margin-left: 0.4rem;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.mr-tres-amount-display {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
}

/* Dynamic rows */
.mr-tres-dyn-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.mr-tres-dyn-label {
  flex: 1 1 200px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
}
.mr-tres-remove {
  background: none;
  border: 1px solid #e0a0a0;
  color: #c0392b;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.mr-tres-remove:hover {
  background: #fdecea;
}
.mr-tres-add-wrap {
  padding-top: 0.75rem;
}

/* Sommaire */
.mr-tres-section--sommaire {
  background: #f8f7fd;
}
.mr-tres-sommaire-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mr-tres-sommaire-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eceaf8;
  font-size: 0.9rem;
  color: #3d3b5c;
}
.mr-tres-sommaire-row--total {
  border-top: 2px solid #292746;
  border-bottom: none;
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
}

/* Actions */
.mr-tres-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .mr-tres-summary {
    flex-direction: column;
    gap: 0.75rem;
  }
  .mr-tres-summary-sep {
    width: 100%;
    height: 1px;
  }
  .mr-tres-amount {
    width: 110px;
  }
}

/* --------------------------------------- TR�SORERIE � Range report -------- */

.mr-tres-range-wrap {
  margin-top: 2.5rem;
  border-top: 2px solid #e8e6f0;
  padding-top: 2rem;
}
.mr-tres-range-title {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mr-tres-range-title i {
  color: #9490bb;
}

.mr-tres-range-form {
  margin-bottom: 1.5rem;
}
.mr-tres-range-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.mr-tres-range-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: #292746;
}
.mr-tres-range-field label {
  font-weight: 600;
  white-space: nowrap;
}
.mr-tres-range-sep {
  font-size: 1.2rem;
  color: #9490bb;
}

/* Table */
.mr-tres-range-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e8e6f0;
}
.mr-tres-range-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #292746;
  white-space: nowrap;
}
.mr-tres-range-table thead th {
  background: #292746;
  color: #fff;
  padding: 0.55rem 0.75rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.mr-tres-range-table thead th:first-child {
  text-align: left;
}
.mr-tres-range-table tbody tr:nth-child(even) {
  background: #f8f7fd;
}
.mr-tres-range-table tbody td {
  padding: 0.45rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid #f0eef8;
}
.mr-tres-range-table tbody td:first-child {
  text-align: left;
  font-weight: 500;
}
.mr-tres-range-table tfoot td {
  padding: 0.55rem 0.75rem;
  text-align: right;
  background: #f0eeff;
  font-weight: 600;
  border-top: 2px solid #292746;
}
.mr-tres-range-table tfoot td:first-child {
  text-align: left;
}

.mr-tres-range-totals {
  font-size: 0.85rem;
}
.mr-tres-row--empty td {
  color: #aaa;
  font-style: italic;
}
.mr-tres-row-nodata {
  text-align: center !important;
}
.mr-tres-range-balance {
  font-size: 0.85rem;
}
.mr-bold {
  font-weight: 700;
}

/* ---------------------------------- TR�SORERIE sub-tab nav --------------- */

.mr-tres-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e8e6f0;
  padding-bottom: 0;
}
.mr-tres-subtab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5a5880;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  top: 2px;
  text-decoration: none !important;
  transition:
    background 0.15s,
    color 0.15s;
}
.mr-tres-subtab:hover {
  background: #f4f2fc;
  color: #292746;
  text-decoration: none !important;
}
.mr-tres-subtab--active {
  background: #fff;
  color: #292746;
  border-color: #e8e6f0;
  text-decoration: none !important;
}
.mr-tres-subtab i {
  font-size: 0.8rem;
}

/* ---------------------------------- TR�SORERIE rapport p�riodique --------- */

.mr-tres-rapport {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mr-tres-rapport-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.mr-tres-rapport-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #292746;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-tres-rapport-header h3 i {
  color: #9490bb;
}
.mr-tres-rapport-sub {
  font-size: 0.8rem;
  color: #9490bb;
}

.mr-tres-rapport-section {
  background: #fff;
  border: 1px solid #e8e6f0;
  border-radius: 10px;
  overflow: hidden;
}

.mr-tres-rapport-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: #292746;
}
.mr-tres-rapport-section-title--rec {
  background: #1e6b1e;
}
.mr-tres-rapport-section-title--dep {
  background: #7a1a1a;
}

.mr-tres-rapport-cols-header {
  display: grid;
  grid-template-columns: 1fr 1fr 160px;
  padding: 0.35rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9490bb;
  background: #f8f7fd;
  border-bottom: 1px solid #eceaf8;
}
.mr-tres-rapport-cols-header span:last-child {
  text-align: right;
}

.mr-tres-rapport-row {
  display: grid;
  grid-template-columns: 1fr 1fr 160px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid #f5f4fc;
}
.mr-tres-rapport-row:last-child {
  border-bottom: none;
}
.mr-tres-rapport-row--extra {
  background: #fafafe;
}

.mr-tres-rapport-row--total {
  background: #f0eeff;
  border-top: 2px solid #e0ddf8;
  border-bottom: none;
  padding: 0.75rem 1.25rem;
}

.mr-tres-rapport-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: #292746;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-tres-rapport-label i {
  color: #9490bb;
  width: 16px;
  text-align: center;
  font-size: 0.8rem;
}
.mr-tres-rapport-detail {
  font-size: 0.8rem;
  color: #7a7898;
  font-style: italic;
  line-height: 1.4;
}
.mr-tres-rapport-amount {
  font-size: 0.9rem;
  font-weight: 600;
  color: #292746;
  text-align: right;
  white-space: nowrap;
}

/* Balance row */
.mr-tres-rapport-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #292746;
  color: #fff;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.mr-tres-rapport-balance.mr-tres--pos {
  background: #1a5c1a;
}
.mr-tres-rapport-balance.mr-tres--neg {
  background: #7a1a1a;
}

@media (max-width: 640px) {
  .mr-tres-rapport-cols-header,
  .mr-tres-rapport-row {
    grid-template-columns: 1fr 140px;
  }
  .mr-tres-rapport-cols-header span:nth-child(2),
  .mr-tres-rapport-detail {
    display: none;
  }
}

/* ── Préparer un Rapport — period picker in card ───────────────────────────── */
.mr-prep-period-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.mr-prep-select {
  font-size: 0.82rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #fff;
  color: #292746;
  cursor: pointer;
  max-width: 130px;
}
.mr-prep-go-btn {
  background: #292746;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
}
.mr-prep-go-btn:hover,
.mr-prep-go-btn:focus {
  background: #3f3c6e;
}

/* ── Recent reports history section ────────────────────────────────────────── */
.mr-recent-reports {
  background: #f7f7fb;
  border: 1px solid #e3e2f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.mr-recent-reports-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b6987;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mr-recent-reports-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mr-recent-report-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e3e2f0;
}
.mr-recent-report-item:last-child {
  border-bottom: none;
}
.mr-recent-report-period {
  font-weight: 600;
  font-size: 0.9rem;
  color: #292746;
  min-width: 100px;
}
.mr-recent-report-link {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: #292746;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.mr-recent-report-link:hover {
  color: #ff914d;
}
.mr-recent-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

/* -- Reports page header (back button above title) ------------------------- */
.mr-page-header {
  margin-bottom: 0.75rem;
}

/* -- Report detail back-links row ------------------------------------------ */
.mr-detail-back-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* -- Dashboard action bar -------------------------------------------------- */
.mr-dashboard-action-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.mr-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #e8f0fe;
  color: #292746;
  border: 1px solid #c7d2fb;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.mr-action-btn:hover,
.mr-action-btn:focus {
  background: #d6e4fd;
  border-color: #a4b8f8;
  color: #292746;
}

/* -- Previous month draft notice ------------------------------------------ */
.mr-dashboard-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff8e6;
  border-left: 4px solid #f5a623;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: #5c4100;
}
.mr-dashboard-notice a {
  color: #292746;
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}
.mr-dashboard-notice a:hover {
  color: #ff914d;
}
