/* vconnect 入口・管理画面・上のメニュー・閲覧のみ表示。app.css（表の画面）の見た目を引き継ぐ。
   CSP 'self'：style 属性なし。状態は枠・淡い背景・文字（○×）で示し、色だけに頼らない。 */

/* ---------- 上の帯（利用者メニュー） ---------- */
.topbar .topbar-spacer { flex: 1; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-link { color: #fff; text-decoration: none; font-size: 12px; padding: 4px 6px; border-radius: 3px; }
.tb-link:hover { background: rgba(255,255,255,.18); }
.tb-link:focus-visible, .umenu-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.umenu { position: relative; }
.umenu-btn { background: transparent; border: 0; color: #fff; font-size: 12px; height: 40px; padding: 0 6px; display: flex; align-items: center; gap: 6px; }
.umenu-btn:hover { background: rgba(255,255,255,.14); }
.role-pill { background: rgba(255,255,255,.24); border-radius: 9px; padding: 0 7px; font-size: 11px; line-height: 17px; }
.umenu-caret { font-size: 10px; }
.umenu-panel { position: absolute; right: 0; top: 40px; min-width: 230px; background: #fff; color: #212529; border: 1px solid #aeb7bf; box-shadow: 0 6px 18px rgba(0,0,0,.22); z-index: 80; }
.umenu-head { padding: 10px 14px; border-bottom: 1px solid #e3e7ea; background: #f6f8f9; }
.umenu-head-name { font-weight: 700; font-size: 14px; }
.umenu-head-sub { font-size: 12px; color: #5c6670; margin-top: 2px; }
.umenu-item { display: block; width: 100%; text-align: left; background: #fff; border: 0; padding: 11px 14px; font-size: 13px; color: #212529; text-decoration: none; cursor: pointer; font-family: inherit; }
.umenu-item:hover, .umenu-item:focus-visible { background: #eaf3f6; }
.umenu-confirm { padding: 10px 14px; background: #fff6dd; border-top: 1px solid #e6c36a; font-size: 12.5px; }
.umenu-confirm p { margin: 0 0 8px; line-height: 1.5; }
.umenu-confirm-row { display: flex; gap: 8px; }

/* ---------- 資金繰り表：閲覧のみ・お知らせ ---------- */
.ro-badge { background: #fff; border: 1px solid #8a949e; color: #3d4650; font-size: 11px; padding: 1px 7px; border-radius: 3px; }
.notice-bar { margin: 0 0 8px; padding: 8px 12px; border: 1px solid #e6c36a; background: #fff6dd; color: #5c4200; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12.5px; }
.notice-bar a { color: #1d5f9c; }
.notice-bar button { height: 26px; }
body.ro .pat-btn:disabled { background: #eef1f3; color: #212529; cursor: default; }
body.ro input.cell:disabled, body.ro input[type=checkbox]:disabled { cursor: default; }
body.ro input.cell:disabled { background: transparent; color: #212529; -webkit-text-fill-color: #212529; border-color: transparent; opacity: 1; }
body.ro .memo-ph { display: none; }
body.ro .memo-btn:not(.has) { visibility: hidden; }
body.ro .memo-cell-btn:hover { border-color: transparent; background: none; cursor: default; }
body.ro td.name-cell .nm { cursor: default; }

/* ---------- 入口の画面（はじめの設定・ログイン・パスワード） ---------- */
body.auth-body { background: #eef0f2; font-size: 15px; height: auto; min-height: 100%; }
.auth-main { display: flex; flex-direction: column; align-items: center; padding: 28px 14px 48px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: #2b2f36; font-weight: 700; font-size: 14px; }
.auth-brand .mark { width: 30px; height: 30px; border: 2px solid #5b9ab8; border-radius: 50%; color: #2c6f8a; text-align: center; line-height: 26px; font-weight: 700; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-top: 4px solid #5b9ab8; box-shadow: 0 4px 20px rgba(0,0,0,.12); padding: 24px 24px 22px; }
.auth-card.wide { max-width: 640px; }
.auth-title { font-size: 21px; margin: 0 0 6px; line-height: 1.4; }
.auth-title:focus { outline: none; }
.auth-lead { color: #3d4650; margin: 0 0 18px; line-height: 1.7; }
.auth-form { display: block; }
.fld-row { margin-bottom: 16px; }
.fld-label { display: block; font-weight: 700; margin-bottom: 5px; }
.fld-help { font-size: 13px; color: #4b5560; margin-top: 5px; line-height: 1.6; }
.fld-err { color: #a3281a; font-size: 13.5px; margin-top: 5px; line-height: 1.6; font-weight: 700; }
.fld-err:empty { display: none; }
.auth-input { width: 100%; height: 44px; font-size: 16px; font-family: inherit; border: 1px solid #8e99a4; border-radius: 3px; padding: 0 10px; background: #fff; color: #212529; }
.auth-input:focus { outline: 2px solid #1d6fd8; outline-offset: 0; border-color: #1d6fd8; }
.auth-input.invalid { border-color: #c0392b; background: #fff8f7; }
.pw-wrap { display: flex; }
.pw-wrap .auth-input { flex: 1; min-width: 0; border-radius: 3px 0 0 3px; }
.pw-toggle { flex: none; width: 64px; border: 1px solid #8e99a4; border-left: 0; background: #f1f3f5; font-size: 14px; border-radius: 0 3px 3px 0; color: #212529; }
.pw-toggle:hover { background: #e4e8eb; }
.rules { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13.5px; line-height: 1.7; }
.rules li { color: #4b5560; display: flex; gap: 6px; }
.rules li .mark { flex: none; width: 1.2em; text-align: center; }
.rules li.ok { color: #25621b; }
.rules li.ng { color: #a3281a; }
.rules li.rules-note { color: #5c6670; font-size: 12.5px; display: block; margin-top: 2px; }
.meter { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; color: #3d4650; }
.meter i { flex: 0 0 34px; height: 7px; background: #dee2e6; border-radius: 4px; }
.meter .meter-txt { margin-left: 8px; }
.meter.lv1 i:nth-child(1) { background: #c0392b; }
.meter.lv2 i:nth-child(-n+2) { background: #d89a00; }
.meter.lv3 i:nth-child(-n+3) { background: #2e8b2e; }
.match { font-size: 13.5px; margin-top: 6px; min-height: 0; }
.match.ok { color: #25621b; }
.match.ng { color: #a3281a; }
.match:empty { display: none; }
.form-msg:empty { display: none; }
.form-msg { margin-bottom: 14px; }
.fine { font-size: 13px; color: #5c6670; margin: 10px 0 0; line-height: 1.6; }
.strong { font-weight: 700; }
.forgot-link { margin: 16px 0 0; text-align: center; font-size: 14px; }
.forgot-link a, .fine a, .notice a { color: #1d5f9c; }
.noscript { padding: 20px; text-align: center; }
.remain { margin: 6px 0 0; }
.remain strong { font-size: 1.15em; }

/* ボタン：1画面に目立つのは1つ */
.btn-primary { display: block; width: 100%; height: 46px; background: #2c7a88; color: #fff; border: 0; border-radius: 3px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; margin-top: 4px; }
.btn-primary:hover:not(:disabled) { background: #246874; }
.btn-primary:disabled { background: #9db9be; cursor: not-allowed; }
.btn-primary.linklike { text-align: center; text-decoration: none; line-height: 46px; }
.btn-sub { background: #fff; color: #212529; border: 1px solid #8e99a4; border-radius: 3px; height: 38px; padding: 0 14px; font-size: 14px; font-family: inherit; cursor: pointer; }
.btn-sub:hover:not(:disabled) { background: #eef1f3; }
.btn-sub:disabled { color: #8a949e; border-color: #ced4da; cursor: not-allowed; }
.btn-danger { background: #fff; color: #a3281a; border: 1px solid #c0392b; border-radius: 3px; height: 38px; padding: 0 14px; font-size: 14px; font-family: inherit; cursor: pointer; font-weight: 700; }
.btn-danger:hover:not(:disabled) { background: #fdecea; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }
.sm { height: 32px; font-size: 13px; padding: 0 12px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #1d6fd8; outline-offset: 2px; }

/* お知らせの箱（枠と淡い背景。文字でも内容が分かる） */
.notice { padding: 11px 13px; border: 1px solid; border-radius: 3px; margin-bottom: 14px; line-height: 1.7; font-size: 14px; }
.notice p { margin: 0; }
.notice.err { background: #fdecea; border-color: #e5a39b; color: #7d1c10; }
.notice.warn { background: #fff6dd; border-color: #e6c36a; color: #5c4200; }
.notice.ok { background: #e8f5e5; border-color: #a8d29f; color: #1f4f16; }
.notice.info { background: #eaf4f8; border-color: #b0d3e1; color: #1b4457; }

/* 手順の表示 */
.steps { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0; font-size: 13px; }
.step { flex: 1; padding: 6px 4px; border-bottom: 3px solid #dee2e6; color: #5c6670; }
.step.on { border-color: #2c7a88; color: #1b5662; font-weight: 700; }
.step.done { border-color: #8cc0c9; }

/* 回復コード（大きく） */
.codes { margin: 4px 0 16px; }
.codes-grid { list-style: none; counter-reset: code; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.code-item { counter-increment: code; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 19px; font-weight: 700; letter-spacing: .04em; padding: 10px 8px 10px 40px; white-space: nowrap; border: 1px solid #8e99a4; background: #f8f9fa; position: relative; user-select: all; }
.code-item::before { content: counter(code) "."; position: absolute; left: 10px; top: 13px; font-size: 13px; font-weight: 400; color: #5c6670; letter-spacing: 0; }
.codes-how { margin: 0 0 14px; line-height: 1.7; }
.codes-how p { margin: 0 0 6px; }
.codes-how .strong { font-size: 16px; color: #7d1c10; }
.check-big { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid #5b6770; border-radius: 3px; margin-bottom: 12px; font-size: 17px; font-weight: 700; cursor: pointer; background: #fff; }
.check-big input { width: 22px; height: 22px; flex: none; }

/* 「パスワードを忘れたとき」の2つの案内 */
.sub-card { border: 1px solid #ced4da; padding: 14px 16px; margin-bottom: 14px; background: #fcfdfd; }
.sub-card h2 { font-size: 16px; margin: 0 0 6px; }
.sub-card p { margin: 0 0 10px; line-height: 1.7; }

/* ---------- 利用者の管理 ---------- */
.admin-main { padding: 0 12px 60px; }
.admin-wrap { max-width: 980px; margin: 0 auto; padding-top: 16px; }
.admin-head { margin-bottom: 12px; }
.admin-title { font-size: 21px; margin: 0 0 4px; }
.admin-title:focus { outline: none; }
.admin-lead { color: #3d4650; margin: 0 0 10px; line-height: 1.6; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.admin-nav a { color: #1d5f9c; background: #fff; border: 1px solid #ced4da; padding: 6px 12px; border-radius: 16px; text-decoration: none; font-size: 13.5px; }
.admin-nav a:hover { background: #eaf3f6; }
.card { background: #fff; border: 1px solid #dee2e6; padding: 16px 18px; margin-bottom: 16px; scroll-margin-top: 12px; }
.card h2 { font-size: 17px; margin: 0 0 6px; }
.card-lead { color: #3d4650; margin: 0 0 12px; line-height: 1.7; font-size: 14px; }

.ulist { border: 1px solid #dee2e6; }
.urow { display: grid; grid-template-columns: 1.7fr 90px 190px 130px 100px; gap: 8px; align-items: center; padding: 10px 12px; }
.uhead { background: #f1f3f5; font-weight: 700; font-size: 12.5px; border-bottom: 1px solid #dee2e6; }
.urow-wrap { border-bottom: 1px solid #e6e9ec; }
.urow-wrap:last-child { border-bottom: 0; }
.urow-wrap.open { background: #f8fbfc; }
.uname { line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.uid { font-size: 12.5px; color: #5c6670; }
.me-tag { margin-left: 8px; font-size: 11px; border: 1px solid #5b9ab8; color: #1b5662; border-radius: 3px; padding: 0 5px; }
.role-chip, .st-chip { display: inline-block; font-size: 12.5px; padding: 1px 8px; border-radius: 3px; border: 1px solid #adb5bd; background: #fff; }
.role-admin { border-color: #2c7a88; color: #1b5662; font-weight: 700; }
.st-off { background: #eceff1; color: #4b5560; }
.st-lock { background: #fff6dd; border-color: #e6c36a; color: #5c4200; }
.st-wait { background: #eaf4f8; border-color: #b0d3e1; color: #1b4457; }
.st-on { border-color: #a8d29f; color: #1f4f16; }
.uact { text-align: right; }
.uops { padding: 4px 14px 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ops-group { border: 1px solid #dee2e6; background: #fff; padding: 10px 12px; margin: 0; min-width: 0; }
.ops-group legend, .ops-legend { font-weight: 700; font-size: 13.5px; padding: 0 4px; margin-bottom: 4px; }
.ops-p { font-size: 13px; color: #3d4650; line-height: 1.6; margin: 4px 0 10px; }
.radio-line { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.radio-line input { margin-top: 3px; width: 17px; height: 17px; flex: none; }
.ops-group .btn-sub, .ops-group .btn-danger { margin-top: 8px; }
.confirm-box { border: 1px solid #e5a39b; background: #fdf3f1; padding: 10px 12px; margin-top: 6px; }
.confirm-box p { margin: 0 0 10px; line-height: 1.6; font-size: 13.5px; }
.confirm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.secret-box { border: 2px solid #5b6770; background: #fffdf2; padding: 14px 16px; margin: 8px 0 14px; }
.secret-title { font-weight: 700; margin-bottom: 8px; }
.secret-pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .08em; padding: 12px 14px; border: 1px solid #8e99a4; background: #fff; text-align: center; user-select: all; overflow-wrap: anywhere; }
.secret-notes { margin: 10px 0 12px; padding-left: 20px; line-height: 1.7; font-size: 14px; }
.secret-notes .strong { color: #7d1c10; }
.add-form { max-width: 460px; }
.add-form .btn-primary { width: auto; padding: 0 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; align-items: center; }
.chip { height: 34px; padding: 0 14px; border: 1px solid #8e99a4; background: #fff; border-radius: 17px; font-size: 13.5px; font-family: inherit; cursor: pointer; }
.chip.on { background: #2c7a88; border-color: #2c7a88; color: #fff; font-weight: 700; }
.chip-refresh { margin-left: auto; }
.loglist { border: 1px solid #dee2e6; margin-bottom: 10px; }
.logrow { display: grid; grid-template-columns: 110px 1fr 200px; gap: 8px 12px; padding: 9px 12px; border-bottom: 1px solid #e6e9ec; font-size: 13.5px; align-items: start; }
.logrow:last-child { border-bottom: 0; }
.logrow.strange { background: #fff6dd; outline: 2px solid #d89a00; outline-offset: -2px; }
.logrow.fail .lg-type { color: #7d1c10; }
.lg-time { font-variant-numeric: tabular-nums; color: #3d4650; }
.lg-type { font-weight: 700; }
.lg-sub { font-size: 12.5px; color: #4b5560; margin-top: 2px; overflow-wrap: anywhere; }
.lg-ip { font-size: 12.5px; color: #4b5560; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badge-warn { display: inline-block; background: #d89a00; color: #1f1700; font-size: 11.5px; padding: 0 6px; border-radius: 3px; margin-right: 6px; }
.none { padding: 14px; color: #5c6670; margin: 0; }
.codes-left { font-size: 15px; margin: 0 0 10px; }
.codes-left strong { font-size: 18px; }
.regen-form { max-width: 420px; }

/* ---------- スマホ幅 ---------- */
@media (max-width: 760px) {
  .uhead { display: none; }
  .urow { grid-template-columns: 1fr 1fr; }
  .uname { grid-column: 1 / -1; }
  .ucell[data-label]::before { content: attr(data-label) "："; font-size: 12px; color: #5c6670; display: block; }
  .uact { grid-column: 1 / -1; text-align: left; }
  .uops { grid-template-columns: 1fr; }
  .logrow { grid-template-columns: 1fr; gap: 2px; }
  .secret-pw { font-size: 21px; }
  .tb-link { font-size: 11.5px; }
}
@media (max-width: 480px) {
  .auth-main { padding: 14px 10px 40px; }
  .auth-card { padding: 18px 14px; }
  .codes-grid { grid-template-columns: 1fr; }
  .code-item { font-size: 19px; }
  .umenu-name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .steps { font-size: 12px; }
}
@media print { .umenu, .tb-link, .notice-bar { display: none !important; } }

/* 資金繰り表の中で出す「ログインし直す」の窓 */
.login-box input { height: 36px; font-size: 14px; border: 1px solid #8e99a4; border-radius: 3px; padding: 0 8px; width: 100%; }
.login-note { margin: 0; font-size: 13px; line-height: 1.6; color: #3d4650; }
.login-box { width: 380px; max-width: 92vw; }

/* ---------- API連携（管理者だけ） ---------- */
.api-wrap { max-width: 1080px; }
.api-explain { margin: 0 0 12px; padding: 12px 14px; background: #fff; border: 1px solid #b0d3e1; line-height: 1.8; font-size: 14.5px; color: #1b3a48; }
.api-explain strong { color: #7d1c10; }
.api-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.api-top h2 { margin: 0; }
.api-top .btn-primary.api-new { width: auto; padding: 0 24px; margin: 0; }
.klist { border: 1px solid #dee2e6; }
.krow { display: grid; grid-template-columns: 1.4fr 132px 100px 130px 160px 100px 190px; gap: 8px; align-items: center; padding: 10px 12px; }
.khead { background: #f1f3f5; font-weight: 700; font-size: 12.5px; border-bottom: 1px solid #dee2e6; }
.krow-wrap { border-bottom: 1px solid #e6e9ec; }
.krow-wrap:last-child { border-bottom: 0; }
.krow-wrap.open { background: #f8fbfc; }
.krow-wrap.inactive .kname strong { color: #5c6670; }
.kcell { font-size: 13.5px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.kname strong { font-size: 14.5px; }
.kact { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.scope-write { white-space: nowrap; border-color: #d89a00; background: #fff6dd; color: #5c4200; font-weight: 700; }
.scope-read { border-color: #adb5bd; }
.kops { padding: 4px 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kops .auth-input { height: 38px; font-size: 14px; }
.api-form { max-width: 560px; }
.api-form .ops-group { margin-bottom: 14px; }
.api-form .btn-primary { width: auto; padding: 0 28px; margin-top: 8px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 8px; }
.api-form .form-actions .btn-primary { margin-top: 0; }
.notice.big { font-size: 17px; font-weight: 700; padding: 14px 16px; border-width: 2px; }
#sec-form .confirm-row { margin-top: 10px; }
.co-box { margin-left: 26px; display: grid; gap: 10px; }
.co-group { border: 1px solid #dee2e6; border-radius: 3px; padding: 6px 10px 8px; background: #fff; }
.co-name { font-weight: 700; font-size: 13px; padding: 2px 0; }
.pl-box { margin-left: 24px; border-top: 1px dashed #dee2e6; margin-top: 4px; padding-top: 2px; }
.pl-box.dim { opacity: .5; }
.legacy-group.first { border: 2px solid #d89a00; background: #fffaf0; }
.key-secret { font-size: 22px; letter-spacing: .03em; text-align: left; word-break: break-all; padding: 14px; }
.copy-state { font-size: 13.5px; color: #1f4f16; align-self: center; }
.ulog .lg-sup { grid-column: 1 / -1; font-size: 12.5px; color: #5c4200; background: #fff6dd; padding: 3px 8px; border: 1px dashed #e6c36a; }
.ulog.fail { background: #fff4f2; }
.ulog.deny { background: #fdecea; outline: 2px solid #c0392b; outline-offset: -2px; }
.ulog.deny .lg-type, .ulog.fail .lg-type { color: #7d1c10; }
.res-badge { display: inline-block; font-size: 11.5px; padding: 0 7px; border-radius: 3px; margin-right: 8px; border: 1px solid; font-weight: 700; }
.res-ok { background: #e8f5e5; border-color: #a8d29f; color: #1f4f16; }
.res-fail { background: #fff6dd; border-color: #d89a00; color: #5c4200; }
.res-deny { background: #c0392b; border-color: #c0392b; color: #fff; }
.lg-raw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #6a747e; margin-top: 2px; overflow-wrap: anywhere; }
.kselect { height: 34px; max-width: 100%; border: 1px solid #8e99a4; border-radius: 3px; background: #fff; font-size: 13.5px; font-family: inherit; padding: 0 8px; }
.how-details summary { cursor: pointer; font-weight: 700; font-size: 16px; padding: 4px 0; }
.how-details[open] summary { margin-bottom: 8px; }
.how-title { font-weight: 700; font-size: 13.5px; margin: 10px 0 4px; }
.how-code { margin: 0 0 8px; padding: 10px 12px; background: #1f2933; color: #e6edf3; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; user-select: all; }
@media (max-width: 900px) {
  .khead { display: none; }
  .krow { grid-template-columns: 1fr 1fr; }
  .kname, .kact { grid-column: 1 / -1; }
  .kcell[data-label]::before { content: attr(data-label) "："; font-size: 12px; color: #5c6670; display: block; }
  .kact { justify-content: flex-start; }
  .kops { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .key-secret { font-size: 17px; }
  .api-top .btn-primary.api-new { width: 100%; }
  .form-actions .btn-primary, .form-actions .btn-sub { width: 100%; }
  .tb-right { gap: 4px; }
}

/* ---- 社長の会計：利用者の管理で足した分 ---- */
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: #1d5f9c; cursor: pointer; text-align: left; text-decoration: underline; }
.link-btn:hover { color: #124a7c; }
.auth-input.short { width: 90px; }
.add-form .ops-group { margin-bottom: 12px; }
.st-chip + .st-chip { margin-left: 2px; }
.tb-logout { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); border-radius: 3px; height: 26px; padding: 0 10px; margin-right: 10px; font-size: 12px; cursor: pointer; }
.tb-logout:hover { background: rgba(255,255,255,.18); }
