/* カラーパレット（全CSSファイル共通） */
:root {
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-text: #2d3748;
    --color-text-secondary: #4a5568;
    --color-text-muted: #718096;
    --color-text-strong: #1a202c;
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e0;
    --color-bg: #f5f7fa;
    --color-bg-light: #f7fafc;
    --color-bg-subtle: #edf2f7;
    --color-danger: #e53e3e;
    --color-danger-strong: #dc2626;
    --color-success: #48bb78;
    --color-success-alt: #10b981;
    --color-warning: #f59e0b;
    --color-muted: #a0aec0;
}

/* リセット＆基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* グローバル select & option スタイル */
select {
    background: white;
    color: var(--color-text-strong);
}

select option {
    background: white !important;
    color: var(--color-text-strong) !important;
    padding: 8px;
}

select option:hover,
select option:focus {
    background: #EBF4FF !important;
    color: var(--color-text-strong) !important;
}

select option:checked {
    background: var(--color-primary) !important;
    color: white !important;
    font-weight: 600;
}

/* ヘッダー */
.header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 1.2rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo i {
    font-size: 1.8rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav button.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
}

.user-info i {
    font-size: 1.3rem;
}

.user-selector {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-selector:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-selector:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.admin-badge-header {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--color-text-strong);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6); }
}

/* メインコンテンツ */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* 期限切れアラート */
.overdue-alert {
    background: #FEE2E2;
    border: 2px solid var(--color-danger-strong);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    color: #991B1B;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.overdue-alert i {
    font-size: 1.5rem;
    color: var(--color-danger-strong);
}

.overdue-alert strong {
    font-weight: 700;
}

/* AI営業アラート */
.ai-sales-alert {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: 2px solid #5a67d8;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-sales-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.ai-sales-alert i {
    font-size: 1.5rem;
    color: #FCD34D;
    animation: pulse-icon 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.ai-sales-alert strong {
    font-weight: 700;
    z-index: 1;
}

.ai-sales-alert .alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 1;
    flex: 1;
}

.ai-sales-alert .alert-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.ai-sales-alert .alert-description {
    font-size: 0.95rem;
    opacity: 0.95;
}

.ai-sales-alert .view-details-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    z-index: 1;
    white-space: nowrap;
}

.ai-sales-alert .view-details-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* 営業フラグアラート */
.sales-flag-alert {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6efff 100%);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-strong);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
    transition: all 0.3s;
}

.sales-flag-alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.sales-flag-alert.priority-高 {
    border-color: var(--color-danger-strong);
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
}

.sales-flag-alert.priority-中 {
    border-color: var(--color-warning);
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

.sales-flag-alert.priority-低 {
    border-color: var(--color-success-alt);
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.sales-flag-alert i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.sales-flag-alert.priority-高 i {
    color: var(--color-danger-strong);
}

.sales-flag-alert.priority-中 i {
    color: var(--color-warning);
}

.sales-flag-alert.priority-低 i {
    color: var(--color-success-alt);
}

.sales-flag-alert .alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.sales-flag-alert .alert-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text-strong);
}

.sales-flag-alert .alert-description {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.sales-flag-alert .alert-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.sales-flag-alert .view-details-btn {
    background: var(--color-primary);
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    white-space: nowrap;
}

.sales-flag-alert .view-details-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}


.main-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

/* サマリーカード */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    gap: 1.2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

/* 達成時のカードエフェクト */
.card-achievement {
    position: relative;
    background: #FFFFFF; /* 白背景 */
    border: 2px solid var(--color-warning); /* ゴールドの枠線 */
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}

/* 達成バッジ（回転する星） */
.achievement-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--color-warning) 0%, #D97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    animation: badge-spin 3s linear infinite;
    z-index: 10;
}

@keyframes badge-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 達成時のタイポグラフィ */
.card-achievement .card-content h3 {
    color: #78716C; /* ウォームグレー */
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.card-achievement .card-content .value {
    color: #1C1917; /* ダークグレー */
    font-weight: 700;
    font-size: 2.25rem;
    line-height: 1;
    margin: 0.5rem 0;
}

.card-achievement .subtitle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-danger-strong); /* 鮮やかな赤 */
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.25rem 0.75rem;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 20px;
    margin-top: 0.5rem;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.card-icon.blue { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); }
.card-icon.green { background: linear-gradient(135deg, #56CCF2 0%, #2F80ED 100%); }
.card-icon.orange { background: linear-gradient(135deg, #F2994A 0%, #F2C94C 100%); }
.card-icon.purple { background: linear-gradient(135deg, #A8C0FF 0%, #3F2B96 100%); }

.card-content h3 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card-content .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.3rem;
}

.card-content .subtitle {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.revenue-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.revenue-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.growth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.growth-badge.positive {
    background: #dcfce7;
    color: #15803d;
}

.growth-badge.negative {
    background: #fee2e2;
    color: var(--color-danger-strong);
}

.change {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.change.positive {
    background: #e6fffa;
    color: #00a896;
}

.change.negative {
    background: #fff5f5;
    color: var(--color-danger);
}

/* グラフエリア */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* フルワイドチャートカード */
.chart-card-full {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    width: 100%;
}

.chart-card-full h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ガントチャート */
.gantt-chart-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.gantt-chart-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gantt-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn-gantt-nav {
    background: white;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-gantt-nav:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.gantt-week-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    min-width: 150px;
    text-align: center;
}

.gantt-chart-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 2px solid var(--color-border);
}

.gantt-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.gantt-table thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.gantt-task-header {
    width: 250px;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.gantt-day-header {
    padding: 0.8rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
}

.gantt-day-header.today {
    background: rgba(255, 215, 0, 0.3);
}

.day-label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.day-date {
    font-size: 0.95rem;
}

.day-weekday {
    font-size: 0.8rem;
    opacity: 0.9;
}

.gantt-task-row {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s ease;
}

.gantt-task-row:hover {
    background: var(--color-bg-light);
}

.gantt-task-row.completed {
    opacity: 0.7;
}

.gantt-task-cell {
    padding: 1rem;
    border-right: 2px solid var(--color-border);
    background: #fafafa;
}

.gantt-task-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.gantt-task-name {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.gantt-task-type {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 500;
}

.gantt-task-detail {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.gantt-task-person {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.gantt-day-cell {
    padding: 0.5rem;
    text-align: center;
    border-right: 1px solid var(--color-border);
    position: relative;
}

.gantt-day-cell.today {
    background: rgba(255, 215, 0, 0.1);
}

.gantt-tasks-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    min-height: 30px;
}

.gantt-client-name {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.gantt-client-status {
    margin-top: 0.3rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}

.status-badge.overdue {
    background: rgba(229, 62, 62, 0.15);
    color: var(--color-danger);
}

.status-badge.completed {
    background: rgba(160, 174, 192, 0.15);
    color: var(--color-text-muted);
}

.status-badge.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--color-primary);
}

.gantt-bar {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    display: inline-block;
    min-width: 20px;
    height: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.gantt-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* カテゴリー別の色分け */
.gantt-bar.category-決済事業 {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.gantt-bar.category-広告事業 {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}

.gantt-bar.category-その他 {
    background: linear-gradient(135deg, var(--color-success) 0%, #38a169 100%);
}

/* 状態による上書き */
.gantt-bar.overdue {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c53030 100%) !important;
    animation: pulse-red 2s ease-in-out infinite;
}

.gantt-bar.completed {
    background: linear-gradient(135deg, var(--color-muted) 0%, var(--color-text-muted) 100%) !important;
    opacity: 0.7;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.gantt-bar-label {
    white-space: nowrap;
}

.gantt-no-tasks {
    padding: 3rem;
    text-align: center;
    color: var(--color-muted);
}

.gantt-no-tasks i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.gantt-no-tasks p {
    font-size: 1rem;
}

.gantt-legend {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--color-border);
    flex-wrap: wrap;
}

.legend-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legend-section strong {
    color: var(--color-text);
    margin-right: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.category-payment {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.legend-color.category-ad {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
}

.legend-color.category-other {
    background: linear-gradient(135deg, var(--color-success) 0%, #38a169 100%);
}

.legend-color.overdue {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c53030 100%);
}

.legend-color.completed {
    background: linear-gradient(135deg, var(--color-muted) 0%, var(--color-text-muted) 100%);
}

.legend-color.today {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.legend-color.today {
    background: rgba(255, 215, 0, 0.5);
    border: 2px solid #FFD700;
}

/* アラートセクション */
.alerts-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.alerts-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff5f5;
    border-left: 4px solid #f56565;
    border-radius: 8px;
}

.alert-item i {
    color: #f56565;
    font-size: 1.3rem;
}

.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.alert-content strong {
    font-size: 1rem;
    color: var(--color-text);
}

.alert-content span {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.alert-badge {
    background: var(--color-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 案件管理ビュー */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: white;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.month-selector label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-input {
    padding: 0.5rem 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.month-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* 月ナビゲーション */
.month-nav-btn {
    background: white;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-nav-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.month-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: white;
    border-radius: 8px;
}

.month-select {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.2rem;
}

.month-select:focus {
    outline: none;
}

.month-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    min-width: 100px;
    text-align: center;
}

.month-input-calendar {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* 営業メンバー管理 */
.member-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.member-tag .remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    padding: 0;
}

.member-tag .remove-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

/* フィルター */
.filters {
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ユーザー管理 */
.users-table-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.users-table th {
    background: var(--color-bg-light);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.user-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
}

.user-name-input {
    padding: 0.5rem;
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    font-size: 1rem;
    width: 200px;
}

.user-name-input:focus {
    outline: none;
    border-color: var(--color-primary-dark);
}

/* トグルスイッチ */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 1rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-border-dark);
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: var(--color-text-strong);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-management-info {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--color-primary);
}

.user-management-info h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-management-info ul {
    list-style: disc;
    margin-left: 1.5rem;
}

.user-management-info li {
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.filter-select {
    padding: 0.7rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select option {
    background: white !important;
    color: var(--color-text-strong) !important;
    padding: 8px;
}

.filter-select option:hover,
.filter-select option:focus {
    background: #EBF4FF !important;
    color: var(--color-text-strong) !important;
}

.filter-select option:checked {
    background: var(--color-primary) !important;
    color: white !important;
    font-weight: 600;
}

.filter-select option:active {
    background: #EBF4FF !important;
    color: var(--color-text-strong) !important;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* テーブル */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.deals-table, .goals-table {
    width: 100%;
    border-collapse: collapse;
}

.deals-table thead, .goals-table thead {
    background: var(--color-bg-light);
}

.deals-table th, .goals-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.deals-table th:hover, .goals-table th:hover {
    background: var(--color-bg-subtle);
}

.deals-table th i {
    margin-left: 0.3rem;
    color: var(--color-muted);
}

.deals-table td, .goals-table td {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.deals-table tbody tr:hover, .goals-table tbody tr:hover {
    background: var(--color-bg-light);
}

/* バッジ */
.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-決済事業 {
    background: #e6fffa;
    color: #00a896;
}

.badge-広告事業 {
    background: #fef5e7;
    color: #f39c12;
}

.badge-その他 {
    background: #f4f4f9;
    color: #6c757d;
}

.status-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-新規 { background: #e0f2fe; color: #0369a1; }
.status-ヒアリング { background: #fef3c7; color: #b45309; }
.status-アポ { background: #dbeafe; color: #1e40af; }
.status-提案 { background: #e0e7ff; color: #4338ca; }
.status-資料 { background: #fbcfe8; color: #be185d; }
.status-契約 { background: #fef08a; color: #a16207; }
.status-受注 { background: #dcfce7; color: #15803d; }
.status-失注 { background: #fee2e2; color: var(--color-danger-strong); }

.probability-badge {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.prob-高 {
    background: #dcfce7;
    color: #15803d;
}

.prob-中 {
    background: #fef08a;
    color: #a16207;
}

.prob-低 {
    background: #fee2e2;
    color: var(--color-danger-strong);
}

/* 案件リンク */
.deal-link {
    color: var(--color-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.deal-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.deal-link i {
    font-size: 0.8rem;
}

/* ボタン */
.btn-primary, .btn-secondary {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text-secondary);
}

.btn-secondary:hover {
    background: var(--color-border-dark);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--color-primary);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--color-bg-light);
}

.btn-icon.danger {
    color: var(--color-danger);
}

.btn-icon.danger:hover {
    background: #fff5f5;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-muted);
    cursor: pointer;
    padding: 0.3rem;
    transition: color 0.3s ease;
}

.btn-close:hover {
    color: var(--color-text-secondary);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* フォーム */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--color-danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.7rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group textarea {
    resize: vertical;
}

/* チェックボックスグリッド（提案商材用） */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: var(--color-bg-light);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.checkbox-label:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-border-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"]:checked + span,
.checkbox-label:has(input[type="checkbox"]:checked) {
    background: #e6f3ff;
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

/* AIチャット機能 */
.input-with-ai {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-with-ai input,
.input-with-ai textarea {
    flex: 1;
}

.btn-ai-chat {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-ai-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-ai-inline {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-ai-inline:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-chat-modal {
    max-width: 600px;
    width: 90%;
}

.ai-chat-intro {
    background: var(--color-bg-light);
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-primary);
}

.ai-chat-intro p {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.ai-examples {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.ai-examples strong {
    color: var(--color-text);
}

.ai-examples ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.ai-examples li {
    margin: 0.3rem 0;
}

.btn-ai-submit {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-ai-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-suggestion-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e6f3ff 0%, #f0e6ff 100%);
    border-radius: 12px;
    border: 2px solid var(--color-primary);
}

.ai-suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.ai-suggestion-content {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text);
}

.btn-use-suggestion {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
}

.ai-error-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff5f5;
    border: 2px solid var(--color-danger);
    border-radius: 8px;
    color: var(--color-danger);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 目標設定 */
.goals-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.goals-list {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.goals-list h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

/* CSV管理 */
.csv-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.csv-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.csv-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.csv-card p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.csv-info {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.csv-info h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.info-content h4 {
    font-size: 1rem;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.info-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-content li {
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
}

.info-content p {
    color: var(--color-text-muted);
    margin-bottom: 0.8rem;
}

/* 販売者管理 */
.sellers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.seller-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.seller-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.seller-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-bg-light);
}

.seller-header h3 {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 0.3rem;
}

.seller-header .company {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.seller-status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-アクティブ {
    background: #dcfce7;
    color: #15803d;
}

.status-休止中 {
    background: #fef08a;
    color: #a16207;
}

.status-解約 {
    background: #fee2e2;
    color: var(--color-danger-strong);
}

.seller-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: var(--color-bg-light);
    border-radius: 8px;
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.stat-item div {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.seller-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.seller-footer i {
    margin-right: 0.3rem;
}

/* 販売者ダッシュボード */
.seller-dashboard {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-back {
    background: var(--color-border);
    color: var(--color-text-secondary);
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--color-border-dark);
}

.seller-title h2 {
    font-size: 1.8rem;
    color: var(--color-text);
    margin-bottom: 0.3rem;
}

.seller-title p {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* 知識ベース管理 */
.knowledge-intro {
    background: linear-gradient(135deg, #e6f3ff 0%, #f0e6ff 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--color-primary);
}

.knowledge-intro p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.knowledge-form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.textarea-with-voice {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.textarea-with-voice textarea,
.textarea-with-voice input {
    flex: 1;
}

.btn-voice {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-voice:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-voice.recording {
    background: linear-gradient(135deg, var(--color-success) 0%, #38a169 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.btn-voice-small {
    padding: 0.6rem;
    min-width: 50px;
    justify-content: center;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.checkbox-label-simple {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.checkbox-label-simple input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.knowledge-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: white;
    border: 2px solid var(--color-border);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-color: var(--color-primary);
}

.knowledge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.knowledge-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.knowledge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-color: var(--color-primary);
}

.knowledge-card.inactive {
    opacity: 0.6;
    background: var(--color-bg-light);
}

.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.knowledge-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.knowledge-category {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.knowledge-priority {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.priority-5 {
    background: #fed7d7;
    color: #c53030;
}

.priority-4 {
    background: #feebc8;
    color: #c05621;
}

.priority-3 {
    background: #fefcbf;
    color: #744210;
}

.priority-2 {
    background: #c6f6d5;
    color: #22543d;
}

.priority-1 {
    background: var(--color-border);
    color: var(--color-text-secondary);
}

.knowledge-status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.knowledge-status-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

.knowledge-status-badge.inactive {
    background: var(--color-border);
    color: var(--color-text-muted);
}

.knowledge-actions {
    display: flex;
    gap: 0.5rem;
}

.knowledge-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.8rem 0;
}

.knowledge-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.knowledge-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 1rem;
}

.knowledge-keywords i {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.keyword-tag {
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.knowledge-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.no-data-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--color-muted);
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.no-data-message p {
    font-size: 1.1rem;
}

/* AIアシスタント対話モード */
.knowledge-mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.mode-btn {
    flex: 1;
    background: white;
    border: 2px solid var(--color-border);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border-color: var(--color-primary);
}

.ai-assistant-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.ai-assistant-header {
    margin-bottom: 1.5rem;
}

.ai-assistant-header h3 {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-assistant-header p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* AIアシスタント設定エリア */
.ai-assistant-settings {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ai-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-setting-group label {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-category-select {
    padding: 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.ai-category-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.attachment-controls {
    display: flex;
    gap: 0.5rem;
}

.url-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-attach-file {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-attach-file:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.attached-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.attached-file-item {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 2px solid var(--color-border);
}

.attached-file-item i {
    color: var(--color-primary);
    font-size: 1.2rem;
}

.file-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 500;
}

.file-size {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.btn-remove-file {
    background: #fff5f5;
    color: var(--color-danger);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-file:hover {
    background: var(--color-danger);
    color: white;
}

.reference-url-display {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 2px solid var(--color-border);
    margin-top: 0.5rem;
}

.reference-url-display i {
    color: var(--color-primary);
}

.reference-url-display a {
    flex: 1;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reference-url-display a:hover {
    text-decoration: underline;
}

.btn-remove-url {
    background: #fff5f5;
    color: var(--color-danger);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-url:hover {
    background: var(--color-danger);
    color: white;
}

/* メッセージ編集 */
.message-edit {
    width: 100%;
}

.message-edit-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

.message-edit-textarea:focus {
    outline: none;
    border-color: var(--color-primary-dark);
}

.message-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-save-edit,
.btn-cancel-edit {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-save-edit {
    background: linear-gradient(135deg, var(--color-success) 0%, #38a169 100%);
    color: white;
}

.btn-save-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.btn-cancel-edit {
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
}

.btn-cancel-edit:hover {
    background: var(--color-border);
}

.btn-edit-message {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.btn-edit-message:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

.ai-conversation {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.conversation-start {
    text-align: center;
    padding: 3rem;
    color: var(--color-muted);
}

.conversation-start i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.conversation-start p {
    font-size: 1.1rem;
}

.conversation-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.conversation-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.conversation-message.user .message-avatar {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.conversation-message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--color-success) 0%, #38a169 100%);
    color: white;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.conversation-message.user .message-content {
    text-align: right;
}

.message-text {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    line-height: 1.6;
    white-space: pre-wrap;
}

.conversation-message.user .message-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.message-time {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.3rem;
}

.ai-voice-control {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-voice-large {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-voice-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
}

.btn-voice-large.recording {
    background: linear-gradient(135deg, var(--color-success) 0%, #38a169 100%);
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-confirm-knowledge {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-confirm-knowledge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-reset-conversation {
    background: white;
    color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-reset-conversation:hover {
    border-color: var(--color-border-dark);
    background: var(--color-bg-light);
}

.ai-suggested-knowledge {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e6f3ff 0%, #f0e6ff 100%);
    border-radius: 12px;
    border: 2px solid var(--color-primary);
}

.ai-suggested-knowledge h4 {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggested-knowledge-preview {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
}

.preview-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.preview-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.preview-item strong {
    display: block;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.preview-item pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    color: var(--color-text);
    line-height: 1.6;
}

/* 販売者情報セクション */
.seller-info-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.info-header i {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.info-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.info-content {
    padding-top: 0.5rem;
}

.last-action-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.no-data {
    color: var(--color-muted);
    font-style: italic;
    margin: 0;
}

/* タスク一覧 */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--color-bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    transition: all 0.2s ease;
}

.task-item:hover {
    background: var(--color-bg-subtle);
    transform: translateX(4px);
}

.task-item.overdue {
    border-left-color: var(--color-danger);
    background: #fff5f5;
}

.task-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.task-name {
    font-weight: 600;
    color: var(--color-text);
}

.task-business {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.task-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.task-date i {
    color: var(--color-primary);
}

.overdue-badge {
    background: var(--color-danger);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 商品テーブル */
.products-section, .activities-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

/* 提案商材タグ */
.proposed-products-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.proposed-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.text-muted {
    color: var(--color-muted);
    font-style: italic;
}

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

.section-header h3 {
    font-size: 1.2rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: var(--color-bg-light);
}

.products-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.products-table td {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.products-table tbody tr:hover {
    background: var(--color-bg-light);
}

.product-status {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.prod-提案予定 {
    background: #f3f4f6;
    color: #6b7280;
}

.prod-提案中 {
    background: #dbeafe;
    color: #1e40af;
}

.prod-受注 {
    background: #dcfce7;
    color: #15803d;
}

.prod-失注 {
    background: #fee2e2;
    color: var(--color-danger-strong);
}

.prod-終了 {
    background: #e5e7eb;
    color: #4b5563;
}

/* チャット形式の活動履歴 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--color-bg-light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.chat-message {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.message-type {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.contact-badge {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

.type-商談 { background: #e0e7ff; color: #4338ca; }
.type-電話 { background: #dbeafe; color: #1e40af; }
.type-メール { background: #fef3c7; color: #b45309; }
.type-訪問 { background: #dcfce7; color: #15803d; }
.type-その他 { background: #f4f4f9; color: #6c757d; }

.message-meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.message-content {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
}

.chat-input-area {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.activity-type-select {
    padding: 0.7rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    min-width: 120px;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-send {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-send:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

/* 達成お祝いエフェクト */
.chart-achievement {
    position: relative;
}

.achievement-celebration {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #7c4700;
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    animation: celebration 2s ease-in-out infinite;
}

.achievement-celebration i {
    font-size: 1.3rem;
    animation: trophy-bounce 1s ease-in-out infinite;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* クライアント別グループ表示 */
.deals-grouped {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.client-group {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.client-group:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.client-group-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 1.5rem;
}

.client-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.deal-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.client-summary {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    opacity: 0.95;
}

.client-summary span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.deals-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.deal-item {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.deal-item:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.deal-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.deal-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.deal-amounts {
    display: flex;
    gap: 1.5rem;
}

.amount-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.amount-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
}

.amount-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.deal-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--color-border);
}

.deal-info {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.info-item i {
    color: var(--color-primary);
}

.deal-actions {
    display: flex;
    gap: 0.5rem;
}

/* 新しいグリッドレイアウト */
.section-title {
    margin: 3rem 0 1.5rem 0;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.charts-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 連絡方法バッジ */
.contact-method-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e0e7ff;
    color: #3730a3;
    margin-left: 0.5rem;
}

/* 案件URLリンク */
.deal-url-link {
    color: #4f46e5;
    text-decoration: none;
    word-break: break-all;
}

.deal-url-link:hover {
    text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav {
        width: 100%;
        flex-direction: column;
    }
    
    .nav button {
        width: 100%;
        justify-content: center;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .admin-badge-header {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .overdue-alert {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }
    
    .overdue-alert i {
        font-size: 1.2rem;
    }
    
    .month-selector {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .month-nav-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .month-display {
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid-3col {
        grid-template-columns: 1fr;
    }
    
    .charts-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    .user-selector {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .csv-sections {
        grid-template-columns: 1fr;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .gantt-chart-container {
        overflow-x: scroll;
    }
    
    .gantt-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-gantt-nav {
        width: 100%;
        justify-content: center;
    }
    
    .gantt-task-cell {
        min-width: 150px;
    }
    
    .gantt-client-name {
        font-size: 0.85rem;
    }
    
    .gantt-client-status {
        margin-top: 0.2rem;
    }
    
    .status-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }
    
    .gantt-bar {
        min-width: 15px;
        height: 20px;
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .gantt-tasks-container {
        gap: 2px;
    }
    
    .gantt-legend {
        flex-direction: column;
        gap: 1rem;
    }
    
    .legend-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ai-assistant-settings {
        padding: 1rem;
    }
    
    .attachment-controls {
        flex-direction: column;
    }
    
    .btn-attach-file {
        width: 100%;
        justify-content: center;
    }
    
    .knowledge-mode-selector {
        flex-direction: column;
    }
    
    .ai-conversation {
        min-height: 300px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .ai-voice-control {
        flex-direction: column;
    }
    
    .btn-voice-large,
    .btn-confirm-knowledge,
    .btn-reset-conversation {
        width: 100%;
        justify-content: center;
    }
    
    .knowledge-list {
        grid-template-columns: 1fr;
    }
    
    .textarea-with-voice {
        flex-direction: column;
    }
    
    .btn-voice,
    .btn-voice-small {
        width: 100%;
        justify-content: center;
    }
    
    .input-with-ai {
        flex-direction: column;
    }
    
    .btn-ai-chat,
    .btn-ai-inline {
        width: 100%;
        justify-content: center;
    }
    
    .seller-info-section {
        grid-template-columns: 1fr;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .task-date {
        align-self: flex-start;
    }

    /* モーダルを画面いっぱいに近づける */
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal,
    .modal.modal-large {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header,
    .modal-footer {
        padding: 1rem 1.2rem;
    }

    .modal-body {
        padding: 1.2rem;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer button {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    /* テーブルはスクロール前提でフォントを少し縮小 */
    .table-container table {
        font-size: 0.85rem;
    }
}

/* スマートフォン（小型端末） */
@media (max-width: 480px) {
    .header {
        padding: 0.8rem 1rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    main,
    .view-container {
        padding: 0.8rem;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .btn-large {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }

    .alert-settings-view {
        padding: 1rem;
    }
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
