/* ============================================================
   共通の見た目
   ------------------------------------------------------------
   方向：白に近い生成りの地／細いけい線／英字は斜体のセリフ体／
         日本語は小さめで静か。色は最小限、数字と表は読みやすさ優先。
   ブラウンは差し色として効かせる。
   ============================================================ */
:root {
  --paper: #faf8f4;           /* 地：ほぼ白の生成り */
  --card: #ffffff;
  --ink: #262220;             /* 文字：真っ黒にしない */
  --ink-soft: #6f6459;
  --ink-faint: #a79a8b;
  --rule: #e8e2d8;            /* けい線はできるだけ細く薄く */
  --rule-strong: #d6ccbd;
  --accent: #8c4b2a;          /* ブラウン：見出し・リンク */
  --accent-dark: #603219;
  --accent-soft: #f3ece3;
  --brand: #da5c2c;           /* AM. のロゴの色：数字の棒・強調 */
  --brand-soft: #fbe8dd;
  --good: #4f6b3e;
  --good-soft: #eef2e9;
  --warn: #9c4426;
  --warn-soft: #fbeae3;

  --sans: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  --serif-en: 'Times New Roman', Times, serif;   /* 英字の斜体に使う */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.9;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* 英字の見出し（斜体セリフ）。このサイトの合図になる形 */
.en, h1 .en, h2 em {
  font-family: var(--serif-en); font-style: italic; font-weight: 400;
  letter-spacing: 0.06em; color: var(--accent);
}

/* ---------- ヘッダー ---------- */
header.top {
  background: var(--paper); color: var(--ink);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 20px;
}
header.top .brand-mark { display: flex; align-items: center; gap: 13px; min-width: 0; }
/* ロゴは白地用の画像なので、黒く落として明るい地に載せる */
header.top .brand-mark img { height: 24px; width: auto; flex-shrink: 0; filter: brightness(0); opacity: 0.86; }
header.top .brand-mark .nm {
  font-size: 12px; letter-spacing: 0.16em; color: var(--ink-soft);
  padding-left: 13px; border-left: 1px solid var(--rule-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
header.top .who { font-size: 11px; color: var(--ink-faint); display: flex; align-items: center; gap: 12px; letter-spacing: 0.04em; }
header.top button.out {
  background: none; color: var(--ink-soft); border: 1px solid var(--rule-strong);
  font-family: inherit; font-size: 10.5px; letter-spacing: 0.1em; padding: 6px 13px; cursor: pointer;
}
header.top button.out:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- メニュー ---------- */
nav.menu { background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 55px; z-index: 40; }
nav.menu .toggle {
  display: none; width: 100%; background: none; border: none; color: var(--ink-soft);
  font-family: inherit; font-size: 11px; letter-spacing: 0.18em;
  padding: 12px 20px; text-align: left; cursor: pointer;
}
nav.menu ul { list-style: none; display: flex; flex-wrap: wrap; padding: 0 12px; }
nav.menu a {
  display: block; color: var(--ink-soft); text-decoration: none;
  font-size: 12px; letter-spacing: 0.1em; padding: 12px 14px;
  border-bottom: 1px solid transparent; margin-bottom: -1px;
}
nav.menu a:hover { color: var(--accent); }
nav.menu a.on { color: var(--ink); border-bottom-color: var(--accent); }

@media (max-width: 560px) {
  /* 幅が狭いときは、ヘッダーをロゴ＋名前＋ログアウトだけにする */
  header.top { padding: 13px 15px; gap: 10px; }
  header.top .brand-mark .nm { display: none; }
  header.top .who { font-size: 10.5px; gap: 9px; }
  header.top .who span { white-space: nowrap; }
}

@media (max-width: 680px) {
  nav.menu { top: 54px; }
  nav.menu .toggle { display: block; }
  nav.menu ul { display: none; flex-direction: column; padding: 0 0 8px; }
  nav.menu.open ul { display: flex; }
  nav.menu a { padding: 9px 20px; border-bottom: none; border-left: 2px solid transparent; margin: 0; }
  nav.menu a.on { border-left-color: var(--accent); }
}

/* ---------- 枠 ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 34px 20px 90px; }

.page-head { margin-bottom: 26px; }
.page-head .en { display: block; font-size: 21px; line-height: 1.3; }
.page-head h1 { font-size: 14px; font-weight: 500; letter-spacing: 0.2em; color: var(--ink-soft); margin-top: 2px; }
.page-head .sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 12px; line-height: 1.85; letter-spacing: 0.02em; }

.note {
  background: none; border: 1px solid var(--rule-strong); border-left: 2px solid var(--accent);
  font-size: 12px; padding: 13px 16px; margin-bottom: 22px; line-height: 1.85; color: var(--ink-soft);
}
.note a { color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--rule); padding: 24px 26px; margin-bottom: 20px; }
.card > h2 {
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; color: var(--ink-soft);
  padding-bottom: 13px; margin-bottom: 20px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 11px;
}
.card > h2 em { font-size: 17px; }

@media (max-width: 560px) { .card { padding: 20px 17px; } main { padding: 26px 15px 72px; } }

/* ---------- 数字タイル ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 1px; margin-bottom: 20px; background: var(--rule); border: 1px solid var(--rule); }
.tile { background: var(--card); padding: 19px 20px; }
.tile .lab { font-size: 10.5px; letter-spacing: 0.12em; color: var(--ink-faint); }
.tile .val { font-size: 27px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 6px; letter-spacing: -0.01em; }
.tile .sub { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; margin-top: 3px; }
.tile .sub a { color: var(--accent); }
.tile.ok .val { color: var(--good); }
.tile.ng .val { color: var(--warn); }

/* ---------- 達成率バー ---------- */
.bar { height: 3px; background: var(--rule); margin-top: 12px; position: relative; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--brand); }
.bar.ok > span { background: var(--good); }
.bar.ng > span { background: var(--warn); }

/* ---------- 表 ---------- */
.scroll { overflow-x: auto; border: 1px solid var(--rule); background: var(--card); max-height: 70vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
thead th {
  background: var(--paper); font-size: 10px; letter-spacing: 0.12em; font-weight: 500;
  color: var(--ink-faint); position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--rule-strong);
}
thead th.name, tbody td.name {
  position: sticky; left: 0; background: var(--paper); z-index: 3; min-width: 140px; white-space: nowrap;
}
tbody td.name { background: var(--card); border-right: 1px solid var(--rule-strong); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fcfaf7; }
tbody tr:hover td.name { background: #fcfaf7; }

.minibar { display: inline-block; height: 3px; background: var(--brand); vertical-align: middle; min-width: 2px; }

/* ---------- 札 ---------- */
.tag { display: inline-block; font-size: 10px; letter-spacing: 0.08em; padding: 3px 9px; white-space: nowrap; border: 1px solid; }
.tag-ok { border-color: var(--good); color: var(--good); }
.tag-ng { border-color: var(--warn); color: var(--warn); }
.tag-mute { border-color: var(--rule-strong); color: var(--ink-faint); }

/* ---------- 入力 ---------- */
label.f { display: block; font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-faint); margin: 20px 0 7px; }
label.f:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--rule-strong); padding: 11px 13px;
}
input:focus, textarea:focus, select:focus { outline: 1px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 118px; line-height: 1.85; resize: vertical; font-size: 14px; }

button.btn {
  font-family: inherit; font-size: 11px; letter-spacing: 0.18em;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 13px 26px; cursor: pointer;
}
button.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.btn:disabled { background: var(--ink-faint); border-color: var(--ink-faint); cursor: not-allowed; }
button.btn.ghost { background: none; color: var(--accent); }
button.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }
button.btn.sm { font-size: 10px; padding: 7px 14px; letter-spacing: 0.1em; }

.msg { font-size: 12.5px; padding: 11px 15px; margin-top: 16px; display: none; line-height: 1.8; }
.msg.show { display: block; }
.msg.err { border: 1px solid var(--warn); color: var(--warn); }
.msg.ok { border: 1px solid var(--good); color: var(--good); }

.row { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink-soft); font-size: 12px; }
.empty { color: var(--ink-faint); font-size: 12px; padding: 30px 0; text-align: center; letter-spacing: 0.08em; }

/* ---------- ログイン画面 ---------- */
body.login { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 420px; }
/* 売場の写真そのものが看板なので、ロゴは重ねない */
.login-box .hero {
  position: relative; height: 212px;
  display: flex; align-items: flex-end; justify-content: center;
  background: #2b1d15 url('/hero.jpg') 50% 38% / cover no-repeat;
  border: 1px solid var(--rule); border-bottom: none;
}
.login-box .hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(38,25,17,0.04) 38%, rgba(38,25,17,0.42) 74%, rgba(38,25,17,0.82) 100%);
}
.login-box .hero .s {
  position: relative; z-index: 1; padding-bottom: 17px;
  font-size: 10.5px; letter-spacing: 0.3em; color: rgba(255,255,255,0.92);
}
.login-box .body { background: var(--card); border: 1px solid var(--rule); padding: 30px 28px; }
.login-box button.btn { width: 100%; margin-top: 26px; }
.login-box .foot { font-size: 11px; color: var(--ink-faint); text-align: center; margin-top: 22px; line-height: 1.95; }

/* ---------- お知らせ ---------- */
.news-item { border-bottom: 1px solid var(--rule); padding: 20px 0; }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-item .nh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.news-item .nt { font-size: 14px; font-weight: 500; letter-spacing: 0.02em; }
.news-item .nd { font-size: 10.5px; color: var(--ink-faint); margin-left: auto; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.news-item .nb { font-size: 13px; color: var(--ink-soft); white-space: pre-wrap; margin-top: 9px; line-height: 1.95; }

/* ---------- 売場のバナー（売上・全体のトップ） ---------- */
.banner {
  position: relative;
  background: #2b1d15 url('/hero.jpg') 54% 42% / cover no-repeat;
  border-bottom: 1px solid var(--rule);
}
.banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg,
    rgba(38,25,17,0.82) 0%, rgba(38,25,17,0.62) 42%, rgba(38,25,17,0.12) 100%);
}
.banner .inner {
  position: relative; z-index: 1; color: #fff;
  max-width: 1040px; margin: 0 auto; padding: 44px 20px 42px;
}
.banner .ev {
  font-family: var(--serif-en), 'Noto Serif JP', serif;
  font-style: italic; font-weight: 400; font-size: 27px;
  letter-spacing: 0.04em; line-height: 1.3;
}
.banner .vn {
  font-size: 11.5px; letter-spacing: 0.2em; margin-top: 15px;
  color: rgba(255,255,255,0.88);
}
.banner .dt {
  font-size: 10.5px; letter-spacing: 0.1em; margin-top: 9px;
  color: rgba(255,255,255,0.64); font-variant-numeric: tabular-nums;
}
.banner .dt .demo {
  display: inline-block; margin-left: 10px; padding: 3px 9px;
  border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.8);
  letter-spacing: 0.06em;
}
@media (max-width: 680px) {
  .banner { background-position: 56% 44%; }
  .banner .inner { padding: 30px 15px 28px; }
  .banner .ev { font-size: 20px; }
  .banner .vn { font-size: 10.5px; letter-spacing: 0.14em; margin-top: 11px; }
  .banner .dt .demo { display: block; margin: 8px 0 0; }
}

/* ---------- 売場の写真 ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-top: 14px; }
.shots img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 1px solid var(--rule); background: var(--accent-soft); display: block;
  cursor: zoom-in; transition: opacity .15s;
}
.shots img:hover { opacity: .88; }
.shot-pick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.shot-pick .thumb { position: relative; }
.shot-pick img { width: 104px; height: 78px; object-fit: cover; border: 1px solid var(--rule); display: block; }
.shot-pick button {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--warn); background: #fff; color: var(--warn); font-size: 12px; line-height: 1; cursor: pointer;
}

/* 写真を大きく見る */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(28, 23, 20, 0.9); padding: 24px;
  align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 10px 50px rgba(0,0,0,.4); }
.lightbox .close {
  position: absolute; top: 18px; right: 22px; background: none; border: none;
  color: #fff; font-size: 24px; line-height: 1; cursor: pointer; opacity: .8;
}

/* ---------- 取り込みのドロップ枠 ---------- */
.drop { border: 1px dashed var(--rule-strong); background: var(--card); padding: 40px 20px; text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); border-style: solid; }
.drop .d1 { font-size: 13px; letter-spacing: 0.08em; }
.drop .d2 { font-size: 11px; color: var(--ink-faint); margin-top: 8px; letter-spacing: 0.04em; }
