/* 営業訪問管理の共通の見た目。MudBlazor の後に読み、必要なところだけ上書きする。 */
html, body { font-family: "Noto Sans JP", "Hiragino Sans", "Meiryo", sans-serif; }
body { background: #f5f7fa; }

.sv-main { padding-bottom: 48px; }
.sv-title { white-space: nowrap; }
.sv-version { opacity: .8; white-space: nowrap; }
.sv-user-menu .mud-button-root { text-transform: none; white-space: nowrap; }

/* 見出しの並び（見出し・i・操作） */
.sv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-h1 { margin: 0; }
.sv-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-project-picker { min-width: 200px; }
.sv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-actions .mud-button-root, .sv-head-actions .mud-button-root { white-space: nowrap; }
.sv-muted { color: #6b7280; }
.sv-nowrap { white-space: nowrap; }
.sv-wrap { white-space: normal; word-break: break-word; min-width: 140px; }
.sv-clickable { cursor: pointer; }
.sv-narrow { max-width: 520px; }
.sv-num-input { max-width: 90px; }
.sv-role-select { max-width: 180px; }
.sv-inline-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 絞り込み・入力の並び（スマホは 1 列） */
.sv-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; align-items: center; }
.sv-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.sv-span-2 { grid-column: span 2; }
@media (max-width: 600px) {
    .sv-form-grid { grid-template-columns: 1fr; }
    .sv-span-2 { grid-column: span 1; }
}

/* 担当者・名刺 */
.sv-contact { background: #fbfcfe; }
.sv-contact-head { display: flex; align-items: center; }
.sv-card-area { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-top: 4px; }
.sv-card-thumb { position: relative; display: block; width: 180px; border: 1px solid #d0d7de; border-radius: 6px; overflow: hidden; background: #fff; }
.sv-card-thumb img { display: block; width: 100%; height: 108px; object-fit: contain; background: #eef1f5; }
.sv-card-thumb span { position: absolute; top: 4px; left: 4px; background: rgba(31,78,121,.85); color: #fff; font-size: 12px; padding: 0 6px; border-radius: 4px; }
.sv-card-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sv-card-buttons .mud-button-root { white-space: nowrap; }
.sv-ocr-text { white-space: pre-wrap; font-family: inherit; font-size: 13px; margin: 0; background: #f6f8fa; padding: 8px; border-radius: 4px; }
.sv-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.sv-error-list { margin: 0; padding-left: 20px; }

/* コメント */
.sv-comment { border-left: 3px solid #cfd8e3; padding: 6px 10px; margin-bottom: 10px; background: #fff; }
.sv-comment.is-return { border-left-color: #d32f2f; background: #fff5f5; }
.sv-comment.is-confirm { border-left-color: #2e7d32; background: #f3faf3; }
.sv-comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.sv-comment-body { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.sv-comment-input { display: flex; gap: 8px; align-items: flex-end; }
.sv-comment-input .mud-input-control { flex: 1; }
.sv-history { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; padding: 2px 0; }

/* 表（罫線付き。横にはみ出したら枠の中でスクロール） */
.sv-xscroll { overflow-x: auto; }
.sv-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.sv-table th, .sv-table td { border: 1px solid #e1e5ea; padding: 6px 8px; text-align: left; vertical-align: middle; white-space: nowrap; }
.sv-table th { background: #f0f3f7; font-weight: 600; }
.sv-table td.sv-wrap { white-space: normal; }
.sv-table .num { text-align: right; }
.sv-table tr.is-inactive td { color: #9aa3ad; }

/* ダッシュボード */
.sv-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.sv-kpi { padding: 12px 16px; }
.sv-kpi-label { color: #4b5563; font-size: 14px; }
.sv-kpi-value { font-size: 2rem; font-weight: 700; color: #1f4e79; line-height: 1.3; }
.sv-kpi-sub { color: #6b7280; font-size: 12px; }
.sv-two-col { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sv-trend { display: flex; gap: 6px; align-items: flex-end; height: 200px; padding-top: 8px; overflow-x: auto; }
.sv-trend-col { flex: 1 0 36px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.sv-trend-num { font-size: 11px; color: #4b5563; }
.sv-trend-bars { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.sv-trend-bar { width: 40%; min-height: 1px; border-radius: 2px 2px 0 0; }
.sv-trend-bar.is-visits, .sv-legend .is-visits { background: #1f4e79; }
.sv-trend-bar.is-contracts, .sv-legend .is-contracts { background: #f2a900; }
.sv-trend-label { font-size: 11px; color: #4b5563; white-space: nowrap; }
.sv-legend { font-size: 12px; color: #4b5563; margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.sv-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-left: 8px; }

/* 画面内ヘルプ */
.sv-help { font-size: 14px; line-height: 1.7; }
.sv-help ul { padding-left: 20px; }

/* ログイン画面（静的レンダリング。MudBlazor を使わない） */
.sv-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #1f4e79, #2f6fa8); }
.sv-login-card { background: #fff; border-radius: 12px; padding: 28px 24px; width: 100%; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.sv-login-card h1 { font-size: 1.4rem; margin: 0 0 8px; color: #1f4e79; }
.sv-login-card h1 small { font-size: .8rem; color: #6b7280; font-weight: 400; }
.sv-login-lead { font-size: 13px; color: #4b5563; margin: 0 0 16px; }
.sv-login-card label { display: block; font-size: 13px; margin: 12px 0 4px; color: #374151; }
.sv-login-card input { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #c7ced6; border-radius: 6px; font-size: 16px; }
.sv-login-card button { margin-top: 20px; width: 100%; padding: 12px; border: 0; border-radius: 6px; background: #1f4e79; color: #fff; font-size: 16px; cursor: pointer; }
.sv-login-card button:hover { background: #183e60; }
.sv-login-error { background: #fdecea; color: #b71c1c; padding: 8px 10px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }

/* スマホ（幅 600px 未満）: ボタンの文字は改行させない */
@media (max-width: 600px) {
    .mud-button-root { white-space: nowrap; }
    .sv-project-picker { min-width: 160px; }
    .sv-card-thumb { width: 150px; }
}
.sv-tabs .mud-tabs-panels { padding: 12px; }

/* 一覧の状態の欄（状態と名刺の読み取りの印を並べる） */
.sv-status-cell { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.sv-ocr-badge { white-space: nowrap; }

/* スマホの訪問一覧（カード。2026-12-01） */
.sv-cards { display: flex; flex-direction: column; gap: 8px; }
.sv-card { display: block; background: #fff; border: 1px solid #dde3ea; border-radius: 8px; padding: 8px 12px; color: inherit; text-decoration: none; }
.sv-card:active { background: #eef3f8; }
.sv-card-top { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sv-card-date { margin-left: auto; font-size: 13px; color: #4b5563; white-space: nowrap; }
.sv-card-comments { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: #4b5563; }
.sv-card-title { font-weight: 700; font-size: 15px; margin-top: 4px; word-break: break-word; }
.sv-card-line { font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sv-card-next { margin-left: auto; white-space: nowrap; }

/* 添付ファイル */
.sv-attachments { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.sv-attachment { display: flex; align-items: center; gap: 6px; font-size: 14px; }
