/* KDS受付システム Web版 — 画面スタイル
 *
 * ほかの KDS のアプリ（KDS Creative・入校・売上・ホテルなど）と同じ基本デザイン：
 * 紺のサイドバー、オレンジの差し色、白いカード、薄いグレーの背景。色は利用者ごとに変えず KDS の紺とオレンジで固定。
 * 受付の窓口で1日中使うので、文字は大きめ・押す場所は広め・状態（受付済み・取消など）は色と文字の両方で示す。
 * 文字の大きさは設定画面で 標準／大きめ／特大 を選べる（html の data-text-size。rem で効く）。
 */
:root {
  --ink: #17212a;
  --muted: #5f6f7b;
  --line: #dfe5e9;
  --line-strong: #c5d0d6;
  --paper: #ffffff;
  --canvas: #f4f6f7;
  --subtle: #f8fafb;
  --navy: #132330;
  --navy-2: #1f3749;
  --orange: #e96d2f;
  --orange-dark: #d45b21;
  --orange-pale: #fff1e9;
  --green: #24956a;
  --green-pale: #e8f7f1;
  --blue: #3f6fc0;
  --blue-pale: #eaf2fc;
  --red: #bf3e31;
  --red-pale: #fdecea;
  --yellow: #9a6700;
  --yellow-pale: #fff8e5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(21, 36, 48, .06);
  --shadow-float: 0 18px 50px rgba(16, 24, 40, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;

  /* 旧い名前（ログイン画面・自動ログアウトの部品が使う）。新しい色に寄せる */
  --accent: var(--orange);
  --accent-hover: var(--orange-dark);
  --accent-soft: var(--orange-pale);
  --page-bg: var(--canvas);
  --card-bg: var(--paper);
  --border: var(--line);
  --text: var(--ink);
  --text-sub: var(--muted);
  --danger: var(--red);
  --danger-soft: var(--red-pale);
  --ok: var(--green);
  --warn: #b45309;
  --cal-upcoming: #e4eefb;
  --cal-past: #fdeee4;
  --cal-import: #efe9fb;
  font-size: 15px;
}
:root[data-text-size="1"] { font-size: 16.5px; }
:root[data-text-size="2"] { font-size: 18px; }

* { box-sizing: border-box; }
html { background: var(--canvas); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); }
a { color: var(--blue); }
svg.i { width: 1.15em; height: 1.15em; flex: 0 0 auto; }
.num, td.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ログイン ----------
 * ほかの KDS のアプリ（入校・売上、ホテル、教材、Creative、グループウェア、KDSステップ）と同じ左右分割。
 * 左：紺の面にキャッチコピー、右：アプリ名と名前の一覧。色は利用者ごとのアクセントではなく KDS の紺とオレンジで固定。 */
/* 全画面のキャッチコピー（body の直下に置く写し）にも届くよう、:root に置く */
:root {
  --kds-navy: #132330;
  --kds-navy-text: #f7fafb;
  --kds-navy-muted: #aebdc6;
  --kds-orange: #e96d2f;
  --kds-orange-soft: #fff1e9;
  --kds-good: #24956a;
}
.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  align-items: stretch;
  min-height: 100vh;
  background: #fff;
}
.login-visual {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(54px, 9vw, 150px);
  overflow: hidden;
  color: var(--kds-navy-text);
  background: var(--kds-navy);
}
.login-visual-copy { position: relative; }
.login-eyebrow { margin: 0; color: #f79561; font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.login-visual-copy h2 {
  margin: 22px 0 24px;
  color: #fff;
  font-size: clamp(38px, 4.2vw, 66px);
  line-height: 1.27;
  letter-spacing: -.055em;
}
.login-visual-copy > p:not(.login-eyebrow) { margin: 0; color: var(--kds-navy-muted); font-size: 15px; line-height: 2; }
.login-pills { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 9px; }
.login-pills span {
  padding: 8px 12px;
  border: 1px solid rgba(247, 250, 251, .12);
  border-radius: 20px;
  color: #c7d1d7;
  background: rgba(247, 250, 251, .04);
  font-size: 13px;
}
.login-box {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100% - 50px));
  padding: 40px 0;
}
.login-brand {
  margin: 0 0 58px;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 40px;
  font-size: 17px;
  line-height: 1.08;
  color: var(--text);
}
.login-brand > span { display: flex; flex-direction: column; }
.login-brand small { margin-top: 7px; color: var(--text-sub); font-size: 11px; font-weight: 500; letter-spacing: .06em; }
.kds-product-mark { width: 40px; height: 40px; flex: 0 0 40px; display: block; filter: drop-shadow(0 7px 12px rgba(19, 35, 48, .2)); }
.login-heading { margin: 0 0 29px; }
.login-secure { display: flex; align-items: center; gap: 6px; color: var(--kds-good); font-size: 13px; font-weight: 700; }
.login-secure::before {
  content: "\2713";
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 1px solid currentColor; border-radius: 50%;
  font-size: 10px;
}
.login-heading h2 { margin: 13px 0 7px; font-size: 28px; line-height: 1.55; }
.login-heading p { margin: 0; color: var(--text-sub); font-size: 15px; }
.account-list { display: flex; flex-direction: column; gap: 10px; }
.account-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.account-btn:hover { border-color: var(--kds-orange); background: var(--kds-orange-soft); }
.account-btn:focus-visible { outline: none; border-color: var(--kds-orange); box-shadow: 0 0 0 3px rgba(233, 109, 47, .22); }
.account-btn .role { font-size: 0.8rem; font-weight: 500; color: var(--text-sub); }
.login-box .btn { background: var(--kds-orange); border-color: var(--kds-orange); }
.login-box .btn:hover { background: #d45b21; }
.login-box .btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.login-box .btn.secondary:hover { background: #f4f6f7; }
.login-wrap.single { grid-template-columns: minmax(0, 1fr); }
.login-wrap.single .login-box { width: min(460px, calc(100% - 40px)); }
.login-box .pw-form .field input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; }
/* 社外の入口（https://reception.kds946.com・中継経由。2026-09-27）：ログインID＋パスワード／顔・指紋・暗証番号／2段目。
 * 名前の一覧は出さない。見出しの印は「インターネットからの接続」（入校・売上などと同じ） */
.login-secure.is-internet { color: var(--kds-orange); }
.login-secure.is-internet::before { content: "\21C4"; }
.login-box .pw-form .field label { color: var(--text); font-size: 14px; margin-bottom: 8px; }
.login-box .pw-form .field input:focus { outline: none; border-color: var(--kds-orange); box-shadow: 0 0 0 3px rgba(233, 109, 47, .22); }
.login-box .btn.login-submit { width: 100%; height: 48px; margin-top: 4px; border-radius: 10px; font-size: 1rem; font-weight: 700; }
.login-box .btn.login-passkey { width: 100%; height: 46px; margin-top: 12px; border-radius: 10px; font-weight: 600; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 2px; color: var(--text-sub); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.login-step { display: flex; flex-direction: column; }
.login-step .pw-msg { margin: 0 0 12px; }
.outside-badge {
  padding: 3px 10px; border: 1px solid var(--kds-orange); border-radius: 999px;
  color: #b4461a; background: var(--kds-orange-soft); font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.field .check-label { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--text); font-size: 0.95rem; cursor: pointer; }
.field .check-label input { width: auto; margin: 0; }

@media (max-width: 820px) {
  .login-wrap { display: flex; padding: 35px 25px; }
  .login-visual:not(.lv-splash) { display: none; }
  .login-box { width: min(420px, 100%); margin: auto; padding: 0; }
}
@media (max-width: 520px) {
  .login-wrap { padding: 30px 22px; }
  .login-brand { margin-bottom: 44px; font-size: 16px; }
  .login-heading h2 { font-size: 24px; }
}

/* ログインのキャッチコピー（開くたびに全画面で流してからログイン画面。app.js の playLoginSplash が写しを作る）。
 * 流れ方は入校・売上と同じ：小見出し → 見出しが1行ずつせり上がる → 「笑顔で迎える。」に下線と光 → 説明 → タグ → 約3秒で消える。
 * 画面の中の左の面は止まった完成形で出す（同じ動きを二度見せない）。 */
.lv-line { display: block; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.lv-line > span { display: inline-block; }
.lv-accent { position: relative; }
.lv-accent::after {
  content: "";
  position: absolute;
  left: .02em; right: .5em; bottom: .02em;
  height: .08em;
  border-radius: 2px;
  background: #f79561;
}
.login-visual.lv-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px clamp(28px, 9vw, 150px);
  cursor: pointer;
  animation: lv-leave .5s ease 3.1s forwards;
}
.login-visual.lv-splash.lv-leave-now { animation: lv-leave-now .35s ease forwards; }
.lv-splash .login-visual-copy { width: min(760px, 100%); }
.lv-splash .login-visual-copy h2 { font-size: clamp(32px, 9vw, 72px); }
.lv-splash .lv-line > span { transform: translateY(110%); animation: lv-rise .95s cubic-bezier(.2, .8, .2, 1) .25s forwards; }
.lv-splash .lv-line > span.lv-accent {
  background: linear-gradient(100deg, #fff 38%, #ffc2a1 46%, #f79561 50%, #ffc2a1 54%, #fff 62%) 100% 0 / 260% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: lv-rise .95s cubic-bezier(.2, .8, .2, 1) .43s forwards, lv-shine 1.3s ease-in-out 1.75s forwards;
}
.lv-splash .lv-accent::after { transform: scaleX(0); transform-origin: left center; animation: lv-draw .75s cubic-bezier(.65, 0, .25, 1) 1.2s forwards; }
.lv-splash .login-eyebrow { animation: lv-fade .7s ease .05s both; }
.lv-splash .login-visual-copy > p:not(.login-eyebrow) { animation: lv-fade .8s ease 1.0s both; }
.lv-splash .login-pills span { animation: lv-fade .6s ease both; }
.lv-splash .login-pills span:nth-child(1) { animation-delay: 1.25s; }
.lv-splash .login-pills span:nth-child(2) { animation-delay: 1.35s; }
.lv-splash .login-pills span:nth-child(3) { animation-delay: 1.45s; }
.lv-splash .login-pills span:nth-child(4) { animation-delay: 1.55s; }
@keyframes lv-rise { to { transform: translateY(0); } }
@keyframes lv-draw { to { transform: scaleX(1); } }
@keyframes lv-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes lv-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes lv-leave { to { opacity: 0; visibility: hidden; } }
@keyframes lv-leave-now { to { opacity: 0; visibility: hidden; } }


/* ================================================================
 * ログイン後の画面
 * ================================================================ */

/* ---- 骨組み：紺のサイドバー＋主列 ---- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--navy); color: #fff;
}
.sidebar-head { padding: 22px 20px 18px; display: flex; align-items: center; gap: 12px; }
.sidebar-head img { width: 38px; height: 38px; flex: 0 0 38px; display: block; }
.sidebar-head .brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sidebar-head .brand strong { font-size: 1rem; letter-spacing: .02em; }
.sidebar-head .brand small { margin-top: 5px; color: #7f919f; font-size: .72rem; letter-spacing: .02em; }
.primary-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-group { margin-bottom: 16px; }
.nav-group > p { margin: 0 12px 6px; color: #7f919f; font-size: .68rem; font-weight: 700; letter-spacing: .14em; }
.nav-link {
  width: 100%; min-height: 42px; margin: 2px 0; padding: 0 12px;
  display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 10px; background: transparent;
  color: #c3ccd3; font-size: .9rem; font-weight: 500; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-link:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.nav-link.active { color: #fff; font-weight: 700; background: linear-gradient(90deg, rgba(233, 109, 47, .24), rgba(233, 109, 47, .07)); box-shadow: inset 3px 0 var(--orange); }
.nav-link.active svg { color: var(--orange); }
.nav-link .nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 7px; background: var(--orange); color: #fff; font-size: .72rem; font-weight: 700; }
.sidebar-foot { padding: 10px 12px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.account-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 8px 8px 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #d7e2e7; color: var(--navy); font-weight: 700; font-size: .9rem; }
.account-row strong { display: block; font-size: .85rem; line-height: 1.3; }
.account-row small { display: block; margin-top: 2px; color: #8fa0ad; font-size: .72rem; }
.side-button {
  width: 100%; min-height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 9px;
  border: 0; border-radius: 8px; background: transparent; color: #a9b6bf; font-size: .8rem; cursor: pointer;
}
.side-button:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.main-column { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 62px; padding: 0 28px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
  border-bottom: 1px solid #e5e9ec;
}
.topbar .crumb { color: var(--muted); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.topbar .crumb b { color: var(--ink); }
.quick-search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.quick-search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--subtle);
}
.quick-search input:focus { outline: none; background: #fff; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(233, 109, 47, .14); }
.quick-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.quick-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: .72rem; background: #fff; }
.topbar .menu-button { display: none; }
.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 26px 30px 60px; }

/* ---- 画面の見出し ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .eyebrow { margin: 0; color: var(--orange); font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
.page-head h1 { margin: 4px 0 4px; font-size: 1.65rem; line-height: 1.3; letter-spacing: -.01em; }
.page-head p.desc { margin: 0; color: var(--muted); font-size: .9rem; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- カード ---- */
.card {
  background: var(--paper);
  border: 1px solid #e1e7ea;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card > h2, .card-head h2 { margin: 0 0 12px; font-size: 1.05rem; line-height: 1.4; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: .85rem; font-weight: 500; margin-left: 8px; }
.card .hint, .hint { color: var(--muted); font-size: .86rem; margin: 4px 0 10px; }
.card.tight { padding: 14px 16px; }
.card.flat { box-shadow: none; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 700; vertical-align: 1px; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--orange);
  background: var(--orange); color: #fff;
  font-size: .92rem; font-weight: 700; line-height: 1.2; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(233, 109, 47, .16);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(233, 109, 47, .3); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--subtle); border-color: #aebbc3; }
.btn.secondary.on { background: var(--orange-pale); color: var(--orange-dark); border-color: var(--orange); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: #eef1f3; color: var(--ink); }
.btn.danger { background: #fff; color: var(--red); border-color: #e3b7b1; box-shadow: none; }
.btn.danger:hover { background: var(--red-pale); border-color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.success { background: var(--green); border-color: var(--green); box-shadow: 0 6px 16px rgba(36, 149, 106, .16); }
.btn.success:hover { background: #1d7d59; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: .82rem; border-radius: 8px; }
.btn.large { min-height: 50px; padding: 0 24px; font-size: 1.02rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
/* 切り替え（どれか1つを選ぶ） */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: #eaeef1; flex-wrap: wrap; }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: .88rem; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* ---- 入力 ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: #40515d; margin-bottom: 5px; }
.field label .req { color: var(--red); margin-left: 4px; }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid #d3dce1; border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 80px; line-height: 1.6; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: #e38758; box-shadow: 0 0 0 3px rgba(233, 109, 47, .12);
}
.field input[type="checkbox"], .field input[type="radio"] { width: auto; min-height: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--orange); }
.field .note { font-size: .8rem; color: var(--muted); margin-top: 4px; min-height: 1.1em; }
.field .note.msg-ok { color: var(--green); }
.field .note.msg-err { color: var(--red); }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.inline-fields { display: flex; gap: 8px; align-items: center; }
.inline-fields > * { flex: 1; }
.inline-fields > .narrow { flex: 0 0 110px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: .92rem; }

/* ---- 表 ---- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.table-wrap.tall { max-height: 62vh; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid #edf0f2; }
table.data th {
  position: sticky; top: 0; z-index: 1;
  background: var(--subtle); color: #53636f; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbf6f2; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.is-selected { background: var(--orange-pale); }
table.data tbody tr.is-muted td { color: #98a4ad; }
table.data tbody tr.is-muted td.name { text-decoration: line-through; }
table.data td.wrap { white-space: normal; min-width: 140px; }
table.data td.wrap:empty { min-width: 0; }
table.data td.num, table.data th.num { text-align: right; }
table.data td.actions { text-align: right; }
table.data td.actions .btn + .btn { margin-left: 6px; }
table.data td.name { font-weight: 700; }
table.data td.name small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }

/* ---- 状態の札 ---- */
.badge, .status-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: #eef1f3; color: #53636f; font-size: .76rem; font-weight: 700; white-space: nowrap;
}
.badge.green, .status-受講済み { background: var(--green-pale); color: #1f7a57; }
.badge.blue, .status-予約中 { background: var(--blue-pale); color: #355d91; }
.badge.red, .status-取消 { background: var(--red-pale); color: #a3372c; }
.badge.yellow, .status-日程変更 { background: var(--yellow-pale); color: var(--yellow); }
.badge.orange { background: var(--orange-pale); color: #b4461a; }
.badge.navy { background: var(--navy); color: #fff; }

/* ---- 知らせ（画面の中） ---- */
.notice { padding: 11px 14px; border-radius: 10px; font-size: .88rem; font-weight: 600; margin: 8px 0; border: 1px solid; }
.notice.ok { color: #1f7a57; background: #f2faf6; border-color: #cfe8dc; }
.notice.error { color: #923f36; background: #fff5f4; border-color: #efcec9; }
.notice.warn { color: #7c4a09; background: var(--yellow-pale); border-color: #f0dca8; }
.notice.info { color: #355d91; background: #f3f7fd; border-color: #d5e2f5; }
.msg-ok { color: var(--green); font-weight: 600; }
.msg-err { color: var(--red); font-weight: 600; }
.placeholder-note { color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.empty strong { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }

/* ---- 数字のまとめ ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  display: block; width: 100%; text-align: left;
  background: #fff; border: 1px solid #e1e7ea; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; color: var(--ink); font: inherit;
}
button.stat { cursor: pointer; transition: border-color .15s, transform .15s; }
button.stat:hover { border-color: var(--orange); transform: translateY(-1px); }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 700; }
.stat .value { font-size: 1.7rem; font-weight: 800; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.stat.alert .value { color: var(--orange-dark); }

/* ---- 並べ方 ---- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 18px; align-items: start; }
.two-col { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.two-col > .col { flex: 1; min-width: 320px; }
.sticky-side { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; }

/* ---- ホーム ---- */
.slot-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.slot-card-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--subtle); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.slot-card-head .time { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.slot-card-head .course { font-weight: 700; }
.slot-card-head .count { margin-left: auto; color: var(--muted); font-size: .85rem; font-weight: 600; }
.progress { height: 6px; border-radius: 3px; background: #e7ecef; overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.checkin-list { list-style: none; margin: 0; padding: 4px 0; }
.checkin-list li { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid #f0f3f5; }
.checkin-list li:last-child { border-bottom: 0; }
.checkin-list .who { flex: 1; min-width: 0; }
.checkin-list .who strong { display: block; }
.checkin-list .who small { color: var(--muted); font-size: .8rem; }
.checkin-list li.done .who strong { color: var(--green); }
.check-button {
  min-width: 108px; min-height: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px dashed #b9c5cc; background: #fff; color: var(--muted);
  font-weight: 700; font-size: .85rem; cursor: pointer;
}
.check-button:hover { border-color: var(--green); color: var(--green); }
.check-button.done { border: 1px solid var(--green); background: var(--green); color: #fff; }
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid #edf0f2; cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font: inherit; color: inherit; }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: #fafbfb; }
.list-row .main { flex: 1; min-width: 0; }
.list-row .main strong { display: block; font-size: .92rem; }
.list-row .main small { color: var(--muted); font-size: .8rem; }
.date-chip { flex: 0 0 auto; width: 52px; text-align: center; border-radius: 10px; background: var(--subtle); border: 1px solid var(--line); padding: 4px 0; line-height: 1.15; }
.date-chip b { display: block; font-size: 1.05rem; }
.date-chip small { font-size: .7rem; color: var(--muted); }
.date-chip.sun b { color: var(--red); } .date-chip.sat b { color: var(--blue); }

/* ---- カレンダー ---- */
.calendar { width: 100%; }
.calendar .cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.calendar .cal-title { font-weight: 800; font-size: 1.02rem; }
.calendar table { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
.calendar th { font-size: .75rem; color: var(--muted); padding: 2px; font-weight: 700; }
.calendar th:first-child { color: var(--red); } .calendar th:last-child { color: var(--blue); }
.calendar td { padding: 0; text-align: center; }
.calendar td button {
  position: relative; width: 100%; height: 44px; border: 1px solid transparent; border-radius: 10px;
  background: #fff; font-size: .92rem; font-weight: 600; color: var(--ink); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.calendar td button:hover { border-color: var(--orange); }
.calendar td.empty { background: transparent; }
.calendar td.has-upcoming button { background: var(--cal-upcoming); color: #274b7d; }
.calendar td.has-past button { background: var(--cal-past); color: #8a4a1f; }
.calendar td.has-import button { background: var(--cal-import); color: #5a3f95; }
.calendar td.has-upcoming button::after, .calendar td.has-past button::after, .calendar td.has-import button::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: currentColor; opacity: .6;
}
.calendar td.selected button { background: var(--orange); color: #fff; border-color: var(--orange); }
.calendar td.today button { border-color: var(--navy); }
.cal-legend { display: flex; gap: 14px; margin-top: 8px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.cal-legend .chip { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; }

/* ---- 予約枠の選択肢 ---- */
.slot-options { display: flex; flex-direction: column; gap: 8px; }
.slot-option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.slot-option:hover { border-color: var(--orange); }
.slot-option.on { border-color: var(--orange); background: var(--orange-pale); box-shadow: inset 3px 0 var(--orange); }
.slot-option .time { font-weight: 800; font-variant-numeric: tabular-nums; }
.slot-option .meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---- 候補（入力しながら既存の受講者を出す） ---- */
.suggest { position: relative; }
.suggest-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-float);
  max-height: 320px; overflow: auto; padding: 4px;
}
.suggest-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.suggest-item:hover, .suggest-item.active { background: var(--orange-pale); }
.suggest-item .main { flex: 1; min-width: 0; }
.suggest-item .main strong { display: block; }
.suggest-item .main small { color: var(--muted); font-size: .78rem; }
.picked-person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #cfe8dc; border-radius: 12px; background: #f2faf6; }
.picked-person .main { flex: 1; }
.picked-person strong { display: block; }
.picked-person small { color: var(--muted); }

/* ---- タブ（画面の中） ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  padding: 10px 16px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: .92rem;
  border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--orange); }

/* ---- 小窓 ---- */
dialog {
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-float);
  padding: 24px 26px;
  max-width: 760px;
  width: min(760px, 94vw);
  max-height: 90vh;
  color: var(--ink);
}
dialog.wide { max-width: 980px; width: min(980px, 96vw); }
dialog.narrow { max-width: 460px; width: min(460px, 94vw); }
dialog::backdrop { background: rgba(19, 35, 48, .45); }
dialog h3 { margin: 0 0 14px; font-size: 1.15rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.dialog-actions .left { margin-right: auto; }
.ask-message { margin: 0; white-space: pre-wrap; line-height: 1.8; }

/* ---- 画面の隅に出る知らせ ---- */
.toast-area { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: min(440px, 92vw);
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-float);
  font-size: .9rem; font-weight: 600; line-height: 1.6;
  animation: toast-in .2s ease;
}
.toast.ok { background: #1d6f50; }
.toast.error { background: #a3372c; }
.toast a { color: #fff; }
.toast .close { margin-left: 6px; border: 0; background: none; color: rgba(255, 255, 255, .7); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- 読み込み中 ---- */
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---- 狭い画面（iPad 縦・スマホ）：サイドバーは引き出し式 ---- */
@media (max-width: 1080px) {
  .grid-side, .grid-main-side, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-float); }
  .app.nav-open .sidebar { transform: none; }
  .scrim { display: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(19, 35, 48, .4); }
  .main-column { margin-left: 0; }
  .topbar .menu-button { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .topbar .crumb { display: none; }
  .quick-search kbd { display: none; }
  .content { padding: 18px 14px 40px; }
  .page-head h1 { font-size: 1.35rem; }
  .form-grid .span2 { grid-column: auto; }
}

/* ---- 印刷（参加者一覧など）：画面の飾りを外す ---- */
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .no-print, .toast-area, .btn, .seg, .tabs { display: none !important; }
  .main-column { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block; }
  table.data th { position: static; }
  .table-wrap { border: 0; overflow: visible; max-height: none; }
  body { background: #fff; }
}

/* ---------- パスワード入力（共通ログイン） ---------- */
.pw-field { position: relative; }
.pw-field input { padding-right: 42px !important; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 6px;
  color: var(--text-sub); cursor: pointer;
}
.pw-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.pw-dialog { width: min(400px, 92vw); }
.pw-dialog .field input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 7px; }
.pw-note { color: var(--text-sub); font-size: 0.85rem; margin: 8px 0 0; }
.pw-note:empty, .pw-msg:empty { display: none; }
.pw-msg { margin: 10px 0 0; font-size: 0.9rem; }
.pw-note.enroll-note { margin: 0 0 14px; line-height: 1.7; }
.pw-form { display: flex; flex-direction: column; gap: 12px; }
.pw-actions { margin-top: 4px; gap: 10px; }

/* ---------- 自動ログアウト（窓口の共用PCで1日中開いているため、知らせは遠くからでも分かる大きさ） ---------- */
.login-notice {
  margin: -12px 0 18px;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  color: #7c2d12;
  font-weight: 700;
}
dialog.session-warn {
  width: min(620px, 94vw);
  max-width: 94vw;
  padding: 40px 44px 36px;
  text-align: center;
  border: 4px solid var(--warn);
  border-radius: 16px;
}
dialog.session-warn::backdrop { background: rgba(20, 25, 40, 0.62); }
.session-warn-title { margin: 0; font-size: 2.2rem; font-weight: 800; line-height: 1.3; color: var(--text); }
.session-warn-reason { margin: 6px 0 14px; font-size: 1.3rem; font-weight: 700; color: var(--warn); }
.session-warn-count {
  margin: 0 0 10px;
  font-size: 3.4rem; font-weight: 800; line-height: 1.2;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
}
.session-warn-note { margin: 0 0 22px; color: var(--text-sub); font-size: 1rem; }
.btn.session-warn-btn { font-size: 1.5rem; font-weight: 700; padding: 16px 64px; border-radius: 12px; }
.draft-dialog { width: min(560px, 92vw); }
.draft-dialog .hint { color: var(--text-sub); font-size: 0.9rem; margin: 0 0 12px; }
.draft-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow: auto; }
.draft-list textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: #f8f9fc; resize: vertical; }
