:root {
  --erp-primary: #1e40af;
  --erp-primary-hover: #1d4ed8;
  --erp-primary-light: #eff6ff;
  --erp-primary-muted: #dbeafe;
  --erp-accent: #0f766e;
  --erp-surface: #ffffff;
  --erp-bg: #f4f6f8;
  --erp-border: #e5e7eb;
  --erp-border-strong: #d1d5db;
  --erp-text: #111827;
  --erp-text-secondary: #374151;
  --erp-muted: #6b7280;
  --erp-sidebar-bg: #ffffff;
  --erp-sidebar-width: 248px;
  --erp-radius: 8px;
  --erp-radius-lg: 10px;
  --erp-shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --erp-shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --erp-font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--erp-font);
  font-size: 0.9375rem;
  color: var(--erp-text);
  background: var(--erp-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Bootstrap overrides ── */
.btn {
  font-weight: 600;
  border-radius: var(--erp-radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-primary {
  --bs-btn-bg: var(--erp-primary);
  --bs-btn-border-color: var(--erp-primary);
  --bs-btn-hover-bg: var(--erp-primary-hover);
  --bs-btn-hover-border-color: var(--erp-primary-hover);
  --bs-btn-active-bg: #1e3a8a;
  --bs-btn-active-border-color: #1e3a8a;
  --bs-btn-focus-shadow-rgb: 30, 64, 175;
}

.btn-outline-primary {
  --bs-btn-color: var(--erp-primary);
  --bs-btn-border-color: var(--erp-border-strong);
  --bs-btn-hover-bg: var(--erp-primary-light);
  --bs-btn-hover-border-color: var(--erp-primary);
  --bs-btn-hover-color: var(--erp-primary);
}

.btn-outline-secondary {
  --bs-btn-color: var(--erp-text-secondary);
  --bs-btn-border-color: var(--erp-border-strong);
  --bs-btn-hover-bg: #f9fafb;
}

.form-control, .form-select {
  border-color: var(--erp-border-strong);
  border-radius: var(--erp-radius);
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.form-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--erp-text-secondary);
  margin-bottom: 0.35rem;
}

/* ── App shell ── */
.app-body { min-height: 100vh; }

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

.app-sidebar {
  width: var(--erp-sidebar-width);
  background: var(--erp-sidebar-bg);
  border-right: 1px solid var(--erp-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--erp-border);
  min-height: 64px;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--erp-text);
  line-height: 1.25;
}

.sidebar-brand-sub {
  font-size: 0.75rem;
  color: var(--erp-muted);
  font-weight: 400;
}

.sidebar-nav {
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--erp-muted);
  padding: 1rem 0.75rem 0.375rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
  border-radius: var(--erp-radius);
  color: var(--erp-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.sidebar-link i {
  font-size: 1rem;
  width: 1.125rem;
  text-align: center;
  color: var(--erp-muted);
  transition: color 0.12s;
}

.sidebar-link:hover {
  background: #f9fafb;
  color: var(--erp-text);
}

.sidebar-link:hover i { color: var(--erp-primary); }

.sidebar-link.active {
  background: var(--erp-primary-light);
  color: var(--erp-primary);
  font-weight: 600;
}

.sidebar-link.active i { color: var(--erp-primary); }

.app-main {
  flex: 1;
  margin-left: var(--erp-sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: 64px;
  background: var(--erp-surface);
  border-bottom: 1px solid var(--erp-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topbar-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--erp-text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border: 1px solid var(--erp-border);
  border-radius: 999px;
  background: var(--erp-surface);
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.form-narrow {
  max-width: 280px;
}

.account-nav .nav-link {
  font-weight: 500;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--erp-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--erp-text-secondary);
}

.app-content {
  padding: 1.75rem;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: var(--erp-radius);
}

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--erp-muted);
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: var(--erp-text);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.3);
  z-index: 1035;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--erp-radius);
  border: 1px solid var(--erp-border);
  color: var(--erp-text);
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.page-back-btn:hover {
  border-color: var(--erp-primary);
  color: var(--erp-primary);
  background: var(--erp-primary-subtle, #eef4ff);
}

.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  color: var(--erp-text);
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0.25rem 0 0;
  color: var(--erp-muted);
  font-size: 0.875rem;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Cards ── */
.card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  box-shadow: var(--erp-shadow-sm);
}

.card > .card-header {
  background: transparent;
  border-bottom: 1px solid var(--erp-border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--erp-text);
}

.card > .card-body { padding: 1.25rem; }

.filter-card { margin-bottom: 1.25rem; }

/* ── KPI ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--erp-shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--erp-primary);
  opacity: 0.85;
}

.kpi-card.accent-teal::before { background: var(--erp-accent); }

.kpi-value-suffix {
  font-size: 1rem;
  font-weight: 600;
  color: var(--erp-muted);
}

.diezmos-kpi-grid {
  margin-bottom: 0.25rem;
}

.diezmos-chart-wrap {
  position: relative;
  height: 320px;
}

.diezmos-chart-wrap-sm {
  height: 280px;
}

.diezmos-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.diezmos-summary-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--erp-border);
}

.diezmos-summary-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.diezmos-summary-list span {
  color: var(--erp-muted);
  font-size: 0.875rem;
}

.diezmos-leaders-table .diezmos-month-col {
  min-width: 4.75rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.diezmos-leaders-table .diezmos-cell-active {
  color: var(--erp-primary);
  font-weight: 600;
}
.kpi-card.accent-green::before { background: #059669; }
.kpi-card.accent-amber::before { background: #d97706; }

.kpi-card-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-meta { flex: 1; }

.kpi-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--erp-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--erp-text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--erp-radius);
  background: var(--erp-primary-light);
  color: var(--erp-primary);
  display: grid;
  place-items: center;
  font-size: 1.125rem;
}

.kpi-card.accent-teal .kpi-icon-wrap { background: #f0fdfa; color: var(--erp-accent); }
.kpi-card.accent-green .kpi-icon-wrap { background: #ecfdf5; color: #059669; }
.kpi-card.accent-amber .kpi-icon-wrap { background: #fffbeb; color: #d97706; }

/* ── Tables ── */
.table-card .table { margin-bottom: 0; }

.table-card thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--erp-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--erp-border);
  padding: 0.75rem 1rem;
}

.table-card tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--erp-border);
  color: var(--erp-text-secondary);
}

.table-card tbody tr:hover { background: #fafbfc; }

.table-card tbody tr:last-child td { border-bottom: 0; }

.table-empty {
  text-align: center;
  color: var(--erp-muted);
  padding: 3rem 1rem !important;
}

.members-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 34rem;
  margin: 0 auto;
}

.members-empty-icon {
  font-size: 2rem;
  color: var(--erp-muted);
  opacity: 0.75;
}

.members-empty-message {
  color: var(--erp-text);
  font-weight: 500;
}

.members-empty-hint {
  max-width: 28rem;
}

/* ── Forms ── */
.form-section { margin-bottom: 1.75rem; }

.form-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--erp-text);
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--erp-border);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--erp-border);
}

/* ── Misc ── */
.member-photo-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--erp-border);
}

.member-photo-preview {
  max-width: 100px;
  max-height: 100px;
  object-fit: cover;
  border-radius: var(--erp-radius);
  border: 1px solid var(--erp-border);
}

.member-name-link {
  color: var(--erp-text);
  text-decoration: none;
}

.member-name-link:hover {
  color: var(--erp-primary);
  text-decoration: underline;
}

.member-detail-card {
  border: 1px solid var(--erp-border);
}

.member-detail-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--erp-border);
}

.member-detail-photo-wrap {
  flex-shrink: 0;
}

.member-detail-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--erp-border);
}

.member-detail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--erp-primary-subtle, #e8f0fe);
  color: var(--erp-primary);
  font-size: 2rem;
  font-weight: 700;
  border: 3px solid var(--erp-border);
}

.member-detail-name {
  font-weight: 700;
  color: var(--erp-text);
}

.member-detail-section {
  margin-bottom: 1.75rem;
}

.member-detail-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--erp-text);
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--erp-border);
}

.member-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
}

.member-detail-grid > div {
  min-width: 0;
}

.member-detail-grid dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--erp-muted);
  margin-bottom: 0.25rem;
}

.member-detail-grid dd {
  margin: 0;
  font-weight: 500;
  color: var(--erp-text);
  word-break: break-word;
}

.badge-status {
  font-weight: 600;
  font-size: 0.6875rem;
  padding: 0.3em 0.6em;
  border-radius: 4px;
}

.alert {
  border-radius: var(--erp-radius);
  font-size: 0.875rem;
  border: 1px solid transparent;
}

/* ── Report list ── */
.report-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.report-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--erp-border);
  font-size: 0.875rem;
}

.report-list li:last-child {
  border-bottom: 0;
  font-weight: 700;
  color: var(--erp-text);
}

.report-list .label { color: var(--erp-muted); font-weight: 500; }

.report-tile {
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.report-tile:hover {
  border-color: #c7d2e3;
  box-shadow: var(--erp-shadow-md, 0 4px 12px rgba(15, 23, 42, 0.08));
}

/* ── Vista previa de reporte ── */
.report-preview-kpis .kpi-value.report-kpi-value {
  font-size: 1.25rem;
}

.report-preview-card .card-header {
  background: #f8fafc;
}

.report-count-badge {
  font-weight: 500;
  color: var(--erp-text-secondary) !important;
}

.report-preview-section {
  padding: 0;
}

.report-preview-section--border {
  border-top: 1px solid var(--erp-border);
}

.report-preview-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--erp-border);
}

.report-preview-section-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--erp-text);
}

.report-table-wrap {
  max-height: min(65vh, 640px);
  overflow: auto;
}

.report-data-table {
  font-size: 0.8125rem;
}

.report-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: var(--erp-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 1px solid var(--erp-border);
  padding: 0.65rem 1rem;
}

.report-data-table tbody td {
  padding: 0.6rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f6;
  color: var(--erp-text);
}

.report-data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.report-data-table tbody tr:hover {
  background: #f0f4f8;
}

.report-table-empty {
  text-align: center;
  padding: 2.5rem 1rem !important;
  color: var(--erp-muted);
}

.report-table-empty .bi {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.report-section-title {
  padding: 0.75rem 1rem 0;
  margin: 0;
  color: var(--erp-text-secondary);
}



/* ── Pagination ── */
.pagination .page-link {
  border-radius: var(--erp-radius) !important;
  margin: 0 2px;
  border-color: var(--erp-border);
  color: var(--erp-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pagination .page-item.active .page-link {
  background: var(--erp-primary);
  border-color: var(--erp-primary);
}

/* ── Login (split layout) ── */
.guest-body {
  min-height: 100vh;
  background: var(--erp-surface);
}

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

.guest-split-brand {
  flex: 1;
  background: linear-gradient(160deg, #1e3a8a 0%, #1e40af 55%, #1d4ed8 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.guest-split-brand::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  top: -100px;
  right: -100px;
}

.guest-brand-logo {
  margin-bottom: 2rem;
  width: 100%;
  text-align: center;
}

.guest-brand-logo-img {
  display: inline-block;
  max-width: min(240px, 85%);
  height: auto;
  object-fit: contain;
  vertical-align: middle;
}

.guest-mobile-logo {
  display: none;
  text-align: center;
  margin: -2rem -2rem 1.5rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(160deg, #1e3a8a 0%, #1e40af 55%, #1d4ed8 100%);
  border-radius: var(--erp-radius-lg) var(--erp-radius-lg) 0 0;
}

.guest-brand-heading {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.guest-brand-text {
  font-size: 1rem;
  opacity: 0.85;
  line-height: 1.6;
  max-width: 360px;
  margin: 0;
  width: 100%;
}

.guest-brand-features {
  margin-top: 2.5rem;
  padding: 0;
  list-style: none;
  width: 100%;
  max-width: 360px;
  text-align: left;
}

.guest-brand-features li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 0.625rem;
}

.guest-brand-features i { opacity: 0.7; }

.guest-split-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--erp-bg);
}

.guest-form-panel {
  width: min(400px, 100%);
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  padding: 2rem;
  box-shadow: var(--erp-shadow);
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--erp-text);
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--erp-muted);
  margin-bottom: 1.5rem;
}

.login-mobile-link {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
}

.login-mobile-link a {
  color: var(--erp-primary);
  text-decoration: none;
  font-weight: 600;
}

.login-mobile-link a:hover {
  text-decoration: underline;
}

.guest-form-panel--wide {
  width: min(480px, 100%);
}

.mobile-download-section {
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--erp-surface);
}

.mobile-download-section--muted {
  background: #f9fafb;
}

.mobile-download-section--highlight {
  border-color: var(--erp-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.mobile-platform-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-platform-header i {
  font-size: 1.25rem;
  color: var(--erp-primary);
}

.mobile-platform-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--erp-text);
}

.mobile-version {
  font-size: 0.8125rem;
  color: var(--erp-text-secondary);
  margin-bottom: 0.75rem;
}

.mobile-version-date {
  color: var(--erp-muted);
}

.mobile-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.mobile-install-steps {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--erp-text-secondary);
}

.mobile-install-steps summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--erp-primary);
}

.mobile-install-steps ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.mobile-install-steps li {
  margin-bottom: 0.35rem;
}

.mobile-ios-note {
  font-size: 0.875rem;
  color: var(--erp-muted);
}

.mobile-back-link {
  text-align: center;
  margin: 0;
  font-size: 0.875rem;
}

.mobile-back-link a {
  color: var(--erp-muted);
  text-decoration: none;
}

.mobile-back-link a:hover {
  color: var(--erp-primary);
}

.mobile-download-page {
  max-width: 520px;
}

.account-mobile-card .mobile-download-section:last-child {
  margin-bottom: 0;
}

.account-mobile-card .card-header {
  font-weight: 600;
}

/* ── Mobile ── */
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.08); }
  .app-main { margin-left: 0; }
  .guest-split-brand { display: none; }
  .guest-split-form { flex: 1; }
  .guest-mobile-logo { display: block; }
}

@media (min-width: 992px) {
  .sidebar-backdrop { display: none !important; }
  .guest-split-brand { max-width: 480px; }
}

/* ── Modal forms ── */
.modal-member-create.modal-dialog {
  max-height: calc(100% - 1.75rem);
  margin-top: 0.875rem;
  margin-bottom: 0.875rem;
}

.modal-member-create .modal-content {
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  box-shadow: var(--erp-shadow);
  max-height: calc(100vh - 1.75rem);
}

.modal-member-create .modal-header {
  border-bottom: 1px solid var(--erp-border);
  padding: 1.25rem 1.5rem;
  flex-shrink: 0;
}

.modal-member-create .modal-body {
  padding: 1.25rem 1.5rem;
  background: #fafbfc;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.modal-member-create .modal-footer {
  border-top: 1px solid var(--erp-border);
  padding: 1rem 1.5rem;
  flex-shrink: 0;
}

#memberCreateModal .form-section {
  background: var(--erp-surface);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

#memberCreateModal .form-section-title {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0.75rem;
}

.audit-meta dt {
  color: var(--erp-text-muted, #64748b);
  font-size: 0.875rem;
}

.audit-meta dd {
  margin-bottom: 0.75rem;
}

.audit-json {
  font-size: 0.8rem;
  line-height: 1.45;
  max-height: 320px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--erp-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}