/* [PC5] @file: pc5.css | @version: Ver 1.9 | @updated: 2026-11-26 | @changes: Add CXP multi-link button group wrap and disabled link state */
/* public/css/pc5.css - Normalized Edition */
:root {
    --navy-dark: #07192d;
    --navy-mid: #0d2b4d;
    --navy-table: #102a45;
    --navy-btn: #0d3868;
    --navy-btn-hover: #154c8a;
    --link-blue: #0284c7;
    --link-blue-hover: #0369a1;
    --border-light: #cbd5e1;
    --bg-page: #f0f4f8;
    --text-main: #1f2937;
    --highlight-bg: #fefce8;
    --highlight-border: #eab308;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 1. 共通ユーティリティ ===== */
.m-0 {
    margin: 0;
}

.ml-0 {
    margin-left: 0 !important;
}

.pt-6 {
    padding-top: 6px;
}

.pr-0 {
    padding-right: 0 !important;
}

.is-hidden {
    display: none !important;
}

.text-center {
    text-align: center !important;
}

.v-middle {
    vertical-align: middle !important;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.role-mode-note {
    font-size: 12px;
    font-weight: normal;
}

/* ===== 2. 共通：上部ヘッダー・縦型ポップアップメニュー・下部フッター・メイン枠 ===== */
.top-banner {
    background: linear-gradient(90deg, #040d1a 0%, #0b223e 55%, #16365c 100%);
    color: #fff;
    height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: visible;
    z-index: 500;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.jlr-logo-img {
    height: 28px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.35);
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin: 0;
}

.user-info {
    font-size: 13px;
    font-weight: 600;
    color: #e5e7eb;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
}

.btn-header,
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-header:hover,
.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ヘッダー内：縦型ナビゲーションポップアップ */
.nav-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-nav-toggle:hover,
.btn-nav-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.24);
    border-color: #ffffff;
}

.nav-popup {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 310px;
    max-height: 84vh;
    overflow-y: auto;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 14px 32px rgba(13, 43, 77, 0.25);
    z-index: 10000;
}

.nav-popup.open {
    display: block;
}

.nav-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--navy-mid);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.nav-popup-top-link {
    color: #93c5fd;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 600;
}

.nav-popup-top-link:hover {
    text-decoration: underline;
    color: #ffffff;
}

.nav-popup-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
}

.nav-popup-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px;
}

.nav-popup-cat {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--navy-mid);
    border-bottom: 2px solid var(--navy-mid);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.nav-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-popup-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.nav-popup-list li a:hover:not(.disabled) {
    background: var(--navy-btn);
    border-color: var(--navy-btn);
    color: #ffffff;
}

.nav-popup-list li a.active {
    background: #dbeafe;
    border-color: #60a5fa;
    color: var(--navy-mid);
}

.nav-popup-list li a.disabled {
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.nav-badge-prep {
    display: inline-block;
    background: #cbd5e1;
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.4;
}

.bottom-footer {
    margin-top: auto;
    background: linear-gradient(90deg, #0d2746 0%, #061527 100%);
    height: 48px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--border-light);
}

.footer-brands {
    display: none !important;
}

.footer-copyright {
    margin: 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
}

.main-container {
    flex: 1;
    padding: 16px 24px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* ===== 3. ログイン画面（login.html） ===== */
.login-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: radial-gradient(circle at top right, #e2e8f0 0%, #f0f4f8 65%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #dce3ec;
    box-shadow: 0 8px 24px rgba(7, 25, 45, 0.12);
    overflow: hidden;
}

.login-card-header {
    background: linear-gradient(90deg, #0b223e 0%, #1d426c 100%);
    color: #fff;
    padding: 22px 28px;
    text-align: center;
}

.login-card-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    margin-bottom: 10px;
}

.login-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.login-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: #cbd5e1;
}

.login-form {
    padding: 28px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-alert {
    margin: 0;
    padding: 10px 14px;
    border-radius: 6px;
    background: #fef2f2;
    border: 1px solid #f87171;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: #f8fafc;
    color: #111;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    background: #fff;
    border-color: var(--navy-btn);
    box-shadow: 0 0 0 3px rgba(13, 56, 104, 0.15);
}

.btn-login {
    margin-top: 6px;
    height: 44px;
    background: var(--navy-btn);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
}

.btn-login:hover {
    background: var(--navy-btn-hover);
}

/* ===== 4. メニュー画面（menu.html） ===== */
.menu-portal-container {
    max-width: 1120px;
    width: 100%;
    margin: 28px auto;
    padding: 0 24px;
    flex: 1;
}

.menu-portal-heading {
    margin-bottom: 20px;
}

.menu-portal-heading h2 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--navy-dark);
    font-weight: 800;
}

.menu-portal-heading p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.menu-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(7, 25, 45, 0.06);
    overflow: hidden;
}

.menu-card-header {
    background: linear-gradient(90deg, #0b223e 0%, #1d426c 100%);
    color: #ffffff;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.menu-card-list {
    list-style: none;
    margin: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
}

.menu-card-link:hover:not(.disabled) {
    background: var(--navy-btn);
    color: #ffffff;
    border-color: var(--navy-btn);
}

.menu-card-link.disabled {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.menu-badge-prep {
    font-size: 11px;
    font-weight: 700;
    background: #d1d5db;
    color: #4b5563;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== 5. 検索条件カード・グリッド整列 ===== */
.search-card,
.form-card,
.table-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid #dce3ec;
    overflow: hidden;
    margin-bottom: 14px;
}

.table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.search-card-header,
.form-card-header {
    background: linear-gradient(90deg, #0b223e 0%, #1d426c 60%, #e5ecf4 100%);
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.search-card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-card-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
}

.filter-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* スリム検索画面用：1〜3列目の位置と幅を完全統一 */
body.slim-page .filter-row {
    display: grid;
    grid-template-columns: 105px 210px 235px 235px;
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
}

body.slim-page .filter-row>.form-control {
    width: 100% !important;
}

.filter-label {
    width: 95px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    flex-shrink: 0;
}

.form-control {
    height: 32px;
    padding: 4px 10px;
    font-size: 12.5px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: #fff;
    color: #111;
}

.form-control:focus {
    outline: none;
    border-color: var(--navy-btn);
    box-shadow: 0 0 0 2px rgba(13, 56, 104, 0.15);
}

.w-vin {
    width: 185px;
}

.w-reg {
    width: 185px;
}

.w-order {
    width: 160px;
}

.w-cust {
    width: 380px;
    max-width: 100%;
}

.w-pic {
    width: 185px;
}

.w-status {
    width: 165px;
}

.sub-label {
    font-size: 12.5px;
    font-weight: 700;
    margin-left: 8px;
    margin-right: 4px;
}

.filter-cell-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.filter-cell-inline .sub-label {
    margin: 0 !important;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    flex-shrink: 0;
}

.filter-cell-inline .form-control {
    flex: 1;
    min-width: 0;
    width: 100% !important;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input {
    width: 15px;
    height: 15px;
}

.search-btn-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-search {
    background: var(--navy-btn);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 136px;
    height: 34px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.btn-search:hover {
    background: var(--navy-btn-hover);
}

.btn-clear {
    width: 136px;
    height: 30px !important;
    font-size: 12px !important;
}

/* ===== 6. 一覧上部ツールバー・ページネーション・テーブル ===== */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #dce3ec;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 8px 16px;
}

.list-toolbar+.table-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

.pagination-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    color: #1e293b;
    flex-wrap: wrap;
}

.page-stat strong,
.page-indicator strong {
    color: var(--navy-btn);
    font-size: 13px;
}

.page-size-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.page-size-input {
    width: 56px;
    height: 26px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.page-nav-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-page {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border-light);
    background: #ffffff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-page:hover:not(:disabled) {
    background: var(--navy-btn);
    color: #ffffff;
    border-color: var(--navy-btn);
}

.btn-page:disabled {
    background: #f1f5f9;
    color: var(--border-light);
    cursor: not-allowed;
}

table.contract-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

table.contract-table thead th {
    background: var(--navy-table);
    color: #fff;
    font-weight: 600;
    padding: 6px 8px;
    border: 1px solid #244263;
    text-align: left;
    line-height: 1.3;
    white-space: nowrap;
}

table.contract-table tbody td {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
    line-height: 1.3;
    white-space: nowrap;
}

table.contract-table tbody tr.row-bottom td {
    border-bottom: 2px solid #94a3b8;
    background: #f8fafc;
}

/* 他拠店レコードの色分け */
table.contract-table tbody tr.other-dealer-top td {
    background-color: #fffbeb;
}

table.contract-table tbody tr.other-dealer-bottom td,
table.contract-table tbody tr.other-dealer-single td {
    background-color: #fef3c7;
}

table.contract-table tbody tr.other-dealer-top td:first-child,
table.contract-table tbody tr.other-dealer-bottom td:first-child,
table.contract-table tbody tr.other-dealer-single td:first-child {
    border-left: 4px solid #f59e0b;
}

.badge-other-dealer {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #92400e;
    background: #fde68a;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    vertical-align: middle;
}

/* ===== 7. 契約番号リンク ＆ 「詳細」ボタンのセル内右寄せ整列 ===== */
.contract-link-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.contract-no-link,
.contract-link-group .text-muted-disabled {
    font-family: "BIZ UDGothic", "Hiragino Kaku Gothic ProN", "Meiryo", Consolas, monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
}

.contract-no-link {
    color: var(--link-blue) !important;
    font-weight: 800 !important;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.contract-no-link:hover {
    color: var(--link-blue-hover) !important;
    text-decoration: none;
}

.text-muted-disabled {
    color: #94a3b8;
    font-weight: 700;
}

/* 一覧の操作ボタン（新規／詳細）の共通サイズ・右端揃え */
.btn-row-register,
.btn-inline-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 26px;
    padding: 0 10px;
    margin: 0 !important;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 4px;
    box-sizing: border-box;
    text-decoration: none;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-row-register {
    background: var(--navy-btn);
    color: #ffffff;
    border: 1px solid var(--navy-btn);
}

.btn-row-register:hover:not(:disabled):not(.btn-disabled) {
    background: var(--navy-btn-hover);
    border-color: var(--navy-btn-hover);
}

.btn-inline-detail {
    color: var(--link-blue);
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
}

.btn-inline-detail:hover:not(.btn-disabled) {
    background: var(--link-blue);
    color: #ffffff;
    border-color: var(--link-blue);
}

.btn-disabled,
.btn-row-register:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ステータス・マスタバッジ */
.own-dealer-badge {
    display: inline-block;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.own-dealer-y {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.own-dealer-n {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.status-unregistered {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.status-registered {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #38bdf8;
}

.status-active-master {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.status-disabled-master {
    background: #cbd5e1;
    color: #475569;
    border: 1px solid #94a3b8;
}

table.contract-table tbody tr.row-disabled td {
    background-color: #e2e8f0 !important;
    color: #94a3b8 !important;
}

table.contract-table tbody tr.row-disabled td .fw-700 {
    text-decoration: line-through;
}

.account-type-sub {
    color: #64748b;
    font-size: 11px;
}

.text-registered-done {
    color: #94a3b8;
    font-size: 11px;
}

.empty-state {
    padding: 32px 20px;
    text-align: center;
    color: #334155;
}

.empty-state svg {
    width: 40px;
    height: 40px;
    stroke: #475569;
    margin-bottom: 6px;
}

.empty-state p {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.empty-reason-note {
    margin-top: 6px !important;
    font-size: 12px !important;
    color: #b91c1c !important;
    font-weight: normal !important;
}

/* ===== 8. 新規加入登録・契約詳細・マスタ編集画面（ボックスレイアウト） ===== */
.flow-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    border: 1px solid #dce3ec;
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 14px;
}

.flow-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 700;
}

.step-badge {
    padding: 4px 12px;
    border-radius: 20px;
    background: #e2e8f0;
    color: #475569;
}

.step-badge.active {
    background: var(--navy-btn);
    color: #fff;
}

.step-arrow {
    color: #94a3b8;
    font-weight: bold;
}

.flow-note {
    font-size: 11.5px;
    color: #64748b;
}

.alert-success {
    display: none;
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13.5px;
    font-weight: 700;
    align-items: center;
    justify-content: space-between;
}

.alert-verify {
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    color: #92400e;
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13.5px;
}

.entry-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    padding: 20px 24px;
    align-items: start;
}

.entry-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.group-box {
    border: 1.5px solid #2b547e;
    border-radius: 4px;
    padding: 14px 18px 16px;
    margin: 0;
    background: #ffffff;
}

.group-box legend {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--navy-mid);
    padding: 0 8px;
    margin-left: 6px;
}

.box-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.box-row {
    display: grid;
    grid-template-columns: 185px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 30px;
}

.box-row.align-top {
    align-items: start;
}

.box-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
    padding-left: 4px;
}

.field-auto {
    width: 100%;
    height: 30px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    background-color: #cbd5e1;
    border: 1px solid #94a3b8;
    border-radius: 2px;
    pointer-events: none;
    user-select: none;
}

.field-input {
    width: 100%;
    height: 30px;
    padding: 4px 10px;
    font-size: 12.5px;
    color: #111827;
    background-color: #ffffff;
    border: 1.5px solid #1e293b;
    border-radius: 2px;
}

.field-input:focus {
    outline: none;
    border-color: var(--navy-btn);
    box-shadow: 0 0 0 2px rgba(13, 56, 104, 0.18);
}

textarea.field-input {
    height: 60px;
    padding: 6px 10px;
    resize: vertical;
    font-family: inherit;
}

.flag-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 26px;
    background-color: #cbd5e1;
    border: 1px solid #94a3b8;
    border-radius: 2px;
}

.flag-box input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--navy-btn);
}

.flag-box.flag-locked input[type="checkbox"] {
    pointer-events: none;
}

.readonly-mode .field-input {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    pointer-events: none;
}

.readonly-mode .flag-box input[type="checkbox"] {
    pointer-events: none;
}

.cert-inline-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cxp-legacy-note {
    font-size: 11.5px;
    color: #b91c1c;
    font-weight: 600;
}

.cxp-link-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-light);
    display: flex;
    justify-content: flex-end;
}

.btn-cxp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f0f9ff;
    color: var(--link-blue) !important;
    border: 1.5px solid var(--link-blue);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800 !important;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-cxp-link:hover {
    background: var(--link-blue);
    color: #ffffff !important;
    border-color: var(--link-blue);
}

.legend-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11.5px;
    color: #475569;
    padding: 0 24px 12px;
}

.legend-chip {
    display: inline-block;
    width: 32px;
    height: 14px;
    background: #cbd5e1;
    border: 1px solid #94a3b8;
    vertical-align: middle;
    margin-right: 6px;
}

/* ===== 9. ボタン・フッターバー・モーダル ===== */
.btn {
    height: 34px;
    padding: 0 16px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-light);
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    border-color: #d1d5db;
    cursor: not-allowed;
}

.btn-navy {
    background: var(--navy-btn);
    color: #fff;
    border-color: var(--navy-btn);
}

.btn-navy:hover:not(:disabled) {
    background: var(--navy-btn-hover);
}

.btn-danger-outline {
    border: 1.5px solid #dc2626;
    color: #dc2626;
    background: #fff;
}

.btn-danger-outline:hover:not(:disabled) {
    background: #fef2f2;
}

.btn-lg {
    height: 38px;
    padding: 0 24px;
    font-size: 13.5px;
}

.page-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 0 4px;
}

.form-footer {
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-footer-split {
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-left-area,
.footer-right-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-proc-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.confirm-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: #92400e;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}

.confirm-check-label:hover {
    background: #fef3c7;
}

.confirm-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy-btn);
    cursor: pointer;
}

/* モーダル共通 */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 25, 45, 0.65);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-window-xl {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 1180px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}

.modal-header {
    background: linear-gradient(90deg, #0b223e 0%, #1d426c 100%);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.modal-body-scroll {
    overflow-y: auto;
    flex: 1;
}

.modal-footer-bar {
    padding: 12px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.modal-proc-group,
.modal-action-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-alert-box {
    background: #ffffff;
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 2px solid var(--navy-mid);
}

.modal-alert-body {
    padding: 20px 24px;
    font-size: 13.5px;
    color: #1e293b;
}

.modal-alert-summary {
    margin-top: 12px;
    padding: 12px 14px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.modal-alert-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* ===== 10. Diffレポート画面専用クラス ===== */
.diff-changed {
    background-color: #fef9c3 !important;
    color: #b91c1c !important;
    font-weight: 800 !important;
}

.badge-diff-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.stage-label-before {
    display: inline-block;
    width: 54px;
    padding: 1px 4px;
    text-align: center;
    border-radius: 3px;
    font-size: 10.5px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    margin-right: 4px;
}

.stage-label-after {
    display: inline-block;
    width: 54px;
    padding: 1px 4px;
    text-align: center;
    border-radius: 3px;
    font-size: 10.5px;
    font-weight: 700;
    background: #dbeafe;
    color: #1e40af;
    margin-right: 4px;
}

/* ===== 11. タブレット・レスポンシブ対応 (統合版) ===== */
@media (max-width: 1024px) {
    .top-banner {
        padding: 0 16px;
    }

    .page-title {
        font-size: 15px;
    }

    .main-container {
        padding: 12px 14px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-card-body {
        grid-template-columns: 1fr;
    }

    .search-btn-col {
        flex-direction: row;
        justify-content: flex-end;
    }

    body.slim-page .filter-row {
        grid-template-columns: 95px 1fr 1fr;
    }

    .entry-grid {
        grid-template-columns: 1fr;
        padding: 14px 16px;
    }

    .col-hide-tablet {
        display: none;
    }
}

@media (max-width: 720px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }

    .box-row {
        grid-template-columns: 145px 1fr;
    }
}

/* ===== Req #6: 他拠店表示凡例（チェックON時のみ表示・赤色強調） ===== */
.legend-other-dealer-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #dc2626;
}

.legend-swatch-red {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fef3c7;
    border: 1.5px solid #dc2626;
}

/* ===== 項目ヘルプ「i」アイコン（readonly-mode でもクリック可能） ===== */
.label-with-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid #0d2b4d;
    background: #eff6ff;
    color: #0d2b4d;
    font-size: 11px;
    font-weight: 800;
    font-style: italic;
    font-family: Georgia, serif;
    line-height: 1;
    cursor: pointer !important;
    pointer-events: auto !important;
    flex-shrink: 0;
}

.btn-info-icon:hover {
    background: #0d2b4d;
    color: #ffffff;
}

/* ホバー／フォーカスで吹き出し表示するヘルプツールチップ */
.info-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    pointer-events: auto !important;
}

.info-tooltip-bubble {
    position: absolute;
    left: -12px;
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: 300px;
    padding: 9px 12px;
    border-radius: 6px;
    background: #0d2b4d;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    white-space: normal;
    text-align: left;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    pointer-events: none;
}

.info-tooltip-bubble::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #0d2b4d;
}

.info-tooltip-wrap:hover .info-tooltip-bubble,
.info-tooltip-wrap:focus-within .info-tooltip-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== メニュー見出し横：簡易オペレーションマニュアルリンク ===== */
.menu-portal-title-line {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.menu-portal-title-line h2 {
    margin: 0;
}

.btn-manual-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.btn-manual-link:hover {
    color: #0e3868;
}

.manual-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #0e2745;
    background: transparent;
    color: #0e2745;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-manual-link:hover .manual-info-icon {
    background: #0e2745;
    color: #ffffff;
}

.manual-link-text {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.manual-link-arrow {
    font-size: 13px;
    line-height: 1;
    color: #0e2745;
    transition: transform 0.15s ease;
}

.btn-manual-link:hover .manual-link-arrow {
    transform: translate(1px, -1px);
}

/* ===== メニュー配置：2列グリッド（左列縦詰め・右列レポート縦通し）＋全体センタリング ===== */
.menu-portal-container {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr;
    align-items: start;
    justify-content: center;
}

/* 左列：契約管理 → マスタ管理 → システムを隙間なく縦積み */
.menu-grid>.menu-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

/* 右列：レポートを3行ぶち抜き配置 */
.menu-grid>.menu-card:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 3;
}

#masterManageCard {
    grid-column: 1;
    grid-row: 2;
}

#systemManageCard {
    grid-column: 1;
    grid-row: 3;
}

@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .menu-grid>.menu-card:nth-child(1),
    .menu-grid>.menu-card:nth-child(2),
    #masterManageCard,
    #systemManageCard {
        grid-column: auto;
        grid-row: auto;
    }
}

/* ===== #21 顧客車両検索：列幅固定・省略表示・ホバー全文ツールチップ ===== */
.vehicle-list-table {
    table-layout: fixed;
    width: 100%;
}

.vehicle-list-table th,
.vehicle-list-table td:not(.col-no-ellipsis) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-list-table td.is-truncated {
    cursor: help;
}

.vehicle-list-table td.col-no-ellipsis {
    white-space: nowrap;
    overflow: visible;
}

.cell-hover-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    max-width: 440px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #0e2745;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    box-shadow: 0 10px 24px rgba(14, 39, 69, 0.28);
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0.12s ease;
}

.cell-hover-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== #22 新規加入37か月超過エラー表示 ===== */
.enrollment-limit-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1.5px solid #dc2626;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
}

.enrollment-limit-alert.is-hidden {
    display: none;
}

.footer-error-msg {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    margin-right: 12px;
}

.footer-error-msg.is-hidden {
    display: none;
}

.field-input-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

/* ===== CXPリンク複数ボタン配置 ＆ ID未設定時非活性 ===== */
.cxp-link-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.btn-cxp-link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
    text-decoration: none;
}