/* ===== CDX-LMS Global Styles ===== */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --secondary: #34a853;
  --secondary-light: #e6f4ea;
  --accent: #fbbc04;
  --accent-light: #fef7e0;
  --danger: #ea4335;
  --danger-light: #fce8e6;
  --purple: #9c27b0;
  --purple-light: #f3e5f5;
  --teal: #00897b;
  --teal-light: #e0f2f1;
  --orange: #f57c00;
  --orange-light: #fff3e0;

  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --text-white: #ffffff;

  --bg-white: #ffffff;
  --bg-card:  #ffffff;
  --bg-light: #f8f9fa;
  --bg-gray: #f1f3f4;
  --bg-dark: #1a1a2e;

  --border: #e0e0e0;
  --border-light: #f0f0f0;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 260px;
  --header-height: 64px;
  --bottom-nav-height: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { opacity: 0.8; }

img { max-width: 100%; display: block; }

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-dark);
  color: var(--text-white);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #5c6bc0);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .main { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.logo-text .sub { font-size: 10px; color: rgba(255,255,255,0.5); letter-spacing: 1px; text-transform: uppercase; }

/* User Info in Sidebar */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info .role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  padding: 1px 8px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 2px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.nav-item.active {
  color: white;
  background: rgba(26, 115, 232, 0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar Progress */
.sidebar-progress {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-progress .label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.sidebar-progress .label span {
  color: white;
  font-weight: 600;
}

.mini-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Top Header ===== */
.top-header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg-gray);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  gap: 8px;
  width: 280px;
  border: 1.5px solid transparent;
  transition: var(--transition);
}

.header-search:focus-within {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.header-search input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
}

.header-search input::placeholder { color: var(--text-muted); }

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover { background: var(--bg-gray); color: var(--text-primary); }

.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-secondary);
}

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  padding: 24px;
  display: none;
}

.page-content.active { display: block; }

/* ===== Cards ===== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

/* ===== Stats Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.blue::before { background: linear-gradient(90deg, var(--primary), #5c6bc0); }
.stat-card.green::before { background: linear-gradient(90deg, var(--secondary), var(--teal)); }
.stat-card.yellow::before { background: linear-gradient(90deg, var(--accent), var(--orange)); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), #e91e63); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-card.blue .stat-icon { background: var(--primary-light); }
.stat-card.green .stat-icon { background: var(--secondary-light); }
.stat-card.yellow .stat-icon { background: var(--accent-light); }
.stat-card.purple .stat-icon { background: var(--purple-light); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-change {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--secondary); }
.stat-change.down { color: var(--danger); }

/* ===== Progress Bar ===== */
.progress-bar {
  height: 8px;
  background: var(--bg-gray);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.8s ease;
}

.progress-fill.yellow {
  background: linear-gradient(90deg, var(--accent), var(--orange));
}

.progress-fill.green {
  background: linear-gradient(90deg, var(--secondary), var(--teal));
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

.btn-text {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  background: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-text:hover { background: var(--primary-light); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,115,232,0.4);
}

.btn-secondary {
  background: var(--bg-gray);
  color: var(--text-primary);
}

.btn-secondary:hover { background: var(--border); }

.btn-success {
  background: var(--secondary);
  color: white;
}

.btn-success:hover { background: #2d9249; }

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--secondary-light); color: var(--secondary); }
.badge-warning { background: var(--accent-light); color: #e65100; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-teal { background: var(--teal-light); color: var(--teal); }
.badge-orange { background: var(--orange-light); color: var(--orange); }

/* ===== Curriculum Accordion ===== */
.curriculum-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.year-section { margin-bottom: 20px; }

.year-header {
  background: linear-gradient(135deg, var(--bg-dark), #2d2d44);
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.year-header:hover { opacity: 0.95; }

.year-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.year-badge {
  background: rgba(255,255,255,0.2);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.year-info h3 { font-size: 16px; font-weight: 700; }
.year-info p { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.year-progress-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.year-progress-bar {
  width: 100px;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}

.year-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
}

.year-chevron {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.year-chevron.open { transform: rotate(180deg); }

.quarter-list {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  display: none;
}

.quarter-list.open { display: block; }

.quarter-item { border-bottom: 1px solid var(--border-light); }
.quarter-item:last-child { border-bottom: none; }

.quarter-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background: var(--bg-light);
  transition: var(--transition);
}

.quarter-header:hover { background: var(--bg-gray); }

.quarter-number {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.quarter-info { flex: 1; }
.quarter-info h4 { font-size: 14px; font-weight: 600; }
.quarter-info p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.week-list {
  padding: 8px 0;
  display: none;
}

.week-list.open { display: block; }

.week-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 12px 60px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
}

.week-item:hover { background: var(--primary-light); }

.week-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  font-size: 12px;
}

.week-checkbox.done {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.week-checkbox.in-progress {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.week-info { flex: 1; }
.week-num { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.week-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-top: 1px; }
.week-tags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

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

.week-duration {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ===== Content Player ===== */
.content-player {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.video-container {
  position: relative;
  background: #000;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
}

.video-container iframe,
.video-container .video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white;
}

.play-btn-big {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.play-btn-big:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }

.content-meta {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.content-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

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

.content-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Comments ===== */
.comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.comment-textarea {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  resize: none;
  min-height: 80px;
  transition: var(--transition);
}

.comment-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child { border-bottom: none; }

.comment-body { flex: 1; }
.comment-author { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.comment-date { font-size: 11px; color: var(--text-muted); margin-left: 8px; }
.comment-text { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }

/* ===== Resources Grid ===== */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.resource-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.resource-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.resource-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.resource-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Announcement Banner ===== */
.announce-list { display: flex; flex-direction: column; gap: 12px; }

.announce-item {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 16px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  gap: 14px;
  cursor: pointer;
}

.announce-item:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.announce-item.urgent { border-color: var(--danger); }
.announce-item.info { border-color: var(--secondary); }

.announce-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  padding-top: 2px;
}

.announce-body { flex: 1; }
.announce-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.announce-text { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.announce-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}
.announce-date { font-size: 11px; color: var(--text-muted); }

/* ===== Learning Path ===== */
.learning-path {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.path-step {
  display: flex;
  gap: 16px;
  padding: 0 0 24px 0;
  position: relative;
}

.path-step:last-child { padding-bottom: 0; }

.path-step::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 38px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.path-step:last-child::before { display: none; }

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 1;
  transition: var(--transition);
}

.path-step.done .step-dot {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.path-step.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.path-step.locked .step-dot { opacity: 0.5; }

.step-content { flex: 1; padding-top: 6px; }
.step-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.step-desc { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* ===== Leaderboard ===== */
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.leaderboard-item:hover { background: var(--primary-light); }
.leaderboard-item.me { background: var(--primary-light); border: 1.5px solid var(--primary); }

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-1 { background: #FFD700; color: #7B6000; }
.rank-2 { background: #C0C0C0; color: #4A4A4A; }
.rank-3 { background: #CD7F32; color: white; }
.rank-other { background: var(--bg-gray); color: var(--text-secondary); }

.leaderboard-user { flex: 1; }
.leaderboard-user .name { font-size: 13px; font-weight: 600; }
.leaderboard-user .weeks { font-size: 11px; color: var(--text-secondary); }

.leaderboard-score { font-size: 16px; font-weight: 800; color: var(--primary); }

/* ===== Admin Panel ===== */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-gray);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: center;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-light);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--bg-light); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== Form Elements ===== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
  background: var(--bg-white);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  resize: vertical;
  min-height: 100px;
  transition: var(--transition);
}

.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== Toast Notification ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: slideInRight 0.3s ease;
  max-width: 320px;
}

.toast.success { background: var(--secondary); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

.toast.hiding { animation: fadeOut 0.3s ease forwards; }

/* ===== Login Screen ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  position: relative;
  overflow: hidden;
}

.login-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  background: white;
  animation: float 8s infinite ease-in-out;
}

.shape-1 { width: 400px; height: 400px; top: -100px; left: -100px; animation-delay: 0s; }
.shape-2 { width: 300px; height: 300px; bottom: -80px; right: -80px; animation-delay: 2s; }
.shape-3 { width: 200px; height: 200px; top: 40%; left: 60%; animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 420px;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), #5c6bc0);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(26,115,232,0.4);
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 36px;
  line-height: 1.6;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: white;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.google-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.google-icon {
  width: 24px;
  height: 24px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.demo-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.demo-btn:hover { background: rgba(255,255,255,0.18); }

.login-note {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 20px;
  line-height: 1.7;
}

/* ===== Dashboard Grid ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.dashboard-main { display: flex; flex-direction: column; gap: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }

/* ===== Current Week Card ===== */
.current-week-card {
  background: linear-gradient(135deg, var(--primary) 0%, #5c6bc0 60%, #7c4dff 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.current-week-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.current-week-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: 20%;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.cw-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.7; }
.cw-week { font-size: 48px; font-weight: 900; line-height: 1; margin: 4px 0; }
.cw-title { font-size: 20px; font-weight: 700; opacity: 0.95; }
.cw-theme { font-size: 14px; opacity: 0.7; margin-top: 4px; }

.cw-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.cw-progress {
  flex: 1;
  max-width: 240px;
}

.cw-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.cw-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.cw-progress-fill {
  height: 100%;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
  transition: width 1s ease;
}

.cw-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.cw-btn:hover { background: rgba(255,255,255,0.3); }

/* ===== Recent Content Cards ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.content-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}

.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.content-thumbnail {
  height: 140px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.content-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-video { background: rgba(234,67,53,0.9); color: white; }
.type-pdf { background: rgba(26,115,232,0.9); color: white; }
.type-article { background: rgba(52,168,83,0.9); color: white; }

.content-card-body { padding: 14px; }
.content-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.content-card-meta { display: flex; gap: 12px; margin-top: 8px; align-items: center; }

/* ===== Profile Page ===== */
.profile-header {
  background: linear-gradient(135deg, var(--bg-dark), #2d2d44);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: white;
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  border: 4px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  overflow: hidden;
}

.profile-info { flex: 1; }
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: flex-start;
  min-width: 174px;
}
.profile-action-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.profile-action-btn:hover {
  background: rgba(255,255,255,0.24);
  color: #fff;
}
.profile-name { font-size: 24px; font-weight: 800; }
.profile-role-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 6px;
}

.profile-stats {
  display: flex;
  gap: 28px;
  margin-top: 16px;
}

.profile-stat { text-align: center; }
.profile-stat .val { font-size: 24px; font-weight: 800; }
.profile-stat .lab { font-size: 11px; opacity: 0.6; margin-top: 2px; }

/* ===== Achievement Badges ===== */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.achievement-item {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.achievement-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.achievement-item.locked { opacity: 0.4; filter: grayscale(1); }

.achievement-icon { font-size: 36px; margin-bottom: 8px; }
.achievement-name { font-size: 11px; font-weight: 700; color: var(--text-primary); }
.achievement-desc { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ===== Mobile Bottom Navigation ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: 0;
  background: transparent;
  position: relative;
}

.bottom-nav-item:hover { color: var(--primary); background: var(--primary-light); }

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-icon { font-size: 22px; }

/* ===== Sidebar Overlay (Mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ===== Skeleton Loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-gray) 25%, #e8e8e8 50%, var(--bg-gray) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Chips / Tags ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-gray);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.chip.tech { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.chip.no-code { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.chip.ai { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.chip.community { background: #fff8e1; color: #e65100; border-color: #ffcc80; }
.chip.infra { background: #e0f2f1; color: #004d40; border-color: #80cbc4; }

/* ===== PDF Viewer ===== */
.pdf-viewer {
  background: #525659;
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.pdf-toolbar {
  background: #3c4043;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 13px;
}

.pdf-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: rgba(255,255,255,0.5);
}

/* ===== Notification Dropdown ===== */
.notification-panel {
  position: absolute;
  top: 52px;
  right: 0;
  width: 360px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  z-index: 200;
  overflow: hidden;
  display: none;
}

.notification-panel.open { display: block; }

.notif-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-title { font-size: 15px; font-weight: 700; }

.notif-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: 12px;
}

.notif-item:hover { background: var(--bg-light); }
.notif-item.unread { background: var(--primary-light); }
.notif-item:last-child { border-bottom: none; }

.notif-icon { font-size: 24px; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-text { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .top-header { padding: 0 16px; }
  .hamburger-btn { display: flex; }
  .header-search { width: 200px; }
  .page-content { padding: 16px; padding-bottom: calc(var(--bottom-nav-height) + 16px); }
  .bottom-nav { display: flex; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .content-grid { grid-template-columns: 1fr; }
  .resources-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .login-card { padding: 36px 24px; }
  .current-week-card { padding: 20px; }
  .cw-week { font-size: 36px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-actions { align-self: stretch; width: 100%; }
  .profile-stats { justify-content: center; }
  .achievement-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-tabs .tab-btn { font-size: 12px; padding: 7px 10px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px; }
}

@media (max-width: 400px) {
  :root { font-size: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 22px; }
  .achievement-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== PDF 複数資料 タブUI ===== */
.pdf-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.pdf-tab-btn {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: -2px;
  position: relative;
}

.pdf-tab-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.pdf-tab-btn.active {
  background: white;
  color: var(--primary);
  border-color: var(--border);
  border-bottom-color: white;
  z-index: 1;
}

.pdf-panels {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.pdf-panel {
  display: none;
}

.pdf-panel.active {
  display: block;
}

/* PDFビューアー（iframe対応で高さを拡張） */
.pdf-viewer {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #2d3748, #4a5568);
  color: white;
  font-size: 13px;
  flex-wrap: wrap;
  min-height: 44px;
}

.pdf-toolbar-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.pdf-toolbar-btn:hover {
  background: rgba(255,255,255,0.28);
}

.pdf-body {
  min-height: 480px;
  height: 540px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

/* URL未設定・エラー時の中央表示 */
.pdf-body > div:not([id^="pdfFrame"]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pdf-body iframe {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
}

/* PDF ローディングオーバーレイ */
.pdf-loading-overlay {
  position: absolute;
  inset: 0;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* iframeFrameコンテナ */
#pdfFrame {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* PDF件数バッジ（コンテンツ一覧テーブル用） */
.pdf-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.pdf-count-badge::before {
  content: "📄";
  font-size: 11px;
}

/* 管理者フォーム PDF入力行 */
.pdf-input-row {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.pdf-input-row:focus-within {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* コンテンツ情報バーのPDF件数 */
.content-info-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 600px) {
  .pdf-tab-btn {
    font-size: 11px;
    padding: 6px 10px;
    max-width: 140px;
  }
  .pdf-body {
    min-height: 380px;
    height: 440px;
  }
  .pdf-toolbar-btn {
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* ============================================================
   管理者フォーム — ドキュメント入力共通スタイル
   ============================================================ */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 700px) {
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ドキュメントセクション（PDF / その他ドキュメントの枠） */
.doc-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 10px;
  background: var(--bg-card);
  margin-bottom: 16px;
}

.doc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.doc-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.doc-section-icon {
  font-size: 16px;
}

/* 入力行（PDF・ドキュメント共通） */
.doc-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.doc-input-row:focus-within {
  border-color: var(--primary);
  background: var(--primary-light);
}

.doc-del-btn {
  background: var(--danger-light) !important;
  color: var(--danger) !important;
  flex-shrink: 0;
  margin-top: 2px;
}

.doc-del-placeholder {
  width: 36px;
  flex-shrink: 0;
}

/* Google Drive 判定アイコン */
.gdrive-status-icon {
  font-size: 18px;
  flex-shrink: 0;
  cursor: help;
}

/* ＋追加ボタン */
.doc-add-btn {
  margin-top: 2px;
  margin-bottom: 4px;
}

/* Googleドライブガイド */
.gdrive-guide {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.8;
  background: var(--bg-light);
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid var(--primary);
}

/* ============================================================
   コンテンツプレイヤー — その他ドキュメントカード
   ============================================================ */
.doc-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.doc-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--primary-light);
}

.doc-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.doc-card-body {
  flex: 1;
  min-width: 0;
}

.doc-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
  flex-wrap: wrap;
}

.doc-type-chip {
  font-size: 11px;
  font-weight: 600;
}

.doc-gdrive-chip {
  font-size: 10px;
  background: #e8f4ea;
  color: #1e7e34;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.doc-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ============================================================
   コンテンツ一覧テーブル — ドキュメント件数バッジ
   ============================================================ */
.doc-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--purple-light);
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.doc-count-badge::before {
  content: "📁";
  font-size: 11px;
}

/* ============================================================
   お気に入り (Favorites) — 全般スタイル
   ============================================================ */

/* -------- カリキュラム週アイテムのハートボタン -------- */
.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--text-muted);
  line-height: 1;
  transition: transform 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.fav-btn:hover {
  color: var(--accent);
  background: var(--warning-light, #fff8e1);
  transform: scale(1.2);
}
.fav-btn.active {
  color: var(--accent, #f9a825);
}

/* -------- コンテンツプレイヤーのお気に入りボタン -------- */
.fav-content-btn {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn-warning {
  background: var(--warning-light, #fff8e1);
  color: var(--accent, #f9a825);
  border: 1.5px solid var(--accent, #f9a825);
}
.btn-warning:hover {
  background: var(--accent, #f9a825);
  color: #fff;
}

/* -------- ナビゲーションバッジ -------- */
.fav-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.fav-bottom-badge {
  position: absolute;
  top: -2px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

/* -------- お気に入りページ -------- */
.fav-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.fav-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.fav-empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.fav-empty-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ヘッダー */
.fav-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.fav-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.fav-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}
.fav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ソートボタン群 */
.fav-sort-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.fav-sort-btn {
  background: none;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.fav-sort-btn + .fav-sort-btn {
  border-left: 1px solid var(--border);
}
.fav-sort-btn:hover {
  background: var(--bg-light);
  color: var(--primary);
}
.fav-sort-btn.active {
  background: var(--primary);
  color: #fff;
}

/* カードグリッド */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.fav-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
}
.fav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.fav-card-year-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}
.fav-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fav-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
}
.fav-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.fav-card-duration {
  font-size: 11px;
  color: var(--text-muted);
}
.fav-badge {
  font-size: 10px !important;
  padding: 2px 7px !important;
}
.fav-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.fav-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  gap: 8px;
}
.fav-card-open-btn {
  font-size: 12px !important;
  padding: 5px 12px !important;
}
.fav-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.fav-remove-btn:hover {
  background: var(--danger-light, #fce8e6);
  color: var(--danger);
}

/* -------- ダッシュボードのお気に入りプレビュー行 -------- */
.dash-fav-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid var(--border-light);
}
.dash-fav-row:hover {
  background: var(--bg-light);
}
.dash-fav-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-fav-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .fav-grid {
    grid-template-columns: 1fr;
  }
  .fav-header {
    flex-direction: column;
    align-items: stretch;
  }
  .fav-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   リソース管理（管理者パネル）
   ============================================================ */

/* ---- パネルヘッダー ---- */
.res-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.res-admin-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.res-admin-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- カテゴリブロック ---- */
.res-cat-block {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.res-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--bg-light);
  gap: 12px;
  flex-wrap: wrap;
  transition: background 0.15s;
}
.res-cat-header:hover {
  background: var(--primary-light);
}
.res-cat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.res-cat-chevron {
  font-size: 12px;
  color: var(--text-muted);
  width: 14px;
  display: inline-block;
  transition: transform 0.15s;
}
.res-cat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.res-cat-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- アイテムテーブル ---- */
.res-cat-body {
  padding: 12px 16px;
}
.res-item-table {
  font-size: 13px;
}
.res-item-table th,
.res-item-table td {
  padding: 8px 10px;
  vertical-align: middle;
}
.res-cat-delete-btn {
  background: var(--danger-light, #fce8e6) !important;
  color: var(--danger) !important;
  border: 1px solid var(--danger-light, #fce8e6) !important;
}
.res-cat-delete-btn:hover {
  background: var(--danger) !important;
  color: #fff !important;
}
.res-item-delete-btn {
  background: var(--danger-light, #fce8e6) !important;
  color: var(--danger) !important;
  border: 1px solid transparent !important;
}
.res-item-delete-btn:hover {
  background: var(--danger) !important;
  color: #fff !important;
}

/* btn-xs */
.btn-xs {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.btn-xs:hover {
  background: var(--bg-light);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
}
.btn-danger:hover {
  opacity: 0.88;
}

/* ---- モーダル ---- */
.res-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: none;
}
.res-modal-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  position: relative;
  z-index: 9001;
}
.res-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.res-modal-header.res-modal-danger {
  background: var(--danger);
}
.res-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.res-modal-close:hover { color: #fff; }
.res-modal-body {
  padding: 20px;
  background: #ffffff;
}
.res-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: #ffffff;
}

@media (max-width: 640px) {
  .res-cat-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .res-cat-header-right {
    width: 100%;
    justify-content: flex-end;
  }
  .res-modal-box {
    max-width: 100%;
    border-radius: 12px;
  }
}

/* ============================================================
   ニックネーム機能
   ============================================================ */

/* ---- バッジ（プロフィールヘッダー・リーダーボード） ---- */
.nick-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.nick-badge-sm {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---- モーダル ---- */
.nick-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.nick-modal-box {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.nick-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.nick-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.nick-modal-close:hover { color: #fff; }
.nick-modal-body {
  padding: 20px;
}
.nick-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.nick-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

/* ---- 入力欄 ---- */
.nick-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.nick-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.nick-at {
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-light);
  border-right: 1px solid var(--border);
  height: 40px;
  display: flex;
  align-items: center;
}
.nick-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.nick-input:focus { outline: none; }

.password-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.password-input-row .form-input { flex: 1; }
.password-input-row .btn { white-space: nowrap; }

/* ---- バリデーションメッセージ ---- */
.nick-valid-msg {
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
  transition: color 0.15s;
}
.nick-valid-msg.nick-ok    { color: var(--secondary); }
.nick-valid-msg.nick-error { color: var(--danger); }
.nick-valid-msg.nick-warn  { color: var(--accent, #f9a825); }

/* ---- プレビュー ---- */
.nick-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-light);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.nick-preview strong {
  color: var(--text-primary);
  font-size: 14px;
}

@media (max-width: 500px) {
  .nick-modal-box  { border-radius: 12px; }
  .nick-modal-footer { flex-direction: column; align-items: stretch; }
}

/* ===================================================
   LOGIN — Tab-based layout (User / Admin)
   =================================================== */

/* --- Tab buttons --- */
.login-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 16px;
  background: var(--bg-secondary, #f0f2f5);
  border-radius: 10px;
  padding: 4px;
}

.login-tab {
  flex: 1;
  padding: 9px 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted, #666);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}

.login-tab.active {
  background: #fff;
  color: var(--primary, #1a73e8);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.login-tab:hover:not(.active) {
  background: rgba(255,255,255,.55);
  color: var(--text-primary, #222);
}

/* --- Tab panes --- */
.login-tab-pane {
  display: none;
}

.login-tab-pane.active {
  display: block;
}

/* --- Admin login form --- */
.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-login-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #1a1a1a);
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}

.admin-login-input:focus {
  outline: none;
  border-color: var(--primary, #1a73e8);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.admin-login-input.shake {
  animation: shake .5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* password wrap + eye button */
.admin-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-pw-wrap .admin-login-input {
  padding-right: 44px;
}

.pw-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: .6;
  padding: 2px 4px;
  transition: opacity .15s;
}

.pw-toggle-btn:hover { opacity: 1; }

/* error message */
.admin-login-error {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6c6;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

/* submit button */
.admin-login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  transition: opacity .18s, transform .1s;
}

.admin-login-btn:hover  { opacity: .9; }
.admin-login-btn:active { transform: scale(.98); }

/* ===================================================
   SIDEBAR — Logout button
   =================================================== */
.sidebar-logout {
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}

.logout-btn:hover {
  background: rgba(239,68,68,.25);
  border-color: rgba(239,68,68,.6);
  color: #fff;
}

/* ===================================================
   LOGIN — 一般ユーザー メールフォーム
   =================================================== */
.user-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.user-login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.user-login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e0e0e0);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text-primary, #1a1a1a);
  transition: border-color .18s, box-shadow .18s;
  box-sizing: border-box;
}

.user-login-input:focus {
  outline: none;
  border-color: var(--primary, #1a73e8);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.user-login-input.shake {
  animation: shake .5s ease;
}

/* error */
.user-login-error {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f5c6c6;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

/* submit button */
.user-login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary, #1a73e8), #1557b0);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  transition: opacity .18s, transform .1s;
}

.user-login-btn:hover  { opacity: .9; }
.user-login-btn:active { transform: scale(.98); }

/* domain notice */
.login-domain-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted, #888);
  text-align: center;
  line-height: 1.5;
}

.login-domain-note strong {
  color: var(--primary, #1a73e8);
}

/* =========================================================
   活動報告書 ページ
   ========================================================= */

.reports-page {
  padding: 24px 0;
}

.reports-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.reports-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #111);
}

.reports-meta {
  font-size: 14px;
  color: var(--text-muted, #666);
  background: var(--bg-surface, #f5f5f5);
  padding: 4px 12px;
  border-radius: 20px;
}

.reports-desc {
  font-size: 14px;
  color: var(--text-muted, #666);
  margin: 0 0 20px;
  line-height: 1.7;
}

/* 週リスト */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 1週行 */
.report-row {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.report-row:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.report-row--submitted {
  border-left: 4px solid #34a853;
}

.report-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.report-week-badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--primary, #1a73e8);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.report-week-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #111);
  flex: 1;
  min-width: 120px;
}

.report-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.report-status--done {
  background: #e8f5e9;
  color: #2e7d32;
}
.report-status--none {
  background: #f5f5f5;
  color: #9e9e9e;
}
.report-date {
  font-size: 11px;
  color: #777;
  margin-left: 4px;
}

.report-toggle-btn {
  margin-left: auto;
  white-space: nowrap;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--primary, #1a73e8);
  color: var(--primary, #1a73e8);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.report-toggle-btn:hover {
  background: var(--primary, #1a73e8);
  color: #fff;
}

/* フォームエリア */
.report-form-wrap {
  border-top: 1px solid #e0e0e0;
}

.report-form {
  padding: 16px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
}

.report-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 4px;
}

.report-required {
  color: #d32f2f;
}

.report-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.report-input:focus {
  outline: none;
  border-color: var(--primary, #1a73e8);
}

.report-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}
.report-textarea:focus {
  outline: none;
  border-color: var(--primary, #1a73e8);
}

.report-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.report-form-error {
  font-size: 13px;
  color: #d32f2f;
  background: #ffebee;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 8px;
}

/* =========================================================
   管理者 報告書管理
   ========================================================= */

.rpt-admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.rpt-user-block {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.rpt-user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
  flex-wrap: wrap;
}
.rpt-user-head:hover {
  background: #f5f7ff;
}

.rpt-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary, #1a73e8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.rpt-email {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111);
}

.rpt-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rpt-count-badge {
  font-size: 12px;
  font-weight: 700;
  background: #e8f0fe;
  color: var(--primary, #1a73e8);
  padding: 2px 10px;
  border-radius: 20px;
}

.rpt-latest {
  font-size: 12px;
  color: var(--text-muted, #888);
}

.rpt-caret {
  font-size: 12px;
  color: var(--text-muted, #888);
  transition: transform 0.15s;
}

/* テーブル */
.rpt-user-body {
  border-top: 1px solid #e0e0e0;
  overflow-x: auto;
}

.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rpt-th {
  background: #f5f5f5;
  color: var(--text-muted, #666);
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}

.rpt-td {
  padding: 10px 12px;
  border-top: 1px solid #f0f0f0;
  vertical-align: top;
  color: var(--text-primary, #111);
}

.rpt-link {
  color: var(--primary, #1a73e8);
  text-decoration: none;
  font-weight: 500;
}
.rpt-link:hover {
  text-decoration: underline;
}

.rpt-comment {
  max-width: 260px;
  color: var(--text-muted, #666);
}

.rpt-date {
  white-space: nowrap;
  color: var(--text-muted, #888);
  font-size: 12px;
}

/* =========================================================
   ダーク対応（テーマ変数がダーク時）
   ========================================================= */
@media (prefers-color-scheme: dark) {
  .report-row       { background: var(--bg-card, #1e1e2e); border-color: rgba(255,255,255,.1); }
  .report-form      { background: var(--bg-surface, #16161e); }
  .report-input,
  .report-textarea  { background: var(--bg-card, #1e1e2e); color: var(--text-primary, #eee); border-color: rgba(255,255,255,.2); }
  .rpt-user-block   { background: var(--bg-card, #1e1e2e); border-color: rgba(255,255,255,.1); }
  .rpt-user-head:hover { background: rgba(255,255,255,.05); }
  .rpt-th           { background: rgba(255,255,255,.05); }
  .rpt-td           { border-color: rgba(255,255,255,.07); }
}

/* =========================================================
   バッジ・実績 — カテゴリグループ & カード刷新
   ========================================================= */

.badge-group {
  margin-bottom: 28px;
}

.badge-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light, #e8e8e8);
}

.badge-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

/* カード */
.achievement-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
}
.achievement-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  border-color: var(--primary, #1a73e8);
}
.achievement-item.locked {
  background: #fafafa;
  border-color: #e8e8e8;
  opacity: .65;
  filter: grayscale(.6);
}
.achievement-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 8px;
}
.achievement-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #111);
  margin-bottom: 4px;
  word-break: break-all;
}
.achievement-desc {
  font-size: 10px;
  color: var(--text-muted, #888);
  line-height: 1.4;
}
.achievement-unlocked-mark {
  font-size: 11px;
  margin-top: 6px;
  color: #34a853;
  font-weight: 700;
}
.achievement-lock-mark {
  font-size: 11px;
  margin-top: 6px;
  color: #bbb;
}

/* =========================================================
   バッジ詳細モーダル
   ========================================================= */

.badge-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 16px;
  animation: fadeIn .15s ease;
}

.badge-modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px 28px;
  max-width: 380px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: slideUp .18s ease;
  text-align: center;
}

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

.badge-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted, #888);
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .12s;
}
.badge-modal-close:hover { background: #f0f0f0; }

.badge-modal-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 10px;
}
.badge-modal-locked {
  filter: grayscale(.7);
  opacity: .6;
}

.badge-modal-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #1a73e8);
  background: #e8f0fe;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: .04em;
}

.badge-modal-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary, #111);
  margin-bottom: 6px;
}

.badge-modal-status {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 14px;
}
.badge-modal-status--unlocked {
  background: #e8f5e9;
  color: #2e7d32;
}
.badge-modal-status--locked {
  background: #f5f5f5;
  color: #9e9e9e;
}

.badge-modal-desc {
  font-size: 14px;
  color: var(--text-secondary, #444);
  line-height: 1.65;
  margin: 0 0 16px;
}

.badge-modal-clear-box {
  background: #fffbea;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 14px;
}
.badge-modal-clear-label {
  font-size: 12px;
  font-weight: 700;
  color: #f59f00;
  margin-bottom: 5px;
}
.badge-modal-clear-text {
  font-size: 13px;
  color: var(--text-primary, #222);
  line-height: 1.6;
}

/* プログレスバー */
.badge-modal-progress {
  background: #f5f7ff;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
}
.badge-modal-progress-label {
  font-size: 12px;
  color: var(--text-muted, #666);
  margin-bottom: 6px;
}
.badge-modal-progress-track {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.badge-modal-progress-fill {
  height: 100%;
  background: var(--primary, #1a73e8);
  border-radius: 4px;
  transition: width .4s ease;
}
.badge-modal-progress-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #1a73e8);
  text-align: right;
}

/* =========================================================
   招待モーダル / メンバー詳細
   ========================================================= */

.invite-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9400;
  padding: 16px;
  animation: fadeIn .15s ease;
  overflow-y: auto;
}

.invite-modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  max-width: 640px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  animation: slideUp .18s ease;
  max-height: 92vh;
  overflow-y: auto;
}

.invite-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted, #888);
  padding: 4px 7px;
  border-radius: 6px;
  transition: background .12s;
  line-height: 1;
}
.invite-modal-close:hover { background: #f0f0f0; }

.invite-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary, #111);
  margin: 0 0 6px;
}

.invite-modal-subtitle {
  font-size: 13px;
  color: var(--text-muted, #666);
  line-height: 1.65;
  margin: 0 0 20px;
}

/* フォーム */
.invite-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invite-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .invite-field-row { grid-template-columns: 1fr; }
}

.invite-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.invite-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #333);
}

.invite-required {
  color: #d32f2f;
}

.invite-input {
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
  box-sizing: border-box;
  width: 100%;
  background: #fff;
}
.invite-input:focus {
  outline: none;
  border-color: var(--primary, #1a73e8);
}

.invite-textarea {
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color .15s;
  box-sizing: border-box;
  width: 100%;
}
.invite-textarea:focus {
  outline: none;
  border-color: var(--primary, #1a73e8);
}

.invite-notice {
  background: #e8f0fe;
  border: 1px solid #c5d8fc;
  border-radius: 10px;
  padding: 12px 16px;
}
.invite-notice-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #1a73e8);
  margin-bottom: 8px;
}
.invite-notice-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-primary, #333);
  line-height: 1.7;
}

.invite-error {
  font-size: 13px;
  color: #d32f2f;
  background: #ffebee;
  border-radius: 7px;
  padding: 8px 12px;
}

.invite-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* メンバー詳細グリッド */
.member-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 4px;
}
@media (max-width: 420px) {
  .member-detail-grid { grid-template-columns: 1fr; }
}

.member-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: #f8f9fb;
  border-radius: 8px;
}

.member-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.member-detail-value {
  font-size: 14px;
  color: var(--text-primary, #111);
  font-weight: 500;
}

.member-detail-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #2563eb);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--primary-light, #dbeafe);
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.member-detail-note {
  font-size: 13px;
  color: var(--text-secondary, #444);
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ============================================================
   活動報告書 — 階層レイアウト (rpt2)
   Year → Quarter → Week の3階層アコーディオン
   ============================================================ */

/* ── リスト全体 ── */
.rpt2-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
}

/* ── Year ブロック ── */
.rpt2-year-block {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.rpt2-year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--primary-light, #e8f0fe);
  cursor: pointer;
  user-select: none;
  gap: 12px;
  flex-wrap: wrap;
}
.rpt2-year-head:hover { background: var(--primary-hover, #d2e3fc); }

.rpt2-year-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rpt2-year-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary, #1a73e8);
  white-space: nowrap;
}
.rpt2-year-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.rpt2-year-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.rpt2-year-prog {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rpt2-year-prog-bar {
  width: 80px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.rpt2-year-prog-fill {
  height: 100%;
  background: var(--primary, #1a73e8);
  border-radius: 3px;
  transition: width .4s;
}
.rpt2-year-prog-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.rpt2-year-caret {
  font-size: 11px;
  color: var(--text-muted);
}

.rpt2-year-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Quarter ブロック ── */
.rpt2-q-block {
  background: var(--surface-secondary, #f8f9fa);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.rpt2-q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}
.rpt2-q-head:hover { background: var(--hover, #f1f3f4); }

.rpt2-q-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.rpt2-q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rpt2-q-count {
  font-size: 11px;
  color: var(--text-muted);
}
.rpt2-q-caret {
  font-size: 11px;
  color: var(--text-muted);
}

.rpt2-q-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
}

/* ── Week 行 ── */
.rpt2-week-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

/* 提出済み */
.rpt2-week--submitted {
  border-color: var(--success, #34a853);
  background: #f0faf3;
}

/* 次の提出先 ハイライト */
.rpt2-week--next {
  border-color: var(--primary, #1a73e8);
  box-shadow: 0 0 0 2px rgba(26,115,232,.18);
  background: #eef4ff;
}

.rpt2-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.rpt2-week-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.rpt2-week-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #1a73e8);
  background: var(--primary-light, #e8f0fe);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.rpt2-next-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #1a73e8);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: rpt2-pulse 1.8s ease-in-out infinite;
}
@keyframes rpt2-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .65; }
}

.rpt2-week-title {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpt2-week-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.rpt2-status {
  font-size: 11px;
  white-space: nowrap;
}
.rpt2-status--done  { color: var(--success, #34a853); font-weight: 600; }
.rpt2-status--none  { color: var(--text-muted); }

.rpt2-date {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.rpt2-toggle-btn {
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── ダークモード ── */
@media (prefers-color-scheme: dark) {
  .rpt2-year-head      { background: rgba(26,115,232,.2); }
  .rpt2-year-head:hover{ background: rgba(26,115,232,.3); }
  .rpt2-q-block        { background: var(--surface-secondary, #2a2a2a); }
  .rpt2-week--submitted{ background: rgba(52,168,83,.12); }
  .rpt2-week--next     { background: rgba(26,115,232,.12); }
}

/* ── モバイル ── */
@media (max-width: 600px) {
  .rpt2-year-title  { display: none; }
  .rpt2-week-title  { display: none; }
  .rpt2-year-prog   { display: none; }
  .rpt2-week-head   { padding: 8px 10px; }
  .rpt2-q-head      { padding: 8px 10px; }
}

/* ============================================================
   メンバー個人ページ (mbp)
   ============================================================ */
.mbp-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 0 60px;
}
.mbp-back {
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mbp-header-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  flex-wrap: wrap;
}
.mbp-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light, #e8f0fe);
  color: var(--primary, #1a73e8);
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mbp-header-info { flex: 1; min-width: 0; }
.mbp-name { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.mbp-sub  { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.mbp-status-badge { margin-top: 6px; display: inline-block; }
.mbp-edit-btn { margin-left: auto; flex-shrink: 0; }

.mbp-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.mbp-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.mbp-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.mbp-stat {
  background: var(--surface-secondary, #f8f9fa);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mbp-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.mbp-stat-value { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.mbp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
}
.mbp-field { display: flex; flex-direction: column; gap: 3px; }
.mbp-field--full { grid-column: 1 / -1; }
.mbp-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.mbp-value { font-size: 13px; color: var(--text-primary); font-weight: 500; word-break: break-all; }
.mbp-pre {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--surface-secondary, #f8f9fa);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}

/* 招待メールプレビュー */
.invite-mail-preview {
  background: #f0f7ff;
  border: 1.5px solid var(--primary-light, #c5d9f7);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0 4px;
}
.invite-mail-preview-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #1a73e8);
  margin-bottom: 10px;
}
.invite-mail-body { font-size: 12px; color: var(--text-secondary); }
.imail-line { margin-bottom: 2px; }
.imail-key  { font-weight: 700; color: var(--text-primary); margin-right: 4px; }
.imail-sep  { border-top: 1px solid var(--border); margin: 8px 0; }
.imail-body { line-height: 1.8; white-space: pre-line; }

@media (prefers-color-scheme: dark) {
  .mbp-stat  { background: rgba(255,255,255,.05); }
  .mbp-pre   { background: rgba(255,255,255,.05); }
  .invite-mail-preview { background: rgba(26,115,232,.1); border-color: rgba(26,115,232,.3); }
}
@media (max-width: 600px) {
  .mbp-header-card { padding: 14px; }
  .mbp-name { font-size: 18px; }
  .mbp-edit-btn { width: 100%; margin-left: 0; margin-top: 10px; }
  .mbp-stats-row { grid-template-columns: 1fr 1fr; }
  .mbp-grid { grid-template-columns: 1fr; }
  .mbp-card { padding: 14px 16px; }
}

/* デモデータ注記バッジ */
.mbp-demo-note {
  display: inline-block;
  font-size: 10px;
  background: var(--surface-secondary, #f1f3f4);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ============================================================
   メンバー個人ページ追加スタイル v2
   ============================================================ */

/* ヘッダーのアクションボタン群 */
.mbp-header-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .mbp-header-actions {
    flex-direction: row;
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }
  .mbp-header-actions .btn { flex: 1; }
}

/* 氏名横のニックネームタグ */
.mbp-nick {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #1a73e8);
  background: var(--primary-light, #e8f0fe);
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
}
/* 基本情報カード内のニックネーム値 */
.mbp-nick-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #1a73e8);
}

/* 削除確認バナー */
.mbp-delete-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff3f3;
  border: 1.5px solid var(--danger, #d93025);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-primary);
  flex-wrap: wrap;
}
.mbp-delete-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
  padding-top: 2px;
}
.mbp-delete-banner-body {
  flex: 1;
  min-width: 0;
  line-height: 1.6;
}
.mbp-delete-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .mbp-delete-banner { flex-direction: column; }
  .mbp-delete-banner-actions { width: 100%; }
  .mbp-delete-banner-actions .btn { flex: 1; }
}
@media (prefers-color-scheme: dark) {
  .mbp-delete-banner { background: rgba(217,48,37,.12); border-color: rgba(217,48,37,.5); }
}

/* 編集フォームカード（ページ内インライン） */
.mbp-edit-card {
  border-color: var(--primary, #1a73e8) !important;
  box-shadow: 0 0 0 3px rgba(26,115,232,.12) !important;
}
.mbp-edit-card .mbp-card-title {
  color: var(--primary, #1a73e8);
}

/* ===========================================================
   掲示板 (Board) スタイル
   =========================================================== */

/* ── ページコンテナ ── */
.board-page {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
}

/* ── ナビバッジ（新着通知用） ── */
.board-nav-badge {
  position: absolute;
  top: -3px;
  right: -6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  display: block;
}

/* ── アバター ── */
.board-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.board-avatar--sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 11px;
}

/* ── 投稿フォーム ── */
.board-post-form {
  padding: 16px;
}
.board-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.board-form-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.board-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  box-sizing: border-box;
  margin-bottom: 8px;
  transition: border-color .2s;
}
.board-input:focus { border-color: var(--primary); outline: none; }
.board-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  box-sizing: border-box;
  resize: vertical;
  margin-bottom: 8px;
  transition: border-color .2s;
  line-height: 1.6;
}
.board-textarea:focus { border-color: var(--primary); outline: none; }
.board-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.board-error {
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 8px;
}

/* ── 投稿カード ── */
.board-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.board-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.board-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.board-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.board-author-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}
.board-time {
  font-size: 11px;
  color: var(--text-muted);
}
.board-edited {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── 管理者ボタン ── */
.board-admin-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.board-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 14px;
  transition: background .15s;
}
.board-icon-btn:hover { background: var(--bg-hover, rgba(0,0,0,.06)); }
.board-del-btn:hover  { background: var(--danger-light, #fce8e6); }

/* ── 本文 ── */
.board-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.board-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── 編集フォーム（カード内） ── */
.board-edit-form {
  padding: 10px;
  background: var(--bg-sub, #f8f9fa);
  border-radius: 8px;
  border: 1.5px solid var(--primary);
}

/* ── アクションボタン行 ── */
.board-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.board-action-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.board-action-btn:hover {
  background: var(--primary-light, #e8f0fe);
  border-color: var(--primary);
  color: var(--primary);
}
.board-action-btn.active-like {
  background: #fff3e0;
  border-color: #f57c00;
  color: #f57c00;
}
.board-action-btn.active-fav {
  background: #fffde7;
  border-color: #f9ab00;
  color: #f9ab00;
}
.board-action-btn--sm {
  padding: 3px 9px;
  font-size: 11px;
}
.board-reply-count {
  background: var(--bg-sub, #f0f0f0);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── 返信一覧 ── */
.board-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 20px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
}
.board-reply-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.board-reply-avatar { flex-shrink: 0; }
.board-reply-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.board-reply-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.board-reply-to {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light, #e8f0fe);
  padding: 1px 7px;
  border-radius: 10px;
}
.board-reply-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}
.board-reply-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── 返信フォーム ── */
.board-reply-form {
  margin-left: 20px;
  padding-left: 14px;
  border-left: 2px solid var(--primary);
  padding-top: 8px;
}
.board-reply-to-label {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light, #e8f0fe);
  padding: 3px 10px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 8px;
}

/* ── 削除確認バナー ── */
.board-del-banner {
  background: #fff3f3;
  border: 1.5px solid var(--danger);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── 空メッセージ ── */
.board-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── ダークモード対応 ── */
@media (prefers-color-scheme: dark) {
  .board-input,
  .board-textarea {
    background: var(--bg-card, #2a2a2a);
    border-color: var(--border, #3a3a3a);
    color: var(--text-primary, #e8eaed);
  }
  .board-edit-form   { background: rgba(255,255,255,.04); }
  .board-del-banner  { background: rgba(217,48,37,.12); border-color: rgba(217,48,37,.5); }
  .board-action-btn.active-like { background: rgba(245,124,0,.15); }
  .board-action-btn.active-fav  { background: rgba(249,171,0,.15); }
  .board-reply-count { background: rgba(255,255,255,.08); }
}

/* ── レスポンシブ ── */
@media (max-width: 600px) {
  .board-page { padding: 0 2px 40px; }
  .board-card { padding: 12px; }
  .board-post-form { padding: 12px; }
  .board-replies { margin-left: 8px; padding-left: 8px; }
  .board-reply-form { margin-left: 8px; padding-left: 8px; }
  .board-title { font-size: 14px; }
}

/* =============================================================
   自治体ページ (Municipality)
   ============================================================= */
:root {
  --municipal-color: #2e7d32;
}

/* ページ共通 */
.muni-page, .muni-detail-page {
  max-width: 900px;
  margin: 0 auto;
}

/* ヘッダーカード */
.muni-page-header .card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* アバター */
.muni-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--municipal-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.muni-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

/* テーブル行ホバー */
.muni-member-row:hover {
  background: var(--hover-bg, rgba(0,0,0,0.04));
}

/* 統計ボックス（詳細ページ）*/
.muni-stat-box {
  min-width: 90px;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 10px;
  padding: 12px 18px;
  text-align: center;
}
.muni-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.muni-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

/* 情報グリッド */
.muni-info-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.muni-info-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 13px;
}
.muni-info-label {
  min-width: 130px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.muni-info-val {
  flex: 1;
  word-break: break-all;
}

/* テキストブロック（動機・経歴補足）*/
.mbp-text-block {
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 管理者: 自治体テーブル */
.muni-admin-table th, .muni-admin-table td {
  white-space: nowrap;
}

/* ログインタブ (3つになった場合) */
.login-tabs {
  flex-wrap: wrap;
}

/* ダークモード */
@media (prefers-color-scheme: dark) {
  .muni-stat-box {
    background: var(--card-bg, #2a2a2a);
  }
  .mbp-text-block {
    background: var(--card-bg, #2a2a2a);
  }
}

/* レスポンシブ */
@media (max-width: 600px) {
  .muni-info-label { min-width: 90px; }
  .muni-stat-box   { min-width: 70px; padding: 10px 12px; }
  .muni-stat-val   { font-size: 18px; }
}

/* ===== Video Player Toolbar Fix ===== */
.video-player-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 2;
}

.video-action-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(0,0,0,0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.video-action-btn:hover {
  background: rgba(0,0,0,0.78);
  color: #fff;
}

/* ===== v12: 学習資料PDF / Googleスライドを大きく表示 ===== */
.content-detail-page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.content-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.content-detail-main,
.content-detail-sidebar {
  min-width: 0;
}

.learning-material-section {
  padding: 20px 20px 24px;
  border-top: 1px solid var(--border-light);
}

.learning-material-section .section-title {
  font-size: 18px;
}

/* 以前は540px固定で、GoogleスライドやPDFが小さく見えていたため拡大 */
.pdf-body {
  min-height: 700px;
  height: clamp(700px, 76vh, 920px);
  padding: 0;
}

.pdf-body iframe {
  min-height: 700px;
  background: #fff;
}

.pdf-viewer.pdf-viewer-expanded {
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
}

.pdf-viewer.pdf-viewer-expanded .pdf-body {
  min-height: 860px;
  height: min(92vh, 1100px);
}

.pdf-viewer.pdf-viewer-expanded .pdf-body iframe {
  min-height: 860px;
}

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

  .content-detail-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .learning-material-section {
    padding: 16px;
  }

  .pdf-body,
  .pdf-body iframe {
    min-height: 560px;
    height: 64vh;
  }

  .pdf-viewer.pdf-viewer-expanded .pdf-body,
  .pdf-viewer.pdf-viewer-expanded .pdf-body iframe {
    min-height: 680px;
    height: 78vh;
  }
}
