/* 花秘書 ギフトキャンペーン管理 v3.1
   墨（#32323c）のサイドバーに金をひと筋。作業面は静かに、数字は Lato で読みやすく */

:root {
  --ink: #32323c;
  --ink-2: #4a4a55;
  --text: #2f2f37;
  --muted: #6c6b73;
  --line: #e6e4dd;
  --line-strong: #d6d3c8;
  --bg: #f4f4f2;
  --panel: #ffffff;
  --gold: #91854a;
  --gold-text: #7a6e3c;
  --gold-hover: #6a5f33;
  --gold-soft: #c9b97a;
  --gold-pale: #f7f3e6;
  --ok: #2b6a47;  --ok-bg: #e6f2ea;
  --bad: #9d3333; --bad-bg: #fbe9e9; --bad-line: #efc9c9;
  --warn: #7a5510; --warn-bg: #fbf0d6; --warn-line: #ecd59c;
  --info: #33506f; --info-bg: #e8eef6; --info-line: #cbd8e8;
  --radius: 8px;
  --radius-sm: 5px;
  --focus: 0 0 0 3px rgba(145, 133, 74, .4);
  /* サイドバー（花秘書ゴールド。白文字を読みやすくするため少し深め） */
  --side: #7a6e3c;
  --side-text: #f5f1e6;
  --side-muted: #ddd5bb;
  --font: "Lato", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.adm {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-text); text-underline-offset: 3px; }
a:hover { color: var(--gold-hover); }
code { font-family: "Lato", ui-monospace, monospace; font-size: .92em; background: #f1efe8; color: var(--ink-2); padding: 1px 6px; border-radius: 4px; }
h1, h2, h3 { color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }

.ico { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: "Lato", var(--font); font-variant-numeric: tabular-nums; }
.mono { font-family: "Lato", var(--font); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.t-right { text-align: right; }
.t-bad { color: var(--bad); font-weight: 700; }
.req { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--bad); font-weight: 500; }
.link-quiet { color: var(--muted); font-size: 13px; text-decoration: none; }
.link-quiet:hover { color: var(--gold-text); text-decoration: underline; }

/* ---------- 骨組み ---------- */
.adm-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.adm-side {
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0 14px 18px;
}
.adm-brand {
  display: block;
  padding: 30px 12px 26px;
  margin-bottom: 14px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
}
.adm-brand__logo { display: block; width: 132px; height: auto; }
.adm-brand__sub::before {
  content: "";
  display: block;
  width: 18px;
  height: 1px;
  background: rgba(255, 255, 255, .75);
  margin: 16px 0 10px;
}
.adm-brand__sub { display: block; font-size: 11.5px; color: var(--side-muted); letter-spacing: .06em; }

.adm-nav { display: flex; flex-direction: column; gap: 2px; }
.adm-nav a, .adm-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 0;
  color: var(--side-text);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: .02em;
}
.adm-nav a:hover, .adm-logout:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.adm-nav a.is-active {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #fff;
}
.adm-nav a.is-active .ico { color: #fff; }
.adm-side__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); }
.adm-user { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 12px; margin-bottom: 2px; color: var(--side-text); text-decoration: none; }
.adm-user:hover, .adm-user.is-active { background: rgba(255, 255, 255, .14); color: #fff; }
.adm-user__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-user__role { font-size: 11px; color: var(--side-muted); flex: none; }
.adm-logout { font-size: 13px; color: var(--side-muted); }

.adm-main { padding: 34px 44px 28px; max-width: 1280px; width: 100%; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.adm-head h1 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: .04em; line-height: 1.4; }
.adm-head__lead { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 46em; }
.adm-head__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.adm-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.adm-back .ico { width: 15px; height: 15px; }
.adm-foot { margin-top: 48px; color: #a3a2a8; font-size: 11.5px; letter-spacing: .04em; }

/* ---------- 部品 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__title { margin: 0 0 12px; font-size: 15px; font-weight: 500; letter-spacing: .03em; }
.panel > .muted:first-of-type { margin-top: -4px; }
.section { margin-top: 30px; }
.section__title { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .08em; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split > .section { margin-top: 30px; }
.split > .panel { margin-top: 20px; }
.split--wide-left { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .03em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn .ico { width: 16px; height: 16px; }
.btn--primary { background: var(--gold); color: #fff; font-weight: 700; }
.btn--primary:hover { background: var(--gold-text); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #24242c; color: #fff; }
.btn--ghost { border-color: var(--line-strong); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--gold-text); color: var(--gold-text); }
.btn--danger-ghost { border-color: var(--bad-line); color: var(--bad); }
.btn--danger-ghost:hover { background: var(--bad-bg); color: var(--bad); }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn:disabled { background: #e7e6e1; border-color: transparent; color: #9a9aa0; cursor: not-allowed; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.8;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--bad { background: var(--bad-bg); color: var(--bad); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--neutral { background: #efeee9; color: #5e5d64; }
.pill--muted { background: #efefef; color: #77767c; }
.pill--neutral::before, .pill--muted::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

.notice { margin: 0 0 18px; padding: 12px 16px; border: 1px solid; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.8; }
.notice ul { margin: 6px 0 0; padding-left: 1.3em; }
.notice--success { background: var(--ok-bg); border-color: #c3dfcd; color: #22573a; }
.notice--error { background: var(--bad-bg); border-color: var(--bad-line); color: #862b2b; }
.notice--warn { background: var(--warn-bg); border-color: var(--warn-line); color: #684a10; }
.notice--info { background: var(--info-bg); border-color: var(--info-line); color: #2c4560; }

.empty { margin: 0; color: var(--muted); }
.empty--block { padding: 44px 24px; text-align: center; display: grid; justify-items: center; gap: 14px; }
.empty--block p { margin: 0; }
.empty--ok { display: flex; align-items: center; gap: 8px; color: var(--ok); }

/* ---------- フォーム ---------- */
.form { display: grid; gap: 14px; }
.form--row { grid-template-columns: 1fr auto; align-items: end; }
.field { display: grid; gap: 6px; margin: 0; }
.panel .field + .field { margin-top: 14px; }
.grid-2 .field + .field { margin-top: 0; }
.grid-2 > .field { margin-bottom: 14px; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); letter-spacing: .03em; }
.field__hint { font-size: 12px; color: var(--muted); }
.field__error { margin: 6px 0 0; font-size: 12.5px; color: var(--bad); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
textarea { line-height: 1.85; resize: vertical; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236c6b73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.is-invalid { border-color: #d59b9b !important; background: #fffafa !important; }
.mono-area { font-size: 13.5px; }
.fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.fieldset legend { padding: 0; margin-bottom: 10px; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--gold-text); }
.input-affix { position: relative; display: block; }
.input-affix input { padding-right: 58px !important; text-align: right; font-family: "Lato", var(--font); font-variant-numeric: tabular-nums; }
.input-affix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--muted); pointer-events: none; }
.tokens { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- 表 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  position: sticky;
  top: 0;
  background: #faf9f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #efede7; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf8; }
.table--compact td { padding: 9px 14px; }
.table--orders td { white-space: nowrap; }
.table .t-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.rowlink { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.rowlink:hover { color: var(--gold-text); border-color: var(--gold-text); }

.filters { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, 1fr)) auto; gap: 12px; align-items: end; padding: 16px 18px; }
.field--search { position: relative; }
.field--search .ico { position: absolute; left: 11px; bottom: 10px; color: var(--muted); }
.field--search input { padding-left: 36px !important; }
.filters__actions { display: flex; align-items: center; gap: 12px; }
.listhead { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 8px; font-size: 13px; color: var(--muted); }
.listhead p { margin: 0; }
.listhead strong { color: var(--ink); font-size: 16px; margin-right: 2px; }
.pager { display: flex; justify-content: center; gap: 4px; margin-top: 18px; }
.pager a, .pager__cur { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; color: var(--ink-2); }
.pager a:hover { background: #fff; }
.pager__cur { background: var(--ink); color: #fff; }

.kv { margin: 0; display: grid; gap: 0; }
.kv > div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid #efede7; }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; word-break: break-all; }
.kv--tight > div { padding: 6px 0; }
.kv + .muted, .kv + p { margin-top: 12px; }
.kv--code > div { grid-template-columns: 9.5em 1fr; }
.kv--inline { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.kv--inline > div { display: flex; gap: 10px; padding: 0; border: 0; align-items: center; }
.tier-chip { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 9px; border-radius: 4px; background: #f3f1ea; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }

/* ---------- ダッシュボード ---------- */
.period { position: relative; display: flex; align-items: center; gap: 24px; padding: 22px 26px 26px; overflow: hidden; }
.period__main { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; flex: 1; }
.period__dates { margin: 0; display: flex; align-items: center; gap: 14px; font-size: 19px; color: var(--ink); letter-spacing: .03em; }
.period__sep { width: 26px; height: 1px; background: var(--line-strong); }
.period__note { margin: 0; color: var(--muted); font-size: 13px; }
.period__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #efede6; }
.period__bar span { display: block; height: 100%; background: var(--gold); }

.funnel { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.funnel__step { position: relative; display: grid; gap: 2px; padding: 18px 18px 20px; }
.funnel__step + .funnel__step { border-left: 1px solid var(--line); }
.funnel__step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  z-index: 1;
  width: 10px;
  height: 10px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.funnel__label { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.funnel__value { font-family: "Lato", var(--font); font-weight: 700; font-size: 32px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.funnel__rate { font-size: 12px; color: var(--muted); }
.funnel__step--goal { background: var(--gold-pale); }
.funnel__step--goal .funnel__value { color: var(--gold-text); }

.stock { display: grid; gap: 20px; }
.stock__row + .stock__row { padding-top: 18px; border-top: 1px solid #efede7; }
.stock__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stock__amount { font-family: "Lato", var(--font); font-size: 20px; color: var(--ink); }
.stock__amount small, .inv__amount small, .verdict__value small, .detail__gift-value small { font-family: var(--font); font-size: 12px; color: var(--muted); margin-left: 3px; }
.stock__avail { font-size: 12.5px; color: var(--muted); }
.stock__avail strong { font-family: "Lato", var(--font); font-size: 18px; color: var(--ink); font-weight: 700; }
.stock__bars { display: grid; gap: 4px; }
.stock__bar { display: block; height: 7px; border-radius: 4px; min-width: 2px; }
.stock__bar--avail { background: var(--gold); }
.stock__bar--demand { height: 3px; background: #9d9ba6; }
.stock__meta { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.stock__short { color: var(--bad); font-weight: 700; }
.stock__legend { display: flex; gap: 18px; padding-top: 14px; border-top: 1px solid #efede7; font-size: 12px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; vertical-align: middle; width: 16px; margin-right: 6px; border-radius: 2px; }
.lg--avail::before { height: 7px; background: var(--gold); }
.lg--demand::before { height: 3px; background: #9d9ba6; }

.todo { list-style: none; margin: -6px 0; padding: 0; }
.todo__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0 12px 14px; border-top: 1px solid #efede7; position: relative; }
.todo__item:first-child { border-top: 0; }
.todo__item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; }
.todo__item--bad::before { background: #c45555; }
.todo__item--warn::before { background: #d6a84a; }
.todo__item--info::before { background: #8ea3bb; }
.todo__item p { margin: 0; font-size: 13.5px; line-height: 1.75; }

/* ---------- 取込 ---------- */
.steps { list-style: none; counter-reset: step; display: flex; gap: 0; margin: 0 0 20px; padding: 0; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 10px; color: #9a99a0; font-size: 13px; }
.steps li + li::before { content: ""; width: 38px; height: 1px; background: var(--line-strong); margin: 0 14px; }
.steps span::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: "Lato", var(--font);
  font-size: 12px;
  background: #fff;
}
.steps li.is-current { color: var(--ink); font-weight: 500; }
.steps li.is-current span::before { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.is-done span::before { content: "✓"; background: var(--gold-pale); border-color: var(--gold-soft); color: var(--gold-text); }

.drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 24px;
  border: 1.5px dashed #cfcab9;
  border-radius: var(--radius);
  background: #fbfaf7;
  text-align: center;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--gold); background: var(--gold-pale); }
.drop:focus-within { box-shadow: var(--focus); }
.drop__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--gold-text); margin-bottom: 4px; }
.drop__icon .ico { width: 20px; height: 20px; }
.drop__title { font-size: 15px; font-weight: 500; color: var(--ink); }
.drop__hint { font-size: 12.5px; color: var(--muted); }
.drop.has-file { border-style: solid; border-color: var(--gold-soft); background: var(--gold-pale); }
.drop--compact { padding: 26px 20px; }
.upload__foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.upload__foot--end { justify-content: flex-end; }
.upload__foot .kv dt { font-size: 12.5px; }

.filebar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.filebar p { margin: 0; }
.filebar__name { font-weight: 700; color: var(--ink); word-break: break-all; }
.filebar--inner { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #efede7; }

.warnlist { margin-top: 22px; }
.warnlist summary { cursor: pointer; font-weight: 500; }
.warnlist ul { max-height: 240px; overflow: auto; }

.verdict { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.verdict--inner { padding: 0 0 18px; }
.verdict__main { display: grid; gap: 2px; }
.verdict__label { font-size: 13px; color: var(--muted); }
.verdict__value { font-family: "Lato", var(--font); font-weight: 700; font-size: 44px; line-height: 1.15; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.verdict__split { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.verdict__split strong { font-family: "Lato", var(--font); font-size: 15px; }
.verdict__rest { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid #efede7; }
.verdict__rest > div { padding: 8px 0 8px 22px; }
.verdict__rest dt { font-size: 12px; color: var(--muted); }
.verdict__rest dd { margin: 0; font-family: "Lato", var(--font); font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }

.commitbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 -10px 24px -18px rgba(50, 50, 60, .35);
}
.commitbar__text { margin: 0; color: var(--muted); font-size: 13px; }
.commitbar--inner { position: static; box-shadow: none; border: 0; border-top: 1px solid #efede7; border-radius: 0; margin: 18px -24px -22px; padding: 16px 24px; background: #faf9f6; }

/* ---------- ダイアログ ---------- */
.dialog { width: min(580px, 92vw); padding: 0; border: 0; border-radius: 12px; color: var(--text); box-shadow: 0 30px 80px -24px rgba(20, 20, 30, .5); }
.dialog::backdrop { background: rgba(38, 38, 46, .55); }
.dialog__body { padding: 26px 28px 22px; display: grid; gap: 16px; }
.dialog__title { margin: 0; font-size: 18px; font-weight: 500; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice__item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.choice__item input { margin-top: 4px; accent-color: var(--gold-text); }
.choice__item > span { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; flex: 1; }
.choice__item:has(input:checked) { border-color: var(--gold); background: var(--gold-pale); }
.choice__item:has(input:disabled) { opacity: .55; cursor: default; }
.choice__count { font-size: 18px; color: var(--ink); }
.choice__sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.progress { display: grid; gap: 6px; }
.progress__bar { height: 6px; background: #ecebe6; border-radius: 3px; overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s ease; }
.progress.is-done .progress__bar span { background: #3c8a62; }
.progress.is-error .progress__bar span { background: #b44b4b; }
.progress__text { margin: 0; font-size: 13px; }

/* ---------- 注文詳細 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail__gift { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid #efede7; }
.detail__gift-label { font-size: 12.5px; color: var(--muted); }
.detail__gift-value { font-family: "Lato", var(--font); font-weight: 700; font-size: 38px; line-height: 1.1; color: var(--gold-text); }
.detail__summary .kv dd a { display: inline-flex; align-items: center; gap: 6px; }
.detail__summary .kv dd .field__hint { display: block; margin-top: 2px; }

.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline__item { position: relative; display: flex; gap: 14px; padding-bottom: 16px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: -2px; width: 1px; background: var(--line-strong); }
.timeline__dot { flex: none; width: 11px; height: 11px; margin-top: 6px; border-radius: 50%; border: 1.5px solid #bdbac2; background: #fff; position: relative; z-index: 1; }
.timeline__item--done .timeline__dot { background: var(--gold); border-color: var(--gold); }
.timeline__item--bad .timeline__dot { background: #c45555; border-color: #c45555; }
.timeline__item--warn .timeline__dot { background: #d6a84a; border-color: #d6a84a; }
.timeline__label { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink); }
.timeline__item--todo .timeline__label { color: #8f8e95; }
.timeline__at { color: var(--muted); font-size: 12.5px; }
.timeline__note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.timeline__item--bad .timeline__note { color: var(--bad); }
.timeline__item--warn .timeline__note { color: var(--warn); }

/* ---------- ギフトURL ---------- */
.inventory { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.inv { display: grid; gap: 6px; }
.inv--short { border-top: 3px solid #d6a84a; padding-top: 20px; }
.inv__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.inv__amount { font-family: "Lato", var(--font); font-size: 17px; color: var(--ink); }
.inv__avail { margin: 0; }
.inv__avail .num { font-weight: 700; font-size: 42px; line-height: 1.15; color: var(--ink); }
.inv__avail small { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.meter { height: 5px; background: #ecebe6; border-radius: 3px; overflow: hidden; margin: 4px 0 6px; }
.meter span { display: block; height: 100%; background: var(--gold-soft); }
.inv__meta { margin: 0; display: flex; gap: 22px; }
.inv__meta dt { font-size: 12px; color: var(--muted); }
.inv__meta dd { margin: 0; font-size: 15px; color: var(--ink-2); }
.assign-list { list-style: none; margin: 0; padding: 0; }
.assign-list { columns: 2 320px; column-gap: 0; }
.assign-list li { break-inside: avoid; display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid #efede7; font-size: 13px; }
.assign-list li:first-child { border-top: 0; }
.assign-list a { color: var(--ink); font-weight: 700; text-decoration: none; }

/* ---------- メール確認 ---------- */
.tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs a { display: grid; gap: 1px; padding: 10px 22px 12px; margin-bottom: -1px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; }
.tabs a span { font-size: 11.5px; font-weight: 400; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.mail { padding: 0; overflow: hidden; }
.mail__head { padding: 16px 24px; background: #faf9f6; border-bottom: 1px solid var(--line); }
.mail__head .kv > div { grid-template-columns: 5em 1fr; }
.mail__body { margin: 0; padding: 26px 28px 30px; white-space: pre-wrap; word-break: break-all; font-family: var(--font); font-size: 14px; line-height: 1.95; color: var(--text); max-width: 46em; }
.mail__url { background: #f3eed9; color: var(--gold-hover); padding: 1px 4px; border-radius: 3px; }
.mail__foot { margin: 0; padding: 0 28px 20px; }

/* ---------- 設定 ---------- */
.settings { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings__nav { position: sticky; top: 24px; display: grid; gap: 2px; }
.settings__nav a { padding: 7px 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-size: 13.5px; border-left: 2px solid transparent; }
.settings__nav a:hover { background: #fff; color: var(--gold-text); border-left-color: var(--gold-soft); }
.settings__body { display: grid; gap: 18px; }
.setting { scroll-margin-top: 20px; }
.tiers { display: grid; gap: 8px; margin: 6px 0 12px; max-width: 560px; }
.tiers__head, .tiers__row { display: grid; grid-template-columns: 1fr 20px 1fr 56px; gap: 10px; align-items: center; }
.tiers__head span { font-size: 12px; color: var(--muted); }
.tiers__arrow { color: var(--gold); text-align: center; }
.colmap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 8px; }
.colmap .field + .field { margin-top: 0; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 14px 20px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -10px 24px -18px rgba(50, 50, 60, .35); }
.savebar__text { margin: 0 auto 0 0; color: var(--warn); font-size: 13px; visibility: hidden; }
.is-dirty .savebar__text { visibility: visible; }

/* ---------- ログイン・初期設定 ---------- */
.adm--center { background: var(--ink); min-height: 100vh; }
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 26px; padding: 40px 16px; }
.auth__brand { text-align: center; }
.auth__brand .adm-brand__logo { width: 176px; margin: 0 auto; } /* ログイン・初期設定はゴールドのロゴ（logo-gold.png） */
.auth__brand .adm-brand__sub::before { margin: 18px auto 10px; }
.auth__panel { width: min(400px, 92vw); padding: 32px 32px 30px; border: 0; border-radius: 10px; }
.auth__panel--wide { width: min(620px, 94vw); }
.auth__title { margin: 0 0 18px; font-size: 19px; font-weight: 500; letter-spacing: .06em; }
.auth .btn--block { margin-top: 6px; height: 44px; }

/* ---------- 画面幅 ---------- */
@media (max-width: 1100px) {
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .field--search { grid-column: 1 / -1; }
  .verdict { grid-template-columns: 1fr; }
  .verdict__rest { border-left: 0; border-top: 1px solid #efede7; grid-template-columns: repeat(4, 1fr); }
  .verdict__rest > div { padding: 12px 12px 0 0; }
}
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-side { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0 12px; }
  .adm-brand { padding: 12px 8px; margin: 0; border: 0; display: flex; align-items: center; gap: 12px; }
  .adm-brand__logo { width: 92px; }
  .adm-brand__sub::before { display: none; }
  .adm-side__foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .adm-user { display: none; }
  .adm-logout span { display: none; }
  .adm-nav { order: 3; flex-direction: row; overflow-x: auto; width: calc(100% + 24px); margin: 0 -12px; padding: 0 12px 10px; gap: 4px; scrollbar-width: none; }
  .adm-nav a { white-space: nowrap; padding: 7px 11px; font-size: 13px; }
  .adm-nav a.is-active { box-shadow: inset 0 -3px 0 #fff; }
  .adm-main { padding: 22px 16px 24px; }
  .adm-head { flex-direction: column; align-items: stretch; }
  .adm-head__actions { justify-content: flex-start; }
  .split, .split--wide-left, .detail, .settings, .colmap, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .period__dates { font-size: 16px; gap: 10px; flex-wrap: wrap; }
  .funnel__step { padding: 16px 16px 18px; }
  .funnel__value { font-size: 28px; }
  .funnel { grid-template-columns: 1fr 1fr; }
  .funnel__step:nth-child(odd) { border-left: 0; }
  .funnel__step:nth-child(n+3) { border-top: 1px solid var(--line); }
  .funnel__step:nth-child(even)::after { display: none; }
  .settings__nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .settings__nav a { white-space: nowrap; border: 1px solid var(--line); background: #fff; }
  .period { flex-direction: column; align-items: flex-start; gap: 10px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .verdict__rest { grid-template-columns: 1fr 1fr; }
  .commitbar { flex-direction: column; align-items: stretch; }
  .steps li + li::before { width: 14px; margin: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 送信先メールアドレスの変更（v3.2） ---------- */
.email-change { margin-top: 20px; scroll-margin-top: 20px; }
.email-change__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.email-change .form { gap: 0; }
.email-change .form > * + * { margin-top: 14px; }
.email-change .hint strong { color: var(--ink); }
.checklist { background: #faf9f6; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; }
.checklist__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.checklist ol { margin: 0; padding-left: 1.4em; font-size: 13px; line-height: 1.8; }
.checklist li + li { margin-top: 4px; }
.change-log { list-style: none; margin: 0; padding: 0; }
.change-log li { padding: 12px 0; border-top: 1px solid #efede7; }
.change-log li:first-child { border-top: 0; padding-top: 4px; }
.change-log p { margin: 0; }
.change-log__head { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.change-log__emails { margin-top: 4px !important; font-size: 13.5px; word-break: break-all; }
.change-log__arrow { color: var(--gold); margin: 0 8px; }
.change-log__meta { margin-top: 4px !important; font-size: 12.5px; color: var(--muted); }
@media (max-width: 900px) { .email-change__grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- v3.3 ---------- */
.rule { border: 0; border-top: 1px solid #efede7; margin: 22px 0 18px; }
.panel__subtitle { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.settings__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 18px; }
.settings__fieldset:disabled input, .settings__fieldset:disabled select, .settings__fieldset:disabled textarea { background: #f7f6f2; color: #6c6b73; cursor: not-allowed; }
.alert-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #efede7; font-size: 13px; }
.period__deadline { margin: 0; font-size: 13px; color: var(--ink-2); }
.period__deadline strong { font-weight: 700; }
.split > .panel + .panel { margin-top: 20px; }
@media (max-width: 900px) { .adm-user__role { display: none; } }

/* ---------- v3.4 ---------- */
.t-ok { color: var(--ok); font-weight: 700; }
.t-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verdict__rest { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .verdict__rest { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 1240px) and (min-width: 901px) {
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funnel__step:nth-child(3n+1) { border-left: 0; }
  .funnel__step:nth-child(n+4) { border-top: 1px solid var(--line); }
  .funnel__step:nth-child(3n)::after { display: none; }
}

/* ---------- v3.5：削除まわり ---------- */
.panel.danger { border-color: var(--bad-line); }
.panel.danger .panel__title { color: var(--bad); }
.btn--danger { background: #a83a3a; color: #fff; font-weight: 700; }
.btn--danger:hover { background: #8f2f2f; color: #fff; }
.settings__nav-danger { color: var(--bad) !important; }
.settings__nav-danger:hover { border-left-color: var(--bad) !important; color: var(--bad) !important; }

/* パネル同士・パネルと2段組みの間に余白 */
.adm-main > .panel + .panel,
.adm-main > .split + .panel,
.adm-main > .panel + .split,
.adm-main > .split + .split,
.adm-main > .detail + .panel,
.adm-main > .notice + .panel { margin-top: 20px; }

/* ---------- マニュアル ---------- */
.manual-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.manual-toc { position: sticky; top: 20px; max-height: calc(100vh - 60px); overflow-y: auto; display: grid; gap: 1px; font-size: 13px; }
.manual-toc__title { margin: 0 0 8px; font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.manual-toc__item { display: block; padding: 5px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; }
.manual-toc__item:hover { background: #fff; color: var(--gold-text); border-left-color: var(--gold-soft); }
.manual-toc__item--h1 { font-weight: 700; color: var(--ink); margin-top: 8px; }
.manual-toc__item--h2 { padding-left: 20px; font-size: 12.5px; }
.manual { padding: 28px 32px 36px; line-height: 1.9; }
.manual .mn-h1 { margin: 34px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); font-size: 21px; font-weight: 700; color: var(--ink); scroll-margin-top: 20px; }
.manual > .mn-h1:first-child { margin-top: 0; }
.manual .mn-h2 { margin: 28px 0 10px; padding-left: 10px; border-left: 4px solid var(--gold); font-size: 17px; font-weight: 700; color: var(--ink); scroll-margin-top: 20px; }
.manual h3 { margin: 20px 0 6px; font-size: 14.5px; color: var(--gold-text); }
.manual p { margin: 0 0 10px; font-size: 14px; }
.manual img { max-width: 100%; height: auto; display: block; margin: 14px auto; border: 1px solid var(--line); border-radius: 4px; }
.manual table { width: 100% !important; border-collapse: collapse; margin: 12px 0 16px; font-size: 13px; }
.manual td, .manual th { border: 1px solid var(--line) !important; padding: 8px 10px; vertical-align: top; }
.manual ol, .manual ul { margin: 0 0 12px; padding-left: 1.5em; font-size: 14px; }
.manual li { margin-bottom: 4px; }
@media (max-width: 900px) { .manual-wrap { grid-template-columns: minmax(0, 1fr); } .manual-toc { position: static; max-height: none; } .manual { padding: 20px 16px 26px; } }
@media print {
  .adm-side, .adm-head__actions, .manual-toc, .adm-foot { display: none !important; }
  .adm-shell { grid-template-columns: 1fr; }
  .adm-main { padding: 0; }
  .manual { border: 0; padding: 0; }
}

/* マニュアル本文の注意・ポイントをカード表示にする */
.manual .mn-note {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 13.5px;
  line-height: 1.85;
}
.manual .mn-note--caution { background: #fff5f7; border-left-color: #ff2456; }
.manual .mn-note--point { background: #faf7ec; border-left-color: #91854a; }
.manual .mn-note p { margin: 0 0 6px; padding: 0; background: none; border: 0; line-height: inherit; }
.manual .mn-note p:first-child { margin-bottom: 8px; font-size: 14px; }
.manual .mn-note p:last-child { margin-bottom: 0; }
.manual .mn-note p:first-child b { letter-spacing: .02em; }

/* マニュアル本文の書体を管理画面に合わせる（Word変換で残る font 指定を無効化） */
.manual font { font-family: inherit !important; }
.manual [lang] { font-family: inherit; }
