@charset "UTF-8";
/* ============================================================
   abic Shift 2 — スタイルシート
   外部フォントも CDN も読み込まない。このファイル1枚で完結する。
   ============================================================ */

:root {
  /* 面と文字 */
  --ground:      #f6f7f8;
  --surface:     #ffffff;
  --surface-2:   #f1f3f5;
  --ink:         #1a1e22;
  --ink-2:       #3f474e;
  --muted:       #6b767e;
  --line:        #dde1e6;
  --line-strong: #c5ccd3;

  /* ============================================================
     主色。ここの4つを変えれば、全画面の色が一度に変わります。
     ロゴが白い線画なので、--header は必ず濃い色にしてください。
     ============================================================ */
  --accent:      #1d5b8f;   /* ボタン・強調 */
  --accent-dark: #164771;   /* リンク文字・押したとき */
  --accent-soft: #e3edf6;   /* 選択中の背景・淡い面 */
  --header:      #262b30;   /* ヘッダーの帯（ロゴが載るので濃いめに） */

  /* 意味のある色 */
  --danger:      #a3382a;
  --danger-soft: #fae9e5;
  --warn:        #8a5a08;
  --warn-soft:   #fbf0da;
  --ok:          #16704f;
  --ok-soft:     #e2f1e9;

  --radius:      4px;
  --shadow-sm:   0 1px 2px rgba(26,30,34,.06);
  --shadow:      0 1px 3px rgba(26,30,34,.08), 0 8px 24px -18px rgba(26,30,34,.4);

  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic",
          "Noto Sans JP", "Meiryo", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- ヘッダー ---------- */
.topbar {
  background: var(--header);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 54px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: #fff; opacity: .88; }
/* ロゴは白い線画なので、濃い帯の上にそのまま置く */
.brand-mark { display: block; width: 30px; height: 30px; flex: none; }
.nav {
  display: flex;
  gap: 2px;
  flex: 1;
}
.nav a {
  padding: 6px 13px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: .94rem;
  white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.on {
  background: #fff;
  color: var(--accent-dark);
  font-weight: 700;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.who { display: flex; flex-direction: column; line-height: 1.35; text-align: right; }
.who-name { font-size: .9rem; font-weight: 700; color: #fff; }
.who-role { font-size: .74rem; color: rgba(255,255,255,.7); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px; height: 34px;
  padding: 0 7px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle { border-color: rgba(255,255,255,.4); }
.nav-toggle span { display: block; height: 2px; background: #fff; border-radius: 1px; }

/* ---------- 本文 ---------- */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.main-bare {
  max-width: 400px;
  margin: 0 auto;
  padding: 8vh 20px 60px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 {
  font-size: 1.4rem;
  margin: 0;
  line-height: 1.35;
}
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.crumb { margin: 0 0 2px; font-size: .8rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card-narrow { max-width: 520px; }
.card-title {
  font-size: .96rem;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

/* ---------- フラッシュメッセージ ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash {
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .92rem;
}
.flash-success { background: var(--ok-soft);     border-color: #b8dcc9; color: #12503a; }
.flash-error   { background: var(--danger-soft); border-color: #eec4bb; color: #7f2b20; }
.flash-info    { background: var(--accent-soft); border-color: #bcd4e8; color: var(--accent-dark); }
.flash-code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 2px 10px;
  margin-left: 6px;
  user-select: all;
}

.notice {
  background: var(--warn-soft);
  border: 1px solid #e6d3a8;
  color: var(--warn);
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 16px;
}

/* ---------- フォーム ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset[disabled] { opacity: .78; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px 22px;
}

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.field-indent { margin-left: 26px; margin-top: 2px; }
.field label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-2);
}
.req {
  font-size: .68rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 2px;
  padding: 0 5px;
  margin-left: 5px;
  vertical-align: 1px;
}

input[type="text"], input[type="password"], input[type="search"],
input[type="date"], input[type="time"], input[type="number"], select {
  font: inherit;
  font-size: .94rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 7px 10px;
  width: 100%;
  min-width: 0;
}
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7a72' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 9px;
  padding-right: 28px;
}

.num-input { width: 68px; text-align: right; }

.hint { font-size: .78rem; color: var(--muted); margin: 2px 0 0; line-height: 1.55; }
.hint-inline { font-size: .72rem; color: var(--muted); margin-left: 4px; }

.check { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer; font-size: .92rem; }
.check input { margin-top: 5px; flex: none; }
.check-inline { display: inline-flex; padding: 0; }

.inline-times { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.inline-times input { width: auto; }
.tilde { color: var(--muted); }
.is-hidden { display: none; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
/* 保存ボタンの行。画面に固定はしない。
   固定すると、曜日別の入力表をスクロールしている最中に
   最終行がボタンの下に隠れてしまうため。 */
.actions-sticky {
  padding: 4px 0 8px;
  margin-top: 4px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.field-inline { margin: 0; min-width: 130px; }
.field-inline label { font-size: .76rem; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-sm { font-size: .82rem; padding: 6px 11px; }
.btn-block { width: 100%; padding: 11px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-quiet {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { background: var(--surface); border-color: #e0b4ab; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

.inline { display: inline; }

/* ヘッダーの中のボタンは、濃い帯に合わせて白抜きにする */
.topbar .btn-quiet {
  background: transparent;
  border-color: rgba(255,255,255,.42);
  color: #fff;
}
.topbar .btn-quiet:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- 表 ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.table th, .table td {
  padding: 9px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.table thead th {
  background: var(--surface-2);
  font-size: .76rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .03em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table tbody tr:last-child td { border-bottom: none; }
/* 仮パスワードのまま使う導線 */
.keep-form { margin-top: 14px; text-align: center; }
.hint-tight { margin-top: 6px; font-size: .74rem; line-height: 1.6; }

/* 休暇登録の確認（すでに休みが多い日） */
.notice-sub { display: block; margin-top: 4px; font-size: .78rem; opacity: .85; }

.crowd-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.crowd-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.crowd-date  { font-weight: 700; }
.crowd-count { font-size: .82rem; color: var(--danger); }
.crowd-list  { list-style: none; margin: 0; padding: 0; }
.crowd-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
}
.crowd-list li:last-child { border-bottom: 0; }
.crowd-store { min-width: 9em; color: var(--muted); font-size: .8rem; }
.crowd-name  { font-weight: 700; }
.crowd-type  { margin-left: auto; color: var(--muted); font-size: .78rem; }

.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }

@media (max-width: 780px) {
  .crowd-list li { flex-wrap: wrap; gap: 4px 8px; }
  .crowd-store { min-width: 0; }
  .crowd-type { margin-left: 0; }
}

/* シフトパターンの「後半」行（1日を分割するときだけ使う） */
.wd-split td { background: var(--surface-2); }
.wd-split.is-empty td { opacity: .72; }
.wd-split-label {
  font-size: .74rem; color: var(--muted); font-weight: 700;
  white-space: nowrap;
}

/* 集計期間の切り替え（休暇・支援実績で共通） */
.period {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin-bottom: 14px; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.period-months { display: flex; gap: 6px; }
.period-range  { display: flex; align-items: center; gap: 7px; }
.period-range label { font-size: .78rem; color: var(--muted); font-weight: 700; }
.period-range input[type="date"] { width: auto; }
.period-tilde { color: var(--muted); }
.period-presets { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.period-label { font-size: .74rem; color: var(--muted); }
.period-presets a { font-size: .78rem; color: var(--accent-dark); }

@media (max-width: 780px) {
  .period { flex-direction: column; align-items: stretch; }
  .period-presets { margin-left: 0; flex-wrap: wrap; }
}

/* 並べ替えできる見出し */
.th-sort { padding: 0; }
.th-sort a {
  display: block; padding: 9px 13px;
  color: inherit; text-decoration: none; white-space: nowrap;
}
.th-sort a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.th-sort.is-on a { color: var(--accent-dark); }
.th-mark { font-size: .66rem; margin-left: 3px; }

.table tbody tr:hover { background: #fafbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-muted { color: var(--muted); background: var(--surface-2); }
.row-actions { text-align: right; width: 1%; }

.table-form td { padding: 6px 10px; }
.table-form input { margin: 0; }
.wd-head { background: var(--surface-2); font-weight: 700; text-align: center !important; width: 44px; }
.wd-weekend { color: var(--accent-dark); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
.result-count { font-size: .84rem; color: var(--muted); margin: 0 0 8px; }

/* 曜日の営業状況 */
.weekbar { display: inline-flex; gap: 2px; }
.wd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  font-size: .7rem;
  border-radius: 2px;
  font-weight: 700;
}
.wd-on  { background: var(--accent-soft); color: var(--accent-dark); }
.wd-off { background: var(--surface-2);   color: #b3bac1; }

/* ---------- バッジ ---------- */
.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.7;
  padding: 0 7px;
  border-radius: 2px;
  vertical-align: 1px;
  margin-left: 4px;
}
.badge-accent  { background: var(--accent-soft); color: var(--accent-dark); }
.badge-muted   { background: var(--surface-2);   color: var(--muted); }
.badge-warn    { background: var(--warn-soft);   color: var(--warn); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-2);   color: var(--ink-2); }

/* ---------- ホームのタイル ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
/* 2枚だけのときに横いっぱいへ伸びないようにする */
.tiles-2 { max-width: 460px; }
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
a.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile-static { cursor: default; }
.tile-label { font-size: .78rem; color: var(--muted); }
.tile-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--accent-dark);
}
.tile-unit { font-size: .76rem; color: var(--muted); }

/* ---------- ホーム：今日と明日の不足 ---------- */
.hs-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.home-shortage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 720px) {
  .home-shortage { grid-template-columns: 1fr; }
}
.hs-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.hs-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.hs-label { font-weight: 700; font-size: .95rem; }
.hs-date  { font-size: .82rem; color: var(--muted); }
.hs-holiday {
  font-size: .72rem;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 2px;
  padding: 1px 6px;
}
.hs-ok, .hs-none {
  margin: 10px 0 2px;
  font-size: .86rem;
  color: var(--muted);
}
.hs-ok { color: var(--ok); }
.hs-list { list-style: none; margin: 8px 0 0; padding: 0; }
.hs-list li { border-bottom: 1px solid var(--line); }
.hs-list li:last-child { border-bottom: none; }
.hs-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 2px;
  text-decoration: none;
  color: var(--ink);
}
.hs-list a:hover { background: var(--surface-2); }
.hs-store { flex: 1 1 auto; font-size: .88rem; }
.hs-need {
  font-size: .74rem;
  font-weight: 700;
  border-radius: 2px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.hs-ph { background: #e8f6fc; color: #0f6a8c; }   /* 薬剤師 … 水色 */
.hs-cl { background: #f0f7e2; color: #4d6b13; }   /* 事務 … 黄緑 */

/* ---------- 空状態 / エラー ---------- */
.empty, .error-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}
.error-code {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--line-strong);
  line-height: 1.2;
}
.error-message { color: var(--ink-2); max-width: 46ch; margin: 8px auto 20px; }

/* ---------- ログイン ---------- */
body.bare { background: var(--ground); }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: var(--shadow);
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
}
.auth-logo img { display: block; width: 130px; height: auto; }
.auth-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: .08em;
  text-align: center;
  margin-bottom: 6px;
}
.auth-lead { color: var(--muted); font-size: .88rem; text-align: center; margin: 0 0 22px; }
.auth-note { color: var(--muted); font-size: .78rem; margin: 20px 0 0; line-height: 1.6; }

/* 誰でログインしているか。強制パスワード変更の画面はヘッダーが出ないため */
.auth-who {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
  margin: 0 0 14px; padding: 9px 11px;
  background: var(--accent-soft);
  border-radius: var(--radius);
}
.auth-who-no   { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
                 font-size: .78rem; color: var(--accent-dark); }
.auth-who-name { font-weight: 700; color: var(--ink); }
.auth-who-role { font-size: .74rem; color: var(--muted); margin-left: auto; }

/* ボタンをリンクのように見せる（ログアウトは POST のため button になる） */
.linklike {
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--accent-dark);
  text-decoration: underline; cursor: pointer;
}
.linklike:hover { color: var(--accent); }

/* ---------- 画面が狭いとき ---------- */
@media (max-width: 780px) {
  body { font-size: 14px; }
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    top: 54px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--header);
    padding: 6px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 14px; }
  .topbar-inner { gap: 12px; position: relative; }
  .who-role { display: none; }
  .main { padding: 16px 12px 60px; }
  .card { padding: 16px 14px; }
  .page-head h1 { font-size: 1.2rem; }
  .table th, .table td { padding: 8px 10px; }
}

/* ---------- 開発中だけ出る計測バー ---------- */
.devbar {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.6;
  padding: 5px 11px;
  border-radius: var(--radius);
  opacity: .82;
  pointer-events: none;
}
.devbar strong { color: #8ec8f0; font-weight: 700; }
.devbar-note { color: #9aa4ac; margin-left: 8px; }

@media print {
  .topbar, .actions, .filters, .row-actions, .btn, .devbar { display: none !important; }
  body { background: #fff; }
  .card, .table-wrap { border: none; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   シフト表
   ============================================================ */

/* ---------- 週表示のマトリクス ---------- */
.grid { table-layout: fixed; min-width: 900px; }
.grid th, .grid td { white-space: normal; vertical-align: top; }

.grid-store {
  width: 132px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  border-right: 1px solid var(--line);
  text-align: left !important;
  font-size: .82rem;
  line-height: 1.5;
}
thead .grid-store { background: var(--surface-2); z-index: 3; }
.grid-storename { display: block; font-weight: 700; color: var(--ink); }
.grid-storearea { display: block; font-size: .7rem; color: var(--muted); font-weight: 400; }

.grid-day { width: auto; text-align: center !important; padding: 6px 4px !important; }
.grid-daylink { text-decoration: none; display: block; }
.grid-date { display: block; font-size: .82rem; font-weight: 700; color: var(--ink); }
.grid-wd   { display: block; font-size: .68rem; color: var(--muted); }
.grid-day.is-weekend .grid-wd { color: var(--accent-dark); }
.grid-day.is-holiday { background: var(--warn-soft); }
.grid-day.is-holiday .grid-wd { color: var(--warn); }
.grid-day.is-today { box-shadow: inset 0 -3px 0 var(--accent); }
.grid-holiday {
  display: block; font-size: .62rem; color: var(--warn);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.grid-cell { padding: 5px 5px 6px !important; min-height: 60px; }
.grid-cell.is-closed { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, #eaedf0 6px, #eaedf0 12px); }
.grid-cell.is-short  { background: #fdf6f4; }
.cell-closed { font-size: .7rem; color: var(--muted); }

.cell-need { display: flex; gap: 4px; margin-bottom: 4px; }
.need {
  font-size: .66rem; font-family: var(--mono); line-height: 1.7;
  padding: 0 4px; border-radius: 2px;
  background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.need-short { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.need strong { margin-left: 3px; }

.chip {
  display: block;
  font-size: .72rem;
  line-height: 1.35;
  padding: 3px 5px;
  margin-bottom: 3px;
  border-radius: 2px;
  border-left: 4px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}
/* ホバーで背景色を変えると職種の色と紛らわしいので、枠で示す */
.chip:hover { outline: 1px solid var(--line-strong); outline-offset: -1px; color: var(--accent-dark); }
.chip-name { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-time { display: block; font-family: var(--mono); font-size: .64rem; color: var(--muted); }

/* 職種の色分け。棒だけでなく面にも淡く敷いて、ひと目で分かるようにする。
   管理栄養士は人数計算では事務に合算されるが、表示は別の色にしている。 */
.chip-pharmacist   { border-left-color: #3fb3dd; background: #e8f6fc; }   /* 薬剤師 … 水色 */
.chip-clerk        { border-left-color: #94c53c; background: #f0f7e2; }   /* 事務 … 黄緑 */
.chip-nutritionist { border-left-color: #f0a13c; background: #fdf0de; }   /* 管理栄養士 … 薄橙 */
/* 支援は紫。棒の色は職種のまま残すので、面の色で「支援」だと分かる。
   管理栄養士の薄橙と近くならないよう、暖色は避けている。 */
.chip-help       { border-left-style: dashed; background: #eee1fa; }
.chip-help .chip-time { color: #6b3fa0; }

.cell-add {
  display: block; font-size: .68rem; color: var(--muted);
  text-decoration: none; padding: 2px 0; margin-top: 2px;
}
.cell-add:hover { color: var(--accent); }

.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -8px 0 16px; font-size: .82rem;
}
.bulk-label { color: var(--muted); }

.linkbtn {
  background: none; border: none; padding: 0; margin-left: 4px;
  font: inherit; font-size: .7rem; color: var(--accent-dark);
  text-decoration: underline; cursor: pointer;
}
.linkbtn:hover { color: var(--accent); }

.filters-spacer { flex: 1; }

/* 絞り込みで何を隠しているかの一言 */
.filter-note {
  margin: -4px 0 14px;
  font-size: .84rem;
  color: var(--muted);
}
.text-danger { color: var(--danger); }

/* ---------- 日別調整 ---------- */
.daylist { display: flex; flex-direction: column; gap: 12px; }
.daycard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.daycard.is-short  { border-left-color: var(--danger); }
.daycard.is-closed { opacity: .68; }
.daycard-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
}
.daycard-head h2 { font-size: 1rem; margin: 0; }
.daycard-sub { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.daycard-need { display: flex; gap: 8px; }
.daycard-need .need { font-size: .78rem; padding: 3px 9px; font-family: var(--font); }
.daycard-empty { font-size: .86rem; margin: 0 0 8px; }

/* ---------- 月表示 ---------- */
.monthgrid { table-layout: fixed; min-width: 1240px; font-size: .8rem; }
.monthgrid th, .monthgrid td { padding: 3px 2px !important; text-align: center; }
.mg-name {
  width: 116px; position: sticky; left: 0; z-index: 2;
  background: var(--surface); text-align: left !important;
  border-right: 1px solid var(--line);
}
thead .mg-name { background: var(--surface-2); z-index: 3; }
.mg-staffname { display: block; font-weight: 700; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-job { display: block; font-size: .66rem; color: var(--muted); font-weight: 400; }
.mg-day { width: 36px; }
.mg-date { display: block; font-size: .74rem; font-weight: 700; }
.mg-wd   { display: block; font-size: .62rem; color: var(--muted); font-weight: 400; }
.mg-day.is-weekend, .mg-cell.is-weekend { background: var(--surface-2); }
.mg-day.is-holiday, .mg-cell.is-holiday { background: var(--warn-soft); }
.mg-day.is-today { box-shadow: inset 0 -3px 0 var(--accent); }
.mg-cell { height: 34px; }
.mg-shift {
  display: block; font-family: var(--mono); font-size: .56rem; line-height: 1.35;
  color: var(--ink); text-decoration: none;
  background: var(--accent-soft); border-radius: 2px; padding: 2px 0;
}
/* 開始時刻と終了時刻を縦に積む。inline のままだと横に並んではみ出す。 */
.mg-shift span { display: block; letter-spacing: -.02em; }
.mg-shift:hover { background: var(--accent); color: #fff; }
.mg-shift.is-help { background: var(--warn-soft); outline: 1px solid #e0c48a; }
.mg-leave { font-size: .68rem; color: var(--muted); }
.mg-total { width: 46px; font-family: var(--mono); background: var(--surface-2); }

/* ---------- 定義リスト ---------- */
.deflist { display: grid; gap: 8px; margin: 0; }
.deflist > div { display: grid; grid-template-columns: 132px 1fr; gap: 12px; align-items: baseline; }
.deflist dt { font-size: .82rem; color: var(--muted); }
.deflist dd { margin: 0; }

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

@media (max-width: 780px) {
  .grid-store { width: 96px; }
  .grid { min-width: 760px; }
}

/* ---------- 不足状況の月カレンダー ---------- */
.calmonth { table-layout: fixed; min-width: 760px; }
.calmonth thead th { text-align: center; }
.calmonth thead th.is-weekend { color: var(--accent-dark); }
.cal-cell {
  vertical-align: top; height: 96px; padding: 5px 6px !important;
  white-space: normal; border-right: 1px solid var(--line);
}
.cal-cell.is-blank { background: var(--surface-2); }
.cal-cell.is-short { background: #fdf6f4; }
.cal-cell.is-holiday { background: var(--warn-soft); }
.cal-cell.is-today { box-shadow: inset 0 3px 0 var(--accent); }
.cal-daylink { text-decoration: none; display: block; margin-bottom: 3px; }
.cal-day { font-size: .86rem; font-weight: 700; color: var(--ink); }
.cal-holiday { font-size: .62rem; color: var(--warn); margin-left: 4px; }
.cal-ok { font-size: .68rem; color: var(--muted); }
.cal-closed { font-size: .68rem; color: var(--muted); }
.cal-sum { display: flex; gap: 4px; margin-bottom: 3px; }
.cal-stores { list-style: none; margin: 0; padding: 0; font-size: .66rem; line-height: 1.5; color: var(--ink-2); }
.cal-stores li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-stores .mono { color: var(--danger); margin-left: 3px; }

/* ---------- マイシフト ---------- */
.mylist { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.myday { display: grid; grid-template-columns: 68px 1fr; gap: 14px; background: var(--surface); padding: 12px 16px; align-items: center; }
.myday.is-off { background: var(--surface-2); }
.myday.is-today { background: var(--accent-soft); }
.myday-date { text-align: center; line-height: 1.3; }
.myday-d { display: block; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.myday-w { display: block; font-size: .72rem; color: var(--muted); }
.myday-today { display: inline-block; font-size: .62rem; font-weight: 700; color: var(--accent-dark); }
.myday-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.myday-shift { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.myday-time { font-family: var(--mono); font-size: 1rem; font-weight: 700; color: var(--ink); }
.myday-store { font-size: .88rem; color: var(--ink-2); }
.myday-leave { font-size: .9rem; font-weight: 700; color: var(--warn); }

@media (max-width: 780px) {
  .myday { grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 12px; }
  .myday-d { font-size: 1.1rem; }
  .myday-time { font-size: .92rem; }
}
