/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #f5f5f5;
    z-index: -2;
    opacity: 1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 245, 245, 0.5);
    z-index: -1;
}

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* サイドバー */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    color: white;
}

.sidebar-header h1 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.sidebar-section h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.section-header-with-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.btn-add-inline {
    padding: 4px 8px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-add-inline:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
}

.btn-add-inline:active {
    background: #e0e0e0;
}

.btn-add-group {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-group:hover {
    background: #e0e0e0;
}

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

.group-item {
    margin-bottom: 5px;
}

.group-item a {
    display: flex;
    align-items: center;
    padding: 2px 5px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    gap: 10px;
}

.group-item a:hover {
    background: #f5f5f5;
}

.group-item.active a {
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    color: white;
}

/* ドラッグアンドドロップ用スタイル */
.draggable-group {
    cursor: move;
    user-select: none;
}

.draggable-group.dragging {
    opacity: 0.5;
    background: #f0f0f0;
}

.draggable-group.drag-over {
    border-top: 2px solid #667eea;
}

.drag-handle {
    color: #999;
    font-size: 0.8em;
    cursor: grab;
    user-select: none;
    margin-right: -5px;
    padding: 0 5px;
}

.drag-handle:active {
    cursor: grabbing;
}

.draggable-group.dragging .drag-handle {
    cursor: grabbing;
}

.group-item.active .drag-handle {
    color: rgba(255, 255, 255, 0.7);
}

.group-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.group-icon svg {
    width: 100%;
    height: 100%;
    color: currentColor;
}

/* 左メニューのグループ名 */
.sidebar .group-name {
    font-weight: 500;
    font-size: 0.75em;
    text-decoration: none;
    border-bottom: none;
}

/* サイドバーフッター（アカウント情報） */
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.account-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.account-name {
    flex: 1;
    font-size: 0.95em;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    flex-shrink: 0;
}

.logout-link:hover {
    background: #e0e0e0;
    color: #333;
}

.logout-link svg {
    width: 18px;
    height: 18px;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    background: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px;
    position: relative;
    margin-left: 280px;
    min-height: 100vh;
    max-width: calc(100vw - 280px);
    box-sizing: border-box;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* 右側ヘッダーのグループ名 */
.content-header h2 {
    font-size: 1.8em;
    font-weight: 600;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.content-header h2 .task-count-badge {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
    margin-left: 8px;
}

.content-actions {
    display: flex;
    gap: 10px;
}

/* メッセージ */
.message {
    margin: 0 0 20px 0;
    padding: 15px 20px;
    border-radius: 6px;
    font-weight: 500;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* セクション */
section {
    padding: 0;
}

.todo-list-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.work-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.work-logs-date-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
}

.btn-date-nav:hover {
    border-color: #ee6f1e;
    color: #ee6f1e;
    background: rgba(238, 111, 30, 0.1);
}

.btn-date-nav:active {
    transform: scale(0.95);
}

.btn-date-nav svg {
    display: block;
}

.work-logs-header h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.work-logs-date-display {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
}

.work-logs-date-picker {
    display: flex;
    align-items: center;
    position: relative;
}

.date-picker-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ee6f1e;
    transition: color 0.2s;
    padding: 8px;
    border-radius: 6px;
    background: transparent;
}

.date-picker-label:hover {
    color: #ed1a3d;
    background: rgba(238, 111, 30, 0.1);
}

.date-picker-label svg {
    display: block;
}

.work-logs-date-picker input[type="date"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.work-logs-date-picker input[type="date"]:focus + .date-picker-label,
.date-picker-label:has(+ input[type="date"]:focus) {
    outline: 2px solid #ee6f1e;
    outline-offset: 2px;
}

h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

/* フォーム */
.todo-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.task-form .form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.task-form .form-group:last-child {
    margin-bottom: 0;
}

.task-form .form-group label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    width: 100px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 10px;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

/* モーダル内の入力欄は通常サイズに */
.modal .form-group input,
.modal .form-group textarea,
.modal .form-group select {
    font-size: 1em;
}

.task-form .form-group input,
.task-form .form-group textarea,
.task-form .form-group select {
    flex: 1;
    min-width: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
}

.task-form textarea {
    font-size: 0.9em;
    padding: 8px;
    min-height: 50px;
    resize: vertical;
}

.task-form .form-group .links-wrapper,
.task-form .form-group .tags-container {
    flex: 1;
    min-width: 0;
}

/* ボタン */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #ee6f1e;
    color: white;
}

.btn-success:hover {
    background: #ed1a3d;
    transform: translateY(-2px);
}

.btn-undo {
    background: #f39c12;
    color: white;
}

.btn-undo:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.btn-danger {
    background: #b6b5b5;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 再生・停止ボタン */
.btn-play {
    background: #27ae60;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: auto;
}

.btn-play:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-1px);
}

.btn-play:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-stop {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: auto;
}

.btn-stop:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-edit {
    background: #6c757d;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-edit svg,
.btn-success svg,
.btn-danger svg,
.btn-undo svg {
    width: 14px;
    height: 14px;
}

/* タスク数表示 */
.todo-count-section {
    margin-bottom: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.todo-count {
    color: #666;
    font-size: 0.95em;
    font-weight: 500;
}

.date-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-filter-form .form-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter-form .form-group label {
    margin: 0;
    white-space: nowrap;
}

.date-filter-form .form-group input[type="date"] {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 2.5em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.date-filter-form .form-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #666;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #e9ecef;
}

.filter-btn.active {
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    color: white;
}

.todo-count {
    color: #666;
    font-size: 0.9em;
}

/* TODOリスト */
.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.todo-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.3s;
}

.todo-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.todo-item.completed {
    opacity: 0.7;
    background: #e8f5e9;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: #666;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-size: 1.2em;
    margin-bottom: 8px;
    color: #333;
}

.todo-description {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

.todo-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.todo-date {
    font-size: 0.85em;
    color: #999;
}

.todo-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.todo-actions .btn {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 1.1em;
}

/* グループ階層（現在は使用していないが、将来のため残す） */
.group-section {
    margin-bottom: 40px;
}

/* プロジェクト階層 */
.project-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.project-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.project-name {
    font-size: 1.2em;
    margin-bottom: 1px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ed1a3d;
    font-weight: 600;
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-add-task-to-project {
    background: transparent;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-add-task-to-project:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5568d3;
}

.btn-add-task-to-project svg {
    width: 16px;
    height: 16px;
}

/* タスクテーブル */
.task-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.task-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.task-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.task-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    font-size: 0.9em;
}

.task-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.task-table tbody tr:hover {
    background: #f8f9fa;
}

.task-table tbody tr:last-child {
    border-bottom: none;
}

.task-table tbody tr.completed {
    opacity: 0.7;
    background: #f0f0f0;
}

.task-table tbody tr.completed .task-title-link {
    text-decoration: line-through;
    color: #999;
}

/* 完了したタスクページでは通常のスタイルを使用 */
.completed-tasks-page .task-table tbody tr.completed {
    opacity: 1;
}

.completed-tasks-page .task-table tbody tr.completed .task-title-link {
    text-decoration: none;
    color: #333;
}

.task-table td {
    padding: 5px 10px 5px 10px;
    vertical-align: top;
}

.task-title-cell {
    min-width: 200px;
    max-width: 300px;
}

.task-title-link {
    cursor: pointer;
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.task-title-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.task-description-small {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

.task-links-small {
    margin-top: 4px;
    display: flex;
    gap: 5px;
}

.link-item-small {
    font-size: 0.85em;
    color: #667eea;
    text-decoration: none;
}

.link-item-small:hover {
    text-decoration: underline;
}

.task-tags-cell {
    min-width: 100px;
}

.task-group-project-info {
    margin-bottom: 1px;
    line-height: 1.2;
}

.group-project-name {
    font-size: 0.85em;
    color: #666;
}

.editable-project-name {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

.editable-project-name:hover {
    background: #f0f0f0;
}

.editable-project-name .project-name-input {
    padding: 2px 6px;
    border: 1px solid #4CAF50;
    border-radius: 3px;
    font-size: inherit;
    font-family: inherit;
    background: white;
    color: #333;
    min-width: 150px;
}

.group-project-name {
    font-size: 0.75em;
    color: #666;
}

.group-project-separator {
    font-size: 0.75em;
    color: #999;
    margin: 0 2px;
}

.tag-small {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    color: white;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
}

.task-progress-cell,
.task-priority-cell {
    white-space: nowrap;
    font-size: 0.9em;
    cursor: pointer;
    position: relative;
    min-width: 100px;
    width: 100px;
}

.task-progress-cell:hover,
.task-priority-cell:hover {
    background-color: #f0f0f0;
}

.editable-select {
    position: relative;
}

.editable-display {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
}

.editable-select-field {
    width: 80%;
    padding: 4px;
    border: 1px solid #4CAF50;
    border-radius: 3px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
}

.task-date-cell {
    white-space: nowrap;
    color: #666;
    font-size: 0.85em;
    cursor: pointer;
    position: relative;
}

.task-date-cell:hover {
    background-color: #f0f0f0;
}

.editable-date {
    position: relative;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    min-height: 20px;
}

.editable-date-field {
    padding: 4px;
    border: 1px solid #4CAF50;
    border-radius: 3px;
    font-size: 0.85em;
    background: white;
    cursor: pointer;
    width: 120px;
}

.editable-date-field:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.calendar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
    margin-left: 2px;
    color: #666;
}

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

.editable-date:hover .calendar-icon {
    opacity: 1;
}

.editable-date-field[style*="display: block"] ~ .calendar-icon,
.editable-date-field:not([style*="display: none"]) ~ .calendar-icon {
    display: none;
}

.task-actions-cell {
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: auto;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .main-content {
        max-width: calc(100vw - 280px);
        padding: 20px;
    }

    .content-header {
        padding: 0;
    }

    .task-table {
        font-size: 0.8em;
    }

    .task-table th,
    .task-table td {
        padding: 8px 6px;
    }

    .task-title-cell {
        min-width: 150px;
        max-width: 200px;
    }

    .task-table-container {
        width: 100%;
        max-width: 100%;
    }

    .todo-list-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .kanban-section {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .task-table-container {
        overflow-x: scroll;
    }

    .task-table {
        min-width: 800px;
    }
}

/* カウントバッジ */
.count-badge {
    font-size: 0.75em;
    color: #999;
    font-weight: normal;
    margin-left: 8px;
}

.task-count-badge {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
    margin-left: 8px;
}

/* タグ */
.todo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    color: white;
    font-weight: 500;
}

/* リンク */
.todo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.link-item {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
}

.link-item:hover {
    text-decoration: underline;
}

/* タスク情報 */
.todo-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.info-item {
    color: #666;
}

/* トースト通知モーダル */
.toast-modal {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    animation: slideIn 0.3s ease-out;
}

.toast-content {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    min-width: 200px;
    text-align: center;
}

.toast-success .toast-content {
    background: #27ae60;
    color: white;
}

.toast-error .toast-content {
    background: #e74c3c;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 756px;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

#habitModal .modal-header {
    padding: 10px 15px;
}

#habitModal .modal-header h2 {
    font-size: 1.2em;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

/* 習慣ボタン */
.btn-habit {
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-habit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(238, 111, 30, 0.4);
}

.btn-habit svg {
    width: 18px;
    height: 18px;
}

/* 習慣モーダル */
.modal-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 200px);
}

.habit-add-section {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.habit-input {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.habit-input:focus {
    outline: none;
    border-color: #ee6f1e;
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.habit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.habit-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.habit-item .drag-handle {
    color: #999;
    font-size: 1.2em;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}

.habit-name {
    flex-shrink: 0;
    width: 250px;
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    word-wrap: break-word;
    line-height: 1.4;
}

.week-calendar {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.week-day-btn {
    flex-shrink: 0;
    width: 45px;
    padding: 5px 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.week-day-btn:hover {
    border-color: #ee6f1e;
    background: #fff5e6;
}

.week-day-btn.checked {
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    border-color: #ee6f1e;
    color: white;
}

.week-day-btn.today {
    border-color: #ee6f1e;
    border-width: 2px;
}

.week-day-btn.today.checked {
    border-color: #ee6f1e;
}

.week-day-name {
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
}

.week-day-num {
    font-size: 0.95em;
    font-weight: 600;
}

.week-day-btn.checked .week-day-name,
.week-day-btn.checked .week-day-num {
    color: white;
}

/* 習慣ページ専用スタイル */
.habits-page-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.habits-page-content {
    flex: 0 0 756px;
    max-width: 756px;
    padding: 20px;
}

.habits-stats-sidebar {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.stats-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stats-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ee6f1e;
    padding-bottom: 8px;
}

.stats-card-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.stats-card-header:hover {
    opacity: 0.8;
}

.toggle-icon {
    font-size: 1em;
    color: #ee6f1e;
    font-weight: bold;
    transition: transform 0.2s;
}

.last-month-stats-container {
    margin-top: 20px;
    padding-top: 20px;
}

.stats-divider {
    height: 1px;
    background: #e0e0e0;
    margin-bottom: 15px;
}

.last-month-stats-container h4 {
    margin: 0 0 15px 0;
    font-size: 1em;
    font-weight: 600;
    color: #666;
}

.stats-content {
    min-height: 60px;
}

.stats-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #ee6f1e;
    margin-bottom: 8px;
}

.stats-detail {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stats-percentage {
    font-size: 1.1em;
    font-weight: 600;
    color: #27ae60;
    margin-top: 10px;
}

.monthly-stats-list {
    max-height: 400px;
    overflow-y: auto;
}

.monthly-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.monthly-stat-item:last-child {
    border-bottom: none;
}

.month-label {
    font-weight: 500;
    color: #333;
}

.month-stats {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.month-number {
    font-size: 1.3em;
    font-weight: 700;
    color: #ee6f1e;
}

.month-detail {
    font-size: 0.9em;
    color: #666;
}

.loading {
    color: #999;
    font-style: italic;
}

.error {
    color: #e74c3c;
}

/* 統計カレンダー */
.stats-calendar {
    margin-top: 15px;
    max-width: 200px;
}

.calendar-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.75em;
    margin-bottom: 4px;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.6em;
    color: #666;
    padding: 2px 1px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    position: relative;
    min-height: 0;
}

.calendar-day.empty {
    border: none;
    background: transparent;
}

.calendar-day.weekend {
    background: #f9f9f9;
}

.calendar-day.today {
    border: 1.5px solid #ee6f1e;
    background: #fff5e6;
}

.calendar-day.has-checks {
    background: #e8f5e9;
}

.calendar-day-number {
    font-size: 0.6em;
    font-weight: 500;
    color: #333;
    line-height: 1;
}

.calendar-day-count {
    font-size: 0.5em;
    font-weight: 700;
    color: #27ae60;
    margin-top: 0.5px;
    line-height: 1;
}

/* 月間トラッカーエリア */
.monthly-habits-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.monthly-habits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monthly-habit-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.monthly-habit-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.monthly-habit-name {
    flex: 1;
    font-size: 1em;
    font-weight: 500;
    color: #333;
}

.monthly-habit-count-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-count-up {
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-count-up:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(238, 111, 30, 0.3);
}

.btn-count-up svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.monthly-habit-count {
    font-size: 1.8em;
    font-weight: 700;
    color: #ee6f1e;
    min-width: 50px;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.habits-list-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.habit-item-page {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
}

.habit-item-page:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.habit-item-page .drag-handle {
    color: #999;
    font-size: 1.2em;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}

.habit-name-page {
    flex-shrink: 0;
    width: 250px;
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    word-wrap: break-word;
    line-height: 1.4;
    margin: 0;
}

.week-calendar-page {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.week-day-btn-page {
    flex-shrink: 0;
    width: 45px;
    padding: 5px 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.week-day-btn-page:hover {
    border-color: #ee6f1e;
    background: #fff5e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(238, 111, 30, 0.2);
}

.week-day-btn-page.checked {
    background: linear-gradient(135deg, #ee6f1e 0%, #ed1a3d 100%);
    border-color: #ee6f1e;
    color: white;
}

.week-day-btn-page.today {
    border-color: #ee6f1e;
    border-width: 2px;
}

.week-day-btn-page.today.checked {
    border-color: #ee6f1e;
}

.week-day-btn-page.checked .week-day-name,
.week-day-btn-page.checked .week-day-num {
    color: white;
}

.habit-item .habit-delete-btn,
.habit-item-page .habit-delete-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: auto;
}

.habit-item .habit-delete-btn:hover,
.habit-item-page .habit-delete-btn:hover {
    background: #fee;
    color: #e74c3c;
}

.habit-item .habit-delete-btn svg,
.habit-item-page .habit-delete-btn svg {
    width: 16px;
    height: 16px;
}

.habit-delete-btn:hover {
    background: #fee;
    color: #e74c3c;
}

.habit-delete-btn svg {
    width: 16px;
    height: 16px;
}

.close,
.modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    background: transparent;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.close:focus,
.modal-close:hover,
.modal-close:focus {
    opacity: 0.7;
}

.task-form {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    margin-left: 42px;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group-inline label {
    white-space: nowrap;
    margin: 0;
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
    min-width: 60px;
    flex-shrink: 0;
}

.form-group-inline select,
.form-group-inline input[type="date"] {
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
    width: 140px;
    flex-shrink: 0;
}

.form-group-inline select:focus,
.form-group-inline input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-input-wrapper input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.link-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add-link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 16px;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.link-url {
    flex: 1;
    color: #333;
    font-size: 0.9em;
    word-break: break-all;
}

.btn-remove-link-item {
    padding: 4px;
    background: transparent;
    color: #999;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
}

.btn-remove-link-item:hover {
    color: #e74c3c;
}

.btn-remove-link-item svg {
    width: 16px;
    height: 16px;
}

.btn-remove-link {
    padding: 4px 8px;
    background: transparent;
    color: #666;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-remove-link:hover {
    color: #e74c3c;
}

.btn-remove-link svg {
    width: 16px;
    height: 16px;
}

.btn-secondary {
    background: #6b6b6b;
    color: white;
}

.btn-secondary:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f9f9f9;
    width: 100%;
    min-height: 60px;
}

.tag-checkbox {
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.tag-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tag-checkbox span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    color: white;
    font-size: 0.9em;
    font-weight: 500;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tag-checkbox input[type="checkbox"]:not(:checked) + span {
    opacity: 0.5;
}

.tag-checkbox input[type="checkbox"]:checked + span {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.management-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* タスク詳細サイドパネル */
.task-detail-panel {
    position: fixed;
    top: 0;
    right: -1250px;
    width: 800px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    transition: right 0.3s ease-out;
    overflow-y: auto;
    font-size: 1em;
}

.task-detail-panel.active {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.panel-header h2 {
    margin: 0;
    font-size: 1em;
    color: white;
}

.panel-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.panel-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.panel-content {
    padding: 20px;
    font-size: 1em;
    position: relative;
    z-index: 1;
}

.panel-content input,
.panel-content textarea,
.panel-content select {
    position: relative;
    z-index: 2;
}

.task-detail-panel #detailContent {
    font-size: 1em;
    min-height: 100px;
    height: 50%;
}

.work-log-section {
    margin-top: 0px;
    padding-top: 5px;
    border-top: 1px solid #e0e0e0;
}

.work-log-section h3 {
    font-size: 1em;
    margin-bottom: 5px;
    color: #333;
}

.work-log-list {
    margin-top: 20px;
}

.work-log-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.log-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.log-date {
    font-weight: 600;
    color: #667eea;
    font-size: 1em;
    flex: 1;
    min-width: 0;
}

.log-time {
    font-size: 2.5em;
    color: #27ae60;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.log-content {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 10px;
    word-break: break-word;
}

.btn-delete-log {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-delete-log:hover {
    background: #c0392b;
}

.empty-log {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* 作業ログ一覧ページ（テーブル形式） */
.work-log-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.work-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.work-log-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.work-log-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.work-log-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.work-log-table tbody tr:hover {
    background: #f8f9fa;
}

.work-log-table tbody tr:last-child {
    border-bottom: none;
}

.work-log-table td {
    padding: 12px 15px;
    vertical-align: top;
}

.log-datetime {
    white-space: nowrap;
    color: #666;
    font-size: 0.9em;
}

.log-group {
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}

.log-project {
    color: #764ba2;
    font-weight: 500;
    white-space: nowrap;
}

.log-task {
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.log-work-time {
    color: #27ae60;
    font-weight: 600;
    white-space: nowrap;
}

.log-content {
    color: #333;
    line-height: 1.6;
    max-width: 400px;
    word-wrap: break-word;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .work-log-table {
        font-size: 0.85em;
    }

    .work-log-table th,
    .work-log-table td {
        padding: 10px 12px;
    }

    .log-content {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .work-log-table-container {
        overflow-x: scroll;
    }

    .work-log-table {
        min-width: 800px;
    }
}

/* パネル表示時の背景オーバーレイ */
.task-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1499;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    cursor: pointer;
}

.task-detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ハンバーガーメニューボタン */
.hamburger-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
    border-radius: 4px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.hamburger-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
    border-radius: 4px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.mobile-hamburger-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-hamburger-btn svg {
    width: 24px;
    height: 24px;
}

/* プロジェクト一覧ボタン */
.btn-project-list {
    background: #6b6b6b;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-project-list:hover {
    background: #5a5a5a;
    transform: translateY(-2px);
}

/* ヘッダー左側のレイアウト */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* サイドバーオーバーレイ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .task-detail-panel {
        width: 100%;
        right: -100%;
    }
    .app-container {
        flex-direction: column;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* ハンバーガーメニューボタンを表示 */
    .hamburger-menu-btn,
    .mobile-hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* サイドバーをデフォルトで非表示 */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    /* サイドバーが開いている時 */
    .sidebar.mobile-open {
        left: 0;
    }

    /* サイドバーオーバーレイを表示 */
    .sidebar-overlay {
        display: block;
    }

    .main-content {
        padding: 15px;
        margin-left: 0 !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ヘッダーのレイアウト調整 */
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-left {
        width: 100%;
    }

    .content-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .content-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 0.9em;
        padding: 10px 15px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .content-header h2 {
        font-size: 1.4em;
    }

    .content-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .content-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 0.9em;
        padding: 10px 15px;
    }

    .todo-list-section {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        box-sizing: border-box;
        margin: 0;
    }

    .todo-item {
        flex-direction: column;
    }

    .todo-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* タスクテーブルのスマホ対応 - カード形式に変更 */
    .task-table-container {
        overflow-x: visible;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .task-table {
        display: block; /* テーブルをブロック要素に変更 */
        width: 100%;
    }

    /* カード形式のレイアウト */
    .task-table tbody {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .task-table tbody tr {
        display: flex;
        flex-direction: column;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        margin: 0;
    }

    .task-table thead {
        display: none; /* ヘッダーを非表示 */
    }

    /* タスクカードの基本スタイル */
    .task-table tbody tr {
        display: flex;
        flex-direction: column;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        margin: 0;
        gap: 15px;
    }

    .task-table tbody tr td {
        display: block;
        padding: 0;
        border: none;
        width: 100%;
    }

    /* タスクタイトルセクション */
    .task-title-cell {
        min-width: auto;
        max-width: 100%;
        padding-bottom: 15px;
        border-bottom: 2px solid #f0f0f0;
        margin-bottom: 15px;
        order: 1;
    }

    .task-group-project-info {
        font-size: 1.4em; /* 約2倍 */
        color: #666;
        margin-bottom: 10px;
        font-weight: 500;
    }

    .task-title-link {
        font-size: 2em; /* 約2倍 */
        font-weight: 600;
        display: block;
        margin-bottom: 8px;
        line-height: 1.4;
        color: #333;
    }

    .task-description-small {
        font-size: 1.6em; /* 約2倍 */
        color: #666;
        margin-top: 10px;
        line-height: 1.6;
    }

    .task-links-small {
        margin-top: 10px;
        font-size: 1.6em;
    }

    /* メタ情報を2列グリッドに配置 */
    .task-tags-cell,
    .task-progress-cell,
    .task-priority-cell,
    .task-date-cell,
    .task-table tbody tr td:nth-child(7) {
        min-width: auto;
        padding: 15px;
        background: #f9f9f9;
        border-radius: 10px;
        border: 1px solid #e0e0e0;
        margin-bottom: 0;
    }

    /* タグ、進捗、重要度、作業日、締め切り、作成日を2列グリッドに */
    .task-tags-cell {
        order: 2;
    }

    .task-progress-cell {
        order: 3;
    }

    .task-priority-cell {
        order: 4;
    }

    .task-date-cell[data-field="work_date"] {
        order: 5;
    }

    .task-date-cell[data-field="deadline"] {
        order: 6;
    }

    .task-table tbody tr td:nth-child(7) {
        order: 7;
    }

    .task-actions-cell {
        order: 8;
    }

    /* 2列グリッドレイアウト */
    .task-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* タイトルセルは全幅 */
    .task-title-cell {
        grid-column: 1 / -1;
    }

    /* 操作ボタンセルも全幅 */
    .task-actions-cell {
        grid-column: 1 / -1;
    }

    /* ラベルと値を横並びにする */
    .task-tags-cell,
    .task-progress-cell,
    .task-priority-cell,
    .task-date-cell,
    .task-table tbody tr td:nth-child(7) {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .task-tags-cell::before,
    .task-progress-cell::before,
    .task-priority-cell::before,
    .task-date-cell::before,
    .task-table tbody tr td:nth-child(7)::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 1.4em; /* ラベルも大きく */
        display: inline-block;
        margin: 0;
        padding: 0;
        border: none;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .task-tags-cell::before {
        content: "タグ";
    }

    .task-progress-cell::before {
        content: "進捗";
    }

    .task-priority-cell::before {
        content: "重要度";
    }

    .task-date-cell[data-field="work_date"]::before {
        content: "作業日";
    }

    .task-date-cell[data-field="deadline"]::before {
        content: "締め切り";
    }

    .task-table tbody tr td:nth-child(7)::before {
        content: "作成日";
    }

    .task-tags-cell .tag-small {
        display: inline-block;
        margin: 6px 6px 6px 0;
        padding: 10px 18px; /* タグのパディングを大きく */
        font-size: 1.5em; /* タグの文字サイズを大きく */
        border-radius: 8px;
        font-weight: 500;
    }

    /* タグがない場合の表示（"-"が表示される場合） */
    .task-tags-cell:has(> span:only-child:not(.tag-small)) {
        font-size: 1.8em;
        color: #999;
    }

    .task-progress-cell .editable-display,
    .task-priority-cell .editable-display,
    .task-date-cell .editable-display {
        font-size: 1.8em; /* 値の文字サイズを大きく */
        font-weight: 500;
        color: #333;
        flex: 1;
    }

    /* 作成日の文字サイズを他と揃える */
    .task-table tbody tr td:nth-child(7) {
        font-size: 1.8em;
        color: #333;
        font-weight: 500;
    }

    /* タグセルの内容を横並びに */
    .task-tags-cell {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .task-tags-cell .tag-small {
        margin: 0 6px 6px 0;
    }

    /* タグがない場合（"-"が表示される場合）も横並び */
    .task-tags-cell > span:not(.tag-small) {
        font-size: 1.8em;
        color: #999;
        flex: 1;
    }

    /* 日付セルのラッパーも横並びに対応 */
    .task-date-cell .date-input-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
    }

    .task-date-cell .editable-display {
        flex: 1;
    }

    .task-date-cell .calendar-icon {
        flex-shrink: 0;
    }

    .task-date-cell .editable-date-field {
        font-size: 1.8em;
        padding: 12px;
    }

    /* 操作ボタンセクション */
    .task-actions-cell {
        min-width: auto;
        white-space: normal;
        padding-top: 15px;
        border-top: 2px solid #f0f0f0;
        margin-top: 15px;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        background: white;
    }

    .task-actions-cell::before {
        content: "";
        display: none;
    }

    .task-actions-cell .btn {
        margin: 0;
        padding: 14px 24px; /* ボタンのパディングを大きく */
        font-size: 1.6em; /* ボタンの文字サイズを大きく */
        min-height: 52px; /* タップしやすいサイズに */
        flex: 1;
        min-width: calc(50% - 6px);
    }

    .task-actions-cell .btn-small {
        padding: 14px 20px;
        min-width: 52px;
        height: 52px;
        font-size: 1.6em;
    }

    .task-actions-cell .btn-small svg {
        width: 24px; /* アイコンサイズを大きく */
        height: 24px;
    }

    .editable-display {
        display: inline-block;
    }

    .editable-select,
    .editable-date {
        display: block;
    }

    /* カンバンボードのスマホ対応 */
    .kanban-section {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin-top: 20px;
        box-sizing: border-box;
    }

    .kanban-board {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 100%;
    }

    .kanban-column {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    /* サイドバーのスマホ対応 */
    .sidebar-header {
        padding: 15px;
    }

    .sidebar-header h1 {
        font-size: 1.2em;
    }

    .sidebar-content {
        padding: 15px;
    }

    .sidebar-footer {
        padding: 15px;
    }

    /* 作業ログセクションのスマホ対応 */
    .work-log-section {
        margin-top: 20px;
    }

    .work-log-item {
        padding: 10px;
        font-size: 0.9em;
    }

    /* タスク詳細パネルのスマホ対応 */
    .task-detail-panel {
        padding: 15px;
    }

    .task-detail-header h2 {
        font-size: 1.2em;
    }

    /* ボタンのスマホ対応 */
    .btn {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    /* フォームのスマホ対応 */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.9em;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 2.5em;
        padding: 10px;
    }

    /* タグのスマホ対応 */
    .tag-small {
        font-size: 0.75em;
        padding: 3px 6px;
    }

    /* 日付入力のスマホ対応 */
    .date-input-wrapper {
        font-size: 0.85em;
    }

    .calendar-icon {
        width: 14px;
        height: 14px;
    }

    .calendar-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* より小さなスマホ画面（480px以下） */
@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }

    .content-header h2 {
        font-size: 1.6em;
    }

    .content-actions {
        flex-direction: column;
    }

    .content-actions .btn {
        width: 100%;
        min-width: 0;
        font-size: 1.4em;
        padding: 12px 20px;
    }

    /* タスクテーブルを1列レイアウトに */
    .task-table tbody tr {
        grid-template-columns: 1fr;
    }

    .task-title-cell {
        font-size: 1.8em;
    }

    .task-group-project-info {
        font-size: 1.2em;
    }

    .task-title-link {
        font-size: 1.8em;
    }

    .task-description-small {
        font-size: 1.4em;
    }

    /* ラベルと値を横並びにする（480px以下でも適用） */
    .task-tags-cell,
    .task-progress-cell,
    .task-priority-cell,
    .task-date-cell,
    .task-table tbody tr td:nth-child(7) {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .task-tags-cell::before,
    .task-progress-cell::before,
    .task-priority-cell::before,
    .task-date-cell::before,
    .task-table tbody tr td:nth-child(7)::before {
        font-size: 1.2em;
        margin: 0;
        padding: 0;
        border: none;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .task-tags-cell {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .task-tags-cell .tag-small {
        font-size: 1.3em;
        padding: 8px 14px;
        margin: 0 6px 6px 0;
    }

    .task-tags-cell > span:not(.tag-small) {
        font-size: 1.6em;
        color: #999;
        flex: 1;
    }

    .task-progress-cell .editable-display,
    .task-priority-cell .editable-display,
    .task-date-cell .editable-display {
        font-size: 1.6em;
        flex: 1;
    }

    .task-date-cell .date-input-wrapper {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 1;
    }

    .task-table tbody tr td:nth-child(7) {
        font-size: 1.6em;
        flex: 1;
    }

    .task-actions-cell .btn {
        font-size: 1.4em;
        padding: 12px 20px;
        min-height: 48px;
    }

    .task-actions-cell .btn-small {
        padding: 12px 18px;
        min-width: 48px;
        height: 48px;
        font-size: 1.4em;
    }

    .task-actions-cell .btn-small svg {
        width: 20px;
        height: 20px;
    }

    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 15px;
    }

    .sidebar-header {
        padding: 12px;
    }

    .sidebar-content {
        padding: 12px;
    }

    .sidebar-footer {
        padding: 12px;
    }

    .btn {
        font-size: 0.85em;
        padding: 8px 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 2.5em;
        padding: 8px;
    }
}

/* カンバン形式のスタイル */
.kanban-section {
    margin-top: 40px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.kanban-section h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.kanban-board {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    min-height: 400px;
}

.kanban-column {
    flex: 0 0 280px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.kanban-column-header h4 {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.kanban-count {
    background: #f0c100;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.kanban-column-content {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.kanban-empty {
    text-align: center;
    color: #999;
    font-size: 0.85em;
    padding: 20px;
}

.kanban-card {
    background: white;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: all 0.2s;
    user-select: none;
}

.kanban-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
}

.kanban-column-content.drag-over {
    background: #e8f5e9;
    border: 2px dashed #4CAF50;
    border-radius: 4px;
}

.kanban-card-header {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.kanban-complete-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.7em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    outline: none;
}

.kanban-complete-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.kanban-complete-btn:active {
    transform: scale(0.95);
}

/* カスタム確認ダイアログ */
.confirm-popup {
    position: fixed;
    z-index: 3000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 250px;
    max-width: 350px;
    animation: popupFadeIn 0.2s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-popup-message {
    margin-bottom: 16px;
    font-size: 0.95em;
    color: #333;
    line-height: 1.5;
}

.confirm-popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.confirm-popup-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-popup-btn-primary {
    background: linear-gradient(135deg, #f0c100 0%, #ed1a3d 100%);
    color: white;
}

.confirm-popup-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.confirm-popup-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.confirm-popup-btn-secondary:hover {
    background: #e0e0e0;
}

.confirm-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 2999;
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    display: block;
    cursor: pointer;
}

.kanban-card-title:hover {
    color: #667eea;
    text-decoration: underline;
}

.kanban-card-body {
    font-size: 0.85em;
}

.kanban-card-group-project {
    margin-bottom: 6px;
    line-height: 1.3;
}

.kanban-card-tags {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8em;
}

.kanban-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kanban-priority {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85em;
}

.priority-今日 {
    background: #ff6b6b;
    color: white;
}

.priority-緊急 {
    background: #ee5a6f;
    color: white;
}

.priority-重要 {
    background: #feca57;
    color: #333;
}

.priority-未設定 {
    background: #e0e0e0;
    color: #666;
}

.kanban-deadline {
    color: #666;
    font-size: 0.85em;
}

.kanban-priority-editable {
    position: relative;
    cursor: pointer;
}

.editable-select-field-kanban {
    padding: 4px;
    border: 1px solid #4CAF50;
    border-radius: 3px;
    font-size: 0.85em;
    background: white;
    cursor: pointer;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    min-width: 80px;
}

.editable-display-kanban {
    display: inline-block;
}

/* 作業中モーダル */
.work-timer-modal {
    max-width: 400px;
}

.work-timer-body {
    text-align: center;
    padding: 40px 20px;
}

.work-timer-info {
    margin-bottom: 30px;
}

.work-timer-task-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.work-timer-time {
    font-size: 3em;
    font-weight: 700;
    color: #ee6f1e;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.work-timer-actions {
    margin-top: 30px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 600;
}

/* タスク操作セクション */
.task-actions-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border: 2px solid #ffc107;
}

.task-actions-buttons {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
}

.task-actions-buttons .btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
}

.btn-warning {
    background-color: #ff9800 !important;
    color: white !important;
    border: none;
}

.btn-warning:hover {
    background-color: #f57c00 !important;
}

/* カスタム確認ダイアログ */
.custom-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.custom-confirm-content {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: customConfirmSlideIn 0.3s ease-out;
}

@keyframes customConfirmSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-confirm-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.custom-confirm-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
}

.custom-confirm-body {
    padding: 30px 25px;
}

.custom-confirm-body p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
}

.custom-confirm-footer {
    padding: 15px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.custom-confirm-footer .btn {
    padding: 10px 20px;
    font-size: 1em;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.custom-confirm-footer .btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.custom-confirm-footer .btn-secondary:hover {
    background: #e0e0e0;
}

.custom-confirm-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-confirm-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 日付・数値入力フィールドのモバイル対応 */
input[type="date"],
input[type="number"],
input[type="text"],
textarea {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 1;
    touch-action: manipulation;
    user-select: text;
    -webkit-user-select: text;
}

input[type="date"] {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
}

input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* フォームグループのレイアウト - 項目名と入力欄を横並び */
.work-log-section .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.work-log-section .form-group label {
    min-width: 120px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    flex-shrink: 0;
}

.work-log-section .form-group input,
.work-log-section .form-group textarea {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.work-log-section .form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.work-log-section .form-row .form-group {
    margin-bottom: 0;
}

/* ボタンのある form-group は縦並び維持 */
.work-log-section .form-group:has(button) {
    display: block;
}

/* モバイルデバイスでのタップ領域確保 */
@media (max-width: 768px) {
    input[type="date"],
    input[type="number"],
    input[type="text"],
    textarea {
        min-height: 44px;
        font-size: 16px !important;
        padding: 12px !important;
    }

    .form-group {
        margin-bottom: 15px;
    }

    /* 作業ログセクションのみ横並びレイアウト */
    .work-log-section .form-group {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .work-log-section .form-group label {
        min-width: 100px;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        flex-shrink: 0;
    }

    .work-log-section .form-group input,
    .work-log-section .form-group textarea {
        flex: 1;
        min-height: 44px;
        font-size: 16px !important;
    }

    /* テキストエリアは縦配置 */
    .work-log-section .form-group:has(textarea) {
        flex-direction: column;
        align-items: flex-start;
    }

    .work-log-section .form-group:has(textarea) label {
        margin-bottom: 5px;
    }

    .work-log-section .form-group:has(textarea) textarea {
        width: 100%;
    }

    .form-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* タスク詳細パネル内の入力フィールド */
    .task-detail-panel input[type="date"],
    .task-detail-panel input[type="number"],
    .task-detail-panel input[type="text"],
    .task-detail-panel textarea {
        min-height: 44px;
        font-size: 16px !important;
        padding: 12px !important;
        border: 2px solid #ddd;
        border-radius: 6px;
        background-color: white;
    }

    .task-detail-panel {
        width: 100%;
        right: -100%;
        font-size: 1em;
    }

    .panel-content {
        font-size: 1em;
    }

    /* タスク一覧テーブルのモバイル対応 */
    .task-table thead {
        display: none;
    }

    .task-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 15px;
        background: white;
    }

    .task-table tbody td {
        display: flex;
        align-items: center;
        padding: 8px 0;
        border: none;
        text-align: left;
    }

    .task-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        min-width: 100px;
        padding-right: 10px;
        color: #333;
        flex-shrink: 0;
    }

    /* タスクタイトルは項目名なしで全幅表示 */
    .task-table tbody td.task-title-cell {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 15px;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 10px;
    }

    .task-table tbody td.task-title-cell::before {
        display: none;
    }

    /* 操作ボタンは項目名なし */
    .task-table tbody td:last-child::before {
        display: none;
    }
}