/* ===== 管理画面 ===== */
.admin-page { background: #f4f5f7; }
/* 縦に並べるだけの単純な配置にする（内容が長いサイト設定などでも、タブの行が縮んで隠れないように） */
.admin-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: block; }
.admin-wrap > * { width: min(920px, 100%); margin: 0 auto 14px; box-sizing: border-box; }
.admin-wrap > [hidden] { display: none !important; }
.admin-card { background: #fff; border-radius: 10px; padding: 16px 18px; display: grid; gap: 12px; box-shadow: 0 1px 3px #0001; }
.admin-card h2 { margin: 0; font-size: 17px; }
.admin-card .hint { margin: 0; line-height: 1.6; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.admin-wrap > .admin-tabs { margin-bottom: 0; }
.admin-tabs { display: flex; flex: none; min-height: 44px; background: #fff; border-radius: 10px 10px 0 0; overflow: hidden;
  position: sticky; top: -16px; z-index: 1000; box-shadow: 0 1px 0 var(--line); }   /* 下にスクロールしてもタブは上に残る */
.admin-wrap > .admin-tabs + .admin-card, .admin-wrap > .admin-tabs ~ .admin-card { border-radius: 0 0 10px 10px; }
.admin-tabs .tab[hidden] { display: none; }
.grid.narrow { max-width: 460px; }
.big-btn.add.slim { flex: none; flex-direction: row; min-height: 38px; padding: 6px 14px; }
.alert { background: #fff4d6; border: 1px solid #f0d98c; color: #5a4300; border-radius: 10px; padding: 12px 16px; line-height: 1.6; font-size: 14px; }

.pw-meter { display: grid; gap: 4px; }
.pw-meter span { height: 6px; border-radius: 3px; background: #e3e6ea; position: relative; overflow: hidden; }
.pw-meter span::after { content: ""; position: absolute; inset: 0; width: var(--w, 0%); background: var(--c, #c8102e); transition: width .2s; }
.pw-meter small { font-size: 12px; color: var(--muted); }

.role-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.role-pick legend { font-size: 12px; color: var(--muted); margin-bottom: 4px; padding: 0; }
.pw-box { display: grid; gap: 6px; background: #f6f8fb; border-radius: 8px; padding: 10px; }
.pw-box input[name=password] { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.user-form { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; background: #f7f8fa; padding: 8px 10px; white-space: nowrap; }
.admin-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table td.nowrap { white-space: nowrap; }
.admin-table td.actions { white-space: nowrap; text-align: right; }
.admin-table td.actions .sm-btn + .sm-btn { margin-left: 4px; }
.admin-table tr.off td { color: var(--muted); background: #fafafa; }
.role { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.role.admin { background: #fde8e8; color: #a3122a; }
.role.editor { background: #e3f1ff; color: #185bb0; }
.role.reporter { background: #eaf6ee; color: #16804a; }
.state { font-size: 12px; white-space: nowrap; }
.state.ok { color: #16804a; }
.state.off { color: #a3122a; font-weight: 700; }
.state.warn { color: #8a5a00; }
.me-tag { font-size: 11px; color: var(--muted); margin-left: 4px; }

.set-map { height: 280px; border-radius: 8px; border: 1px solid var(--line); position: relative; z-index: 0; }   /* 地図の部品がタブの上に重ならないように */
.with-btn .hint { align-self: center; }

@media (max-width: 640px) {
  .role-pick { grid-template-columns: 1fr; }
  .admin-table th:nth-child(5), .admin-table td:nth-child(5) { display: none; }
}
.grid .role-pick label.radio-card { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; color: var(--muted); }
.grid .role-pick label.radio-card input { margin-top: 3px; }

/* 一般ユーザー・報告の受付 */
.alert.soft { background: #f3f6fa; border-color: #d9e1ea; color: #364152; padding: 9px 14px; }
.reporter-box { display: grid; gap: 6px; background: #eef8f1; border: 1px solid #cfe9d8; border-radius: 8px; padding: 10px; font-size: 13px; }
.reporter-box p { margin: 0; line-height: 1.6; }
.reporter-box .sm-btn { justify-self: start; }
.report-set { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; margin: 0; }
.report-set legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.grid label.switch-row { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; line-height: 1.5; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.state.wait { color: #8a5a00; font-weight: 700; }
input.mono { font-family: ui-monospace, Consolas, monospace; }
