@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f2f6ff;
  --bg-deep: #0d1224;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --line: #dbe3f3;
  --line-strong: #c9d5ed;
  --text: #141b2d;
  --text-muted: #5c6a87;
  --brand: #3e5bff;
  --brand-2: #12b3a8;
  --brand-warm: #ff9f47;
  --danger: #d43f5e;
  --warning: #a16a00;
  --ok: #267f5b;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 55px rgba(31, 51, 97, 0.12);
  --shadow-soft: 0 8px 28px rgba(31, 51, 97, 0.08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: Manrope, sans-serif;
  background:
    radial-gradient(900px 600px at 8% -5%, #d9e4ff 0%, transparent 55%),
    radial-gradient(780px 500px at 95% 0%, #dff3ef 0%, transparent 52%),
    linear-gradient(180deg, #f6f9ff 0%, #f1f6ff 100%);
}

a {
  color: var(--brand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #ebf1ff;
  color: #294193;
  font-size: 12px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 80% -10%, rgba(255, 255, 255, 0.2), transparent 45%),
    linear-gradient(180deg, #1a2140 0%, #12172f 100%);
  color: #eff4ff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar h1 {
  margin: 0 0 14px;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.01em;
  font-size: 18px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: #dbe4ff;
  font-weight: 600;
  font-size: 14px;
  transition: 0.18s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.content {
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.card {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  overflow: hidden;
}


.card h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.hero {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background:
    radial-gradient(320px 160px at 0% 0%, rgba(62, 91, 255, 0.18), transparent 70%),
    radial-gradient(340px 160px at 100% 100%, rgba(18, 179, 168, 0.18), transparent 72%),
    linear-gradient(120deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
}

.muted { color: var(--text-muted); }

.metric {
  margin: 8px 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: #425377;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok { color: var(--ok); border-color: #bee8d3; background: #eaf9f2; }
.badge.warn { color: var(--warning); border-color: #f2dfb8; background: #fff7e9; }
.badge.danger { color: var(--danger); border-color: #f3c4d0; background: #ffecf1; }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
}

.table th,
.table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.table tr:last-child td { border-bottom: 0; }

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #607094;
  background: #f8faff;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand) 0%, #6c4eff 100%);
  box-shadow: 0 8px 20px rgba(80, 77, 255, 0.28);
}

.btn.primary:hover { transform: translateY(-1px); }

.btn.soft {
  background: #f4f7ff;
  border: 1px solid var(--line);
  color: #425377;
}

.btn.danger {
  color: #fff;
  background: linear-gradient(120deg, #cf3f5f 0%, #e45d73 100%);
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #6a7895;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 12px 12px;
  font: inherit;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #7a92ff;
  box-shadow: 0 0 0 4px rgba(85, 111, 255, 0.14);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
}

.auth-card {
  width: min(460px, 96vw);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.95));
  padding: 24px;
}

.auth-code {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.auth-code input {
  text-align: center;
  font-size: 21px;
  font-weight: 800;
}

.notice {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 600;
}

.notice.ok { background: #ebf9f0; color: #216b47; border-color: #cde8d6; }
.notice.warn { background: #fff5e8; color: #8f5600; border-color: #ffdcb2; }
.notice.error { background: #ffedf2; color: #b72d4b; border-color: #f2c5d1; }

.list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.proto-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f7;
  font-size: 12px;
  color: #4c5c80;
  background: rgba(250, 252, 255, 0.9);
  backdrop-filter: blur(8px);
}

.proto-bar a {
  color: #3047a1;
  font-weight: 700;
  text-decoration: none;
}

.proto-main-links,
.proto-quick-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.proto-main-links a,
.proto-quick-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
}

.role-student .sidebar {
  background: linear-gradient(180deg, #132247 0%, #1a2f60 100%);
}

.role-admin .sidebar {
  background: linear-gradient(180deg, #2b1f4d 0%, #1b1538 100%);
}

.role-methodist .sidebar {
  background: linear-gradient(180deg, #103b3a 0%, #0f2e32 100%);
}

.role-support .sidebar {
  background: linear-gradient(180deg, #4c2c16 0%, #332117 100%);
}

.kit-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.flow-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.flow-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.flow-card h4 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
}

.flow-note {
  margin-top: 14px;
  border-left: 3px solid #7b8dff;
  padding-left: 12px;
  color: #4f5f83;
  font-size: 14px;
}

.journey-step {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.journey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.role-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .flow-grid,
  .grid.cols-3,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .role-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar h2 { font-size: 24px; }
}

/* Additional structure helpers */
.stack { display: grid; gap: 12px; }
.module-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px; }
.module-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.lesson-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--line); }
.lesson-row:first-of-type { border-top: 0; }
.player {
  background: linear-gradient(145deg, #121936 0%, #1d2852 100%);
  color: #dce8ff;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 18px;
  min-height: 200px;
  display: grid;
  align-content: center;
}
.crumbs { font-size: 13px; color: #66789b; margin: 0 0 10px; }
.crumbs a { color: #3f57c7; text-decoration: none; }
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f9ff;
  gap: 4px;
}
.seg a {
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 10px;
  color: #4a5f86;
  font-size: 12px;
  font-weight: 700;
}
.seg a.active,
.seg a:hover { background: #fff; border: 1px solid var(--line); color: #273f8f; }

/* Alternative themes */
body[data-theme="apple"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --line: #e4e7ec;
  --line-strong: #d7dce5;
  --text: #111319;
  --text-muted: #5f6775;
  --brand: #111319;
  --brand-2: #5f6775;
  --brand-warm: #8f98a8;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 20px 48px rgba(18, 20, 24, 0.08);
  --shadow-soft: 0 8px 24px rgba(18, 20, 24, 0.06);
  background:
    radial-gradient(1000px 520px at 10% -10%, #ffffff 0%, transparent 60%),
    linear-gradient(180deg, #fafbfc 0%, #f2f4f7 100%);
}

body[data-theme="apple"] .hero,
body[data-theme="apple"] .card,
body[data-theme="apple"] .flow-card,
body[data-theme="apple"] .auth-card {
  border-color: #e7eaf0;
  background: #ffffff;
}

body[data-theme="apple"] .btn.primary {
  background: #16181f;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

body[data-theme="shot"] {
  --bg: #11111a;
  --surface: #171724;
  --surface-soft: #1f1f31;
  --line: #2d2c43;
  --line-strong: #3b3b58;
  --text: #f3f5ff;
  --text-muted: #b3b9d2;
  --brand: #6f52ff;
  --brand-2: #00d6c3;
  --brand-warm: #ff7b54;
  --shadow: 0 26px 58px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(900px 520px at 0% -10%, rgba(111,82,255,0.35), transparent 56%),
    radial-gradient(900px 520px at 100% 0%, rgba(0,214,195,0.24), transparent 60%),
    linear-gradient(180deg, #11111a 0%, #0d0d14 100%);
}

body[data-theme="shot"] .card,
body[data-theme="shot"] .flow-card,
body[data-theme="shot"] .hero,
body[data-theme="shot"] .auth-card,
body[data-theme="shot"] .module-card,
body[data-theme="shot"] .table {
  background: linear-gradient(165deg, #1a1b2a 0%, #151625 100%);
  border-color: #33344f;
  color: var(--text);
}

body[data-theme="shot"] .muted,
body[data-theme="shot"] .crumbs,
body[data-theme="shot"] .table th {
  color: #aeb5cf;
}

body[data-theme="shot"] .btn.primary {
  background: linear-gradient(120deg, #7f5dff 0%, #00c7b6 100%);
  box-shadow: 0 10px 22px rgba(103, 84, 255, 0.34);
}

body[data-theme="shot"] .btn.soft,
body[data-theme="shot"] input,
body[data-theme="shot"] select,
body[data-theme="shot"] textarea,
body[data-theme="shot"] .seg {
  background: #1f2031;
  border-color: #3b3d5b;
  color: #edf0ff;
}

body[data-theme="shot"] .proto-bar {
  background: rgba(18, 18, 28, 0.88);
  border-bottom-color: #343651;
  color: #c5cbee;
}

body[data-theme="shot"] .proto-main-links a,
body[data-theme="shot"] .proto-quick-links a,
body[data-theme="shot"] .role-card {
  background: #1f2031;
  border-color: #3b3d5b;
  color: #edf0ff;
}

body[data-theme="shot"] .proto-bar a,
body[data-theme="shot"] .crumbs a,
body[data-theme="shot"] a {
  color: #9bb2ff;
}

/* Auth polish */
.auth-head {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.auth-foot {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.auth-actions .btn { flex: 1; }

.auth-code input {
  min-height: 52px;
}

@media (max-width: 560px) {
  .auth-card { padding: 20px; }
  .auth-head h2 { font-size: 24px; }
  .auth-actions { flex-direction: column; }
}
