/* ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Hiragino Sans', 'Meiryo', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.7;
}

:root {
    --map-occupied: #e57373;
    --map-vacant: #d3d3d3;
    --map-waiting: #ffd54f;
    --map-high-speed: #ff9800;
    --map-ev: #64b5f6;
    --map-training: #81c784;
    --map-unused: #757575;

    --list-entered-bg: #d4edda;
    --list-entered-fg: #155724;
    --list-next-bg: #cfe2ff;
    --list-next-fg: #084298;
    --list-waiting-bg: #fff3cd;
    --list-waiting-fg: #856404;
    --list-unentered-bg: #f1f3f5;
    --list-unentered-fg: #495057;
    --list-recommend-bg: #f8d7da;
    --list-recommend-fg: #842029;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー直下の余白を抑える */
main.container {
    padding-top: 4px; /* 既定20px → 8px */
}

/* ヘッダー */
.header {
    background-color: #2c5f41;
    color: white;
    padding: 0.25rem 0; /* ヘッダーの上下パディングを縮小 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ヘッダー内のコンテナは縦パディングをさらに小さく */
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 64px;
    padding-top: 6px;
    padding-bottom: 6px;
}

/* 左端の共通表示（システム名 + メニュー） */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    z-index: 61;
}

.header-left .system-name {
    font-size: 1.15rem;
    font-weight: bold;
    white-space: nowrap;
    color: #fff;
}

/* システム名の下に本日の月日・曜日種別・A/B交番を出す（横幅を増やさず、中央のタイトルと重ならないように2段にする） */
.header-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.header-day {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2px;
    font-size: 0.85rem;
    white-space: nowrap;
    color: #fff;
}
.header-day-kind,
.header-day-ab {
    padding: 0 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 3px;
    font-weight: bold;
}
.header-day-ab { background: #fff; color: #2c5f41; }
.header-day.is-estimated .header-day-kind,
.header-day.is-estimated .header-day-ab { border-style: dashed; }
.header-day-note { font-size: 0.75rem; color: #ffe08a; }

/* ページ別タイトルは中央に固定表示 */
.header h1 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 1.3rem; /* タイトルサイズを小さめに */
    line-height: 1.2;
    font-weight: bold;
    margin: 0; /* 余白を削減 */
    white-space: nowrap;
}

.user-info {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    color: white;
}

.user-info a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid white;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.user-info a:hover {
    background-color: rgba(255,255,255,0.2);
}

.header-menu {
    position: relative;
    z-index: 60;
}

.header-menu .btn {
    background: transparent;
    color: white;
    border: 1px solid white;
}

.header-menu .btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ログインフォーム */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
    color: #333;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #2c5f41;
    box-shadow: 0 0 0 2px rgba(44,95,65,0.2);
}

.btn {
    /* padding: 0.75rem 1.5rem; */
    padding: 0.45rem 0.9rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background-color: #2c5f41;
    color: white;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #1e4129;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #f8d7da;
    color: black;
}

/* ダッシュボード */
.dashboard {
    display: grid;
    /* minmax(0, ...) が必須。グリッドアイテムの min-width は既定が auto なので、
       .parking-map の width:700px が .main-content の min-content を約764pxに固定し、
       1.3fr の取り分を無視して縮まなくなる。1024px前後でダッシュボードが
       .container を突き抜けてページ全体に横スクロールが出ていた。 */
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
    gap: 2rem;
    margin-top: 2rem; /* デフォルト */
    min-height: calc(100vh - 200px);
}

/* メイン直下のダッシュボードは余白を小さめに */
.container > .dashboard {
    margin-top: 0.2rem; 
}

.main-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar {
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
}

.sidebar-panel {
    width: 100%;
    box-sizing: border-box;
}

/* 駐車場マップ */
.parking-map {
    width: 700px;       /* 枠だけ小さく */
    height: 700px;      /* 枠だけ小さく */
    max-width: 100%;    /* 画面が狭いときははみ出さない */
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: auto;
}

.parking-map svg {
    display: block;
}

/* 駐車位置 入替/移動 最終確認（画面中央） */
.swap-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
}
.swap-modal.show { display: flex; }
.swap-modal-box {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.swap-move-line { padding: 0.3rem 0; font-weight: bold; }
/* 後続車の予定位置への移動など、実施できないときの「実施」ボタン */
.swap-modal-box .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.swap-violation-hard { background:#f8d7da; color:#842029; border:1px solid #dc3545; border-radius:6px; padding:0.5rem 0.7rem; margin:0.5rem 0; font-size:0.88rem; }
.swap-violation-soft { background:#fff3cd; color:#856404; border:1px solid #ffc107; border-radius:6px; padding:0.5rem 0.7rem; margin:0.5rem 0; font-size:0.88rem; }
.swap-violation-none { background:#d4edda; color:#155724; border:1px solid #28a745; border-radius:6px; padding:0.5rem 0.7rem; margin:0.5rem 0; font-size:0.88rem; }
/* ドラッグで駐車位置を入替/移動するときの視覚フィードバック */
/* 掴んだ元のマス（掴んでいることを示すため薄くする） */
#parking-map rect.pm-drag-source { stroke:#ff8c00; stroke-width:3; opacity:0.45; }
/* ドロップ先のマス（破線で「ここに入る」ことを示す） */
#parking-map rect.pm-drop-target { stroke:#0d6efd; stroke-width:4; stroke-dasharray:6 3; }
/* カーソルに追従する車両のゴースト */
#parking-map g.pm-drag-ghost rect { fill:#ff8c00; fill-opacity:0.75; stroke:#b35c00; stroke-width:2; }
#parking-map g.pm-drag-ghost text { fill:#fff; font-weight:700; font-size:13px; }
/* ドラッグ中は画面全体を grabbing カーソルにし、文字選択を抑止する */
body.pm-dragging, body.pm-dragging * { cursor:grabbing !important; user-select:none; }

/* 代替車両 未完了バナー（常設・1行） */
.subst-banner {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.9rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 5px solid #e0a800;
    border-radius: 6px;
    color: #856404;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
}
.subst-banner:hover { background: #ffe8a1; }

/* 車庫図: 故障車両マス */
#parking-map rect.parking-space-kosho { fill: #f5b7b7; stroke: #c0392b; stroke-width: 2; }

/* 外駐車両エリア（車庫図の下） */
.gaichu-area {
    margin-top: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
}
.gaichu-title {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
    color: #856404;
}
.gaichu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gaichu-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: #fff;
    border: 1px solid #e0b400;
    border-radius: 14px;
    font-size: 0.85rem;
    color: #6b5200;
}
.gaichu-chip .gaichu-bus { font-weight: bold; }
.gaichu-chip .gaichu-reason { color: #999; font-size: 0.78rem; }

/* D3.js スタイル */
.parking-space-vacant {
    fill: var(--map-vacant);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-occupied {
    fill: var(--map-occupied);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-available {
    fill: lightpink;
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-restricted {
    fill: white;
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-violation {
    fill: var(--map-waiting);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

/* 待機車両（黄色） */
.parking-space-evacuated {
    fill: var(--map-waiting);
    stroke: var(--map-waiting);
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-waiting {
    fill: var(--map-waiting);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-no-school {
    fill: var(--map-vacant);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-no-high {
    fill: var(--map-high-speed);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

.parking-space-ev {
    fill: var(--map-ev);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

/* 教育車両（料金機なし）専用の駐車位置 */
.parking-space-training {
    fill: var(--map-training);
    stroke: black;
    stroke-width: 1;
    cursor: pointer;
}

/* 利用しない駐車位置 */
.parking-space-unused {
    fill: var(--map-unused);
    stroke: black;
    stroke-width: 1;
    cursor: default;
}

.parking-label {
    fill: darkblue;
    font-size: 14px;
    font-family: Arial, sans-serif;
    text-anchor: start;
    pointer-events: none;
}

.bus-info {
    fill: darkblue;
    font-size: 12px;
    font-family: Arial, sans-serif;
    text-anchor: start;
    pointer-events: none;
}

.time-label {
    fill: darkblue;
    font-size: 9px;
    font-family: Arial, sans-serif;
    pointer-events: none;
}

/* コントロールパネル */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 3ボタン横並び */
.button-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.button-row .btn {
    flex: 1 1 0;
}

@media (max-width: 768px) {
    .button-row {
        flex-direction: column;
    }
}

/* ドロップダウンメニュー */
.menu-dropdown {
    position: relative;
    display: inline-block;
}

.menu-dropdown .menu-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    padding: 0.5rem 0;
    z-index: 50;
}

.menu-dropdown.show .menu-dropdown-content {
    display: block;
}

.menu-dropdown .menu-dropdown-content a {
    display: block;
    padding: 0.6rem 1rem;
    color: #333;
    text-decoration: none;
}

.menu-dropdown .menu-dropdown-content a:hover {
    background: #f5f5f5;
}

.diary-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.diary-info h3 {
    color: #495057;
    margin-bottom: 0.5rem;
}

/* ステータス表示 */
.status-indicators {
    display: flex;
    gap: 0.5rem;
    row-gap:0.5rem;
    margin-bottom: 0.2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.status-color {
    width: 20px;
    height: 20px;
    border: 1px solid #333;
}

.color-occupied { background-color: var(--map-occupied); }
.color-available { background-color: lightpink; }
.color-vacant { background-color: var(--map-vacant); }
.color-restricted { background-color: white; }
.color-violation { background-color: var(--map-waiting); }
.color-no-school { background-color: var(--map-waiting); }
.color-no-high { background-color: var(--map-high-speed); }
.color-ev { background-color: var(--map-ev); }
.color-training { background-color: var(--map-training); }
.color-unused { background-color: var(--map-unused); }

/* モーダルダイアログ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* アラート */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .parking-map {
        height: 75vh;
    }
}

@media (max-width: 768px) {
    .control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-info {
        position: static;
        text-align: center;
        margin-top: 1rem;
    }
    
    .parking-map {
        height: 60vh;
    }
}

/* =============================================================================
   新機能用スタイル
   ============================================================================= */

/* ページヘッダー */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #2c5f41;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb-item {
    text-decoration: none;
    color: #007bff;
}

.breadcrumb-item.active {
    color: #666;
    font-weight: bold;
}

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin-left: 0.5rem;
    color: #666;
}

/* 時間編集モード */
.time-edit-mode {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.time-edit-mode input[type="checkbox"] {
    margin-right: 8px;
}

/* タブコンテナ */
.tab-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    background: white;
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* セクション */
.section-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h3 {
    color: #2c5f41;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 0.9rem;
}

/* グリッドレイアウト */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .settings-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* バス順序リスト */
.bus-order-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
}

.bus-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sortable-list {
    max-height: 350px;
    overflow-y: auto;
}

.bus-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: move;
    transition: all 0.3s;
}

.bus-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.bus-item.parked {
    background: #eeeeee;
    border-color: #cccccc;
}

.bus-order-number {
    width: 30px;
    height: 30px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.bus-info {
    flex: 1;
}

.bus-id {
    font-weight: bold;
    color: #2c5f41;
    font-size: 1rem;
}

.bus-times {
    font-size: 0.85rem;
    color: #666;
    margin: 0.2rem 0;
}

.bus-space {
    font-size: 0.85rem;
    color: #007bff;
    font-weight: bold;
}

.bus-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
}

.bus-status.parked {
    background: #d4edda;
    color: #155724;
}

.bus-status.unparked {
    background: #fff3cd;
    color: #856404;
}

/* オプション */
.option-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

.option-description {
    font-size: 0.85rem;
    color: #666;
    margin-left: 1.5rem;
    margin-top: -0.25rem;
}

/* テーブル */
.table-container {
    background: white;
    border-radius: 8px;
    /* overflow:hidden だと列がはみ出したテーブルが切れたまま、スクロールもできない。
       ダイヤマスタの世代履歴（7列）は1366px幅で右端の閲覧/削除ボタンごと切れて
       操作不能になっていた。 */
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table-actions {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 0.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c5f41;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* バス種別表示 */
.category-display {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-weight: bold;
    color: #495057;
    text-align: center;
    min-width: 40px;
}

/* 順位表示 */
.order-display {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    font-weight: bold;
    color: #0066cc;
    text-align: center;
    min-width: 30px;
}

/* ソート可能ヘッダー */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.sortable-header:hover {
    background-color: #f8f9fa;
}

.sort-arrow {
    font-size: 0.8em;
    margin-left: 4px;
    color: #666;
}

/* カレンダーグリッド */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}

.calendar-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.weekday-header {
    font-weight: bold;
    color: #2c5f41;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.diagram-selector select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* プログレスバー */
.progress-container {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* 情報パネル */
.info-panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-panel h4 {
    color: #2c5f41;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* データ状況 */
.data-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: #666;
    font-size: 0.9rem;
}

.status-value {
    font-weight: bold;
    color: #2c5f41;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

/* ログ */
.log-container {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
}

.log-entry {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.log-entry.log-info {
    background: #d1ecf1;
    color: #0c5460;
}

.log-entry.log-success {
    background: #d4edda;
    color: #155724;
}

.log-entry.log-error {
    background: #f8d7da;
    color: #721c24;
}

.log-entry.log-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.log-time {
    font-weight: bold;
    margin-right: 0.5rem;
}

/* プレビュー */
.optimization-preview {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.preview-content {
    background: white;
    border-radius: 6px;
    padding: 1rem;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.preview-table th,
.preview-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #dee2e6;
}

.preview-table th {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.preview-actions {
    text-align: right;
    margin-top: 1rem;
}

/* 最適化ルール */
.optimization-rules {
    background: white;
    border-radius: 8px;
    padding: 2rem;
}

.rule-group {
    margin-bottom: 2rem;
}

.rule-group h4 {
    color: #2c5f41;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.rule-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.rule-item label {
    font-weight: bold;
    color: #2c5f41;
    margin-bottom: 0.5rem;
    display: block;
}

.rule-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.rule-actions {
    text-align: center;
    margin-top: 2rem;
}

/* 日付セレクター */
.date-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.date-selector label {
    font-weight: bold;
    color: #2c5f41;
}

.date-selector input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* アクション */
.calendar-actions {
    text-align: center;
    margin-top: 2rem;
}

/* アラート（時間編集モーダル用） */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* バス順序変更 - 追加スタイル */
.bus-handle {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.2rem;
    margin-right: 0.75rem;
    cursor: grab;
}

.bus-handle:active {
    cursor: grabbing;
}

.bus-item.bus-parked {
    background: #d4edda;
    border-color: #c3e6cb;
}

.bus-item.bus-unparked {
    background: white;
}

.bus-number {
    font-weight: bold;
    color: #2c5f41;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.bus-details {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.bus-type {
    padding: 0.15rem 0.5rem;
    background: #e9ecef;
    border-radius: 3px;
    font-weight: 500;
}

.bus-time {
    color: #495057;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    min-width: 70px;
    display: inline-block;
}

.status-parked {
    background: #28a745;
    color: white;
}

.status-unparked {
    background: #ffc107;
    color: #333;
}

.sortable-ghost {
    opacity: 0.4;
    background: #f8f9fa;
}

/* モーダルオーバーレイ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #2c5f41;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}