/* Payment SIGE — responsive institutional design system */

:root {
  --navy-950: #071426;
  --navy-900: #0b1f3a;
  --navy-800: #12345b;
  --blue-700: #1559d6;
  --blue-700-rgb: 21, 89, 214;
  --blue-600: #2471ef;
  --blue-solid: #1559d6;
  --blue-solid-rgb: 21, 89, 214;
  --blue-100: #dceafe;
  --blue-50: #eff6ff;
  --cyan-500: #19b9ca;
  --cyan-500-rgb: 25, 185, 202;
  --green-600: #08966f;
  --green-600-rgb: 8, 150, 111;
  --green-solid: #087a5c;
  --green-solid-rgb: 8, 122, 92;
  --green-100: #d9f7ec;
  --amber-600: #c4740a;
  --amber-600-rgb: 196, 116, 10;
  --amber-100: #fff1cc;
  --red-600: #d4384b;
  --red-600-rgb: 212, 56, 75;
  --red-solid: #c73549;
  --red-solid-rgb: 199, 53, 73;
  --red-100: #ffe1e5;
  --purple-600: #7656d8;
  --purple-600-rgb: 118, 86, 216;
  --purple-solid: #6746c7;
  --purple-solid-rgb: 103, 70, 199;
  --on-light: #132033;
  --ink-900: #162033;
  --ink-700: #3d4b61;
  --ink-500: #6d7a90;
  --line: #e5eaf1;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --sidebar-width: 280px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(13, 31, 58, 0.04), 0 8px 24px rgba(13, 31, 58, 0.06);
  --shadow-md: 0 16px 48px rgba(13, 31, 58, 0.12);
  --transition: 180ms ease;
}

[data-theme="dark"] {
  color-scheme: dark;
  --navy-950: #030a13;
  --navy-900: #071525;
  --navy-800: #102c4a;
  --blue-700: #69a2ff;
  --blue-700-rgb: 105, 162, 255;
  --blue-600: #4e8ff7;
  --blue-solid: #2f6fca;
  --blue-solid-rgb: 47, 111, 202;
  --blue-100: #17355e;
  --blue-50: #10263f;
  --green-600: #43cfa3;
  --green-solid: #087a5c;
  --green-solid-rgb: 8, 122, 92;
  --green-100: #123c33;
  --amber-600: #f0b453;
  --amber-100: #49351b;
  --red-600: #ff7180;
  --red-solid: #c73549;
  --red-solid-rgb: 199, 53, 73;
  --red-100: #4a2028;
  --purple-600: #a78bfa;
  --purple-solid: #6746c7;
  --purple-solid-rgb: 103, 70, 199;
  --ink-900: #edf4ff;
  --ink-700: #c5d2e4;
  --ink-500: #91a3ba;
  --line: #26384d;
  --surface: #101d2d;
  --canvas: #081321;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16), 0 10px 28px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 20px 54px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink-900);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue-700);
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1045;
  display: flex;
  width: min(86vw, var(--sidebar-width));
  flex-direction: column;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(36, 113, 239, 0.2), transparent 36%),
    linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  box-shadow: var(--shadow-md);
  transform: translateX(-102%);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidebar-open {
  overflow: hidden;
}

.sidebar-open .app-sidebar {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  visibility: hidden;
  background: rgba(3, 12, 26, 0.56);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-open .sidebar-overlay {
  visibility: visible;
  opacity: 1;
}

.sidebar-header {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan-500));
  box-shadow: 0 8px 24px rgba(36, 113, 239, 0.28);
  font-size: 1.15rem;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.brand-copy strong {
  font-weight: 750;
}

.brand-copy span {
  color: #7ee1ec;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sidebar-close,
.mobile-menu-button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
}

.sidebar-close {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-context {
  margin: 18px 16px 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.context-label,
.nav-section-label {
  display: block;
  color: #8fa5c0;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.context-label {
  margin-bottom: 10px;
}

.context-value {
  display: flex;
  align-items: center;
  gap: 11px;
}

.context-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  color: #8be4ee;
  border-radius: 10px;
  background: rgba(25, 185, 202, 0.12);
}

.context-value strong,
.context-value small {
  display: block;
}

.context-value strong {
  color: #fff;
  font-size: 0.85rem;
}

.context-value small {
  margin-top: 1px;
  color: #91a3ba;
  font-size: 0.7rem;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 14px 24px;
}

.nav-section-label {
  padding: 8px 12px;
}

.nav-section-spaced {
  margin-top: 18px;
}

.sidebar-link {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  margin: 3px 0;
  padding: 10px 13px;
  color: #b7c4d5;
  border-radius: 11px;
  font-size: 0.875rem;
  font-weight: 590;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}

.sidebar-link i {
  width: 20px;
  color: #7891ae;
  font-size: 1.05rem;
  text-align: center;
  transition: color var(--transition);
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.sidebar-link:hover i {
  color: #8be4ee;
}

.sidebar-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(36, 113, 239, 0.26), rgba(25, 185, 202, 0.08));
  box-shadow: inset 3px 0 0 var(--cyan-500);
}

.sidebar-link.active i {
  color: #62d6e3;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-700);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 680;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--blue-700);
  border-color: var(--blue-600);
}

.sidebar-theme-toggle {
  width: 100%;
  margin-bottom: 13px;
  color: #b7c4d5;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-theme-toggle:hover {
  color: #fff;
  border-color: rgba(139, 228, 238, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-theme-toggle {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.auth-theme-toggle {
  position: fixed;
  z-index: 20;
  top: 18px;
  right: 18px;
  padding: 0 13px;
  color: #d5e2f1;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(7, 20, 38, 0.72);
  backdrop-filter: blur(12px);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 11px;
}

.user-avatar,
.mobile-avatar {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  color: var(--on-light);
  border-radius: 50%;
  background: linear-gradient(135deg, #d9f7ec, #9ce8d4);
  font-size: 0.8rem;
  font-weight: 800;
}

.user-details {
  min-width: 0;
  flex: 1;
}

.user-details strong,
.user-details small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-details strong {
  color: #fff;
  font-size: 0.8rem;
}

.user-details small {
  color: #8fa5c0;
  font-size: 0.7rem;
}

.logout-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: #9db0c7;
  border-radius: 10px;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.logout-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.app-workspace {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.mobile-menu-button {
  color: var(--ink-900);
  background: var(--blue-50);
  font-size: 1.3rem;
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-900);
  font-size: 0.84rem;
  text-decoration: none;
}

.mobile-brand .brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.mobile-avatar {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.app-content,
.flash-region,
.app-footer {
  width: 100%;
  max-width: 1540px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 16px;
  padding-left: 16px;
}

.app-content {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 44px;
}

.flash-region {
  padding-top: 16px;
}

.flash-region:empty {
  display: none;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 18px;
  padding-bottom: 22px;
  color: var(--ink-500);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan-500);
}

/* Page structure */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--blue-700);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--ink-900);
  font-size: clamp(1.65rem, 5vw, 2.2rem);
  font-weight: 760;
  letter-spacing: -0.04em;
}

.page-description {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--ink-500);
  font-size: 0.9rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink-900);
  font-size: 1.05rem;
  font-weight: 730;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 0.8rem;
}

/* Cards and metrics */
.card {
  color: var(--ink-900);
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  border-color: #d5deeb !important;
  box-shadow: 0 12px 32px rgba(13, 31, 58, 0.09) !important;
}

.card-header {
  min-height: 60px;
  padding: 16px 18px;
  color: var(--ink-900);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
}

.card-body {
  padding: 18px;
}

.card-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  min-height: 142px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  right: -22px;
  bottom: -36px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--metric-soft, var(--blue-50));
  content: "";
}

.metric-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  color: var(--ink-500);
  font-size: 0.74rem;
  font-weight: 650;
}

.metric-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--metric-color, var(--blue-700));
  border-radius: 10px;
  background: var(--metric-soft, var(--blue-50));
  font-size: 1rem;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  color: var(--ink-900);
  font-size: clamp(1.65rem, 7vw, 2rem);
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: 1;
}

.metric-meta {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 0.68rem;
}

.metric-card.metric-pending {
  --metric-color: var(--amber-600);
  --metric-soft: var(--amber-100);
}

.metric-card.metric-success {
  --metric-color: var(--green-600);
  --metric-soft: var(--green-100);
}

.metric-card.metric-failed {
  --metric-color: var(--red-600);
  --metric-soft: var(--red-100);
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.action-panel {
  position: relative;
  min-height: 260px;
  padding: 24px;
  color: #fff;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(36, 113, 239, 0.96), rgba(11, 31, 58, 0.98)),
    var(--navy-900);
  box-shadow: 0 20px 50px rgba(21, 89, 214, 0.22);
  overflow: hidden;
}

.action-panel::before,
.action-panel::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  content: "";
}

.action-panel::before {
  right: -70px;
  bottom: -110px;
  width: 280px;
  height: 280px;
}

.action-panel::after {
  right: 36px;
  bottom: -86px;
  width: 180px;
  height: 180px;
}

.action-panel-content {
  position: relative;
  z-index: 1;
  max-width: 470px;
}

.action-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9eeaf1;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.action-panel h2 {
  margin: 13px 0 9px;
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.action-panel p {
  max-width: 430px;
  margin: 0 0 24px;
  color: #c9d9ea;
  font-size: 0.86rem;
}

.profile-panel {
  height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.profile-heading .user-avatar {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.profile-heading strong,
.profile-heading small {
  display: block;
}

.profile-heading strong {
  font-size: 0.9rem;
}

.profile-heading small {
  color: var(--ink-500);
  font-size: 0.73rem;
}

.context-list {
  display: grid;
  gap: 10px;
}

.context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.context-row span:first-child {
  color: var(--ink-500);
}

.context-row strong {
  color: var(--ink-900);
  text-align: right;
}

/* Payment hub */
.queue-schedule-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--blue-600) 24%, var(--line));
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.queue-schedule-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  color: var(--blue-700);
  border-radius: 13px;
  background: var(--blue-50);
  font-size: 1.15rem;
}

.queue-schedule-copy {
  min-width: 0;
  flex: 1;
}

.queue-schedule-copy strong,
.queue-schedule-copy small {
  display: inline;
}

.queue-schedule-copy strong {
  color: var(--ink-900);
  font-size: 1rem;
}

.queue-schedule-copy strong small {
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 600;
}

.queue-schedule-copy p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.schedule-summary {
  display: flex;
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--canvas);
}

.schedule-summary small {
  color: var(--ink-500);
  font-size: 0.7rem;
}

.schedule-summary strong {
  color: var(--ink-900);
  font-size: 1.25rem;
}

.payment-hero {
  position: relative;
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #dbe6f5;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(110deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(21, 89, 214, 0.05) 40px);
  overflow: hidden;
}

.payment-hero::after {
  position: absolute;
  top: -88px;
  right: -50px;
  width: 230px;
  height: 230px;
  border: 34px solid rgba(36, 113, 239, 0.07);
  border-radius: 50%;
  content: "";
}

.payment-hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.payment-hero-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: #fff;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue-700), var(--cyan-500));
  box-shadow: 0 10px 24px rgba(36, 113, 239, 0.24);
}

.payment-hero h1 {
  margin: 0;
  font-size: clamp(1.65rem, 6vw, 2.35rem);
  font-weight: 780;
  letter-spacing: -0.045em;
}

.payment-hero p {
  margin: 8px 0 0;
  color: var(--ink-500);
}

.payment-type-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.payment-option {
  position: relative;
  display: flex;
  min-height: 240px;
  flex-direction: column;
  padding: 22px;
  color: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.payment-option::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--option-color, var(--blue-600));
  content: "";
}

.payment-option:hover {
  color: var(--ink-900);
  border-color: color-mix(in srgb, var(--option-color, var(--blue-600)) 35%, var(--line));
  box-shadow: 0 18px 42px rgba(13, 31, 58, 0.11);
  transform: translateY(-3px);
}

.payment-option.option-green {
  --option-color: var(--green-600);
  --option-soft: var(--green-100);
}

.payment-option.option-red {
  --option-color: var(--red-600);
  --option-soft: var(--red-100);
}

.payment-option-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  color: var(--option-color, var(--blue-600));
  border-radius: 13px;
  background: var(--option-soft, var(--blue-100));
  font-size: 1.25rem;
}

.payment-option h2 {
  margin: 20px 0 8px;
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.payment-option p {
  flex: 1;
  margin: 0 0 22px;
  color: var(--ink-500);
  font-size: 0.8rem;
}

.option-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--option-color, var(--blue-600));
  font-size: 0.78rem;
  font-weight: 750;
}

.option-action i {
  transition: transform var(--transition);
}

.payment-option:hover .option-action i {
  transform: translateX(4px);
}

/* Forms, buttons, tables and Bootstrap refinements */
.btn {
  min-height: 42px;
  padding: 0.58rem 1rem;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 680;
  box-shadow: none !important;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-lg {
  min-height: 50px;
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.btn-sm {
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.74rem;
}

.btn-primary {
  color: #fff;
  border-color: var(--blue-solid);
  background: var(--blue-solid);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #104bbb;
  background: #104bbb;
}

.btn-success {
  color: #fff;
  border-color: var(--green-solid);
  background: var(--green-solid);
}

.btn-danger {
  color: #fff;
  border-color: var(--red-solid);
  background: var(--red-solid);
}

.btn-purple {
  color: #fff;
  border-color: var(--purple-solid);
  background: var(--purple-solid);
}

.btn-light {
  color: var(--on-light);
  border-color: #fff;
  background: #fff;
}

.btn-light:hover {
  color: var(--on-light);
  border-color: #eaf2ff;
  background: #eaf2ff;
}

.form-label {
  margin-bottom: 7px;
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 680;
}

.form-control,
.form-select {
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  color: var(--ink-900);
  border: 1px solid #d7dee9;
  border-radius: 10px;
  background-color: #fff;
  font-size: 0.86rem;
}

.form-control::placeholder {
  color: #9ca8b8;
}

.form-control:focus,
.form-select:focus {
  color: var(--ink-900);
  border-color: var(--blue-600);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(36, 113, 239, 0.12);
}

.form-control-lg,
.form-select-lg {
  min-height: 50px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.form-check-input:checked {
  border-color: var(--blue-700);
  background-color: var(--blue-700);
}

.form-text {
  color: var(--ink-500);
  font-size: 0.7rem;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink-700);
  margin: 0;
  font-size: 0.8rem;
}

.table thead th,
.table-light,
.table-dark {
  --bs-table-bg: #f8fafc;
  --bs-table-color: var(--ink-500);
}

.table th {
  padding: 13px 16px;
  color: var(--ink-500);
  border-bottom: 1px solid var(--line);
  font-size: 0.66rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  color: var(--ink-700);
  border-color: var(--line);
  vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: #f8fbff;
  color: var(--ink-900);
}

.badge {
  padding: 0.46em 0.7em;
  border-radius: 7px;
  font-size: 0.66rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge.bg-primary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-purple {
  color: #fff;
}

.badge.bg-warning,
.badge.bg-info {
  color: var(--on-light);
}

.bg-primary {
  background-color: rgba(var(--blue-solid-rgb), var(--bs-bg-opacity, 1)) !important;
}

.bg-success {
  background-color: rgba(var(--green-solid-rgb), var(--bs-bg-opacity, 1)) !important;
}

.bg-danger {
  background-color: rgba(var(--red-solid-rgb), var(--bs-bg-opacity, 1)) !important;
}

.bg-warning {
  background-color: rgba(var(--amber-600-rgb), var(--bs-bg-opacity, 1)) !important;
}

.bg-info {
  background-color: rgba(var(--cyan-500-rgb), var(--bs-bg-opacity, 1)) !important;
}

.bg-purple {
  background-color: rgba(var(--purple-solid-rgb), var(--bs-bg-opacity, 1)) !important;
}

.text-primary {
  color: var(--blue-700) !important;
}

.text-success {
  color: var(--green-600) !important;
}

.text-danger {
  color: var(--red-600) !important;
}

.text-warning {
  color: var(--amber-600) !important;
}

.text-info {
  color: #0d95a5 !important;
}

.text-purple {
  color: var(--purple-600) !important;
}

.text-muted {
  color: var(--ink-500) !important;
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 13px 46px 13px 15px;
  border-radius: 11px;
  font-size: 0.8rem;
}

.alert .btn-close {
  top: 50%;
  transform: translateY(-50%);
}

.breadcrumb {
  margin-bottom: 0;
  font-size: 0.76rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #a2adbb;
}

.modal-content {
  color: var(--ink-900);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header,
.modal-footer {
  padding: 16px 20px;
  border-color: var(--line);
}

.modal-body {
  padding: 20px;
}

/* Login */
.auth-body {
  background:
    radial-gradient(circle at 12% 12%, rgba(36, 113, 239, 0.18), transparent 28%),
    radial-gradient(circle at 92% 88%, rgba(25, 185, 202, 0.15), transparent 26%),
    var(--navy-950);
}

.auth-main {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.auth-flash {
  position: fixed;
  z-index: 10;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 32px), 520px);
  padding: 0;
  transform: translateX(-50%);
}

.auth-shell {
  display: grid;
  width: min(100%, 1040px);
  max-width: 1040px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.auth-showcase {
  position: relative;
  display: none;
  min-height: 620px;
  padding: 46px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(36, 113, 239, 0.7), rgba(7, 20, 38, 0.94)),
    var(--navy-900);
  overflow: hidden;
}

.auth-showcase::before {
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 420px;
  height: 420px;
  border: 54px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  content: "";
}

.auth-showcase-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.auth-message {
  max-width: 380px;
}

.auth-message h1 {
  margin: 0 0 16px;
  font-size: 2.35rem;
  font-weight: 760;
  letter-spacing: -0.05em;
  line-height: 1.08;
}

.auth-message p {
  margin: 0;
  color: #c5d8ec;
}

.auth-trust {
  display: flex;
  gap: 10px;
  color: #a9c2dc;
  font-size: 0.73rem;
}

.auth-card {
  display: flex;
  min-height: 540px;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 30px 22px;
  color: var(--ink-900);
  background: #fff;
}

.auth-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: var(--ink-900);
  text-decoration: none;
}

.auth-card h2 {
  margin: 0;
  font-size: clamp(1.65rem, 7vw, 2rem);
  font-weight: 770;
  letter-spacing: -0.04em;
}

.auth-card-subtitle {
  margin: 8px 0 28px;
  color: var(--ink-500);
  font-size: 0.84rem;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap > i {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 14px;
  color: #8c9aab;
  transform: translateY(-50%);
}

.input-icon-wrap .form-control {
  padding-left: 42px;
}

.auth-support {
  margin: 24px 0 0;
  color: var(--ink-500);
  font-size: 0.72rem;
  text-align: center;
}

/* The authentication page is deliberately compact on phone screens. */
@media (max-width: 767.98px) {
  .auth-main {
    display: block;
    padding-top: max(140px, calc(env(safe-area-inset-top) + 120px));
  }

  .auth-flash {
    top: max(68px, calc(env(safe-area-inset-top) + 52px));
  }

  .auth-flash .alert {
    margin: 0;
    padding-right: 42px;
    text-align: left;
  }

  .auth-shell {
    border-radius: 20px;
  }

  .auth-card {
    min-height: 0;
    padding: 30px 24px;
  }

  .auth-mobile-brand {
    margin-bottom: 26px;
  }

  .auth-card-subtitle {
    margin-bottom: 24px;
  }

  /* Safari on iOS zooms focused controls whose text is smaller than 16px. */
  .form-control,
  .form-select {
    font-size: 16px;
  }

  .auth-support {
    margin-top: 20px;
  }

  .auth-theme-toggle {
    top: max(14px, env(safe-area-inset-top));
    right: 16px;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .auth-theme-toggle [data-theme-label] {
    display: none;
  }
}

@media (max-width: 374.98px) {
  .auth-card {
    padding: 26px 20px;
  }

  .auth-card h2 {
    font-size: 1.55rem;
  }

  .form-control-lg {
    min-height: 48px;
  }
}

/* Utilities and legacy compatibility */
.min-vh-75 {
  min-height: 75vh;
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.fade-in {
  animation: fadeIn 0.35s ease-out both;
}

.payment-card:hover,
.stat-card:hover {
  transform: translateY(-2px);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b8c3d1;
  background-clip: content-box;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .mobile-header {
  background: rgba(8, 19, 33, 0.92);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .payment-option:hover {
  border-color: #38506b !important;
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.28) !important;
}

[data-theme="dark"] .card-footer,
[data-theme="dark"] .table thead th,
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-dark {
  --bs-table-bg: #132337;
  --bs-table-color: var(--ink-700);
  background: #132337;
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: #14263a;
  color: var(--ink-900);
}

[data-theme="dark"] .table-danger > * {
  --bs-table-bg-state: rgba(255, 113, 128, 0.13);
  --bs-table-color-state: var(--ink-900);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  color: var(--ink-900);
  border-color: #334960;
  background-color: #0c1928;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  color: var(--ink-900);
  background-color: #0c1928;
}

[data-theme="dark"] .payment-hero {
  border-color: #263f5d;
  background:
    linear-gradient(110deg, rgba(16, 38, 63, 0.98), rgba(16, 29, 45, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(105, 162, 255, 0.06) 40px);
}

[data-theme="dark"] .text-dark {
  color: var(--ink-900) !important;
}

[data-theme="dark"] .bg-warning.text-dark,
[data-theme="dark"] .bg-info.text-dark,
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-info {
  color: var(--on-light) !important;
}

[data-theme="dark"] .text-secondary {
  color: var(--ink-700) !important;
}

[data-theme="dark"] .page-link {
  color: var(--blue-700);
  border-color: var(--line);
  background: var(--surface);
}

[data-theme="dark"] .page-item.disabled .page-link {
  color: var(--ink-500);
  background: #132337;
}

[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-white {
  background-color: var(--surface) !important;
}

[data-theme="dark"] .auth-shell,
[data-theme="dark"] .auth-card {
  color: var(--ink-900);
  background: var(--surface);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

@media (max-width: 575.98px) {
  .queue-schedule-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .queue-schedule-banner > .badge {
    margin-left: 62px;
  }
}

@media (min-width: 576px) {
  .app-content,
  .flash-region,
  .app-footer {
    padding-right: 24px;
    padding-left: 24px;
  }

  .page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .payment-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (min-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .metric-card {
    min-height: 154px;
    padding: 20px;
  }

  .payment-type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .payment-hero {
    padding: 34px;
  }

  .auth-shell {
    grid-template-columns: 1.08fr 0.92fr;
  }

  .auth-card {
    padding: 44px;
  }

  .auth-showcase {
    display: block;
  }

  .auth-mobile-brand {
    display: none;
  }
}

@media (min-width: 992px) {
  .app-sidebar {
    width: var(--sidebar-width);
    transform: none;
    box-shadow: none;
  }

  .sidebar-overlay {
    display: none;
  }

  .app-workspace {
    margin-left: var(--sidebar-width);
  }

  .app-content,
  .flash-region,
  .app-footer {
    padding-right: 34px;
    padding-left: 34px;
  }

  .app-content {
    padding-top: 38px;
    padding-bottom: 54px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.7fr);
  }

  .action-panel {
    min-height: 300px;
    padding: 34px;
  }
}

@media (min-width: 1280px) {
  .app-content,
  .flash-region,
  .app-footer {
    padding-right: 46px;
    padding-left: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.grade-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}

.grade-flow-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink-500);
  font-size: 0.78rem;
  font-weight: 700;
}

.grade-flow-steps li span {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.grade-flow-steps li.active,
.grade-flow-steps li.completed {
  color: var(--blue-700);
}

.grade-flow-steps li.active span {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(var(--blue-700-rgb), 0.1);
}

.grade-flow-steps li.completed span {
  border-color: var(--green-600);
  background: var(--green-600);
  color: #fff;
}

.grade-flow-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
}

.student-context {
  padding: 18px;
  border: 1px solid rgba(var(--blue-700-rgb), 0.16);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.grade-sheet-search {
  width: min(100%, 280px);
}

.grade-sheet-table-wrap {
  max-height: 68vh;
}

.grade-sheet-table {
  min-width: 980px;
  font-size: 0.82rem;
}

.grade-sheet-table thead {
  position: sticky;
  z-index: 2;
  top: 0;
}

.grade-sheet-table th {
  white-space: nowrap;
  background: var(--canvas);
}

.grade-sheet-table td:first-child {
  min-width: 220px;
  font-weight: 600;
}

.grade-sheet-table .grade-input {
  min-width: 86px;
  text-align: right;
  font-weight: 700;
}

/* Keep the student selected for editing prominent without losing contrast. */
.grade-sheet-table tbody tr.table-primary > * {
  --bs-table-bg: #e5f0ff;
  --bs-table-hover-bg: #d8e9ff;
  --bs-table-color: #102542;
  color: #102542 !important;
  border-color: #b8d2f4;
}

[data-theme="dark"] .grade-sheet-table tbody tr.table-primary > * {
  --bs-table-bg: #173b61;
  --bs-table-hover-bg: #204d7f;
  --bs-table-color: #f4f8ff;
  color: #f4f8ff !important;
  border-color: #376995;
}

[data-theme="dark"] .grade-sheet-table tbody tr.table-primary .grade-input {
  color: #f4f8ff;
  border-color: #4c7bab;
  background-color: #0c1d31;
}

.grade-sheet-context dt {
  margin-top: 14px;
  color: var(--ink-500);
  font-weight: 600;
}

.grade-sheet-table tr.grade-row-locked > * {
  background: color-mix(in srgb, var(--amber-100) 65%, transparent);
}

.grade-sheet-table tr.grade-row-conflict > * {
  box-shadow: inset 4px 0 0 var(--red-600);
}

.grade-sheet-table tr.grade-row-mine > * {
  box-shadow: inset 3px 0 0 var(--blue-700);
}

.grade-input.grade-lock-pending {
  cursor: wait;
  opacity: 0.7;
}

.grade-sheet-context dt:first-child {
  margin-top: 0;
}

.grade-sheet-context dd {
  margin-top: 3px;
  margin-bottom: 0;
  color: var(--ink-900);
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .grade-flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Payments already present in the active queue remain visible but unavailable. */
.queued-payment-row > * {
    opacity: 0.68;
}

.queued-payment-row .badge {
    opacity: 1;
}
