:root {
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --soft: #f8fafc;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --accent-light: #dbeafe;
  --gold: #f59e0b;
  --gold-light: #fef3c7;
  --navy: #0f172a;
  --plum: #581c87;
  --sky: #eff6ff;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.06);
  --shadow: 0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -2px rgba(15,23,42,0.06);
  --shadow-md: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.06);
  --shadow-xl: 0 25px 50px -12px rgba(15,23,42,0.18);
  --heavy-shadow: 0 25px 50px -12px rgba(15,23,42,0.25);
  --hero-image: url("https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&w=1800&q=88");
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-theme="emerald"] {
  --accent: #059669;
  --accent-dark: #065f46;
  --accent-light: #d1fae5;
  --gold: #10b981;
  --sky: #ecfdf5;
  --navy: #064e3b;
  --plum: #1b4332;
}

body[data-theme="royal"] {
  --accent: #7c3aed;
  --accent-dark: #5b21b6;
  --accent-light: #ede9fe;
  --gold: #f59e0b;
  --sky: #f5f3ff;
  --navy: #1e1b4b;
  --plum: #581c87;
}

body[data-theme="graphite"] {
  --accent: #475569;
  --accent-dark: #1e293b;
  --accent-light: #f1f5f9;
  --gold: #94a3b8;
  --sky: #f1f5f9;
  --navy: #0f172a;
  --plum: #1e293b;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(24px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.brand small,
.metric-label,
.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a,
.nav-button {
  color: var(--muted);
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-button:hover,
.nav-links a:hover {
  color: var(--accent);
}

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

.nav-icon-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 14px 0 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.nav-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.nav-icon-btn span,
.compact-btn span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
}

.compact-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding-left: 10px;
}

.compact-btn span {
  background: rgba(255, 255, 255, 0.9);
}

.hero {
  position: relative;
  min-height: calc(100vh - 73px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(60px, 10vw, 120px) clamp(20px, 5vw, 40px);
  background: var(--soft);
  color: var(--ink);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  color: var(--navy);
}

.hero p.lead {
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--muted);
  line-height: 1.5;
  margin: 0 auto 40px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-actions .primary-btn {
  font-size: 16px;
  padding: 14px 28px;
  border-radius: var(--radius-xl);
}

.hero-actions .secondary-btn {
  font-size: 16px;
  padding: 14px 28px;
  border-radius: var(--radius-xl);
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero-actions .secondary-btn:hover {
  background: var(--line);
}

.premium-plate {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: clamp(32px, 5vw, 48px);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--gold);
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  max-width: 760px;
  font-size: clamp(40px, 6.5vw, 78px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 700;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

.hero-copy {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  font-weight: 400;
}

.hero-proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 28px;
}

.hero-proof-row span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.hero-actions,
.toolbar,
.form-grid,
.dashboard-header,
.app-header,
.list-row,
.tabs,
.notice-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3), 0 1px 2px rgba(37,99,235,0.2);
}

.primary-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.secondary-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(8px);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ghost-btn,
.icon-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-secondary);
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.full {
  width: 100%;
}

.hero-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.hero-metrics-strip {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(980px, 100%);
  justify-self: center;
  align-self: end;
  margin-top: 8px;
}

.hero-panel > div {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.metric-value {
  display: block;
  font-size: 34px;
  font-weight: 800;
}

.section {
  padding: clamp(42px, 6vw, 84px) clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.feature-band {
  background: var(--paper);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card,
.login-panel,
.dashboard,
.stat-card,
.data-panel,
.role-strip > div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.feature-card {
  padding: 24px;
  transition: all var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.feature-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
}

.feature-card p,
.role-strip span,
.list-row p,
.empty-state,
.mini-text {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.role-band {
  background: var(--soft);
}

.role-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.role-strip > div {
  padding: 20px;
  transition: all var(--transition-base);
}

.role-strip > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.role-strip strong,
.role-strip span {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  background: var(--soft);
}

.auth-page {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 6vw, 80px) 20px;
  background: var(--soft);
  position: relative;
}

.back-link {
  position: absolute;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.back-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.login-panel,
.dashboard,
.data-panel {
  padding: 24px;
}

.login-panel {
  position: relative;
  z-index: 10;
}

.login-form {
  display: grid;
  gap: 16px;
}

.signup-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.auth-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}

.auth-switch {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.auth-switch.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.signup-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.method-btn,
.secondary-form-btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.method-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.secondary-form-btn {
  background: var(--soft);
}

.secondary-form-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.dashboard {
  min-height: 640px;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-header,
.app-header {
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.identity-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.header-identity h2 {
  margin: 0 0 4px;
  font-size: clamp(20px, 2.3vw, 30px);
  line-height: 1.1;
}

.identity-meta {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-control {
  min-width: 150px;
  font-size: 11px;
  color: var(--muted);
}

.theme-control select {
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  font-weight: 800;
}

.workspace-card {
  position: relative;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.workspace-card::before {
  display: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  border-radius: var(--radius-md);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: var(--accent-light);
  opacity: 0.5;
}

.stat-number {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.tabs {
  align-items: stretch;
  margin-bottom: 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.tab-btn {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  box-shadow: var(--shadow-xs);
}

.data-panel {
  margin-top: 16px;
  border-color: var(--line);
}

.data-panel h3 {
  margin-bottom: 14px;
  font-size: 16px;
  color: var(--ink);
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}

.form-grid .wide {
  grid-column: span 2;
}

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

.list {
  display: grid;
  gap: 12px;
}

.list-row {
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  transition: all var(--transition-fast);
}

.list-row:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.list-row > div {
  min-width: 0;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.school-row {
  align-items: flex-start;
}

.list-row h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.list-row p {
  margin: 0;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
}

.auth-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.88) 48%, rgba(88,28,135,0.8));
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(37,99,235,0.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(139,92,246,0.12), transparent 40%);
}

.auth-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  perspective: 900px;
}

.auth-ambient span {
  position: absolute;
  width: 260px;
  height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  transform: rotateX(58deg) rotateZ(-28deg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18);
  animation: plateDrift 7s ease-in-out infinite;
}

.auth-ambient span:nth-child(1) {
  top: 14%;
  left: 7%;
}

.auth-ambient span:nth-child(2) {
  right: 8%;
  top: 16%;
  animation-delay: -2s;
}

.auth-ambient span:nth-child(3) {
  right: 18%;
  bottom: 8%;
  animation-delay: -4s;
}

.auth-stage {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 420px);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.auth-story {
  color: #fff;
}

.auth-brand {
  margin-bottom: clamp(42px, 8vw, 80px);
  color: #fff;
}

.auth-story h2 {
  max-width: 600px;
  font-size: clamp(34px, 5.5vw, 62px);
  color: #fff;
}

.auth-story p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.7;
}

.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 600px;
  margin-top: 28px;
}

.auth-proof div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.auth-proof strong,
.auth-proof span {
  display: block;
}

.auth-proof span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.premium-card {
  position: relative;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-xl);
}

.premium-card::before {
  display: none;
}

.back-link {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 13px;
  backdrop-filter: blur(14px);
  transition: all var(--transition-fast);
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.portal-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--soft);
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--navy);
  color: #fff;
  overflow-y: auto;
}

.portal-brand {
  color: #fff;
}

.portal-brand .brand-mark,
.auth-brand .brand-mark {
  background: linear-gradient(135deg, #ffffff, #e2e8f0);
  color: var(--navy);
}

.school-chip {
  display: grid;
  gap: 4px;
  margin: 24px 4px 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.school-chip span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.portal-nav-wrap {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.sidebar-section-title {
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-menu {
  display: grid;
  gap: 4px;
}

.portal-nav-btn {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 10px 4px 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  transition: all var(--transition-fast);
}

.portal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.portal-nav-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.portal-nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 700;
}

.portal-nav-btn.active .portal-nav-icon {
  background: var(--accent);
  color: #fff;
}

.portal-main {
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
}

.portal-main .data-panel,
.portal-main .stat-card {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.portal-main .list-row {
  border-color: var(--line);
}

.website-preview {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}

.website-preview-media {
  min-height: 150px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-md);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  animation: fadeIn 200ms ease;
}

.profile-modal {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow-xl);
  animation: slideUp 250ms ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes premiumFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes plateDrift {
  0%, 100% {
    transform: translateY(0) rotateX(58deg) rotateZ(-28deg);
  }
  50% {
    transform: translateY(-14px) rotateX(58deg) rotateZ(-24deg);
  }
}

@keyframes erpFloat {
  0%, 100% {
    transform: rotateY(-14deg) rotateX(8deg) translateY(0);
  }
  50% {
    transform: rotateY(-10deg) rotateX(6deg) translateY(-12px);
  }
}

@keyframes phoneFloat {
  0%, 100% {
    transform: rotateY(-12deg) rotateZ(2deg) translateY(0);
  }
  50% {
    transform: rotateY(-8deg) rotateZ(1deg) translateY(-14px);
  }
}

.danger {
  color: var(--danger);
}

.success {
  color: var(--success);
}

.paper-preview {
  margin-top: 10px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
}

.progress-bar {
  width: min(280px, 100%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-light);
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width var(--transition-slow);
}

.summary-block {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
}

.summary-block strong {
  color: var(--ink);
}

/* SVG icon utilities */
button svg,
a svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.ghost-btn,
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-nav-icon {
  display: grid;
  place-items: center;
}

.portal-nav-icon svg {
  width: 16px;
  height: 16px;
}

.list-row h4 {
  font-size: 14px;
  font-weight: 600;
}

.list-row p {
  font-size: 13px;
}

@media (max-width: 980px) {
  .hero,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-rows: auto auto auto;
    align-items: start;
  }

  .hero-visual {
    width: min(100%, 640px);
    min-height: 500px;
    justify-self: center;
    order: 2;
  }

  .hero-panel {
    order: 3;
  }

  .hero-metrics-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-grid,
  .role-strip,
  .stat-grid,
  .form-grid,
  .panel-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-stage,
  .portal-page {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
    height: auto;
  }

  .app-header,
  .header-actions {
    align-items: stretch;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }

  .nav-links {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .nav-icon-btn,
  .compact-btn {
    min-height: 38px;
    padding-right: 10px;
    font-size: 12px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 42px 16px 28px;
  }

  .hero-visual {
    min-height: 470px;
  }

  .erp-window {
    top: 18px;
    left: 0;
    width: 82%;
    min-height: 260px;
    padding: 14px;
    transform: rotateY(-8deg) rotateX(5deg);
  }

  .erp-grid div {
    height: 54px;
  }

  .mobile-preview {
    width: 166px;
    height: 342px;
    right: 0;
    top: 92px;
    border-width: 7px;
  }

  .student-card {
    left: 0;
    bottom: 18px;
    width: min(270px, 76%);
  }

  .hero-metrics-strip {
    grid-template-columns: 1fr;
  }

  .website-preview {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .role-strip,
  .stat-grid,
  .form-grid,
  .panel-grid.two {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .auth-page {
    padding: 72px 16px 24px;
  }

  .auth-stage,
  .auth-proof {
    grid-template-columns: 1fr;
  }

  .auth-story h2 {
    font-size: 36px;
  }

  .premium-card {
    padding: 22px;
  }
}
