:root {
  --bg: #08111f;
  --panel: rgba(15, 27, 49, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --muted: #b4c1d4;
  --accent: #f59e0b;
  --accent-2: #38bdf8;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.42);
}

body {
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30%),
    linear-gradient(180deg, #08111f 0%, #0b1324 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(8, 17, 31, 0.92);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar a {
  color: var(--text);
  margin-left: 12px;
  text-decoration: none;
}

.logout-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

.container {
  padding: 24px 24px 24px 36px;
}

.card,
.sheet,
.panel,
.student-card,
.messages .message,
.weekday-button,
.auth-card,
table {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card {
  padding: 22px 24px 24px;
  margin-bottom: 18px;
}

.sheet {
  padding: 22px 24px 24px;
  margin-bottom: 18px;
}

.button {
  display: inline-block;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), #fb7185);
  color: #08111f;
  border-radius: 10px;
  text-decoration: none;
  border: none;
}

.button.secondary {
  background: rgba(2, 6, 23, 0.34);
  color: var(--text);
  border: 1px solid var(--line);
}

.app-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.app-form p {
  margin: 0;
  display: grid;
  gap: 8px;
}

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

.app-form input,
.app-form textarea,
.app-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.34);
  color: var(--text);
  font: inherit;
}

.app-form input:focus,
.app-form textarea:focus,
.app-form select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.app-form textarea {
  min-height: 140px;
  resize: vertical;
}

.app-form .helptext,
.app-form .errorlist {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.app-form .errorlist {
  color: #fca5a5;
  list-style: none;
  padding: 0;
}

.student-card {
  padding: 20px 22px 20px 24px;
  text-decoration: none;
  color: inherit;
}

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

.page-head h2 {
  margin: 0;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.sheet-row {
  margin: 0 0 14px;
}

.sheet-row.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sheet-row .label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sheet-row .value {
  line-height: 1.7;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 18px;
}

.panel {
  min-height: 120px;
  padding: 16px;
}

.messages .message {
  padding: 10px 12px;
  margin-bottom: 8px;
}

.weekday-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.weekday-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 8px 4px;
}

.search-form {
  display: grid;
  gap: 12px;
  margin: 20px 0 12px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.28), rgba(2, 6, 23, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.search-row input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 0 18px;
  background: rgba(2, 6, 23, 0.42);
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-row input[type="search"]::placeholder {
  color: rgba(180, 193, 212, 0.72);
}

.search-row input[type="search"]:focus {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 3px rgba(245, 158, 11, 0.16);
}

.search-row .button {
  width: auto;
  min-width: 104px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
}

.weekday-button.active {
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
}

.text-button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--accent-2);
  font: inherit;
}

.portal-hero {
  padding: 32px 0 18px;
}

.hero-copy {
  max-width: 960px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 28px;
}

.portal-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  padding: 32px;
  text-decoration: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.portal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.45);
}

.portal-card h2 {
  margin: 0;
  font-size: 1.7rem;
}

.portal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.portal-action {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #fbbf24);
  color: #0b1324;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.2);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

a {
  color: inherit;
}

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

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .sheet-row.two-col {
    grid-template-columns: 1fr;
  }

  .sheet-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row .button {
    width: 100%;
  }

  .search-row input[type="search"] {
    min-height: 52px;
  }

  .search-row .button {
    min-height: 52px;
  }
}
