:root {
  --brand: #8677D6;          /* LPの紫 */
  --brand-dark: #655ccd;
  --teal: #00B3BA;           /* LPのティール */
  --grad: linear-gradient(90deg, #8B76D6 0%, #00B3BA 100%);
  --text: #131313;
  --muted: #6b7280;
  --bg: #F7F7F7;             /* LPの薄グレー */
  --card: #ffffff;
  --border: #e6e6ea;
  --error: #dc2626;
  --success: #059669;
  --shadow: 4px 8px 24px #00000014;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--brand); }

.en { font-family: "Montserrat", sans-serif; }

/* ---- 公開ページ（申込・ログイン） ---- */
.public-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.public-logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  text-decoration: none;
  position: relative;
  padding-bottom: 6px;
}
.public-logo::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--grad);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
}

.card--wide { max-width: 720px; }

.card h1 { font-size: 20px; margin: 0 0 8px; }
.card .card-lead { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}
.field-error { color: var(--error); font-size: 13px; margin: 4px 0 0; }

/* LP風ピルボタン（グラデーション） */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: inherit;
  transition: opacity .2s ease, box-shadow .2s ease;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 4px 8px 24px #00000029;
}
.btn-primary:hover { opacity: .85; }
.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn-secondary:hover { background: #f4f2fc; }
.btn-block { display: block; width: 100%; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: #e9f8f4; color: #056a5c; border: 1px solid #b7e9de; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- 管理画面 ---- */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 230px;
  background: #fff;
  border-right: 1px solid var(--border);
  color: var(--text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.admin-brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  padding: 22px 20px 16px;
  text-decoration: none;
  line-height: 1.2;
}
.admin-brand .sub {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}
.admin-brand .bar {
  display: block;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad);
  margin-top: 8px;
}
.admin-nav { flex: 1; padding: 6px 12px; }
.admin-nav a {
  display: block;
  color: #444a52;
  text-decoration: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  margin-bottom: 4px;
}
.admin-nav a:hover { background: #f1effb; color: var(--brand-dark); }
.admin-nav a.is-active {
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 4px 6px 16px #8b76d63d;
}
.admin-sidebar-footer { padding: 16px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.admin-sidebar-footer button {
  background: none; border: none; color: #444a52; cursor: pointer; padding: 0; font-size: 13px; font-family: inherit;
}
.admin-sidebar-footer button:hover { color: var(--brand-dark); text-decoration: underline; }

.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }
.admin-title {
  font-size: 22px;
  margin: 0 0 20px;
  position: relative;
  padding-left: 14px;
}
.admin-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-radius: 3px;
  background: var(--grad);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 16px; margin: 0 0 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad);
}
.stat .stat-label { font-size: 12px; color: var(--muted); }
.stat .stat-value { font-size: 26px; font-weight: 700; font-family: "Montserrat", "Noto Sans JP", sans-serif; }
.stat .stat-value small { font-size: 14px; font-weight: normal; color: var(--muted); font-family: "Noto Sans JP", sans-serif; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }

.stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d8dbe0; }

.review-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review-item:last-child { border-bottom: none; }
.review-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.review-text { white-space: pre-wrap; margin: 4px 0 0; }
.review-answers { font-size: 13px; color: var(--muted); margin-top: 6px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; font-family: inherit; background: #fff; }

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: 14px; background: #fff; color: var(--text);
}
.pagination .is-current { background: var(--grad); color: #fff; border-color: transparent; }

.report-body { max-width: 760px; }
.report-body h2 {
  font-size: 18px;
  border-left: none;
  padding-left: 14px;
  margin: 28px 0 12px;
  position: relative;
}
.report-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 5px;
  border-radius: 3px;
  background: var(--grad);
}
.report-body h2:first-child { margin-top: 0; }
.report-body blockquote { border-left: 3px solid #cfc8f0; margin: 8px 0; padding: 4px 14px; color: var(--muted); }

.url-copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.url-copy input { flex: 1; min-width: 240px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-family: inherit; background: #f9fafb; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.color-grid label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.color-grid input[type="color"] { width: 40px; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: #fff; }

.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-trial { background: #eef1fd; color: #655ccd; }
.badge-active { background: #e6f7f6; color: #00858b; }
.badge-inactive { background: #fef2f2; color: #991b1b; }

@media (max-width: 800px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-brand { padding: 12px 16px; font-size: 17px; white-space: nowrap; }
  .admin-brand .sub, .admin-brand .bar { display: none; }
  .admin-nav { display: flex; padding: 0 8px; }
  .admin-nav a { padding: 8px 12px; white-space: nowrap; margin-bottom: 0; }
  .admin-sidebar-footer { padding: 12px 16px; white-space: nowrap; border-top: none; }
  .admin-main { padding: 20px 16px; }
}
