
/* 店長の画面。第1段階「店長のシフト帳」の見た目を引き継ぐ。上に店の帯、要約の数字、主役はスタッフ×日付の表 */
:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --sunken: #e9ecf2;
  --ink: #1a2133;
  --muted: #5f6878;
  --line: #d9dee8;
  --accent: #274a8f;          /* 藍 */
  --accent-ink: #ffffff;
  --accent-soft: #e3e9f6;
  --ok: #e3f3e8; --ok-ink: #1d6b3a;
  --part: #fdf1d6; --part-ink: #8a5a00;
  --ng: #f9e1df; --ng-ink: #a2281e;
  --bad: #c62f22;
  --sat: #2f5fb3; --sun: #c0392b;
  --shadow: 0 10px 30px rgba(20, 30, 60, .16);
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161f; --surface: #1a2030; --sunken: #232a3b; --ink: #e6e9f0; --muted: #9aa3b5; --line: #2f374a;
    --accent: #8fb0f0; --accent-ink: #0f1626; --accent-soft: #24324f;
    --ok: #1d3627; --ok-ink: #8fd6a6; --part: #3a3018; --part-ink: #f0c66a; --ng: #3d2121; --ng-ink: #f2a39b;
    --bad: #ff7b6e; --sat: #8fb0f0; --sun: #ff8f84; --shadow: 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161f; --surface: #1a2030; --sunken: #232a3b; --ink: #e6e9f0; --muted: #9aa3b5; --line: #2f374a;
  --accent: #8fb0f0; --accent-ink: #0f1626; --accent-soft: #24324f;
  --ok: #1d3627; --ok-ink: #8fd6a6; --part: #3a3018; --part-ink: #f0c66a; --ng: #3d2121; --ng-ink: #f2a39b;
  --bad: #ff7b6e; --sat: #8fb0f0; --sun: #ff8f84; --shadow: 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.6; }
.wrap { padding-inline: 16px; padding-block: 16px 48px; max-width: 1400px; margin: 0 auto; display: grid; gap: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }

/* 上部の帯 */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.brand { display: grid; min-width: 0; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 700; text-wrap: balance; }
.month { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.month b { font-size: 16px; padding-inline: 8px; min-width: 7.5em; text-align: center; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; font-size: 16px; }
.icon-btn:hover { background: var(--sunken); }
.status { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-weight: 700; }
.status.final { background: var(--ok); color: var(--ok-ink); }
.spacer { flex: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* タブ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 8px 14px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.tab .cnt { font-size: 11px; background: var(--ng); color: var(--ng-ink); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

/* 要約 */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { font-family: var(--f-num); font-size: 20px; font-variant-numeric: tabular-nums; }
.stat.alert b { color: var(--bad); }

.note { font-size: 12px; color: var(--muted); }
.banner { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* シフト表 */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }
.gridbox { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-height: 70vh; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.grid th, .grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; }
.grid thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; font-weight: 500; padding: 4px 0; width: 52px; min-width: 52px; text-align: center; line-height: 1.3; }
.grid thead th.sat { color: var(--sat); }
.grid thead th.sun, .grid thead th.hol { color: var(--sun); }
.grid thead th small { display: block; font-size: 10px; }
.grid .name { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding: 4px 10px; min-width: 140px; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.grid thead .name { z-index: 3; }
.grid .name .tag { font-size: 10px; border-radius: 3px; padding: 0 4px; margin-left: 4px; font-weight: 700; }
.tag.minor { background: var(--part); color: var(--part-ink); }
.tag.role { background: var(--sunken); color: var(--muted); }
.tag.nosub { background: var(--ng); color: var(--ng-ink); }
.cell { height: 40px; width: 52px; min-width: 52px; text-align: center; position: relative; cursor: pointer; }
.cell:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.r-ok { background: var(--ok); }
.cell.r-time { background: var(--part); }
.cell.r-ng { background: repeating-linear-gradient(135deg, var(--ng) 0 5px, transparent 5px 9px); }
.cell .sh { font-family: var(--f-num); font-weight: 600; font-size: 11.5px; display: block; line-height: 1.2; }
.cell .sh.has { background: var(--accent); color: var(--accent-ink); border-radius: 4px; margin: 3px; padding: 4px 0; }
.cell .rq { font-size: 10px; color: var(--muted); line-height: 1.2; display: block; }
.cell .warn { position: absolute; top: 1px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; }
.grid .tot { padding: 4px 8px; text-align: right; white-space: nowrap; font-family: var(--f-num); font-variant-numeric: tabular-nums; min-width: 74px; }
.grid .tot.bad { color: var(--bad); font-weight: 600; }
.grid tr.cov th.name { font-weight: 400; color: var(--muted); }
.grid tr.cov.first td, .grid tr.cov.first th { border-top: 2px solid var(--ink); }
.covc { text-align: center; font-family: var(--f-num); font-size: 11.5px; height: 28px; }
.covc.short { background: var(--ng); color: var(--ng-ink); font-weight: 600; }
.covc.over { color: var(--part-ink); }
.covc.fine { color: var(--ok-ink); }

/* 要確認リスト */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: grid; gap: 8px; min-width: 0; }
.panel h2 { margin: 0; font-size: 15px; }
.warnlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.warnlist li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.warnlist li button { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; text-align: left; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; transform: translateY(-1px); }
.dot.soft { background: var(--part-ink); }

/* 取り込み */
.import { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 820px) { .import { grid-template-columns: 1fr; } }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 22px 14px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--sunken); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 15px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 78px; height: 110px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--sunken); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; }
textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); resize: vertical; }
.thinking { font-size: 13px; color: var(--muted); }
.tablebox { overflow-x: auto; }
table.plain { border-collapse: collapse; width: 100%; font-size: 13px; }
.plain th, .plain td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: middle; }
.plain th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.plain input[type="text"], .plain input[type="number"], .plain input[type="time"], .plain select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface); }
.plain input[type="number"] { width: 6.5em; }
tr.conflict { background: var(--part); }
tr.unsure td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.pill { font-size: 11px; border-radius: 999px; padding: 1px 8px; font-weight: 700; white-space: nowrap; }
.pill.new { background: var(--ok); color: var(--ok-ink); }
.pill.same { background: var(--sunken); color: var(--muted); }
.pill.conf { background: var(--ng); color: var(--ng-ink); }
.choice { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.src { font-size: 11px; color: var(--muted); }

/* セル編集シート */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 15, 30, .35); z-index: 20; display: grid; place-items: center; padding: 16px; }
.sheet { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: min(440px, 100%); max-height: 90vh; overflow: auto; padding: 16px 18px; display: grid; gap: 12px; }
@media (max-width: 520px) { .sheet-bg { place-items: end center; padding: 0; } .sheet { border-radius: 14px 14px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); } }
.sheet h3 { margin: 0; font-size: 16px; }
.sheet h4 { margin: 0; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .06em; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 8px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type="time"], .row input[type="text"] { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface); }
.sheet .msgs { display: grid; gap: 4px; font-size: 12.5px; color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 13px; z-index: 30; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.empty { text-align: center; padding: 40px 16px; display: grid; gap: 10px; justify-items: center; }
.confirm { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) { .cell .sh.has { transition: transform .12s; } .cell:hover .sh.has { transform: scale(1.04); } }

/* ---- 第2段階で足したもの ---- */
html, body { margin: 0; }
.statebar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.statebar .steps { display: flex; gap: 4px; flex-wrap: wrap; font-size: 12px; }
.statebar .steps span { padding: 2px 10px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.statebar .steps span.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.statebar .msg { font-size: 13px; color: var(--muted); flex: 1; min-width: 200px; }
.status.collecting { background: var(--part); color: var(--part-ink); }
.alertbox { background: var(--ng); color: var(--ng-ink); border-radius: 8px; padding: 10px 14px; font-size: 13px; display: grid; gap: 4px; }
.alertbox b { font-size: 14px; }
.cell.locked { cursor: default; }
.cell.locked:hover { box-shadow: none; }
.chk { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
tr.unsure-row { background: var(--part); }
.login { max-width: 420px; margin: 10vh auto; display: grid; gap: 12px; }
.login input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.audit li { font-size: 12.5px; }
/* 取り込みは上下に並べる（結果の表を広く使う） */
.import { grid-template-columns: minmax(0, 1fr); }
.panel { align-content: start; }

/* ---- スタッフの画面（スマホ中心） ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-h.sun, .cal-d.sun .num { color: var(--sun); }
.cal-h.sat, .cal-d.sat .num { color: var(--sat); }
.cal-d { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-height: 54px; padding: 4px 2px; display: grid; align-content: start; justify-items: center; gap: 2px; min-width: 0; }
.cal-d .num { font-size: 14px; font-weight: 600; }
.cal-d small { font-size: 10.5px; line-height: 1.2; color: var(--ink); font-family: var(--f-num); overflow-wrap: anywhere; }
.cal-d.k-ok { background: var(--ok); }
.cal-d.k-time { background: var(--part); }
.cal-d.k-ng { background: repeating-linear-gradient(135deg, var(--ng) 0 6px, var(--surface) 6px 11px); }
.cal-d.changed { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d:disabled { cursor: default; opacity: .85; }
.seg.big button { padding: 10px 14px; font-size: 15px; flex: 1 1 40%; }
.sendbar { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding-block: 8px; }
.sendbar .btn { padding: 10px 18px; font-size: 15px; }
.shiftlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.shift-row { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.day-block { border-bottom: 1px solid var(--line); padding-block: 6px; display: grid; gap: 2px; }
.day-block.me .day-h { color: var(--accent); }
.day-h { font-weight: 700; font-size: 13px; }
.day-h.sun { color: var(--sun); }
.day-h.sat { color: var(--sat); }
.day-p { display: flex; justify-content: space-between; font-size: 14px; padding-inline: 4px; }
.day-p.is-me { background: var(--accent-soft); border-radius: 6px; font-weight: 700; }
@media (max-width: 520px) { .top h1 { font-size: 17px; } .tab { padding: 8px 10px; } }

/* ---- お試し版 ---- */
.demo-bar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; background: var(--part); color: var(--part-ink); border-radius: 10px; padding: 8px 12px; }
.demo-bar .note { color: var(--part-ink); }
.demo-bar select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--ink); max-width: 100%; }
.demo-landing ul { padding-left: 18px; margin: 0; display: grid; gap: 2px; }
