/* 美容整体CANON 予約システム — スマホ幅優先の1カラム */
:root {
  --bg: #fdf8f3;
  --card: #ffffff;
  --text: #33302c;
  --muted: #7a726a;
  --line: #ecdfd2;
  --primary: #ec7a12; /* ロゴのオレンジ */
  --primary-dark: #c8620a;
  --primary-soft: #fdeede;
  --danger: #b4372b;
  --danger-soft: #fbe9e6;
  --warn-soft: #fff4d6;
  --radius: 10px;
  --max: 640px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

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

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
}

.site-header .brand img {
  height: 36px;
  width: auto;
  display: block;
}

.hero-logo {
  display: block;
  width: 200px;
  max-width: 60%;
  height: auto;
  margin: 8px auto 16px;
}

.hero-title {
  text-align: center;
  font-size: 20px;
  margin: 0 0 16px;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 22px;
  margin: 8px 0 16px;
}

h2 {
  font-size: 17px;
  margin: 24px 0 8px;
  border-left: 4px solid var(--primary);
  padding-left: 8px;
}

p {
  margin: 8px 0;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card.link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card.link:active,
.card.link:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.card .title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 4px;
}

.card .meta {
  color: var(--primary-dark);
  font-weight: 700;
  margin-top: 6px;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.secondary {
  background: var(--card);
  color: var(--primary);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.small {
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

.actions {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.steps {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}

.steps li {
  flex: 1;
  text-align: center;
  padding: 6px 2px;
  border-bottom: 3px solid var(--line);
}

.steps li.active {
  color: var(--primary-dark);
  font-weight: 700;
  border-bottom-color: var(--primary);
}

.summary {
  background: var(--primary-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}

dl.kv {
  margin: 0;
  display: grid;
  grid-template-columns: 6em 1fr;
  row-gap: 6px;
  column-gap: 8px;
}

dl.kv dt {
  color: var(--muted);
  font-size: 14px;
}

dl.kv dd {
  margin: 0;
  word-break: break-all;
}

/* 月カレンダー */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-nav .month {
  font-weight: 700;
  font-size: 18px;
}

.cal {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal th {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.cal th.sun,
.cal td.sun .d {
  color: var(--danger);
}

.cal th.sat,
.cal td.sat .d {
  color: #2a5db0;
}

.cal td {
  text-align: center;
  padding: 0;
  height: 56px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.cal td .d {
  display: block;
  font-size: 13px;
  padding-top: 4px;
}

.cal td .m {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.cal td a {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  padding-bottom: 4px;
}

.cal td a:hover,
.cal td a:active {
  background: var(--primary-soft);
}

.cal td.available .m {
  color: var(--primary);
}

.cal td.full .m {
  color: var(--danger);
}

.cal td.unavailable {
  color: #b5b0a6;
  background: #f3f1ec;
}

.cal td.today .d {
  text-decoration: underline;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* 時間ボタン */
.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.slots a {
  display: block;
  text-align: center;
  padding: 12px 0;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.slots a:hover,
.slots a:active {
  background: var(--primary-soft);
}

/* フォーム */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.field .req {
  color: var(--danger);
  font-size: 12px;
  margin-left: 4px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field textarea {
  min-height: 90px;
}

.field .help {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 15px;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
}

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.alert.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert.warn {
  background: var(--warn-soft);
}

.alert.info {
  background: var(--primary-soft);
}

.alert ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.cf-turnstile {
  margin: 12px 0;
}

.big-no {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

table.plain {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.plain th,
table.plain td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.plain th {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.site-footer {
  max-width: var(--max);
  margin: 24px auto;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 720px) {
  main {
    padding: 24px 16px;
  }
  .slots {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== 管理画面 ===== */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.admin-nav a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.admin-nav a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-user {
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eee;
  color: #444;
  white-space: nowrap;
}

.badge.confirmed,
.badge.sent {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge.cancelled,
.badge.failed,
.badge.gave_up,
.badge.no_show {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.done {
  background: #e6ecf7;
  color: #2a5db0;
}

.badge.pending,
.badge.sending {
  background: var(--warn-soft);
  color: #7a5a00;
}

table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

table.list th,
table.list td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.list th {
  background: #f3f1ec;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

table.list tr.row-link {
  cursor: pointer;
}

table.list tr.row-link:hover {
  background: var(--primary-soft);
}

.table-wrap {
  overflow-x: auto;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.filters .field {
  margin-bottom: 0;
}

.filters .full {
  grid-column: 1 / -1;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inline-form {
  display: inline;
}

.stat {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat .card {
  flex: 1;
  min-width: 120px;
  text-align: center;
  margin: 0;
}

.stat .n {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
}

.stat .card.warn .n {
  color: var(--danger);
}

/* 管理カレンダー（月） */
.cal td .cnt {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.cal td.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.timeline .t {
  font-weight: 700;
  color: var(--primary-dark);
}

/* 営業スケジュール（週グリッド） */
.sched-wrap {
  overflow-x: auto;
}

table.sched {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  background: var(--card);
  font-size: 13px;
}

table.sched th,
table.sched td {
  border: 1px solid var(--line);
  text-align: center;
  padding: 0;
}

table.sched th {
  padding: 6px 2px;
  font-weight: 400;
  font-size: 12px;
  background: #f3f1ec;
}

table.sched th .dow {
  font-weight: 700;
  font-size: 13px;
}

table.sched th.sun .dow {
  color: var(--danger);
}

table.sched th.sat .dow {
  color: #2a5db0;
}

table.sched th.holiday {
  background: var(--danger-soft);
}

table.sched th.special {
  background: var(--warn-soft);
}

table.sched th .day-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

table.sched th .day-actions button {
  font-size: 11px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

table.sched td.time {
  width: 56px;
  font-size: 12px;
  color: var(--muted);
  background: #faf9f6;
}

table.sched td .cell {
  display: block;
  height: 34px;
  line-height: 34px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
}

table.sched td .cell.open {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

table.sched td .cell.closed {
  background: #f1efe9;
  color: #b5b0a6;
}

table.sched td .cell.booked {
  background: #e6ecf7;
  color: #2a5db0;
  cursor: not-allowed;
}

.sched-legend {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0;
}

pre.mail {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  background: #faf9f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin: 0;
}

details summary {
  cursor: pointer;
  color: var(--primary);
}

@media (min-width: 720px) {
  .filters {
    grid-template-columns: repeat(4, 1fr);
  }
}
