:root {
  color-scheme: light;
  --payit-green: #185a3a;
  --payit-green-dark: #103d2a;
  --payit-green-deep: #123629;
  --payit-green-soft: #eaf2ed;
  --payit-ink: #202a24;
  --payit-muted: #718078;
  --payit-page: #f5f7f5;
  --payit-frame: #e8eeea;
  --payit-surface: #ffffff;
  --payit-border: #e5ebe7;
  --payit-shadow: 0 4px 14px rgba(32, 42, 36, 0.06);
  --payit-shadow-hover: 0 8px 20px rgba(32, 42, 36, 0.1);
  --payit-radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

html,
body {
  background-color: var(--payit-page);
  color: var(--payit-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.sidebar {
  background: linear-gradient(180deg, var(--payit-green) 0%, var(--payit-green-dark) 100%) !important;
  box-shadow: 4px 0 20px rgba(12, 37, 24, 0.1) !important;
}

.sidebar-logo img {
  background: #050505 !important;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22) !important;
}

.sidebar-logo h3 {
  color: #fff !important;
  text-shadow: none !important;
  letter-spacing: 0.4px !important;
}

.sidebar-nav li.active {
  background: #fff !important;
  color: var(--payit-green-dark) !important;
  box-shadow: 0 5px 16px rgba(7, 30, 17, 0.12) !important;
}

.sidebar-nav li.active i {
  color: var(--payit-green) !important;
}

.sidebar-nav li.active::before {
  background: var(--payit-green) !important;
}

.main,
.main-content,
.page-content,
.content-area {
  background-color: var(--payit-page);
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--payit-ink);
}

.card,
.card-panel,
.table-card,
.scanner-card,
.scanner-table-card,
.report-section,
.kpi-card,
.stat-card,
.dashboard-card,
.content-card,
.filter-card,
.modal-content {
  border-color: var(--payit-border);
  box-shadow: var(--payit-shadow);
}

.card,
.card-panel,
.table-card,
.scanner-card,
.scanner-table-card,
.report-section,
.kpi-card,
.stat-card,
.dashboard-card,
.content-card,
.filter-card {
  border-radius: 14px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  border-color: #d8e1db;
  border-radius: 9px;
  color: var(--payit-ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--payit-green) !important;
  box-shadow: 0 0 0 3px rgba(24, 90, 58, 0.12) !important;
  outline: none;
}

.btn-primary,
.btn-success,
.primary-btn,
.create-btn {
  background: var(--payit-green) !important;
  border-color: var(--payit-green) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-success:hover,
.primary-btn:hover,
.create-btn:hover {
  background: var(--payit-green-dark) !important;
  border-color: var(--payit-green-dark) !important;
}

.btn-outline,
.btn-outline-primary {
  border-color: #b9c9bf !important;
  color: var(--payit-green-dark) !important;
}

table th {
  background: #f0f4f1;
  color: #46544b;
}

table tr:nth-child(even) {
  background: #f8faf8;
}

table tr:hover {
  background: #eff5f1;
}

a {
  color: var(--payit-green);
}

a:hover {
  color: var(--payit-green-dark);
}

::selection {
  background: #d5e8dc;
  color: var(--payit-green-dark);
}

/* Shared admin interface polish */
body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #164633 0%, #102f24 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 6px 0 24px rgba(12, 37, 24, 0.08) !important;
}

.sidebar-logo {
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

.sidebar-nav li {
  border-radius: 11px !important;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-nav li:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  transform: translateX(2px);
}

.sidebar-nav li.active {
  color: var(--payit-green-dark) !important;
  background: #fff !important;
  box-shadow: 0 5px 16px rgba(5, 25, 15, 0.16) !important;
}

.sidebar-nav li.active::before {
  border-radius: 0 4px 4px 0;
}

.sidebar-bottom {
  border-top-color: rgba(255, 255, 255, 0.14) !important;
}

@media (max-width: 768px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.sidebar-open {
    position: fixed !important;
    top: var(--sidebar-scroll-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden !important;
  }

  .container {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .main {
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar > div:first-child {
    flex: 0 0 auto;
  }

  .sidebar-nav {
    flex: 0 0 auto;
    overflow: visible;
  }

  .sidebar-bottom {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .sidebar-bottom .logout-btn {
    min-height: 48px;
    margin-top: 10px;
    padding: 12px;
    font-size: 14px;
    touch-action: manipulation;
  }
}

.main {
  min-width: 0;
  background: var(--payit-page) !important;
}

.dashboard-container,
.report-header,
.section-header {
  color: var(--payit-ink);
}

.report-header,
.section-header {
  margin-bottom: 20px;
}

.report-header h1,
.section-header h1,
.section-header h2,
.section-header h3 {
  color: var(--payit-ink) !important;
  letter-spacing: -0.025em;
}

.report-header p,
.section-header p,
.header-info {
  color: var(--payit-muted);
}

.card,
.card-panel,
.table-card,
.scanner-card,
.scanner-table-card,
.report-section,
.kpi-card,
.stat-card,
.dashboard-card,
.content-card,
.filter-card {
  background-color: var(--payit-surface);
  border: 1px solid var(--payit-border);
  border-radius: var(--payit-radius);
  box-shadow: var(--payit-shadow);
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.stat-card:hover,
.dashboard-card:hover,
.content-card:hover {
  border-color: #d2ded6;
  box-shadow: var(--payit-shadow-hover);
}

.stat-card[onclick],
.dashboard-card[onclick] {
  cursor: pointer;
}

.filter-bar,
.filter-card,
.report-toolbar,
.page-toolbar {
  border-color: var(--payit-border);
  border-radius: var(--payit-radius);
}

.filter-bar,
.filter-card {
  background: var(--payit-surface);
  box-shadow: var(--payit-shadow);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  align-items: end;
  gap: 12px;
}

.filter-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.filter-field .filter-label {
  color: var(--payit-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.filter-field select {
  width: 100%;
  min-width: 0 !important;
  min-height: 40px;
  background: #fbfcfb;
}

.filter-bar .semester-badge,
.filter-bar .clear-filter {
  align-self: center;
  justify-self: start;
}

.tab-bar {
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--payit-border);
  border-radius: 14px;
  background: #edf2ef;
}

.tab-bar button,
.tab-bar a,
.report-tab {
  border-radius: 10px;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.tab-bar button.active,
.tab-bar a.active,
.report-tab.active {
  background: #fff;
  color: var(--payit-green-dark);
  box-shadow: 0 2px 8px rgba(22, 48, 34, 0.08);
}

.report-container {
  width: min(100%, 1120px);
  margin: 18px auto 30px;
  padding: clamp(18px, 3vw, 36px);
  border: 1px solid var(--payit-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--payit-shadow);
}

body.print-preview .report-container {
  border-color: var(--payit-border) !important;
  border-radius: 10px;
  box-shadow: var(--payit-shadow);
}

.report-title {
  border-bottom: 1px solid var(--payit-border) !important;
}

.report-title h2,
.report-title h3 {
  color: var(--payit-ink);
}

.report-section {
  margin: 18px 0;
  padding: 18px;
}

.report-table {
  width: 100%;
  border: 1px solid var(--payit-border) !important;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 10px;
}

.report-table th,
.report-table td {
  border-color: var(--payit-border) !important;
}

.report-table th {
  background: #edf3ef !important;
  color: #34483b !important;
  font-weight: 700;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.report-footer {
  color: var(--payit-muted);
  border-top-color: var(--payit-border) !important;
}

.overview-tab-summary {
  margin: 20px 0;
}

.overview-tab-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}

.overview-tab-summary-header h3 {
  margin: 0;
  color: var(--payit-ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.overview-tab-summary-header p {
  margin: 4px 0 0;
  color: var(--payit-muted);
  font-size: 0.82rem;
}

.overview-filter-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--payit-muted);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.overview-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.overview-summary-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--payit-border);
  border-radius: 14px;
  background: #fff;
  color: var(--payit-ink);
  text-align: left;
  box-shadow: 0 4px 14px rgba(22, 48, 34, 0.04);
}

.overview-summary-card:hover {
  border-color: #cbd9d0;
}

.overview-summary-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--payit-green-soft);
  color: var(--payit-green);
}

.overview-summary-card.attendance .overview-summary-icon {
  background: #eef2fb;
  color: #5269a5;
}

.overview-summary-card.students .overview-summary-icon {
  background: #f2effa;
  color: #7661a4;
}

.overview-summary-card.financial .overview-summary-icon {
  background: #fcf3e7;
  color: #a86b1f;
}

.overview-summary-content {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.overview-summary-title {
  color: var(--payit-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overview-summary-value {
  color: var(--payit-ink);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.overview-summary-detail {
  color: var(--payit-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.overview-summary-arrow {
  flex: 0 0 auto;
  margin: 3px 0 0 auto;
  color: #98a69d;
  font-size: 0.72rem;
}

.overview-report-summary {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.overview-report-summary-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.overview-report-summary-heading h3 {
  margin: 0;
  color: var(--payit-ink);
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.overview-report-summary-heading p {
  margin: 4px 0 0;
  color: var(--payit-muted);
  font-size: 0.82rem;
}

.overview-report-summary-heading > span {
  color: var(--payit-muted);
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}

.overview-report-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--payit-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(22, 48, 34, 0.045);
  break-inside: avoid;
}

.overview-report-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.overview-report-description {
  margin: -4px 0 14px;
  color: var(--payit-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.overview-attendance-filter {
  width: min(100%, 280px);
  margin-bottom: 14px;
}

.overview-report-panel-heading h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--payit-ink);
  font-size: 1rem;
  font-weight: 750;
}

.overview-report-panel-heading h4 i {
  color: var(--payit-green);
}

.overview-report-panel.attendance .overview-report-panel-heading h4 i {
  color: #5269a5;
}

.overview-report-panel.students .overview-report-panel-heading h4 i {
  color: #7661a4;
}

.overview-report-panel.financial .overview-report-panel-heading h4 i {
  color: #a86b1f;
}

.overview-report-panel-heading button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--payit-border);
  border-radius: 9px;
  background: #fff;
  color: var(--payit-green-dark);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.overview-report-panel-heading button:hover {
  background: var(--payit-green-soft);
  border-color: #c9d9cf;
}

.overview-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-report-metrics > div {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 68px;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e9eeeb;
  border-radius: 11px;
  background: #f8faf9;
}

.overview-report-metrics span {
  color: var(--payit-muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
}

.overview-report-metrics strong {
  color: var(--payit-ink);
  font-size: 1.02rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.overview-report-metrics small {
  color: var(--payit-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.overview-report-table-wrap {
  min-width: 0;
  margin-top: 16px;
}

.overview-report-table-wrap h5 {
  margin: 0 0 8px;
  color: #46544b;
  font-size: 0.78rem;
  font-weight: 750;
}

.overview-compact-table {
  font-size: 0.78rem;
}

.overview-compact-table th,
.overview-compact-table td {
  padding: 8px 10px;
}

.overview-report-distributions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.overview-report-distributions .overview-report-table-wrap {
  min-width: 0;
}

.table-card {
  overflow: hidden;
}

.table-card table,
.scanner-table-card table {
  margin-bottom: 0;
}

table thead th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

table td,
table th {
  vertical-align: middle;
}

button,
.btn,
[role="button"] {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn-primary,
.btn-success,
.primary-btn,
.create-btn {
  border-radius: 10px !important;
  box-shadow: 0 4px 10px rgba(24, 90, 58, 0.14);
}

.btn-primary:focus-visible,
.btn-success:focus-visible,
.primary-btn:focus-visible,
.create-btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(24, 90, 58, 0.22);
  outline-offset: 2px;
}

.modal-content,
.modal-dialog,
.admin-profile-dialog {
  border: 1px solid var(--payit-border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(17, 38, 27, 0.2);
}

.mobile-menu-toggle {
  border: 1px solid var(--payit-border) !important;
  border-radius: 11px !important;
  box-shadow: var(--payit-shadow);
}

.login-container {
  max-width: 440px;
}

.login-card {
  border: 1px solid rgba(227, 233, 229, 0.9) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 64px rgba(17, 38, 27, 0.18) !important;
}

.login-card::before {
  background: linear-gradient(90deg, var(--payit-green), #73a183) !important;
}

.logo-wrapper {
  box-shadow: 0 8px 20px rgba(18, 54, 41, 0.16) !important;
}

.login-title {
  color: var(--payit-ink) !important;
}

.login-btn {
  border-radius: 11px !important;
  background: var(--payit-green) !important;
  box-shadow: 0 7px 16px rgba(24, 90, 58, 0.18) !important;
}

.login-btn:hover {
  background: var(--payit-green-dark) !important;
  box-shadow: 0 9px 20px rgba(16, 61, 42, 0.22) !important;
}

.bg-shape-2 {
  background: rgba(24, 90, 58, 0.045) !important;
}

/* Match the mobile app palette while preserving the existing sidebar. */
body {
  background-color: var(--payit-page) !important;
  color: var(--payit-ink);
}

.dashboard-header {
  border-bottom-color: var(--payit-border) !important;
}

.dashboard-header .greeting h1,
.dashboard-header .card-header h3,
.progress-card .progress-header .label,
.activity-card .card-header h3 {
  color: var(--payit-ink) !important;
}

.dashboard-header .greeting p,
.dashboard-header .header-info .date-badge,
.stat-card .info h4,
.stat-card .info .sub-text,
.progress-card .progress-details,
.activity-item .activity-content,
.activity-item .activity-content small {
  color: var(--payit-muted) !important;
}

.dashboard-header .header-info .date-badge,
.stats-grid .stat-card,
.progress-card,
.activity-card,
.actions-card,
.action-btn {
  background-color: var(--payit-surface) !important;
  border-color: var(--payit-border) !important;
  box-shadow: var(--payit-shadow);
}

.stats-grid .stat-card:hover,
.action-btn:hover {
  border-color: #b8cfc0 !important;
  background-color: var(--payit-green-soft) !important;
}

.stat-card .icon {
  background: var(--payit-green-soft) !important;
  color: var(--payit-green) !important;
  box-shadow: none !important;
}

.stat-card .info .number,
.stat-card .info .number.green,
.stat-card .info .number.blue,
.stat-card .info .number.orange,
.stat-card .info .number.purple {
  color: var(--payit-ink) !important;
}

.stat-card .info .number.green {
  color: var(--payit-green) !important;
}

.stats-summary .stat-item,
.stats-summary .stat-box {
  background: var(--payit-surface) !important;
  border: 1px solid var(--payit-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--payit-shadow) !important;
}

.stats-summary .stat-item:hover,
.stats-summary .stat-box:hover {
  border-color: #d2ded6 !important;
  box-shadow: var(--payit-shadow-hover) !important;
}

.stats-summary .stat-item > i,
.stats-summary .stat-box > .icon {
  background: var(--payit-green-soft) !important;
  color: var(--payit-green) !important;
  box-shadow: none !important;
}

.stats-summary .stat-item .stat-label,
.stats-summary .stat-box .info h4,
.stats-summary .stat-box .info .amount {
  color: var(--payit-muted) !important;
}

.stats-summary .stat-item strong,
.stats-summary .stat-item .count,
.stats-summary .stat-box .info .number {
  color: var(--payit-ink) !important;
}

.progress-card .progress-header .percent,
.progress-card .progress-header .percent.green,
.progress-card .progress-header .percent.blue,
.progress-card .progress-header .percent.orange {
  color: var(--payit-green) !important;
}

.progress-card .progress-track {
  background: var(--payit-green-soft) !important;
}

.progress-card .progress-track .progress-fill,
.progress-card .progress-track .progress-fill.green {
  background: var(--payit-green) !important;
}

.progress-card .progress-track .progress-fill.blue {
  background: #4a6cf7 !important;
}

.progress-card .progress-track .progress-fill.orange {
  background: #f59e0b !important;
}

.activity-card .card-header h3 i,
.actions-card .card-header h3 i {
  color: var(--payit-green) !important;
  background: var(--payit-green-soft) !important;
}

.activity-card .card-header .view-all,
.activity-card .card-header .view-all:hover,
.action-btn i,
.action-btn .icon-blue,
.action-btn .icon-green,
.action-btn .icon-orange,
.action-btn .icon-purple {
  color: var(--payit-green) !important;
}

.activity-item .activity-icon,
.activity-item .activity-icon.payment,
.activity-item .activity-icon.student,
.activity-item .activity-icon.attendance,
.activity-item .activity-icon.event,
.activity-item .activity-icon.user,
.activity-item .activity-icon.default {
  background: var(--payit-green) !important;
  color: #fff !important;
}

.actions-card .action-btn {
  background: var(--payit-surface) !important;
  border-color: var(--payit-green) !important;
  color: var(--payit-ink) !important;
  border-width: 2px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 10px rgba(24, 90, 58, 0.08);
}

.actions-card .action-btn:hover {
  background: var(--payit-green-soft) !important;
  border-color: var(--payit-green-dark) !important;
  color: var(--payit-ink) !important;
}

.actions-card .action-btn i,
.actions-card .action-btn .icon-blue,
.actions-card .action-btn .icon-green,
.actions-card .action-btn .icon-orange,
.actions-card .action-btn .icon-purple {
  color: var(--payit-green) !important;
}

.dashboard-header .header-info .date-badge:hover {
  border-color: #b8cfc0 !important;
}

/* Shared surfaces, tables, and controls for the remaining web pages. */
.main,
.main-content,
.page-content,
.content-area {
  background-color: var(--payit-page) !important;
  color: var(--payit-ink);
}

.card,
.card-panel,
.table-card,
.scanner-card,
.scanner-table-card,
.report-section,
.kpi-card,
.stat-card,
.dashboard-card,
.content-card,
.filter-card,
.modal-content,
.panel,
.summary-card,
.details-card,
.form-card {
  background-color: var(--payit-surface);
  border-color: var(--payit-border);
  box-shadow: var(--payit-shadow);
}

table thead th {
  background-color: #f1f5f2 !important;
  color: #46544b !important;
}

table tbody tr:nth-child(even) {
  background-color: #f8faf8;
}

table tbody tr:hover {
  background-color: #eff5f1;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  border-color: #d7e1da;
  color: var(--payit-ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--payit-green) !important;
  box-shadow: 0 0 0 3px rgba(24, 90, 58, 0.12) !important;
}

.cron-setup-page .container {
  min-height: auto;
}

.cron-setup-page h1 {
  color: var(--payit-ink) !important;
}

.cron-setup-page .step {
  background: var(--payit-green-soft) !important;
  border-left-color: var(--payit-green) !important;
}

.cron-setup-page .step h3 {
  color: var(--payit-ink) !important;
}

.cron-setup-page .btn {
  background: var(--payit-green) !important;
  border-color: var(--payit-green) !important;
  color: #fff !important;
}

.cron-setup-page .btn:hover {
  background: var(--payit-green-dark) !important;
}

.btn-event-type,
.header-actions .btn.btn-fee,
.header-actions .btn.btn-warning,
.btn-edit,
.event-type-table .btn-edit {
  background: var(--payit-green) !important;
  border-color: var(--payit-green) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(24, 90, 58, 0.16) !important;
}

.btn-event-type:hover,
.header-actions .btn.btn-fee:hover,
.header-actions .btn.btn-warning:hover,
.btn-edit:hover,
.event-type-table .btn-edit:hover {
  background: var(--payit-green-dark) !important;
  border-color: var(--payit-green-dark) !important;
  color: #fff !important;
  box-shadow: 0 5px 12px rgba(16, 61, 42, 0.22) !important;
}

.pending-select-button {
  background: var(--payit-green) !important;
  border-color: var(--payit-green) !important;
  color: #fff !important;
}

.pending-select-button:hover {
  background: var(--payit-green-dark) !important;
  border-color: var(--payit-green-dark) !important;
  color: #fff !important;
}

@media (max-width: 768px) {
  .overview-tab-summary-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar .semester-badge,
  .filter-bar .clear-filter {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .report-container {
    margin: 12px auto 22px;
    padding: 16px;
    border-radius: 14px;
  }

  .report-section {
    padding: 12px;
  }

  .tab-bar {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
  }

  .tab-bar > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .overview-summary-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .overview-report-panel {
    padding: 13px;
  }

  .overview-report-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-report-distributions {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .overview-report-summary-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .report-container,
  body.print-preview .report-container {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .report-table {
    border-radius: 0;
  }
}

/* Responsive layout guardrails shared by the PHP web app. */
html,
body {
  min-width: 0;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

.main,
.main-content,
.page-content,
.content-area,
.page,
.report-container,
.table-card,
.scanner-table-card,
.report-section,
.modal-content,
.modal-box {
  min-width: 0;
}

.table-scroll,
.table-wrap,
.table-responsive,
.overview-report-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.toolbar-controls,
.toolbar-actions,
.filter-group,
.header-actions,
.page-toolbar,
.page-header,
.section-header,
.header-info,
.modal-actions,
.form-row,
.form-grid {
  min-width: 0;
  max-width: 100%;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  max-width: 100%;
}

@media (max-width: 1024px) {
  .container:has(> .sidebar) {
    width: 100%;
    max-width: 100%;
  }

  .container:has(> .sidebar) > .main > *,
  .container:has(> .sidebar) .main-content > *,
  .container:has(> .sidebar) .page-content > * {
    min-width: 0;
    max-width: 100%;
  }

  .container:has(> .sidebar) > .sidebar {
    width: min(250px, 28vw);
    flex: 0 0 min(250px, 28vw);
  }

  .container:has(> .sidebar) > .main {
    min-width: 0;
    padding-right: clamp(12px, 2.2vw, 22px);
    padding-left: clamp(12px, 2.2vw, 22px);
  }

  .report-grid,
  .stats-grid,
  .stat-cards,
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .container:has(> .sidebar) {
    display: flex;
    width: 100%;
    height: auto;
    max-height: none;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    overflow: visible;
  }

  .container:has(> .sidebar) > .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1050;
    width: min(280px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    flex: 0 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.sidebar-open .container:has(> .sidebar) > .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 1049;
    inset: 0;
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .mobile-menu-toggle,
  .menu-toggle {
    position: fixed !important;
    z-index: 1055 !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    min-width: 42px;
    min-height: 42px;
    touch-action: manipulation;
  }

  .container:has(> .sidebar) > .main {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 70px 14px 22px !important;
    overflow: visible;
  }

  .container:has(> .sidebar) > .main > *,
  .container:has(> .sidebar) .main-content > *,
  .container:has(> .sidebar) .page-content > * {
    min-width: 0;
    max-width: 100%;
  }

  .page-toolbar,
  .page-header,
  .section-header,
  .report-header,
  .overview-report-summary-heading,
  .overview-tab-summary-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .toolbar-controls,
  .toolbar-actions,
  .filter-group,
  .header-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .toolbar-controls > *,
  .filter-group > *,
  .header-actions > * {
    min-width: 0;
    max-width: 100%;
  }

  .table-scroll,
  .table-wrap,
  .table-responsive,
  .overview-report-table-wrap {
    width: 100%;
    overflow-x: auto;
  }

  .table-card:has(> table),
  .card:has(> table),
  .scanner-table-card:has(> table),
  .report-section:has(> table),
  .modal-content:has(> table) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll > table,
  .table-wrap > table,
  .table-responsive > table {
    min-width: 520px;
  }

  .overview-report-table-wrap > table,
  .table-card:has(> table) > table,
  .card:has(> table) > table,
  .scanner-table-card:has(> table) > table,
  .report-section:has(> table) > table,
  .modal-content:has(> table) > table {
    min-width: 0;
  }

  .overview-report-table-wrap > table:has(thead th:nth-child(n+4)),
  .table-card:has(> table) > table:has(thead th:nth-child(n+4)),
  .card:has(> table) > table:has(thead th:nth-child(n+4)),
  .scanner-table-card:has(> table) > table:has(thead th:nth-child(n+4)),
  .report-section:has(> table) > table:has(thead th:nth-child(n+4)),
  .modal-content:has(> table) > table:has(thead th:nth-child(n+4)) {
    min-width: 440px;
  }

  .overview-report-table-wrap > table:has(thead th:nth-child(n+6)),
  .table-card:has(> table) > table:has(thead th:nth-child(n+6)),
  .card:has(> table) > table:has(thead th:nth-child(n+6)),
  .scanner-table-card:has(> table) > table:has(thead th:nth-child(n+6)),
  .report-section:has(> table) > table:has(thead th:nth-child(n+6)),
  .modal-content:has(> table) > table:has(thead th:nth-child(n+6)) {
    min-width: 520px;
  }

  .report-section,
  .report-container,
  .overview-report-panel,
  .table-card,
  .scanner-table-card {
    max-width: 100%;
  }

  .report-section {
    padding: 14px;
  }

  .modal {
    padding: max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .modal-content,
  .modal-dialog,
  .modal-box,
  .student-detail-content,
  .student-qr-content {
    width: min(100%, 560px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .form-row,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-row > *,
  .form-grid > * {
    min-width: 0;
  }

  .page {
    width: 100%;
    margin: 14px auto;
    padding-right: 14px;
    padding-left: 14px;
  }

  .summary {
    flex-wrap: wrap;
  }

  .summary > * {
    flex: 1 1 160px;
    min-width: 0;
  }

  .login-box {
    padding: clamp(20px, 6vw, 40px);
  }
}

@media (max-width: 480px) {
  .container:has(> .sidebar) > .main {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  .stat-cards,
  .stats-grid,
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-toolbar,
  .page-header,
  .header-actions,
  .toolbar-actions,
  .modal-actions {
    gap: 8px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions > button,
  .modal-actions > .btn {
    flex: 1 1 auto;
  }

  .toolbar-controls input:not([type="checkbox"]):not([type="radio"]),
  .toolbar-controls select,
  .filter-group select,
  .filter-bar select,
  .search-box input,
  .search-box select {
    min-width: 0 !important;
    max-width: 100%;
  }

  .login-box {
    box-shadow: 6px 6px 0 #1f7a45;
  }
}

@media (max-width: 360px) {
  .stat-cards,
  .stats-grid,
  .dashboard-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-container {
    padding: 12px;
  }
}
