/* 崎永ワークセンター ブランド：赤 #e60012 / 黒 #0a0a0a / 白 #fafaf8 / グレー。
   緑・ベージュ・パステル・蛍光色は使わない。業務文言に絵文字を使わない。 */

:root {
  --red: #e60012;
  --black: #0a0a0a;
  --ink: #1f2329;
  --white: #fafaf8;
  --gray-1: #f0efed;
  --gray-2: #d8d6d2;
  --gray-3: #8a8884;
  --gray-4: #55534f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Noto Sans JP", "Hiragino Sans", sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
}

.boot { padding: 40px; color: var(--gray-3); }

/* ---- 試験運用バナー ---- */
.demo-banner {
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 8px;
  letter-spacing: 0.08em;
}

/* ---- ログイン ---- */
.login-wrap {
  min-height: 100vh;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
}
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-s {
  width: 46px; height: 46px; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 26px;
  transform: skewX(-6deg);
}
.brand-name { color: #fff; font-weight: 900; font-size: 22px; letter-spacing: 0.12em; }
.brand-sub { color: var(--gray-3); font-size: 10px; letter-spacing: 0.3em; margin-top: 2px; }
.login-card {
  background: var(--white); padding: 32px; width: 360px;
  border-top: 3px solid var(--red);
}
.login-card h1 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.login-card .hint { color: var(--gray-3); font-size: 11px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--gray-4); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px; border: 1px solid var(--gray-2);
  background: #fff; font-size: 14px; font-family: inherit;
}
.field input:focus { outline: 2px solid var(--red); border-color: transparent; }
.error-box {
  background: #fff; border: 1px solid var(--red); color: var(--red);
  padding: 8px 10px; font-size: 12px; margin-bottom: 12px; display: none;
}
.error-box.show { display: block; }

/* ---- ボタン ---- */
.btn {
  display: inline-block; border: none; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 13px; padding: 10px 18px; letter-spacing: 0.05em;
  background: var(--ink); color: #fff;
}
.btn:hover { opacity: 0.88; }
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--gray-2); }
.btn.sm { padding: 5px 10px; font-size: 11px; }
.btn:disabled { background: var(--gray-2); color: var(--gray-3); cursor: not-allowed; }
.btn.wide { width: 100%; }

/* ---- レイアウト ---- */
.layout { display: flex; min-height: calc(100vh - 29px); }
.sidebar {
  width: 232px; background: var(--black); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.sidebar .brand-block { padding: 18px 16px; border-bottom: 1px solid #2a2a2a; }
.sidebar .brand-name { font-size: 15px; }
.nav { flex: 1; padding: 12px 0; }
.nav a {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 16px;
  color: #cfcecc; text-decoration: none; font-size: 13px; font-weight: 700;
  border-left: 3px solid transparent;
}
.nav a .num { font-size: 10px; color: var(--gray-3); font-weight: 700; width: 18px; }
.nav a .en { display: block; font-size: 9px; color: var(--gray-3); font-weight: 400; letter-spacing: 0.12em; }
.nav a.active { background: #1c1c1c; border-left-color: var(--red); color: #fff; }
.nav a:hover { background: #161616; }
.sidebar .foot { padding: 14px 16px; border-top: 1px solid #2a2a2a; font-size: 10px; color: var(--gray-3); }
.sidebar .foot .dot { color: var(--red); font-weight: 900; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--gray-2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px;
}
.topbar .who { font-size: 12px; color: var(--gray-4); }
.topbar .who b { color: var(--ink); }
.badge-kt {
  background: var(--black); color: #fff; font-weight: 900; font-size: 11px;
  padding: 5px 8px; margin-left: 8px;
}
.content { padding: 26px 28px 60px; max-width: 1200px; }

.page-label { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: 0.25em; }
.page-title { font-size: 26px; font-weight: 900; margin: 2px 0 4px; }
.page-desc { color: var(--gray-3); font-size: 12px; margin-bottom: 22px; }

/* ---- カード ---- */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stat {
  flex: 1; min-width: 160px; background: #fff; border: 1px solid var(--gray-2);
  border-top: 3px solid var(--red); padding: 14px 16px;
}
.stat.dark { background: var(--black); color: #fff; border-color: var(--black); }
.stat .k { font-size: 11px; font-weight: 700; color: var(--gray-3); }
.stat .v { font-size: 30px; font-weight: 900; line-height: 1.2; }
.stat .s { font-size: 10px; color: var(--gray-3); }

/* ---- テーブル ---- */
.tablebox { background: #fff; border: 1px solid var(--gray-2); overflow-x: auto; margin-bottom: 24px; }
.tablebox .tb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-1);
}
.tb-head h2 { font-size: 14px; font-weight: 900; }
.tb-head .live { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: 0.2em; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left; font-size: 10px; color: var(--gray-3); font-weight: 700;
  padding: 8px 12px; border-bottom: 1px solid var(--gray-1); white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--gray-1); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.mono { font-variant-numeric: tabular-nums; }

/* ---- 状態表示（色だけに頼らず文字と形でも区別する） ---- */
.tag {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px;
  border: 1px solid var(--gray-2); color: var(--gray-4); background: #fff;
}
.tag.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag.alert { background: var(--red); color: #fff; border-color: var(--red); }
.tag.line-red { border-color: var(--red); color: var(--red); }

/* ---- 2カラム ---- */
.cols { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.cols > .col-main { flex: 2; min-width: 420px; }
.cols > .col-side { flex: 1; min-width: 260px; }
.attn { background: var(--black); color: #fff; padding: 18px; }
.attn h3 { color: var(--red); font-size: 10px; letter-spacing: 0.2em; margin-bottom: 10px; }
.attn .item { border-bottom: 1px solid #2a2a2a; padding: 9px 0; font-size: 12px; }
.attn .item:last-child { border-bottom: none; }
.attn .item .n { color: var(--red); font-weight: 900; margin-right: 8px; }

/* ---- フォーム行 ---- */
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.form-inline .field { margin-bottom: 0; }
.form-inline .field input, .form-inline .field select { width: auto; min-width: 140px; }

.section-gap { height: 14px; }
.note { font-size: 11px; color: var(--gray-3); margin: 8px 0 16px; }
.issue-error { color: var(--red); font-weight: 700; }
.issue-warning { color: var(--gray-4); }

.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--black); color: #fff;
  padding: 12px 18px; font-size: 13px; font-weight: 700; border-left: 3px solid var(--red);
  display: none; max-width: 420px; z-index: 50;
}
.toast.show { display: block; }

/* ---- 掲示用QRの印刷（A4・1拠点1枚） ---- */
.qr-sheet {
  background: #fff; border: 1px solid var(--gray-2); margin-bottom: 24px;
  padding: 40px; max-width: 640px; text-align: center;
}
.qr-head { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 20px; }
.qr-s {
  width: 40px; height: 40px; background: var(--red); color: #fff;
  font-weight: 900; font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.qr-title { font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-align: left; }
.qr-site { font-size: 22px; font-weight: 900; text-align: left; }
.qr-img { width: 320px; height: 320px; }
.qr-guide { margin-top: 16px; font-size: 15px; font-weight: 700; line-height: 1.9; }
.qr-foot { margin-top: 16px; font-size: 10px; color: var(--gray-3); border-top: 2px solid var(--red); padding-top: 8px; }

@media print {
  .demo-banner, .sidebar, .topbar, .no-print, .page-label, .page-title, .page-desc, .toast { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  .qr-sheet { border: none; page-break-after: always; max-width: none; }
  body { background: #fff; }
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .content { padding: 16px; }
}
