﻿/* ScholarWallet Enterprise Theme - final authoritative visual layer */
:root {
  --sw-bg: #f5f2eb;
  --sw-page: #f7f5ef;
  --sw-surface: #ffffff;
  --sw-surface-soft: #fbfaf6;
  --sw-ink: #101722;
  --sw-ink-2: #1f2937;
  --sw-muted: #697386;
  --sw-border: #e7dfd2;
  --sw-border-2: #d8cbb8;
  --sw-accent: #9a661b;
  --sw-accent-dark: #6f430f;
  --sw-accent-soft: #f4e6cc;
  --sw-danger: #b42318;
  --sw-danger-soft: #fff4f2;
  --bs-primary: #9a661b;
  --bs-success: #9a661b;
  --bs-info: #697386;
  --bs-warning: #9a661b;
  --bs-danger: #b42318;
  --bs-blue: #9a661b;
  --bs-green: #9a661b;
  --bs-cyan: #697386;
  --bs-purple: #6f430f;
  --bs-pink: #697386;
}
html, body {
  background: linear-gradient(135deg, #fbfaf6 0%, #f5f2eb 100%) !important;
  color: var(--sw-ink) !important;
}
#sidebar {
  background: linear-gradient(180deg, #101722 0%, #151e2b 58%, #101722 100%) !important;
  border-right: 1px solid rgba(255,255,255,.06) !important;
  box-shadow: 18px 0 42px rgba(16,23,34,.18) !important;
}
#sidebar::before { opacity: .28 !important; }
#sidebar .sidebar-brand,
#sidebar .sidebar-footer {
  background: rgba(16,23,34,.98) !important;
  border-color: rgba(255,255,255,.075) !important;
}
#sidebar .brand-icon,
#sidebar .user-avatar {
  background: #9a661b !important;
  box-shadow: none !important;
}
#sidebar .brand-name { color: #fff !important; }
#sidebar .brand-sub,
#sidebar .user-info .role { color: #a8b3c5 !important; }
#sidebar .nav-section { color: #74839a !important; }
#sidebar .nav-link {
  color: #b8c2d1 !important;
  background: transparent !important;
  border-color: transparent !important;
}
#sidebar .nav-link i { color: #9aa8bb !important; }
#sidebar .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.08) !important;
}
#sidebar .nav-link:hover i { color: #fff !important; }
#sidebar .nav-link.active {
  color: #fff !important;
  background: rgba(154,102,27,.18) !important;
  border-color: rgba(201,154,76,.2) !important;
  box-shadow: inset 3px 0 0 #c99a4c !important;
}
#sidebar .nav-link.active i { color: #f3d7a0 !important; }
#sidebar .logout-link { color: #d8cbb8 !important; }
#sidebar .logout-link:hover { color: #fff !important; background: rgba(255,255,255,.07) !important; }
.sidebar-scroll-btn {
  background: rgba(255,255,255,.055) !important;
  border-color: rgba(255,255,255,.08) !important;
  color: #b8c2d1 !important;
}
#topbar {
  background: rgba(255,255,255,.96) !important;
  border-bottom: 1px solid #e7dfd2 !important;
}
#topbar .page-title,
h1, h2, h3, h4, h5, h6 { color: var(--sw-ink) !important; }
.card,
.table-responsive,
.modal-content,
.report-card,
.clean-table-card,
.backup-card,
.health-card,
.portal-card,
.scan-card,
.payment-card,
.student-id-card,
.id-card,
.ticket-card,
[class*="-card"] {
  border-color: var(--sw-border) !important;
  box-shadow: 0 12px 34px rgba(16,23,34,.07) !important;
}
.card-header,
.table thead th,
.table-light,
.bg-light,
.clean-table thead th,
.activity-table th {
  background: #fbfaf6 !important;
  color: #8a94a6 !important;
  border-color: var(--sw-border) !important;
}
.table tbody tr:nth-child(odd),
.table-striped tbody tr:nth-of-type(odd) { background-color: #fbfaf6 !important; }
.table tbody tr:nth-child(even),
.table-striped tbody tr:nth-of-type(even) { background-color: #fff !important; }
.table-hover tbody tr:hover,
.table tbody tr:hover { background-color: #f4ead8 !important; }
.table td, .table th { border-color: #ece5da !important; }
/* Primary actions only use restrained gold */
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover,
button[type="submit"].btn:not(.btn-danger):not(.btn-outline-danger),
button.btn-primary,
a.btn-primary,
a.btn-success,
a.btn-info,
a.btn-warning {
  background: #9a661b !important;
  border-color: #9a661b !important;
  color: #fff !important;
  box-shadow: none !important;
}
.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-warning:hover,
button[type="submit"].btn:not(.btn-danger):not(.btn-outline-danger):hover {
  background: #6f430f !important;
  border-color: #6f430f !important;
  color: #fff !important;
}
.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-secondary {
  background: #fff !important;
  border-color: #bfa675 !important;
  color: #6f430f !important;
}
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
  background: #f4e6cc !important;
  border-color: #9a661b !important;
  color: #6f430f !important;
}
/* Stop Bootstrap semantic colors from creating a rainbow */
.bg-primary,
.bg-success,
.bg-info,
.bg-warning,
.bg-primary-subtle,
.bg-success-subtle,
.bg-info-subtle,
.bg-warning-subtle,
.text-bg-primary,
.text-bg-success,
.text-bg-info,
.text-bg-warning {
  background-color: #f4e6cc !important;
  color: #4b3415 !important;
  border-color: #d8c099 !important;
}
.text-primary,
.text-success,
.text-info,
.text-warning,
.text-green,
[class*="text-primary"],
[class*="text-success"],
[class*="text-info"],
[class*="text-warning"] {
  color: #6f430f !important;
}
.border-primary,
.border-success,
.border-info,
.border-warning,
.border-primary-subtle,
.border-success-subtle,
.border-info-subtle,
.border-warning-subtle {
  border-color: #d8c099 !important;
}
.badge,
.clean-chip,
.status-badge,
.role-badge,
.health-badge,
.audit-chip,
[class*="badge"] {
  background: #f3f1ec !important;
  color: #374151 !important;
  border: 1px solid #ded6c8 !important;
  box-shadow: none !important;
}
.badge.bg-danger,
.badge.text-bg-danger,
.bg-danger,
.text-bg-danger,
.clean-chip.danger {
  background: var(--sw-danger-soft) !important;
  color: var(--sw-danger) !important;
  border-color: #fecdca !important;
}
.text-danger,
.amount-negative,
.deduction-amount { color: var(--sw-danger) !important; }
.alert-success,
.alert-info,
.alert-warning {
  background: #f8efe0 !important;
  border-color: #dcc49c !important;
  color: #4b3415 !important;
}
.alert-danger { background: var(--sw-danger-soft) !important; border-color: #fecdca !important; color: var(--sw-danger) !important; }
.form-control,
.form-select,
.input-group-text {
  border-color: var(--sw-border) !important;
  background-color: #fff !important;
}
.form-control:focus,
.form-select:focus {
  border-color: #9a661b !important;
  box-shadow: 0 0 0 4px rgba(154,102,27,.13) !important;
}
.nav-tabs .nav-link.active,
.nav-pills .nav-link.active,
.list-group-item.active,
.dropdown-item.active,
.dropdown-item:active,
.progress-bar {
  background: #9a661b !important;
  border-color: #9a661b !important;
  color: #fff !important;
}
.nav-tabs .nav-link,
.list-group-item { color: #374151 !important; }
a:not(.btn):not(.nav-link),
.page-link { color: #6f430f !important; }
a:not(.btn):not(.nav-link):hover,
.page-link:hover { color: #4b2b09 !important; }
/* Neutralize old inline colorful UI on tables/charts/cards */
[style*="#006"], [style*="#0d6efd"], [style*="#2563eb"], [style*="#16a34a"], [style*="#22c55e"], [style*="#4ade80"], [style*="#0891b2"], [style*="#14b8a6"], [style*="#0f766e"], [style*="rgb(0"], [style*="rgb(22"], [style*="rgb(37"] {
  color: #6f430f !important;
  border-color: #d8c099 !important;
}
/* Export/utility buttons should be professional, not traffic-light colors */
a[href*="csv"].btn,
button[name*="csv"].btn,
.btn-export,
.btn-outline-success,
.btn-outline-danger {
  color: #6f430f !important;
  border-color: #bfa675 !important;
  background: #fff !important;
}
/* Tables: reduce colored pills in student/status rows */
td .badge,
td .btn-sm,
td .clean-chip {
  font-weight: 800 !important;
}
/* Keep only true failures red */
.table .text-danger,
.table [class*="danger"],
.badge.bg-danger { color: var(--sw-danger) !important; }
/* Login/portal/public pages */
.login-card,
.reset-card,
.portal-shell,
.public-portal-shell {
  background: #fff !important;
  border-color: var(--sw-border) !important;
}
/* Print surfaces stay restrained */
@media print {
  body { background: #fff !important; }
  .btn, #sidebar, #topbar, .no-print { display: none !important; }
}
/* Wide-table usability: visible bottom horizontal scrollbar */
#main-wrapper,
#page-content {
  min-width: 0 !important;
}
body {
  overflow-x: auto !important;
}
.table-responsive,
.clean-table-scroll,
.data-table-wrap,
.user-table-wrap,
.transaction-table-wrap,
.report-table-wrap {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  padding-bottom: 12px !important;
  scrollbar-width: auto !important;
  scrollbar-color: #9a661b #efe8dc !important;
}
.table-responsive::-webkit-scrollbar,
.clean-table-scroll::-webkit-scrollbar,
.data-table-wrap::-webkit-scrollbar,
.user-table-wrap::-webkit-scrollbar,
.transaction-table-wrap::-webkit-scrollbar,
.report-table-wrap::-webkit-scrollbar {
  height: 14px !important;
}
.table-responsive::-webkit-scrollbar-track,
.clean-table-scroll::-webkit-scrollbar-track,
.data-table-wrap::-webkit-scrollbar-track,
.user-table-wrap::-webkit-scrollbar-track,
.transaction-table-wrap::-webkit-scrollbar-track,
.report-table-wrap::-webkit-scrollbar-track {
  background: #efe8dc !important;
  border-radius: 999px !important;
}
.table-responsive::-webkit-scrollbar-thumb,
.clean-table-scroll::-webkit-scrollbar-thumb,
.data-table-wrap::-webkit-scrollbar-thumb,
.user-table-wrap::-webkit-scrollbar-thumb,
.transaction-table-wrap::-webkit-scrollbar-thumb,
.report-table-wrap::-webkit-scrollbar-thumb {
  background: #9a661b !important;
  border-radius: 999px !important;
  border: 3px solid #efe8dc !important;
}
.table-responsive > table,
.clean-table-scroll > table,
.data-table-wrap > table,
.user-table-wrap > table,
.transaction-table-wrap > table,
.report-table-wrap > table {
  width: max-content !important;
  min-width: 1180px !important;
}
@media (max-width: 992px) {
  .table-responsive > table,
  .clean-table-scroll > table,
  .data-table-wrap > table,
  .user-table-wrap > table,
  .transaction-table-wrap > table,
  .report-table-wrap > table {
    min-width: 980px !important;
  }
}
/* ScholarWallet UI Polish Pass - unified premium private-school system */
:root {
  --sw-navy-950: #0b1220;
  --sw-navy-900: #111827;
  --sw-navy-850: #162033;
  --sw-navy-800: #1f2937;
  --sw-cream-50: #fffdf8;
  --sw-cream-100: #fbf7ed;
  --sw-cream-200: #f3eadb;
  --sw-gold-700: #a96f18;
  --sw-gold-800: #7a4a10;
  --sw-gold-500: #c39242;
  --sw-radius-sm: 10px;
  --sw-radius-md: 16px;
  --sw-radius-lg: 22px;
  --sw-shadow-sm: 0 8px 22px rgba(15, 23, 42, .06);
  --sw-shadow-md: 0 18px 46px rgba(15, 23, 42, .10);
  --sw-shadow-soft: 0 22px 70px rgba(122, 74, 16, .10);
}

* { text-rendering: geometricPrecision; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", "Aptos", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: -.012em;
}

#main-wrapper {
  background:
    radial-gradient(circle at 18% 8%, rgba(195,146,66,.12), transparent 28%),
    linear-gradient(135deg, var(--sw-cream-50), var(--sw-cream-100) 64%, #f7efe0) !important;
}
#page-content,
.main-content,
.content-wrapper {
  padding: clamp(18px, 2.5vw, 34px) !important;
}
#topbar {
  min-height: 76px !important;
  padding: 0 clamp(18px, 2.3vw, 34px) !important;
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(231,223,210,.75) !important;
}
#topbar .page-title {
  font-size: clamp(1.35rem, 2.2vw, 2rem) !important;
  font-weight: 850 !important;
  letter-spacing: -.04em !important;
}
#currentTime,
.time-pill,
#topbar .time-display {
  background: rgba(255,255,255,.78) !important;
  border: 1px solid var(--sw-border) !important;
  color: #536176 !important;
  border-radius: 999px !important;
  padding: 10px 18px !important;
  box-shadow: var(--sw-shadow-sm) !important;
  font-weight: 800 !important;
}

#sidebar {
  background:
    radial-gradient(circle at 25% 0%, rgba(195,146,66,.20), transparent 22%),
    linear-gradient(180deg, #0b1220 0%, #111827 46%, #0c1422 100%) !important;
}
#sidebar .sidebar-brand { padding: 22px 20px !important; }
#sidebar .brand-icon {
  width: 58px !important;
  height: 58px !important;
  border-radius: 18px !important;
  background: #fff !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  overflow: hidden !important;
}
#sidebar .brand-name {
  font-size: 1.22rem !important;
  font-weight: 900 !important;
  letter-spacing: -.035em !important;
}
#sidebar .brand-sub { font-size: .92rem !important; }
#sidebar .sidebar-nav { padding: 18px 10px !important; }
#sidebar .nav-section {
  margin: 22px 16px 9px !important;
  font-size: .73rem !important;
  font-weight: 900 !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
}
#sidebar .nav-link {
  margin: 3px 8px !important;
  padding: 12px 15px !important;
  border-radius: 15px !important;
  font-weight: 800 !important;
  gap: 12px !important;
  transition: background .18s ease, color .18s ease, transform .18s ease !important;
}
#sidebar .nav-link i {
  width: 22px !important;
  font-size: 1.1rem !important;
}
#sidebar .nav-link:hover { transform: translateX(2px); }
#sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(169,111,24,.24), rgba(195,146,66,.10)) !important;
  border: 1px solid rgba(195,146,66,.34) !important;
  box-shadow: inset 4px 0 0 var(--sw-gold-500), 0 12px 26px rgba(0,0,0,.16) !important;
}
#sidebar .sidebar-footer {
  padding: 17px 15px 20px !important;
}
#sidebar .user-avatar {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, var(--sw-gold-700), var(--sw-gold-800)) !important;
}
#sidebar .logout-link {
  border-radius: 14px !important;
  padding: 12px 14px !important;
  font-weight: 850 !important;
}
.sidebar-scroll-btn { height: 32px !important; border-radius: 999px !important; }

.card,
.report-card,
.clean-table-card,
.backup-card,
.health-card,
.portal-card,
.scan-card,
.payment-card,
.settings-card,
.dashboard-card,
.modal-content,
.table-responsive,
[class*="-panel"] {
  background: rgba(255,255,255,.88) !important;
  border: 1px solid var(--sw-border) !important;
  border-radius: var(--sw-radius-lg) !important;
  box-shadow: var(--sw-shadow-md) !important;
}
.card-header,
.modal-header,
.report-card-header,
.clean-card-header {
  background: linear-gradient(180deg, rgba(255,253,248,.96), rgba(251,247,237,.92)) !important;
  border-bottom: 1px solid var(--sw-border) !important;
  border-radius: var(--sw-radius-lg) var(--sw-radius-lg) 0 0 !important;
}
.modal-header.bg-warning,
.modal-header[style*="background"] {
  background: linear-gradient(135deg, var(--sw-navy-900), var(--sw-navy-800)) !important;
  color: #fff !important;
}

h1, .h1 { font-size: clamp(2rem, 3.3vw, 2.7rem) !important; font-weight: 900 !important; letter-spacing: -.055em !important; }
h2, .h2 { font-size: clamp(1.55rem, 2.4vw, 2.15rem) !important; font-weight: 900 !important; letter-spacing: -.045em !important; }
h3, .h3 { font-size: clamp(1.22rem, 1.8vw, 1.55rem) !important; font-weight: 850 !important; letter-spacing: -.035em !important; }
label,
.form-label,
.table thead th,
.clean-table thead th,
.nav-tabs .nav-link,
.list-group-item {
  font-weight: 850 !important;
}
.text-muted,
.small.text-muted,
.form-text { color: #6d7788 !important; }

.btn {
  border-radius: 14px !important;
  font-weight: 850 !important;
  letter-spacing: -.015em !important;
  padding: .66rem 1.05rem !important;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease !important;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
button[type="submit"].btn:not(.btn-danger):not(.btn-outline-danger) {
  background: linear-gradient(135deg, var(--sw-gold-700), var(--sw-gold-800)) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(169,111,24,.22) !important;
}
.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-warning:hover,
button[type="submit"].btn:not(.btn-danger):not(.btn-outline-danger):hover {
  background: linear-gradient(135deg, #8b570f, #5f390c) !important;
}
.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-warning,
.btn-outline-secondary,
.btn-outline-danger {
  border: 1px solid #c8b28b !important;
  background: rgba(255,255,255,.78) !important;
  color: var(--sw-gold-800) !important;
  box-shadow: none !important;
}
.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover,
.btn-outline-warning:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover {
  background: #f6ead6 !important;
  color: #4b2b09 !important;
}
.btn-sm { padding: .46rem .72rem !important; border-radius: 11px !important; font-size: .86rem !important; }

.form-control,
.form-select,
.input-group-text {
  min-height: 48px !important;
  border-radius: 14px !important;
  border: 1px solid #ded4c4 !important;
  color: var(--sw-ink) !important;
  box-shadow: none !important;
}
.input-group .form-control,
.input-group .form-select,
.input-group .input-group-text { border-radius: 0 !important; }
.input-group > :first-child { border-top-left-radius: 14px !important; border-bottom-left-radius: 14px !important; }
.input-group > :last-child { border-top-right-radius: 14px !important; border-bottom-right-radius: 14px !important; }
.form-control::placeholder { color: #8b95a6 !important; }

.table {
  margin-bottom: 0 !important;
  vertical-align: middle !important;
}
.table thead th,
.clean-table thead th,
.activity-table th {
  padding: 18px 20px !important;
  font-size: .78rem !important;
  letter-spacing: .065em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}
.table tbody td,
.clean-table td,
.activity-table td {
  padding: 18px 20px !important;
  font-size: .98rem !important;
}
.table tbody tr {
  transition: background .15s ease !important;
}
.table tbody tr:nth-child(odd) { background: rgba(251,247,237,.60) !important; }
.table tbody tr:nth-child(even) { background: rgba(255,255,255,.90) !important; }
.table tbody tr:hover { background: #f3eadb !important; }
.table-responsive { overflow: auto !important; }

.badge,
.clean-chip,
.status-badge,
.role-badge,
.health-badge,
.audit-chip,
[class*="badge"] {
  border-radius: 999px !important;
  padding: .42rem .72rem !important;
  font-weight: 850 !important;
  letter-spacing: -.01em !important;
  background: #f4f0e8 !important;
  color: #283243 !important;
  border: 1px solid #dfd3c1 !important;
}
.bg-danger,
.text-bg-danger,
.badge.bg-danger,
.badge.text-bg-danger,
.alert-danger {
  background: #fff1ef !important;
  color: #9f1b14 !important;
  border-color: #f3b7ae !important;
}
.text-danger,
.amount-negative,
.deduction-amount { color: #a21c14 !important; }
.amount-positive,
.deposit-amount { color: var(--sw-gold-800) !important; }

.alert {
  border-radius: var(--sw-radius-md) !important;
  padding: 16px 18px !important;
  box-shadow: var(--sw-shadow-sm) !important;
}
.alert-success,
.alert-info,
.alert-warning {
  background: linear-gradient(135deg, #fff7e8, #f6ead6) !important;
  color: #4b3415 !important;
  border-color: #d9bd88 !important;
}

.nav-tabs {
  border-color: var(--sw-border) !important;
}
.nav-tabs .nav-link {
  border-radius: 14px 14px 0 0 !important;
  color: #3f4b5f !important;
  padding: .78rem 1.15rem !important;
}
.nav-tabs .nav-link.active,
.nav-pills .nav-link.active,
.list-group-item.active {
  background: linear-gradient(135deg, var(--sw-gold-700), var(--sw-gold-800)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* Dashboard stat cards and summary strips */
.stat-card,
.metric-card,
.summary-card,
.dashboard-stat,
.kpi-card {
  background: rgba(255,255,255,.90) !important;
  border: 1px solid var(--sw-border) !important;
  border-radius: var(--sw-radius-lg) !important;
  box-shadow: var(--sw-shadow-md) !important;
}
.stat-card .icon,
.metric-card .icon,
.summary-card .icon,
.stat-icon,
.kpi-icon {
  background: linear-gradient(135deg, var(--sw-gold-700), var(--sw-gold-800)) !important;
  color: #fff !important;
  border-radius: 16px !important;
}
.stat-card .value,
.metric-value,
.kpi-value {
  color: var(--sw-gold-800) !important;
  font-weight: 900 !important;
  letter-spacing: -.04em !important;
}
.hero-strip,
.today-strip,
.dashboard-hero,
.dark-summary {
  background: linear-gradient(135deg, var(--sw-navy-900), var(--sw-navy-800)) !important;
  border-radius: var(--sw-radius-lg) !important;
  box-shadow: var(--sw-shadow-md) !important;
}

/* Scanner and payment surfaces */
.scan-card .card-header,
.scanner-card .card-header,
.payment-card .card-header,
.ticket-card .card-header {
  background: linear-gradient(135deg, var(--sw-navy-900), var(--sw-navy-800)) !important;
  color: #fff !important;
}
.scan-card .btn,
.scanner-card .btn,
.payment-card .btn { min-height: 52px !important; }

/* Reports side tabs: remove old blue and make it premium */
.report-tabs .list-group-item,
.reports-tabs .list-group-item,
.report-menu .list-group-item,
.reports-menu .list-group-item,
.list-group .list-group-item {
  border-color: var(--sw-border) !important;
  background: rgba(255,255,255,.88) !important;
}
.report-tabs .list-group-item.active,
.reports-tabs .list-group-item.active,
.report-menu .list-group-item.active,
.reports-menu .list-group-item.active,
.list-group .list-group-item.active {
  background: linear-gradient(135deg, var(--sw-gold-700), var(--sw-gold-800)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* Print/PDF views should stay crisp and readable */
@media print {
  html, body { background: #fff !important; color: #111827 !important; }
  .student-id-card,
  .id-card,
  .ticket-card,
  .meal-ticket,
  .id-card-front,
  .id-card-back {
    box-shadow: none !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}

@media (max-width: 992px) {
  #page-content,
  .main-content,
  .content-wrapper { padding: 16px !important; }
  #topbar { min-height: 66px !important; }
  .card,
  .report-card,
  .clean-table-card,
  .modal-content { border-radius: 18px !important; }
  .btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* UI polish correction: restore special hero/summary cards and remove empty space */
.health-hero.card,
.card.health-hero {
  background: linear-gradient(135deg, #0b1220 0%, #111827 68%, #a96f18 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 22px !important;
  min-height: 0 !important;
  box-shadow: 0 18px 44px rgba(15,23,42,.16) !important;
  overflow: hidden !important;
}
.health-hero .card-body {
  min-height: 0 !important;
  padding: 22px 26px !important;
  gap: 18px !important;
}
.health-hero .health-kicker,
.health-hero .text-white-50,
.health-hero .health-pill .label {
  color: rgba(255,255,255,.72) !important;
}
.health-hero .health-title,
.health-hero .health-pill .num {
  color: #ffffff !important;
}
.health-hero .health-summary {
  margin-left: auto !important;
  align-items: stretch !important;
}
.health-hero .health-pill {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #fff !important;
  min-width: 108px !important;
}
.health-card.card {
  margin-bottom: 18px !important;
}
.health-card .card-header {
  padding: 16px 20px !important;
}
.health-table td,
.health-table th {
  padding: 15px 20px !important;
}

/* Dashboard: keep KPI cards even and restore dark Today summary strip */
.row > [class*="col-"] > .stat-card.card {
  min-height: 150px !important;
  display: flex !important;
}
.row > [class*="col-"] > .stat-card.card > .card-body {
  min-height: 150px !important;
  width: 100% !important;
}
.stat-card .section-label {
  min-height: 42px !important;
  display: flex !important;
  align-items: center !important;
}
.card[style*="#111827"],
.card[style*="linear-gradient(135deg,#111827"] {
  background: linear-gradient(135deg, #0b1220 0%, #111827 58%, #1f2937 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 44px rgba(15,23,42,.16) !important;
}
.card[style*="#111827"] .card-body,
.card[style*="linear-gradient(135deg,#111827"] .card-body {
  min-height: 96px !important;
  padding: 20px 24px !important;
  align-items: center !important;
}
.card[style*="#111827"] div,
.card[style*="#111827"] span,
.card[style*="#111827"] .section-label,
.card[style*="linear-gradient(135deg,#111827"] div,
.card[style*="linear-gradient(135deg,#111827"] span,
.card[style*="linear-gradient(135deg,#111827"] .section-label {
  color: #ffffff !important;
}
.card[style*="#111827"] [style*="#b7791f"],
.card[style*="linear-gradient(135deg,#111827"] [style*="#b7791f"] {
  color: #f5c56f !important;
}
.card[style*="#111827"] .btn,
.card[style*="linear-gradient(135deg,#111827"] .btn {
  color: #fff !important;
}

/* Avoid invisible text on cards when local page styles expect a dark surface */
.card .text-white,
.card .text-white-50,
.card [class*="text-white"] {
  text-shadow: none !important;
}

@media (max-width: 992px) {
  .health-hero .card-body { padding: 20px !important; }
  .health-hero .health-summary { margin-left: 0 !important; width: 100% !important; }
  .health-hero .health-pill { flex: 1 1 100px !important; }
  .row > [class*="col-"] > .stat-card.card,
  .row > [class*="col-"] > .stat-card.card > .card-body { min-height: 132px !important; }
}

/* ScholarWallet UX 8.3 polish layer */
:root {
  --sw-focus: rgba(33, 99, 235, .22);
  --sw-blue-700: #1d4ed8;
  --sw-green-700: #15803d;
  --sw-amber-700: #a16207;
  --sw-red-700: #b42318;
  --sw-radius-control: 10px;
  --sw-shadow-soft: 0 8px 24px rgba(16, 23, 34, .055);
}

.sw-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-150%);
  background: #fff;
  color: #111827 !important;
  border: 2px solid var(--sw-blue-700);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-weight: 850;
  text-decoration: none;
}
.sw-skip-link:focus { transform: translateY(0); }

#page-content {
  width: 100% !important;
  max-width: 1500px !important;
  margin: 0 auto !important;
}
#topbar {
  min-height: 62px !important;
  padding: .68rem 1.35rem !important;
}
#topbar .page-title {
  font-size: clamp(1.05rem, 1vw + .85rem, 1.38rem) !important;
  letter-spacing: 0 !important;
}
.topbar-role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .38rem .75rem;
  border-radius: 999px;
  background: #f3f6fb;
  border: 1px solid #dbe4ef;
  color: #334155;
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
}

#page-content > .d-flex.justify-content-between:first-child,
#page-content > .d-flex.justify-content-between.align-items-center:first-child,
#page-content > .d-flex.justify-content-between.align-items-start:first-child {
  padding: .92rem 1rem !important;
  margin-bottom: 1rem !important;
  background: rgba(255,255,255,.82) !important;
  border: 1px solid var(--sw-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--sw-shadow-soft) !important;
  gap: .85rem !important;
}
#page-content > .d-flex.justify-content-between:first-child h4,
#page-content > .d-flex.justify-content-between.align-items-center:first-child h4 {
  margin-bottom: .12rem !important;
  letter-spacing: 0 !important;
}

.card,
.modal-content,
.table-responsive {
  border-radius: 14px !important;
}
.card {
  box-shadow: var(--sw-shadow-soft) !important;
}
.card-header {
  min-height: 54px !important;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.card-header h5,
.card-header h6 {
  margin-bottom: 0 !important;
}

.table-responsive {
  border: 1px solid var(--sw-border) !important;
  background: #fff !important;
  overflow: auto !important;
}
.table {
  margin-bottom: 0 !important;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc !important;
  color: #5f6c80 !important;
  font-size: .71rem !important;
  letter-spacing: .055em !important;
  padding: .78rem .9rem !important;
}
.table td {
  padding: .78rem .9rem !important;
}
.table td .btn,
.table td form .btn {
  margin-block: .12rem !important;
}

.btn {
  border-radius: var(--sw-radius-control) !important;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  letter-spacing: 0 !important;
}
.btn-sm {
  min-height: 34px;
  padding-inline: .62rem !important;
}
.btn i {
  line-height: 1;
  flex: 0 0 auto;
}
.btn-danger,
.btn-outline-danger:hover {
  background: var(--sw-red-700) !important;
  border-color: var(--sw-red-700) !important;
  color: #fff !important;
}
.btn-outline-danger {
  border-color: #f2b8b5 !important;
  color: var(--sw-red-700) !important;
}

.form-control,
.form-select,
.input-group-text {
  border-radius: var(--sw-radius-control) !important;
  min-height: 42px !important;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}
.input-group > .input-group-text:not(:last-child) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
label,
.form-label {
  letter-spacing: 0 !important;
}

:focus-visible {
  outline: 3px solid var(--sw-focus) !important;
  outline-offset: 2px !important;
}
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.nav-link:focus-visible {
  box-shadow: 0 0 0 4px var(--sw-focus) !important;
}

.alert {
  border-radius: 12px !important;
  padding: .85rem 1rem !important;
}
.badge {
  line-height: 1.15 !important;
}

.modal-dialog-scrollable .modal-content,
.registration-modal .modal-content {
  max-height: calc(100dvh - 2rem) !important;
}
.modal-header {
  min-height: 62px !important;
}
.modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  gap: .55rem !important;
}

.registration-card,
.registration-id-card,
.dep-card,
.pay-card,
.scan-card,
.health-card {
  border-radius: 14px !important;
}
.registration-card h6 span {
  border-radius: 9px !important;
}
.photo-drop {
  border-radius: 12px !important;
}

.dep-shell,
.pay-wrap {
  width: min(100%, 860px) !important;
}
.dep-header,
.pay-header {
  background: linear-gradient(135deg, #101722 0%, #172033 72%, #7c4a12 100%) !important;
}
.dep-body,
.pay-card .card-body {
  padding: clamp(1rem, 1.8vw, 1.35rem) !important;
}

#reader {
  border: 1px dashed #cbd5e1 !important;
  border-radius: 14px !important;
  background: #fff !important;
}

.list-group-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.list-group-item-action:hover {
  background: #f8fafc !important;
}

footer,
#main-wrapper > .text-center.small {
  background: rgba(255,255,255,.82) !important;
  border-color: var(--sw-border) !important;
  color: #667085 !important;
}

@media (max-width: 992px) {
  #page-content > .d-flex.justify-content-between:first-child,
  #page-content > .d-flex.justify-content-between.align-items-center:first-child,
  #page-content > .d-flex.justify-content-between.align-items-start:first-child {
    align-items: flex-start !important;
  }
  .table-responsive {
    border-radius: 12px !important;
  }
}

@media (max-width: 768px) {
  #topbar {
    padding: .62rem .78rem !important;
  }
  .topbar-role-pill {
    display: none !important;
  }
  #page-content {
    padding: .75rem !important;
  }
  #page-content > .d-flex.justify-content-between:first-child,
  #page-content > .d-flex.justify-content-between.align-items-center:first-child,
  #page-content > .d-flex.justify-content-between.align-items-start:first-child {
    padding: .85rem !important;
    flex-direction: column !important;
  }
  #page-content > .d-flex.justify-content-between:first-child .btn,
  #page-content > .d-flex.justify-content-between.align-items-center:first-child .btn {
    width: 100% !important;
  }
  .card-body {
    padding: .95rem !important;
  }
  .table {
    min-width: 720px;
  }
  .modal-dialog {
    margin: .5rem !important;
  }
  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch !important;
  }
  .modal-footer .btn {
    width: 100%;
  }
}
