/* =================================================================
   成田ヒルズカントリークラブ 業務管理システム 統合スタイルシート
   【個人・共有タスク対応完全版】
   ================================================================= */

/* 基本リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ブランドカラー変数定義 */
:root {
    --primary-green: #2E8B57;      /* フォレストグリーン（メイン） */
    --secondary-green: #228B22;    /* より深い緑（ホバー・アクティブ） */
    --light-green: #32CD32;        /* ライムグリーン（成功・完了） */
    --pale-green: #e8f5e8;         /* 薄い緑（背景・完了コメント） */
    --warning-yellow: #ffc107;     /* 警告色 */
    --danger-red: #dc3545;         /* 危険色 */
    --success-green: #28a745;      /* 成功色 */
    --info-blue: #17a2b8;          /* 情報色 */
    --light-gray: #f8f9fa;         /* 薄いグレー */
    --border-gray: #e1e5e9;        /* ボーダーグレー */
    --text-gray: #666;             /* テキストグレー */
}

/* =================================================================
   共通コンポーネント
   ================================================================= */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-green);
}

.btn-outline {
    background: white;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.btn-outline:hover {
    background: var(--primary-green);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

/* 評価ボタンのコメントアクション */
.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.comment-actions .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
    font-weight: 500;
    min-width: 80px;
}

.comment-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
    font-weight: 500;
    min-width: 70px;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.comment-actions .btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

/* 完了したタスクの情報表示 */
.individual-task-completion,
.shared-task-completed {
    margin-top: 12px;
    padding: 12px;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--success-green);
}

.individual-completion-header,
.completion-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.individual-completion-icon,
.completed-by-icon {
    font-size: 14px;
}

.individual-completion-text,
.completed-by-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--success-green);
}

.completion-time,
.completed-time {
    font-size: 11px;
    color: var(--text-gray);
    margin-left: auto;
}

.completed-by {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-display {
    margin-top: 8px;
}

.rating-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.rating-value.excellent {
    background: rgba(255, 193, 7, 0.1);
    color: #f39c12;
}

.rating-value.good {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-green);
}

.rating-value.fair {
    background: rgba(255, 193, 7, 0.15);
    color: #e67e22;
}

.rating-value.poor {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-red);
}

.rating-comment {
    margin-top: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.4;
}

.shared-task-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(23, 162, 184, 0.1);
    border-radius: 6px;
}

.notice-icon {
    font-size: 12px;
}

.notice-text {
    font-size: 11px;
    color: var(--info-blue);
}

/* 写真アップロード機能のスタイル */
.photo-upload-section {
    margin-top: 12px;
}

.photo-upload-label {
    display: inline-block;
    padding: 8px 16px;
    background: var(--light-gray);
    color: var(--text-gray);
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
}

.photo-upload-label:hover {
    background: #e9ecef;
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.photo-input {
    display: none;
}

.photo-upload-label {
    display: inline-block;
    padding: 8px 12px;
    background: var(--light-gray);
    border: 2px dashed var(--border-gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    color: var(--text-gray);
    font-size: 13px;
}

.photo-upload-label:hover {
    background: var(--pale-green);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.photo-upload-section {
    margin-top: 10px;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
}

.photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-gray);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--danger-red);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.photo-remove-btn:hover {
    background: #c82333;
}

.photo-index {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .photo-preview-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .photo-preview-item {
        width: 70px;
        height: 70px;
    }
}

/* 完了したタスクの写真表示 */
.completed-photos {
    margin-top: 10px;
}

.photos-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 6px;
    font-weight: 500;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
    max-width: 300px;
}

.photo-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-gray);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 写真モーダル */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.photo-modal.show {
    opacity: 1;
    visibility: visible;
}

.photo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.photo-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.photo-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.photo-modal-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
}

/* スマホでの写真表示 */
@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .photo-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .photo-modal-overlay {
        padding: 10px;
    }
    
    .photo-modal-image {
        max-height: 80vh;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* =================================================================
   ログイン画面スタイル
   ================================================================= */

.login-page {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
}

.login-container {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: var(--primary-green);
    font-size: 24px;
    margin-bottom: 10px;
}

.logo p {
    color: var(--text-gray);
    font-size: 14px;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: var(--secondary-green);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* =================================================================
   管理者画面専用スタイル
   ================================================================= */

.admin-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header-title p {
    font-size: 14px;
    opacity: 0.8;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-info {
    font-size: 14px;
    margin-right: 15px;
}

.logout-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-green);
}

.stat-card.success {
    border-left-color: var(--success-green);
}

.stat-card.warning {
    border-left-color: var(--warning-yellow);
}

.stat-card.danger {
    border-left-color: var(--danger-red);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-title {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 600;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    background: var(--primary-green);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-description {
    font-size: 12px;
    color: var(--text-gray);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 20px 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.progress-chart {
    padding: 20px;
}

.location-progress {
    margin-bottom: 20px;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.location-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.location-percentage {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-green);
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s;
    background: var(--success-green);
}

.progress-fill.warning {
    background: var(--warning-yellow);
}

.progress-fill.danger {
    background: var(--danger-red);
}

.issues-table {
    width: 100%;
    border-collapse: collapse;
}

.issues-table th,
.issues-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.issues-table th {
    background: var(--light-gray);
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.issues-table td {
    font-size: 13px;
    color: var(--text-gray);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-danger {
    background: #f8d7da;
    color: #721c24;
}

.activity-list {
    padding: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 14px;
    color: white;
    background: var(--success-green);
}

.activity-icon.warning {
    background: var(--warning-yellow);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.activity-description {
    font-size: 12px;
    color: var(--text-gray);
}

.activity-time {
    font-size: 11px;
    color: #999;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

/* =================================================================
   管理画面ナビゲーション
   ================================================================= */

.admin-nav {
    background: white;
    border-bottom: 1px solid var(--border-gray);
    padding: 0 20px;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    overflow-x: auto;
}

.nav-item {
    padding: 15px 0;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-gray);
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-item.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.nav-item:hover {
    color: var(--primary-green);
}

/* =================================================================
   セクション管理
   ================================================================= */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    color: #333;
}

/* =================================================================
   データテーブル
   ================================================================= */

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: var(--light-gray);
    font-weight: 600;
    color: #333;
    font-size: 14px;
    position: sticky;
    top: 0;
}

.data-table td {
    font-size: 13px;
    color: var(--text-gray);
}

.data-table tbody tr:hover {
    background: var(--pale-green);
}

/* =================================================================
   管理画面テーブル別列幅・折り返し制御
   ================================================================= */

/* ドラッグ&ドロップ順序列共通スタイル */
.data-table .drag-handle {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: center;
    cursor: grab;
    user-select: none;
}

.data-table .drag-handle:active {
    cursor: grabbing;
}

.drag-icon {
    color: #999;
    font-size: 12px;
    font-weight: bold;
}

.data-table .drag-handle:hover .drag-icon {
    color: #666;
}

/* ユーザー管理テーブル - 折り返し制御 */
#usersTable th:nth-child(1),
#usersTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}
#usersTable th:nth-child(2),
#usersTable td:nth-child(2) {
    white-space: nowrap;
}
#usersTable th:nth-child(5),
#usersTable td:nth-child(5),
#usersTable th:nth-child(6),
#usersTable td:nth-child(6),
#usersTable th:nth-child(7),
#usersTable td:nth-child(7) {
    white-space: nowrap;
    text-align: center;
}

/* 部署管理テーブル - 折り返し制御 */
#departmentsTable th:nth-child(1),
#departmentsTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}
#departmentsTable th:nth-child(2),
#departmentsTable td:nth-child(2) {
    white-space: nowrap;
}
#departmentsTable th:nth-child(4),
#departmentsTable td:nth-child(4),
#departmentsTable th:nth-child(5),
#departmentsTable td:nth-child(5),
#departmentsTable th:nth-child(6),
#departmentsTable td:nth-child(6) {
    white-space: nowrap;
    text-align: center;
}


/* 場所管理テーブル - 折り返し制御 */
#locationsTable th:nth-child(1),
#locationsTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}
#locationsTable th:nth-child(2),
#locationsTable td:nth-child(2) {
    white-space: nowrap;
}
#locationsTable th:nth-child(3),
#locationsTable td:nth-child(3),
#locationsTable th:nth-child(6),
#locationsTable td:nth-child(6),
#locationsTable th:nth-child(7),
#locationsTable td:nth-child(7) {
    white-space: nowrap;
    text-align: center;
}
#locationsTable td:nth-child(3) {
    font-size: 16px;
}


/* タスク管理テーブル - 折り返し制御 */
#tasksTable th:nth-child(1),
#tasksTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}
#tasksTable th:nth-child(2),
#tasksTable td:nth-child(2) {
    width: 80px;
    max-width: 100px;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
}

/* タスク名（3列目）は折り返しを許可 */
#tasksTable th:nth-child(3),
#tasksTable td:nth-child(3) {
    white-space: normal;
    max-width: 200px;
}

/* 実行場所列（5列目）の2段組表示設定 */
#tasksTable th:nth-child(5),
#tasksTable td:nth-child(5) {
    width: 120px;
    max-width: 120px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
/*    line-height: 1.4;
    padding: 8px 4px;*/
    vertical-align: middle;
}
#tasksTable th:nth-child(6),
#tasksTable td:nth-child(6),
#tasksTable th:nth-child(8),
#tasksTable td:nth-child(8) {
    white-space: nowrap;
    text-align: center;
}

/* 頻度列（8列目）は折り返し可能にする */
#tasksTable th:nth-child(7),
#tasksTable td:nth-child(7) {
    text-align: center;
}

/* =================================================================
   ステータスバッジ
   ================================================================= */

.status-active {
    background: #d4edda;
    color: #155724;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.role-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.role-admin {
    background: #dc3545;
    color: white;
}

.role-manager {
    background: #ffc107;
    color: #212529;
}

.role-employee {
    background: #6c757d;
    color: white;
}

/* =================================================================
   頻度表示バッジ
   ================================================================= */

.frequency-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.frequency-badge.daily {
    background: #e8f5e8;
    color: #2e7d32;
}

.frequency-badge.weekly {
    background: #e3f2fd;
    color: #1565c0;
}

.frequency-badge.monthly {
    background: #fff3e0;
    color: #f57c00;
}

.frequency-badge.specific {
    background: #f3e5f5;
    color: #7b1fa2;
}

.frequency-badge.as_needed {
    background: #fce4ec;
    color: #c2185b;
}

/* =================================================================
   アクションボタン
   ================================================================= */

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--info-blue);
    color: white;
}

.btn-edit:hover {
    background: #138496;
}

.btn-delete {
    background: var(--danger-red);
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

/* =================================================================
   モーダル
   ================================================================= */

.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.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* =================================================================
   【個人・共有タスク対応】タスク管理モーダル専用スタイル
   ================================================================= */

/* 実行頻度ラジオボタンのレイアウト */
.frequency-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 10px 0;
}

.frequency-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.frequency-options label:hover {
    background: rgba(46, 139, 87, 0.1);
}

.frequency-options input[type="radio"] {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: var(--primary-green);
}

/* 頻度設定詳細オプションのスタイル */
#weeklyOptions, #specificDatesOptions, #weekOfMonthOptions, #periodOfMonthOptions, #dateRangeOptions, #rainyDayOptions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid #e9ecef;
    border-left: 4px solid var(--primary-green);
}

#weeklyOptions h4, #specificDatesOptions h4, #weekOfMonthOptions h4, #periodOfMonthOptions h4, #dateRangeOptions h4, #rainyDayOptions h4 {
    color: var(--primary-green);
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 曜日選択グリッドのスタイル */
.weekday-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 500px;
}

.weekday-grid label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s;
}

.weekday-grid label:hover {
    border-color: var(--primary-green);
    background: rgba(46, 139, 87, 0.05);
}

.weekday-grid input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.1);
    accent-color: var(--primary-green);
}

.weekday-grid input[type="checkbox"]:checked + span {
    color: var(--primary-green);
    font-weight: 600;
}

.weekday-grid span {
    font-size: 14px;
    transition: color 0.3s;
}

/* 日付入力行のスタイル */
.date-input-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.date-input-row input[type="date"] {
    flex: 1;
    margin-right: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
}

.date-input-row button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.3s;
    min-width: 60px;
}

.date-input-row button:hover {
    background: #c82333;
}

/* 日付追加ボタン */
.add-date-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    margin-top: 10px;
}

.add-date-btn:hover {
    background: var(--secondary-green);
}

/* 期間設定スタイル - weekday-gridと同じデザインパターンを適用 */
/* 月の特定週選択グリッド */
.week-of-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 500px;
}

.week-of-month-grid label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s;
}

.week-of-month-grid label:hover {
    border-color: var(--primary-green);
    background: rgba(46, 139, 87, 0.05);
}

.week-of-month-grid input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.1);
    accent-color: var(--primary-green);
}

.week-of-month-grid input[type="checkbox"]:checked + span {
    color: var(--primary-green);
    font-weight: 600;
}

.week-of-month-grid span {
    font-size: 14px;
    transition: color 0.3s;
}

/* 月の特定期間選択グリッド */
.period-of-month-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 500px;
}

.period-of-month-grid label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s;
}

.period-of-month-grid label:hover {
    border-color: var(--primary-green);
    background: rgba(46, 139, 87, 0.05);
}

.period-of-month-grid input[type="radio"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.1);
    accent-color: var(--primary-green);
}

.period-of-month-grid input[type="radio"]:checked + span {
    color: var(--primary-green);
    font-weight: 600;
}

.period-of-month-grid span {
    font-size: 14px;
    transition: color 0.3s;
}

/* 期間指定の日付入力スタイル */
.date-range-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}

.date-range-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s;
}

.date-range-row:hover {
    border-color: var(--primary-green);
    background: rgba(46, 139, 87, 0.05);
}

.date-range-row label {
    font-weight: 600;
    color: #333;
    min-width: 60px;
    margin-bottom: 0;
}

.date-range-row input[type="date"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.date-range-row input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

/* レスポンシブデザイン - 期間設定 */
@media (max-width: 768px) {
    .week-of-month-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .week-of-month-grid,
    .period-of-month-grid {
        grid-template-columns: 1fr;
    }
    
    .date-range-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .date-range-row label {
        min-width: auto;
    }
    
    .date-range-row input[type="date"] {
        width: 100%;
    }
}

/* 選択された部署の表示スタイル */
#selectedDepartments {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    min-height: 50px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#selectedDepartments span {
    background: var(--primary-green);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#selectedDepartments span[style*="color: #666"] {
    background: none;
    color: #666;
    padding: 0;
    box-shadow: none;
    font-style: italic;
}

#selectedDepartments span[style*="color: #dc3545"] {
    background: none;
    color: #dc3545;
    padding: 0;
    box-shadow: none;
    font-weight: 600;
}

/* =================================================================
   【新機能】個人・共有タスク対応スタイル
   ================================================================= */

/* タスクタイプ選択ラジオボタンのスタイル */
.task-type-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 10px 0;
}

.task-type-options label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
    position: relative;
}

.task-type-options label:hover {
    border-color: var(--primary-green);
    background: rgba(46, 139, 87, 0.05);
}

.task-type-options input[type="radio"] {
    position: absolute;
    top: 15px;
    right: 15px;
    width: auto;
    margin: 0;
    transform: scale(1.3);
    accent-color: var(--primary-green);
}

.task-type-options input[type="radio"]:checked + strong {
    color: var(--primary-green);
}

.task-type-options strong {
    font-size: 16px;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.task-type-options small {
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
}

/* タスクタイプバッジのスタイル */
.task-type-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.task-type-badge.task-type-shared {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #90caf9;
}

.task-type-badge.task-type-individual {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #f57c00;
    border: 1px solid #ffcc02;
}

/* タスクタイプ説明エリア */
#taskTypeExplanation {
    padding: 12px;
    background: #e8f5e8;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
    display: none;
}

/* 従業員画面でのタスクタイプ表示 */
.employee-task-type-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.employee-task-type-indicator.shared {
    background: rgba(33, 150, 243, 0.15);
    color: #1976d2;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.employee-task-type-indicator.individual {
    background: rgba(255, 152, 0, 0.15);
    color: #f57c00;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* タスクアイテムでのタスクタイプ別スタイル */
.task-item.individual-task {
    border-left: 4px solid #ff9800;
}

.task-item.shared-task {
    border-left: 4px solid #2196f3;
}

.task-item.individual-task:hover {
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.task-item.shared-task:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

/* 個人タスク専用の完了情報表示 */
.individual-task-completion {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.individual-completion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.individual-completion-icon {
    font-size: 16px;
    color: #ff9800;
}

.individual-completion-text {
    font-weight: 600;
    color: #e65100;
    font-size: 14px;
}

/* タスクタイプ説明メモ */
.task-type-note {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-type-note.individual {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #f57c00;
}

.task-type-note.shared {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #1976d2;
}

/* フィルターボタンのタスクタイプ対応 */
.filter-btn.shared-tasks {
    border-color: #2196f3;
    color: #1976d2;
}

.filter-btn.shared-tasks.active {
    background: #2196f3;
    border-color: #2196f3;
}

.filter-btn.individual-tasks {
    border-color: #ff9800;
    color: #f57c00;
}

.filter-btn.individual-tasks.active {
    background: #ff9800;
    border-color: #ff9800;
}

/* 統計カードのタスクタイプ別表示 */
.stat-card.individual-tasks {
    border-left-color: #ff9800;
}

.stat-card.individual-tasks .stat-icon {
    background: #ff9800;
}

.stat-card.shared-tasks {
    border-left-color: #2196f3;
}

.stat-card.shared-tasks .stat-icon {
    background: #2196f3;
}

/* 管理画面でのテーブル列幅調整 */
/* タスク種別列（2番目の列） */
#tasksTable th:nth-child(2),
#tasksTable td:nth-child(2) {
    text-align: center;
}

/* 実行場所列（5番目の列） は上記で設定済み */

/* 担当部署列（6番目の列） */

/* マニュアル列（7番目の列） */
#tasksTable th:nth-child(7),
#tasksTable td:nth-child(7) {
    width: 100px;
    text-align: center;
}

/* =================================================================
   プリセットアイコン機能
   ================================================================= */

.preset-icons {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    margin-top: 5px;
}

.preset-icons small {
    color: var(--text-gray);
    font-size: 12px;
    margin-bottom: 5px;
    display: block;
}

.preset-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    margin: 2px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    min-width: 32px;
    height: 32px;
}

.preset-btn:hover {
    background: var(--pale-green);
    border-color: var(--primary-green);
    transform: scale(1.1);
}

.preset-btn:active {
    background: var(--primary-green);
    color: white;
    transform: scale(0.95);
}

/* =================================================================
   アニメーション
   ================================================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================================================
   フォーム要素
   ================================================================= */

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-gray);
    font-size: 12px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-group {
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
    background: white;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.checkbox-group label:hover {
    background: rgba(46, 139, 87, 0.05);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* =================================================================
   従業員画面専用スタイル
   ================================================================= */

.employee-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.employee-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 22px;
    margin-bottom: 5px;
}

.header-left .date-info {
    font-size: 14px;
    opacity: 0.9;
}

.header-right {
    text-align: right;
}

.user-greeting {
    font-size: 16px;
    margin-bottom: 5px;
}

.logout-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: 15px;
    transition: all 0.3s;
}

.logout-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.employee-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 統計カード */
.employee-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.employee-stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    border-left: 4px solid var(--primary-green);
    transition: transform 0.3s;
}

.employee-stat-card:hover {
    transform: translateY(-2px);
}

.employee-stat-card.completed {
    border-left-color: var(--success-green);
}

.employee-stat-card.remaining {
    border-left-color: var(--warning-yellow);
}

.employee-stat-card.issues {
    border-left-color: var(--danger-red);
}

.stat-label {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 600;
}

/* 完了メッセージ */
.completed-message {
    background: linear-gradient(135deg, var(--success-green), var(--light-green));
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.completed-message h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.completed-message p {
    opacity: 0.9;
}

/* フィルタリング */
.task-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid var(--border-gray);
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.filter-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.filter-btn span {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.8;
}

/* タスクコンテナ */
.tasks-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tasks-header {
    background: var(--light-gray);
    padding: 20px;
    border-bottom: 1px solid var(--border-gray);
}

.tasks-header h2 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.tasks-subtitle {
    margin: 5px 0 0 0;
    color: var(--text-gray);
    font-size: 14px;
}

/* タスクリスト */
.task-list {
    padding: 0;
}

.task-item {
    border-bottom: 1px solid var(--border-gray);
    padding: 20px;
    transition: all 0.3s;
    position: relative;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.task-item.completed {
    background: rgba(40, 167, 69, 0.05);
}

.task-item.issue {
    background: rgba(220, 53, 69, 0.05);
}

.task-item.completed.shared-task {
    border-left: 4px solid var(--success-green);
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05), transparent);
}

.task-item.completed:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.task-description {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.4;
}

.task-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-gray);
    align-items: center;
}

.task-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.task-status.pending {
    background: #fff3cd;
    color: #856404;
}

.task-status.completed {
    background: #d4edda;
    color: #155724;
}

/* 評価ボタン */
.rating-section {
    margin-top: 15px;
}

.rating-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.rating-btn {
    background: white;
    border: 2px solid var(--border-gray);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-btn:hover {
    transform: translateY(-1px);
}

.rating-btn.excellent {
    border-color: var(--success-green);
}

.rating-btn.excellent:hover,
.rating-btn.excellent.selected {
    background: var(--success-green);
    color: white;
}

.rating-btn.good {
    border-color: var(--light-green);
}

.rating-btn.good:hover,
.rating-btn.good.selected {
    background: var(--light-green);
    color: white;
}

.rating-btn.fair {
    border-color: var(--warning-yellow);
}

.rating-btn.fair:hover,
.rating-btn.fair.selected {
    background: var(--warning-yellow);
    color: white;
}

.rating-btn.poor {
    border-color: var(--danger-red);
}

.rating-btn.poor:hover,
.rating-btn.poor.selected {
    background: var(--danger-red);
    color: white;
}

/* コメントセクション */
.comment-section {
    margin-top: 10px;
    display: none;
}

.comment-section.show {
    display: block;
}

.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-green);
}

.comment-textarea.required {
    border-color: var(--danger-red);
}

/* 送信セクション */
.submit-section {
    margin-top: 15px;
    display: none;
    gap: 10px;
}

.btn-submit {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: var(--secondary-green);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-cancel {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-cancel:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

/* =================================================================
   【新機能】共有タスク専用スタイル
   ================================================================= */

/* 共有タスク完了情報セクション */
.shared-task-completed {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08), rgba(50, 205, 50, 0.05));
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.completion-header {
    margin-bottom: 12px;
}

.completed-by {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--success-green);
    font-size: 14px;
}

.completed-by-icon {
    font-size: 16px;
}

.completed-by-text {
    flex: 1;
}

.completed-time {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: normal;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 12px;
}

.completion-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.completed-rating {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    align-self: flex-start;
}

.completed-rating.excellent {
    background: #d4edda;
    color: #155724;
}

.completed-rating.good {
    background: #e8f5e8;
    color: #2e7d32;
}

.completed-rating.fair {
    background: #fff3cd;
    color: #856404;
}

.completed-rating.poor {
    background: #f8d7da;
    color: #721c24;
}

.completed-comment {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--success-green);
}

.comment-icon {
    font-size: 14px;
    margin-top: 2px;
}

.comment-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

.shared-task-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.2);
    border-radius: 6px;
    font-size: 12px;
    color: var(--info-blue);
    font-weight: 500;
}

.notice-icon {
    font-size: 14px;
}

.notice-text {
    flex: 1;
}

/* フィルターボタンの強調 */
.filter-btn.completed .count {
    background: var(--success-green);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 4px;
}

/* タスク管理固有スタイル */
.task-info {
    display: flex;
    flex-direction: column;
}

.task-name {
    font-weight: 600;
    margin-bottom: 4px;
}

/* 通知スタイルの改善 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    font-weight: 600;
    max-width: 400px;
    white-space: pre-line;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background: var(--success-green);
    color: white;
}

.notification.error {
    background: var(--danger-red);
    color: white;
}

.notification.info {
    background: var(--info-blue);
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =================================================================
   レスポンシブ対応
   ================================================================= */

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .employee-header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .employee-main {
        padding: 15px;
    }
    
    .employee-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .task-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .rating-buttons {
        justify-content: center;
    }
    
    .submit-section {
        flex-direction: column;
    }
    
    .preset-btn {
        font-size: 14px;
        padding: 4px 6px;
        min-width: 28px;
        height: 28px;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .weekday-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .frequency-options {
        padding: 12px;
    }
    
    #weeklyOptions, #specificDatesOptions, #weekOfMonthOptions, #periodOfMonthOptions, #dateRangeOptions, #rainyDayOptions {
        padding: 15px;
        margin: 10px 0;
    }
    
    .task-type-options {
        padding: 12px;
        gap: 12px;
    }
    
    .task-type-options label {
        padding: 12px;
    }
    
    .task-type-options strong {
        font-size: 14px;
    }
    
    .task-type-options small {
        font-size: 12px;
    }
    
    .employee-task-type-indicator {
        position: static;
        margin-top: 8px;
        display: inline-block;
    }
    
    .task-type-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    /* テーブルの列を縮小 */
    #tasksTable th:nth-child(5),
    #tasksTable td:nth-child(5) {
        width: 80px;
        font-size: 10px;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    .employee-stats {
        grid-template-columns: 1fr;
    }
    
    .rating-buttons {
        grid-template-columns: repeat(2, 1fr);
        display: grid;
        gap: 8px;
    }
    
    .nav-content {
        gap: 15px;
    }
    
    .nav-item {
        font-size: 12px;
    }
    
    .weekday-grid {
        grid-template-columns: 1fr;
    }
    
    .weekday-grid label {
        padding: 8px 10px;
    }
    
    .date-input-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .date-input-row input[type="date"] {
        margin-right: 0;
        width: 100%;
    }
    
    .task-type-options {
        gap: 10px;
    }
    
    .task-type-options label {
        padding: 10px;
    }
}

/* =================================================================
   ローディング状態・エラー・空状態
   ================================================================= */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: var(--text-gray);
}

.loading::before {
    content: '⏳';
    margin-right: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
}

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 15px;
}

/* =================================================================
   【新機能】ドラッグ&ドロップ視覚的フィードバック
   ================================================================= */

/**
 * 【教育的解説】ドラッグ&ドロップのUX設計思想
 * 
 * 優れたドラッグ&ドロップ体験には、以下の視覚的要素が必要です：
 * 
 * 1. 【アフォーダンス】：ドラッグできることを示すハンドル
 * 2. 【状態フィードバック】：ドラッグ中の明確な視覚的変化
 * 3. 【挿入指示】：ドロップ位置の明確な表示
 * 4. 【エラー防止】：無効な操作の抑制
 * 5. 【滑らかな遷移】：操作の連続性を保つアニメーション
 */

/* ドラッグハンドルの基本スタイル */
.drag-handle {
    width: 30px;
    text-align: center;
    cursor: grab;
    user-select: none;
    padding: 8px 4px;
    vertical-align: middle;
    position: relative;
}

.drag-handle:hover {
    background-color: rgba(46, 139, 87, 0.1);
}

.drag-handle:active {
    cursor: grabbing;
}

/* ドラッグアイコンのスタイル */
.drag-icon {
    color: #666;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.2s ease;
    line-height: 1;
    user-select: none;
}

.drag-handle:hover .drag-icon {
    color: var(--primary-green);
}

/* ドラッグ可能な行の基本設定 */
.draggable-task {
    cursor: move;
    transition: all 0.2s ease;
    background-color: white;
}

.draggable-task:hover {
    background-color: rgba(46, 139, 87, 0.02);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 【重要】ドラッグ中の状態スタイル */
.draggable-task.dragging {
    opacity: 0.6;
    background-color: rgba(46, 139, 87, 0.1);
    border: 2px dashed var(--primary-green);
    transform: rotate(1deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    position: relative;
}

/* ドラッグ中はホバー効果を無効化 */
.draggable-task.dragging:hover {
    transform: rotate(1deg); /* ホバーの transform を上書き */
}

/* 【視覚的フィードバック】挿入位置の表示 */
.draggable-task.drag-over-top {
    border-top: 3px solid var(--primary-green);
    box-shadow: 0 -2px 0 rgba(46, 139, 87, 0.3);
}

.draggable-task.drag-over-bottom {
    border-bottom: 3px solid var(--primary-green);
    box-shadow: 0 2px 0 rgba(46, 139, 87, 0.3);
}

/* ドラッグプレースホルダーのスタイル */
.drag-placeholder {
    background: linear-gradient(45deg, 
        rgba(46, 139, 87, 0.1) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(46, 139, 87, 0.1) 50%, 
        rgba(46, 139, 87, 0.1) 75%, 
        transparent 75%);
    background-size: 20px 20px;
    height: 50px;
    border: 2px dashed var(--primary-green);
    opacity: 0.8;
    animation: pulse 1.5s ease-in-out infinite;
}

.placeholder-content {
    text-align: center;
    padding: 15px;
    color: var(--primary-green);
    font-weight: 600;
    font-size: 14px;
}

/* プレースホルダーのアニメーション */
@keyframes pulse {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.9; 
        transform: scale(1.02);
    }
}

/* 【アクセシビリティ】タブレット・モバイル対応 */
@media (max-width: 768px) {
    .drag-handle {
        width: 40px;
        padding: 12px 6px;
    }
    
    .drag-icon {
        font-size: 16px;
    }
    
    /* タッチデバイスでのドラッグ操作を改善 */
    .draggable-task {
        touch-action: none;
    }
    
    .draggable-task.dragging {
        transform: rotate(0deg) scale(1.05);
    }
    
    /* タッチ操作時のフィードバックを強化 */
    .draggable-task.drag-over-top,
    .draggable-task.drag-over-bottom {
        border-width: 4px;
    }
}

/* 【パフォーマンス最適化】GPU加速の活用 */
.draggable-task.dragging,
.drag-placeholder {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* ドラッグ操作中は選択を無効化 */
.dragging-active {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 【詳細な状態表示】ドラッグ可能性の視覚的ヒント */
.drag-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(46, 139, 87, 0.05);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.drag-handle:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

/* ドラッグ中のカーソル表示 */
.dragging-cursor {
    cursor: grabbing !important;
}

.dragging-cursor * {
    cursor: grabbing !important;
}

/* 【エラー状態】無効なドロップゾーンの表示 */
.invalid-drop-zone {
    background-color: rgba(220, 53, 69, 0.1);
    border: 2px dashed #dc3545;
    color: #dc3545;
}

.invalid-drop-zone .placeholder-content {
    color: #dc3545;
}

.invalid-drop-zone .placeholder-content::before {
    content: '⚠️ ';
}

/* 【成功フィードバック】順序変更完了の表示 */
.order-update-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid var(--success-green);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { 
        background-color: rgba(40, 167, 69, 0.2);
        transform: scale(1);
    }
    50% { 
        background-color: rgba(40, 167, 69, 0.3);
        transform: scale(1.01);
    }
    100% { 
        background-color: rgba(40, 167, 69, 0.1);
        transform: scale(1);
    }
}


/* ドラッグハンドル列のヘッダーテキスト */
.drag-header-text {
    font-size: 12px;
    color: #666;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* 【アクセシビリティ】高コントラストモード対応 */
@media (prefers-contrast: high) {
    .drag-handle {
        border: 1px solid #333;
    }
    
    .draggable-task.dragging {
        border-color: #000;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .drag-over-top,
    .drag-over-bottom {
        border-color: #000 !important;
    }
}

/* 【アクセシビリティ】アニメーション削減設定 */
@media (prefers-reduced-motion: reduce) {
    .draggable-task,
    .drag-placeholder,
    .drag-handle,
    .drag-icon {
        transition: none;
        animation: none;
    }
    
    .draggable-task.dragging {
        transform: none;
    }
    
    .order-update-success {
        animation: none;
    }
}

/* =================================================================
   タスクテーブルの新レイアウト
   ================================================================= */

/* 順序セル（ドラッグハンドル） */
.drag-handle {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    padding: 8px 4px !important;
    text-align: center;
    overflow: hidden;
}

/* タスク名セル */
.task-name-cell {
    font-weight: 600;
}

/* タスク説明セル（折り返し対応） */
.task-description-cell {
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal !important;
    overflow-wrap: break-word;
    hyphens: auto;
    text-align: left !important;
    position: relative;
}

/* ホバー時にz-indexを上げる */
.task-description-cell:hover {
    z-index: 10000;
}

/* ホバーしている行全体のz-indexも上げる */
.data-table tr:hover {
    position: relative;
    z-index: 1000;
}

.task-description {
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.4;
    padding: 4px 0;
}

/* 省略された説明のスタイル */
.task-description-truncated {
    cursor: help;
    position: relative;
}

/* ツールチップのスタイル */
.task-description-tooltip {
    display: none;
    position: absolute;
    z-index: 9999;
    background-color: rgba(33, 33, 33, 1);
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    line-height: 1.5;
    max-width: 400px;
    width: max-content;
    white-space: pre-wrap;
    word-wrap: break-word;
    top: 100%;
    left: 0;
    margin-top: 5px;
    opacity: 1;
}

/* 下から3行目以降は上に表示 */
#tasksTable tbody tr:nth-last-child(-n+3) .task-description-tooltip {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 5px;
}

/* ツールチップの矢印 */
.task-description-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(33, 33, 33, 1) transparent;
}

/* 下から3行目以降の矢印は下向きに */
#tasksTable tbody tr:nth-last-child(-n+3) .task-description-tooltip::before {
    bottom: auto;
    top: 100%;
    border-color: rgba(33, 33, 33, 1) transparent transparent transparent;
}

/* ホバー時の表示 */
.task-description-cell:hover .task-description-tooltip {
    display: block;
}

/* 2段表示セル */
.two-line-cell {
    padding: 8px 12px !important;
}

.cell-line {
    padding: 4px 0;
}

.cell-line:first-child {
    border-bottom: 1px dotted var(--border-gray);
    margin-bottom: 4px;
    padding-bottom: 6px;
}

/* 実行場所/担当部署統合列のスタイル */
.location-department {
    text-align: center;
    vertical-align: middle;
    min-width: 140px;
}

.location-department .cell-line {
    font-size: 13px;
    line-height: 1.3;
}

.location-department .cell-line:first-child {
    font-weight: 600;
    color: var(--primary-green);
}

.location-department .cell-line:last-child {
    color: #666;
    font-size: 12px;
}

/* 頻度/種別セルのスタイル */
.two-line-cell .task-type-badge {
    font-size: 11px;
    padding: 3px 8px;
    display: inline-block;
}

/* 状態/操作セルのスタイル */
.two-line-cell .action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.two-line-cell .btn-small {
    font-size: 12px;
    padding: 4px 8px;
}

/* テーブル全体の調整 */
#tasksTable {
    width: 100%;
}

#tasksTable th,
#tasksTable td {
    vertical-align: middle;
}

/* 順序列のみ最小幅に固定 */
#tasksTable th:nth-child(1),
#tasksTable td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

/* 実行場所列（5列目）の折り返し設定 */
#tasksTable th:nth-child(5),
#tasksTable td:nth-child(5) {
    width: 100px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .task-description-cell {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .task-description-cell {
        max-width: 150px;
    }
    
    .task-name-cell {
        min-width: 100px;
    }
    
    /* ツールチップの位置調整 */
    .task-description-tooltip {
        left: auto;
        right: 0;
        max-width: 300px;
    }
    
    .task-description-tooltip::before {
        left: auto;
        right: 20px;
    }
}

/* =================================================================
   ユーザー一括登録モーダルのスタイル
   ================================================================= */

/* ヘッダーボタン配置 */
.header-buttons {
    display: flex;
    gap: 10px;
}

/* セカンダリボタンスタイル */
.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #545b62;
}

/* 一括登録モーダルの情報セクション */
.bulk-upload-info {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bulk-upload-info h4,
.bulk-upload-info h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.csv-format {
    background: #f8f9fa;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.csv-format code {
    font-family: 'Courier New', monospace;
    color: var(--primary-green);
    font-weight: 600;
}

.format-example {
    margin: 15px 0;
}

.format-example pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.4;
}

.format-notes ul {
    margin: 10px 0 0 20px;
    color: var(--text-gray);
}

.format-notes li {
    margin: 5px 0;
    font-size: 14px;
}

/* アップロード進捗バー */
.upload-progress {
    margin: 20px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), var(--light-green));
    transition: width 0.3s ease-out;
}

.progress-text {
    color: var(--text-gray);
    font-size: 14px;
}


/* ファイル入力のスタイル */
input[type="file"] {
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: var(--light-gray);
    transition: border-color 0.3s;
}

input[type="file"]:hover {
    border-color: var(--primary-green);
}

input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-green);
    background: rgba(46, 139, 87, 0.05);
}

/* =================================================================
   ドラッグ&ドロップ機能用スタイル
   ================================================================= */

/* ドラッグ中の視覚効果 */
.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.dragging-active {
    cursor: grabbing !important;
}

/* ドロップターゲット効果 */
.drag-over-top {
    border-top: 3px solid var(--primary-green) !important;
    background: rgba(46, 139, 87, 0.05) !important;
}

.drag-over-bottom {
    border-bottom: 3px solid var(--primary-green) !important;
    background: rgba(46, 139, 87, 0.05) !important;
}

/* ドラッグ可能な行のスタイル */
.draggable-user,
.draggable-department,
.draggable-location,
.draggable-task {
    transition: all 0.2s ease;
}

.draggable-user:hover,
.draggable-department:hover,
.draggable-location:hover,
.draggable-task:hover {
    background: rgba(46, 139, 87, 0.02);
}

/* ドラッグハンドルのアクティブ状態 */
.data-table .drag-handle:hover {
    background: rgba(46, 139, 87, 0.1);
}

/* =================================================================
   既存のスタイルシート（変更なし）
   ================================================================= */