/* ============================================================
   JPSO 予約管理 共通スタイル
   ・1つの画面をレスポンシブで作る（スマホを基本にし、900px 以上を PC とする）
   ・一覧は PC では表、スマホではカードにする
   ・配色は予約システムに合わせる
   ============================================================ */
:root {
  --c-primary: #33545f;
  --c-primary-dark: #284651;
  --c-primary-soft: #e6eef0;
  --c-bg: #f3f6f6;
  --c-surface: #ffffff;
  --c-border: #d5dee1;
  --c-text: #1f2d33;
  --c-sub: #5f6f75;
  --c-ok: #1e7a4c;
  --c-ok-bg: #e5f4ec;
  --c-cancel: #8a5a00;
  --c-cancel-bg: #fdf3dc;
  --c-fail: #b3261e;
  --c-fail-bg: #fdecec;
  --c-muted-bg: #eef1f2;
  --c-info-bg: #e8f1fb;
  --c-info: #1d4f86;
  --radius: 10px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

h1,
h2,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--c-sub);
}

.small {
  font-size: 13px;
}

.mono {
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

.break {
  word-break: break-all;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.error-text {
  color: var(--c-fail);
}

/* ---------- ヘッダー ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--c-primary);
  color: #fff;
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  min-height: 52px;
  margin: 0 auto;
  padding: 0 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
}

.brand-sub {
  font-size: 13px;
  opacity: 0.9;
}

.nav-pc,
.nav-pc-only {
  display: none;
}

.app-header a.is-active {
  background: rgba(255, 255, 255, 0.18);
}

.count-badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #d93025;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.sp-task-link {
  margin-left: auto;
  padding: 6px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.header-logout {
  margin-left: auto;
}

.header-logout .link-button {
  color: #fff;
}

.nav-sp {
  position: relative;
  margin-left: auto;
}

.sp-task-link + .nav-sp {
  margin-left: 0;
}

.nav-sp > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}

.nav-sp > summary::-webkit-details-marker {
  display: none;
}

.nav-sp-icon,
.nav-sp-icon::before,
.nav-sp-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
}

.nav-sp-icon {
  position: relative;
}

.nav-sp-icon::before,
.nav-sp-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-sp-icon::before {
  top: -5px;
}

.nav-sp-icon::after {
  top: 5px;
}

.nav-sp-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 32px));
  padding: 8px;
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color: var(--c-text);
}

.nav-sp-panel a,
.nav-sp-panel .link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--c-text);
  text-decoration: none;
  text-align: left;
}

.nav-sp-panel a.is-active {
  background: var(--c-primary-soft);
  font-weight: 700;
}

.nav-sp-panel hr {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--c-border);
}

.nav-sp-user {
  padding: 4px 12px;
  color: var(--c-sub);
  font-size: 13px;
}

@media (min-width: 900px) {
  .nav-pc {
    display: flex;
    gap: 4px;
    margin-left: 16px;
  }

  .nav-pc a {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
  }

  .nav-pc a:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .nav-pc-only {
    display: block;
  }

  .nav-sp,
  .sp-task-link {
    display: none;
  }
}

.user-menu {
  position: relative;
  margin-left: auto;
}

.user-menu > summary {
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}

.user-menu > summary::after {
  content: " ▾";
}

.user-menu > summary::-webkit-details-marker {
  display: none;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.user-menu-panel a,
.user-menu-panel .link-button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--c-text);
  text-decoration: none;
  text-align: left;
}

.user-menu-role {
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 4px;
  color: var(--c-sub);
  font-size: 13px;
}

.user-menu-panel a:hover,
.user-menu-panel .link-button:hover {
  background: var(--c-primary-soft);
}

/* ---------- ページ ---------- */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.page-narrow {
  max-width: 720px;
}

.page-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 20px;
  line-height: 1.4;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead {
  margin-bottom: 16px;
  color: var(--c-sub);
  font-size: 14px;
}

.back-link {
  display: inline-block;
  margin-bottom: 4px;
  padding: 6px 0;
  font-size: 14px;
  text-decoration: none;
}

.empty {
  padding: 32px 16px;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-sub);
  text-align: center;
}

/* ---------- 案内 ---------- */
.flash {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
}

.flash p + p {
  margin-top: 4px;
}

.flash-ok {
  background: var(--c-ok-bg);
  color: var(--c-ok);
}

.flash-error {
  background: var(--c-fail-bg);
  color: var(--c-fail);
}

.flash-info {
  background: var(--c-info-bg);
  color: var(--c-info);
}

.alert-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-left: 5px solid #d93025;
  border-radius: var(--radius);
  background: var(--c-fail-bg);
  color: var(--c-fail);
  text-decoration: none;
}

.alert-banner span {
  font-size: 13px;
}

/* ---------- カード ---------- */
.card {
  display: block;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
}

.card-title {
  margin-bottom: 10px;
  font-size: 16px;
}

.card-alert {
  border-color: #f0b4b0;
  border-left: 5px solid #d93025;
}

.card-notice {
  border-color: #9cc3e6;
  border-left: 5px solid var(--c-info);
  background: var(--c-info-bg);
}

.cards {
  display: grid;
  gap: 10px;
}

.cards .card {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .cards-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--c-text);
  text-decoration: none;
}

.card-link:hover {
  border-color: var(--c-primary);
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-main {
  font-size: 16px;
  font-weight: 700;
}

.is-past {
  opacity: 0.72;
}

/* ---------- 状態のバッジ ---------- */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}

.status-ok {
  background: var(--c-ok-bg);
  color: var(--c-ok);
}

.status-cancel {
  background: var(--c-cancel-bg);
  color: var(--c-cancel);
}

.status-fail {
  background: var(--c-fail-bg);
  color: var(--c-fail);
}

.status-muted {
  background: var(--c-muted-bg);
  color: var(--c-sub);
}

/* ---------- ボタン ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--c-primary);
}

.button-primary {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

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

.button-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.button-block {
  width: 100%;
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.button-row form {
  margin: 0;
}

.link-button {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--c-primary);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- 入力 ---------- */
.field {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field > label,
.field > legend,
.field > .label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-weight: 700;
  font-size: 14px;
}

.req {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--c-fail-bg);
  color: var(--c-fail);
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

input[type="text"],
input[type="search"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-surface);
  font-size: 16px; /* スマホで入力時に画面が拡大されないよう16px以上 */
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: 1px;
}

.input-short {
  max-width: 180px;
}

.hint {
  margin-top: 6px;
  color: var(--c-sub);
  font-size: 13px;
}

.static {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--c-bg);
}

.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-weight: 400;
  cursor: pointer;
}

.field > label.radio {
  display: flex;
  margin-bottom: 0;
  font-weight: 400;
}

.radio input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field-row + .hint {
  margin-bottom: 16px;
}

.password-box {
  display: flex;
  gap: 6px;
}

.password-box input {
  flex: 1;
}

/* ---------- 予約一覧の検索 ---------- */
.chips {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chip {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  text-decoration: none;
}

.chip.is-active {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

.search .field {
  margin-bottom: 12px;
}

.search .button-row {
  margin-top: 4px;
}

.period {
  display: flex;
  align-items: center;
  gap: 6px;
}

.period input {
  min-width: 0;
}

@media (min-width: 900px) {
  .search-grid {
    display: grid;
    grid-template-columns: 2fr 2fr 1.4fr 1.4fr;
    gap: 12px;
  }
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 8px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

/* ---------- 表（PC）・カード（スマホ）の切り替え ---------- */
.pc-only {
  display: none;
}

@media (min-width: 900px) {
  .pc-only {
    display: table;
  }

  .sp-only {
    display: none;
  }
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  overflow: hidden;
}

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

.table .num {
  text-align: right;
}

.table th {
  background: var(--c-primary-soft);
  font-size: 13px;
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-clickable tbody tr {
  cursor: pointer;
}

.table-clickable tbody tr:hover td {
  background: #f7fafa;
}

.row-link {
  color: var(--c-text);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 予約詳細 ---------- */
.detail-head {
  margin-bottom: 12px;
}

.detail-head .page-title {
  margin-bottom: 2px;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-grid .card {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.dl > div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--c-bg);
}

.dl > div:last-child {
  border-bottom: 0;
}

.dl dt {
  color: var(--c-sub);
  font-size: 13px;
}

.dl dd {
  word-break: break-word;
}

.dl + .dl {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
}

.mail-list li {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-bg);
}

.mail-list li:last-child {
  border-bottom: 0;
}

.mail-list li.is-failed .mail-name::after {
  content: "　未送信";
  color: var(--c-fail);
  font-size: 12px;
  font-weight: 700;
}

.detail-text {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--c-bg);
  font-size: 13px;
  word-break: break-word;
}

/* ---------- 要対応 ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}

.tabs a {
  padding: 10px 16px;
  border-bottom: 3px solid transparent;
  color: var(--c-sub);
  text-decoration: none;
}

.tabs a.is-active {
  border-bottom-color: var(--c-primary);
  color: var(--c-text);
  font-weight: 700;
}

.task p + p {
  margin-top: 6px;
}

.guide {
  margin: 8px 0;
  font-size: 14px;
}

.guide summary {
  color: var(--c-primary);
  cursor: pointer;
}

.guide p {
  margin-top: 6px;
}

.task-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.task-form input[type="text"] {
  flex: 1 1 220px;
}

.task-form .button {
  flex: 0 0 auto;
}

.task-reservation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 14px;
}

.task-reservation a {
  font-family: var(--mono);
  font-weight: 700;
}

.task-items {
  margin: 8px 0;
  padding: 8px 10px 8px 26px;
  border-radius: 8px;
  background: var(--c-bg);
  font-size: 13px;
  list-style: disc;
  word-break: break-word;
}

.task-items:empty {
  display: none;
}

.task .card-title {
  margin-bottom: 4px;
}

.handled {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--c-border);
}

/* ---------- カウンセラー ---------- */
.counselor-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.counselor-text {
  flex: 1;
  min-width: 0;
}

.photo {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #dfe6e9;
  overflow: hidden;
}

.photo img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
}

.is-unpublished {
  background: #fafbfb;
}

.warnings {
  margin-top: 10px;
  padding: 8px 10px 8px 28px;
  border-radius: 8px;
  background: var(--c-cancel-bg);
  color: var(--c-cancel);
  font-size: 13px;
  list-style: "⚠ ";
}

.warnings-inline {
  color: var(--c-cancel);
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-bg);
}

.copy-row .small.muted {
  width: 100%;
}

/* ---------- メニュー登録 ---------- */
.square-values {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--c-info-bg);
  color: var(--c-info);
  font-size: 13px;
}

/* ---------- 管理者 ---------- */
.role {
  display: inline-block;
  margin-right: 6px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--c-primary-soft);
  color: var(--c-primary-dark);
  font-weight: 700;
}

.field > label.role-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 400;
}

.field > label.role-option:has(input:checked) {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

.role-option input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
}

.role-option > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role-desc {
  font-size: 13px;
}

.role-perms {
  color: var(--c-sub);
  font-size: 12px;
}

.temp-password {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
}

.temp-password .mono {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--c-surface);
  font-size: 22px;
  font-weight: 700;
}

/* ---------- ログイン ---------- */
.login-body {
  background: var(--c-primary);
}

.login {
  max-width: 400px;
  margin: 0 auto;
  padding: 48px 16px;
}

.login-brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #fff;
}

.login-brand .brand-logo {
  font-size: 28px;
}

.login-brand .brand-sub {
  font-size: 16px;
}

.login-card {
  padding: 24px 20px;
}

.login-card .hint {
  margin-top: 16px;
}

/* ---------- コピーしたことの表示（mng.js） ---------- */
.copied::after {
  content: " ✓";
}
