/* VS CRM 核のデザイン（契約 §10）。トークンは :root。外部フォント・CDN なし。
   レイアウト＝左ナビ＋上の帯＋本文（≤768px は下ナビ）。部品のクラスは vs- で始める（モジュールは vsm-<name>- を使う）。 */
:root {
  --vs-navy: #1F3A5F;
  --vs-blue: #3B6FA0;
  --vs-bg: #F4F6F9;
  --vs-surface: #FFFFFF;
  --vs-text: #1C2430;
  --vs-muted: #6B7785;
  --vs-border: #E2E6EB;
  --vs-ok: #2E7D32;
  --vs-warn: #B26A00;
  --vs-danger: #C0392B;
  --vs-accent: #C79B3B;
  --vs-font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --vs-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --vs-radius: 8px;
  --vs-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --vs-shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --vs-side-w: 224px;
  --vs-top-h: 56px;
  --vs-bottom-h: 60px;
  --vs-ok-bg: #E8F3E9;
  --vs-warn-bg: #FFF3E0;
  --vs-danger-bg: #FBEAE8;
  --vs-info-bg: #E8EFF7;
  --vs-accent-bg: #F8F0DD;
  --vs-row-hover: #F7F9FC;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--vs-bg); color: var(--vs-text); font-family: var(--vs-font); font-size: 14px; line-height: 1.6; }
a { color: var(--vs-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--vs-blue); outline-offset: 2px; }
[hidden] { display: none !important; }
code, pre { font-family: var(--vs-mono); }
.vs-skip { position: absolute; left: -9999px; }
.vs-skip:focus { left: 8px; top: 8px; z-index: 1000; background: var(--vs-surface); padding: 6px 10px; }

/* ---------------------------------------------------------------- レイアウト */
.vs-app { min-height: 100vh; }
.vs-side { position: fixed; inset: 0 auto 0 0; width: var(--vs-side-w); background: var(--vs-navy); color: #fff; display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.vs-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.vs-brand:hover { text-decoration: none; }
.vs-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--vs-accent); color: var(--vs-navy); font-weight: 800; font-size: 13px; }
.vs-side-items, .vs-side-group { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; }
.vs-side-group { margin-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.vs-side-head { font-size: 11px; color: rgba(255, 255, 255, .55); padding: 0 10px 4px; letter-spacing: .08em; }
.vs-side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: rgba(255, 255, 255, .82); }
.vs-side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.vs-side-link.is-active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 var(--vs-accent); }
.vs-side-foot { margin-top: auto; padding: 12px 18px; font-size: 11px; color: rgba(255, 255, 255, .45); }
.vs-body { margin-left: var(--vs-side-w); min-height: 100vh; display: flex; flex-direction: column; }
.vs-top { position: sticky; top: 0; z-index: 15; height: var(--vs-top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--vs-surface); border-bottom: 1px solid var(--vs-border); }
.vs-top-brand { display: none; }
.vs-search-form { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--vs-bg); border: 1px solid var(--vs-border); border-radius: 999px; padding: 0 12px; color: var(--vs-muted); }
.vs-search-form .vs-input.vs-search { border: 0; background: transparent; padding: 7px 0; box-shadow: none; }
.vs-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.vs-main { flex: 1; padding: 20px 24px 40px; max-width: 1400px; width: 100%; outline: none; }
.vs-bottom { display: none; }
.vs-boot { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 48px 16px; color: var(--vs-muted); }

@media (max-width: 768px) {
  body { font-size: 15px; }
  .vs-side { display: none; }
  .vs-body { margin-left: 0; padding-bottom: calc(var(--vs-bottom-h) + env(safe-area-inset-bottom)); }
  .vs-top { padding: 0 12px; gap: 8px; }
  .vs-top-brand { display: inline-flex; }
  .vs-user-name { display: none; }
  .vs-main { padding: 14px 16px 24px; }
  .vs-bottom { display: flex; position: fixed; inset: auto 0 0 0; height: calc(var(--vs-bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--vs-surface); border-top: 1px solid var(--vs-border); z-index: 30; }
  .vs-bottom-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--vs-muted); background: none; border: 0; padding: 4px 2px; min-width: 0; }
  .vs-bottom-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .vs-bottom-link.is-active { color: var(--vs-navy); font-weight: 600; }
  .vs-hide-sm { display: none; }
}

/* ---------------------------------------------------------------- 文字・見出し */
.vs-h1 { font-size: 20px; margin: 0; line-height: 1.35; font-weight: 700; }
.vs-h2 { font-size: 15px; margin: 0; font-weight: 700; }
.vs-sub, .vs-muted { color: var(--vs-muted); }
.vs-sub { font-size: 13px; margin-top: 2px; }
.vs-page-head { margin-bottom: 16px; }
.vs-page-head-row { display: flex; align-items: flex-end; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.vs-back { display: inline-block; font-size: 13px; margin-bottom: 4px; }
.vs-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vs-pad { padding: 12px 16px; }
.vs-mt { margin-top: 12px; }
.vs-nowrap { white-space: nowrap; }
.vs-al-right { text-align: right; }
.vs-al-center { text-align: center; }
.vs-pre { background: var(--vs-bg); border-radius: 6px; padding: 10px; font-size: 12px; overflow: auto; max-height: 240px; }
.vs-code-sm { font-size: 11px; color: var(--vs-muted); word-break: break-all; }

/* ---------------------------------------------------------------- ボタン */
.vs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--vs-border); background: var(--vs-surface); color: var(--vs-text); cursor: pointer; font-weight: 500; white-space: nowrap; }
.vs-btn:hover { background: var(--vs-row-hover); text-decoration: none; }
.vs-btn:disabled { opacity: .55; cursor: not-allowed; }
.vs-btn-primary { background: var(--vs-navy); border-color: var(--vs-navy); color: #fff; }
.vs-btn-primary:hover { background: #17304F; }
.vs-btn-danger { background: var(--vs-danger); border-color: var(--vs-danger); color: #fff; }
.vs-btn-danger:hover { background: #A93226; }
.vs-btn-ghost { background: transparent; border-color: transparent; }
.vs-btn-sm { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.vs-btn-block { width: 100%; }
.vs-icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--vs-muted); cursor: pointer; }
.vs-icon-btn:hover { background: var(--vs-bg); color: var(--vs-text); }
.vs-link-btn { background: none; border: 0; color: var(--vs-blue); cursor: pointer; padding: 6px 0; text-align: left; }
.vs-icon { flex: none; vertical-align: middle; }
.vs-icon-letter { display: inline-grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .2); font-size: 11px; font-weight: 700; flex: none; }

/* ---------------------------------------------------------------- 上の帯の部品 */
.vs-bell-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--vs-danger); color: #fff; font-size: 10px; line-height: 17px; font-weight: 700; }
.vs-user-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 999px; }
.vs-user-btn:hover { background: var(--vs-bg); }
.vs-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--vs-navy); color: #fff; font-size: 13px; font-weight: 700; }
.vs-pop { position: absolute; z-index: 60; min-width: 260px; max-width: min(380px, calc(100vw - 16px)); background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: var(--vs-radius); box-shadow: var(--vs-shadow-lg); padding: 6px; }
.vs-pop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--vs-border); margin-bottom: 4px; display: grid; gap: 2px; }
.vs-pop-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--vs-text); cursor: pointer; text-align: left; }
.vs-pop-item:hover { background: var(--vs-bg); text-decoration: none; }
.vs-bell-box { max-height: 60vh; overflow: auto; }
.vs-notif { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--vs-border); background: none; padding: 10px 12px; cursor: pointer; }
.vs-notif:hover { background: var(--vs-row-hover); }
.vs-notif.is-unread { box-shadow: inset 3px 0 0 var(--vs-blue); background: #FAFCFF; }
.vs-notif-title { font-weight: 600; }
.vs-notif-body { color: var(--vs-muted); font-size: 13px; }
.vs-notif-at { color: var(--vs-muted); font-size: 11px; margin-top: 2px; }
.vs-more-list { display: grid; gap: 4px; }
.vs-more-link { display: flex; align-items: center; gap: 10px; padding: 12px; border: 0; border-radius: 8px; background: var(--vs-bg); color: var(--vs-text); cursor: pointer; text-align: left; width: 100%; }

/* ---------------------------------------------------------------- カード・KPI・ダッシュボード */
.vs-card { background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: var(--vs-radius); box-shadow: var(--vs-shadow); margin-bottom: 16px; min-width: 0; }
.vs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--vs-border); flex-wrap: wrap; }
.vs-card-body { padding: 14px 16px; }
.vs-card-body-flush { padding: 0; }
.vs-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.vs-grid-2 > .vs-card { margin-bottom: 0; }
.vs-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.vs-kpi { display: block; background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: var(--vs-radius); padding: 12px 14px; color: var(--vs-text); text-align: left; min-width: 0; }
.vs-kpi-link { cursor: pointer; }
.vs-kpi-link:hover { border-color: var(--vs-blue); text-decoration: none; }
.vs-kpi-label { font-size: 12px; color: var(--vs-muted); }
.vs-kpi-value { font-size: 22px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; word-break: break-word; }
.vs-kpi-sub { font-size: 12px; color: var(--vs-muted); }
.vs-kpi-ok .vs-kpi-value { color: var(--vs-ok); }
.vs-kpi-warn .vs-kpi-value { color: var(--vs-warn); }
.vs-kpi-danger .vs-kpi-value { color: var(--vs-danger); }
.vs-kpi-accent { border-top: 3px solid var(--vs-accent); }
.vs-kpi-trend { font-size: 12px; margin-left: 4px; }
.vs-kpi-trend-up { color: var(--vs-ok); }
.vs-kpi-trend-down { color: var(--vs-danger); }
.vs-dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.vs-widget { grid-column: span 4; background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: var(--vs-radius); box-shadow: var(--vs-shadow); padding: 14px 16px; min-width: 0; }
.vs-widget-s { grid-column: span 3; }
.vs-widget-l { grid-column: span 8; }
.vs-widget-xl { grid-column: span 12; }
.vs-widget-title { font-size: 13px; font-weight: 700; color: var(--vs-muted); margin: 0 0 10px; letter-spacing: .02em; }
.vs-dash > .vs-empty, .vs-dash > .vs-loading, .vs-dash > .vs-error { grid-column: 1 / -1; }
@media (max-width: 1100px) { .vs-widget, .vs-widget-s { grid-column: span 6; } .vs-widget-l { grid-column: span 12; } }
@media (max-width: 768px) { .vs-dash { gap: 12px; } .vs-widget, .vs-widget-s, .vs-widget-l { grid-column: 1 / -1; } }
.vs-wlist { list-style: none; margin: 0; padding: 0; }
.vs-wlist li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--vs-border); flex-wrap: wrap; }
.vs-wlist li:last-child { border-bottom: 0; }
.vs-wlist small { color: var(--vs-muted); }

/* ---------------------------------------------------------------- バッジ・定義の並び */
.vs-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--vs-bg); color: var(--vs-muted); border: 1px solid var(--vs-border); }
.vs-badge + .vs-badge { margin-left: 4px; }
.vs-badge-ok { background: var(--vs-ok-bg); color: var(--vs-ok); border-color: transparent; }
.vs-badge-warn { background: var(--vs-warn-bg); color: var(--vs-warn); border-color: transparent; }
.vs-badge-danger { background: var(--vs-danger-bg); color: var(--vs-danger); border-color: transparent; }
.vs-badge-info { background: var(--vs-info-bg); color: var(--vs-blue); border-color: transparent; }
.vs-badge-accent { background: var(--vs-accent-bg); color: #8A6A1F; border-color: transparent; }
.vs-dl { display: grid; grid-template-columns: minmax(8em, max-content) 1fr; gap: 6px 16px; margin: 0; }
.vs-dl dt { color: var(--vs-muted); font-size: 13px; }
.vs-dl dd { margin: 0; min-width: 0; word-break: break-word; }
@media (max-width: 480px) { .vs-dl { grid-template-columns: 1fr; gap: 0; } .vs-dl dd { margin-bottom: 8px; } }

/* ---------------------------------------------------------------- 表 */
.vs-table-wrap { min-width: 0; }
.vs-table-bar { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.vs-table-search { max-width: 280px; }
.vs-table-count { color: var(--vs-muted); font-size: 12px; }
.vs-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--vs-border); border-radius: var(--vs-radius); background: var(--vs-surface); }
.vs-card .vs-table-scroll { border: 0; border-radius: 0; }
.vs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.vs-table caption { text-align: left; padding: 8px 12px; color: var(--vs-muted); }
.vs-table th, .vs-table td { padding: 9px 12px; border-bottom: 1px solid var(--vs-border); text-align: left; vertical-align: top; }
.vs-table th { position: sticky; top: 0; background: #F8FAFC; font-size: 12px; color: var(--vs-muted); font-weight: 600; white-space: nowrap; z-index: 1; }
.vs-table tbody tr:last-child td { border-bottom: 0; }
.vs-th-sort { cursor: pointer; user-select: none; }
.vs-th-sort:hover, .vs-th-sort.is-sorted { color: var(--vs-text); }
.vs-sort-mark { font-size: 10px; }
.vs-table-click tbody tr { cursor: pointer; }
.vs-table tbody tr:hover { background: var(--vs-row-hover); }
.vs-table td.vs-al-right, .vs-table th.vs-al-right { text-align: right; }
@media (max-width: 768px) { .vs-table th, .vs-table td { padding: 8px 10px; white-space: nowrap; } .vs-table-search { max-width: none; flex: 1; } }

/* ---------------------------------------------------------------- フォーム */
.vs-input { display: block; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--vs-border); border-radius: 6px; background: var(--vs-surface); }
.vs-input:focus { border-color: var(--vs-blue); outline: none; box-shadow: 0 0 0 3px rgba(59, 111, 160, .18); }
.vs-input.is-invalid { border-color: var(--vs-danger); }
textarea.vs-input { resize: vertical; min-height: 90px; line-height: 1.6; }
.vs-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.vs-form-1 { grid-template-columns: minmax(0, 1fr); }
.vs-field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.vs-field-full, .vs-form-foot { grid-column: 1 / -1; }
.vs-field-check label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding-top: 6px; }
.vs-label { font-size: 13px; font-weight: 600; color: var(--vs-text); }
.vs-req { color: var(--vs-danger); }
.vs-help { font-size: 12px; color: var(--vs-muted); }
.vs-field-err { font-size: 12px; color: var(--vs-danger); min-height: 0; }
.vs-field-err:empty { display: none; }
.vs-input-unit { display: flex; align-items: stretch; }
.vs-input-unit .vs-input { border-top-right-radius: 0; border-bottom-right-radius: 0; text-align: right; }
.vs-input-unit > span { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--vs-border); border-left: 0; border-radius: 0 6px 6px 0; background: var(--vs-bg); color: var(--vs-muted); font-size: 12px; white-space: nowrap; }
.vs-form-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.vs-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.vs-lookup { position: relative; }
.vs-lookup-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 70; list-style: none; margin: 0; padding: 4px; background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: 6px; box-shadow: var(--vs-shadow-lg); max-height: 260px; overflow: auto; }
.vs-lookup-list li { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.vs-lookup-list li small { color: var(--vs-muted); }
.vs-lookup-list li:hover, .vs-lookup-list li.is-active { background: var(--vs-info-bg); }
.vs-lookup-list li.vs-lookup-none { color: var(--vs-muted); cursor: default; }
@media (max-width: 768px) { .vs-form { grid-template-columns: minmax(0, 1fr); } .vs-input { min-height: 42px; font-size: 16px; } }

/* ---------------------------------------------------------------- タブ */
.vs-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--vs-border); overflow-x: auto; margin-bottom: 14px; scrollbar-width: thin; }
.vs-tab { flex: none; border: 0; background: none; padding: 9px 14px; color: var(--vs-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; white-space: nowrap; }
.vs-tab:hover { color: var(--vs-text); }
.vs-tab.is-active { color: var(--vs-navy); border-bottom-color: var(--vs-navy); }
.vs-tab-badge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--vs-bg); color: var(--vs-muted); font-size: 11px; line-height: 18px; }

/* ---------------------------------------------------------------- 時系列 */
.vs-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.vs-tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.vs-tl-item::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--vs-border); }
.vs-tl-item:last-child::before { display: none; }
.vs-tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--vs-info-bg); color: var(--vs-blue); }
.vs-tl-ok .vs-tl-dot { background: var(--vs-ok-bg); color: var(--vs-ok); }
.vs-tl-warn .vs-tl-dot { background: var(--vs-warn-bg); color: var(--vs-warn); }
.vs-tl-danger .vs-tl-dot { background: var(--vs-danger-bg); color: var(--vs-danger); }
.vs-tl-accent .vs-tl-dot { background: var(--vs-accent-bg); color: #8A6A1F; }
.vs-tl-main { min-width: 0; }
.vs-tl-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.vs-tl-title { font-weight: 600; }
.vs-tl-at { color: var(--vs-muted); font-size: 12px; white-space: nowrap; }
.vs-tl-meta { color: var(--vs-muted); font-size: 12px; }
.vs-tl-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }

/* ---------------------------------------------------------------- 空・読み込み・誤り */
.vs-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 16px; background: var(--vs-surface); border: 1px dashed var(--vs-border); border-radius: var(--vs-radius); color: var(--vs-muted); }
.vs-empty-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--vs-bg); color: var(--vs-blue); }
.vs-empty-title { font-weight: 700; color: var(--vs-text); }
.vs-empty-msg { max-width: 44em; font-size: 13px; }
.vs-empty .vs-btn { margin-top: 6px; }
.vs-loading { display: flex; align-items: center; gap: 10px; color: var(--vs-muted); padding: 16px; }
.vs-spinner { width: 18px; height: 18px; border: 2px solid var(--vs-border); border-top-color: var(--vs-blue); border-radius: 50%; animation: vs-spin .8s linear infinite; flex: none; }
@keyframes vs-spin { to { transform: rotate(360deg); } }
.vs-error { display: grid; gap: 6px; justify-items: start; padding: 14px 16px; background: var(--vs-danger-bg); color: var(--vs-danger); border-radius: var(--vs-radius); }
.vs-table-empty:empty { display: none; }

/* ---------------------------------------------------------------- 小窓・知らせ */
.vs-modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; }
.vs-modal { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--vs-surface); border-radius: 12px; box-shadow: var(--vs-shadow-lg); }
.vs-modal-wide { width: min(880px, 100%); }
.vs-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--vs-border); }
.vs-modal-body { padding: 16px 18px; overflow: auto; }
.vs-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--vs-border); flex-wrap: wrap; }
.vs-confirm-msg { margin: 0; white-space: pre-wrap; }
@media (max-width: 768px) {
  .vs-modal-back { place-items: end stretch; padding: 0; }
  .vs-modal, .vs-modal-wide { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.vs-toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.vs-toast { padding: 10px 14px; border-radius: 8px; background: var(--vs-text); color: #fff; box-shadow: var(--vs-shadow-lg); transition: opacity .3s, transform .3s; }
.vs-toast-ok { background: var(--vs-ok); }
.vs-toast-warn { background: var(--vs-warn); }
.vs-toast-error { background: var(--vs-danger); }
.vs-toast-out { opacity: 0; transform: translateY(6px); }
@media (max-width: 768px) { .vs-toasts { left: 16px; right: 16px; bottom: calc(var(--vs-bottom-h) + 12px + env(safe-area-inset-bottom)); max-width: none; } }

/* ---------------------------------------------------------------- ログイン・MFA */
.vs-login-body { min-height: 100vh; background: linear-gradient(160deg, var(--vs-navy) 0%, #2B4E7A 55%, var(--vs-bg) 55.1%); }
.vs-login { width: min(420px, 100%); margin: 0 auto; padding: 40px 16px; }
.vs-login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.vs-login-card { background: var(--vs-surface); border-radius: 12px; box-shadow: var(--vs-shadow-lg); padding: 22px 20px; }
.vs-login-form { display: grid; gap: 8px; }
.vs-login-form .vs-btn-primary { margin-top: 6px; min-height: 44px; }
.vs-login-h { font-size: 18px; margin: 0 0 6px; }
.vs-login-note { margin: 0 0 6px; color: var(--vs-muted); font-size: 13px; }
.vs-login-steps { margin: 0 0 6px; padding-left: 1.3em; font-size: 13px; color: var(--vs-muted); }
.vs-login-msg:empty { display: none; }
.vs-login-msg { font-size: 13px; padding: 8px 10px; border-radius: 6px; }
.vs-login-msg-error { background: var(--vs-danger-bg); color: var(--vs-danger); }
.vs-login-msg-ok { background: var(--vs-ok-bg); color: var(--vs-ok); }
.vs-login-foot { text-align: center; color: var(--vs-muted); font-size: 12px; margin-top: 16px; }
.vs-qr { display: grid; place-items: center; padding: 6px; }
.vs-qr svg, .mfa-qr-svg { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; }
.vs-secret summary { cursor: pointer; color: var(--vs-blue); font-size: 13px; }
.vs-secret-code { display: block; margin: 6px 0; padding: 8px; background: var(--vs-bg); border-radius: 6px; font-size: 14px; word-break: break-all; letter-spacing: .05em; }
.vs-code-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-family: var(--vs-mono); min-height: 48px; }
.vs-token-value { width: 100%; font-family: var(--vs-mono); font-size: 13px; word-break: break-all; }
.vs-backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; list-style: none; padding: 0; margin: 4px 0 8px; }
.vs-backup-codes code { display: block; padding: 6px; text-align: center; background: var(--vs-bg); border-radius: 6px; font-size: 15px; }

/* ---------------------------------------------------------------- 印刷 */
@media print {
  body { background: #fff; font-size: 11pt; }
  .vs-side, .vs-top, .vs-bottom, .vs-toasts, .vs-actions, .vs-table-bar, .vs-btn, .vs-tabs, .vs-skip { display: none !important; }
  .vs-body { margin: 0; padding: 0; }
  .vs-main { padding: 0; max-width: none; }
  .vs-card, .vs-widget, .vs-kpi { box-shadow: none; break-inside: avoid; }
  .vs-table-scroll { overflow: visible; border: 0; }
  .vs-table th { position: static; }
  a { color: inherit; }
}

/* ---------------------------------------------------------------- 統合で足した物（2026-11-09） */
/* 主ボタン（＋記録）：PC は上の帯の右・スマホは下ナビの中央 */
.vs-top-primary { min-height: 34px; padding: 4px 14px; border-radius: 999px; }
.vs-bottom-primary { position: relative; color: var(--vs-navy); font-weight: 600; }
.vs-bottom-primary-dot { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-top: -18px; border-radius: 50%;
  background: var(--vs-navy); color: #fff; box-shadow: var(--vs-shadow-lg); border: 3px solid var(--vs-surface); }
@media (max-width: 768px) { .vs-top-primary { display: none; } }
/* ダッシュボード：札の中の数字は詰めて並べる（縦に長くならないように） */
.vs-widget .vs-kpi-row { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.vs-widget .vs-kpi { padding: 8px 10px; }
.vs-widget .vs-kpi-value { font-size: 19px; white-space: nowrap; }
/* 札の幅は 4 の倍数（s・m＝1/3、l＝2/3）にして行の右に穴を作らない。空いた所は後ろの札で詰める */
.vs-dash { align-items: start; grid-auto-flow: row dense; }
.vs-widget-s { grid-column: span 4; }
@media (min-width: 1600px) { .vs-widget-s { grid-column: span 3; } .vs-widget-m { grid-column: span 3; } .vs-widget-l { grid-column: span 6; } }
@media (max-width: 1100px) { .vs-widget, .vs-widget-s { grid-column: span 6; } .vs-widget-l { grid-column: span 12; } }
@media (max-width: 768px) { .vs-widget, .vs-widget-s, .vs-widget-l { grid-column: 1 / -1; } }
/* スマホ：上から 3 つの後は見出しだけ（押すと開く） */
@media (max-width: 768px) {
  .vs-widget.is-folded-sm > :not(.vs-widget-title) { display: none; }
  .vs-widget.is-folded-sm .vs-widget-title { margin: 0; cursor: pointer; display: flex; justify-content: space-between; }
  .vs-widget.is-folded-sm .vs-widget-title::after { content: "開く ▾"; font-weight: 400; color: var(--vs-blue); }
}
/* スマホ：一覧の表はカード（SPEC §2-8）。1 行目＝最初の列、残りは「見出し：値」 */
@media (max-width: 768px) {
  .vs-table-cards .vs-table-scroll { border: 0; background: transparent; overflow: visible; }
  .vs-table-cards .vs-table thead { display: none; }
  .vs-table-cards .vs-table, .vs-table-cards .vs-table tbody { display: block; }
  .vs-table-cards .vs-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 12px; background: var(--vs-surface);
    border: 1px solid var(--vs-border); border-radius: var(--vs-radius); padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--vs-shadow); }
  .vs-table-cards .vs-table td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; overflow-wrap: anywhere; text-align: left; }
  .vs-table-cards .vs-table td:first-child { grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
  .vs-table-cards .vs-table td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--vs-muted); }
  .vs-table-cards .vs-table td:empty, .vs-table-cards .vs-table td.vs-card-skip { display: none; }
  .vs-table-cards .vs-table td.vs-card-full { grid-column: 1 / -1; }
  .vs-table-cards.has-card-title .vs-table td:first-child { grid-column: auto; font-weight: 400; font-size: inherit; }
  .vs-table-cards.has-card-title .vs-table td:first-child::before { content: attr(data-label); display: block; font-size: 11px; color: var(--vs-muted); }
  .vs-table-cards .vs-table td.vs-card-title { order: -1; grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
  .vs-table-cards .vs-table td.vs-card-title::before { content: none !important; }
}

/* 押す所は 44px 以上（SPEC §2-8・スマホ幅）＝外出先で片手で押す「保存」・小さいボタンも含める（UX-B5） */
@media (max-width: 768px) {
  .vs-btn, .vs-btn-sm { min-height: 44px; }
  .vs-btn-sm { padding: 6px 12px; font-size: 13px; }
  .vs-icon-btn { width: 44px; height: 44px; }   /* 閉じる・外す等の印のボタンも 44px（V-UX-REQUIREMENTS-2） */
}
