/* スマートフォン用メインスタイル */
/* 適用範囲: 767px以下のスマートフォン */

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    /* スマートフォンでは16px以上が推奨 */
    width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    /* iOSのテキスト自動拡大を防止 */
}

/* スマートフォン用グローバル設定 */
* {
    font-family: 'Noto Sans JP', sans-serif;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    /* タップハイライト */
}

/* ボタン要素のスマートフォン最適化 */
button,
.btn {
    min-height: 44px;
    /* Appleの推奨タップ領域 */
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    /* iOSデフォルトスタイル無効化 */
}

.flex {
    display: flex;
}

/* スマートフォン用レイアウト調整 */
.container,
.content-area {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* フレックスボックスの縦積み変更 */
.flex-row,
.d-flex {
    flex-direction: column !important;
    gap: 10px;
}

/* グリッドレイアウトの1列化 */
.grid,
.row {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 15px;
}

/* タッチ対応のスクロールエリア */
.scroll-area {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* ===== スマートフォン用サイドバーオーバーレイ化 ===== */

/* サイドバーをオーバーレイ式に変更 */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -250px !important;
    /* 初期状態は画面外に隠す */
    width: 250px !important;
    height: 100vh !important;
    z-index: 1000 !important;
    transition: left 0.3s ease !important;
    overflow-y: auto !important;
}

/* サイドバーが開いた状態（既存の.onクラスを活用） */
.sidebar.on {
    left: 0 !important;
    width: 250px !important;
    /* スマホでは60pxではなく全幅表示 */
}

/* サイドバーメニューテキストを常に表示 */
.sidebar.on .menu-item span {
    display: inline !important;
    opacity: 1 !important;
}

/* オーバーレイ背景 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* メインコンテンツエリアの調整 */
.dashboard {
    margin-left: 0 !important;
    width: 100% !important;
}

/* ===== スマートフォン用ヘッダー簡素化 ===== */

.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60px !important;
    z-index: 998;
    background: #fff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 15px !important;
}

/* ヘッダータイトル */
.header p {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    flex: 1 !important;
    text-align: center !important;
}

.header p a {
    color: #2c3e50 !important;
    text-decoration: none !important;
}

/* ヘッダーの複雑な要素を非表示 */
.header ul,
.header .search-bar {
    display: none !important;
}

/* ハンバーガーメニューボタンのスタイル */
.btn_sidemenu_toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    color: #2c3e50 !important;
    font-size: 20px !important;
}

/* メインコンテンツをヘッダー分下げる */
.content-section {
    margin-top: 0 !important;
    padding: 0 !important;
    /* パディングを完全に削除 */
}

/* ===== スマートフォン用フィルタアコーディオン化 ===== */

/* フィルタのアコーディオンヘッダー */
.filter-accordion-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 15px !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    margin-bottom: 5px !important;
}

.filter-accordion-header h3 {
    margin: 0 !important;
    font-size: 16px !important;
    color: #495057 !important;
}

.filter-accordion-icon {
    font-size: 14px !important;
    color: #6c757d !important;
    transition: transform 0.3s ease !important;
}

.filter-accordion-header.active .filter-accordion-icon {
    transform: rotate(180deg) !important;
}

.filters {
    display: flex !important;
    /* フィルタ要素を表示 */
    flex-direction: column !important;
    /* 縦並び */
    gap: 10px !important;
    padding: 15px !important;
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    margin-bottom: 0px !important;
}

/* フィルタ内のselect要素 */
.filters select {
    width: 100% !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
    border-radius: 6px !important;
    border: 1px solid #ced4da !important;
    font-size: 14px !important;
}

/* フィルタボタングループ */
.filters button {
    padding: 10px 16px !important;
    margin-bottom: 8px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.filters #apply-filter-btn {
    background: #007bff !important;
    color: white !important;
    border: 1px solid #007bff !important;
}

.filters #clear-filter-btn {
    background: #6c757d !important;
    color: white !important;
    border: 1px solid #6c757d !important;
}

/* ===== スマートフォン用タスクカード表示 ===== */

/* テーブル表示をスマートフォン用に調整 */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
}

.table-responsive table {
    min-width: 800px !important;
    /* ダッシュボード統計テーブル用に増加 */
    font-size: 13px !important;
    width: auto !important;
    /* 自動幅調整 */
}

.table-responsive th,
.table-responsive td {
    padding: 8px 12px !important;
    /* パディング拡大 */
    white-space: nowrap !important;
    /* 改行を完全に防止 */
    min-width: 80px !important;
    /* 列の最小幅を保証 */
}

/* すべてのテーブルに横スクロール適用 */
table {
    min-width: 800px !important;
    white-space: nowrap !important;
}

/* ダッシュボード統計テーブル専用 */
.dashboard-stats table,
.overdue-table,
.upcoming-table,
.active-table {
    min-width: 900px !important;
    table-layout: fixed !important;
}

.dashboard-stats th,
.dashboard-stats td,
.overdue-table th,
.overdue-table td,
.upcoming-table th,
.upcoming-table td,
.active-table th,
.active-table td {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 10px 8px !important;
}

/* テーブルコンテナに横スクロールを強制適用 */
.overdue-table-container,
.upcoming-table-container,
.active-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
}

/* タスクカードコンテナ */
.task-cards-container {
    display: block !important;
}

/* 個別タスクカード */
.task-card {
    background: #fff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    min-height: 120px !important;
}

/* タスクカードヘッダー */
.task-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 12px !important;
}

.task-card-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 !important;
    flex: 1 !important;
    line-height: 1.3 !important;
}

.task-card-priority {
    padding: 4px 8px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-left: 8px !important;
}

/* タスクカード本文 */
.task-card-body {
    margin-bottom: 12px !important;
}

.task-card-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    font-size: 14px !important;
    color: #6c757d !important;
}

.task-card-meta-item {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.task-card-meta-item i {
    font-size: 12px !important;
    width: 14px !important;
}

/* タスクカードフッター */
.task-card-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #e9ecef !important;
}

.task-card-status {
    padding: 4px 12px !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    background: #e9ecef !important;
    color: #495057 !important;
}

.task-card-actions {
    display: flex !important;
    gap: 8px !important;
}

.task-card-actions button {
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    border: 1px solid #dee2e6 !important;
    background: #fff !important;
    color: #495057 !important;
    min-height: 32px !important;
    width: auto !important;
}

/* 優先度別カラー */
.task-card-priority.high {
    background: #dc3545 !important;
    color: #fff !important;
}

.task-card-priority.medium {
    background: #ffc107 !important;
    color: #212529 !important;
}

.task-card-priority.low {
    background: #28a745 !important;
    color: #fff !important;
}

/* 画面幅に応じた要素サイズ調整 */
img,
video,
iframe {
    max-width: 100% !important;
    height: auto !important;
}

/* テーブルの横スクロール対応 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 600px;
    /* 最小幅を設定 */
    font-size: 14px !important;
}

/* カード要素の幅調整 */
.card,
.panel,
.box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 15px 0 !important;
    box-sizing: border-box;
}

/* モーダルのスマートフォン対応 */
.modal-dialog {
    width: 95% !important;
    max-width: 95% !important;
    margin: 15px auto !important;
}

/* フォーム幅の統一 */
.form-control,
.form-select,
.form-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* ナビゲーション要素の幅調整 */
.navbar,
.header,
.footer {
    width: 100% !important;
    padding: 0 15px !important;
}

p {
    margin: 0;
    margin-bottom: 10px;
}

#editor .ck-editor__editable {
    min-height: 500px;
}

.ck.ck-editor__main>.ck-editor__editable {
    height: 500px;
}

/* スマートフォン用フォーム要素 */
input[type=text],
input[type=search],
input[type=tel],
input[type=url],
input[type=email],
input[type=password],
input[type=datetime],
input[type=date],
input[type=month],
input[type=week],
input[type=time],
input[type=datetime-local],
input[type=number],
select,
textarea {
    padding: 12px;
    /* スマートフォンでは大きなタップ領域が必要 */
    border-radius: 8px;
    border-style: solid;
    border-width: 1px;
    border-color: #cccccc;
    box-shadow: inset 0 1px 0px rgba(0, 0, 0, 0.1);
    height: unset;
    font-size: 16px;
    /* iOS Safariでのズーム防止 */
    width: 100%;
    max-width: 100%;
    -webkit-appearance: none;
    /* iOSでのデフォルトスタイル無効化 */
}

/* ************ 簡易タスク登録フォーム ************ */
.quick-task-form-container,
.section-controls-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quick-task-form-container .detail-box {
    margin: 0;
    background: white;
    border-radius: 8px;
    border: none;
    box-shadow: none;
}

.quick-task-form-container .form-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quick-task-form-container .form-section-title {
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    flex: 1;
}

.quick-task-toggle-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    margin-left: 15px;
    margin-top: -16px;
}

.quick-task-toggle-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
    transform: scale(1.1);
}

.quick-task-toggle-btn:active {
    transform: scale(0.95);
}

.quick-task-collapsed {
    height: 49px;
    overflow-y: hidden;
    transition: height 0.3s ease-in-out;
}

.quick-task-expanded {
    height: auto;
    transition: height 0.3s ease-in-out;
}

.quick-task-form {
    margin: 0;
}

.quick-task-form input,
.quick-task-form select {
    width: 100% !important;
}

.quick-task-form .form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quick-task-form .form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.quick-task-form .form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 13px;
    color: #495057;
}

.quick-task-form .form-group:last-child label {
    display: none;
}

.quick-task-form .required {
    color: #dc3545;
    font-weight: bold;
}

.quick-task-form .form-control {
    height: 42px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.quick-task-form .form-group select.form-control {
    padding: 8px 16px;
}

.quick-task-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    outline: none;
}

.quick-task-form .btn-big {
    height: 42px;
    padding: 0 20px;
    font-weight: 600;
    transition: all 0.15s ease-in-out;
}

.quick-task-form .btn-big:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.quick-task-form .btn-big:disabled {
    transform: none;
    box-shadow: none;
    opacity: 0.6;
    cursor: not-allowed;
}

.quick-task-form .alert {
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.quick-task-form .alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.quick-task-form .alert-success {
    background-color: #d1eddb;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* レスポンシブ対応 */
.quick-task-form .form-row {
    flex-direction: column;
    gap: 10px;
}

.quick-task-form .form-group {
    flex: 1 1 100% !important;
}


/* ************* header ************* */
.header {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 56px;
    /* モバイル向けに高さを拡大 */
    background-color: #e2e2e2;
    z-index: 1000;
    /* z-indexを上げて確実に最前面に */
    overflow: visible;
    /* overflowを変更 */
    display: flex;
    align-items: center;
    justify-content: center;
    /* 中央揃えに変更 */
    padding: 0 12px;
    /* 左右のパディング追加 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* 影を追加 */
}

/* ロゴエリア - 中央配置 */
.header p {
    position: relative;
    left: auto;
    padding: 0;
    margin: 0;
    text-align: center;
}

.header p span {
    display: none;
    /* モバイルでは非表示 */
}

.header p a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    /* モバイル向けにサイズ調整 */
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    /* タップターゲット最小サイズ */
    padding: 0 8px;
}

/* ナビゲーションメニュー - モバイルでは非表示 */
.header ul {
    display: none;
}

/* 検索バー - モバイルでは非表示 */
.header .search-bar {
    display: none;
    /* モバイルでは非表示 */
}

.header .search-bar i {
    font-size: 18px;
    color: #666;
    flex-shrink: 0;
}

.header .search-bar input[type="text"] {
    border: none;
    outline: none;
    background: transparent;
    margin-left: 8px;
    height: 36px;
    width: 100%;
    font-size: 14px;
    color: #333;
}

.header .search-bar input[type="text"]::placeholder {
    color: #999;
    font-size: 14px;
}

/* ハンバーガーメニューボタン（モバイル用） */
.header .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #333;
    font-size: 24px;
}

.header .mobile-menu-btn:active {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

/* タブレット以上で元のレイアウトに戻す */
.header {
    height: 48px;
    padding: 0;
    justify-content: normal;
}

.header p span {
    display: block;
    font-size: 12px;
    line-height: 1;
    font-weight: bold;
}

.header p a {
    font-size: 18px;
    padding-top: 2px;
    height: auto;
    padding: 0;
}

.header ul {
    position: absolute;
    right: 220px;
    display: flex;
}

.header ul li {
    line-height: 48px;
    padding-left: 20px;
    font-size: 14px;
    font-weight: bold;
}

.header ul li a {
    color: #333;
    text-decoration: none;
}

.header .search-bar {
    display: flex;
    /* タブレット以上では表示 */
    position: absolute;
    right: 0px;
    width: 200px;
    height: 48px;
    max-width: none;
    margin: 0;
    padding: 5px 10px;
    background: none;
    box-shadow: none;
    border-radius: 5px;
    align-items: center;
}

.header .search-bar i {
    font-size: 16px;
    color: #333;
}

.header .search-bar input[type="text"] {
    height: 26px;
    width: 154px;
}

.header .mobile-menu-btn {
    display: none;
}

.header a:hover {
    opacity: 0.6;
}

/* ************* sidebar ************* */

/* モバイルのサイドバー設定 */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    /* ヘッダーの下から */
    width: 0px !important;
    /* 初期状態では幅0 */
    height: calc(100vh - 56px);
    background: #f8fafd;
    z-index: 1000;
    /* z-indexを1000に設定 */
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transition: width 0.3s ease-out;
    overflow: hidden;
    /* overflow:hiddenに設定 */
    padding: 0;
}

/* サイドメニュートグルボタンをヘッダー右上に固定 */
.btn_sidemenu_toggle {
    position: fixed;
    right: 12px;
    top: 6px;
    /* ヘッダー内に収まるように調整 */
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 24px;
    z-index: 1001;
    /* ヘッダーより上に */
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

.btn_sidemenu_toggle:active {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

/* サイドバーがオンの時（メニュー展開時） */
.sidebar.on {
    width: 100% !important;
    /* 画面全体の幅に */
}

/* サイドバーメニュー */
.sidebar-menu {
    margin-top: 20px;
    font-size: 16px;
    font-weight: bold;
    padding: 0 20px;
}

.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.sidebar-menu .menu-item:hover,
.sidebar-menu .menu-item:active,
.menu-item.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.sidebar-menu .menu-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .menu-item span {
    display: inline-block;
}

/* タブレット以上で元のレイアウトに戻す */
.sidebar {
    display: block;
    width: 250px;
    background: #f8fafd;
    padding: 0px;
    overflow: hidden;
    position: relative;
    margin-top: 0;
    height: auto;
    box-shadow: none;
    animation: none;
}


.sidebar.on {
    width: 60px;
    padding: 0px;
    position: relative;
    top: auto;
    left: auto;
    height: auto;
}

.btn_sidemenu_toggle:active {
    background: none;
}

.sidebar-menu {
    font-size: 20px;
    padding: 0 20px;
    background-color: #f8fafd;
}

.on .sidebar-menu {
    padding: 0 10vw;
    padding-top: 50px;
}

.sidebar-menu .menu-item {
    padding: 10px;
    font-size: 16px;
    margin-bottom: 15px;
}

.sidebar-menu .menu-item i {
    margin-right: 10px;
}

.on .sidebar-menu .menu-item i {
    margin-right: 0px;
}

.on .sidebar-menu .menu-item span {
    display: none;
}

.sidebar-menu .menu-item:hover,
.menu-item.active {
    opacity: 0.5;
    background: none;
    color: #333;
}

/* ************* login ************* */

.login {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login .main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    height: 100vh;
}

.login-form {
    width: 100%;
    max-width: 384px;
    padding: 24px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: #1f2937;
    margin-bottom: 20px;
    margin-top: 0;
}

.login-error {
    color: #ef4444;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100% !important;
}

/* ************* dashboard ************* */

.dashboard {
    min-height: calc(100vh - 56px);
    margin-top: 56px;
}

/* ************* main-content ************* */

.main-content {
    flex: 1;
    padding: 5vw !important;
    /* スマートフォン向けレスポンシブパディング */
    background-color: #fff;
    width: 100vw;
}

/* ************* section-title ************* */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-top: 0 !important;
    /* 上マージンを削除 */
    margin-bottom: 20px;
}

/* ************* mini_form ************* */

[name=mini_form] {
    padding: 10px;
    background-color: #fafafa;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #f8fafd;
    width: fit-content;
}

[name=mini_form] h2 {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
}

[name=mini_form] [type=text] {
    border-radius: 3px 0px 0px 3px;
    height: 34px;
    width: 350px;
    font-size: 12px;
}

[name=mini_form] .btn {
    border-radius: 0px 3px 3px 0px;
    height: 33px;
    width: 80px;
    text-align: center;
    margin: 0;
    line-height: 16px;
}


/* ************* table ************* */

.task-table-container {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    height: calc(100vh - 320px);
}

.task-table {
    width: 100%;
    border-collapse: collapse;
}

.task-table th,
.task-table td {
    border-bottom: 1px solid #fff !important;
    border-right: 1px solid #fff !important;
    line-height: 24px;
    padding: 2px 5px;
    font-size: 12px;
}

.task-table th {
    font-weight: 600;
    color: #111827;
    background-color: #eee !important;
    text-align: center;
}

.task-table th a {
    color: #ccc;
    margin: 0 4px;
    font-size: 18px;
}

.task-table th a.sort_on {
    color: #999;
}

.task-table td {
    color: #444444;
    font-family: monospace;
    background-color: #fff;
    vertical-align: middle;
    font-size: 14px;
    font-size: 12px;
    line-height: 26px;
}

.task-table tr:nth-child(even) td.c1 {
    background-color: #f7f7f7 !important;
}

.task-table tr:nth-child(even):hover td.c1 {
    background-color: #f8fafd !important;
}

.task-table td.c1 {
    background-color: #fff !important;
}

.task-table tr:hover td.c1 {
    background-color: #eee !important;
}

.task-table td.status0 {
    background-color: #eaf1ff !important;
}

.task-table tr:hover td.status0 {
    background-color: #bbd2ff !important;
}

.task-table td.status1 {
    background-color: #dcffe6 !important;
}

.task-table tr:hover td.status1 {
    background-color: #8ff3ab !important;
}

.task-table td.status2 {
    background-color: #ffe5e5 !important;
}

.task-table tr:hover td.status2 {
    background-color: #ffb7b7 !important;
}

.task-table tr:hover td * {
    font-weight: bold !important;
}

.task-table td.title {}

.task-table td.title a {
    color: #333;
    text-decoration: none;
    width: calc(100% - 30px);
    display: inline-block;
    font-weight: normal;
}

.task-table td.title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 28px;
    vertical-align: middle;
    padding-left: 10px;
}

.task-table td.title span:nth-child(0) {}

.task-table td.title span:nth-child(1) {}

.task-table td.title span:nth-child(2) {
    display: none;
}

.task-table td.title i {
    display: inline-block;
    color: #000;
    margin-left: 10px;
    cursor: pointer;
}

.task-table td.cell_title {
    width: 700px;
    max-width: 700px;
}

.task-table td.cell_btn {
    width: 0px;
    max-width: 0px;
}

.task-table td.cell_mini {
    width: 120px;
    max-width: 120px;
}

.task-table td.cell_detail {
    word-break: break-all;
    word-break: break-word;
    overflow-wrap: break-word;
}

.detail th {
    width: 120px;
    max-width: 120px;
    text-align: right;
}

/* ************* btn ************* */

.btn {
    padding: 4px 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
    box-shadow: unset !important;
    text-shadow: unset !important;
}

.btn:hover {
    box-shadow: unset !important;
    text-shadow: unset !important;
}

.login .btn {
    padding: 5px;
    height: 40px;
    width: 100%;
}

.btn i {
    margin-right: 8px !important;
    /* アイコンとテキストの適切な余白 */
}

table .btn-edit,
table .btn-delete {
    width: 28px;
    height: 28px;
    line-height: 30px;
    font-size: 12px;
    padding: 0;
}

.btn-c1 {
    color: #fff;
    background-color: #4982ff;
}

.btn-c1:hover {
    color: #fff;
    background-color: #3c71e6;
}

.btn-c2 {
    color: #fff;
    background-color: #ff5555;
}

.btn-c2:hover {
    color: #fff;
    background-color: #d64343;
}

.btn-c3 {
    color: #fff;
    background-color: #61dd85;
}

.btn-c3:hover {
    color: #fff;
    background-color: #4bb76a;
}

.btn-c4 {
    color: #fff;
    background-color: #999;
}

.btn-c4:hover {
    color: #fff;
    background-color: #666;
}

.btn-c4 {
    min-height: unset !important;
    /* min-heightを削除 */
}

.btn-big {
    margin-top: 10px;
    padding: 8px 16px
}

.btn-wide {
    min-width: 200px;
}

.btn-submit {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}


/* ************* input ************* */

.input-label {
    margin-bottom: 5px;
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
}

.form-control,
.input-text,
.input-select,
.input-date,
.textarea {
    width: 100%;
    border: 1px solid #ccc;
    outline: none;
}

.input-select,
.input-date {
    border-radius: 8px;
}

.textarea {
    resize: vertical;
}

/* ************* status ************* */
.status0,
.priority0,
.date3 {
    color: #fff !important;
    font-weight: bold;
    background-color: #4982ff !important;
    padding: 2px 5px 3px 5px;
}

span.status0,
span.priority0,
span.date3 {
    border-radius: 5px;
    cursor: pointer;
}

.status1,
.priority1,
.date2 {
    color: #fff !important;
    font-weight: bold;
    background-color: #61dd85 !important;
    padding: 2px 5px 3px 5px;
}

span.status1,
span.priority1,
span.date2 {
    border-radius: 5px;
    cursor: pointer;
}

.status2,
.priority2,
.date1 {
    color: #fff !important;
    font-weight: bold;
    background-color: #ff5555 !important;
    padding: 2px 5px 3px 5px;
}

span.status2,
span.priority2,
span.date1 {
    border-radius: 5px;
    cursor: pointer;
}

.form-container {
    padding: 24px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.text-right {
    text-align: right;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: red;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    padding: 2px 6px;
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    padding: 5px 10px;
    margin-right: 10px;
    font-weight: bold;
}

.detail-box {
    display: block;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #444444;
    background-color: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ************* dashboard-list ************* */

.dashboard-list {}

.dashboard-list h2 {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ************* 詳細ページ用CSS（シンプル版） ************* */
.detail-page-header {
    background: white;
    color: #2c3e50;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);
}

.detail-page-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}

.detail-page-title .icon {
    background: #f8f9fa;
    color: #6c757d;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.detail-page-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.detail-page-meta .meta-item {
    background: #f8f9fa;
    color: #495057;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.detail-cards-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.status-card .detail-stats-grid {
    width: calc(50% - 10px);
    display: inline-block;
    margin-right: 16px;
    margin-bottom: 0px;
}

.status-card .detail-stats-grid:last-child {
    margin-right: 0;
}

.detail-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-card-title i {
    color: #6c757d;
}

.detail-info-grid {
    display: grid;
    gap: 5px;
}

.detail-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.detail-info-item:last-child {
    border-bottom: none;
}

.detail-info-icon {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.detail-info-content {
    flex: 1;
}

.detail-info-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.detail-info-value {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.detail-description {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: 15px;
    line-height: 1.6;
    color: #555;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-bottom: 20px;
}

.detail-stats-grid:last-child {
    margin-bottom: 0px;
}

.detail-stat-item {
    text-align: center;
    padding: 5px 10px;
    background: white;
    color: #495057;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.detail-stat-number {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0px;
    color: #2c3e50;
}

.detail-stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.detail-actions-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    margin-top: 20px;
}

.detail-actions-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.detail-action-btn.primary {
    background-color: #999;
    color: white;
    box-shadow: 0 4px 15px #99999954;
}

.detail-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px #99999999;
}

.detail-action-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.detail-action-btn.secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.detail-action-btn.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.detail-action-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.progress-bar-container {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #f8f9fa;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.progress-bar-fill {
    height: 100%;
    background: #007bff;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.timeline-container {
    margin-top: 20px;
}

.timeline-item {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-date {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.timeline-title {
    font-weight: 600;
    margin: 5px 0;
    color: #333;
}

.timeline-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.detail-cards-container {
    grid-template-columns: 1fr;
    gap: 20px;
}

.detail-actions-grid {
    grid-template-columns: 1fr;
}

.detail-page-title {
    font-size: 20px;
}

.detail-page-header {
    padding: 15px;
    margin-bottom: 15px;
}

.detail-stat-item {
    padding: 12px;
}

.detail-stat-number {
    font-size: 18px;
}

/* ************* セクションコントロール ************* */
/* フィルタのアコーディオン内容 */
.section-controls-container {
    margin-bottom: 20px !important;
}

.section-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 13px;
    border-bottom: 1px solid #e5e5e5;
}

.section-controls .filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-controls .actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.section-controls button {
    padding: 8px 15px;
}

.section-controls {
    flex-direction: column;
    align-items: stretch;
}

.section-controls .filters {
    justify-content: flex-start;
}

.section-controls .actions {
    justify-content: center;
}


/* ************* ページネーション ************* */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-info {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    min-width: 120px;
    text-align: center;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* ボタンの余白調整 */
.btn.ml5 {
    margin-left: 5px;
}

.btn.mr5 {
    margin-right: 5px;
}

.btn.mr10 {
    margin-right: 10px;
}

/* アイコンとテキストの余白統一設定 */
i.mr5 {
    margin-right: 8px !important;
    /* 5pxでは狭すぎるため8pxに調整 */
}

i.mr10 {
    margin-right: 12px !important;
    /* 10pxを12pxに調整してより見やすく */
}

/* FontAwesome アイコン全般の余白設定 */
.fa-solid,
.fa-regular,
.fa-light {
    margin-right: 6px !important;
    /* デフォルト余白 */
}

/* セクションタイトルのアイコン余白 */
.section-title i {
    margin-right: 12px !important;
}

/* フィルタボタン内のアイコン余白 */
.filters .btn i {
    margin-right: 6px !important;
}

/* メニューアイテムのアイコン余白確保 */
.menu-item i {
    margin-right: 12px !important;
    width: 20px !important;
    text-align: center !important;
}

/* スマートフォン向けメニュー項目の非表示 */
.sidebar-menu a[href="board.php"],
.sidebar-menu a[href="gantt.php"] {
    display: none !important;
    /* ボードとガントチャートを非表示 */
}

.form-container div {
    margin-bottom: 15px !important;
    /* div要素間の余白を15pxに設定 */
}

/* カラーピッカーの最小幅設定 */
input[type="color"] {
    min-width: 100px !important;
    /* カラーピッカーの最小幅を100pxに設定 */
}

/* ===== activity-log.phpのスタイル設定はインラインCSSに移行済み ===== */
/* 外部CSSとの競合を避けるため、この部分は削除しました */

.btn.mt20 {
    margin-top: 20px;
}

.btn.mb10 {
    margin-bottom: 10px;
}

.btn.mb20 {
    margin-bottom: 20px;
}

/* ************* 設定ページ ************* */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.settings-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.settings-card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.settings-icon {
    color: #6c757d;
    font-size: 20px;
}

.settings-card-body {
    padding: 20px;
}

.settings-card-body p {
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.settings-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.settings-features li {
    padding: 5px 0;
    color: #6c757d;
    position: relative;
    padding-left: 20px;
}

.settings-features li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.settings-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ************* バッジ ************* */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-system {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.badge-custom {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #ce93d8;
}

/* ************* 優先度値 ************* */
.priority-value {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #dee2e6;
}

/* ************* インライン編集 ************* */
.editable-cell {
    position: relative;
    transition: background-color 0.2s ease;
}

.editable-cell:hover {
    background-color: #e3f1ff !important;
    border-radius: 4px;
}

.editable-cell:hover:after {
    content: "編集";
    position: absolute;
    top: 2px;
    right: 2px;
    background: #007bff;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.8;
}

/* ************* インライン編集モーダル ************* */
.inline-edit-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.inline-edit-modal.show {
    display: block;
}

.inline-edit-modal .modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.inline-edit-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.inline-edit-modal .modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.inline-edit-modal .modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.inline-edit-modal .modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.inline-edit-modal .modal-body {
    padding: 20px;
}

.inline-edit-modal .form-group {
    margin-bottom: 15px;
}

.inline-edit-modal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.inline-edit-modal .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.inline-edit-modal .form-control:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.inline-edit-modal .form-actions {
    margin-top: 10px;
}

.inline-edit-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* ボタンスタイルの統一 */
.inline-edit-modal .btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: inline-block;
    user-select: none;
}

.inline-edit-modal .btn:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.inline-edit-modal .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.inline-edit-modal .btn-outline {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

.inline-edit-modal .btn-outline:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.inline-edit-modal .btn-c1 {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.inline-edit-modal .btn-c1:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.inline-edit-modal .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inline-edit-modal .modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: none;
}

.inline-edit-modal .modal-header,
.inline-edit-modal .modal-body,
.inline-edit-modal .modal-footer {
    padding: 15px;
}

.inline-edit-modal .modal-footer {
    flex-direction: column;
    gap: 8px;
}

.inline-edit-modal .btn {
    width: 100%;
}

/* 期限超過スタイル */
.deadline-overdue {
    color: #dc3545 !important;
    font-weight: bold;
}

/* 状態と優先度のスタイル（既存スタイルとの互換性確保） */
.status-completed {
    color: #28a745;
}

.status-progress {
    color: #007bff;
}

.status-review {
    color: #ffc107;
}

.status-hold {
    color: #6c757d;
}

.status-pending {
    color: #dc3545;
}

.priority-high {
    color: #dc3545;
    font-weight: bold;
}

.priority-medium {
    color: #ffc107;
}

.priority-low {
    color: #28a745;
}

/* プロジェクトリンクとタスクリンクのスタイル */
.project-link,
.task-link {
    text-decoration: none;
    color: #007bff;
    transition: color 0.2s ease;
}

.project-link:hover,
.task-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.task-link strong {
    font-weight: 600;
}


/* ************ タスク詳細モーダル ************ */
.task-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.task-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.task-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    max-width: 1200px;
    max-height: 800px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.task-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.task-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.task-modal-close:hover {
    background-color: #e5e5e5;
}

.task-modal-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.task-detail-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* モーダル表示時のiframe内調整用クラス */
.modal-view {
    padding-top: 0 !important;
}

.modal-view .dashboard {
    min-height: auto !important;
    margin-top: 0 !important;
    width: 100% !important;
}

.modal-view .header,
.modal-view .sidebar {
    display: none !important;
}

.modal-view .main-content {
    margin-left: 0 !important;
    padding: 20px !important;
}

.modal-content-view {
    margin-left: 0 !important;
    padding: 20px !important;
    width: 100% !important;
}

/* モーダル表示時のセクションヘッダー非表示 */
.modal-view .section-header,
.modal-view .section-title {
    display: none !important;
}

/* ************ ガントチャート リサイズハンドル ************ */
.gantt-task-bar {
    position: relative;
}

.gantt-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    background-color: transparent;
    z-index: 10;
}

.gantt-resize-left {
    left: 0;
    cursor: ew-resize;
}

.gantt-resize-right {
    right: 0;
    cursor: ew-resize;
}

/* ホバー時に視覚的フィードバック */
.gantt-resize-handle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ************ ガントチャート 中央コンテンツ ************ */
.gantt-center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    white-space: nowrap;
    z-index: 11;
    pointer-events: none;
}

.gantt-center-content .gantt-detail-btn {
    pointer-events: auto;
}

/* ************ ガントチャート 移動ハンドル ************ */
.gantt-move-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc(50% - 30px);
    background-color: transparent;
    cursor: move;
    z-index: 9;
}

.gantt-move-center-left {
    left: 10px;
    /* 左のリサイズハンドルを避ける */
    right: calc(50% + 30px);
    /* 中央コンテンツを避ける */
}

.gantt-move-center-right {
    left: calc(50% + 30px);
    /* 中央コンテンツを避ける */
    right: 10px;
    /* 右のリサイズハンドルを避ける */
}

/* ホバー時に視覚的フィードバック */
.gantt-move-handle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 日数テキストのz-index調整 */
.gantt-bar-text {
    position: relative;
    pointer-events: none;
    /* クリックイベントを透過 */
    user-select: none;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

/* ************ ガントチャート 詳細表示ボタン ************ */
.gantt-detail-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    padding: 0;
    vertical-align: middle;
    pointer-events: auto;
    /* クリック可能にする */
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gantt-detail-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

.gantt-detail-btn:active {
    transform: scale(0.95);
}

/* ************ ガントチャート ツールチップ ************ */
.gantt-tooltip {
    position: fixed;
    z-index: 1000;
    background: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.4;
    max-width: 320px;
    min-width: 240px;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gantt-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-title {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 18px;
}

.tooltip-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 12px;
}

.tooltip-value {
    color: white;
    font-size: 13px;
    text-align: right;
    flex-grow: 1;
    font-weight: 500;
}

/* ステータス・優先度の色分け */
.tooltip-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tooltip-priority {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}