/* NINE'S 勤怠・日報 — 黒と白が基調。赤は使わない */
:root {
  --ink: #0b0a09;
  --ink-2: #1e1a17;
  --ink-3: #3a3530;
  --mid: #6b635a;
  --line: #d8d0c4;
  --line-2: #ebe6de;
  --bone: #ede8e0;
  --paper: #f6f4f0;
  --white: #ffffff;
  --f-display: "Arial Black", "Arial Bold", Impact, "Helvetica Neue", Helvetica, sans-serif;
  --f-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-jp);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- 上部 ---------- */
.topbar { background: var(--ink); color: var(--bone); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-logo { height: 22px; width: auto; filter: invert(1) brightness(1.1); }
.brand-sub { font-weight: 700; font-size: 14px; letter-spacing: .08em; white-space: nowrap; }
.who { font-size: 13px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who b { font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 99px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.chip-demo { background: var(--bone); color: var(--ink); font-family: var(--f-display); }

/* ---------- デモユーザー切替 ---------- */
.demo-bar { background: var(--ink-2); color: var(--bone); border-bottom: 1px solid #000; }
.demo-bar-inner { max-width: 1180px; margin: 0 auto; padding: 10px var(--gutter) 12px; }
.demo-bar-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.demo-bar-head strong { font-size: 14px; letter-spacing: .06em; }
.demo-bar-note { font-size: 12px; color: #b9b1a6; }
.switcher { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.switch-btn {
  border: 1px solid #5a534c; background: transparent; color: var(--bone); border-radius: 8px;
  padding: 8px 6px; cursor: pointer; text-align: center; min-height: 52px; line-height: 1.3;
}
.switch-btn small { display: block; font-size: 11px; color: #b9b1a6; }
.switch-btn:hover { border-color: var(--bone); }
.switch-btn[aria-pressed="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); font-weight: 700; }
.switch-btn[aria-pressed="true"] small { color: var(--ink-3); }
.switch-btn:disabled { opacity: .5; cursor: wait; }
.guide { margin-top: 10px; font-size: 13px; }
.guide summary { cursor: pointer; color: #d9d2c7; }
.guide ol { margin: 8px 0 0; padding-left: 1.6em; display: grid; gap: 2px; }

/* ---------- 本文 ---------- */
.app { max-width: 1180px; margin: 0 auto; padding: 18px var(--gutter) 40px; outline: none; }
.loading { color: var(--mid); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin: 4px 0 16px; }
.page-head h1 { margin: 0; font-size: 22px; line-height: 1.3; }
.page-head .sub { color: var(--mid); font-size: 13px; }
.eyebrow { font-family: var(--f-display); font-size: 11px; letter-spacing: .18em; color: var(--mid); text-transform: uppercase; }

.grid { display: grid; gap: 16px; }
.staff-grid { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin: 0 auto; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .count { font-family: var(--f-mono); font-size: 13px; color: var(--mid); font-weight: 400; }
.card-dark { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.muted { color: var(--mid); }
.small { font-size: 13px; }

/* タブ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink); margin: 0 auto 16px; max-width: 760px; }
.tab { border: 0; background: transparent; padding: 10px 16px; cursor: pointer; font-weight: 700; color: var(--mid); border-radius: 8px 8px 0 0; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bone); }

/* 状態 */
.status-card { display: grid; gap: 14px; }
.status-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-label { font-size: 28px; font-weight: 800; letter-spacing: .04em; display: flex; align-items: center; gap: 10px; }
.times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time-box { border: 1px solid #3d3732; border-radius: 8px; padding: 8px 10px; }
.card:not(.card-dark) .time-box { border-color: var(--line); }
.time-box span { display: block; font-size: 11px; color: #b9b1a6; }
.card:not(.card-dark) .time-box span { color: var(--mid); }
.time-box b { font-family: var(--f-mono); font-size: 20px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.dot-live { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { font-size: 12px; text-align: center; padding: 6px 2px; border-top: 3px solid #4a443e; color: #b9b1a6; }
.steps li.done { border-color: var(--bone); color: var(--bone); font-weight: 700; }
.steps li.done::before { content: "✓ "; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--ink); background: var(--white); color: var(--ink);
  border-radius: 8px; padding: 10px 16px; font-weight: 700; cursor: pointer; min-height: 44px; text-decoration: none;
}
.btn:hover { background: var(--line-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bone); }
.btn-primary:hover { background: var(--ink-3); }
.btn-invert { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn-invert:hover { background: var(--white); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-sm { min-height: 34px; padding: 4px 10px; font-size: 13px; border-width: 1px; }
.btn-xl { min-height: 64px; font-size: 20px; width: 100%; letter-spacing: .1em; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 auto; }

/* ピル（状態） */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--ink); white-space: nowrap; }
.pill-solid { background: var(--ink); color: var(--bone); }
.pill-soft { background: var(--line-2); border-color: var(--line-2); color: var(--ink-3); }
.pill-dash { border-style: dashed; border-color: var(--mid); color: var(--mid); }
.card-dark .pill { border-color: var(--bone); }
.card-dark .pill-solid { background: var(--bone); color: var(--ink); }

/* 業務 */
.task-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.task { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.task-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.task-title { font-weight: 700; word-break: break-word; }
.task-cat { font-size: 11px; color: var(--mid); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .25s; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row .bar { flex: 1; }
.bar-row b { font-family: var(--f-mono); font-size: 13px; min-width: 3.4em; text-align: right; }
.prog-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.prog-btns button { border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 6px 0; font-size: 12px; cursor: pointer; min-height: 36px; }
.prog-btns button[aria-pressed="true"] { background: var(--ink); color: var(--bone); border-color: var(--ink); font-weight: 700; }
.icon-btn { border: 0; background: transparent; color: var(--mid); cursor: pointer; font-size: 13px; padding: 2px 4px; text-decoration: underline; }

/* フォーム */
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label, .field .label { font-size: 13px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--mid); font-weight: 400; }
input[type="text"], input[type="password"], input[type="time"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid var(--mid); border-radius: 8px; padding: 10px 12px; background: var(--white); min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.suggest button { border: 1px dashed var(--mid); background: transparent; border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.add-box { border-top: 1px dashed var(--line); padding-top: 14px; }

/* コメント */
.comment { border-left: 3px solid var(--ink); padding: 6px 0 6px 12px; margin: 0 0 10px; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.comment .meta { font-size: 12px; color: var(--mid); }
.comment.unread { background: var(--line-2); border-radius: 0 8px 8px 0; padding-right: 10px; }
.card-dark .comment { border-color: var(--bone); }
.card-dark .comment .meta { color: #b9b1a6; }
.notice-new { animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.98); opacity: .4; } }

.report-view dt { font-size: 12px; color: var(--mid); font-weight: 700; margin-top: 10px; }
.report-view dd { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }

/* 表 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 12px; color: var(--mid); font-weight: 700; white-space: nowrap; }
td.num { font-family: var(--f-mono); white-space: nowrap; }
tr.today td { background: var(--paper); font-weight: 700; }

/* 管理者 */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi span { display: block; font-size: 12px; color: var(--mid); font-weight: 700; }
.kpi b { font-family: var(--f-display); font-size: 34px; line-height: 1.1; }
.kpi small { font-size: 13px; color: var(--mid); margin-left: 2px; }
.kpi.attn { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.kpi.attn span, .kpi.attn small { color: #cfc7bb; }

.admin-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.staff-rows { display: grid; gap: 10px; }
.srow { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 190px minmax(0, 1fr) 150px; gap: 14px; align-items: start; }
.srow.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--line); } to { background: transparent; } }
.srow-name b { font-size: 16px; display: block; }
.srow-name span { font-size: 12px; color: var(--mid); }
.srow-time { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.srow-tasks { display: grid; gap: 6px; }
.mini-task { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; align-items: center; font-size: 13px; }
.mini-task .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-report { display: grid; gap: 6px; justify-items: start; }
.side-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.side-list li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.side-list .btn-row { margin-top: 8px; }

.danger-zone { border: 2px dashed var(--ink); }

/* フッター */
.footer { border-top: 1px solid var(--line); background: var(--white); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--mid); }
.footer-note { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 16px; font-size: 12px; color: var(--mid); }

/* トースト */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bone); padding: 12px 18px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 700; }
.toast.err { background: var(--white); color: var(--ink); border: 2px solid var(--ink); }

/* モーダル */
.modal { border: 0; padding: 0; border-radius: 14px; width: min(680px, calc(100% - 24px)); max-height: calc(100% - 24px); }
.modal::backdrop { background: rgba(11,10,9,.6); }
.modal-inner { padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 19px; }
.close-x { border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.reset-list { margin: 8px 0 14px; padding-left: 1.3em; }

/* 合言葉の入口 */
.gate-body { background: var(--ink); color: var(--bone); min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.gate { width: min(420px, 100%); }
.gate-logo { height: 30px; filter: invert(1) brightness(1.1); }
.gate h1 { font-size: 22px; margin: 18px 0 6px; display: flex; align-items: center; gap: 10px; }
.gate h1 span { font-family: var(--f-display); font-size: 11px; background: var(--bone); color: var(--ink); padding: 3px 8px; border-radius: 99px; letter-spacing: .1em; }
.gate label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.gate input { background: var(--ink-2); color: var(--bone); border-color: #5a534c; margin-bottom: 14px; }
.gate .btn-primary { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.gate-error { border: 1px solid var(--bone); border-radius: 8px; padding: 8px 12px; font-weight: 700; }
.gate-note { font-size: 12px; color: #b9b1a6; margin-top: 18px; }

/* 画面幅ごと */
@media (max-width: 1020px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .srow { grid-template-columns: 190px minmax(0, 1fr); }
  .srow-report { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; align-items: center; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .switch-btn { font-size: 13px; padding: 6px 2px; }
  .brand-logo { height: 17px; }
  .brand-sub { display: none; }
  .who { font-size: 12px; max-width: 45%; }
  .who b { font-size: 13px; }
  .who .muted { display: none; }
  .switch-btn small { font-size: 10px; }
  .demo-bar-note { display: none; }
  .status-label { font-size: 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 28px; }
  .row2 { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 1fr; }
  .srow-report { grid-auto-flow: row; }
  .card { padding: 14px; }
  .times b { font-size: 17px; }
}
