:root {
  --mat-green:        #4d8160;
  --mat-green-dark:   #3a6149;
  --mat-teal:         #7EBEC5;
  --mat-teal-light:   #c2e4e8;
  --mat-green-light:  #83B075;
  --mat-purple:       #6804cc;
  --mat-bg:           #F7F8F5;
  --mat-white:        #FFFFFF;
  --mat-text:         #2d3940;
  --mat-text-muted:   #666;
  --mat-card-radius:  20px;
  --mat-border:       #d6e8da;
}

body {
  background-color: var(--mat-bg);
  color: var(--mat-text);
  font-family: 'Lexend', sans-serif;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Changa One', sans-serif;
  color: var(--mat-green);
}

/* Cards */
.matamoe-card {
  background: var(--mat-white);
  border: 1.5px solid var(--mat-border);
  border-radius: var(--mat-card-radius);
  padding: 1.5rem;
}

/* Buttons */
.btn-primary, .btn-mat-green {
  background-color: var(--mat-green);
  border-color: var(--mat-green);
  border-radius: 20px;
  color: #fff;
  font-family: 'Lexend', sans-serif;
  font-weight: 500;
}
.btn-primary:hover, .btn-mat-green:hover {
  background-color: var(--mat-green-dark);
  border-color: var(--mat-green-dark);
}
.btn-cta {
  background-color: var(--mat-purple);
  border-color: var(--mat-purple);
  border-radius: 20px;
  color: #fff;
  font-family: 'Lexend', sans-serif;
  font-weight: 500;
}
.btn-cta:hover {
  background-color: #5503aa;
  border-color: #5503aa;
  color: #fff;
}
.btn-outline-mat {
  border: 1.5px solid var(--mat-green);
  border-radius: 20px;
  color: var(--mat-green);
  background: transparent;
}
.btn-outline-mat:hover {
  background-color: var(--mat-green);
  color: #fff;
}

/* Filter pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.filter-pill {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  border: 1.5px solid var(--mat-border);
  background: var(--mat-white);
  color: var(--mat-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-pill:hover {
  border-color: var(--mat-green);
  color: var(--mat-green);
}
.filter-pill.active {
  background-color: var(--mat-green);
  border-color: var(--mat-green);
  color: #fff;
}
.filter-dot-open  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mat-green); margin-right: 4px; }
.filter-dot-closed { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mat-text-muted); margin-right: 4px; }

/* Status badge colours */
.badge-unprocessed    { background: #aaa; color: #fff; }
.badge-offered        { background: #d97706; color: #fff; }
.badge-confirmed      { background: var(--mat-green); color: #fff; }
.badge-waitlisted     { background: #64748b; color: #fff; }
.badge-pending_payment { background: #7c3aed; color: #fff; }
.badge-withdrawn      { background: #374151; color: #fff; }
.badge-holding        { background: #64748b; color: #fff; }
.badge-ignore         { background: #e5e7eb; color: #6b7280; }

/* Status filter pills — outlined when unselected, filled when active */
.filter-pill.status-unprocessed    { border-color:#aaa;      color:#888; }
.filter-pill.status-offered        { border-color:#d97706;   color:#d97706; }
.filter-pill.status-confirmed      { border-color:var(--mat-green); color:var(--mat-green); }
.filter-pill.status-waitlisted     { border-color:#64748b;   color:#64748b; }
.filter-pill.status-pending_payment { border-color:#7c3aed;  color:#7c3aed; }
.filter-pill.status-withdrawn      { border-color:#374151;   color:#374151; }
.filter-pill.status-holding        { border-color:#64748b;   color:#64748b; }
.filter-pill.status-ignore         { border-color:#d1d5db;   color:#9ca3af; }

.filter-pill.status-unprocessed.active, .filter-pill.status-unprocessed:hover    { background:#aaa;              border-color:#aaa;              color:#fff; }
.filter-pill.status-offered.active, .filter-pill.status-offered:hover            { background:#d97706;           border-color:#d97706;           color:#fff; }
.filter-pill.status-confirmed.active, .filter-pill.status-confirmed:hover        { background:var(--mat-green);  border-color:var(--mat-green);  color:#fff; }
.filter-pill.status-waitlisted.active, .filter-pill.status-waitlisted:hover      { background:#64748b;           border-color:#64748b;           color:#fff; }
.filter-pill.status-pending_payment.active, .filter-pill.status-pending_payment:hover { background:#7c3aed;      border-color:#7c3aed;           color:#fff; }
.filter-pill.status-withdrawn.active, .filter-pill.status-withdrawn:hover        { background:#374151;           border-color:#374151;           color:#fff; }
.filter-pill.status-holding.active, .filter-pill.status-holding:hover            { background:#64748b;           border-color:#64748b;           color:#fff; }
.filter-pill.status-ignore.active, .filter-pill.status-ignore:hover              { background:#d1d5db;           border-color:#d1d5db;           color:#6b7280; }

/* Inline status select — border colour matches status */
.status-select[data-status="unprocessed"]    { border-color:#aaa; }
.status-select[data-status="offered"]        { border-color:#d97706; color:#d97706; }
.status-select[data-status="confirmed"]      { border-color:var(--mat-green); color:var(--mat-green); }
.status-select[data-status="waitlisted"]     { border-color:#64748b; color:#64748b; }
.status-select[data-status="pending_payment"]{ border-color:#7c3aed; color:#7c3aed; }
.status-select[data-status="withdrawn"]      { border-color:#374151; color:#374151; }
.status-select[data-status="holding"]        { border-color:#64748b; color:#64748b; }
.status-select[data-status="ignore"]         { border-color:#d1d5db; color:#9ca3af; }

/* Navbar */
.navbar-matamoe {
  /* Override Bootstrap 5.3 CSS variables for dark navbar */
  --bs-navbar-brand-color: #fff !important;
  --bs-navbar-brand-hover-color: #fff !important;
  --bs-navbar-color: rgba(255,255,255,0.85) !important;
  --bs-navbar-hover-color: #fff !important;
  --bs-navbar-active-color: #fff !important;
  --bs-navbar-toggler-border-color: rgba(255,255,255,0.4) !important;
  background-color: var(--mat-green);
  border-bottom: none;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.navbar-matamoe .navbar-brand {
  font-family: 'Changa One', sans-serif;
  color: #fff !important;
  font-size: 1.4rem;
  padding-right: 1.5rem;
}
.navbar-matamoe .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
}
.navbar-matamoe .nav-link:hover,
.navbar-matamoe .nav-link.active {
  color: #fff !important;
}
.navbar-matamoe .navbar-toggler {
  border-color: rgba(255,255,255,0.4);
}
.navbar-matamoe .navbar-toggler-icon {
  filter: invert(1);
}
.navbar-matamoe .navbar-nav {
  gap: 0.15rem;
}
.navbar-matamoe .btn-outline-mat {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}
.navbar-matamoe .btn-outline-mat:hover {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
}

/* Admin sidebar */
.sidebar {
  background-color: var(--mat-green);
  min-height: 100vh;
  width: 248px;
  flex-shrink: 0;
}
.sidebar .sidebar-brand {
  font-family: 'Changa One', sans-serif;
  color: #FFFFFF;
  font-size: 1.3rem;
  padding: 1.25rem 1.5rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.01em;
}
.sidebar .nav-link {
  color: rgba(255,255,255,0.85);
  padding: 0.65rem 1.5rem;
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: 0;
  line-height: 1.3;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background-color: rgba(255,255,255,0.13);
}
.sidebar .nav-section-label {
  color: rgba(255,255,255,0.45);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1.25rem 1.5rem 0.4rem;
  list-style: none;
}

.sidebar .nav-link-manage {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.38);
  padding-top: 0.3rem;
  padding-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.sidebar .nav-link-manage:hover {
  color: rgba(255,255,255,0.7);
  background: none;
}

/* Location heading */
.location-heading {
  font-family: 'Changa One', sans-serif;
  color: var(--mat-green);
  border-bottom: 2px solid var(--mat-border);
  padding-bottom: 0.4rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Programme card */
.programme-card {
  background: var(--mat-white);
  border: 1.5px solid var(--mat-border);
  border-radius: var(--mat-card-radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.programme-card:hover {
  box-shadow: 0 4px 16px rgba(77,129,96,0.12);
}
.programme-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.programme-card .card-body {
  padding: 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.programme-card .card-title {
  font-family: 'Changa One', sans-serif;
  color: var(--mat-text);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

/* Form sections */
.form-section-title {
  font-family: 'Changa One', sans-serif;
  color: var(--mat-green);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px solid var(--mat-border);
}

/* Stat cards (admin dashboard) */
.stat-card {
  background: var(--mat-white);
  border: 1.5px solid var(--mat-border);
  border-radius: var(--mat-card-radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  display: block;
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(77,129,96,0.12); }
.stat-card .stat-number {
  font-family: 'Changa One', sans-serif;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--mat-text-muted);
  font-weight: 500;
}

/* Fill bar */
.fill-bar {
  height: 8px;
  background: var(--mat-teal-light);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.fill-bar-inner {
  height: 100%;
  background: var(--mat-green);
  border-radius: 4px;
  transition: width 0.3s;
}
.fill-bar-inner.over { background: #dc2626; }

/* Social login buttons */
.btn-social {
  background: #fff;
  border: 1px solid var(--mat-border);
  border-radius: 20px;
  color: var(--mat-text);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 1rem;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.btn-social:hover {
  border-color: var(--mat-green);
  box-shadow: 0 2px 8px rgba(77,129,96,0.1);
  color: var(--mat-text);
}

/* Alert banner */
.alert-errors {
  border-radius: var(--mat-card-radius);
  border-left: 4px solid #dc2626;
}


/* Form labels */
.form-label {
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
  color: var(--mat-text);
}
.form-text {
  color: var(--mat-text-muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

/* Form controls */
.form-control,
.form-select {
  border-color: var(--mat-border);
  border-radius: 10px;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--mat-green);
  box-shadow: 0 0 0 3px rgba(77,129,96,0.12);
}

/* Definition lists */
dl.row dt {
  font-weight: 500;
  color: var(--mat-text-muted);
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}
dl.row dd {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--mat-border);
}
dl.row dt:last-of-type,
dl.row dd:last-of-type {
  border-bottom: none;
}

/* Tables */
.table > :not(caption) > * > * {
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
}
.table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mat-text-muted);
  border-bottom: none;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.82rem;
}
.breadcrumb-item a {
  color: var(--mat-green);
  text-decoration: none;
}
.breadcrumb-item a:hover {
  text-decoration: underline;
}
.breadcrumb-item.active {
  color: var(--mat-text-muted);
}

/* Page section spacing */
.admin-section + .admin-section {
  margin-top: 2rem;
}

/* Form submission states */
form.is-submitting {
  pointer-events: none;
  opacity: 0.7;
}

form.is-submitting button[type="submit"],
form.is-submitting input[type="submit"] {
  cursor: not-allowed;
}

/* Loading spinner */
.spinner-border-sm {
  width: 0.875rem;
  height: 0.875rem;
  border-width: 0.15em;
}

/* Tabs - Roll view */
.nav-tabs .nav-link {
  color: #64748b;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
}
.nav-tabs .nav-link.active {
  color: var(--mat-green);
  background-color: transparent;
  border-bottom: 3px solid var(--mat-green);
}
.nav-tabs .nav-link:hover {
  color: var(--mat-green);
  border-bottom: 3px solid var(--mat-green);
}

/* Misc */
.text-mat-green { color: var(--mat-green) !important; }
.bg-mat-green   { background-color: var(--mat-green) !important; }
.text-mat-muted { color: var(--mat-text-muted) !important; }
.border-mat     { border-color: var(--mat-border) !important; }
.fw-500         { font-weight: 500 !important; }
.fw-600         { font-weight: 600 !important; }

/* Mobile admin bar */
.admin-mobile-bar {
  background: var(--mat-green);
  position: sticky;
  top: 0;
  z-index: 1050;
}

/* Responsive admin sidebar */
@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
    z-index: 1040;
    transition: left 0.25s ease;
    overflow-y: auto;
  }
  .sidebar.sidebar-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,.25);
  }
}

/* Scrollable tables on small screens */
.table-responsive-admin {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Stack action buttons on mobile */
@media (max-width: 576px) {
  .btn-mobile-stack {
    display: flex;
    flex-direction: column;
    gap: .4rem;
  }
  .btn-mobile-stack .btn {
    width: 100%;
  }
}
