/* ホールAIO 新管理画面（admin2）。docs/admin-v2-design.md */
:root {
  --ink: #1c2530; --muted: #5d6875; --line: #d5dae0; --bg: #f3f5f7; --panel: #fff;
  --accent: #1f5fa8; --accent-d: #174a85; --bar: #17212c;
  --ok: #1a7f37; --warn: #9a6700; --ng: #c62828; --info-bg: #eaf2fb; --warn-bg: #fff6dd; --ng-bg: #fdecec; --ok-bg: #e7f5ea;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.loading { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ログイン */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px 24px; }
.login h1 { font-size: 18px; margin: 0 0 20px; text-align: center; }
.login label { display: block; margin-bottom: 14px; font-size: 13px; }
.login input { width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid #98a2ad; border-radius: 5px; font-size: 16px; }
.login .btn { width: 100%; justify-content: center; padding: 10px; }

/* 枠 */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bar); color: #e8edf2; display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 46px; }
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a { color: #c5cfd9; text-decoration: none; padding: 6px 10px; border-radius: 5px; font-size: 13px; }
.topbar nav a:hover { color: #fff; background: #26323f; }
.topbar nav a.active { color: #fff; background: #2f3e4e; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12px; color: #c5cfd9; white-space: nowrap; }
.topbar .link { background: none; border: 0; color: #c5cfd9; cursor: pointer; font-size: 12px; padding: 0; }
.topbar .link:hover { color: #fff; }
main { max-width: 1120px; margin: 0 auto; padding: 22px 16px 80px; }
h1 { font-size: 21px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.crumb a { text-decoration: none; }
.head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head .spacer { flex: 1; }

/* 部品 */
.help p, .help li, .help td { line-height: 1.75; }
.help ol, .help ul { padding-left: 1.5em; margin: 8px 0 12px; }
.help table { margin: 10px 0 14px; }
.help th, .help td { vertical-align: top; }
.help code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; }
.help section h2, section.help h2 { scroll-margin-top: 70px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #98a2ad; background: #fff; border-radius: 5px; padding: 6px 12px; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: #f1f4f7; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.danger { color: var(--ng); border-color: #e0a3a3; }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.note { border-radius: 6px; padding: 10px 12px; margin: 0 0 14px; background: var(--info-bg); white-space: pre-wrap; }
.note.warn { background: var(--warn-bg); }
.note.ng { background: var(--ng-bg); color: #7a1414; }
.note.ok { background: var(--ok-bg); }
.badge { display: inline-block; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 10px; background: #e6eaee; color: #36414d; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.ng { background: var(--ng-bg); color: var(--ng); }
.badge.run { background: var(--info-bg); color: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #e6eaee; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.scroll { overflow-x: auto; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=url], input[type=tel], input[type=password], select, textarea {
  border: 1px solid #98a2ad; border-radius: 5px; padding: 6px 8px; background: #fff; max-width: 100%;
}
textarea { width: 100%; min-height: 64px; resize: vertical; }
input.w-s { width: 90px; } input.w-m { width: 200px; } input.w-l { width: 100%; }
input.bad, textarea.bad { border-color: var(--ng); background: #fff8f8; }

/* 店舗一覧 */
.filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter input { flex: 1; min-width: 200px; }
.tenant h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.store-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #e6eaee; flex-wrap: wrap; }
.store-row .name { font-weight: 600; text-decoration: none; min-width: 200px; flex: 1; }
.store-row .quick { display: flex; gap: 6px; flex-wrap: wrap; }

/* 基本情報フォーム */
.field { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 16px; padding: 14px 0; border-top: 1px solid #e6eaee; }
.field:first-of-type { border-top: 0; padding-top: 0; }
.field > .label { font-weight: 600; }
.field > .label small { display: block; font-weight: 400; color: var(--muted); }
.field .inputs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field .inputs label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.obs { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.obs .src { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px; background: #fafbfc; display: flex; gap: 8px; align-items: center; max-width: 100%; }
.obs .src b { font-weight: 600; white-space: nowrap; }
.obs .src .val { overflow-wrap: anywhere; }
.obs .src.same { border-color: #b7dfc1; background: var(--ok-bg); }
.obs .src.diff { border-color: #ecd9a0; background: var(--warn-bg); }
.obs .src.none { color: var(--muted); }
.changed-mark { color: var(--warn); font-size: 12px; font-weight: 400; }
.actions { position: sticky; bottom: 0; background: rgba(243,245,247,.96); border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 機種リスト */
.mrow { display: grid; grid-template-columns: minmax(180px, 2fr) 110px 80px minmax(120px, 1fr) auto; gap: 6px; padding: 8px 0; border-top: 1px solid #e6eaee; align-items: start; }
.mrow.new { grid-template-columns: minmax(180px, 2fr) 110px 80px 130px auto; }
.mrow .desc { grid-column: 1 / -1; }
.mrow input, .mrow select { width: 100%; }
.mrow .ops { display: flex; gap: 4px; }
.mhead { font-size: 12px; color: var(--muted); border-top: 0; padding-bottom: 0; }
.period { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }

/* 照合 */
table.rv th, table.rv td { border: 1px solid #e6eaee; min-width: 120px; }
table.rv tbody th { background: #fafbfc; white-space: nowrap; min-width: 0; }
td.rv-ng { background: var(--ng-bg); }
td.rv-warn { background: var(--warn-bg); }
.rv-t-ng { color: var(--ng); font-weight: 600; }
tr.rv-sel td { background: var(--info-bg); }
table.rv thead th.rv-gbp { background: #e8f0fe; box-shadow: inset 0 3px 0 #1a73e8; }
.badge.gbp { background: #1a73e8; color: #fff; }
.badge.gbp.part { background: #fff; color: #1a73e8; border: 1px solid #1a73e8; }

@media (max-width: 720px) {
  .field { grid-template-columns: 1fr; }
  .mrow, .mrow.new { grid-template-columns: 1fr 1fr; }
  .mrow .mname { grid-column: 1 / -1; }
  .mhead { display: none; }
  .topbar { gap: 10px; overflow-x: auto; }
}
