@charset "UTF-8";

/* ========================================= */
/* 共通変数・リセット                          */
/* ========================================= */
:root {
    --primary-color: #0056b3;
    --bg-color: #f4f6f9;
    --text-color: #333;
    --border-color: #dee2e6;
    --card-bg: #fff;
    
    --status-gray: #E7E7E7;
    --status-green: #65D984;
    --status-blue: #87CEFA;
    --status-yellow: #DEDC66;
    --status-red: #FF6347;

    --admin-primary: #343a40;
    --admin-secondary: #007bff;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* ========================================= */
/* 1. 利用者ログイン画面 (index.php)           */
/* ========================================= */
body.user-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}
body.user-login-body .login-box {
    background: #fff;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
body.user-login-body .login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}
body.user-login-body .login-description {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 30px;
    line-height: 1.5;
}
body.user-login-body .form-group {
    margin-bottom: 25px;
}
body.user-login-body .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-color);
}
body.user-login-body .form-group input {
    width: 100%;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1.1rem;
}
body.user-login-body .password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
body.user-login-body .password-input-wrapper input {
    padding-right: 45px;
}
body.user-login-body .btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #888;
    display: flex;
}
body.user-login-body .btn-toggle-password:hover {
    color: var(--primary-color);
}
body.user-login-body .btn-toggle-password svg {
    width: 22px;
    height: 22px;
}
body.user-login-body .btn-login {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}
body.user-login-body .btn-login:hover { background-color: #004494; }
body.user-login-body .error-msg { color: #dc3545; font-weight: bold; margin-bottom: 15px; text-align: center; }
body.user-login-body .footer-note {
    margin-top: 25px;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    line-height: 1.4;
}

/* ========================================= */
/* 2. 管理者ログイン画面 (admin/index.php)     */
/* ========================================= */
body.admin-login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
body.admin-login-body .login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
body.admin-login-body .login-box h1 { 
    text-align: center; 
    color: var(--admin-primary); 
    margin-top: 0; 
    margin-bottom: 30px; 
    font-size: 1.5rem; 
}
body.admin-login-body .form-group { margin-bottom: 20px; }
body.admin-login-body .form-group label { display: block; font-weight: bold; margin-bottom: 5px; }
body.admin-login-body .form-group input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
body.admin-login-body .password-input-wrapper { position: relative; display: flex; align-items: center; }
body.admin-login-body .password-input-wrapper input { padding-right: 45px; }
body.admin-login-body .btn-toggle-password { position: absolute; right: 12px; background: none; border: none; cursor: pointer; padding: 0; color: #888; display: flex; }
body.admin-login-body .btn-toggle-password:hover { color: var(--admin-secondary); }
body.admin-login-body .btn-toggle-password span { font-size: 22px; }
body.admin-login-body .btn-login { width: 100%; padding: 12px; background-color: var(--admin-secondary); color: #fff; border: none; border-radius: 4px; font-size: 1.1rem; cursor: pointer; margin-top: 10px; }
body.admin-login-body .btn-login:hover { background-color: #0056b3; }
body.admin-login-body .error-msg { color: #dc3545; text-align: center; margin-bottom: 15px; font-weight: bold; }

/* ========================================= */
/* 3. 管理者ダッシュボード共通 (admin/index.php) */
/* ========================================= */
body.admin-dashboard-body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
body.admin-dashboard-body .sidebar { 
    width: 250px; 
    background: var(--admin-primary); 
    color: #fff; 
    min-height: 100vh; 
    padding-top: 20px; 
    flex-shrink: 0; 
}
body.admin-dashboard-body .sidebar h2 { 
    text-align: center; 
    font-size: 1.2rem; 
    border-bottom: 1px solid #4b545c; 
    padding-bottom: 15px; 
    margin-bottom: 20px;
}
body.admin-dashboard-body .sidebar a { 
    display: block; 
    color: #c2c7d0; 
    text-decoration: none; 
    padding: 12px 20px; 
}
body.admin-dashboard-body .sidebar a:hover, 
body.admin-dashboard-body .sidebar a.active { 
    background: #495057; 
    color: #fff; 
    border-left: 3px solid var(--admin-secondary); 
}
body.admin-dashboard-body .main-content { 
    flex-grow: 1; 
    padding: 30px; 
    height: 100vh; 
    overflow-y: auto; 
    box-sizing: border-box; 
}
body.admin-dashboard-body .header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 10px; 
    margin-bottom: 30px;
}
body.admin-dashboard-body .header h1 { 
    margin: 0; 
    font-size: 1.8rem; 
}
body.admin-dashboard-body .card { 
    background: #fff; 
    padding: 20px; 
    border-radius: 4px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 30px; 
}
body.admin-dashboard-body .btn { 
    padding: 6px 12px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    color: #fff; 
    font-size: 0.85rem; 
    text-decoration: none; 
    display: inline-block; 
}
body.admin-dashboard-body .btn-primary { background: var(--admin-secondary); }
body.admin-dashboard-body .btn-secondary { background: #6c757d; }
/* Jspreadsheet（Excel風画面）のテーブルには共通スタイルを適用しない */
body.admin-dashboard-body table:not(.jexcel) { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
body.admin-dashboard-body table:not(.jexcel) th, body.admin-dashboard-body table:not(.jexcel) td { border: 1px solid var(--border-color); padding: 10px; text-align: left; }
body.admin-dashboard-body table:not(.jexcel) th { background: #f8f9fa; }

/* ========================================= */
/* 4. 利用者トップ画面 (user_top.php)          */
/* ========================================= */
body.user-top-body .header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
body.user-top-body .header h1 { margin: 0; font-size: 1rem; }
body.user-top-body .action-btn { background-color: transparent; border: none; color: #fff; padding: 5px; border-radius: 4px; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; }
body.user-top-body .action-btn:hover { background-color: rgba(255,255,255,0.1); }
body.user-top-body .search-bar-container { display: none; background-color: #e9ecef; padding: 10px 15px; border-bottom: 1px solid var(--border-color); }
body.user-top-body .search-bar-container input { width: 100%; padding: 10px 15px; border: 1px solid #ccc; border-radius: 20px; font-size: 1rem; box-sizing: border-box; outline: none; }
body.user-top-body .search-bar-container input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(0,86,179,0.25); }
body.user-top-body .container { max-width: 1200px; margin: 0 auto; padding: 20px; }
body.user-top-body .announcement { background-color: #fff3cd; border-left: 5px solid #ffecb5; color: #856404; padding: 15px; border-radius: 4px; margin-bottom: 20px; font-size: 0.95rem; }
body.user-top-body .range-slider-wrapper { position: relative; width: 100%; height: 30px; display: flex; align-items: center; }
body.user-top-body .range-track-bg { position: absolute; width: 100%; height: 6px; background: #ddd; border-radius: 3px; z-index: 1; }
body.user-top-body .range-track-fill { position: absolute; height: 6px; background: var(--primary-color); border-radius: 3px; z-index: 1; }
body.user-top-body .range-slider-wrapper input[type="range"] { position: absolute; width: 100%; -webkit-appearance: none; background: transparent; pointer-events: none; z-index: 2; margin: 0; outline: none; }
body.user-top-body .range-slider-wrapper input[type="range"]::-webkit-slider-thumb { pointer-events: all; -webkit-appearance: none; width: 20px; height: 20px; background: #fff; border: 2px solid var(--primary-color); border-radius: 50%; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
body.user-top-body .range-slider-wrapper input[type="range"]::-moz-range-thumb { pointer-events: all; width: 20px; height: 20px; background: #fff; border: 2px solid var(--primary-color); border-radius: 50%; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
body.user-top-body .filter-buttons { display: flex; gap: 10px; margin-bottom: 20px; }
body.user-top-body .filter-btn { flex: 1; padding: 10px; border: 1px solid var(--primary-color); background-color: #fff; color: var(--primary-color); border-radius: 4px; cursor: pointer; font-size: 0.9rem; font-weight: bold; text-align: center; }
body.user-top-body .filter-btn.active { background-color: var(--primary-color); color: #fff; opacity: 0.7; cursor: default; }
body.user-top-body .filter-btn:disabled { opacity: 0.5; background-color: #e9ecef !important; color: #6c757d !important; border-color: #ced4da !important; cursor: not-allowed; }
body.user-top-body .btn01style { padding: 4px 10px; border: 1px solid var(--primary-color); background-color: #fff; color: var(--primary-color); border-radius: 4px; text-decoration: none; font-size: 0.8rem; font-weight: bold; display: inline-block; text-align: center; transition: all 0.2s ease; flex: 1; }
body.user-top-body .btn01style:hover { background-color: var(--primary-color); color: #fff; }
body.user-top-body .legend { background: #fff; padding: 10px; border-radius: 4px; border: 1px solid var(--border-color); margin-bottom: 20px; font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
body.user-top-body .legend-item { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 6px 14px; border-radius: 20px; transition: all 0.2s ease; user-select: none; font-weight: bold; font-size: 0.85rem; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
body.user-top-body .legend-item:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
body.user-top-body .legend-item.inactive { opacity: 0.5; background-color: #e9ecef !important; color: #6c757d !important; border-color: #ced4da; box-shadow: none; transform: none; }
body.user-top-body .card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { body.user-top-body .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { body.user-top-body .card-grid { grid-template-columns: repeat(3, 1fr); } }
body.user-top-body .dispatch-card { background-color: var(--card-bg); border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid var(--border-color); }
body.user-top-body .card-header { background-color: #f8f9fa; padding: 12px 15px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
body.user-top-body .status-badge { font-size: 0.8rem; padding: 3px 8px; border-radius: 12px; background-color: rgba(255, 255, 255, 0.9); color: #333; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
body.user-top-body .card-body { padding: 15px; }
body.user-top-body .info-row { display: flex; margin-bottom: 10px; border-bottom: 1px dashed #eee; padding-bottom: 8px; }
body.user-top-body .info-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
body.user-top-body .info-label { width: 30%; color: #666; font-size: 0.9rem; }
body.user-top-body .info-value { width: 70%; font-weight: bold; font-size: 0.95rem; }
body.user-top-body .phone-link { color: var(--primary-color); text-decoration: none; display: inline-block; background-color: #e9ecef; padding: 4px 10px; border-radius: 15px; margin-left: 10px; }
@media (max-width: 600px) {
    body.user-top-body .info-label { width: 35%; font-size: 0.85rem; margin-bottom: 0; }
    body.user-top-body .info-value { width: 65%; font-size: 0.9rem; }
}

/* ========================================= */
/* 5. 利用者ヘルプ画面 (view_help.php)         */
/* ========================================= */
body.user-help-body { line-height: 1.6; }
body.user-help-body .header { background-color: var(--primary-color); color: #fff; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; }
body.user-help-body .header h1 { margin: 0; font-size: 1.2rem; display: flex; align-items: center; }
body.user-help-body .header h1 .material-symbols-outlined { margin-right: 8px; }
body.user-help-body .back-btn { color: #fff; text-decoration: none; display: flex; align-items: center; font-size: 0.9rem; border: 1px solid rgba(255,255,255,0.5); padding: 4px 10px; border-radius: 4px; transition: background 0.2s; }
body.user-help-body .back-btn:hover { background: rgba(255,255,255,0.1); }
body.user-help-body .container { max-width: 800px; margin: 20px auto; padding: 0 15px; }
body.user-help-body .section { background: #fff; border: 1px solid var(--border-color); border-radius: 6px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
body.user-help-body .section h2 { margin-top: 0; color: var(--primary-color); font-size: 1.1rem; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; display: flex; align-items: center; }
body.user-help-body .section h2 .material-symbols-outlined { margin-right: 6px; font-size: 1.3rem; }
body.user-help-body .desc { font-size: 0.95rem; color: #444; margin-bottom: 10px; }
body.user-help-body .ui-mock { background: #f8f9fa; border: 1px solid #ddd; padding: 15px; border-radius: 4px; margin: 15px 0; text-align: center; }
body.user-help-body .ui-mock img, body.user-help-body .ui-mock .mock-element { display: inline-block; }
body.user-help-body .mock-slider { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.85rem; font-weight: bold; }
body.user-help-body .mock-slider-bar { width: 150px; height: 6px; background: #ddd; border-radius: 3px; position: relative; }
body.user-help-body .mock-slider-fill { position: absolute; left: 20%; width: 60%; height: 100%; background: var(--primary-color); border-radius: 3px; }
body.user-help-body .mock-slider-thumb { width: 16px; height: 16px; background: #fff; border: 2px solid var(--primary-color); border-radius: 50%; position: absolute; top: -5px; }
body.user-help-body .mock-legend { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
body.user-help-body .mock-legend-item { padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; border: 1px solid rgba(0,0,0,0.1); }
body.user-help-body ul.features { padding-left: 20px; margin: 0; font-size: 0.95rem; }
body.user-help-body ul.features li { margin-bottom: 8px; }

/* ========================================= */
/* 6. 管理者ヘルプ画面 (admin/view_help.php)   */
/* ========================================= */
.help-section { margin-bottom: 30px; }
.help-section h2 { border-bottom: 2px solid var(--admin-secondary); padding-bottom: 10px; margin-bottom: 20px; color: var(--admin-primary); font-size: 1.4rem; }
.help-section h3 { font-size: 1.1rem; color: #333; margin-top: 25px; margin-bottom: 15px; border-left: 4px solid var(--admin-secondary); padding-left: 10px; }
.help-desc { font-size: 0.95rem; line-height: 1.6; color: #444; margin-bottom: 15px; }
.help-img-box { background: #f8f9fa; border: 1px solid #dee2e6; padding: 15px; border-radius: 4px; margin-bottom: 15px; }
.btn-mock { display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border-radius: 4px; font-size: 0.85rem; font-weight: normal; text-decoration: none; color: #fff; cursor: default; }
.btn-mock-primary { background: var(--admin-secondary); }
.btn-mock-secondary { background: #6c757d; }
.btn-mock-success { background: #20c997; }
.btn-mock-danger { background: #dc3545; }
.btn-mock-info { background: #17a2b8; }
.btn-mock-copy { background: #6c757d; }
.btn-mock-edit { background: #28a745; color: #fff; }
.icon-mock { font-size: 1.2em; vertical-align: middle; margin-right: 4px; }
.shortcut-list { list-style: none; padding: 0; margin-bottom: 15px; }
.shortcut-list li { margin-bottom: 10px; padding-left: 20px; position: relative; font-size: 0.95rem; line-height: 1.5; color: #444; }
.shortcut-list li::before { content: "✓"; position: absolute; left: 0; color: #28a745; font-weight: bold; }

/* ========================================= */
/* 7. 管理者配車管理 (admin/view_dispatch_manage.php) */
/* ========================================= */
.table-container th[data-col] { position: sticky; top: 0; background: #f8f9fa; z-index: 2; border-bottom: 2px solid var(--border-color); }
.table-container th.col-status { position: sticky; top: 0; right: 180px; background: #f8f9fa; z-index: 4; box-shadow: -2px 0 5px rgba(0,0,0,0.05); border-left: 1px solid var(--border-color); border-bottom: 2px solid var(--border-color); }
.table-container th.col-action { position: sticky; top: 0; right: 0; background: #f8f9fa; z-index: 4; box-shadow: -2px 0 5px rgba(0,0,0,0.05); border-left: 1px solid var(--border-color); border-bottom: 2px solid var(--border-color); }

.table-container th[data-col]:hover, .table-container th.col-status:hover { background-color: #e2e6ea; }
.sort-icon { display: inline-block; width: 14px; text-align: center; color: var(--admin-secondary); }

.table-container::-webkit-scrollbar { width: 12px; height: 12px; }
.table-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; border: 2px solid #f1f1f1; }
.table-container::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ========================================= */
/* 8. 管理者Excel風編集 (admin/view_dispatch_grid.php) */
/* ========================================= */
.jexcel thead td,
.jexcel thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa !important;
    box-shadow: 0 1px 0 #ccc; 
}
.simplebar-scrollbar::before {
    background-color: #adb5bd;
    opacity: 0.8 !important;
}

/* ========================================= */
/* 9. 汎用コンポーネント・レイアウト補完       */
/* ========================================= */

/* 各種ボタンカラー */
.btn-danger { background-color: #dc3545; color: #fff; }
.btn-info { background-color: #17a2b8; color: #fff; }
.btn-edit { background-color: #28a745; color: #fff; }
.btn-copy { background-color: #6c757d; color: #fff; }
.btn-restore { background-color: #ffc107; color: #212529; }
.btn-danger:hover { background-color: #c82333; }
.btn-info:hover { background-color: #138496; }
.btn-edit:hover { background-color: #218838; }
.btn-copy:hover { background-color: #5a6268; }
.btn-restore:hover { background-color: #e0a800; }

/* モーダル (表示項目設定など) */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: #fff; padding: 20px; border-radius: 8px; width: 90%; max-width: 500px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; }
.close-btn:hover { color: #000; }

/* フォームグリッド (新規登録・編集画面など) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group-grid { margin-bottom: 0; }
.full-width { grid-column: 1 / -1; }

/* ダッシュボード (ダッシュボード画面) */
.dashboard-cards { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 200px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-left: 5px solid var(--admin-secondary); }
.stat-card h3 { margin-top: 0; font-size: 1.1rem; color: #555; }
.stat-card .number { font-size: 2rem; font-weight: bold; margin: 10px 0 0 0; color: var(--admin-primary); }
.quick-links { display: flex; gap: 15px; flex-wrap: wrap; }
.link-card { flex: 1; min-width: 200px; background: #fff; padding: 20px; text-align: center; border-radius: 8px; text-decoration: none; color: var(--admin-secondary); font-weight: bold; border: 1px solid var(--border-color); transition: background 0.2s; }
.link-card:hover { background: #f8f9fa; }

/* 金額入力画面 (view_dispatch_finance.php) */
.info-box { background: #f8f9fa; padding: 15px; border-radius: 4px; margin-bottom: 20px; border-left: 4px solid var(--admin-secondary); }
.info-box p { margin: 5px 0; }
.summary-container { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.summary-box { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 15px; display: flex; flex-direction: column; gap: 10px; min-width: 250px; }
.summary-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #eee; padding-bottom: 5px; }
.summary-item:last-child { border-bottom: none; padding-bottom: 0; }
.summary-label { font-weight: bold; color: #555; }
.summary-value { font-size: 1.2rem; font-weight: bold; }
.summary-value.sales { color: #0056b3; }
.summary-value.profit { color: #28a745; font-size: 1.4rem; }
.summary-value.advance { color: #17a2b8; }

/* 共通バッジ・テーブル行装飾 */
.status-badge { padding: 4px 8px; border-radius: 12px; font-size: 0.85rem; font-weight: bold; display: inline-block; text-align: center; }
.deleted-row td { color: #999; text-decoration: line-through; }

/* ========================================= */
/* 10. 共通フォーム・入力要素                  */
/* ========================================= */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; color: #333; }
.form-group input[type="text"], 
.form-group input[type="date"], 
.form-group input[type="time"], 
.form-group input[type="number"], 
.form-group select, 
.form-group textarea {
    width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-family: inherit; font-size: 1rem;
}
.required { color: #dc3545; font-size: 0.8rem; margin-left: 5px; vertical-align: text-top; }
.form-actions { margin-top: 30px; text-align: center; border-top: 1px solid var(--border-color); padding-top: 20px; }
.search-form { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; }
.search-form .form-group { margin-bottom: 0; flex: 1; min-width: 200px; }

/* ========================================= */
/* 11. メッセージ・一括編集・レスポンシブ補完 */
/* ========================================= */

/* サクセス・エラーメッセージ */
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; font-weight: bold; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }

/* 一括編集モード時のテーブル内入力要素・ハイライト */
.editable-cell td { background-color: #fdfffe !important; }
.table-container td input[type="text"],
.table-container td input[type="time"],
.table-container td input[type="date"],
.table-container td input[type="number"] {
    width: 100%; padding: 6px; box-sizing: border-box; border: 1px solid #ced4da; border-radius: 4px; font-family: inherit; font-size: 0.9rem; transition: border-color 0.2s;
}
.table-container td input:focus { border-color: #80bdff; outline: 0; box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); }

/* スマホ・タブレット向けのレスポンシブ対応 */
@media (max-width: 768px) {
    /* 新規登録・編集のフォームを1列にする */
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    
    /* 検索フィルターを縦並びにする */
    .search-form { flex-direction: column; align-items: stretch; gap: 10px; }
    .search-form .form-group { min-width: 100%; }
    
    /* ダッシュボードのカードを縦並びにする */
    .dashboard-cards { flex-direction: column; }
    .stat-card { width: 100%; }
    .quick-links { flex-direction: column; }
}

/* ========================================= */
/* 12. マスタ管理・グリッド画面の補完          */
/* ========================================= */

/* グリッド画面のコントロール部 */
.grid-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 15px; }

/* マスタ管理系のインラインフォーム・バッジ等 */
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: #f8f9fa; padding: 15px; border-radius: 4px; border: 1px solid var(--border-color); margin-bottom: 20px; }
.form-inline .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }
.form-inline .btn { height: 38px; }
.badge-sales { background-color: #007bff; color: #fff; padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; display: inline-block; }
.badge-advance { background-color: #17a2b8; color: #fff; padding: 4px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; display: inline-block; }
.col-action-master { width: 140px; min-width: 140px; text-align: center; white-space: nowrap; }

/* スマホ用の上書き（マスタ・グリッド） */
@media (max-width: 768px) {
    .grid-controls { flex-direction: column; align-items: stretch; }
    .grid-controls form { width: 100%; }
    .grid-controls button { width: 100%; box-sizing: border-box; }
    .form-inline { flex-direction: column; align-items: stretch; }
    .form-inline .btn { width: 100%; }
}

.h1-style {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.h2-style {
    font-weight: bold;
    color: #007bff; 
    font-size: 1.3rem; 
    border-bottom: 2px solid #007bff; 
    padding-bottom: 8px; 
    margin-top: 0; 
    margin-bottom: 15px;
}