/* 管理画面（common.css に追加する分） */

[hidden] { display: none !important; }

/* ---- 上の帯 ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; white-space: nowrap; }
.topbar .event-pick { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 280px; }
.topbar .event-pick label { margin: 0; white-space: nowrap; }
.topbar .event-pick select { flex: 1; max-width: 520px; }

/* ---- 左メニューと本文 ---- */
.layout { display: flex; min-height: calc(100vh - 60px); }
.side {
  width: 200px;
  flex-shrink: 0;
  padding: 12px 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.side a {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.side a:hover { background: #f1f4f9; }
.side a.current { background: #e8effc; color: var(--accent); font-weight: 700; border-left-color: var(--accent); }
.side a.later { color: var(--muted); }
.side a.later small { display: block; font-size: 12px; }
main { flex: 1; min-width: 0; padding: 24px 28px 96px; }

/* ---- 入力欄 ---- */
input[type="number"], input[type="date"], select, textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
textarea { width: 100%; resize: vertical; }
.inline input[type="text"], .inline input[type="number"] { width: auto; }
.inline label { display: inline; margin: 0; color: var(--text); font-size: 15px; }
input.w-code { width: 7em !important; }
input.w-number { width: 9em !important; }
input.w-count { width: 6em !important; }
input.w-sec { width: 6.5em !important; }

/* ---- ボタン ---- */
button.small { font-size: 14px; padding: 5px 12px; }
button.danger { background: #fbeaea; color: var(--danger); }

/* ---- 表 ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: #fafbfc; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.ops { text-align: right; white-space: nowrap; }
td.ops button + button { margin-left: 6px; }
td.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; font-size: 17px; }
td.note { max-width: 220px; font-size: 13px; color: var(--muted); }
tr.selected td { background: #f3f7ff; }
tfoot td { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--line); border-bottom: 0; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; background: #eef0f3; color: var(--muted); white-space: nowrap; }
.badge.on { background: #e3f4ec; color: var(--ok); }
.badge.off { background: #fbeaea; color: var(--danger); }
.badge.live { background: #e8effc; color: var(--accent); }
.tag { margin-left: 8px; font-size: 12px; color: var(--accent); }
.sold-out { color: var(--danger); font-weight: 700; }

/* ---- 区画 ---- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0 16px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 20px; }
.panel { padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.panel h2 { font-size: 16px; margin: 0 0 6px; }
.panel .row { margin-top: 10px; }
.inline-add { margin-top: 12px; padding: 12px 16px; background: #fff8e6; border: 1px solid #f0d68a; border-radius: 8px; }
.inline-add p { margin: 0 0 8px; font-size: 14px; }
.inline-add input[type="text"] { width: 14em; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; }
.summary { margin: 8px 0; font-size: 14px; color: var(--muted); }
h2.sub { font-size: 17px; margin: 28px 0 8px; }

/* ---- 演出設定 ---- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.settings-grid label { margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; margin: 6px 0; }
.check input { width: 18px; height: 18px; }

/* ---- 入力ダイアログ ---- */
dialog {
  width: min(540px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  color: var(--text);
}
dialog::backdrop { background: rgba(20, 25, 35, .45); }
dialog h2 { font-size: 19px; margin: 0 0 12px; }
.field { margin-bottom: 14px; }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select { width: 100%; }
.hint { margin-top: 4px; font-size: 13px; color: var(--muted); }
.req { margin-left: 6px; font-size: 11px; color: var(--danger); }
.actions { margin-top: 18px; }

/* ---- 結果のお知らせ（右下） ---- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(520px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
  white-space: pre-line;
}
.toast.ok { background: #e3f4ec; color: #14532d; border: 1px solid #b6e2cb; }
.toast.err { background: #fdecea; color: #7f1d1d; border: 1px solid #f5c2bd; }
.toast .close { padding: 0 4px; font-size: 20px; line-height: 1; background: transparent; color: inherit; }
