/* Nyaarock 秘書室 日程調整 — ホログラム青猫テーマ🐱 */
:root {
  --bg: #0c1424;
  --panel: #121d33;
  --panel-2: #18253f;
  --ink: #e8f1ff;
  --muted: #91a6c6;
  --cyan: #38e1ff;
  --cyan-dim: #1aa7c9;
  --line: #243551;
  --yes: #2ecc71;
  --maybe: #f1c40f;
  --no: #e74c3c;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #15233f 0%, var(--bg) 60%);
  color: var(--ink);
  line-height: 1.6;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(12, 20, 36, 0.8);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  display: block;
  max-width: 920px; margin: 0 auto; padding: 16px 20px;
  color: var(--cyan); font-weight: 800; font-size: 20px; text-decoration: none;
  text-shadow: 0 0 12px rgba(56, 225, 255, 0.5);
}
.brand span { color: var(--muted); font-weight: 500; font-size: 14px; }

.container { max-width: 920px; margin: 0 auto; padding: 28px 20px 60px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0; }
.lead { color: var(--muted); margin-top: 4px; }
.hint { color: var(--muted); font-size: 13px; }

/* ボタン */
.btn {
  display: inline-block; cursor: pointer;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font-size: 14px; text-decoration: none; transition: 0.15s;
}
.btn:hover { border-color: var(--cyan-dim); }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-dim));
  color: #04121c; font-weight: 700; border: none;
  box-shadow: 0 0 18px rgba(56, 225, 255, 0.35);
}
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* カード / フォーム */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-top: 16px;
}
.field { display: block; margin-bottom: 16px; }
.field > span, legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field em { color: var(--cyan); font-style: normal; font-size: 12px; margin-left: 6px; }
input[type=text], input[type=datetime-local], textarea {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 14px;
}
input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,255,0.15); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.candidate-row { display: flex; gap: 8px; margin-bottom: 8px; }
.candidate-row input[type=datetime-local] { flex: 0 0 220px; }
.form-actions { margin-top: 8px; }

/* テーブル */
.table { width: 100%; border-collapse: collapse; margin-top: 14px; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
.table .num { text-align: center; font-variant-numeric: tabular-nums; }
.table .score { font-weight: 700; color: var(--cyan); }
.actions { display: flex; gap: 6px; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-open { background: rgba(46,204,113,0.15); color: var(--yes); }
.badge-closed { background: rgba(145,166,198,0.15); color: var(--muted); }
.badge-draft { background: rgba(241,196,15,0.15); color: var(--maybe); }

/* 投票テーブル */
.vote-table { table-layout: fixed; width: 100%; }
.vote-table th, .vote-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.vote-table th { background: var(--panel-2); color: var(--muted); font-weight: 600; text-align: center; }
.vote-table th:first-child { text-align: left; width: 58%; }
.vote-table th:not(:first-child) { width: 21%; }
.vote-table td:first-child { text-align: left; font-size: 14px; }
.vote-table td.vote { text-align: center; }
.vote input { transform: scale(1.6); cursor: pointer; }
.vote-yes { background: rgba(46,204,113,0.06); }
.vote-maybe { background: rgba(241,196,15,0.06); }
.label-chip { display: inline-block; margin-left: 8px; padding: 2px 8px; font-size: 11px; border-radius: 6px; background: var(--panel-2); color: var(--cyan); }

/* くーのアドバイス */
.advice-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(56,225,255,0.10), rgba(26,167,201,0.05));
  border: 1px solid var(--cyan-dim); border-radius: var(--radius);
  padding: 18px; margin: 18px 0;
  box-shadow: 0 0 24px rgba(56,225,255,0.12);
}
.advice-avatar { font-size: 34px; filter: drop-shadow(0 0 8px var(--cyan)); }
.advice-name { color: var(--cyan); font-weight: 700; margin-bottom: 2px; }
.advice-body p { margin: 0; }

.best-banner {
  background: var(--panel-2); border: 1px solid var(--cyan-dim);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 14px;
}
.best-banner .best-stat { margin-left: 10px; color: var(--muted); }
.best-banner .owner-flag { float: right; color: var(--cyan); font-weight: 700; }

.result-table tr.is-best { background: rgba(56,225,255,0.08); }
.owner-cell { text-align: center; font-weight: 700; }
.owner-cell.ok { color: var(--yes); }
.owner-cell.maybe { color: var(--maybe); }
.owner-cell.ng { color: var(--no); }

/* 内訳マトリクス */
.detail-block { margin-top: 18px; }
.detail-block summary { cursor: pointer; color: var(--cyan); padding: 8px 0; }
.matrix-table td { text-align: center; }
.cell-yes { color: var(--yes); font-weight: 700; }
.cell-maybe { color: var(--maybe); font-weight: 700; }
.cell-no { color: var(--no); }
.cell-none { color: var(--muted); }

.share-box { margin-top: 22px; padding: 12px 16px; background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; font-size: 13px; }
.share-box code { color: var(--cyan); word-break: break-all; }

.empty { text-align: center; padding: 40px; color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; }
.flash-success { background: rgba(46,204,113,0.12); border: 1px solid var(--yes); }
.flash-error { background: rgba(231,76,60,0.12); border: 1px solid var(--no); }

/* review画面 */
.review-table td { vertical-align: middle; }
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 9px; cursor: pointer; font-size: 15px; transition: 0.15s;
}
.edit-btn:hover { border-color: var(--cyan); background: rgba(56,225,255,0.08); }
.remove-btn { color: var(--no); border-color: rgba(231,76,60,0.3); }
.remove-btn:hover { background: rgba(231,76,60,0.12); border-color: var(--no); }
.approve-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: 24px; padding: 16px 20px;
  background: var(--panel); border: 1px solid var(--cyan-dim);
  border-radius: var(--radius);
  box-shadow: 0 0 18px rgba(56,225,255,0.10);
}
.approve-count { color: var(--muted); font-size: 14px; }
.approve-count b { color: var(--ink); font-size: 18px; }

/* 月替わりメッセージ */
.monthly-msg-card {
  background: linear-gradient(135deg, rgba(56,225,255,0.07), rgba(26,167,201,0.03));
  border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  border-radius: var(--radius); padding: 14px 18px; margin: 14px 0;
}
.monthly-msg-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.monthly-msg-avatar { font-size: 20px; filter: drop-shadow(0 0 6px var(--cyan)); }
.monthly-msg-label { font-size: 12px; color: var(--cyan); font-weight: 600; }
.monthly-msg-tip {
  margin: 0 0 6px; font-size: 14px; color: var(--ink); line-height: 1.7;
}
.monthly-msg-cheer {
  margin: 0; font-size: 13px; color: var(--muted); font-style: italic;
}

/* データ更新ログ */
.update-log-card {
  background: rgba(241,196,15,0.08); border: 1px solid var(--maybe);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
}
.update-log-title { font-weight: 700; color: var(--maybe); margin-bottom: 10px; }
.update-log-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 5px 0; border-bottom: 1px solid rgba(241,196,15,0.15); font-size: 13px;
}
.update-log-row:last-child { border-bottom: none; }
.update-log-name { font-weight: 700; min-width: 80px; }
.update-log-date { color: var(--muted); min-width: 120px; }
.update-log-change { color: var(--cyan); font-weight: 700; }
.update-log-time { color: var(--muted); font-size: 12px; margin-left: auto; }

/* 集計テーブル メンバー名 */
.member-cell { display: flex; flex-direction: column; gap: 4px; }
.member-count { font-weight: 700; font-size: 13px; }
.yes-count { color: var(--yes); }
.maybe-count { color: var(--maybe); }
.member-names { display: flex; flex-wrap: wrap; gap: 4px; }
.member-tag {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.yes-tag { background: rgba(46,204,113,0.15); color: var(--yes); }
.maybe-tag { background: rgba(241,196,15,0.15); color: var(--maybe); }
.tag-delete-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; opacity: 0.5; padding: 0 0 0 3px; color: inherit;
}
.tag-delete-btn:hover { opacity: 1; }

/* 削除確認モーダル */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 32px; min-width: 280px; text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.modal-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.modal-dt { color: var(--cyan); font-size: 15px; margin: 0 0 22px; font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-remove {
  background: var(--no); color: #fff; font-weight: 700;
  border: none; padding: 10px 20px; border-radius: 10px; cursor: pointer;
}
.btn-remove:hover { background: #c0392b; }

/* 修正モードバナー */
.edit-mode-banner {
  background: rgba(56,225,255,0.10); border: 1px solid var(--cyan-dim);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
  font-size: 14px; color: var(--cyan);
}

/* 練習モード */
.preview-note {
  color: var(--maybe); font-size: 13px; margin: 0 0 10px;
  border-left: 3px solid var(--maybe); padding-left: 8px;
}

/* シフトアップロード */
.upload-area {
  position: relative; border: 2px dashed var(--line); border-radius: 12px;
  background: var(--bg); cursor: pointer; overflow: hidden;
  transition: border-color 0.2s;
}
.upload-area:hover { border-color: var(--cyan); }
.upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-placeholder { padding: 36px; text-align: center; pointer-events: none; }
.upload-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.upload-placeholder p { color: var(--muted); margin: 0; }
.preview-img { width: 100%; max-height: 400px; object-fit: contain; display: block; padding: 8px; }

select { appearance: none; }

.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--line); }

/* ===== スマホ対応 ===== */
@media (max-width: 600px) {
  .container { padding: 16px 12px 48px; }
  h1 { font-size: 18px; }

  /* ヘッダー */
  .page-head { gap: 8px; }
  .page-head > div { width: 100%; }

  /* テーブル全般：横スクロール */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 13px; }

  /* 回答ページの投票テーブル — display:blockを打ち消してfixedレイアウトを維持 */
  .vote-table { display: table !important; width: 100% !important; }
  .vote-table th, .vote-table td { padding: 10px 4px; }
  .vote-table td:first-child { font-size: 13px; }
  .vote-table td.vote { text-align: center !important; }
  .vote input { transform: scale(1.6); }

  /* 集計テーブル */
  .result-table th, .result-table td { padding: 8px 6px; }

  /* adviceカード */
  .advice-card { padding: 14px; gap: 10px; }
  .advice-avatar { font-size: 26px; }

  /* 月替わりメッセージ */
  .monthly-msg-card { padding: 12px; }

  /* 承認バー */
  .approve-bar { flex-direction: column; align-items: stretch; }
  .approve-bar > div { justify-content: stretch; }
  .approve-bar .btn { width: 100%; text-align: center; }

  /* フォームボタン */
  .form-actions .btn { width: 100%; text-align: center; }

  /* review テーブル */
  .review-table .ops-* { white-space: nowrap; }

  /* 共有ボックス */
  .share-box code { font-size: 11px; }

  /* ミーティング一覧：ボタンを縦並びに */
  .table .actions { flex-direction: column; align-items: flex-end; gap: 4px; }
}
