/* 自社ヒートマップ 管理画面（試作）。画面の並び・操作の順番はミエルカヒートマップに寄せ、素材とコードは自作。 */
:root {
  --side: #1b1b1b;
  --side-active: #343434;
  --band-a: #f39a1f;
  --band-b: #e2572a;
  --bg: #e6ebf0;
  --card: #fff;
  --ink: #2b2b2b;
  --muted: #7a7f86;
  --line: #dde2e7;
  --teal: #12a9c4;
  --teal-dark: #0e8ea5;
  --orange: #f08a24;
  --accent: #f4a259;
  --table-head: #1f1f1f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: var(--teal-dark); }
button { font-family: inherit; }

/* 左のメニュー */
.side { position: fixed; inset: 0 auto 0 0; width: 225px; background: var(--side); color: #eee; padding: 18px 12px; overflow-y: auto; z-index: 20; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 26px 10px 34px; }
.side .logo .mark { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, var(--band-a), var(--band-b)); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px; letter-spacing: -.5px; }
.side .logo .name { font-weight: 800; font-size: 15px; line-height: 1.25; }
.side .logo .name small { display: block; font-weight: 500; font-size: 11px; color: #aaa; }
.side nav a { display: flex; align-items: center; gap: 10px; color: #e8e8e8; text-decoration: none; padding: 10px 12px; border-radius: 6px; margin-bottom: 4px; font-size: 13.5px; }
.side nav a:hover { background: #2a2a2a; }
.side nav a.on { background: var(--side-active); }
.side nav svg { width: 18px; height: 18px; flex: none; }
.side .userbox { position: absolute; bottom: 16px; left: 14px; right: 12px; font-size: 12px; color: #bbb; border-top: 1px solid #333; padding-top: 12px; }
.side .userbox .who { color: #eee; font-weight: 700; margin-bottom: 8px; }
.side .userbox .who small { display: block; font-weight: 500; color: #999; font-size: 11px; }
.side .userbox a, .side .userbox button { display: block; background: none; border: 0; color: #bbb; padding: 3px 0; font-size: 12px; cursor: pointer; text-decoration: underline; font-family: inherit; }

/* ログイン画面 */
.login-body { background: linear-gradient(135deg, #2a2a2a, #111); min-height: 100vh; display: grid; place-items: center; margin: 0; }
.login-card { width: min(380px, 92vw); background: #fff; border-radius: 6px; padding: 30px 28px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.login-card .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-card .logo .mark { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, var(--band-a), var(--band-b)); display: grid; place-items: center; font-weight: 800; color: #fff; }
.login-card .logo .name { font-weight: 800; font-size: 15px; }
.login-card .logo .name small { display: block; font-weight: 500; font-size: 11px; color: #888; }
.login-card h1 { font-size: 18px; margin: 0 0 16px; }
.login-card label { display: block; font-size: 12.5px; font-weight: 700; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; }
.login-card button { width: 100%; margin-top: 20px; padding: 12px; border: 0; border-radius: 4px; background: linear-gradient(90deg, var(--band-a), var(--band-b)); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; }
.login-card .mini { margin-top: 14px; }

/* 上の帯 */
.main { margin-left: 225px; min-height: 100%; }
.band { background: linear-gradient(90deg, var(--band-a), var(--band-b)); color: #fff; padding: 14px 18px 22px; position: relative; }
.band .crumbs { font-size: 12px; font-weight: 700; opacity: .95; }
.band .crumbs a { color: #fff; text-decoration: none; }
.band .crumbs span.sep { margin: 0 6px; }
.band h1 { font-size: 30px; margin: 14px 0 6px; font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 16px; }
.band h1 .pill { font-size: 13px; font-weight: 600; background: rgba(255,255,255,.75); color: #555; padding: 6px 14px; border-radius: 3px; }
.band p { margin: 0; font-size: 13px; font-weight: 600; }
.band .util { position: absolute; right: 0; top: 0; background: #111; color: #eee; font-size: 12.5px; padding: 12px 18px; display: flex; gap: 18px; }

.content { padding: 20px 20px 60px; }
.card { background: var(--card); border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 20px; }
.card.pad { padding: 22px 28px; }

/* データ収集状況 */
.stats { display: flex; align-items: stretch; }
.stats .label { width: 210px; display: flex; align-items: center; padding: 0 28px; font-weight: 800; font-size: 16px; color: #555; }
.stats .cell { flex: 1; padding: 14px 20px; border-left: 1px solid var(--line); }
.stats .cell .k { font-size: 12.5px; font-weight: 700; color: #444; }
.stats .cell .v { font-size: 26px; font-weight: 800; margin-top: 12px; }
.stats .cell .v small { font-size: 13px; font-weight: 700; }
.stats .cell .lim { font-size: 11.5px; color: #666; }

/* 表 */
.tbl-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.tbl-head h2 { font-size: 18px; margin: 0; font-weight: 800; }
.tbl-head .grow { flex: 1; }
.search { width: 100%; max-width: 530px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 20px; font-size: 13px; margin-bottom: 16px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { background: var(--table-head); color: #fff; font-size: 12px; font-weight: 700; padding: 14px 12px; text-align: left; border-right: 1px solid #444; }
table.list th.num, table.list td.num { text-align: right; }
table.list th.c, table.list td.c { text-align: center; }
table.list td { padding: 14px 12px; border-bottom: 1px solid #eceff2; vertical-align: middle; }
table.list tr:nth-child(even) td { background: #f8f9fa; }
table.list td .t { font-size: 13.5px; }
table.list td .u { font-size: 12.5px; color: var(--teal-dark); word-break: break-all; }
table.list td.num { font-size: 16px; font-weight: 700; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 3px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; }
.btn.teal { background: var(--teal); color: #fff; }
.btn.teal:hover { background: var(--teal-dark); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.ghost { background: #fff; color: #444; border: 1px solid #999; }
.btn.light { background: #e8edf1; color: #333; }
.btn.small { padding: 5px 10px; font-size: 11.5px; }
.btn[disabled] { opacity: .45; cursor: default; }
.tag-ok { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; background: #e3f6ea; color: #1f8a4c; }
.tag-no { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; background: #fdecea; color: #c0392b; }

/* ヒートマップ画面 */
.hm-wrap { display: flex; gap: 20px; align-items: flex-start; }
.hm-main { flex: 1; min-width: 0; }
.hm-side { width: 262px; flex: none; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.hm-side.hide { width: 40px; overflow: hidden; }
.hm-side.hide .opt-body { display: none; }
.opt { padding: 16px 16px 24px; }
.opt .hidebtn { font-size: 11.5px; color: #555; cursor: pointer; border: 0; background: none; padding: 0; }
.opt h3 { font-size: 22px; margin: 12px 0 20px; font-weight: 800; color: #444; }
.opt h4 { font-size: 15px; margin: 22px 0 10px; padding-left: 10px; border-left: 4px solid var(--accent); font-weight: 800; color: #333; display: flex; align-items: center; gap: 6px; }
.opt .sep { border-top: 1px solid var(--line); margin: 16px 0 0; }
.opt label.r { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13.5px; cursor: pointer; }
.opt label.r input { accent-color: var(--orange); width: 16px; height: 16px; }
.opt select, .opt input[type=date], .opt textarea { width: 100%; padding: 8px 10px; border: 0; background: #e8edf1; border-radius: 3px; font-size: 13px; font-family: inherit; }
.opt .dates { display: grid; grid-template-columns: 1fr; gap: 6px; }
.opt .dates.cmp select, .opt .dates.cmp input { background: #fde3cc; }
.opt .row2 { display: flex; gap: 6px; margin-top: 6px; }
.opt .wide { width: 100%; justify-content: center; padding: 10px; font-size: 13.5px; }
.opt .tabs3 { display: flex; gap: 14px; margin: 4px 0 8px; font-size: 13px; font-weight: 700; }
.opt .tabs3 a { color: #aaa; text-decoration: none; padding-bottom: 4px; cursor: pointer; }
.opt .tabs3 a.on { color: #444; border-bottom: 3px solid var(--orange); }
.opt .note { font-size: 12px; color: #555; line-height: 1.6; margin: 10px 0; }
.opt .meta { font-size: 12px; color: #666; margin-top: 6px; }
.q { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #555; color: #fff; font-size: 10px; font-weight: 800; cursor: help; flex: none; }

.toprow { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.btn-outline { background: #fff; border: 1px solid #bbb; border-radius: 3px; padding: 7px 10px; font-size: 12px; cursor: pointer; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 0 6px 0; align-items: flex-end; }
.tabs a { padding: 10px 8px 9px; margin-right: 10px; font-weight: 700; font-size: 13px; color: #b5b9bf; text-decoration: none; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs a.on { color: #333; border-bottom-color: var(--orange); }
.tabs .grow { flex: 1; }
.tabs .ai { margin-bottom: 8px; background: linear-gradient(90deg, #6b2bd9, #1aa3d6); color: #fff; border: 0; border-radius: 3px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }

.cols { display: flex; gap: 18px; padding: 14px 6px 6px; }
.col { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 3px; background: #fafbfc; }
.col.cmp { border: 3px solid #f6a15c; }
.colhead { padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.colhead .p { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.colhead .m { display: flex; gap: 26px; margin-top: 10px; font-size: 13px; font-weight: 700; }
.colhead .m b { font-size: 14px; margin-left: 6px; }
.maps { display: flex; gap: 14px; padding: 14px; background: #d7dee5; justify-content: center; }
.col.cmp .maps { background: #f8b07a; }
.map { background: #fff; padding: 10px 12px 14px; border-radius: 2px; }
.map .ttl { text-align: center; font-weight: 700; font-size: 13.5px; margin-bottom: 10px; display: flex; justify-content: center; gap: 6px; align-items: center; }
.map .stage { position: relative; }
.map .stage img { display: block; width: 100%; height: auto; }
.map .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map .stage .noimg { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #f2f4f6, #f2f4f6 10px, #e9ecef 10px, #e9ecef 20px); color: #777; font-size: 12px; text-align: center; padding: 10px; }
.tip { position: fixed; pointer-events: none; background: rgba(20,20,20,.88); color: #fff; font-size: 12.5px; font-weight: 700; padding: 4px 8px; border-radius: 2px; z-index: 99; display: none; white-space: nowrap; }

.links-wrap { display: flex; gap: 18px; padding: 14px 6px; align-items: flex-start; }
.links-wrap .left { width: 380px; flex: none; }
.links-wrap .right { flex: 1; min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 3px; background: #fff; margin-bottom: 16px; }
.panel .ph { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); }
.panel .pb { background: #d7dee5; padding: 14px; }
.panel table.list th { font-size: 11.5px; padding: 10px; }
.panel table.list td { font-size: 12.5px; padding: 10px; background: #fff; }
.panel table.list td.num { font-size: 13px; }
.panel .scroll { max-height: 520px; overflow-y: auto; }
.dl { background: #fde3cc; color: #333; border: 0; padding: 6px 10px; border-radius: 3px; font-weight: 700; font-size: 12px; cursor: pointer; }

/* 小窓 */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 4px; width: min(820px, 92vw); max-height: 90vh; overflow: auto; }
.modal .mh { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 17px; }
.modal .mh button { border: 0; background: none; font-size: 22px; cursor: pointer; color: #666; }
.modal .mb { padding: 18px; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); text-align: right; }
.modal pre { background: #f4f6f8; padding: 12px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; font-size: 12.5px; }

/* フォーム */
.form { display: grid; grid-template-columns: 160px 1fr; gap: 14px 18px; align-items: center; max-width: 820px; margin: 0 auto; }
.form label { text-align: right; font-weight: 700; font-size: 13px; }
.form input, .form select { padding: 9px 12px; border: 1px solid #ccc; border-radius: 3px; font-size: 13.5px; font-family: inherit; }
.form .pages { max-height: 160px; overflow-y: auto; border: 1px solid #ddd; padding: 8px 10px; border-radius: 3px; font-size: 12.5px; }
.form .pages label { display: flex; text-align: left; gap: 6px; font-weight: 500; }
.err { color: #c0392b; font-weight: 700; font-size: 13px; }
.empty { padding: 30px; text-align: center; color: #777; }
.mini { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .side { display: none; }
  .main { margin-left: 0; }
  .hm-wrap { flex-direction: column; }
  .hm-side { width: 100%; position: static; max-height: none; }
  .stats { flex-wrap: wrap; }
  .stats .label { width: 100%; padding: 14px 20px 0; }
  .stats .cell { flex: 1 1 45%; }
  .cols, .links-wrap { flex-direction: column; }
  .links-wrap .left { width: 100%; }
}
