/* ==========================================================
   管理画面（デモ） スタイル
   ========================================================== */
:root {
  --primary: #1b6e53;
  --primary-dark: #14523e;
  --primary-light: #e6f2ee;
  --accent: #e8a13a;
  --text: #2b2b2b;
  --text-muted: #6b7280;
  --bg: #f3f4f6;
  --white: #fff;
  --line: #e5e7eb;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .08);
  --sidebar-w: 240px;
}

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

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.7;
}
a { text-decoration: none; color: var(--primary); }
ul { list-style: none; }

/* デモ告知バー（公開サイト側と同デザイン） */
.demo-bar {
  background: #333;
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 300;
}
.demo-bar strong { color: var(--accent); }
.demo-bar a.demo-bar-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 12px;
}
.demo-bar a.demo-bar-btn:hover { opacity: .85; }

/* レイアウト */
.admin-layout { display: flex; min-height: calc(100vh - 34px); }

/* サイドバー */
.sidebar {
  width: var(--sidebar-w);
  background: #1f2b26;
  color: #cfe0d8;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2f8d6d, var(--primary-dark));
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand .t { line-height: 1.3; }
.sidebar-brand .t .name { color: #fff; font-weight: 700; font-size: 13.5px; display: block; }
.sidebar-brand .t .sub { font-size: 10.5px; opacity: .7; }

.sidebar-nav { padding: 14px 12px; flex: 1; }
.sidebar-nav .group-label {
  font-size: 10.5px;
  letter-spacing: .12em;
  color: #8aa398;
  padding: 14px 10px 6px;
  text-transform: uppercase;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cfe0d8;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); }
.sidebar-nav a.active { background: var(--primary); color: #fff; font-weight: 700; }
.sidebar-nav .icon { width: 20px; text-align: center; font-size: 15px; }

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
}
.sidebar-foot a { color: #ffd9a0; }

/* メイン */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 17px; }
.topbar .user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-muted);
}
.topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 24px; max-width: 1040px; }

/* パネル */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 20px; }

/* 統計カード */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.stat .label { font-size: 12px; color: var(--text-muted); }
.stat .value { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .note { font-size: 11.5px; color: var(--text-muted); }

/* テーブル */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13.5px;
  vertical-align: middle;
}
.admin-table thead th {
  background: #f9fafb;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.admin-table tr:hover td { background: #f9fafb; }
.admin-table .actions { white-space: nowrap; text-align: right; }

/* ステータスバッジ */
.status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status.pub { background: #dcf5e8; color: #157a4d; }
.status.draft { background: #f1f2f4; color: #6b7280; }
.status.scheduled { background: #fdf1dc; color: #b57a1e; }

/* ボタン */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--white); color: var(--primary); border: 1px solid var(--primary); }
.btn-danger-outline { background: var(--white); color: #c0392b; border: 1px solid #d9948c; }
.btn-muted { background: #eef0f2; color: var(--text-muted); }

/* フォーム */
.form-grid { display: grid; gap: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.form-row .hint { font-size: 11.5px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="time"],
.form-row input[type="datetime-local"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-row textarea { resize: vertical; }
.form-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .form-cols-2 { grid-template-columns: 1fr; } }

/* トグルスイッチ（見た目のみ） */
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; }
.toggle .sw {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--primary);
  position: relative;
  flex-shrink: 0;
}
.toggle .sw::after {
  content: "";
  position: absolute;
  top: 3px; right: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
}
.toggle.off .sw { background: #cbd2d9; }
.toggle.off .sw::after { right: auto; left: 3px; }

/* 画像アップロード枠（見た目のみ） */
.upload-box {
  border: 2px dashed #cbd2d9;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: #fafbfb;
}
.upload-box .thumb {
  max-width: 320px;
  margin: 0 auto 12px;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(45deg, #e5e9e7 0 14px, #dbe1de 14px 28px);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #7d8781;
}

/* フォームフッター */
.form-actions {
  display: flex; gap: 12px; align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  flex-wrap: wrap;
}
.form-actions .note { font-size: 12px; color: var(--text-muted); }

/* お知らせ枠 */
.notice {
  background: #fdf6e8;
  border: 1px solid #f0dcb4;
  color: #8a6417;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

@media (max-width: 820px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .sidebar-nav .group-label { width: 100%; }
}
