/* ═══════════════════════════════════════════
   リセット・基本
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:      #2e7d32;
  --green-dark: #1b5e20;
  --green-light:#e8f5e9;
  --accent:     #ff8f00;
  --text:       #333;
  --muted:      #666;
  --border:     #ddd;
  --radius:     10px;
  --shadow:     0 4px 16px rgba(0,0,0,.10);
}

body {
  font-family: "Hiragino Kaku Gothic Pro", "Meiryo", sans-serif;
  color: var(--text);
  background: #fafafa;
}

a { color: inherit; text-decoration: none; }
#privacy .tag-section a { color: var(--green-dark); text-decoration: underline; }
#privacy .tag-section a:hover { color: var(--green); }

/* ═══════════════════════════════════════════
   ヘッダー・ナビ
═══════════════════════════════════════════ */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--green);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

nav {
  max-width: 1100px; margin: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 60px;
}

.logo {
  color: #fff; font-size: 1.1rem; font-weight: bold; white-space: nowrap;
}

nav ul { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; }

nav ul li a {
  color: rgba(255,255,255,.9);
  padding: 6px 12px; border-radius: 4px;
  font-size: .9rem; transition: background .2s;
}
nav ul li a:hover { background: rgba(255,255,255,.15); }

.nav-kyogiin {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.4) !important;
  border-radius: 4px;
}
.nav-kyogiin:hover { background: rgba(255,255,255,.3) !important; }

/* ═══════════════════════════════════════════
   フラッシュメッセージ
═══════════════════════════════════════════ */
.flash {
  text-align: center; padding: 10px;
  font-size: .9rem; font-weight: bold;
}
.flash-success { background: #c8e6c9; color: #1b5e20; }
.flash-danger  { background: #ffcdd2; color: #b71c1c; }

/* ═══════════════════════════════════════════
   ボタン
═══════════════════════════════════════════ */
.btn {
  display: inline-block;
  background: var(--green); color: #fff;
  padding: 10px 24px; border-radius: 6px;
  border: none; cursor: pointer;
  font-size: .95rem; font-weight: bold;
  transition: background .2s, transform .1s;
}
.btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-full  { width: 100%; text-align: center; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--green); color: var(--green);
}
.btn-outline:hover { background: var(--green-light); }
.btn-view  { background: #0277bd; padding: 5px 14px; font-size: .85rem; }
.btn-view:hover { background: #01579b; }
.btn-danger { background: #c62828; padding: 5px 14px; font-size: .85rem; }
.btn-danger:hover { background: #b71c1c; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }

/* ═══════════════════════════════════════════
   アラート
═══════════════════════════════════════════ */
.alert {
  padding: 12px 18px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: .95rem;
}
.alert-success { background: #c8e6c9; color: #1b5e20; border-left: 4px solid var(--green); }
.alert-danger  { background: #ffcdd2; color: #b71c1c; border-left: 4px solid #c62828; }

/* ═══════════════════════════════════════════
   ヒーロー・スライドショー
═══════════════════════════════════════════ */
#hero {
  position: relative; overflow: hidden;
  text-align: center; color: #fff;
  min-height: 420px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 20px;
}

.slideshow { position: absolute; inset: 0; z-index: 0; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slideshow::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}

#hero h1, #hero p, #hero a {
  position: relative; z-index: 1;
}
#hero h1 { font-size: 2rem; margin-bottom: 14px; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
#hero p  { font-size: 1.05rem; margin-bottom: 28px; max-width: 560px; line-height: 1.7; }

/* ═══════════════════════════════════════════
   セクション共通
═══════════════════════════════════════════ */
section { padding: 60px 20px; max-width: 1000px; margin: auto; }

section h2 {
  text-align: center; font-size: 1.7rem;
  color: var(--green); margin-bottom: 36px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--green-light);
}

/* ─ 新着情報の見出し ─ */
section h2 {
  text-align: center; font-size: 1.7rem;
  color: var(--green); margin-bottom: 36px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--green-light);
}

/* ─ 概要テーブル ─ */
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 16px; border: 1px solid var(--border); }
table th { background: var(--green-light); width: 140px; font-weight: bold; }

/* ─ カード ─ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; text-align: center;
  transition: transform .2s;
}
.card:hover { transform: translateY(-4px); }
.card .icon { font-size: 2.4rem; margin-bottom: 12px; }
.card h3 { color: var(--green); margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* ─ タイムライン ─ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}
.timeline-item {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 24px;
  display: flex; align-items: center; gap: 14px; min-width: 200px;
}
.timeline-month {
  background: var(--green); color: #fff;
  border-radius: 6px; padding: 4px 12px; font-weight: bold; font-size: .9rem;
}
.timeline-name { font-size: .95rem; font-weight: bold; }

/* ─ お問い合わせ ─ */
#contact { text-align: center; }
#contact p { margin: 8px 0; font-size: 1rem; }

/* ═══════════════════════════════════════════
   認証画面（ログイン）
═══════════════════════════════════════════ */
.auth-section {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 120px); padding: 40px 20px;
}

.auth-box {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px;
  width: 100%; max-width: 420px; text-align: center;
}

.auth-icon { font-size: 3rem; margin-bottom: 12px; }
.auth-box h2 { color: var(--green); margin-bottom: 8px; }
.auth-desc { color: var(--muted); font-size: .9rem; line-height: 1.6; margin-bottom: 24px; }

/* ─ フォーム共通 ─ */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: .85rem; font-weight: bold; margin-bottom: 6px; color: var(--muted); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .95rem; outline: none;
  transition: border-color .2s;
  font-family: inherit; color: inherit; background: #fff;
  caret-color: var(--green);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green); }
.form-group textarea { resize: vertical; }

/* ═══════════════════════════════════════════
   協議員ファイルページ
═══════════════════════════════════════════ */
.kyogiin-section {
  max-width: 900px; margin: auto; padding: 40px 20px;
}

.kyogiin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.kyogiin-header h2 { color: var(--green); font-size: 1.5rem; }

/* 月タブ */
.month-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 28px;
}
.month-tab {
  padding: 8px 14px; border-radius: 6px;
  background: #fff; border: 1px solid var(--border);
  font-size: .9rem; cursor: pointer; transition: all .2s;
}
.month-tab:hover  { background: var(--green-light); border-color: var(--green); }
.month-tab.active {
  background: var(--green); color: #fff; border-color: var(--green);
  font-weight: bold;
}

/* ファイルエリア */
.files-area {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}
.files-area h3 { color: var(--green); margin-bottom: 18px; }

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 8px;
  background: var(--green-light); flex-wrap: wrap;
}
.file-icon { font-size: 1.3rem; }
.file-name { flex: 1; font-size: .95rem; min-width: 120px; word-break: break-all; }

.no-files {
  text-align: center; padding: 40px 20px; color: var(--muted);
}

/* ═══════════════════════════════════════════
   管理ダッシュボード
═══════════════════════════════════════════ */
.admin-section {
  max-width: 860px; margin: auto; padding: 40px 20px;
}

.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.admin-header h2 { color: var(--green); font-size: 1.5rem; }

.admin-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
  margin-bottom: 24px;
}
.admin-card h3 {
  color: var(--green); margin-bottom: 20px;
  padding-bottom: 8px; border-bottom: 2px solid var(--green-light);
}
.admin-card h4 {
  color: var(--muted); font-size: .9rem; margin: 14px 0 8px;
}

.form-row {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.form-grow { flex: 1; min-width: 200px; }

.month-section { margin-bottom: 12px; }
.no-files-msg { color: var(--muted); text-align: center; padding: 20px; }

/* ═══════════════════════════════════════════
   フッター
═══════════════════════════════════════════ */
footer {
  background: var(--green-dark); color: rgba(255,255,255,.8);
  text-align: center; padding: 20px;
  font-size: .85rem; margin-top: 40px;
}

/* ═══════════════════════════════════════════
   レスポンシブ
═══════════════════════════════════════════ */
@media (max-width: 640px) {
  nav { flex-direction: column; height: auto; padding: 10px 16px; gap: 6px; }
  nav ul { gap: 2px; justify-content: center; }
  nav ul li a { font-size: .8rem; padding: 5px 8px; }
  #hero h1 { font-size: 1.4rem; }
  .auth-box { padding: 28px 20px; }
  .month-tabs { gap: 4px; }
  .month-tab { padding: 6px 10px; font-size: .82rem; }
}

/* ═══════════════════════════════════════════
   ユーザー管理テーブル
═══════════════════════════════════════════ */
.add-user-form {
  background: var(--green-light);
  border-radius: 8px; padding: 18px; margin-bottom: 16px;
}
.add-user-form h4 { color: var(--green); margin-bottom: 14px; }

.user-table-wrap { overflow-x: auto; }
.user-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.user-table th {
  background: var(--green); color: #fff;
  padding: 10px 12px; text-align: left;
}
.user-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.user-table tr.inactive td { opacity: .5; }
.user-table tr:hover td { background: #f9f9f9; }

.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 12px; font-size: .8rem; font-weight: bold;
}
.badge-active   { background: #c8e6c9; color: #1b5e20; }
.badge-inactive { background: #ffcdd2; color: #b71c1c; }

.inline-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form input[type="password"] {
  padding: 5px 8px; font-size: .85rem;
  border: 1px solid var(--border); border-radius: 4px;
}

.btn-warning { background: #e65100; }
.btn-warning:hover { background: #bf360c; }
.btn-success { background: #2e7d32; }
.btn-success:hover { background: #1b5e20; }

/* ═══════════════════════════════════════════
   資料・議事録セクション
═══════════════════════════════════════════ */
.login-user {
  color: var(--muted); font-size: .9rem; margin-bottom: 16px;
}
.kyogiin-header-btns { display: flex; gap: 8px; }

.file-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.file-section:last-child { margin-bottom: 0; }

.file-section-title {
  color: var(--green); font-size: 1rem;
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--green-light);
}

/* ─ 管理画面 追加スタイル ─ */
.card-desc {
  color: var(--muted); font-size: .88rem; margin-bottom: 16px;
}

.permission-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 14px 0; align-items: center;
}
.checkbox-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .9rem; cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
}

.fixed-permissions {
  background: #f5f5f5; padding: 10px 14px;
  border-radius: 6px; font-size: .88rem; color: var(--muted);
}

.meta-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.mbadge {
  font-size: .75rem; padding: 2px 7px;
  border-radius: 10px; font-weight: bold;
}
.mbadge-on  { background: #c8e6c9; color: #1b5e20; }
.mbadge-off { background: #f5f5f5; color: #999; }

.month-section h5 {
  color: var(--muted); font-size: .85rem;
  margin: 10px 0 6px; padding-left: 4px;
}

.tag-section {
  margin: 18px 0; padding: 14px 16px;
  background: var(--green-light);
  border-left: 5px solid var(--green);
  border-radius: 8px;
}
.tag-section-title {
  color: var(--green-dark);
  font-size: 1.15rem; font-weight: bold;
  margin: 0 0 10px;
}

/* ═══════════════════════════════════════════
   管理者ランク関連
═══════════════════════════════════════════ */
.rank-badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 12px; font-size: .85rem; font-weight: bold; margin-top: 6px;
}
.rank1-badge { background: #e3f2fd; color: #0277bd; }
.rank2-badge { background: #fce4ec; color: #c62828; }

.rank-info-box {
  background: #f5f5f5; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 20px; text-align: left;
}
.rank-info-item {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; margin-bottom: 6px;
}
.rank-info-item:last-child { margin-bottom: 0; }
.rank-tag {
  display: inline-block; padding: 2px 10px;
  border-radius: 10px; font-size: .8rem; font-weight: bold; white-space: nowrap;
}
.rank1-tag { background: #e3f2fd; color: #0277bd; }
.rank2-tag { background: #fce4ec; color: #c62828; }

.rank2-card { border-left: 4px solid #c62828; }
.rank2-card h3 { color: #c62828; }

.rank-label {
  display: inline-block; font-size: .72rem;
  background: #fce4ec; color: #c62828;
  padding: 2px 8px; border-radius: 8px;
  font-weight: normal; margin-left: 8px; vertical-align: middle;
}

.rank1-notice {
  background: #f5f5f5; border-radius: var(--radius);
  padding: 16px 20px; color: var(--muted);
  font-size: .9rem; text-align: center;
  border: 1px dashed var(--border);
}

/* ─ フッターリンク ─ */
.footer-links {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.footer-link {
  color: rgba(255,255,255,.75); font-size: .85rem;
  text-decoration: underline; transition: color .2s;
}
.footer-link:hover { color: #fff; }
.footer-sep { color: rgba(255,255,255,.4); font-size: .85rem; }

.news-list { list-style: none; padding: 0; max-width: 800px; margin: 0 auto; }
.news-item {
  display: flex; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid #e0e0e0; padding: 12px 14px;
  border-left: 5px solid var(--news-accent, #4dabf7);
  border-radius: 6px;
  background: #fafafa;
  margin-bottom: 8px;
}
.news-item:nth-child(6n+1) { --news-accent: #ff6b6b; }
.news-item:nth-child(6n+2) { --news-accent: #ffa94d; }
.news-item:nth-child(6n+3) { --news-accent: #ffd43b; }
.news-item:nth-child(6n+4) { --news-accent: #51cf66; }
.news-item:nth-child(6n+5) { --news-accent: #4dabf7; }
.news-item:nth-child(6n+6) { --news-accent: #9775fa; }
.news-date {
  color: #fff; background: var(--news-accent, #4dabf7);
  font-size: 0.8rem; font-weight: bold; flex-shrink: 0;
  padding: 3px 10px; border-radius: 999px;
}
.news-content { flex: 1; }
.news-title { font-weight: bold; color: #333; }
.news-body { margin: 6px 0 0 0; color: #555; font-size: 0.9rem; white-space: pre-wrap; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  height: 32px;
  width: auto;
}