/* ケアつなぐ 共通CSS */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2E7D6F;
  --primary-dark: #1f5c52;
  --primary-light: #e8f5f2;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.12);
}
body { font-family: 'Hiragino Sans', 'Noto Sans JP', sans-serif; background: var(--gray-50); color: var(--gray-800); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius); font-size: 15px; font-weight: 600; transition: all .2s; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* フォーム */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-control { width: 100%; padding: 12px 14px; border: 2px solid var(--gray-200); border-radius: 10px; font-size: 15px; font-family: inherit; transition: border-color .2s; background: #fff; }
.form-control:focus { outline: none; border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* カード */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* アラート */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: flex-start; gap: 8px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* バッジ */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-used { background: #e0e7ff; color: #3730a3; }
.badge-expired { background: #fef3c7; color: #92400e; }
.badge-revoked { background: #fee2e2; color: #991b1b; }
.badge-broadcast { background: #dbeafe; color: #1e40af; }
.badge-individual { background: #fce7f3; color: #9d174d; }
.badge-unread { background: var(--accent); color: #fff; }

/* ローディング */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 10px; color: var(--gray-400); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状態 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* モーダル */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.close-btn { background: none; border: none; font-size: 20px; color: var(--gray-400); cursor: pointer; padding: 4px; }

/* ライトボックス */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 16px; color: #fff; font-size: 32px; cursor: pointer; background: none; border: none; }

/* フェード */
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
.fade-in { animation: fadeIn .25s ease; }
