:root {
  color-scheme: light;
  --ink: #231815;
  --yellow: #ffe500;
  --line: #e9e5dc;
  --paper: #faf9f6;
  --muted: #6a645d;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.6; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; min-height: 82px; margin: auto; padding: 10px 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 19px; font-weight: 800; white-space: nowrap; }
.brand img { width: 58px; height: 58px; object-fit: contain; }
.brand small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; }
.topbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topbar nav a, .link-button { background: none; border: 0; padding: 6px 0; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.topbar nav a:hover, .link-button:hover { text-decoration: underline; text-decoration-color: #e4c900; text-decoration-thickness: 3px; }
.inline { display: inline; margin: 0; }
.container { max-width: 1120px; padding: 28px 24px 80px; margin: 0 auto; min-height: calc(100vh - 145px); }
.page-title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; }
h1 { font-size: clamp(25px, 4vw, 34px); letter-spacing: .015em; margin: 0; }
.page-title span, .muted, .help { color: var(--muted); }
h2 { font-size: 20px; margin: 0 0 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 25px; margin: 0 0 24px; box-shadow: 0 5px 22px rgba(35,24,21,.03); }
.panel.narrow { max-width: 550px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 45px; padding: 9px 17px; border: 1px solid #d6d0c3; border-radius: 8px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.button:hover { border-color: var(--ink); transform: translateY(-1px); }
.button.primary { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 3px 0 #c8b600; }
.button.primary:hover { box-shadow: 0 4px 0 #c8b600; }
.action-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar, .section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.search { display: flex; gap: 8px; flex: 1; max-width: 650px; }
.search input { flex: 1; min-width: 180px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 20px; }
label { display: block; margin-bottom: 16px; font-weight: 700; font-size: 14px; }
label input, label select, label textarea, .search input { display: block; width: 100%; min-height: 45px; border: 1px solid #cfc9be; background: #fff; border-radius: 7px; padding: 9px 11px; margin-top: 6px; color: var(--ink); font-size: 16px; }
label textarea { resize: vertical; min-height: 105px; }
label input:focus, label select:focus, label textarea:focus, .search input:focus { outline: 3px solid #fff4a6; border-color: #a89400; }
input[type=file] { padding: 8px; }
.help { font-size: 13px; margin: 8px 0 18px; }
.notice { padding: 13px 17px; border: 1px solid #b9d3a6; background: #f0f8ec; border-radius: 8px; margin-bottom: 18px; }
.notice.error { border-color: #e3b9b2; background: #fff0ed; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-grid.with-sales { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; }
.stat-link { text-decoration: none; }
.stat-link:hover { border-color: #d3bf00; background: #fffdf0; }
.stat small { display: block; font-size: 14px; color: var(--muted); font-weight: 700; }
.stat strong { font-size: 39px; margin-right: 5px; }
.with-sales .stat strong { font-size: clamp(25px, 2.6vw, 39px); overflow-wrap: anywhere; }
.month-filter { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.month-filter label { margin: 0; min-width: 180px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.voided { color: var(--muted); background: #f5f4f1; }
.voided .money { text-decoration: line-through; }
.list-row { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); text-decoration: none; align-items: center; }
.list-row:hover { background: #fffdf0; }
.list-row small { display: block; color: var(--muted); }
.list-row time { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 14px; white-space: nowrap; }
td small { display: block; color: var(--muted); }
.strong-link { font-weight: 700; text-underline-offset: 3px; }
.pager { display: flex; justify-content: space-between; margin-bottom: 30px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
figure { min-width: 0; margin: 0 0 16px; }
figure img { width: 100%; height: 190px; display: block; object-fit: cover; background: #ece9e3; border-radius: 8px; }
figcaption { font-size: 13px; padding-top: 7px; color: var(--muted); }
.photo-form { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 8px; }
.danger-link, .text-button { background: none; border: none; color: #8d251d; text-decoration: underline; padding: 6px; font-size: 13px; }
.danger-button { border: 1px solid #9e3830; color: #8d251d; background: #fff; padding: 7px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
footer { text-align: center; color: var(--muted); padding: 18px; font-size: 13px; }
@media (max-width: 760px) {
  .topbar-inner { display: block; padding: 8px 16px; }
  .brand { margin-bottom: 4px; }
  .topbar nav { gap: 4px 15px; padding-bottom: 5px; }
  .topbar nav a, .link-button { font-size: 13px; }
  .container { padding: 20px 15px 55px; }
  .panel { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .stat-grid { gap: 8px; }
  .stat-grid.with-sales { grid-template-columns: 1fr; }
  .stat { padding: 16px; }
  .stat strong { font-size: 29px; }
  .list-row { grid-template-columns: 1fr auto; }
  .list-row span:nth-child(2) { display: none; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  figure img { height: 145px; }
  .search { width: 100%; }
}

/* シフト管理 */
.shift-table { min-width: 640px; }
.shift-table th:first-child { position: sticky; left: 0; background: #fff; min-width: 105px; z-index: 1; }
.shift-table td { min-width: 165px; }
.shift-cell { display: block; text-decoration: none; min-height: 55px; border-radius: 6px; padding: 4px; }
.shift-cell:hover { background: #fff7b8; }
.shift-cell strong { display: block; font-size: 14px; white-space: nowrap; }
.shift-badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 5px; }
.shift-work { background: #fff4a6; }
.shift-off { background: #eeeeee; }
.shift-paid { background: #e3f2fb; }
.shift-today { background: #fffdf0; }
.shift-weekdays { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 15px; display: flex; flex-wrap: wrap; gap: 16px; }
.shift-weekdays label { margin: 5px 0; display: inline-flex; align-items: center; gap: 5px; }
.shift-weekdays input { width: 20px; min-height: 20px; margin: 0; }
.shift-delete { margin-top: 22px; }
#shift-editor { scroll-margin-top: 20px; }

/* スマホ対応（2026-11 追加） */
.compact-table { min-width: 0; }
.sales-table td:first-child, .sales-table td:nth-child(2) a { white-space: nowrap; }
.more-fields { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 18px; }
.more-fields summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.more-fields[open] summary { margin-bottom: 12px; }
