/* ==========================================================================
   Modern layout theme (loaded after adminlte + custom.css)
   ========================================================================== */

:root {
  --app-primary: #4c1d95;
  --app-primary-dark: #292463;
  --app-primary-soft: #efeafc;
  --app-gradient: linear-gradient(160deg, #0f0c29 0%, #292463 50%, #4c1d95 100%);
  --app-bg: #f4f5fa;
  --app-surface: #ffffff;
  --app-border: #e7e8f0;
  --app-text: #1f2133;
  --app-muted: #6b6f85;
  --app-radius: 12px;
  --app-radius-sm: 8px;
  --app-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --app-topbar-h: 60px;
}

body {
  font-family: "Inter", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
}

.content-wrapper {
  background: var(--app-bg);
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.main-header.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1034;
  min-height: var(--app-topbar-h);
  padding: 0 1rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 1px 8px rgba(16, 24, 40, .04);
}

.app-topbar .topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 10px;
  color: var(--app-muted) !important;
  transition: background-color .15s, color .15s;
}

.app-topbar .topbar-icon-btn:hover {
  background: var(--app-primary-soft);
  color: var(--app-primary) !important;
}

.app-topbar .topbar-user {
  display: flex !important;
  align-items: center;
  gap: .65rem;
  padding: .3rem .75rem .3rem .3rem !important;
  margin-left: .35rem;
  border-radius: 999px;
  transition: background-color .15s;
}

.app-topbar .topbar-user:hover {
  background: var(--app-bg);
}

.topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--app-gradient);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
}

.topbar-user-text {
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.topbar-user-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--app-text);
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar-user-role {
  font-size: .75rem;
  color: var(--app-muted);
}

.app-topbar .topbar-signout {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
}

.app-topbar .topbar-signout:hover {
  border-color: #f3c3c8;
  background: #fdf1f2;
  color: #c62839;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.main-sidebar {
  background: var(--app-gradient) !important;
  box-shadow: 4px 0 24px rgba(15, 12, 41, .18) !important;
}

.main-sidebar .brand-link {
  display: flex;
  align-items: center;
  height: var(--app-topbar-h);
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
}

.main-sidebar .brand-link .brand-image {
  float: none;
  margin: 0 .7rem 0 .2rem;
  max-height: 32px;
  opacity: 1 !important;
}

.main-sidebar .brand-link .brand-text {
  font-weight: 600 !important;
  letter-spacing: .2px;
  color: #fff;
}

.main-sidebar .sidebar {
  padding: 0 .6rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .2) transparent;
}

.main-sidebar .sidebar::-webkit-scrollbar { width: 6px; }
.main-sidebar .sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .2);
  border-radius: 3px;
}

/* user card */
.app-user-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem .1rem .75rem;
  padding: .8rem;
  border: 1px solid rgba(255, 255, 255, .1) !important;
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}

.app-user-card-img {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.app-user-card-text {
  min-width: 0;
  line-height: 1.3;
  white-space: nowrap;
}

.app-user-card-greeting {
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .6);
}

.app-user-card-name {
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-user-card-role {
  font-size: .8rem;
  color: rgba(255, 255, 255, .55);
}

/* collapsed (mini) sidebar: show only the image */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .app-user-card {
  padding: .5rem 0;
  justify-content: center;
  background: transparent;
  border-color: transparent !important;
}

.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .app-user-card-text {
  display: none;
}

.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .app-user-card-img {
  width: 32px;
  height: 32px;
}

/* menu */
.nav-sidebar .nav-header {
  margin-left: 0 !important;
  padding: 1.1rem .9rem .45rem !important;
  font-size: .68rem !important;
  font-weight: 600;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .45) !important;
}

.nav-sidebar > .nav-item {
  margin-bottom: 2px;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link {
  display: flex;
  align-items: center;
  padding: .6rem .8rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, .78);
  font-size: .92rem;
  transition: background-color .15s, color .15s, transform .15s;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link p {
  line-height: 1.3;
  white-space: normal;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link .nav-icon {
  flex-shrink: 0;
  font-size: 1rem !important;
  margin-right: .55rem;
  opacity: .9;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link:hover {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active {
  background: #fff !important;
  color: var(--app-primary) !important;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22) !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active .nav-icon {
  color: var(--app-primary);
  opacity: 1;
}

.nav-sidebar .nav-link .badge.right {
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  padding: .3em .6em;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.content-header {
  padding: 1.5rem 1.25rem .75rem;
}

.content-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--app-text);
}

.content-header .breadcrumb {
  background: transparent;
  font-size: .85rem;
}

.content-header .breadcrumb-item,
.content-header .breadcrumb-item a {
  color: var(--app-muted);
}

.content-header .breadcrumb-item.active {
  color: var(--app-primary);
  font-weight: 500;
}

.content {
  padding: 0 .5rem 1rem;
}

.card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.card > .card-header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  border-top-left-radius: var(--app-radius) !important;
  border-top-right-radius: var(--app-radius) !important;
}

.card-title {
  font-weight: 600;
}

/* buttons */
.btn {
  border-radius: var(--app-radius-sm);
  font-weight: 500;
  padding: .45rem 1rem;
  transition: opacity .15s, transform .15s, box-shadow .15s;
}

.btn-sm {
  padding: .25rem .6rem;
  border-radius: 6px;
}

.quilt-button {
  border: none !important;
  border-radius: var(--app-radius-sm) !important;
  box-shadow: 0 4px 12px rgba(76, 29, 149, .25);
}

.quilt-button:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(76, 29, 149, .35);
}

.btn:focus,
.btn.focus {
  box-shadow: 0 0 0 3px rgba(76, 29, 149, .2);
}

/* forms */
.form-control,
.custom-select,
.select2-container--bootstrap4 .select2-selection {
  border-color: #dcdde6;
  border-radius: var(--app-radius-sm) !important;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:not(textarea):not([multiple]),
.custom-select {
  min-height: 42px;
}

.form-control:focus,
.custom-select:focus {
  border-color: #8b6fd1;
  box-shadow: 0 0 0 3px rgba(76, 29, 149, .12);
}

label:not(.form-check-label):not(.custom-control-label) {
  font-weight: 600;
  font-size: .9rem;
  color: #34374b;
}

/* tables */
.table thead th {
  border-top: 0;
  border-bottom: 1px solid var(--app-border);
  background: #f8f8fc;
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.table td {
  border-top-color: var(--app-border);
  vertical-align: middle;
}

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

/* pagination */
.pagination {
  flex-wrap: wrap;
  gap: 4px;
}

.pagination .page-link {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm) !important;
  margin-left: 0;
  min-width: 36px;
  text-align: center;
  color: var(--app-text);
}

.pagination .page-item.active .page-link {
  background: var(--app-gradient);
  border-color: transparent;
  color: #fff;
}

/* info boxes / alerts */
.small-box {
  border-radius: var(--app-radius);
  overflow: hidden;
  box-shadow: var(--app-shadow);
}

.small-box > .small-box-footer {
  border-radius: 0;
}

.alert {
  border-radius: var(--app-radius-sm);
}

.info-box {
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.modal-content {
  border: 0;
  border-radius: var(--app-radius);
  box-shadow: 0 20px 50px rgba(16, 24, 40, .25);
}

/* footer */
.main-footer {
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: .85rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  /* AdminLTE's overlay behind the open sidebar on tablets/phones */
  #sidebar-overlay {
    background: rgba(15, 12, 41, .45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
}

@media (max-width: 767.98px) {
  .main-header.app-topbar {
    padding: 0 .5rem;
  }

  .app-topbar .topbar-signout {
    padding: 0;
    width: 40px;
    height: 40px;
    justify-content: center;
  }

  .content-header {
    padding: 1rem .75rem .5rem;
  }

  .content-header h1 {
    font-size: 1.35rem;
  }

  .content-header .breadcrumb {
    float: none !important;
    padding: .25rem 0 0;
    margin: 0;
  }

  .content {
    padding: 0 0 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .btn {
    margin-bottom: .35rem;
  }

  .small-box .inner h3 {
    white-space: normal;
    word-break: break-word;
    font-size: 1.4rem !important;
  }

  /* wide tables scroll inside their card instead of stretching the page */
  .card-body .table:not(.mobile-table) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card-body .table.desktop-table {
    display: none;
  }

  .main-footer {
    padding: .75rem;
    text-align: center;
    font-size: .78rem;
  }
}

/* ==========================================================================
   Auth pages (login / reset password) — guest.layout
   ========================================================================== */
body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(800px 500px at 85% 0%, rgba(124, 58, 237, .16), transparent 60%),
    radial-gradient(700px 500px at 10% 100%, rgba(41, 36, 99, .14), transparent 60%),
    var(--app-bg);
  background-attachment: fixed;
}

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
}

/* one card: photo on the left, form on the right */
.auth-frame {
  display: flex;
  width: 100%;
  max-width: 1040px;
  min-height: min(640px, calc(100vh - 4rem));
  background: var(--app-surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 24px 60px rgba(41, 36, 99, .18);
  animation: authFadeUp .45s ease-out both;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* photo panel */
.auth-visual {
  position: relative;
  flex: 0 0 52%;
  overflow: hidden;
  background: #0f0c29;
}

.auth-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 35% center; /* keep the subject in frame */
  transform: scale(1.02);
  transition: transform 6s ease-out;
}

.auth-frame:hover .auth-visual-img {
  transform: scale(1.06);
}

/* brand tint + bottom fade for the caption */
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 12, 41, .05) 35%, rgba(15, 12, 41, .88) 100%),
    linear-gradient(135deg, rgba(76, 29, 149, .25) 0%, rgba(15, 12, 41, 0) 60%);
}

.auth-visual-caption {
  position: absolute;
  z-index: 1;
  left: 2.25rem;
  right: 2.25rem;
  bottom: 2.25rem;
  color: #fff;
}

.auth-visual-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .35rem .85rem .35rem .45rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.auth-visual-brand img {
  width: 22px;
  height: auto;
}

.auth-visual-caption h2 {
  margin: 0 0 .5rem;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.auth-visual-caption p {
  margin: 0;
  font-size: .95rem;
  color: rgba(255, 255, 255, .78);
}

.auth-panel {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 2.5rem 3rem 1.75rem;
}

.auth-logo {
  display: block;
  width: fit-content;
  margin: 0 auto 1.1rem;
}

.auth-home-link {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: var(--app-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: all .15s;
}

.auth-home-link:hover {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
  color: var(--app-primary);
  text-decoration: none;
}

.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
  margin: .5rem 0 0;
  font-size: .75rem;
}

.auth-legal-links a {
  color: var(--app-muted);
}

.auth-legal-links a:hover {
  color: var(--app-primary);
}

.auth-logo img {
  width: 60px;
  height: auto;
}

.auth-heading {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-heading h1 {
  margin: 0 0 .35rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--app-text);
}

.auth-heading p {
  margin: 0;
  font-size: .92rem;
  color: var(--app-muted);
}

.auth-panel .login-box-msg {
  padding: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--app-text);
}

.auth-panel .form-control {
  min-height: 48px;
  padding: .6rem .9rem;
  background: #f8f8fc;
  border-radius: 10px !important;
}

.auth-panel .form-control:focus {
  background: #fff;
}

.auth-panel .quilt-button {
  min-height: 48px;
  margin-top: .5rem;
  border-radius: 10px !important;
  font-size: 1rem;
  font-weight: 600;
}

/* password visibility toggle */
.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .form-control {
  padding-right: 2.9rem;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: .4rem;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
  outline: none;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.auth-copyright {
  margin: 1.75rem 0 0;
  text-align: center;
  font-size: .75rem;
  color: var(--app-muted);
}

/* tablets: form only */
@media (max-width: 899.98px) {
  .auth-visual {
    display: none;
  }

  .auth-frame {
    max-width: 460px;
    min-height: 0;
  }

  .auth-panel {
    padding-top: 4.25rem;
  }
}

/* phones */
@media (max-width: 575.98px) {
  body.auth-page {
    background:
      linear-gradient(160deg, #0f0c29 0%, #292463 50%, #4c1d95 100%) top / 100% 240px no-repeat,
      var(--app-bg);
  }

  .auth-shell {
    align-items: flex-start;
    padding: 3.5rem 1rem 1.5rem;
  }

  .auth-frame {
    border-radius: 18px;
  }

  .auth-panel {
    padding: 4rem 1.35rem 1.5rem;
  }

  .auth-home-link {
    top: 1rem;
    left: 1rem;
  }

  .auth-panel .btn {
    margin-bottom: 0;
  }
}

/* Payments (Received): total of the filtered payments */
.payments-total {
  margin: .75rem 0 1rem;
  padding: .9rem 1.1rem;
  border: 1px solid #d9cdf7;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
}
.payments-total-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
}
.payments-total-label { color: var(--app-muted); font-weight: 500; }
.payments-total-label small { margin-left: .35rem; font-size: .8rem; }
.payments-total-amount { font-size: 1.35rem; font-weight: 700; color: var(--app-primary); }
.payments-total-count { margin-left: auto; color: var(--app-muted); font-size: .9rem; }

/* breakdown by payment method */
.payments-total-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .6rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid #d9cdf7;
}
.payments-total-method {
  display: flex;
  flex-direction: column;
  padding: .55rem .75rem;
  border-radius: 8px;
  background: #fff;
}
.payments-total-method-label { font-size: .75rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--app-muted); }
.payments-total-method-amount { font-weight: 700; color: var(--app-text); }
.payments-total-method-count { font-size: .78rem; color: var(--app-muted); }
.payments-total-method.is-no-method { background: rgba(255, 255, 255, .55); border: 1px dashed #d9cdf7; }
.payments-total-method-hint { margin-top: .2rem; font-size: .72rem; font-style: italic; color: var(--app-muted); line-height: 1.3; }

.payments-total-hint {
  margin: .75rem 0 1rem;
  padding: .7rem 1rem;
  border: 1px dashed #d9cdf7;
  border-radius: var(--app-radius-sm);
  color: var(--app-muted);
  font-size: .9rem;
}
.payments-total-hint i { color: var(--app-primary); margin-right: .35rem; }

/* --------------------------------------------------------------------------
   Graphs page
   -------------------------------------------------------------------------- */
.graphs-intro { margin: 0 0 1rem; color: var(--app-muted); font-size: .9rem; }

.graphs-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.graphs-kpi {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
}
.graphs-kpi-label { font-size: .8rem; font-weight: 600; color: var(--app-muted); }
.graphs-kpi-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: var(--app-text); line-height: 1.2; }
.graphs-kpi-note { font-size: .8rem; color: var(--app-muted); }

.graphs-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.25rem .75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
}
.graphs-card[hidden] { display: none; }
.graphs-card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--app-text); }
.graphs-card-head p { margin: .2rem 0 .75rem; font-size: .85rem; color: var(--app-muted); }

.graphs-canvas { position: relative; height: 240px; }
.graphs-canvas-lg { height: 340px; }

.graphs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0 1.25rem;
}

.graphs-table { margin-top: .5rem; border-top: 1px solid var(--app-border); }
.graphs-table summary {
  padding: .6rem 0 .25rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--app-primary);
  cursor: pointer;
}
.graphs-table table { margin: .5rem 0 0; font-size: .85rem; }
.graphs-table th { white-space: nowrap; }

.graphs-empty, .graphs-error { margin: .5rem 0 0; color: var(--app-muted); font-size: .9rem; }
.graphs-error { color: #c62839; }

@media (max-width: 991.98px) {
  .graphs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .graphs-kpis { gap: .65rem; }
  .graphs-kpi { padding: .8rem .9rem; }
  .graphs-kpi-value { font-size: 1.25rem; }
  .graphs-card { padding: 1rem .85rem .5rem; }
  .graphs-canvas-lg { height: 280px; }
  .graphs-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
/* payment method colours (same as the Graphs page) */
.pm-cash { background: #2a78d6; }
.pm-bank { background: #eb6834; }
.pm-visa { background: #1baf7a; }
.pm-master { background: #eda100; }
.pm-amex { background: #e87ba4; }
.pm-not_recorded { background: #c3c2b7; }

.dash-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fafafd;
}
.dash-filter-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.dash-field { display: flex; flex-direction: column; gap: .3rem; margin: 0; font-weight: 600 !important; font-size: .8rem !important; color: var(--app-muted) !important; }
.dash-field .form-control { width: 170px; }
.dash-filter .quilt-button { min-height: 42px; margin-bottom: 0; }
.dash-filter-side { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }

.dash-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.dash-chip {
  padding: .35rem .8rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: #fff;
  color: var(--app-text);
  font-size: .82rem;
  font-weight: 500;
}
.dash-chip:hover { border-color: var(--app-primary); color: var(--app-primary); text-decoration: none; }
.dash-chip.is-active { border-color: var(--app-primary); background: var(--app-primary); color: #fff; }
.dash-download { font-size: .85rem; font-weight: 500; color: var(--app-primary); white-space: nowrap; }

.dash-period { margin: .9rem 0 1rem; color: var(--app-muted); font-size: .9rem; }
.dash-period strong { color: var(--app-text); }

.dash-kpi { position: relative; padding-right: 3.5rem; }
.dash-kpi-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1rem;
}
.dash-kpi-icon.is-income { background: #e8f5ec; color: #1d7a33; }
.dash-kpi-icon.is-members { background: #e7f0fc; color: #1c5cab; }
.dash-kpi-icon.is-trained { background: var(--app-primary-soft); color: var(--app-primary); }
.dash-kpi-icon.is-visits { background: #fff4e0; color: #a86b00; }
.dash-kpi-icon.is-profit { background: #e8f5ec; color: #1d7a33; }
.dash-kpi-icon.is-loss { background: #fdecee; color: #c62839; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0 1.25rem;
}

.dash-table { margin: 0; font-size: .9rem; }
.dash-table thead th { background: transparent; }
.dash-table tfoot th { border-top: 2px solid var(--app-border); font-weight: 700; color: var(--app-text); }

.dash-share { height: 4px; margin-top: .4rem; border-radius: 2px; background: #eef0f5; overflow: hidden; }
.dash-share span { display: block; height: 100%; border-radius: 2px; background: #1d7a33; }

.dash-stackbar {
  display: flex;
  gap: 2px;
  height: 14px;
  margin: .25rem 0 1rem;
  border-radius: 4px;
  overflow: hidden;
  background: #eef0f5;
}
.dash-stackbar span { display: block; height: 100%; min-width: 3px; }

.dash-methods { margin: 0; padding: 0; list-style: none; }
.dash-methods li {
  display: grid;
  grid-template-columns: 12px 1fr auto auto;
  align-items: center;
  gap: .4rem .75rem;
  padding: .6rem 0;
  border-top: 1px solid var(--app-border);
  font-size: .9rem;
}
.dash-swatch { width: 12px; height: 12px; border-radius: 3px; }
.dash-method-name small { display: block; font-size: .75rem; font-style: italic; color: var(--app-muted); }
.dash-method-count { color: var(--app-muted); font-size: .82rem; white-space: nowrap; }
.dash-method-amount { font-weight: 700; text-align: right; white-space: nowrap; }

.dash-empty { margin: .25rem 0 .75rem; color: var(--app-muted); font-size: .9rem; }

.dash-card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dash-link { font-size: .85rem; font-weight: 500; color: var(--app-primary); white-space: nowrap; }

.dash-cashflow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  padding-bottom: .5rem;
}
.dash-cf-item {
  display: flex;
  flex: 1 1 140px;
  flex-direction: column;
  padding: .8rem 1rem;
  border-radius: var(--app-radius-sm);
  background: #f6f6fa;
}
.dash-cf-item span { font-size: .8rem; font-weight: 600; color: var(--app-muted); }
.dash-cf-item strong { font-size: 1.2rem; color: var(--app-text); }
.dash-cf-op { font-size: 1.3rem; font-weight: 700; color: var(--app-muted); }
.dash-cf-result { background: #e8f5ec; }
.dash-cf-result strong { color: #1d7a33; }
.dash-cf-result.is-loss { background: #fdecee; }
.dash-cf-result.is-loss strong { color: #c62839; }

@media (max-width: 767.98px) {
  .dash-filter-fields { width: 100%; }
  .dash-field { flex: 1 1 140px; }
  .dash-field .form-control { width: 100%; }
  .dash-filter .quilt-button { flex: 1 1 100%; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-cf-op { display: none; }
  .dash-cf-item { flex: 1 1 calc(50% - .75rem); }
  .dash-methods li { grid-template-columns: 12px 1fr auto; }
  .dash-method-count { grid-column: 2; grid-row: 2; }
}
.dash .graphs-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 575.98px) {
  .dash .graphs-kpis { grid-template-columns: 1fr; }
  .dash .graphs-kpi-value { white-space: nowrap; }
}

/* Payments (Received): admin Excel export */
.payments-export { display: flex; justify-content: flex-end; margin: .75rem 0 1rem; }
.payments-export-btn {
  border: 1px solid #b7dfc3;
  background: #eef8f1;
  color: #1d6b35;
  font-weight: 600;
}
.payments-export-btn:hover { background: #1d7a33; border-color: #1d7a33; color: #fff; }
.payments-export-btn i { margin-right: .3rem; }

/* --------------------------------------------------------------------------
   Import Members (super admin)
   -------------------------------------------------------------------------- */
.import-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.import-step {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .8rem 1rem;
  border-radius: var(--app-radius-sm);
  background: var(--app-primary-soft);
  color: #34374b;
  font-size: .88rem;
}
.import-step span {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--app-gradient);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}
.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0 1.25rem;
}
.import-drop {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: 1.5rem 1rem;
  border: 2px dashed #d0c4f2;
  border-radius: var(--app-radius);
  background: #fbfaff;
  color: var(--app-muted) !important;
  font-weight: 500 !important;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.import-drop:hover, .import-drop.has-file { border-color: var(--app-primary); background: var(--app-primary-soft); }
.import-drop i { font-size: 1.8rem; color: #1d7a33; }
.import-drop.has-file .import-drop-text { color: var(--app-text); font-weight: 600; }
.import-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: .5rem 0 .75rem;
}
.import-template { font-size: .9rem; font-weight: 500; color: var(--app-primary); }
.import-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: .88rem;
}
.import-columns strong { font-weight: 500; }
.import-badge {
  margin-left: .35rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #fdecee;
  color: #c62839;
  font-size: .7rem;
  font-weight: 600;
}
.import-note { margin: 0 0 .75rem; color: var(--app-muted); font-size: .85rem; }
.import-errors { border-color: #f3c3c8; }

@media (max-width: 991.98px) {
  .import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .import-steps { grid-template-columns: 1fr; }
  .import-columns { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Settings (edited in place)
   -------------------------------------------------------------------------- */
.settings {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 5rem;   /* room for the save bar */
}
.settings-nav {
  position: sticky;
  top: calc(var(--app-topbar-h) + 1rem);
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.settings-nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  border-radius: 10px;
  color: var(--app-muted);
  font-size: .92rem;
  font-weight: 500;
}
.settings-nav-link i { width: 16px; text-align: center; }
.settings-nav-link:hover { background: #f4f3f9; color: var(--app-text); text-decoration: none; }
.settings-nav-link.is-active { background: var(--app-primary-soft); color: var(--app-primary); font-weight: 600; }

.settings-section { scroll-margin-top: calc(var(--app-topbar-h) + 1rem); padding-bottom: 1rem; }
.settings-section .graphs-card-head h3 i { margin-right: .4rem; color: var(--app-primary); font-size: .95rem; }
.settings-section .graphs-card-head { margin-bottom: .5rem; }

/* switch rows */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .85rem 0;
  border-top: 1px solid var(--app-border);
}
.setting-row-text { min-width: 0; }
.setting-row-label { display: block; margin: 0; font-weight: 600 !important; font-size: .93rem !important; color: var(--app-text) !important; }
.setting-row-help { margin: .15rem 0 0; color: var(--app-muted); font-size: .83rem; }

.setting-switch { flex-shrink: 0; min-width: 84px; padding-left: 2.6rem; }
.setting-switch .custom-control-label { font-weight: 500 !important; color: var(--app-muted) !important; cursor: pointer; }
.setting-switch .custom-control-label::before {
  left: -2.6rem; top: .05rem; width: 2.25rem; height: 1.3rem; border-radius: 999px; border-color: #c9cbd8; background: #e7e8f0;
}
.setting-switch .custom-control-label::after {
  left: calc(-2.6rem + 3px); top: calc(.05rem + 3px); width: calc(1.3rem - 6px); height: calc(1.3rem - 6px); border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.setting-switch .custom-control-input:checked ~ .custom-control-label::before { border-color: var(--app-primary); background: var(--app-primary); }
.setting-switch .custom-control-input:checked ~ .custom-control-label::after { transform: translateX(.95rem); }
.setting-switch .custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 3px rgba(76, 29, 149, .2); }
.setting-switch-state::before { content: attr(data-off); }
.setting-switch .custom-control-input:checked ~ .custom-control-label .setting-switch-state::before { content: attr(data-on); color: var(--app-primary); font-weight: 600; }

/* segmented choice */
.setting-segmented {
  flex-shrink: 0;
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #eef0f5;
}
.setting-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.setting-segmented label {
  margin: 0;
  padding: .35rem .9rem;
  border-radius: 8px;
  color: var(--app-muted) !important;
  font-size: .85rem !important;
  font-weight: 500 !important;
  cursor: pointer;
}
.setting-segmented input:checked + label { background: #fff; color: var(--app-primary) !important; font-weight: 600 !important; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.setting-segmented input:focus-visible + label { box-shadow: 0 0 0 3px rgba(76, 29, 149, .2); }

/* fields */
.setting-field { margin-bottom: 1rem; }
.setting-field textarea { resize: vertical; min-height: 64px; }
.setting-field-help { display: block; margin-top: .3rem; color: var(--app-muted); font-size: .8rem; }
.setting-required { color: #c62839; }
.setting-secret { position: relative; }
.setting-secret .form-control { padding-right: 2.8rem; }
.setting-secret-toggle {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--app-muted); cursor: pointer;
}
.setting-secret-toggle:hover { background: var(--app-primary-soft); color: var(--app-primary); }

/* save bar */
.settings-savebar {
  position: fixed;
  z-index: 1030;
  left: 50%;
  bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .65rem .75rem .65rem 1.25rem;
  border-radius: 14px;
  background: #1f2133;
  color: #fff;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .3);
  transform: translate(-50%, 200%);
  visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.settings-savebar.is-visible { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }
.settings-savebar-text { font-size: .9rem; font-weight: 500; white-space: nowrap; }
.settings-savebar-text i { margin-right: .4rem; font-size: .5rem; vertical-align: middle; color: #fbbf24; }
.settings-savebar-actions { display: flex; gap: .5rem; }
.settings-savebar .btn { margin: 0; }

@media (max-width: 991.98px) {
  .settings { grid-template-columns: 1fr; }
  .settings-nav {
    position: sticky;
    z-index: 5;
    top: var(--app-topbar-h);
    flex-direction: row;
    overflow-x: auto;
    margin: 0 -1rem;
    padding: .5rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--app-border);
  }
  .settings-nav-link { white-space: nowrap; padding: .45rem .75rem; }
}
@media (max-width: 575.98px) {
  .setting-row { align-items: flex-start; gap: 1rem; }
  .setting-row-stack { flex-direction: column; align-items: stretch; gap: .6rem; }
  .setting-row-stack .setting-segmented { align-self: flex-start; }
  .settings-savebar { left: .75rem; right: .75rem; bottom: .75rem; transform: translateY(200%); gap: .75rem; flex-wrap: wrap; justify-content: space-between; }
  .settings-savebar.is-visible { transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Birthdays
   -------------------------------------------------------------------------- */
.bday-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fafafd;
}
.bday-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.bday-pick .form-control { width: 150px; }
.bday-pick .quilt-button { min-height: 42px; margin-bottom: 0; }
.bday-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.25rem 0 .5rem; }
.bday-heading h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.bday-heading span { color: var(--app-muted); font-size: .9rem; }
.bday-table td { vertical-align: middle; }
.bday-row-today { background: #fff8e6; }
.bday-when { display: inline-block; margin-top: .2rem; padding: .1rem .5rem; border-radius: 999px; background: #eef0f5; color: var(--app-muted); font-size: .75rem; font-weight: 600; }
.bday-when.is-today { background: #f59e0b; color: #fff; }
.bday-when.is-soon { background: var(--app-primary-soft); color: var(--app-primary); }
.bday-when.is-past { background: transparent; padding-left: 0; }
.bday-empty { padding: 2.5rem 1rem; text-align: center; color: var(--app-muted); }
.bday-empty i { font-size: 2rem; color: #d0c4f2; }
.bday-empty p { margin: .75rem 0 1rem; }
.bday-pagination { display: flex; justify-content: flex-end; margin-top: .75rem; }

@media (max-width: 767.98px) {
  .bday-pick { width: 100%; }
  .bday-pick .dash-field { flex: 1 1 130px; }
  .bday-pick .form-control { width: 100%; }
  .bday-pick .quilt-button { flex: 1 1 100%; }
}
