/* GLOG 管理サイト（milligram の上に重ねる最小限のスタイル） */
:root {
    --admin-ink: #1f2933;
    --admin-muted: #616e7c;
    --admin-line: #d9dee3;
    --admin-bg: #f5f7f9;
    --admin-accent: #1f5fa8;
    --admin-warn-bg: #fff4e5;
    --admin-warn-ink: #8a4b00;
}

body {
    background: var(--admin-bg);
    color: var(--admin-ink);
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
    font-size: 1.5rem;
}

h1 { font-size: 2.4rem; margin-bottom: 2rem; }

.button, button, input[type="submit"] { background-color: var(--admin-accent); border-color: var(--admin-accent); }
.button.button-outline { background-color: transparent; color: var(--admin-accent); }

/* ヘッダー */
.admin-header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--admin-line);
    display: flex;
    gap: 1.6rem;
    justify-content: space-between;
    padding: 0.8rem 2rem;
}
.admin-brand { color: var(--admin-ink); font-size: 1.8rem; font-weight: 700; }
.admin-account { align-items: center; display: flex; gap: 1.2rem; }
.admin-account-role {
    border: 1px solid var(--admin-line);
    border-radius: 1rem;
    color: var(--admin-muted);
    font-size: 1.2rem;
    padding: 0 0.8rem;
}
.admin-logout { margin: 0; }

/* 本体（左メニュー＋内容） */
.admin-body { display: flex; min-height: calc(100vh - 6rem); }
.admin-nav { background: #fff; border-right: 1px solid var(--admin-line); flex: 0 0 20rem; padding: 1.6rem 0; }
.admin-nav ul { list-style: none; margin: 0; }
.admin-nav li { margin: 0; }
.admin-nav-item { color: var(--admin-ink); display: block; padding: 0.8rem 2rem; }
.admin-nav-item.is-current { background: var(--admin-bg); border-left: 4px solid var(--admin-accent); font-weight: 700; padding-left: 1.6rem; }
.admin-nav-item.is-disabled { color: #a0a8b0; cursor: default; }
.admin-nav-item small { font-size: 1.1rem; margin-left: 0.6rem; }
.admin-main { flex: 1 1 auto; min-width: 0; padding: 2.4rem 3rem; }

/* ダッシュボードの数値 */
.stat-row { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-bottom: 2.4rem; }
.stat { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; flex: 1 1 18rem; padding: 1.6rem; }
.stat-label { color: var(--admin-muted); display: block; font-size: 1.3rem; }
.stat-value { display: block; font-size: 3rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.stat.is-warning { background: var(--admin-warn-bg); border-color: #f0c38a; }
.stat.is-warning .stat-value { color: var(--admin-warn-ink); }
.note { color: var(--admin-muted); }

/* フラッシュメッセージ */
.message { border-radius: 6px; margin-bottom: 1.6rem; padding: 1rem 1.4rem; }
.message.success { background: #e6f4ea; color: #1e6b34; }
.message.error { background: #fdecea; color: #a12a1f; }

/* ログイン画面 */
.login-page { align-items: center; display: flex; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; max-width: 40rem; padding: 3rem; width: 100%; }
.login-title { font-size: 2.2rem; text-align: center; }
.login-submit { width: 100%; }

/* スマートフォン幅ではメニューを上に並べる */
@media (max-width: 640px) {
    .admin-body { flex-direction: column; }
    .admin-nav { border-bottom: 1px solid var(--admin-line); border-right: 0; flex-basis: auto; padding: 0.4rem 0; }
    .admin-nav ul { display: flex; flex-wrap: wrap; }
    .admin-nav-item { padding: 0.6rem 1.2rem; }
    .admin-main { padding: 1.6rem; }
    .admin-account-role { display: none; }
}

/* ページ見出しと操作ボタン */
.page-head { align-items: center; display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between; margin-bottom: 1.6rem; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.page-actions .button, .page-actions form { margin: 0; }
.breadcrumb { color: var(--admin-muted); font-size: 1.3rem; margin-bottom: 0.8rem; }
h2 { font-size: 1.9rem; margin: 2.8rem 0 1.2rem; }
h2 .count { color: var(--admin-muted); font-size: 1.4rem; font-weight: 400; margin-left: 0.6rem; }

/* 絞り込みフォーム */
.filter-form { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; margin-bottom: 1.6rem; padding: 1.6rem 1.6rem 0.4rem; }
.filter-grid { display: grid; gap: 0 1.6rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.filter-actions { display: flex; gap: 0.8rem; }
.result-count { color: var(--admin-muted); margin-bottom: 0.8rem; }

/* 表 */
.table-wrap { position: relative; background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; overflow-x: auto; }
.data-table { margin: 0; }
.data-table th, .data-table td { padding: 0.8rem 1.2rem; vertical-align: top; }
.data-table th:first-child, .data-table td:first-child { padding-left: 1.6rem; }
.data-table th { background: #fafbfc; font-size: 1.3rem; white-space: nowrap; }
.data-table td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.data-table td.center { text-align: center; }
.data-table td.actions { white-space: nowrap; }
.data-table td.empty { color: var(--admin-muted); padding: 2.4rem; text-align: center; }
.data-table tr.is-inactive td { color: #8a949e; }
.data-table input[type="checkbox"] { margin: 0; }
.sub { color: var(--admin-muted); font-size: 1.25rem; }
.table-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.2rem; }
.table-actions button { margin: 0; }
.paginator { margin-top: 1.6rem; }
.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; }
.pagination li { margin: 0; }
.pagination li a, .pagination li.active a { border: 1px solid var(--admin-line); border-radius: 4px; display: inline-block; padding: 0.2rem 1rem; }
.pagination li.active a { background: var(--admin-accent); border-color: var(--admin-accent); color: #fff; }
.pagination li.disabled a { color: #b4bcc4; pointer-events: none; }

/* バッジ */
.badge { border-radius: 1rem; display: inline-block; font-size: 1.15rem; font-weight: 600; line-height: 1.6; margin-left: 0.4rem; padding: 0 0.8rem; vertical-align: middle; white-space: nowrap; }
.badge-expired { background: #fdecea; color: #a12a1f; }
.badge-this_month { background: var(--admin-warn-bg); color: var(--admin-warn-ink); }
.badge-trial { background: #e8f0fb; color: var(--admin-accent); }
.badge-muted { background: #eef0f2; color: var(--admin-muted); }

/* 詳細 */
.detail-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr)); }
.detail-list { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; display: grid; gap: 0.6rem 1.6rem; grid-template-columns: 11rem 1fr; margin: 0; padding: 1.6rem; }
.detail-list dt { color: var(--admin-muted); font-weight: 400; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

/* フォーム */
fieldset { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; margin-bottom: 1.6rem; padding: 1.6rem 1.6rem 0.4rem; }
legend { font-weight: 700; padding: 0 0.4rem; }
.form-grid { display: grid; gap: 0 1.6rem; grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr)); }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 0 2.4rem; }
.checkbox-row label { font-weight: 400; }
.input.radio { margin-bottom: 1.5rem; }
.input.radio > label { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 400; margin: 0 2.4rem 0 0; white-space: nowrap; }
.input.radio > label:first-child { display: block; font-weight: 700; margin: 0 0 0.6rem; }
.input.radio input[type="radio"] { margin: 0; }
.error-message { color: #a12a1f; font-size: 1.3rem; margin: -1rem 0 1.2rem; }
.form-actions { display: flex; gap: 0.8rem; }

/* パスワード発行 */
.issued-box { background: #fff; border: 2px solid var(--admin-accent); border-radius: 8px; margin-bottom: 2rem; max-width: 52rem; padding: 2rem; }
.issued-box dl { display: grid; gap: 0.6rem 1.6rem; grid-template-columns: 10rem 1fr; }
.issued-box dt { color: var(--admin-muted); font-weight: 400; }
.issued-box dd { margin: 0; }
.issued-password { font-size: 2.4rem; letter-spacing: 0.1em; }
.warning-text { color: #a12a1f; font-weight: 600; margin: 0; }

/* 削除 */
.danger-zone { border-top: 1px solid var(--admin-line); margin-top: 3.2rem; padding-top: 0.8rem; }
.button.button-danger { background: #a12a1f; border-color: #a12a1f; }
.visually-hidden { clip: rect(0 0 0 0); height: 1px; overflow: hidden; position: absolute; width: 1px; }

/* 見た目の調整（milligram の既定を上書き） */
a { color: var(--admin-accent); }
a:hover, a:focus { color: #164a85; }
label, legend { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.4rem; }
.button.button-clear, button.button-clear { color: var(--admin-accent); }
.admin-nav { flex-basis: 22rem; }
.admin-nav-item small { white-space: nowrap; }
.admin-brand { white-space: nowrap; }

@media (max-width: 640px) {
    .admin-header { padding: 0.8rem 1.2rem; }
    .admin-brand { font-size: 1.6rem; }
    .admin-account-name { display: none; }
    /* milligram は狭い画面で表の行と列を入れ替えるため、通常の表＋横スクロールに戻す */
    .data-table { display: table; }
    .data-table thead { display: table-header-group; }
    .data-table tbody { display: table-row-group; white-space: normal; }
    .data-table tr { display: table-row; }
    .data-table th, .data-table td { display: table-cell; white-space: nowrap; }
}
.related-pager { align-items: center; display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1rem; }

/* 監査ログ */
.nowrap { white-space: nowrap; }
.audit-table td { font-size: 1.4rem; }
.badge-action { margin-left: 0; }
.badge-auth { background: #eef0f2; color: var(--admin-muted); }
.badge-stand { background: #e8f0fb; color: var(--admin-accent); }
.badge-customer { background: var(--admin-warn-bg); color: var(--admin-warn-ink); }
.changes { margin-top: 0.6rem; }
.changes summary { color: var(--admin-accent); cursor: pointer; font-size: 1.3rem; }
.changes table { font-size: 1.3rem; margin: 0.6rem 0 0; }
.changes th, .changes td { padding: 0.4rem 1rem 0.4rem 0; }

/* 顧客・給油記録の修正 */
.badge-record { background: var(--admin-warn-bg); color: var(--admin-warn-ink); }
.detail-list.narrow { margin-bottom: 1.6rem; max-width: 52rem; }
.record-photo img { border: 1px solid var(--admin-line); border-radius: 6px; max-height: 32rem; max-width: 100%; }

/* CSV */
.badge-csv { background: #e6f4ea; color: #1e6b34; }
.csv-card { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; margin-bottom: 2rem; padding: 1.6rem 2rem; }
.csv-card h2 { margin-top: 0; }
.inline-form { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.inline-form .input { margin: 0; min-width: 18rem; }
.inline-form button { margin: 0 0 1.5rem; }
.link-list { margin-bottom: 1.6rem; }
.reason-list { margin: 0; padding-left: 1.6rem; }
.reason-list li { margin: 0; }
.data-table tr.is-error td { background: #fdf3f2; }
.text-error { color: #a12a1f; }
.badge-import-create { background: #e8f0fb; color: var(--admin-accent); margin-left: 0; }
.badge-import-update { background: var(--admin-warn-bg); color: var(--admin-warn-ink); margin-left: 0; }
.badge-import-unchanged { background: #eef0f2; color: var(--admin-muted); margin-left: 0; }
.badge-import-error { background: #fdecea; color: #a12a1f; margin-left: 0; }
.issued-box.wide { max-width: none; }
.issued-password-sm { font-size: 1.7rem; letter-spacing: 0.08em; }
.badge-stand_group { background: #efedff; color: #4b3fa6; }

/* 変更履歴（F-22） */
.more-link { margin: .5rem 0 0; text-align: right; }
.history-table .badge { margin-right: .25rem; }
.badge-admin { background: #e7f1fb; color: #1d4f86; }

/* 管理者アカウント（F-23、F-24、A-05） */
.badge-warn { background: #f9eeda; color: #7a4b00; }
.row-inactive td { color: #888; }
.role-help { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; font-size: .9em; }
.role-help dt { font-weight: bold; }
.role-help dd { margin: 0; color: #555; }
.narrow-form { max-width: 32rem; }
.login-subtitle { font-size: 1.6rem; margin: 0 0 1rem; }
.login-link { margin-top: 1rem; text-align: center; font-size: .9em; }
.admin-account-link { font-size: .9em; margin-right: .5rem; }
@media (max-width: 600px) { .role-help { grid-template-columns: 1fr; } }

/* ロゴ（現行アプリの glog_logo.svg） */
.admin-brand { align-items: center; display: inline-flex; gap: .8rem; }
.admin-brand-logo { display: block; height: 3rem; width: auto; }
.admin-brand-label { border-left: 1px solid var(--admin-line); color: var(--admin-muted); font-size: 1.4rem; font-weight: 600; padding-left: .8rem; }
.login-title { align-items: center; display: flex; flex-direction: column; gap: .6rem; }
.login-logo { display: block; height: 4.4rem; width: auto; }
.login-title-label { color: var(--admin-muted); font-size: 1.5rem; font-weight: 600; }
@media (max-width: 640px) { .admin-brand-logo { height: 2.6rem; } }
.admin-account-link { white-space: nowrap; }
@media (max-width: 640px) { .admin-brand-label { display: none; } }
.filter-note { background: #e7f1fb; border-radius: 6px; padding: .6rem 1rem; }
.related-pager .more-link-inline { margin-left: auto; font-size: .9em; }
.form-error { background: #fbebeb; border-radius: 6px; color: #8a1f1f; margin: .8rem 0; padding: .8rem 1rem; }
.form-error .button-outline { margin: .6rem 0 0; display: block; }
.text-warn { color: #7a4b00; }
.message.warning { background: #f9eeda; color: #7a4b00; }
.warning-list { color: #7a4b00; list-style: none; margin: .3rem 0 0; padding: 0; }

/* 請求の設定 */
.settings-table th[scope="row"] { font-weight: 600; vertical-align: top; }
.settings-table .setting-input { align-items: center; display: flex; gap: .6rem; }
.settings-table .setting-input .input { margin: 0; }
.settings-table .setting-number { width: 9rem; }
.settings-table td.note { font-size: .88em; min-width: 18rem; }
.settings-table .setting-text { width: 48rem; max-width: 100%; }

/* 請求 */
.row-actions summary { cursor: pointer; color: var(--admin-link, #1f5fa8); }
.row-actions .mini-form { border-top: 1px solid var(--admin-line); margin: .6rem 0 0; padding-top: .6rem; min-width: 18rem; }
.row-actions .mini-form .input { margin-bottom: .4rem; }
.button-small { font-size: 1.1rem; height: 3rem; line-height: 3rem; padding: 0 1.2rem; }
.button-danger { background: #b3261e; border-color: #b3261e; }
h3 { font-size: 1.8rem; margin-top: 2rem; }
.row-actions[open] { min-width: 20rem; }

/* タブ（請求） */
.tabs { border-bottom: 2px solid var(--admin-line); display: flex; flex-wrap: wrap; gap: .2rem; margin: 2rem 0 1.4rem; }
.tabs .tab { border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; color: var(--admin-muted); margin-bottom: -2px; padding: .8rem 1.4rem; white-space: nowrap; }
.tabs .tab:hover { background: #eef3f9; }
.tabs .tab.is-active { background: #fff; border-color: var(--admin-line); border-bottom: 2px solid #fff; color: var(--admin-ink); font-weight: 700; }
.tab-count { background: #e7f1fb; border-radius: 1rem; color: #1d4f86; font-size: 1.1rem; margin-left: .4rem; padding: .1rem .7rem; }
.filter-chips { align-items: center; display: flex; flex-wrap: wrap; gap: .6rem; font-size: .9em; }
.chip { border: 1px solid var(--admin-line); border-radius: 1.4rem; padding: .2rem 1rem; }
.chip.is-active { background: #1f5fa8; border-color: #1f5fa8; color: #fff; }
.chip-sep { border-left: 1px solid var(--admin-line); height: 1.6rem; margin: 0 .4rem; }
.cell-ellipsis { display: inline-block; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.ext-mark { background: #e6f4ea; border-radius: 3px; color: #1e6b34; font-size: 1.05rem; margin-left: .4rem; padding: 0 .4rem; }
.data-table.is-compact th, .data-table.is-compact td { padding: 0.8rem 0.8rem; }
.data-table.is-compact th:first-child, .data-table.is-compact td:first-child { padding-left: 1.2rem; }
.cell-ellipsis.is-narrow { max-width: 8rem; }
.row-dialog { border: 1px solid var(--admin-line); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.18); max-width: calc(100vw - 3.2rem); padding: 1.6rem 2rem; width: 42rem; }
.row-dialog::backdrop { background: rgba(20,30,40,.35); }
.row-dialog-head { align-items: center; display: flex; justify-content: space-between; }
.row-dialog-head h2 { font-family: monospace; font-size: 1.8rem; margin: 0; }
.row-dialog-close { background: none; border: 0; color: var(--admin-muted); cursor: pointer; font-size: 2.2rem; height: auto; line-height: 1; margin: 0; padding: .2rem .6rem; }
.row-dialog-close:hover { background: none; color: inherit; }
.row-dialog .sub { margin: .4rem 0 0; white-space: normal; }
.row-dialog .mini-form { border-top: 1px solid var(--admin-line); margin: 1.2rem 0 0; padding-top: 1.2rem; }
.row-dialog .mini-form .input { margin-bottom: .6rem; }
.row-dialog input[type="text"], .row-dialog input[type="date"] { margin-bottom: .6rem; width: 100%; }
.data-table td.actions > .button-small { height: 2.4rem; line-height: 2.2rem; margin: 0; padding: 0 1rem; }
.row-dialog .row-dialog-head .row-dialog-close { background: transparent; border: 0; color: var(--admin-muted); font-size: 2.4rem; font-weight: normal; height: auto; line-height: 1; padding: 0 .4rem; }
.row-dialog .row-dialog-head .row-dialog-close:hover, .row-dialog .row-dialog-head .row-dialog-close:focus { background: transparent; color: #222; }
.tab-panel-foot { color: var(--admin-muted); font-size: 1.3rem; margin: 1rem 0 0; }
/*
 * メニュー（2026-11-08 見直し）
 * - 小見出しは帯をやめ、小さめの灰色の文字＋区切り線にする（押せる項目と見た目を分ける）
 * - 項目は小見出しより一段下げる
 * - 選んでいる項目はロゴの色（オレンジ）の縦線と薄いオレンジの背景で示す
 */
.admin-nav-heading { background: transparent; border-top: 1px solid var(--admin-line); color: #7b8794; font-size: 1.2rem; font-weight: 700; letter-spacing: .1em; margin: 1.2rem 0 .2rem; padding: 1.2rem 2rem .2rem; }
.admin-nav > ul:first-child .admin-nav-heading, .admin-nav > .admin-nav-heading:first-child { border-top: 0; margin-top: 0; padding-top: .4rem; }
.admin-nav-item { border-left: 4px solid transparent; font-size: 1.45rem; padding: .7rem 2rem .7rem 2.8rem; }
.admin-nav-item:hover, .admin-nav-item:focus { background: #fdf5ee; color: var(--admin-ink); }
.admin-nav-item.is-current { background: #fdeee4; border-left: 4px solid #ea5541; color: #a8361c; font-weight: 700; padding-left: 2.8rem; }
@media (max-width: 640px) {
    /* スマホではメニューを横に詰めて並べる（見出しは出さず、グループの区切りも詰める） */
    .admin-nav-heading { display: none; }
    .admin-nav { align-content: flex-start; display: flex; flex-basis: auto; flex-wrap: wrap; }
    .admin-nav ul { display: contents; }
    .admin-nav-item, .admin-nav-item.is-current { border-left: 0; padding: .6rem 1.2rem; }
    .admin-nav-item.is-current { border-bottom: 3px solid #ea5541; }
}
.tab-count.is-warn { background: #fdecc8; color: #7a4b00; }
.data-table tr.row-note td { border-top: 0; padding-top: 0; }
.alert-panel { background: #fff; border: 1px solid var(--admin-line); border-radius: 8px; margin-bottom: 2.4rem; padding: 1.6rem 2rem; }
.alert-panel h2 { font-size: 1.8rem; margin: 0 0 1rem; }
.alert-list { list-style: none; margin: 0; }
.alert-item { border-left: 4px solid #9db8d6; margin: 0 0 .8rem; padding: .4rem 0 .4rem 1.2rem; }
.alert-item.is-warn { border-left-color: #e0a040; }
.alert-link { display: flex; gap: 1.2rem; justify-content: space-between; max-width: 56rem; }
.alert-count { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.alert-item.is-warn .alert-count { color: var(--admin-warn-ink); }
.alert-help { color: var(--admin-muted); display: block; font-size: 1.25rem; }
/* フォームで長く入る項目は 2 列分の幅にする（3 列並ぶ広さのときだけ。狭い画面は 1 列のまま） */
@media (min-width: 1000px) {
    .form-grid > .span-2 { grid-column: span 2; }
}
.data-table tfoot .total-row th, .data-table tfoot .total-row td { background: #fafbfc; border-top: 2px solid var(--admin-line); }
/* 列の多い一覧（スタンド一覧）は、左右の余白をさらに詰めて 1 行に収める */
.data-table.is-dense th, .data-table.is-dense td { padding-left: .5rem; padding-right: .5rem; }
.data-table.is-dense th:first-child, .data-table.is-dense td:first-child { padding-left: 1.2rem; }
/* 絞り込み欄で長い案内文が入る項目（キーワード）は広くする。狭い画面では 1 列のまま */
@media (min-width: 1000px) {
    .filter-grid > .span-3 { grid-column: span 3; }
}
@media (min-width: 1000px) {
    .filter-grid > .span-2 { grid-column: span 2; }
}
.cell-ellipsis.is-medium { max-width: 10rem; }
.alert-more { margin-left: .8rem; white-space: nowrap; }
/* スタンドの詳細：一覧の前後のスタンドへ移る */
.list-nav { align-items: center; display: flex; flex-wrap: wrap; gap: .8rem; margin: -.4rem 0 1.2rem; }
.list-nav .button { margin: 0; }
.list-nav .is-disabled { cursor: default; opacity: .4; pointer-events: none; }
.list-nav-pos { color: var(--admin-muted); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.list-nav-back { font-size: 1.3rem; margin-left: .8rem; }
.filter-form .filter-chips { margin: .2rem 0 1.2rem; }
/* 見出しクリックで並べ替えた列に向きを出す（CakePHP の Paginator が asc / desc クラスを付ける） */
.data-table th a.asc::after { content: " ▲"; font-size: .9em; }
.data-table th a.desc::after { content: " ▼"; font-size: .9em; }
.sort-note { color: var(--admin-muted); font-size: 1.3rem; margin-left: 1.2rem; }
/* 詳細の項目名は折り返さない（列幅は最も長い項目名に合わせる）。左右のカードの高さがそろっても行の間は広げない（2026-11-08） */
.detail-list { align-content: start; grid-template-columns: minmax(11rem, max-content) 1fr; }
.detail-list dt { white-space: nowrap; }
/* 一覧の選択欄（まとめて無効にするなど）は幅を取らない */
.data-table th.is-check, .data-table td.is-check, .data-table.is-dense th.is-check:first-child, .data-table.is-dense td.is-check:first-child { padding-left: .8rem; padding-right: 0; width: 1%; }
.data-table th.is-check input, .data-table td.is-check input { margin: 0; }
/* 一覧の「選んだスタンドを」操作（2026-11-09）：ボタンは同じ形の枠線で、無効にするだけ赤 */
.bulk-actions { align-items: center; display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.2rem; }
.bulk-actions-label { color: var(--admin-ink); font-weight: 700; }
.bulk-actions .bulk-button { height: 3.4rem; line-height: 3.2rem; margin: 0; padding: 0 1.6rem; }
.bulk-actions .bulk-button.button-outline { background: #fff; border-color: var(--admin-accent); color: var(--admin-accent); }
.bulk-actions .bulk-button.button-outline:hover:not([disabled]), .bulk-actions .bulk-button.button-outline:focus:not([disabled]) { background: #e8f0fb; border-color: var(--admin-accent); color: var(--admin-accent); }
.bulk-actions .bulk-button.is-danger { border-color: #b3261e; color: #b3261e; }
.bulk-actions .bulk-button.is-danger:hover:not([disabled]), .bulk-actions .bulk-button.is-danger:focus:not([disabled]) { background: #fbebeb; border-color: #b3261e; color: #b3261e; }
.bulk-actions .bulk-button[disabled] { background: #fff; border-color: var(--admin-line); color: #a0a8b0; opacity: 1; }
.bulk-help { font-size: 1.3rem; margin-top: .6rem; }
/* スタンド一覧（2026-11-09）：都道府県から後ろの列は選んだものだけ出す。期限は日付の色で示す */
.stand-list [data-col] { display: none; }
.stand-list.show-pref [data-col="pref"], .stand-list.show-address [data-col="address"],
.stand-list.show-tel [data-col="tel"], .stand-list.show-email [data-col="email"] { display: table-cell; }
.cell-ellipsis.is-address { max-width: 12rem; }
.date-expired { color: #a12a1f; font-weight: 700; }
.date-this_month { color: var(--admin-warn-ink); font-weight: 700; }
.column-picker { align-items: center; display: flex; flex-wrap: wrap; font-size: 1.35rem; gap: .4rem 1.4rem; margin: 0 0 .8rem; }
.column-picker-label { color: var(--admin-muted); }
.column-picker label { align-items: center; display: inline-flex; font-size: 1.35rem; font-weight: 400; gap: .4rem; margin: 0; }
.column-picker input { margin: 0; }
.column-picker input:disabled + * , .column-picker label:has(input:disabled) { color: #a0a8b0; }

/* 選べる列を2つまで出しても 1280px で横スクロールにならないよう、スタンド一覧だけ文字を少し小さくし、長い項目は細めに省略する */
.stand-list { font-size: 1.3rem; }
.data-table.is-dense.stand-list th, .data-table.is-dense.stand-list td { padding-left: .35rem; padding-right: .35rem; }
.stand-list .badge { font-size: 1.05rem; padding: .1rem .5rem; }
.stand-list .cell-ellipsis { max-width: 11rem; }
.stand-list .cell-ellipsis.is-narrow { max-width: 7rem; }
.stand-list .cell-ellipsis.is-address { max-width: 8rem; }
/*
 * スタンド一覧の列の幅（2026-11-09）：どの列も中身の最大幅で左から詰めて並べる（名称・選べる列は省略しない）。
 * 余った幅は右端の「編集」の列が受け止める。幅が足りないときは、グループ・代理店だけを縮めて「…」で省略する（画面の JS が px で決める）
 */
.stand-list td.flex-col { max-width: 0; }
.stand-list .flex-col .cell-ellipsis { display: block; max-width: none; }
.stand-list .flex-name { white-space: nowrap; }
.stand-list th.list-tail { text-align: right; }
/* 列幅を測るあいだは、伸び縮みする列（名称以外）の中身を隠す（ほかの列を中身ぴったりの幅で測るため） */
.stand-list.is-measuring .flex-col .cell-ellipsis { display: none; }

/* スタンド一覧は列の幅を JS が px で配るので、選択欄に割合の幅を付けない（割合があると表が枠いっぱいに広がり、余りが固定の列に配られる） */
.data-table.is-dense.stand-list th.is-check:first-child, .data-table.is-dense.stand-list td.is-check:first-child { width: 2.2rem; }
/* 一覧でマウスを載せた行に色を付ける（どの行を見ているか分かるように。2026-11-09）。選んだ行（チェックを付けた行）も薄く色を付ける */
.data-table tbody tr:hover td { background: #eef4fb; }
.data-table tbody tr:has(td.empty):hover td { background: transparent; }
.data-table tbody tr:has(.bulk-check:checked) td { background: #fff6e8; }
.data-table tbody tr:has(.bulk-check:checked):hover td { background: #fdeed6; }
/* 請求の設定の試算：上の要約は文字が折り返さない幅にする */
.detail-list.simulation-summary { display: inline-grid; margin-bottom: 1.6rem; max-width: 100%; }
.detail-list.simulation-summary dd { white-space: nowrap; }
/* <button> の枠線ボタンも、リンクの枠線ボタン（.button.button-outline）と同じ青にそろえる（milligram の既定の赤を使わない。2026-11-11） */
button.button-outline, input[type="submit"].button-outline { background-color: transparent; border-color: var(--admin-accent); color: var(--admin-accent); }
button.button-outline:hover, button.button-outline:focus { background-color: #e8f0fb; border-color: var(--admin-accent); color: var(--admin-accent); }
.table-wrap + form .form-actions, .table-wrap + .note + form .form-actions { margin-top: 1.6rem; }

/* 請求の確定：グループの取引の行（クリックで明細を開く・閉じる） */
.group-row { cursor: pointer; }
.row-toggle { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; font-weight: normal; height: auto; letter-spacing: normal; line-height: inherit; margin: 0; padding: 0; text-align: left; text-transform: none; }
.row-toggle:hover, .row-toggle:focus { background: none; color: inherit; }
.row-toggle:focus-visible { outline: 2px solid var(--admin-accent, #1f5fa8); outline-offset: 2px; }
.row-toggle-mark { color: var(--admin-muted); display: inline-block; width: 1em; }

/* 見出しの右のボタンを並べる（スタンド一覧の CSV 出力・新規登録） */
.page-head-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.page-head-actions .button { margin: 0; }

/* 入金の取込：過入金など、入金済みにはするが確かめてほしいこと（赤字） */
.note-danger { color: #b3261e; font-weight: 600; }
