/* ===== リセット & ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f0f4f8;
    min-height: 100vh;
}

/* ===== ログイン画面 ===== */
.page-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f4fb 0%, #d0eaf7 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.login-card {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    padding: 40px 36px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.login-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: #3B9EBF;
    letter-spacing: 0.5px;
}

.login-title {
    font-size: 15px;
    color: #666;
    font-weight: 400;
    margin-bottom: 24px;
}

/* エラー */
.alert {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-error {
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    color: #c0392b;
}

/* フォーム */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #cdd8e3;
    border-radius: 4px;
    background: #fff;
    color: #333;
    transition: border-color 0.15s;
    outline: none;
}

.form-control-static {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #e5eaef;
    border-radius: 4px;
    background: #f7f9fb;
    color: #555;
    min-height: 38px;
}

/* 返却詳細などの読み取り専用リスト */
.detail-list {
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
}
.detail-list dt {
    padding: 7px 12px;
    font-size: 13px;
    color: #666;
    background: #f7f9fb;
    border-bottom: 1px solid #e5eaef;
    white-space: nowrap;
    display: flex;
    align-items: center;
}
.detail-list dd {
    padding: 7px 12px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border-bottom: 1px solid #e5eaef;
    display: flex;
    align-items: center;
    word-break: break-all;
}
.detail-list dt:last-of-type,
.detail-list dd:last-of-type {
    border-bottom: none;
}

.form-control:focus {
    border-color: #3B9EBF;
    box-shadow: 0 0 0 3px rgba(59, 158, 191, 0.15);
}

.btn-login {
    display: block;
    width: 100%;
    padding: 11px;
    margin-top: 8px;
    background: #3B9EBF;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.5px;
}

.btn-login:hover  { background: #2e87a5; }
.btn-login:active { background: #27748f; }

.login-footer {
    font-size: 11px;
    color: #999;
}

/* ==========================================================
   アプリレイアウト（認証済みページ共通）
   ========================================================== */

/* ---- 変数 ---- */
:root {
    --sidebar-width: 220px;
    --header-height: 52px;
    --sidebar-bg:     #1e2d3d;
    --sidebar-hover:  #263d52;
    --sidebar-active: #3B9EBF;
    --sidebar-text:   #9ab4c8;
    --sidebar-text-active: #ffffff;
}

/* ---- ベースレイアウト ---- */
.page-app {
    background: #f0f4f8;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================
   サイドバー
   ========================================================== */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.2s ease;
}

/* ロゴ */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

/* ナビゲーションリスト */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.nav-list {
    list-style: none;
}

/* 共通リンクスタイル */
.nav-link,
.nav-link--parent {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    line-height: 1.4;
}

.nav-link:hover,
.nav-link--parent:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-link.is-active,
.nav-link--parent.is-active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

/* アイコン */
.nav-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    opacity: 0.75;
}

.nav-icon svg {
    width: 16px;
    height: 16px;
}

.nav-link.is-active .nav-icon,
.nav-link--parent.is-active .nav-icon {
    opacity: 1;
}

/* 開閉矢印 */
.nav-arrow {
    margin-left: auto;
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.5;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.nav-item--parent.is-open .nav-arrow {
    transform: rotate(180deg);
}

/* サブメニュー */
.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: rgba(0,0,0,0.15);
}
/* is-open はJS側のstyle.maxHeightで制御するため、CSSクラスは矢印・背景のみ担当 */

.nav-sublink {
    display: block;
    padding: 7px 16px 7px 42px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 12px;
    transition: background 0.12s, color 0.12s;
    line-height: 1.4;
}

.nav-sublink:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-sublink.is-active {
    color: #ffffff;
    background: rgba(59,158,191,0.35);
}

/* ==========================================================
   メインエリア
   ========================================================== */
.app-body {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* ヘッダー */
.app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 16px;
    gap: 12px;
    flex-shrink: 0;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-page-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e2d3d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-username {
    font-size: 13px;
    color: #555;
}

/* ハンバーガー（モバイル用） */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 28px;
    height: 28px;
    padding: 4px;
    border: none;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle span {
    display: block;
    height: 2px;
    background: #555;
    border-radius: 1px;
}

/* ログアウトボタン */
.logout-form {
    margin: 0;
}

.btn-logout {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: #f6f8fa;
    color: #333;
}

/* フラッシュメッセージ */
.flash {
    padding: 10px 20px;
    font-size: 13px;
    line-height: 1.5;
}

.flash--success {
    background: #d4edda;
    border-bottom: 1px solid #c3e6cb;
    color: #1d6a34;
}

.flash--error {
    background: #fff0f0;
    border-bottom: 1px solid #f5c6cb;
    color: #c0392b;
}

/* メインコンテンツ */
.app-main {
    flex: 1;
    padding: 24px 20px;
    min-height: 0;
}

/* 暫定プレースホルダー */
.placeholder-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #fff;
    border-radius: 6px;
    border: 1px dashed #cdd8e3;
    color: #888;
    font-size: 14px;
}

/* ==========================================================
   共通コンポーネント
   ========================================================== */

/* パンくず */
.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}
.page-breadcrumb a { color: #3B9EBF; text-decoration: none; }
.page-breadcrumb a:hover { text-decoration: underline; }

/* カード */
.card {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.card-header {
    padding: 13px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e2d3d;
    margin: 0;
}
.card-body { padding: 16px 20px; }

/* テーブル */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th,
.table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.table th {
    background: #f7f9fc;
    font-weight: 600;
    color: #444;
    font-size: 12px;
    white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tr.row-editing   { background: #fffbe6; }
.col-actions { width: 1px; white-space: nowrap; }
.col-toggle  { width: 1px; white-space: nowrap; text-align: center; }
.table-actions { white-space: nowrap; vertical-align: middle; }
.table-actions > * + * { margin-left: 6px; }

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    white-space: nowrap;
    line-height: 1;
}
.btn-sm  { padding: 4px 10px; font-size: 12px; }
.btn-xs  { padding: 2px 8px;  font-size: 11px; }
.btn-success      { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-success:hover { background: #219a52; border-color: #219a52; }
.btn-primary   { background: #3B9EBF; color: #fff; border-color: #3B9EBF; }
.btn-primary:hover   { background: #2e87a5; border-color: #2e87a5; }
.btn-secondary { background: #fff; color: #555; border-color: #d0d7de; }
.btn-secondary:hover { background: #f6f8fa; }
.btn-warning   { background: #f39c12; color: #fff; border-color: #f39c12; }
.btn-warning:hover   { background: #e08e0b; border-color: #e08e0b; }
.btn-danger    { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.btn-danger:hover    { background: #c0392b; border-color: #c0392b; }

/* フォーム拡張 */
.form-select {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #cdd8e3;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    outline: none;
}
.form-select:focus {
    border-color: #3B9EBF;
    box-shadow: 0 0 0 3px rgba(59,158,191,0.15);
}
.required { color: #e74c3c; }
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.form-row .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }
.form-group--submit {
    flex: 0 0 auto !important;
    min-width: auto !important;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.d-inline { display: inline; }

/* バッジ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-spot    { background: #e8f4fb; color: #2e87a5; }
.badge-monthly { background: #fff3cd; color: #856404; }
.badge-none    { background: #f0f0f0; color: #666;    }

/* アラート追加 */
.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #1d6a34;
}

/* 空リスト */
.empty-message { color: #888; font-size: 13px; padding: 8px 0; }

/* ==========================================================
   マスタ管理 トップページ
   ========================================================== */
.master-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.master-index-section .card-title { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.master-index-links { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.master-index-links a {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.1s;
}
.master-index-links a:hover { background: #f0f4f8; color: #3B9EBF; }
.master-index-links .not-impl {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 4px;
    color: #bbb;
    font-size: 13px;
    cursor: default;
}

/* ==========================================================
   レスポンシブ（狭い画面）
   ========================================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.is-open {
        transform: translateX(0);
    }
    .app-body {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
}

/* === 複雑マスタ検索フォーム === */
.search-card { margin-bottom: 16px; }
.search-card .card-body { padding: 14px 20px; }
.search-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.search-form .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }
.search-form .form-group--submit { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; }

/* === 一覧ヘッダー（タイトル+新規登録ボタン） === */
.list-header { display: flex; align-items: center; justify-content: space-between; }

/* === 画像プレビュー === */
.img-preview-box { width: 120px; height: 80px; border: 1px solid #cdd8e3; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f7f9fc; margin-bottom: 8px; }
.img-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-preview-thumb { width: 40px; height: 40px; border: 1px solid #e2e8f0; border-radius: 3px; object-fit: contain; vertical-align: middle; }

/* === バッジ追加 === */
.badge-role-honsha  { background: #e8f4fb; color: #2e87a5; }
.badge-role-fc      { background: #fff3cd; color: #856404; }
.badge-role-office  { background: #f0f0f0; color: #666; }
.badge-days         { background: #e8f4fb; color: #2e87a5; }
.badge-quantity     { background: #fff3cd; color: #856404; }
.badge-insurance    { background: #fde8e8; color: #c0392b; }
.badge-non-smoking  { background: #e8f4fb; color: #2e87a5; }
.badge-smoking      { background: #fde8e8; color: #c0392b; }
.badge-both         { background: #fff3cd; color: #856404; }

/* === オプション料金グリッド === */
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.price-grid .form-group { min-width: 0; }

/* === フォームセクション === */
.form-section-title { font-size: 12px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #e2e8f0; }

/* === フォームアクションボタン行 === */
.form-actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #e2e8f0; }

/* ==========================================================
   予約一覧
   ========================================================== */

/* 検索フォーム2行レイアウト */
.search-form--reservation { flex-direction: column; gap: 8px; align-items: stretch; }
.search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.search-row .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }
.search-row .form-group--submit { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; }

/* 日付範囲入力 */
.input-range { display: flex; align-items: center; gap: 6px; }
.input-range .form-control { flex: 1; min-width: 0; }
.range-sep { white-space: nowrap; color: #666; font-size: 13px; }

/* 件数表示+ページネーション+ボタン を並べるヘッダー */
.list-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-count { margin: 0; font-size: 13px; color: #555; flex: 1; }

/* ページネーション */
.pagination { display: flex; gap: 3px; flex-wrap: wrap; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid #cdd8e3;
    font-size: 12px;
    color: #3B9EBF;
    text-decoration: none;
    transition: background 0.1s;
}
.page-link:hover { background: #f0f7fa; }
.page-link.is-current {
    background: #3B9EBF;
    border-color: #3B9EBF;
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}

/* カードフッター（ページネーション下） */
.card-footer { padding: 10px 20px; border-top: 1px solid #e8eef4; display: flex; justify-content: center; }

/* テーブルスクロール */
.table-responsive { overflow-x: auto; }

/* 予約一覧テーブル */
.table--reservation th,
.table--reservation td { white-space: nowrap; vertical-align: middle; }
.table--reservation td small { font-size: 11px; }

/* 行作業ボタン列 */
.td-actions { vertical-align: middle; }
.td-actions-inner { display: flex; flex-direction: column; gap: 4px; }

/* テキスト色 */
.text-danger { color: #e74c3c; font-weight: 600; }
.text-muted  { color: #888; }

/* バッジ（汎用） */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.badge--teal   { background: #e0f5f8; color: #1a7f96; }
.badge--orange { background: #fff3e0; color: #c47a00; }
.badge--green  { background: #e6f4ea; color: #277a3b; }
.badge--red    { background: #fde8e8; color: #c0392b; }
.badge--gray   { background: #f0f0f0; color: #666; }

/* ボタン追加色 */
.btn-teal          { background: #3B9EBF; color: #fff; border: none; }
.btn-teal:hover    { background: #2e87a5; color: #fff; }
.btn-orange        { background: #f0940a; color: #fff; border: none; }
.btn-orange:hover  { background: #d4820a; color: #fff; }
.btn-outline-orange { background: #fff; color: #f0940a; border: 1px solid #f0940a; }
.btn-outline-orange:hover { background: #fff8ee; }

/* ==========================================================
   予約フォーム（新規・詳細共通）
   ========================================================== */

.res-form-wrap { }

/* 3カラムグリッド */
.res-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}
@media (max-width: 1100px) {
    .res-form { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .res-form { grid-template-columns: 1fr; }
}

/* セクション */
.form-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}
.form-section-hd {
    background: #4a6d8c;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
}
.form-section .form-group {
    padding: 6px 12px 0;
    margin-bottom: 0;
}
.form-section .form-group:last-child {
    padding-bottom: 10px;
}
.form-section textarea.form-control {
    margin: 6px 12px 10px;
    width: calc(100% - 24px);
    box-sizing: border-box;
}

/* 静的表示 */
.form-static {
    font-size: 13px;
    padding: 5px 0;
    font-weight: 600;
    color: #1a2e44;
}

/* 必須マーク */
.required { color: #e53e3e; margin-left: 2px; }

/* ラジオグループ */
.radio-group { display: flex; gap: 16px; padding: 5px 0; }
.radio-label  { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }

/* インライン入力グループ */
.input-inline-group { display: flex; align-items: center; gap: 6px; }
.form-control--sm { width: 90px; }
.form-control--xs { width: 64px; }
.inline-label { font-size: 12px; color: #555; white-space: nowrap; }
.unit-label   { font-size: 12px; color: #666; white-space: nowrap; }
.text-right   { text-align: right; }

/* オプションテーブル */
.option-table { width: 100%; font-size: 12px; }
.option-table tr { border-bottom: 1px solid #f0f4f8; }
.option-table tr:last-child { border-bottom: none; }
.option-name  { padding: 5px 12px; color: #444; }
.option-input { padding: 4px 12px; display: flex; align-items: center; gap: 4px; }

/* 料金テーブル */
.charge-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.charge-table tr { border-bottom: 1px solid #f0f4f8; }
.charge-table tr:last-child { border-bottom: none; }
.charge-label { padding: 5px 12px; color: #444; white-space: nowrap; }
.charge-value { padding: 4px 4px; }
.charge-unit  { padding: 4px 12px 4px 2px; color: #666; font-size: 11px; }
.charge-total-row .charge-label { font-weight: 700; color: #1a2e44; }
.charge-total-row .charge-value input { font-weight: 700; }

/* 社内メモ */
.memo-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}
.memo-section .form-section-hd { margin-bottom: 0; }
.memo-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 12px;
}
.memo-col-hd {
    font-weight: 600;
    font-size: 13px;
    color: #4a6d8c;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e2e8f0;
}
.memo-col .form-control { width: 100%; }

/* フォームアクションボタン */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 24px;
}

/* お客様連絡事項ボックス（詳細画面のみ） */
.customer-request-box {
    background: #fffbe6;
    border: 1px solid #f5e14a;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
}
.customer-request-label { font-size: 12px; font-weight: 600; color: #7d6000; margin-bottom: 4px; }
.customer-request-body  { font-size: 13px; color: #333; }

/* ==========================================================
   CSV予約登録
   ========================================================== */

.csv-upload-form { }
.csv-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.csv-upload-row .form-group { margin-bottom: 0; flex: 1; min-width: 200px; }
.csv-upload-row .form-group--submit { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; }

.portal-csv-section {
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.portal-csv-hd {
    background: #3d5a73;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
}
.portal-csv-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
}
.portal-csv-col {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f4f8;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
}
.portal-csv-col-num {
    display: inline-block;
    background: #4a6d8c;
    color: #fff;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* ===== クラス フォーム ===== */
.class-form-top { display: flex; gap: 16px; align-items: flex-start; }
.class-form-left { flex: 0 0 220px; }
.class-form-right { flex: 1; min-width: 0; }
.class-form-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.class-form-grid .form-group { margin-bottom: 0; }
.input-with-unit { display: flex; align-items: center; gap: 6px; }
.input-with-unit .form-control { flex: 1; }

/* ===== 車両管理 フォーム ===== */
.vehicle-form-top { display: flex; gap: 16px; align-items: flex-start; }
.vehicle-form-left { flex: 0 0 240px; }
.vehicle-form-right { flex: 1; min-width: 0; }
.plate-input-group { display: flex; align-items: center; gap: 6px; }

/* 中部フィールド（グリッドレイアウト） */
.vehicle-form-mid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 12px;
}
.vehicle-form-mid .form-group { margin-bottom: 0; }
.vehicle-form-mid .span2 { grid-column: span 2; }
.vehicle-form-mid .input-inline-group { flex-wrap: nowrap; }
.monospace { font-family: monospace; letter-spacing: 0.05em; }

/* ===== 整備情報 ===== */
.maint-vehicle-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.maint-vehicle-info { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.maint-vehicle-info__item { display: flex; align-items: baseline; gap: 6px; }
.maint-vehicle-info__label { font-size: 12px; color: #888; white-space: nowrap; }
.maint-vehicle-info__value { font-size: 14px; font-weight: 600; }
.table--compact td, .table--compact th { padding: 6px 8px; font-size: 13px; }
.pagination-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; border-bottom: 1px solid #e2e8f0; }
.pagination-bar--bottom { border-bottom: none; border-top: 1px solid #e2e8f0; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 8px; border: 1px solid #cdd8e3; border-radius: 4px; font-size: 12px; color: #4a6d8c; text-decoration: none; }
.page-btn.is-current { background: #3b9ebf; color: #fff; border-color: #3b9ebf; }
.page-btn:hover:not(.is-current) { background: #f0f4f8; }

/* ===== 陸事提出書類 ===== */
.transport-doc-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b9ebf;
}
.transport-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 8px;
}
.transport-doc-header__left { flex: 1; }
.transport-doc-formal-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
    margin: 0;
}
.transport-doc-info-table { border-collapse: collapse; font-size: 13px; }
.transport-doc-info-table th,
.transport-doc-info-table td {
    border: 1px solid #ccc;
    padding: 4px 10px;
    white-space: nowrap;
}
.transport-doc-info-table th { background: #f4f7fa; font-weight: 600; }
.transport-doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.transport-doc-table th,
.transport-doc-table td {
    border: 1px solid #bbb;
    padding: 5px 8px;
}
.transport-doc-table thead th { background: #f0f4f8; font-weight: 600; }
.transport-doc-num { text-align: right; font-variant-numeric: tabular-nums; }
.transport-doc-total td { font-weight: 700; background: #f8f9fa; }

/* ============================================================
   売上テーブル
   ============================================================ */
.sales-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sales-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}
.sales-table th,
.sales-table td {
    border: 1px solid #d0d7e2;
    padding: 5px 7px;
    vertical-align: middle;
}
.sales-th {
    background: #2563a8;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 72px;
}
.sales-th--bold { background: #1a4a8a; }
.sales-th--accent { background: #c05a00; }
.sales-th-date {
    background: #2563a8;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 52px;
    position: sticky;
    left: 0;
    z-index: 2;
}
.sales-td {
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: #fff;
}
.sales-td--bold {
    font-weight: 700;
    background: #edf3fb;
}
.sales-td--accent {
    background: #fff5ec;
}
.sales-td-date {
    text-align: center;
    background: #f4f7fa;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
}
.sales-tr-total td {
    background: #dce8f8;
    font-weight: 700;
}
.sales-tr-total .sales-td--bold { background: #b8d0ef; }
.sales-tr-total .sales-td--accent { background: #f5e0cc; }
.link-day {
    color: #2563a8;
    text-decoration: none;
    font-weight: 600;
}
.link-day:hover { text-decoration: underline; }

/* =============================================
   売上日別報告
   ============================================= */
.daily-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}
.daily-report-table th,
.daily-report-table td {
    border: 1px solid #d0d7e2;
    padding: 5px 8px;
    vertical-align: middle;
}
.dr-th-label {
    background: #2563a8;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 130px;
}
.dr-th-group {
    background: #1a4a8a;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 100px;
}
.dr-th-credit {
    background: #c05a00;
    color: #fff;
    font-weight: 600;
    text-align: center;
}
.dr-th-sub {
    background: #3a6bbf;
    color: #fff;
    font-weight: 500;
    text-align: center;
    min-width: 68px;
}
.dr-td-label {
    background: #f4f7fa;
    font-weight: 500;
    text-align: left;
}
.dr-td-num {
    text-align: right;
    background: #fff;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
}
.dr-td-amt {
    text-align: right;
    background: #fff;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
}
.dr-td-bold {
    font-weight: 700;
    background: #edf3fb;
}
.dr-tr-total .dr-td-label { background: #dce8f8; font-weight: 700; }
.dr-tr-total .dr-td-num   { background: #dce8f8; font-weight: 700; }
.dr-tr-total .dr-td-amt   { background: #dce8f8; font-weight: 700; }
.dr-section-label {
    font-size: 13px;
    font-weight: 700;
    color: #2563a8;
    margin: 18px 0 6px;
}
.dr-section-label--blue   { color: #2563a8; }
.dr-section-label--orange { color: #c05a00; }

/* =============================================
   販売種別統計
   ============================================= */
.sales-type-stats-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sales-type-stats-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}
.sales-type-stats-table th,
.sales-type-stats-table td {
    border: 1px solid #d0d7e2;
    padding: 4px 6px;
    vertical-align: middle;
}
/* ヘッダー行 */
.sts-th-cat {
    background: #1a4a8a;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 120px;
    position: sticky;
    left: 0;
    z-index: 3;
}
.sts-th-type {
    background: #1a4a8a;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 130px;
    position: sticky;
    left: 120px;
    z-index: 3;
}
.sts-th-day {
    background: #2563a8;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 36px;
}
.sts-th-month {
    background: #1a4a8a;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 50px;
}
/* カテゴリ列（左固定） */
.sts-td-cat {
    background: #2563a8;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    vertical-align: top;
    padding-top: 6px;
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 120px;
    max-width: 120px;
}
/* 販売先名列（左固定2列目） */
.sts-td-type {
    background: #1e3d6e;
    color: #fff;
    font-size: 11px;
    position: sticky;
    left: 120px;
    z-index: 2;
    min-width: 130px;
    max-width: 130px;
}
.sts-td-type--agg {
    background: #1a4a8a;
    font-weight: 700;
    color: #c8d8f0;
}
/* 日付セル */
.sts-td-day {
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: #fff;
    min-width: 36px;
}
/* 月計セル */
.sts-td-month {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    background: #edf3fb;
    min-width: 50px;
}
/* カテゴリ集計行 */
.sts-row-cat-agg .sts-td-day {
    background: #f0f5fc;
}
/* 日間集計行（橙） */
.sts-row-grand-total .sts-td-grand {
    background: #e07820;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 2;
}
.sts-row-grand-total .sts-td-day {
    background: #fff3e0;
    font-weight: 700;
}
.sts-row-grand-total .sts-td-month {
    background: #fde0b0;
    font-weight: 700;
}

/* 現金管理 2カラムレイアウト */
.dr-cash-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 12px;
}
.dr-cash-table,
.dr-denom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.dr-cash-table th,
.dr-cash-table td,
.dr-denom-table th,
.dr-denom-table td {
    border: 1px solid #d0d7e2;
    padding: 5px 8px;
    vertical-align: middle;
}
.dr-cash-table thead th,
.dr-denom-table thead th {
    background: #2563a8;
    color: #fff;
    font-weight: 600;
    text-align: center;
}
.dr-cash-table tbody th {
    background: #f4f7fa;
    font-weight: 500;
    text-align: left;
}
.dr-cash-table td,
.dr-denom-table td {
    text-align: right;
    background: #fff;
    font-variant-numeric: tabular-nums;
}
.dr-cash-table tr.dr-tr-subtotal th,
.dr-cash-table tr.dr-tr-subtotal td {
    background: #edf3fb;
    font-weight: 700;
}
.dr-cash-table tr.dr-tr-total2 th,
.dr-cash-table tr.dr-tr-total2 td {
    background: #dce8f8;
    font-weight: 700;
}
.dr-denom-table tbody td.denom-count-cell {
    text-align: right;
    padding: 2px 4px;
}
.dr-denom-table tbody td.denom-count-cell input[type="number"] {
    width: 70px;
    text-align: right;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 12px;
}
.dr-denom-subtotal {
    font-weight: 700;
    background: #edf3fb !important;
}
.dr-denom-result th {
    background: #f4f7fa;
    font-weight: 500;
    text-align: left;
}
.dr-denom-result td {
    background: #fff;
    font-weight: 600;
}
.dr-denom-result.dr-tr-diff th,
.dr-denom-result.dr-tr-diff td { color: #b00; }
.dr-stamp-area {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: auto;
}
.dr-stamp-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.dr-stamp-item label {
    white-space: nowrap;
    font-weight: 500;
    color: #444;
}
.dr-stamp-item input[type="text"] {
    width: 100px;
    border: 1px solid #b0bec5;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 13px;
}
.dr-confirmed-badge {
    display: inline-block;
    background: #22a06b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 10px;
}

/* =============================================
   売上日計累計表
   ============================================= */
.search-rows { display: flex; flex-direction: column; gap: 10px; }
.search-label-wide { min-width: 90px; }
.form-control--narrow { width: 80px; }
.form-unit { margin: 0 6px 0 2px; font-size: 13px; }
.radio-label { display: inline-flex; align-items: center; gap: 4px; margin-right: 16px; cursor: pointer; font-size: 13px; }

.cumul-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cumul-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}
.cumul-table th,
.cumul-table td {
    border: 1px solid #d0d7e2;
    padding: 4px 8px;
    vertical-align: middle;
}
.cumul-th {
    background: #2563a8;
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}
.cumul-th--day { min-width: 30px; background: #1a4a8a; }
.cumul-th--accent { background: #1a4a8a; }
.cumul-th--dark { background: #143a70; }

.cumul-td-day {
    text-align: center;
    font-weight: 600;
    background: #f4f7fa;
    min-width: 30px;
}
.cumul-td-dow {
    text-align: center;
    background: #f4f7fa;
    min-width: 30px;
}
.cumul-dow--sat { color: #1a6bc4; }
.cumul-dow--sun { color: #c0392b; }
.cumul-tr--sat .cumul-td-day,
.cumul-tr--sat .cumul-td-dow { background: #eef3fb; }
.cumul-tr--sun .cumul-td-day,
.cumul-tr--sun .cumul-td-dow { background: #fdf0f0; }

.cumul-td-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: #fff;
    min-width: 80px;
}
.cumul-td-accent { background: #edf3fb; }
.cumul-td-dark   { background: #dce8f8; }

.cumul-mikakunin {
    color: #c0392b;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

.cumul-tr-total td {
    background: #dce8f8;
    font-weight: 700;
}
.cumul-td-total-label {
    text-align: center;
    font-weight: 700;
    background: #dce8f8;
}
