:root {
  --navy: #0b1638;
  --navy-2: #101d47;
  --bg: #f1f3f8;
  --card: #fff;
  --text: #1a2233;
  --muted: #8a93a6;
  --line: #e7eaf0;
  --blue: #2f5af5;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20,30,60,.05), 0 4px 14px rgba(20,30,60,.05);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

.layout { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 218px; flex: 0 0 218px; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sb-logo { padding: 26px 20px 30px; text-align: center; }
.sb-logo .mark {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 12px;
  background: #fff; color: var(--navy); font-weight: 800; font-size: 26px;
  display: flex; align-items: center; justify-content: center; font-family: Arial, sans-serif;
}
.sb-logo .name { font-family: Arial, sans-serif; font-weight: 800; letter-spacing: 3px; font-size: 17px; }
.sb-menu { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 6px; }
.sb-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: 10px; color: #aab4d4; font-size: 14px; font-weight: 700;
  background: none; border: none; cursor: pointer; text-align: left; width: 100%;
}
.sb-item:hover { background: var(--navy-2); color: #fff; }
.sb-item.on { background: var(--blue); color: #fff; }
.sb-item svg { width: 20px; height: 20px; flex: 0 0 20px; }
.sb-logout { padding: 16px 12px 22px; }

/* ---------- main ---------- */
.main { flex: 1; padding: 26px 30px 50px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.page-title h1 { font-size: 24px; font-weight: 800; }
.page-title p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.admin-chip { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 14px 6px 6px; box-shadow: var(--shadow); }
.admin-chip .av { width: 34px; height: 34px; border-radius: 50%; background: #e7eaf0; display: flex; align-items: center; justify-content: center; }
.admin-chip .who { line-height: 1.2; }
.admin-chip .who .role { font-size: 11px; color: var(--muted); }
.admin-chip .who .nm { font-size: 13px; font-weight: 800; }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-card .s-title { font-size: 13px; font-weight: 700; color: #3c465c; margin-bottom: 12px; }
.stat-card .s-main { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.stat-card .s-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.s-ico.blue { background: #e5edff; } .s-ico.purple { background: #efe9fe; }
.s-ico.orange { background: #fff3e0; } .s-ico.green { background: #e5f8ec; }
.stat-card .s-val { font-size: 27px; font-weight: 800; }
.stat-card .s-val small { font-size: 14px; font-weight: 700; }
.s-delta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.s-delta b.up { color: var(--green); } .s-delta b.down { color: #e11d48; }

/* chart panel */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 16px; font-weight: 800; }
.range-tabs { display: flex; gap: 8px; }
.range-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; color: #6b7488; cursor: pointer; }
.range-tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* summary row */
.sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.sum-item { display: flex; gap: 12px; align-items: center; padding: 6px 18px; border-right: 1px solid var(--line); }
.sum-item:last-child { border-right: none; }
.sum-item .s-ico { width: 46px; height: 46px; }
.sum-item .lbl { font-size: 12.5px; font-weight: 700; color: #3c465c; }
.sum-item .val { font-size: 22px; font-weight: 800; }
.sum-item .val small { font-size: 12px; }
.sum-item .delta { font-size: 11.5px; color: var(--muted); }

/* ---------- review page ---------- */
.review-layout { display: grid; grid-template-columns: 280px 1fr 300px; gap: 16px; align-items: start; }
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-item { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.q-item.on { border-color: var(--blue); background: #f4f7ff; }
.q-item .dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid #c4cad8; flex: 0 0 17px; margin-top: 2px; }
.q-item.on .dot { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px #f4f7ff; }
.q-item .nm { font-size: 15px; font-weight: 800; }
.q-item .shop { font-size: 12px; color: #4a5468; margin: 2px 0; }
.q-item .dt { font-size: 11.5px; color: var(--muted); }
.count-pill { background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; padding: 8px 16px; }
.count-pill b { color: var(--blue); }

.preview-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.preview-note { font-size: 12px; color: var(--muted); margin: 4px 0 14px; }
.preview-frame { background: #f2f3f7; border-radius: 12px; padding: 14px; max-height: 72vh; overflow-y: auto; }

.action-col { display: flex; flex-direction: column; gap: 14px; }
.action-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.action-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.action-card h3 .ic { width: 20px; height: 20px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.ic.red { background: var(--red); } .ic.blue { background: var(--blue); } .ic.green { background: var(--green); }
.action-card.reject { background: #fef2f2; }
.action-card select, .action-card textarea, .action-card input {
  width: 100%; border: 1px solid #d4d9e3; border-radius: 9px; padding: 9px 10px;
  font-size: 13px; font-family: inherit; outline: none; background: #fff; margin-bottom: 8px;
}
.action-card textarea { min-height: 70px; resize: vertical; }
.btn { border: none; border-radius: 9px; padding: 11px 14px; font-size: 13.5px; font-weight: 800; cursor: pointer; width: 100%; }
.btn.red { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.gray { background: #eef0f4; color: #3c465c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.code-box { display: flex; gap: 6px; align-items: center; background: #f4f5f9; border-radius: 9px; padding: 9px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.code-box code { flex: 1; font-family: Consolas, monospace; }
.code-box button { background: none; border: none; cursor: pointer; font-size: 14px; }
.hint { font-size: 11px; color: var(--muted); margin-bottom: 8px; }

/* ---------- users page ---------- */
.search-panel { display: flex; gap: 14px; align-items: flex-end; }
.search-panel .fg { flex: 0 0 260px; }
.fg label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.fg input { width: 100%; border: 1px solid #d4d9e3; border-radius: 9px; padding: 10px 12px; font-size: 13.5px; font-family: inherit; outline: none; }
.users-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }

.profile-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.pc-head { display: flex; gap: 14px; margin-bottom: 14px; }
.pc-av { width: 74px; height: 74px; border-radius: 50%; overflow: hidden; flex: 0 0 74px; background: #e7eaf0; }
.pc-av img { width: 100%; height: 100%; object-fit: cover; }
.pc-name { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pc-name .tag { font-size: 11px; background: #eef0f4; color: #6b7488; padding: 2px 9px; border-radius: 999px; }
.pc-id { font-size: 12px; color: var(--muted); margin: 4px 0; }
.pc-bio { font-size: 12.5px; line-height: 1.6; white-space: pre-line; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; }
.pc-stat { text-align: center; padding: 12px 4px; border-right: 1px solid var(--line); }
.pc-stat:last-child { border-right: none; }
.pc-stat .l { font-size: 11px; color: #4a5468; font-weight: 700; }
.pc-stat .v { font-size: 20px; font-weight: 800; margin-top: 2px; }
.kv { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv .k { color: #4a5468; font-weight: 700; }
.kv .v { font-weight: 600; text-align: right; }
.pc-actions { display: flex; gap: 8px; margin-top: 14px; }
.pc-actions button { flex: 1; font-size: 12px; font-weight: 800; padding: 9px 6px; border-radius: 8px; cursor: pointer; background: #fff; }
.pa-status { border: 1.5px solid var(--blue); color: var(--blue); }
.pa-warn { border: 1.5px solid var(--orange); color: var(--orange); }
.pa-stop { border: 1.5px solid var(--red); color: var(--red); }

.user-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; border: 1.5px solid transparent; }
.user-list-item:hover { background: #f6f7fb; }
.user-list-item.on { border-color: var(--blue); background: #f4f7ff; }
.uli-av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #e7eaf0; flex: 0 0 40px; }
.uli-av img { width: 100%; height: 100%; }

.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 12px; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; background: #fafbfd; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.thumb { width: 52px; height: 62px; border-radius: 8px; object-fit: cover; display: block; }
.rt-title { font-size: 13.5px; font-weight: 800; }
.rt-sub { font-size: 11.5px; color: #4a5468; margin-top: 2px; }
.rt-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 4px 10px; white-space: nowrap; }
.pill.pub { color: #0d9488; border: 1.5px solid #5eead4; background: #f0fdfa; }
.pill.rev { color: var(--orange); border: 1.5px solid #fcd34d; background: #fffbeb; }
.pill.rej { color: var(--red); border: 1.5px solid #fca5a5; background: #fef2f2; }
.pill.hid { color: #6b7488; border: 1.5px solid #d4d9e3; background: #f4f5f9; }
.pill.ok { color: var(--green); border: 1.5px solid #86efac; background: #f0fdf4; }
.pill.gray { color: #6b7488; border: 1.5px solid #d4d9e3; background: #f4f5f9; }
.btn-outline { border: 1.5px solid #3c465c; color: #3c465c; background: #fff; border-radius: 8px; font-size: 12px; font-weight: 800; padding: 7px 14px; cursor: pointer; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-card { background: #fff; border-radius: 18px; padding: 36px 34px; width: 380px; }
.login-card h1 { font-size: 20px; font-weight: 800; text-align: center; margin: 14px 0 4px; }
.login-card p { font-size: 12.5px; color: var(--muted); text-align: center; margin-bottom: 20px; }
.login-card .fg { margin-bottom: 12px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 30px;
  background: #1a2233; color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.empty { text-align: center; color: var(--muted); font-size: 13.5px; padding: 40px 0; }

/* ---- v2 追加 ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 18, 40, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  background: #fff; border-radius: 16px; width: 100%; max-width: 460px;
  padding: 26px; position: relative; max-height: 88vh; overflow-y: auto;
}
.modal-card .close-x { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 20px; color: #6b7488; cursor: pointer; }
.modal-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.coupon-box {
  border: 2px solid var(--blue); border-radius: 14px; padding: 18px; text-align: center; margin-bottom: 16px;
}
.coupon-box.used { border-color: #c4cad8; background: #f7f8fa; }
.coupon-box .cc { font-family: Consolas, monospace; font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.coupon-box .cs { margin-top: 8px; }
.coupon-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.coupon-kv .k { color: #6b7488; font-weight: 700; }
.coupon-kv .v { font-weight: 700; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.report-modal {
  background: #f2f3f7; border-radius: 16px; width: 100%; max-width: 460px;
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.report-modal .rm-head {
  background: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.report-modal .rm-head h2 { font-size: 15px; font-weight: 800; }
.report-modal .rm-head button { background: none; border: none; font-size: 19px; color: #6b7488; cursor: pointer; }
.report-modal .rm-body { overflow-y: auto; padding: 14px; }
.eye-btn { background: none; border: 1.5px solid #d4d9e3; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; }
.eye-btn:hover { border-color: var(--blue); }

@media (max-width: 1100px) {
  .stat-grid, .sum-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .review-layout { grid-template-columns: 1fr; }
  .users-layout { grid-template-columns: 1fr; }
  .sidebar { width: 64px; flex-basis: 64px; }
  .sb-item span, .sb-logo .name { display: none; }
}
