:root {
  --color-background: #f8f9fc;
  --color-surface: #ffffff;
  --color-surface-muted: #eef2ff;
  --color-primary: #3b82f6;
  --color-primary-soft: #e0f2fe;
  --color-text: #1f2937;
  --color-muted: #64748b;
  --color-border: rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.1);
  --radius-lg: 1rem;
  --radius-pill: 999px;
  --max-width: 1200px;
  --gradient-bg: radial-gradient(circle at top, rgba(96, 165, 250, 0.18), rgba(186, 230, 253, 0));
}

* {
  box-sizing: border-box;
}

body.app-body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  position: relative;
}

body.app-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  z-index: -2;
}

body.app-body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.85) 100%);
  z-index: -1;
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--color-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  color: var(--color-muted);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover,
a:focus {
  color: #1d4ed8;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-soft);
  background: var(--color-surface);
  padding: 0.35rem;
}

.brand-text {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  color: var(--color-muted);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-welcome {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.nav-school {
  color: var(--color-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.4rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #1d4ed8;
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.35);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-primary);
  border-color: transparent;
}

.btn-ghost:hover,
.btn-ghost:focus {
  background: rgba(59, 130, 246, 0.16);
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(59, 130, 246, 0.45);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: #1d4ed8;
}

.rich-text-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rich-text-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: rgba(59, 130, 246, 0.08);
}

.rich-text-toolbar-separator {
  width: 1px;
  height: 1.5rem;
  background: rgba(59, 130, 246, 0.25);
  display: inline-block;
}

.rich-text-button {
  border: none;
  background: #ffffff;
  border-radius: 0.5rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  line-height: 1;
}

.rich-text-button:hover,
.rich-text-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.rich-text-button:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.rich-text-button-label {
  font-family: 'Poppins', 'Inter', sans-serif;
}

.rich-text-editor {
  min-height: 200px;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  line-height: 1.6;
  color: var(--color-text);
  font-size: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.rich-text-editor:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  outline: none;
}

.rich-text-editor p {
  margin-bottom: 0.75rem;
}

.rich-text-editor ul,
.rich-text-editor ol {
  padding-left: 1.4rem;
  margin-bottom: 0.75rem;
}

.rich-text-editor.is-empty::before {
  content: attr(data-placeholder);
  color: rgba(71, 85, 105, 0.6);
  font-size: 0.95rem;
}

[data-rich-text-ready="true"] textarea[data-rich-text-target="input"] {
  display: none;
}

.rich-text-display {
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.rich-text-display p {
  margin-bottom: 0.85rem;
}

.rich-text-display ul,
.rich-text-display ol {
  margin-bottom: 0.85rem;
  padding-left: 1.4rem;
}

.rich-text-display a {
  color: var(--color-primary);
  text-decoration: underline;
}

.btn-outline-secondary {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--color-muted);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
}

.btn-link {
  background: transparent;
  color: var(--color-primary);
  padding-left: 0;
  padding-right: 0;
  border: none;
}

.btn-link:hover,
.btn-link:focus {
  color: #1d4ed8;
  text-decoration: underline;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.92);
  border-color: rgba(248, 113, 113, 0.92);
  color: #7f1d1d;
}

.btn-danger:hover,
.btn-danger:focus {
  background: rgba(220, 38, 38, 0.95);
  border-color: rgba(220, 38, 38, 0.95);
  color: #fff;
  box-shadow: 0 12px 24px rgba(248, 113, 113, 0.35);
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.6);
  color: #b91c1c;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background: rgba(254, 226, 226, 0.9);
  border-color: rgba(220, 38, 38, 0.9);
  color: #7f1d1d;
}

.btn-outline-warning {
  background: transparent;
  border-color: rgba(251, 191, 36, 0.65);
  color: #a16207;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
  background: rgba(254, 243, 199, 0.9);
  border-color: rgba(217, 119, 6, 0.9);
  color: #92400e;
}

.btn-sm {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
}

.app-shell {
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  gap: 2rem;
}

.sidebar-panel {
  width: 270px;
  flex: 0 0 270px;
  position: sticky;
  top: 110px;
  align-self: flex-start;
}

.sidebar-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.sidebar-subtitle {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-item {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 0.8rem;
  color: var(--color-text);
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease-in-out;
  font-size: 0.95rem;
}

.sidebar-link:hover,
.sidebar-link:focus {
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

.sidebar-link--active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.sidebar-link--parent {
  font-weight: 600;
  font-size: 0.98rem;
}

.sidebar-submenu {
  list-style: none;
  margin: 0.15rem 0 0.4rem 0.7rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-sublink {
  display: block;
  padding: 0.35rem 0.65rem;
  border-radius: 0.6rem;
  color: var(--color-muted);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: all 0.2s ease-in-out;
}

.sidebar-sublink:hover,
.sidebar-sublink:focus {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.08);
}

.sidebar-sublink--active {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.2);
  font-weight: 600;
}

.main-content {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.main-content--public {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.content-container {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.message-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.alert-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1rem 3rem 1rem 1.25rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.alert-card.alert-success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(220, 252, 231, 0.9);
}

.alert-card.alert-warning {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(254, 243, 199, 0.9);
}

.alert-card.alert-danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(254, 226, 226, 0.92);
}

.alert-card.alert-info {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(224, 242, 254, 0.9);
}

.alert-dismiss {
  position: absolute;
  top: 0.65rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: var(--color-muted);
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease-in-out;
}

.alert-dismiss:hover {
  transform: scale(1.1);
}

.hero,
.page-hero {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(125, 211, 252, 0.85));
  color: #f8fafc;
  padding: 4rem;
  border-radius: calc(var(--radius-lg) * 1.2);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.hero h1,
.page-hero h1 {
  color: inherit;
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  margin-bottom: 1rem;
}

.hero p,
.page-hero p {
  color: rgba(241, 245, 249, 0.88);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 2rem auto;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--color-surface);
  border-radius: calc(var(--radius-lg) * 1.2);
  padding: 2.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}

.hero-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

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

.page-header h1 {
  font-size: clamp(1.85rem, 2.4vw, 2.5rem);
  margin: 0;
}

.page-header p {
  margin: 0;
  font-size: 1rem;
}

.page-actions {
  justify-content: flex-end;
}

.section-grid {
  display: grid;
  gap: 1.75rem;
}

.section-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feature-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-text);
  padding: 0.85rem 1.1rem;
  border-radius: 0.85rem;
  font-weight: 500;
}

.feature-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-primary);
  font-size: 0.9rem;
}

.card {
  border: 1px solid var(--color-border) !important;
  border-radius: calc(var(--radius-lg) * 0.95) !important;
  box-shadow: var(--shadow-soft) !important;
  background: var(--color-surface) !important;
  padding: 0;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  background: rgba(248, 250, 252, 0.72) !important;
  border-radius: calc(var(--radius-lg) * 0.95) calc(var(--radius-lg) * 0.95) 0 0 !important;
  padding: 1.25rem 1.75rem !important;
}

.card-highlight {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), rgba(125, 211, 252, 0.2)) !important;
  border: 1px solid rgba(59, 130, 246, 0.15) !important;
}

.card-highlight .display-6,
.card-highlight .stats-value {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--color-primary);
}

.card-highlight h6 {
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-muted);
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-card) !important;
}

.card > .card-body {
  padding: 1.75rem 1.75rem 2rem 1.75rem;
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6 {
  margin-bottom: 0.75rem;
}

.list-group-item {
  border: none;
  padding: 0.9rem 1.25rem;
  background: transparent;
  color: var(--color-text);
}

.list-group-item + .list-group-item {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.badge {
  border-radius: var(--radius-pill) !important;
  padding: 0.35rem 0.75rem !important;
  font-weight: 600 !important;
}

.badge-category {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #1d4ed8 !important;
}

.badge-status {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #059669 !important;
}

.form-control,
.form-select,
textarea,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='number'],
input[type='time'],
input[type='date'] {
  border-radius: 0.85rem !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
  padding: 0.75rem 1rem !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--color-text);
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus {
  border-color: rgba(59, 130, 246, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important;
}

.form-label {
  font-weight: 600;
  color: var(--color-text);
}

.form-text {
  color: var(--color-muted) !important;
  font-size: 0.85rem;
}

.form-check-input {
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

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

.table {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table thead {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-text);
}

.table th,
.table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.2s ease-in-out;
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.06);
}


.table-directory {
  table-layout: fixed;
  font-size: 0.9rem;
}

.table-directory .directory-col {
  overflow: hidden;
}

.table-directory .directory-col--bulk {
  width: 2.75rem;
}

.table-directory .directory-col--name {
  width: clamp(7rem, 18vw, 16rem);
}

.table-directory .directory-col--username {
  width: clamp(5.5rem, 14vw, 11rem);
}

.table-directory .directory-col--email {
  width: clamp(7rem, 20vw, 15rem);
}

.table-directory .directory-col--year,
.table-directory .directory-col--school,
.table-directory .directory-col--count {
  width: clamp(3.5rem, 10vw, 7.5rem);
}

.table-directory .directory-col--connections {
  width: clamp(8rem, 24vw, 18rem);
  white-space: normal;
}

.table-directory .directory-col--actions {
  width: clamp(5.5rem, 12vw, 9rem);
}

.table-directory .directory-text-truncate {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-directory .directory-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-directory .directory-pill-list .badge {
  font-size: 0.75rem;
  margin-right: 0;
}

@media (max-width: 1200px) {
  .table-directory {
    font-size: 0.85rem;
  }

  .table-directory .directory-col--bulk {
    width: 2.5rem;
  }

  .table-directory .directory-col--name {
    width: clamp(6.5rem, 22vw, 14rem);
  }

  .table-directory .directory-col--username {
    width: clamp(5rem, 16vw, 9.5rem);
  }

  .table-directory .directory-col--email {
    width: clamp(6.5rem, 22vw, 13rem);
  }

  .table-directory .directory-col--connections {
    width: clamp(7.5rem, 28vw, 16rem);
  }
}

@media (max-width: 992px) {
  .table-directory {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.75rem 0.9rem;
  }

  .table-directory .directory-col--name {
    width: clamp(6rem, 26vw, 12rem);
  }

  .table-directory .directory-col--username {
    width: clamp(4.5rem, 18vw, 8.5rem);
  }

  .table-directory .directory-col--email {
    width: clamp(6rem, 26vw, 11.5rem);
  }

  .table-directory .directory-col--connections {
    width: clamp(6.5rem, 32vw, 14rem);
  }
}

.calendar-card {
  background: linear-gradient(145deg, rgba(224, 242, 254, 0.65), rgba(238, 242, 255, 0.9));
}

.calendar-wrapper {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  min-height: 520px;
  box-shadow: var(--shadow-soft);
}

.calendar-wrapper--full {
  min-height: 70vh;
}

.calendar-wrapper .fc {
  font-family: 'Inter', 'Poppins', sans-serif;
  color: var(--color-text);
}

.calendar-wrapper .fc-theme-standard td,
.calendar-wrapper .fc-theme-standard th {
  border-color: rgba(148, 163, 184, 0.2);
}

.calendar-wrapper .fc-theme-standard .fc-scrollgrid {
  border-radius: var(--radius-lg);
  border-color: rgba(148, 163, 184, 0.28);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.calendar-wrapper .fc-timegrid-slot,
.calendar-wrapper .fc-timegrid-axis {
  height: 2.75rem;
}

.calendar-wrapper .fc-timegrid-slot-label-cushion {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 500;
}

.calendar-wrapper .fc-toolbar {
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-wrapper .fc-toolbar-title {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--color-text);
}

.calendar-wrapper .fc-button-group > .fc-button,
.calendar-wrapper .fc-toolbar-chunk .fc-button {
  margin: 0 0.2rem;
}

.calendar-wrapper .fc-button {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: rgba(59, 130, 246, 0.14);
  color: var(--color-primary);
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  text-transform: capitalize;
  transition: transform 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.calendar-wrapper .fc-button:hover,
.calendar-wrapper .fc-button:focus {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.25);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.18);
}

.calendar-wrapper .fc-button:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.calendar-wrapper .fc-button-primary:not(:disabled).fc-button-active,
.calendar-wrapper .fc-button-primary:not(:disabled):active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.28);
}

.calendar-wrapper .fc-daygrid-day-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  transition: color 0.2s ease-in-out;
}

.calendar-wrapper .fc-daygrid-day-frame {
  padding: 0.6rem;
  border-radius: var(--radius-md);
  transition: background 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.calendar-wrapper .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background: rgba(59, 130, 246, 0.08);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.calendar-wrapper .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame,
.calendar-wrapper .fc-timegrid-col.fc-day-today {
  background: rgba(59, 130, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.calendar-wrapper .fc-daygrid-day-top {
  align-items: center;
  gap: 0.35rem;
}

.calendar-wrapper .fc-col-header-cell-cushion {
  padding: 0.65rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.calendar-wrapper .fc-event {
  border-radius: var(--radius-lg);
  border: none;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.8rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

.calendar-wrapper .fc-event-main-frame {
  display: grid;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
}

.calendar-wrapper .fc-event-time {
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.calendar-wrapper .fc-event-title {
  font-size: 0.85rem;
}

.calendar-wrapper .calendar-closure-event.fc-event {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #991b1b;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.15);
}

.calendar-wrapper .fc-bg-event.calendar-closure-event {
  background: rgba(220, 38, 38, 0.12);
}

.calendar-wrapper .calendar-closure-event .fc-event-title {
  color: inherit;
}

.calendar-wrapper .fc-daygrid-block-event .fc-event-time,
.calendar-wrapper .fc-daygrid-block-event .fc-event-title {
  font-weight: 600;
}

.calendar-wrapper .fc-list-table {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-wrapper .fc-list-event:hover td {
  background: rgba(59, 130, 246, 0.08);
}

.site-footer {
  margin-top: 4rem;
  padding: 4rem 2rem 2rem 2rem;
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.2), rgba(226, 232, 240, 0.45));
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
}

.footer-column h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-column li {
  color: var(--color-muted);
}

.footer-column a {
  color: inherit;
}

.footer-column a:hover {
  color: var(--color-primary);
}

.footer-meta {
  text-align: center;
  color: var(--color-muted);
  margin-top: 2.5rem;
  font-size: 0.9rem;
}

.club-matrix-wrapper {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: var(--shadow-soft);
}

.club-matrix-table {
  min-width: 640px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.club-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(224, 242, 254, 0.85);
  backdrop-filter: blur(12px);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
}

.club-matrix-student-header {
  min-width: 200px;
}

.club-matrix-club-header {
  min-width: 150px;
}

.club-matrix-club-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.club-matrix-club-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
}

.club-matrix-count {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.club-matrix-count-full {
  color: #b91c1c;
}

.club-matrix-student-cell {
  background: rgba(59, 130, 246, 0.05);
  position: sticky;
  left: 0;
  z-index: 2;
}

.club-matrix-table td.matrix-cell {
  text-align: center;
  cursor: pointer;
  min-width: 96px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.club-matrix-table td.matrix-cell:hover {
  background-color: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
}

.matrix-icon {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.04);
}

.matrix-icon-joined {
  color: #0f766e;
  background: rgba(16, 185, 129, 0.18);
}

.matrix-icon-waitlisted {
  color: #a16207;
  background: rgba(251, 191, 36, 0.2);
}

.club-matrix-filters {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.club-matrix-filters .form-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.club-matrix-tag-option {
  display: inline-flex;
  align-items: center;
}

.club-matrix-tag-option .btn {
  border-radius: var(--radius-pill);
}

.matrix-placeholder {
  color: rgba(15, 23, 42, 0.35);
  font-size: 1rem;
  font-weight: 600;
}

.club-matrix-table > :not(caption) > * > * {
  padding: 0.6rem 0.5rem;
}

@media (max-width: 1200px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar-panel {
    width: 100%;
    position: static;
  }
}

@media (max-width: 992px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .page-header--split {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 1.5rem;
  }

  .content-container {
    gap: 1.5rem;
  }

  .hero,
  .page-hero {
    padding: 2.75rem;
  }

  .nav-container {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 576px) {
  .app-shell {
    padding: 1rem;
  }

  .top-nav {
    position: static;
  }

  .hero,
  .page-hero {
    padding: 2.25rem 1.75rem;
  }

  .page-header {
    padding: 2rem 1.75rem;
  }

  .btn {
    width: 100%;
  }

  .nav-actions {
    gap: 0.5rem;
  }
}

.login-hero {
  padding: clamp(1.5rem, 4vw, 3rem) 0;
  background: linear-gradient(
    180deg,
    rgba(224, 242, 255, 0.75) 0%,
    rgba(236, 248, 255, 0.6) 45%,
    rgba(255, 255, 255, 0.95) 100%
  );
  position: relative;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(15, 122, 168, 0.16), transparent 45%),
    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.16), transparent 55%);
  z-index: -1;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-in-up 0.9s ease forwards;
}

.fade-in-up.delay-100 {
  animation-delay: 0.1s;
}

.fade-in-up.delay-200 {
  animation-delay: 0.2s;
}

.fade-in-up.delay-300 {
  animation-delay: 0.3s;
}

.fade-in-up.delay-400 {
  animation-delay: 0.4s;
}

@keyframes fade-in-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 1.75rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(18px);
}

.login-card h2 {
  margin: 0;
}

.login-card p {
  margin-bottom: 0;
}

.login-form label {
  display: block;
  font-weight: 600;
  color: var(--color-text);
}

.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.96);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  font-size: 1rem;
  color: var(--color-text);
}

.login-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.login-form .text-danger {
  margin-top: 0.35rem;
}

.login-form .alert-card {
  margin-top: 0.5rem;
  border-radius: 0.75rem;
}

.login-form .btn-primary {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 1rem;
  font-size: 1rem;
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.35);
}

.about-section,
.features-section {
  padding: clamp(3rem, 8vw, 4.5rem) 0;
}

.about-section .about-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-section h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  margin: 0;
}

.about-section p {
  font-size: 1.1rem;
  color: var(--color-muted);
  margin: 0;
}

.features-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.features-header h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.4rem);
}

.features-header p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
}

.features-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .features-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.feature-card {
  position: relative;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  padding: 1.75rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 122, 168, 0.16), rgba(59, 130, 246, 0.08));
  color: #0f7aa8;
}

.feature-icon-wrapper svg {
  width: 26px;
  height: 26px;
}

.feature-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-text);
}

.feature-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}
