/* ============================================================
   Lantern Hall 管理画面 — チャコール × テラコッタ
   ============================================================ */

:root {
  --bg: #f6f2ec;
  --card: #ffffff;
  --ink: #2b2520;
  --ink-soft: #4a4238;
  --muted: #8a7f70;
  --line: #e6ded1;
  --terra: #c05a2e;
  --terra-dark: #9d4720;
  --amber: #d99a2b;
  --night: #241e18;

  --ok: #3a7d44;
  --warn: #b96a10;
  --ng: #b3402e;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(43, 37, 32, .06), 0 8px 24px rgba(43, 37, 32, .05);
  --font-num: 'Outfit', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--terra); }

/* ---------- レイアウト ---------- */
body.admin { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--night);
  color: #cfc4b3;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { padding: 26px 22px 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-shop {
  display: block;
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: .04em;
  color: #f7f0e4;
}
.sidebar-label { font-size: 11px; color: #8a7f70; }
.sidebar-nav { display: flex; flex-direction: column; padding: 16px 0; flex-grow: 1; }
.sidebar-nav a {
  color: #cfc4b3;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-nav a.is-active {
  background: rgba(192, 90, 46, .18);
  border-left-color: var(--terra);
  color: #fff;
}
.sidebar-foot { padding: 18px 22px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-foot a { color: #8a7f70; font-size: 12.5px; text-decoration: none; }
.sidebar-foot a:hover { color: #cfc4b3; }

.admin-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 700; margin: 0; }
.topbar-user { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--ink-soft); }
.btn-link {
  background: none;
  border: none;
  color: var(--terra);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }
.admin-content { padding: 28px 32px 48px; }

/* ---------- KPIカード ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  border-top: 3px solid var(--terra);
}
.stat-label { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.stat-value {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  margin: 0;
}
.stat-value span { font-size: 14px; font-family: 'Noto Sans JP', sans-serif; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ---------- パネル ---------- */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
}
.panel-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-empty { color: var(--muted); font-size: 13.5px; padding: 16px 0; margin: 0; }

/* ---------- ダッシュボードリスト ---------- */
.upcoming-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.upcoming-list li, .recent-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.upcoming-list li:last-child, .recent-list li:last-child { border-bottom: none; }
.upcoming-date {
  font-family: var(--font-num);
  font-weight: 600;
  color: var(--terra);
  width: 74px;
  flex-shrink: 0;
}
.upcoming-body { flex-grow: 1; min-width: 0; }
.upcoming-body a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upcoming-body a:hover { color: var(--terra); }
.upcoming-meta, .recent-meta { display: block; font-size: 11.5px; color: var(--muted); }
.upcoming-capacity { display: flex; flex-direction: column; gap: 3px; width: 110px; flex-shrink: 0; }
.upcoming-count { font-size: 11px; color: var(--muted); font-family: var(--font-num); }
.recent-no {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.recent-body { flex-grow: 1; min-width: 0; }

/* ---------- メーター・バッジ ---------- */
.meter {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #efe8da;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--terra));
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.b-open      { background: #e4efe0; color: var(--ok); }
.b-few       { background: #f7ead3; color: var(--warn); }
.b-full      { background: var(--ink); color: #fff; }
.b-ended     { background: #eae4d8; color: var(--muted); }
.b-cancelled { background: #f4ddd8; color: var(--ng); }
.b-draft     { background: #eae4d8; color: var(--muted); }
.b-applied   { background: #e4efe0; color: var(--ok); }
.b-st-published { background: #e4efe0; color: var(--ok); }
.b-st-draft     { background: #eae4d8; color: var(--muted); }
.b-st-cancelled { background: #f4ddd8; color: var(--ng); }

.cat-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 8px;
  white-space: nowrap;
}
.cat-chip-seminar    { color: #c05a2e; }
.cat-chip-workshop   { color: #6d7f3a; }
.cat-chip-networking { color: #c9891b; }
.cat-chip-course     { color: #2f7f77; }

/* ---------- テーブル ---------- */
.panel-table { padding: 8px 0 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
}
.table tbody tr:hover { background: #fbf8f2; }
.table tbody tr:last-child td { border-bottom: none; }
.row-muted { opacity: .55; }

.cell-nowrap { white-space: nowrap; }
.cell-mono { font-family: var(--font-num); font-weight: 600; }
.cell-strong { font-weight: 700; color: var(--ink); text-decoration: none; }
a.cell-strong:hover { color: var(--terra); }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); }
.cell-sub-line { display: block; font-size: 12.5px; }
.cell-capacity { min-width: 150px; }
.cell-capacity .meter { margin-bottom: 4px; }
.cell-count { font-size: 11px; color: var(--muted); font-family: var(--font-num); }
.cell-actions { text-align: right; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: #f1ebdf; }
.btn-outline { background: var(--card); color: var(--terra); border-color: var(--terra); }
.btn-outline:hover { background: #faeee7; }
.btn-sm { padding: 4px 12px; font-size: 12px; background: var(--card); border-color: var(--line); color: var(--ink-soft); }
.btn-sm:hover { border-color: var(--terra); color: var(--terra); }
.btn-danger { color: var(--ng); }
.btn-danger:hover { border-color: var(--ng); color: var(--ng); background: #fbf1ef; }
.btn-block { display: block; width: 100%; text-align: center; }

.page-actions { display: flex; justify-content: flex-end; margin-bottom: 18px; }

/* ---------- フィルタバー ---------- */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-form select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  max-width: 340px;
}
.filter-info { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }

/* ---------- フォーム ---------- */
.form-panel { max-width: 860px; padding: 28px 32px; }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.req {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--terra);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 2px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfcf9;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid rgba(192, 90, 46, .4);
  border-color: var(--terra);
}
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}
.form-foot-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

/* ---------- フラッシュ ---------- */
.flash {
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 18px;
}
.flash p { margin: 2px 0; }
.flash-success { background: #e4efe0; color: var(--ok); }
.flash-error { background: #f4ddd8; color: var(--ng); }

/* ---------- ログイン ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(480px 320px at 80% 10%, rgba(217, 154, 43, .18), transparent 70%),
    var(--night);
}
.login-card {
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  padding: 38px 36px 30px;
}
.login-brand {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: .04em;
  text-align: center;
  margin: 0;
}
.login-label {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 26px;
}
.login-demo {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 8px;
  padding: 9px;
  margin: 22px 0 10px;
}
.login-demo code {
  font-family: var(--font-num);
  font-weight: 600;
  color: var(--terra);
}
.login-back { text-align: center; font-size: 12px; margin: 0; }
.login-back a { color: var(--muted); text-decoration: none; }
.login-back a:hover { color: var(--terra); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  body.admin { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; padding: 0; overflow-x: auto; }
  .sidebar-nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidebar-nav a.is-active { border-left: none; border-bottom-color: var(--terra); }
  .sidebar-foot { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 20px 16px 40px; }
  .form-cols, .form-cols-3 { grid-template-columns: 1fr; }
}
