* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ログイン・変更画面の中央寄せ */
#loginView, #changePassView {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  width: 100%;
}

.login-card {
  max-width: 400px;
  padding: 32px 24px;
}

.brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
}

.sub-text {
  font-size: 0.85rem;
  color: #64748b;
  margin: 8px 0 20px;
  text-align: center;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #2563eb;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.primary-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.error-msg {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 14px;
  text-align: center;
}

/* ポータルヘッダー */
.app-header {
  background: #ffffff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.portal-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.logout-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

/* ポータルメイン */
.portal-main {
  padding: 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.user-card {
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
}

.grade-tag {
  font-size: 0.9rem;
  color: #64748b;
  display: block;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
}

.badge.admin {
  background: #fef3c7;
  color: #92400e;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.app-card {
  background: #ffffff;
  padding: 24px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
  transition: transform 0.15s, border-color 0.15s;
}

.app-card:active {
  transform: scale(0.98);
}

.app-card.admin {
  border: 1px solid #fde68a;
  background: #fffbeb;
}

.app-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.app-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.hidden {
  display: none !important;
}