:root {
  --ink: #182230;
  --muted: #475467;
  --line: rgba(15, 23, 42, 0.32);
  --brand: #2563eb;
  --brand-dark: #1e3a8a;
  --mint: #14b8a6;
  --paper: rgba(255, 255, 255, 0.86);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.2), transparent 30rem),
    linear-gradient(135deg, #eef4ff 0%, #f8fafc 46%, #ecfeff 100%);
}

.shell-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(18px);
}

.topbar {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.94));
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 1rem;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--mint));
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.compact-brand {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.26);
  font-size: 0.78rem;
  letter-spacing: -0.04em;
}

.field,
.select-field,
.text-field {
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #182230;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.field:focus,
.select-field:focus,
.text-field:focus {
  border-color: rgba(37, 99, 235, 0.9);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), #0f766e);
  color: white;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.34);
}

.btn-primary:disabled {
  transform: none;
  opacity: 0.48;
  box-shadow: none;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.conversation-item {
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.conversation-item:hover,
.conversation-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(20, 184, 166, 0.08));
  border-color: rgba(37, 99, 235, 0.16);
  transform: translateX(2px);
}

.school-switcher-button {
  align-items: center;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(71, 85, 105, 0.95);
  border-radius: 0.65rem;
  color: white;
  display: flex;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 0.75rem;
  justify-content: space-between;
  min-width: 14rem;
  padding: 0.45rem 0.8rem;
}

.school-switcher-menu {
  background: white;
  border: 1.5px solid rgba(15, 23, 42, 0.2);
  border-radius: 1rem;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 0.25rem;
  left: 0;
  margin-top: 0.45rem;
  min-width: 100%;
  padding: 0.4rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 40;
}

.school-switcher-menu.hidden {
  display: none;
}

.school-switcher-menu button {
  border-radius: 0.8rem;
  color: #182230;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  text-align: left;
  white-space: nowrap;
}

.school-switcher-menu button:hover,
.school-switcher-menu button.active {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.message-bubble-in {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.message-bubble-out {
  background: #4f46e5;
  color: white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
}

.premium-conversation {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.68);
  border-left: 4px solid transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0;
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  text-align: left;
  width: 100%;
}

.premium-conversation:hover {
  background: rgba(226, 232, 240, 0.9);
  transform: none;
}

.premium-conversation.active {
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 72%);
  border-bottom-color: rgba(79, 70, 229, 0.28);
  border-left-color: #4f46e5;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.2), 0 8px 20px rgba(79, 70, 229, 0.12);
  transform: none;
}

.premium-conversation.active .premium-avatar {
  background: #4f46e5;
  border-color: #4338ca;
  color: white;
}

.premium-avatar {
  align-items: center;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #4338ca;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 800;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.staff-avatar {
  border: 2px solid white;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  flex: 0 0 auto;
  height: 1.75rem;
  object-fit: cover;
  width: 1.75rem;
}

.staff-avatar.small {
  border-width: 1px;
  height: 1.35rem;
  width: 1.35rem;
}

.staff-avatar-fallback {
  align-items: center;
  background: #059669;
  color: white;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 800;
  justify-content: center;
}

.compose-mode {
  border-radius: 0.5rem;
  color: #475467;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
}

.compose-mode.active {
  background: #0f172a;
  color: white;
}

.inbox-page aside {
  border-color: rgba(15, 23, 42, 0.24) !important;
}

.inbox-page aside > .border-b,
.inbox-page section > .border-b,
.inbox-page form.border-t {
  border-color: rgba(15, 23, 42, 0.18) !important;
}

.inbox-page #conversationList.divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(15, 23, 42, 0.14) !important;
}

.page-title {
  letter-spacing: -0.025em;
}

.data-table th {
  color: #344054;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tr:hover td {
  background: rgba(37, 99, 235, 0.035);
}

.admin-card {
  min-height: 12rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.admin-card:hover {
  border-color: rgba(79, 70, 229, 0.34);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-tabs a {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: #334155;
  font-weight: 700;
  padding: 0.65rem 1rem;
}

.admin-tabs a:hover,
.admin-tabs a.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.1));
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.admin-shell {
  display: grid;
  gap: 0;
  min-height: 100vh;
}

.admin-sidebar {
  background: #0f172a;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: white;
  display: flex;
  flex-direction: column;
  min-height: auto;
  padding: 1rem 0.85rem;
}

.admin-logo {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  gap: 0.8rem;
  padding: 0.25rem 0.5rem 1rem;
}

.admin-logo strong span {
  color: #818cf8;
}

.admin-logo strong,
.admin-logo small {
  display: block;
}

.admin-logo small {
  color: rgba(219, 234, 254, 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-menu {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.admin-menu a,
.admin-side-link {
  border-radius: 0.65rem;
  color: #cbd5e1;
  font-weight: 700;
  padding: 0.68rem 0.8rem;
}

.admin-menu a:hover,
.admin-menu a.active,
.admin-side-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.admin-menu a.active {
  background: #4f46e5;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}

.admin-sidebar-footer {
  display: grid;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1rem;
}

.admin-user-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: white;
  font-weight: 700;
  padding: 0.9rem 1rem;
}

.admin-user-chip span {
  color: rgba(219, 234, 254, 0.68);
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
  text-transform: capitalize;
}

.admin-main {
  background: #f1f5f9;
  min-width: 0;
  padding: 1.25rem;
}

.admin-header {
  border-radius: 0.9rem;
  padding: 1.1rem 1.25rem;
}

.admin-content-card {
  border-radius: 0.9rem;
  margin-top: 1rem;
  padding: 1.25rem;
}

.admin-main .page-title {
  font-weight: 700 !important;
}

.admin-header .page-title {
  font-size: clamp(1.55rem, 2.4vw, 2rem) !important;
  line-height: 1.08;
}

.admin-content-card h2.page-title {
  font-size: 1.35rem !important;
  line-height: 1.15;
}

.admin-content-card h3.page-title,
.admin-card h2.page-title {
  font-size: 1.15rem !important;
  line-height: 1.2;
}

.admin-main p,
.admin-main .text-slate-500,
.admin-main .text-slate-600 {
  color: #475467 !important;
}

.admin-main .border-slate-900\/10,
.admin-main .border-slate-900\/5 {
  border-color: rgba(15, 23, 42, 0.28) !important;
}

.admin-main fieldset,
.admin-main form.rounded-3xl,
.admin-main section.rounded-3xl,
.admin-main .rounded-3xl.border {
  border-color: rgba(15, 23, 42, 0.28) !important;
  border-width: 1.5px !important;
}

.admin-main .bg-white\/60,
.admin-main .bg-white\/70 {
  background-color: #ffffff !important;
}

.admin-main .shell-card,
.admin-main.shell-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.16);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
}

.admin-main form.rounded-3xl,
.admin-main fieldset,
.admin-main section.rounded-3xl,
.admin-main .rounded-3xl.border,
.admin-main table.rounded-3xl {
  border-radius: 0.75rem !important;
}

.admin-main .btn-primary {
  background: #4f46e5;
  border-radius: 0.55rem !important;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.18);
  padding-bottom: 0.6rem;
  padding-top: 0.6rem;
}

.admin-main .btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

.admin-main .field,
.admin-main .select-field,
.admin-main .text-field {
  border-radius: 0.6rem !important;
  font-size: 0.9rem;
  padding: 0.65rem 0.8rem;
}

.admin-main .data-table {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.75rem !important;
}

.admin-main .data-table td,
.admin-main .data-table th {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

@media (min-width: 1024px) {
  .admin-shell {
    grid-template-columns: 16rem minmax(0, 1fr);
  }

  .admin-sidebar {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
  }
}

@media (max-width: 1023px) {
  .inbox-page > div {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .inbox-page main {
    height: auto;
  }
}
