/* ===== Lumière Affiliate — admin console ===== */
:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #7d8a97;
  --line: #e1e7ee;
  --accent: #3f7cac;
  --accent-deep: #2c6088;
  --ok: #1f7a43;
  --okbg: #e8f3ec;
  --warn: #b5852f;
  --err: #b53b3b;
  --errbg: #fcecec;
  --sans: "Noto Sans JP", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 14px 36px -22px rgba(76, 52, 40, 0.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性を最優先で尊重 (.login/.app の display:grid が UA の [hidden] を上書きしてしまう問題の修正) */
[hidden] { display: none !important; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 15px; }
a { color: var(--accent-deep); }
button { font: inherit; cursor: pointer; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #7fb1d6, var(--accent)); color: #fff; font-weight: 700; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(60% 60% at 70% 10%, rgba(127,177,214,.3), transparent), var(--bg); padding: 1.5rem; }
.login__card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 2.6rem 2.2rem; width: min(420px, 92vw); text-align: center; }
.login__brand { font-size: 1.4rem; display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: .4rem; }
.login__lead { color: var(--muted); margin-bottom: 1.8rem; }
.gbtn { display: inline-flex; align-items: center; gap: .7rem; width: 100%; justify-content: center; background: #fff; border: 1px solid #dadce0; border-radius: 10px; padding: .85rem 1rem; font-weight: 700; color: #3c4043; text-decoration: none; transition: box-shadow .15s, background .15s; }
.gbtn:hover { box-shadow: 0 2px 8px rgba(60,64,67,.2); background: #fafafa; }
.login__err { background: var(--errbg); color: var(--err); border-radius: 10px; padding: .7rem; margin-top: 1.1rem; font-size: .88rem; }
.login__note { color: var(--muted); font-size: .8rem; margin-top: 1.4rem; }

/* ---- app shell ---- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #efe9e2; display: flex; flex-direction: column; padding: 1.3rem 1rem; position: sticky; top: 0; height: 100vh; }
.side__brand { font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem 1.3rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.side__close { display: none; margin-left: auto; background: transparent; border: 0; color: rgba(255,255,255,.7); font-size: 1.05rem; cursor: pointer; padding: .2rem .45rem; border-radius: 7px; }
.side__close:hover { background: rgba(255,255,255,.12); color: #fff; }
.side-backdrop { display: none; }
.side__ctx { padding: 1rem .4rem .2rem; }
.side__ctx label { display: block; font-size: .7rem; letter-spacing: .08em; color: rgba(255,255,255,.5); margin-bottom: .35rem; text-transform: uppercase; }
.side__ctx select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; padding: .55rem .7rem; font: inherit; }
.side__ctx select option { color: #1f2933; }
.side__nav { display: flex; flex-direction: column; gap: .2rem; margin-top: .8rem; flex: 1; }
.side__nav button { background: transparent; border: 0; color: rgba(255,255,255,.72); text-align: left; padding: .7rem .9rem; border-radius: 10px; display: flex; align-items: center; gap: .6rem; transition: background .15s, color .15s; }
.side__nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.side__nav button.on { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; font-weight: 700; }
.side__nav .ico { width: 18px; text-align: center; }
.side__newhq { width: 100%; margin-top: .6rem; background: rgba(255,255,255,.08); color: #fff; border: 1px dashed rgba(255,255,255,.28); border-radius: 9px; padding: .5rem .7rem; font-size: .82rem; }
.side__newhq:hover { background: rgba(255,255,255,.16); }
.side__nav .nav-back { color: rgba(255,255,255,.6); border-bottom: 1px solid rgba(255,255,255,.1); border-radius: 0; margin-bottom: .3rem; }
.side__nav .nav-alert { margin-left: auto; background: #d05a5a; color: #fff; font-size: .66rem; font-weight: 800; padding: .06rem .5rem; border-radius: 999px; white-space: nowrap; }
.side__user { font-size: .8rem; color: rgba(255,255,255,.6); padding: .8rem .5rem 0; border-top: 1px solid rgba(255,255,255,.1); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.6rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.hamburger { display: none; background: transparent; border: 0; font-size: 1.3rem; }
.crumb { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .15rem .1rem; font-size: .9rem; }
.crumb-seg { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink); font-weight: 700; padding: .2rem .15rem; white-space: nowrap; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.crumb-seg.muted { color: var(--muted); font-weight: 600; }
.crumb-seg.link { border: 0; background: transparent; cursor: pointer; border-radius: 7px; }
.crumb-seg.link:hover { background: var(--bg); color: var(--accent-deep); }
.crumb-ico { font-size: .92em; opacity: .85; }
.crumb-sep { color: var(--muted); opacity: .6; padding: 0 .1rem; }
.crumb-role { margin-left: .45rem; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; padding: .18rem .6rem; border-radius: 999px; white-space: nowrap; }
.range { display: flex; gap: .3rem; background: var(--bg); padding: .25rem; border-radius: 10px; }
.range button { border: 0; background: transparent; padding: .35rem .8rem; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: .85rem; }
.range button.on { background: var(--panel); color: var(--ink); box-shadow: 0 2px 6px -3px rgba(0,0,0,.3); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: .7rem; font-size: .88rem; }
.topbar__right img { width: 30px; height: 30px; border-radius: 50%; }
.topbar__right .role { background: var(--accent); color: #fff; font-size: .68rem; padding: .12rem .5rem; border-radius: 999px; font-weight: 700; }
.logout { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .7rem; font-size: .8rem; color: var(--muted); }

.view { padding: 1.6rem; }
.view h1 { font-size: 1.4rem; margin-bottom: .3rem; }
.view .sub { color: var(--muted); margin-bottom: 1.4rem; font-size: .9rem; }
.lp-link { font-weight: 700; white-space: nowrap; }

/* ---- cards / kpi ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.4rem; align-items: start; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: .82rem; }
.kpi .val { font-size: 1.9rem; font-weight: 700; margin-top: .2rem; }
.kpi .val small { font-size: .9rem; color: var(--muted); font-weight: 400; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; margin-bottom: 1.4rem; }
.panel h2 { font-size: 1.05rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
/* ---- この案件のしくみ (フロー図) ---- */
.flowmap { display: flex; align-items: stretch; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: .1rem; flex: 1 1 100px; min-width: 96px; padding: .7rem .4rem; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink); text-align: center; }
.flow-step:hover { border-color: var(--accent); background: #eef5fb; }
.flow-step .fs-ico { font-size: 1.25rem; }
.flow-step b { font-size: .8rem; white-space: nowrap; }
.flow-step .sub { font-size: .72rem; color: var(--muted); }
.flow-arrow { align-self: center; color: var(--accent); font-weight: 800; opacity: .7; }
/* ---- 今日の予約 ---- */
.today-list { display: grid; gap: .4rem; }
.today-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); flex-wrap: wrap; }
.today-row .tr-time { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.today-row .spacer { flex: 1; }
/* ---- QRコード ---- */
.qr-wrap { display: grid; place-items: center; padding: .8rem 0 .4rem; }
.qr-wrap img { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 10px; }
.mgmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.mgmt-tile { display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink); }
.mgmt-tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px -8px rgba(0,0,0,.3); }
.warn-box { background: #fdf3e3; border: 1px solid #e8c98a; border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.4rem; }
.warn-box b { color: #9a5a12; }
.warn-box p { color: var(--ink); font-size: .88rem; line-height: 1.6; margin: .5rem 0 .9rem; }
.mgmt-tile .mi-ico { font-size: 1.3rem; }
.mgmt-tile b { font-size: .95rem; }
.mgmt-tile .sub { font-size: .76rem; color: var(--muted); }
/* ---- 報酬のしくみ ---- */
.reward-model { display: grid; gap: .7rem; }
.rm-row { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.rm-ico { font-size: 1.5rem; line-height: 1.2; }
.rm-body { flex: 1; min-width: 0; }
.rm-body > b { font-size: .92rem; }
.rm-detail { font-size: .9rem; color: var(--ink); margin-top: .25rem; }
.rm-rate { color: var(--accent-deep); font-size: 1.05rem; }
.rm-note { color: var(--muted); font-size: .8rem; line-height: 1.6; margin-top: .8rem; }
.rm-note b { color: var(--ink); }
/* ---- 報酬スケジュール (締め日→支払日) ---- */
.sched-lead { font-size: .95rem; margin-bottom: .9rem; }
.sched-date { color: var(--accent-deep); font-size: 1.15rem; }
.sched-next td { background: #eef5fb; }
.next-pill { display: inline-block; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; padding: .1rem .55rem; border-radius: 999px; vertical-align: middle; margin-left: .3rem; }
/* ---- 予約カレンダー (管理: 日付×時間グリッド) ---- */
.calgrid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.calgrid { border-collapse: collapse; width: max-content; min-width: 100%; }
.calgrid th, .calgrid td { text-align: center; padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.calgrid thead th { padding: .4rem .35rem; font-size: .76rem; font-weight: 700; color: var(--accent-deep); background: var(--bg); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.calgrid thead th.sun { color: #d05a5a; }
.calgrid thead th.sat { color: #4a7bb0; }
.calgrid .cg-dow { font-size: .66rem; font-weight: 500; opacity: .85; }
.calgrid .cg-time { position: sticky; left: 0; z-index: 2; background: var(--panel); padding: 0 .55rem; font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.calgrid thead th.cg-corner { position: sticky; left: 0; z-index: 3; }
.bkg-cell { display: block; width: 100%; min-width: 52px; height: 36px; border: 0; background: transparent; font: inherit; font-size: .8rem; font-weight: 700; line-height: 36px; padding: 0 .2rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bkg-cell.free { color: #2a9d5c; font-size: 1rem; }
.bkg-cell.past { color: #d9cfc4; }
.bkg-cell.rsv { background: var(--bg); color: var(--accent-deep); cursor: pointer; }
.bkg-cell.done { background: #e7f4ec; color: #1f7a4d; cursor: pointer; }
.bkg-cell.ns { background: #efece8; color: #8a8278; cursor: pointer; }
.bkg-cell.blk { background: #fdf0ef; color: #c25555; font-size: .78rem; }
.bkg-cell.blk.staff { background: #f3edfb; color: #7a5ea6; }
/* 予約カレンダーの凡例 (1行のコンパクトなチップ表示) */
.bk-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin-top: .6rem; font-size: .76rem; color: var(--muted); }
.bk-legend .lg { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.bk-legend .lg-chip { display: inline-block; padding: .06rem .45rem; border-radius: 6px; font-size: .72rem; font-weight: 700; line-height: 1.5; }
.bk-legend .lg-chip.free { color: #2a9d5c; background: var(--bg); }
.bk-legend .lg-chip.blk { background: #fdf0ef; color: #c25555; }
.bk-legend .lg-chip.staff { background: #f3edfb; color: #7a5ea6; }
.bk-legend .lg-chip.rsv { background: var(--bg); color: var(--accent-deep); }
.bk-legend .lg-chip.done { background: #e7f4ec; color: #1f7a4d; }
.bk-legend .hint { color: var(--muted); }
/* 予約停止一覧の区分ラベル */
.reason-pill { display: inline-block; background: #fdf0ef; color: #c25555; font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.reason-pill.staff { background: #f3edfb; color: #7a5ea6; }
/* 案件設定の編集権限ラベル */
.perm-pill { display: inline-block; font-size: .7rem; font-weight: 800; padding: .16rem .6rem; border-radius: 999px; white-space: nowrap; }
.perm-pill.mgr { background: #fdf3e3; color: #9a5a12; border: 1px solid #e8c98a; }
.perm-pill.store { background: #e9f1f7; color: var(--accent-deep); border: 1px solid #bcd6e8; }
/* 予約カレンダー上部の枠設定表示 */
.bk-info { color: var(--muted); font-size: .84rem; margin-bottom: .7rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bk-info b { color: var(--ink); }
.calgrid thead th.closed { background: #fdf0ef; color: #c25555; }
.calgrid thead th.clickable { cursor: pointer; }
.calgrid thead th.clickable:hover { text-decoration: underline; }
.cg-closedmark { display: block; font-size: .62rem; font-weight: 700; color: #c25555; }
.chart-wrap { position: relative; height: 300px; }

/* ---- affiliate link box (partner) ---- */
.linkbox { display: flex; gap: .6rem; align-items: stretch; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 220px; font: inherit; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.code-pill { font-family: ui-monospace, monospace; background: var(--bg); border: 1px dashed var(--accent); color: var(--accent-deep); padding: .15rem .55rem; border-radius: 7px; font-weight: 700; }
.chan-line { background: #06c755; color: #fff; font-size: .66rem; font-weight: 800; padding: .08rem .4rem; border-radius: 5px; letter-spacing: .04em; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .7rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #faf8f5; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { font-size: .72rem; padding: .12rem .55rem; border-radius: 999px; font-weight: 700; }
.badge.valid { background: var(--okbg); color: var(--ok); }
.badge.invalid { background: var(--errbg); color: var(--err); }
.badge.pending { background: #fff4e0; color: var(--warn); }
.badge.suspended { background: #eef0f2; color: var(--muted); }
.badge.active, .badge.invited { background: var(--okbg); color: var(--ok); }
.badge.reserved { background: #e7f0f7; color: #2f6da3; }
.badge.confirmed { background: var(--okbg); color: var(--ok); }
.badge.visited { background: var(--okbg); color: var(--ok); }
.badge.no_show { background: #eef0f2; color: var(--muted); }
.badge.cancelled { background: var(--errbg); color: var(--err); }

/* ---- buttons ---- */
.btn { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; border: 0; border-radius: 9px; padding: .55rem 1.1rem; font-weight: 700; font-size: .85rem; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--accent-deep); border: 1px solid var(--line); }
.btn.tiny { padding: .3rem .6rem; font-size: .76rem; border-radius: 7px; }
.btn.danger { background: transparent; color: var(--err); border: 1px solid #eccaca; }
.row-actions { display: flex; gap: .35rem; }

/* ---- forms / modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(40,30,24,.45); display: grid; place-items: center; z-index: 100; padding: 1.2rem; }
.modal { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); width: min(480px, 94vw); padding: 1.6rem; max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 1.1rem; }
.modal label { display: block; font-weight: 700; font-size: .85rem; margin: .9rem 0 .35rem; }
.modal input, .modal select, .modal textarea { width: 100%; font: inherit; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 9px; background: #fcfaf8; }
.modal .hint { color: var(--muted); font-size: .78rem; margin-top: .25rem; }
.modal .confirm-msg { font-size: .92rem; color: var(--ink); margin: -.4rem 0 .2rem; }
.cardform label { display: block; font-weight: 700; font-size: .85rem; margin: .9rem 0 .35rem; }
.cardform label:first-child { margin-top: 0; }
.cardform input, .cardform textarea, .cardform select { width: 100%; font: inherit; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 9px; background: #fcfaf8; }
.cardform .hint { color: var(--muted); font-size: .78rem; margin-top: .5rem; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.4rem; }
.field-err { color: var(--err); font-size: .82rem; margin-top: .6rem; min-height: 1em; }
/* ---- コンテキスト切替メニュー (トップバー右) ---- */
.ctxswitch { position: relative; }
.ctxswitch-btn { display: inline-flex; align-items: center; gap: .5rem; max-width: 380px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: .5rem .85rem; font: inherit; cursor: pointer; color: var(--ink); }
.ctxswitch-btn:hover { border-color: var(--accent); }
.ctxswitch-btn.open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63,124,172,.18); }
.ctxswitch-cur { display: inline-flex; align-items: center; gap: .5rem; max-width: 330px; min-width: 0; font-weight: 700; font-size: .95rem; }
.ctxswitch-cur .cm-ico { flex: none; font-size: 1.05rem; }
.ctxswitch-cur .cm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ctxswitch-cur .cm-role { flex: none; background: var(--accent); color: #fff; font-size: .82rem; font-weight: 800; padding: .22rem .7rem; border-radius: 999px; white-space: nowrap; }
.ctxswitch .caret { color: var(--muted); font-size: .75rem; flex: none; }
.ctxmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 280px; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 44px -14px rgba(0,0,0,.4); padding: .4rem; z-index: 60; }
.ctxmenu[hidden] { display: none; }
.ctxmenu-head { font-size: .72rem; color: var(--muted); font-weight: 700; padding: .35rem .55rem; }
.ctxmenu-row { display: flex; align-items: stretch; gap: .15rem; border-radius: 9px; }
.ctxmenu-row.current { background: var(--bg); }
.ctxmenu-item { flex: 1; display: flex; align-items: center; gap: .55rem; min-width: 0; background: transparent; border: 0; padding: .5rem .55rem; border-radius: 9px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.ctxmenu-item:hover { background: var(--bg); }
.ctxmenu-ico { font-size: 1rem; flex: none; }
.ctxmenu-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.ctxmenu-text b { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.ctxmenu-role { font-size: .72rem; color: var(--muted); font-weight: 700; }
.ctxmenu-check { margin-left: auto; color: var(--accent); font-size: .6rem; }
.ctxmenu-newtab { display: flex; align-items: center; padding: 0 .6rem; color: var(--muted); text-decoration: none; border-radius: 9px; font-weight: 800; }
.ctxmenu-newtab:hover { background: var(--bg); color: var(--accent-deep); }
.ctxmenu-foot { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.ctxmenu-newhq { width: 100%; background: transparent; border: 0; padding: .55rem; border-radius: 9px; text-align: left; font: inherit; font-weight: 700; color: var(--accent-deep); cursor: pointer; }
.ctxmenu-newhq:hover { background: var(--bg); }
.ctxmenu-empty { padding: .55rem; color: var(--muted); font-size: .82rem; }
/* ---- アカウントアイコン + メニュー (最右上) ---- */
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 50%; cursor: pointer; overflow: hidden; }
.acct-btn:hover, .acct-btn.open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63,124,172,.18); }
.acct-btn img { width: 100%; height: 100%; object-fit: cover; }
.acct-ava { font-weight: 800; color: var(--accent-deep); font-size: .95rem; }
.acctmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 44px -14px rgba(0,0,0,.4); padding: .4rem; z-index: 60; }
.acctmenu[hidden] { display: none; }
.acctmenu-head { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.acctmenu-head img { width: 38px; height: 38px; border-radius: 50%; }
.acctmenu-id { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.acctmenu-id b { font-size: .9rem; }
.acctmenu-role { align-self: flex-start; margin-top: .2rem; background: var(--accent); color: #fff; font-size: .64rem; font-weight: 800; padding: .1rem .45rem; border-radius: 999px; }
.acctmenu-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: .55rem; border-radius: 9px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.acctmenu-item:hover { background: var(--bg); }
.acctmenu-item.ops { color: var(--accent-deep); }
.acctmenu-item.danger:hover { background: #fdecec; color: var(--err); }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
select.input, input.input { font: inherit; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }

/* ---- toast ---- */
.toast { position: fixed; bottom: 1.3rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .8rem 1.3rem; border-radius: 10px; box-shadow: var(--shadow); z-index: 200; font-size: .9rem; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

/* ---- 予約詳細の連絡先 (タップで電話/メール) ---- */
.contact-row { display: flex; align-items: center; gap: .6rem; margin: .35rem 0; }
.contact-link { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border: 1px solid var(--accent); border-radius: 9px; color: var(--accent-deep); font-weight: 700; text-decoration: none; font-size: .9rem; }
.contact-link:hover { background: var(--bg); }

/* ---- LINE内ブラウザ警告バナー ---- */
.linewarn { position: fixed; top: 0; left: 0; right: 0; z-index: 300; display: flex; align-items: center; justify-content: center; gap: .5rem .8rem; flex-wrap: wrap; background: #2c2c2a; color: #fff; padding: .6rem 1rem; font-size: .85rem; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.linewarn .lw-ico { color: #ffcc4d; font-weight: 800; }
.linewarn .lw-btn { background: #fff; color: #1f4e6b; font-weight: 800; padding: .35rem .85rem; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.linewarn .lw-btn:hover { background: #eef4f9; }

/* ---- responsive ---- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 80; width: 248px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: translateX(0); }
  .side__close { display: inline-block; }
  .side-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70; }
  .hamburger { display: block; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .crumb { display: none; } /* 狭幅では現在地はメニューボタンの表示に集約 */
  .topbar { padding: .6rem .8rem; gap: .5rem; }
  .topbar__right { gap: .5rem; }
  .ctxswitch-cur { max-width: 60vw; }
  .ctxswitch-cur .cm-name { display: none; }
  .ctxswitch-cur .cm-role { font-size: .9rem; padding: .25rem .8rem; }
  .ctxmenu { min-width: 240px; max-width: calc(100vw - 1.6rem); }
  .acctmenu { min-width: 220px; max-width: calc(100vw - 1.6rem); }
  /* 代理店画面をスマホで見やすく */
  .main { padding: 0; }
  .view { padding: 1rem; }
  .panel { padding: 1rem; margin-bottom: 1rem; }
  .chart-wrap { height: 220px; }
  .toolbar { gap: .5rem; }
  table { font-size: .82rem; }
  td, th { padding: .5rem .55rem; }
}
