:root {
  --blue-900: #0a2f66;
  --blue-700: #0f5eb8;
  --blue-600: #1473d2;
  --blue-100: #e8f2ff;
  --ink: #122033;
  --muted: #617089;
  --line: #dbe4ef;
  --surface: #ffffff;
  --background: #f4f8fd;
  --danger: #b42318;
  --success: #10855a;
  --shadow: 0 18px 50px rgba(10, 47, 102, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.public-page {
  min-height: 100vh;
  background:
    linear-gradient(160deg, rgba(10, 47, 102, 0.96), rgba(20, 115, 210, 0.88)),
    url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1400&q=80") center / cover;
}

.public-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.brand-panel,
.form-panel,
.success-panel,
.login-panel,
.panel,
.metric {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.brand-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: white;
  background: var(--blue-900);
  font-size: 1.55rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue-700);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 9vw, 2.25rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.form-panel,
.success-panel,
.login-panel,
.panel {
  border-radius: 8px;
  padding: 22px;
}

.helper-text,
.section-heading p,
.dashboard-heading p {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.field span,
.field legend {
  font-weight: 800;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  outline: none;
}

input:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(20, 115, 210, 0.14);
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.interest-option,
.area-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 700;
}

.interest-option input,
.area-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-700);
}

.interest-option:has(input:checked),
.area-option:has(input:checked) {
  border-color: var(--blue-600);
  background: var(--blue-100);
}

.counter {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  color: white;
  background: var(--blue-700);
}

.primary-button:hover {
  background: var(--blue-900);
}

.secondary-button {
  color: var(--blue-900);
  background: var(--blue-100);
}

.danger-button {
  color: var(--danger);
  background: #fff0ee;
}

.error-message {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--danger);
  font-weight: 700;
}

.success-panel {
  text-align: center;
}

.success-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 999px;
  color: white;
  background: var(--success);
  font-size: 2rem;
  font-weight: 900;
}

.success-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-page {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #f7fbff, #e6f1ff);
}

.login-panel {
  width: min(100%, 430px);
}

.admin-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

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

.admin-header h1 {
  font-size: 2rem;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.header-actions .primary-button {
  width: auto;
}

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

.metric {
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

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

.section-heading p {
  margin-bottom: 0;
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.compact-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.compact-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.compact-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.link-button {
  border: 0;
  color: var(--danger);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue-900);
  background: var(--blue-100);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.group-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.group-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.number-pill {
  min-width: 46px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: center;
  color: white;
  background: var(--blue-900);
  font-weight: 900;
}

.assignment-pill {
  display: grid;
  gap: 2px;
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 8px;
  color: white;
  background: var(--blue-900);
}

.assignment-pill strong,
.assignment-pill span {
  overflow-wrap: anywhere;
}

.assignment-pill strong {
  font-size: 0.98rem;
}

.assignment-pill span {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.84;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
}

@media (min-width: 430px) {
  .option-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .admin-header,
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-layout,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .admin-shell {
    padding: 18px;
  }

  .header-actions,
  .header-actions .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
  }
}
