:root {
  /* Material-ish (light) theme: white surfaces + light purple */
  --m3-primary: #7c5cff;
  --m3-primary-hover: #6a4cff;
  --m3-primary-container: #eee9ff;
  --m3-on-primary: #ffffff;

  --m3-surface: #ffffff;
  --m3-surface-2: #fbfaff;
  --m3-surface-variant: #f5f3ff;
  --m3-on-surface: #1b1b1f;
  --m3-on-surface-2: rgba(27, 27, 31, 0.72);
  --m3-outline: rgba(27, 27, 31, 0.14);
  --m3-outline-2: rgba(27, 27, 31, 0.10);

  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-0: 0 0 0 rgba(0, 0, 0, 0);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(124, 92, 255, 0.12);
  --shadow-2: 0 2px 6px rgba(16, 24, 40, 0.08), 0 22px 48px rgba(124, 92, 255, 0.16);

  /* Bootstrap color overrides (so utilities match the theme) */
  --bs-primary: #7c5cff;
  --bs-primary-rgb: 124, 92, 255;
}

html {
  color-scheme: light;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--m3-on-surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(124, 92, 255, 0.20), rgba(124, 92, 255, 0) 60%),
    radial-gradient(700px 340px at 92% 0%, rgba(181, 141, 255, 0.18), rgba(181, 141, 255, 0) 55%),
    linear-gradient(180deg, #fbfbff 0%, #f6f3ff 45%, #ffffff 100%);
}

main {
  flex: 1 0 auto;
}

/* Links */
a {
  color: var(--m3-primary);
  text-decoration: none;
}
a:hover {
  color: var(--m3-primary-hover);
  text-decoration: underline;
  text-decoration-color: rgba(124, 92, 255, 0.35);
  text-underline-offset: 3px;
}

/* App bar */
.appbar {
  position: sticky;
  top: 0;
  z-index: 1030; /* bootstrap navbar */
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--m3-outline);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(22px 22px at 30% 30%, #ffffff 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, rgba(124, 92, 255, 1) 0%, rgba(181, 141, 255, 1) 100%);
  box-shadow: var(--shadow-1);
}

.navbar-brand {
  color: var(--m3-on-surface) !important;
  letter-spacing: -0.01em;
}
.navbar-brand:hover {
  color: var(--m3-on-surface) !important;
  text-decoration: none;
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

/* Page header */
.page-header .eyebrow {
  color: var(--m3-on-surface-2);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.page-header h1 {
  letter-spacing: -0.02em;
}

/* Cards (surfaces) */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--m3-outline);
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-header {
  background: rgba(255, 255, 255, 0.66) !important;
  border-bottom: 1px solid var(--m3-outline-2) !important;
  border-top-left-radius: var(--radius-lg) !important;
  border-top-right-radius: var(--radius-lg) !important;
}

.shadow-sm {
  box-shadow: var(--shadow-1) !important;
}

/* Stat cards */
.stat-card {
  border-radius: var(--radius-xl);
}
.stat-label {
  color: var(--m3-on-surface-2);
  font-size: 0.9rem;
  font-weight: 600;
}
.stat-value {
  font-size: clamp(1.5rem, 2.2vw, 2.4rem);
  letter-spacing: -0.02em;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--m3-surface-variant);
  border: 1px solid var(--m3-outline-2);
}
.stat-icon .material-symbols-rounded {
  font-size: 22px;
}

/* Buttons */
.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.95rem;
  transition: transform 120ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.btn-sm {
  padding: 0.42rem 0.75rem;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(124, 92, 255, 0.22) !important;
}

.btn-primary {
  background: var(--m3-primary) !important;
  border-color: var(--m3-primary) !important;
  box-shadow: var(--shadow-1);
}
.btn-primary:hover {
  background: var(--m3-primary-hover) !important;
  border-color: var(--m3-primary-hover) !important;
  box-shadow: var(--shadow-2);
}

.btn-success,
.btn-danger {
  box-shadow: var(--shadow-1);
}
.btn-success:hover,
.btn-danger:hover {
  box-shadow: var(--shadow-2);
}

.btn-light {
  background: rgba(255, 255, 255, 0.78) !important;
  border-color: var(--m3-outline) !important;
}
.btn-outline-secondary {
  border-color: var(--m3-outline) !important;
  color: var(--m3-on-surface) !important;
  background: rgba(255, 255, 255, 0.55);
}
.btn-outline-secondary:hover {
  background: rgba(124, 92, 255, 0.10) !important;
  border-color: rgba(124, 92, 255, 0.28) !important;
}

/* Keep semantic colors but modernize appearance */
.btn-outline-success {
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #0f766e !important;
  background: rgba(16, 185, 129, 0.10);
}
.btn-outline-success:hover {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}
.btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.09);
}
.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

/* Forms */
.form-label {
  font-weight: 600;
  color: rgba(27, 27, 31, 0.78);
}

.form-control,
.form-select,
textarea.form-control {
  border-radius: var(--radius-md);
  border-color: var(--m3-outline);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.68rem 0.82rem;
}
.form-control::placeholder,
textarea.form-control::placeholder {
  color: rgba(27, 27, 31, 0.44);
}
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  background: #ffffff;
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(124, 92, 255, 0.18);
}

/* Table */
.table-responsive {
  border-radius: var(--radius-lg);
}
.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}
.table thead th {
  background: rgba(245, 243, 255, 0.78) !important;
  color: rgba(27, 27, 31, 0.62);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--m3-outline) !important;
  padding: 0.95rem 1rem;
}
.table td {
  border-top: 1px solid var(--m3-outline-2);
  padding: 0.95rem 1rem;
}
.table-hover tbody tr:hover {
  background: rgba(124, 92, 255, 0.06) !important;
}

.table-scroll {
  max-height: min(560px, calc(100vh - 420px));
  overflow: auto;
}
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Badges / chips */
.badge {
  border-radius: 999px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* Alerts */
.alert {
  border-radius: var(--radius-lg);
  border: 1px solid var(--m3-outline);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-1);
}
.alert-success {
  border-left: 6px solid rgba(16, 185, 129, 0.65);
}
.alert-danger,
.alert-warning {
  border-left: 6px solid rgba(239, 68, 68, 0.55);
}

/* Small niceties */
.text-muted {
  color: rgba(27, 27, 31, 0.60) !important;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--m3-outline);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.app-footer a.text-muted {
  color: rgba(27, 27, 31, 0.62) !important;
}
.app-footer a.text-muted:hover {
  color: var(--m3-primary) !important;
  text-decoration: none;
}
