/* ニューモフィズムデザインのCSS */
:root {
  --bg-color: #e6e7ee;
  --text-color: #44476a;
  --shadow-light: #ffffff;
  --shadow-dark: #a3a9cc;
  --primary-color: #5e72e4;
  --success-color: #2dce89;
  --error-color: #f5365c;
  --border-radius: 15px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding: 0;
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* ニューモフィズム効果のミックスイン */
.neumorphism {
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
}

.neumorphism-inset {
  background: var(--bg-color);
  box-shadow: inset 5px 5px 10px var(--shadow-dark), 
             inset -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
}

/* ヘッダースタイル */
header {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--text-color);
}

nav {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  width: 100%;
}

nav ul {
  display: flex;
  list-style-type: none;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  padding: 5px;
  width: 100%;
  max-width: 600px;
  flex-wrap: wrap;
  justify-content: center;
}

nav ul li {
  margin: 5px;
}

nav ul li a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text-color);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  text-align: center;
}

nav ul li a:hover {
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
}

nav ul li a.active {
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  font-weight: bold;
}

/* メインコンテンツスタイル */
main {
  min-height: calc(100vh - 200px);
  width: 100%;
}

section {
  margin-bottom: 30px;
  width: 100%;
}

h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

/* タブコンテンツ */
.tab-content {
  display: none;
  padding: 20px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  width: 100%;
}

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

/* 統計カードスタイル */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.stat-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  transition: transform 0.3s ease;
  min-height: 120px;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 2.5rem;
  margin-right: 20px;
  padding: 15px;
  border-radius: 50%;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 5px;
  word-break: break-all;
  width: 100%;
}

/* サマリーセクション */
.summary-section {
  padding: 25px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  margin-top: 30px;
}

/* 月次報告書スタイル */
.report-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.report-selector label {
  margin-right: 5px;
}

.report-selector select {
  padding: 10px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border: none;
  border-radius: var(--border-radius);
  margin-right: 15px;
  color: var(--text-color);
  outline: none;
}

.report-content {
  padding: 25px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
  margin-top: 20px;
  min-height: 300px;
}

.report-loading {
  text-align: center;
  padding: 50px 0;
  color: #777;
}

.report-title {
  font-size: 1.8rem;
  margin-bottom: 15px;
  text-align: center;
}

.report-date {
  text-align: center;
  margin-bottom: 20px;
  font-style: italic;
}

.report-section {
  margin-bottom: 25px;
}

.report-section h4 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.activity-list {
  list-style-type: none;
}

.activity-item {
  margin-bottom: 15px;
  padding: 15px;
  background: var(--bg-color);
  box-shadow: 3px 3px 5px var(--shadow-dark), 
             -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
}

.activity-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.financial-item {
  padding: 15px;
  background: var(--bg-color);
  box-shadow: 3px 3px 5px var(--shadow-dark), 
             -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
  text-align: center;
}

.financial-item .label {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.financial-item .value {
  font-size: 1.3rem;
  font-weight: bold;
}

/* 団体についてのスタイル */
.about-content {
  padding: 25px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
}

.about-content p {
  margin-bottom: 15px;
}

.about-content ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

.contact-info {
  margin-top: 30px;
  padding: 20px;
  background: var(--bg-color);
  box-shadow: 3px 3px 5px var(--shadow-dark), 
             -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
}

.contact-info p {
  margin-bottom: 10px;
}

.contact-info i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* 管理者ログインスタイル */
.admin-login {
  max-width: 500px;
  margin: 0 auto;
  padding: 30px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
}

/* 月選択とインプットのグループ化 */
.form-group-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.form-group-inline input {
  flex: 1;
  min-width: 100px;
}

.form-group-inline select {
  width: auto;
  min-width: 80px;
}

.btn {
  padding: 12px 25px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  box-shadow: 3px 3px 5px var(--shadow-dark), 
             -3px -3px 5px var(--shadow-light);
}

.btn:active {
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
}

.btn-small {
  padding: 8px 15px;
  font-size: 0.9rem;
}

.error-message {
  color: var(--error-color);
  margin-top: 10px;
  text-align: center;
}

.success-message {
  color: var(--success-color);
  margin-top: 10px;
  text-align: center;
}

/* 管理パネルスタイル */
.admin-panel {
  padding: 30px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  width: 100%;
}

.admin-tabs {
  display: flex;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tab-btn {
  padding: 10px 20px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 10px;
}

.admin-tab-btn:hover {
  box-shadow: 3px 3px 5px var(--shadow-dark), 
             -3px -3px 5px var(--shadow-light);
}

.admin-tab-btn.active {
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  font-weight: bold;
}

.admin-tab-content {
  display: none;
  padding: 20px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

.admin-tab-content.active {
  display: block;
}

.logout-btn {
  margin-left: auto;
  background: var(--bg-color);
  color: var(--error-color);
}

/* 月次報告書フォーム */
.finance-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.finance-row {
  display: flex;
  flex-direction: column;
}

#activities-container {
  margin-bottom: 15px;
}

#activities-container .activity-item {
  margin-bottom: 15px;
  padding: 15px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
}

#activities-container .activity-item input,
#activities-container .activity-item textarea {
  margin-bottom: 10px;
}

/* フッタースタイル */
footer {
  text-align: center;
  padding: 20px 0;
  margin-top: 50px;
  font-size: 0.9rem;
}

/* 募金履歴・アナリティクススタイル */
.analytics-selector {
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
}

.analytics-summary {
  margin-bottom: 30px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.summary-card {
  padding: 20px;
  background: var(--bg-color);
  box-shadow: 5px 5px 10px var(--shadow-dark), 
             -5px -5px 10px var(--shadow-light);
  border-radius: var(--border-radius);
  text-align: center;
}

.summary-card h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--text-color);
}

.summary-card p {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.donation-table {
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  border-radius: var(--border-radius);
  padding: 20px;
}

.donation-table h4 {
  margin-bottom: 15px;
  text-align: center;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius);
}

.donation-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.donation-table th,
.donation-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.donation-table th {
  background: var(--bg-color);
  box-shadow: inset 3px 3px 5px var(--shadow-dark), 
             inset -3px -3px 5px var(--shadow-light);
  font-weight: bold;
  color: var(--text-color);
}

.donation-table tbody tr {
  transition: background-color 0.3s ease;
}

.donation-table tbody tr:hover {
  background-color: rgba(94, 114, 228, 0.1);
}

.donation-table .amount {
  font-weight: bold;
  color: var(--success-color);
}

.donation-table .method {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: bold;
}

.donation-table .method.bank {
  background-color: #e3f2fd;
  color: #1976d2;
}

.donation-table .method.credit {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.donation-table .method.cash {
  background-color: #e8f5e8;
  color: #388e3c;
}

.donation-table .no-data {
  text-align: center;
  color: #777;
  font-style: italic;
  padding: 30px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 15px;
  }
  
  .stat-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
    padding: 10px;
  }
  
  .stat-content h3 {
    font-size: 1.2rem;
  }
  
  .stat-value {
    font-size: 1.3rem;
  }
  
  .financial-summary {
    grid-template-columns: 1fr;
  }
  
  .admin-tabs {
    flex-direction: column;
  }
  
  .admin-tab-btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .logout-btn {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }
  
  .finance-details {
    grid-template-columns: 1fr;
  }
  
  .tab-content {
    padding: 15px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 10px;
  }
  
  .btn {
    width: 100%;
    padding: 12px 15px;
  }
  
  nav ul {
    flex-direction: column;
    padding: 10px;
  }
  
  nav ul li {
    width: 100%;
    margin: 3px 0;
  }
  
  nav ul li a {
    width: 100%;
  }
  
  .report-selector {
    flex-direction: column;
    align-items: stretch;
  }
  
  .report-selector label {
    margin-bottom: 5px;
  }
  
  .report-selector select {
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .form-group-inline {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-group-inline select {
    width: 100%;
  }
  
  .summary-cards {
    grid-template-columns: 1fr;
  }
  
  .donation-table {
    padding: 10px;
  }
  
  .donation-table th,
  .donation-table td {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* 小さいスマホ向け */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  .stat-card {
    min-height: 100px;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .stat-content h3 {
    font-size: 1rem;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .admin-login, .admin-panel {
    padding: 15px;
  }
  
  .admin-tab-content {
    padding: 10px;
  }
  
  .donation-table th,
  .donation-table td {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
  
  .summary-card p {
    font-size: 1.2rem;
  }
}

/* データ入力セクション */
.data-input-section {
  background: var(--card-background);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-inset);
  border: 1px solid var(--border-color);
}

.data-input-section h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.2em;
}

.data-input-section .form-group-inline {
  margin-bottom: 15px;
}

.data-input-section .form-group-inline:last-of-type {
  margin-bottom: 10px;
}

.data-input-section input,
.data-input-section select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  box-shadow: var(--shadow-inset-small);
  font-size: 14px;
  transition: all 0.3s ease;
}

.data-input-section input:focus,
.data-input-section select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.data-input-section .btn {
  padding: 8px 16px;
  font-size: 14px;
  min-width: auto;
}

/* テーブルの操作ボタン */
.table-actions {
  display: flex;
  gap: 5px;
}

.table-actions .btn {
  padding: 4px 8px;
  font-size: 12px;
  min-width: auto;
}

.btn-edit {
  background: linear-gradient(145deg, #f39c12, #e67e22);
  color: white;
}

.btn-edit:hover {
  background: linear-gradient(145deg, #e67e22, #d35400);
}

.btn-delete {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  color: white;
}

.btn-delete:hover {
  background: linear-gradient(145deg, #c0392b, #a93226);
}

/* 報告書表示の拡張スタイル */
.expense-details {
  margin-top: 15px;
}

.expense-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-background);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-inset-small);
}

.expense-table th,
.expense-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.expense-table th {
  background: linear-gradient(145deg, #f8f9fa, #e9ecef);
  font-weight: 600;
  color: var(--primary-color);
}

.expense-table td.amount {
  text-align: right;
  font-weight: 600;
  color: var(--secondary-color);
}

.challenges-list {
  margin-top: 15px;
}

.challenge-item {
  background: var(--card-background);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-inset-small);
  border-left: 4px solid #e74c3c;
}

.challenge-title {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
  font-size: 1.1em;
}

.challenge-description {
  color: var(--text-color);
  line-height: 1.6;
}

.financial-item .label {
  font-weight: 600;
  color: var(--primary-color);
}

.financial-item .value {
  font-weight: 600;
  font-size: 1.1em;
}

/* 支出項目のスタイル */
.stat-card.expense-item h3,
.stat-card.expense-item .stat-value {
  color: var(--error-color);
}