/* ==========================================================================
   MAIN.CSS - Monerion メインスタイルシート
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8f8f8;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: relative;
    /* 設定ボタンの相対位置基準 */
}

h1 {
    color: #000000;
    margin-bottom: 30px;
    border-bottom: 3px solid #000000;
    padding-bottom: 10px;
    font-weight: 700;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #4F46E5;  /* Primary Accent - プライマリCTA */
    color: white;
}

.btn-primary:hover {
    background: #7C3AED;  /* Secondary Accent - ホバー状態 */
}

.btn-secondary {
    background: #8B5CF6;  /* Muted Accent - セカンダリアクション */
    color: white;
}

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

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 40px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}

.tables-container {
    margin-top: 30px;
}

/* タブボタン */
.tab-buttons {
    display: flex;
    align-items: flex-end;
    padding: 8px 8px 0 8px;
    margin-bottom: 0;
    min-height: 40px;
}

.tab-button {
    position: relative;
    padding: 8px 20px;
    margin-right: -1px;
    background: #c8ccd0;
    border: 1px solid #a8acb1;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    min-width: 120px;
    height: 32px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover:not(.active) {
    background: #d5d9dd;
}

.tab-button.active {
    background: white;
    border-color: #d2d2d2;
    z-index: 2;
    height: 35px;
    margin-top: -3px;
    color: #202124;
    font-weight: 500;
}

/* タブ追加ボタン（右端配置） */
.tab-add-buttons {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    height: 32px;
}

.tab-add-btn {
    padding: 6px 12px;
    border: 2px solid #000000;
    border-radius: 0;
    background: white;
    color: #000000;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    height: 28px;
    min-width: 80px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tab-add-btn:hover {
    background: #000000;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tab-add-btn.active {
    display: flex;
}

#addExpenseBtn {
    border-color: #ef4444;
    color: #ef4444;
}

#addExpenseBtn:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* タブコンテンツ */
.tab-content {
    background: white;
    border: 1px solid #d2d2d2;
    border-top: none;
    border-radius: 0 8px 8px 8px;
    position: relative;
    z-index: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.table-section {
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.table-header {
    background: #000000;
    color: white;
    padding: 8px;
    font-weight: bold;
    font-size: 16px;
}

.expense-header {
    background: #ef4444;
}

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

th {
    background: #f0f0f0;
    padding: 8px;
    text-align: left;
    font-size: 12px;
    border-bottom: 2px solid #ddd;
}

/* 売上テーブルのカラム幅調整 */
.table-section:first-child th:nth-child(1) {
    width: 7%;
}

/* 種別 */
.table-section:first-child th:nth-child(2) {
    width: 18%;
}

/* クライアント */
.table-section:first-child th:nth-child(3) {
    width: 12%;
}

/* 担当者 */
.table-section:first-child th:nth-child(4) {
    width: 12%;
}

/* 金額 */
.table-section:first-child th:nth-child(5) {
    width: 18%;
}

/* 期間 */
.table-section:first-child th:nth-child(6) {
    width: 8%;
}

/* 状態 */
.table-section:first-child th:nth-child(7) {
    width: 8%;
}

/* 確度 */
.table-section:first-child th:nth-child(8) {
    width: 17%;
}

/* 操作 */

.table-section:first-child td:nth-child(1) {
    width: 7%;
}

.table-section:first-child td:nth-child(2) {
    width: 18%;
}

.table-section:first-child td:nth-child(3) {
    width: 12%;
}

.table-section:first-child td:nth-child(4) {
    width: 12%;
}

.table-section:first-child td:nth-child(5) {
    width: 18%;
}

.table-section:first-child td:nth-child(6) {
    width: 8%;
}

.table-section:first-child td:nth-child(7) {
    width: 8%;
}

.table-section:first-child td:nth-child(8) {
    width: 17%;
}

td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 担当者列のスタイル */
.table-section:first-child td:nth-child(3) {
    color: #4F46E5;  /* Primary Accent - 重要データ */
    font-weight: 500;
}

tr:hover {
    background: #f9f9f9;
}

.status-confirmed {
    color: #22c55e;  /* Success Green - 確認状態の機能色として維持 */
    font-weight: bold;
}

.status-prospective {
    color: #FF9800;
    font-style: italic;
}

.delete-btn {
    background: #ff5252;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin-right: 3px;
}

.delete-btn:hover {
    background: #ff1744;
}

.edit-btn {
    background: #000000;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 0;
    cursor: pointer;
    font-size: 11px;
    margin-right: 3px;
}

.edit-btn:hover {
    background: #333333;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
}

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000000;
}

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

label {
    display: block;
    font-weight: bold;
    color: #555;
}

input,
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #000000;
}

.summary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.08);  /* Primary Accent シャドウ */
    border: 1px solid #6366F1;  /* Subtle Accent - 境界線 */
}

/* 3段構造のエリアブロック */
.summary-area {
    background: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.06);  /* Muted Accent シャドウ */
    border: 1px solid #f0f0ff;  /* 極薄アクセントボーダー */
}

.summary-area-header {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid #06B6D4;  /* Light Accent - ヘッダーアンダーライン */
    display: flex;
    align-items: center;
    gap: 6px;
}

.business-area .summary-area-header {
    color: #1a1a1a;  /* Soft Black - 統合デザインルール */
    border-bottom-color: #333333;  /* Gray 600 - アンダーライン */
}

.salary-area .summary-area-header {
    color: #1a1a1a;  /* Soft Black - 統合デザインルール */
    border-bottom-color: #666666;  /* Gray 500 - アンダーライン */
}

.tax-area .summary-area-header {
    color: #ef4444;  /* Alert Red - 機能色として維持 */
    border-bottom-color: #ef4444;  /* Alert Red - 税金は警告色として維持 */
}

.summary-area-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.summary-item {
    text-align: center;
    background: white;
    padding: 12px 8px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.08);  /* Subtle Accent シャドウ */
    border: 1px solid #e8e8ff;  /* 極薄アクセントボーダー */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);  /* Primary Accent ホバーシャドウ */
    border-color: #6366F1;  /* Subtle Accent ホバーボーダー */
}

.summary-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.profit-positive {
    color: #0891B2;  /* Tertiary Accent - 情報表示 */
    font-size: 20px !important;
}

/* 利益項目の特別スタイル */
.summary-item:has(.profit-positive),
.summary-item:has(.profit-negative) {
    background: linear-gradient(135deg, #f8f8ff 0%, #f0f0ff 100%);  /* アクセントグラデーション */
    border: 2px solid #4F46E5;  /* Primary Accent - 重要項目強調 */
}

.profit-negative {
    color: #f44336;
}

/* 税金表示用スタイル */
.tax-non-taxable {
    color: #666 !important;
    font-style: italic;
}

.tax-taxable {
    color: #f44336 !important;
}

/* 年収表示（利益系スタイル） */
.annual-salary-highlight {
    color: #FF6B35;
    font-size: 20px !important;
}

/* 年収項目の特別スタイル */
.summary-item:has(.annual-salary-highlight) {
    background: linear-gradient(135deg, #fff8f0 0%, #ffede6 100%);
    border: 2px solid #FF6B35;
    border-radius: 8px;
}

/* 受注確度スタイル */
.probability-high {
    color: #d32f2f;
    font-weight: bold;
}


/* FPモードトグルスイッチ */
.fp-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.fp-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fp-toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #cccccc;  /* Gray 300 */
    border-radius: 24px;
    transition: .4s;
    margin-right: 8px;
}

.fp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fp-toggle-switch input:checked + .fp-toggle-slider {
    background-color: #4F46E5;  /* Primary Accent */
}

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

.fp-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #666666;  /* Gray 500 */
}

/* FP診断エリア */
.fp-diagnostics {
    margin: 20px 0;
    padding: 20px;
    background: #f8f8f8;  /* Gray 100 */
    border: 2px solid #1a1a1a;  /* Soft Black */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.05);
}

.fp-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;  /* Gray 200 */
    padding-bottom: 10px;
}

.fp-header h3 {
    margin: 0 0 5px 0;
    color: #1a1a1a;  /* Soft Black */
    font-size: 18px;
    font-weight: 700;
}

.fp-disclaimer {
    font-size: 11px;
    color: #999999;  /* Gray 400 */
    font-style: italic;
}

.fp-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fp-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;  /* Gray 200 */
}

.fp-section-title {
    font-weight: bold;
    color: #666666;  /* Gray 500 */
    margin-bottom: 10px;
    font-size: 14px;
}

/* 累進課税シミュレーター */
.income-tax-simulator {
    grid-column: 1 / -1;
    /* 全幅を使用 */
    max-width: none;
}

.current-status {
    background: #f8f8f8;  /* Gray 100 */
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.income-breakdown {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 16px;
}

.income-breakdown .plus,
.income-breakdown .equals {
    color: #999999;  /* Gray 400 */
    font-weight: bold;
}

.income-breakdown .total {
    font-weight: bold;
    color: #333333;  /* Gray 600 */
}

.tax-rate-badge {
    display: inline-block;
    background: #4F46E5;  /* Primary Accent */
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
}

.slider-container {
    margin: 20px 0;
    position: relative;
}

.slider-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #666666;  /* Gray 500 */
}

#business-income-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right,
            #22c55e 0%, #22c55e 19.5%,
            /* 5% 税率帯 - Success Green */
            #06B6D4 19.5%, #06B6D4 33%,
            /* 10% 税率帯 - Light Accent */
            #F59E0B 33%, #F59E0B 69.5%,
            /* 20% 税率帯 - Warning Yellow */
            #ef4444 69.5%, #ef4444 90%,
            /* 23% 税率帯 - Alert Red */
            #7C3AED 90%, #7C3AED 100%
            /* 33%+ 税率帯 - Secondary Accent */
        );
    outline: none;
    -webkit-appearance: none;
}

#business-income-slider::-webkit-slider-thumb {
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #4F46E5;  /* Primary Accent */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#business-income-slider::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #4F46E5;  /* Primary Accent */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tax-brackets-overlay {
    position: relative;
    height: 30px;
    margin-top: 5px;
}

.bracket-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    color: #666666;  /* Gray 500 */
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #e5e5e5;  /* Gray 200 */
}

.business-tax-line {
    color: #ef4444 !important;  /* Alert Red */
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
}

.slider-value {
    position: relative;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #22c55e;  /* Success Green */
    margin-top: 5px;
    margin-bottom: 15px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    padding: 4px 8px;
    display: inline-block;
}

.simulation-results {
    background: #f8f8f8;  /* Gray 100 */
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.result-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #e5e5e5;  /* Gray 200 */
}

.result-item.important {
    border-left-color: #ef4444;  /* Alert Red */
}

.result-item.highlight {
    border-left-color: #22c55e;  /* Success Green */
    background: #f8fff9;
}

.result-item label {
    display: block;
    font-size: 12px;
    color: #999999;  /* Gray 400 */
    margin-bottom: 4px;
}

.result-item > span {
    font-size: 16px;
    font-weight: bold;
    color: #666666;  /* Gray 500 */
}

.bracket-info {
    font-size: 12px !important;
    font-weight: normal !important;
    color: #999999 !important;  /* Gray 400 */
    margin-left: 8px;
}

.change-amount.positive {
    color: #22c55e;  /* Success Green */
}

.change-amount.negative {
    color: #ef4444;  /* Alert Red */
}

.tax-increase {
    color: #ef4444;  /* Alert Red */
}

.tax-decrease {
    color: #22c55e;  /* Success Green */
}

.breakdown {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.breakdown small {
    color: #999999;  /* Gray 400 */
    font-size: 11px;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);  /* Warning Yellow background */
    color: #92400E;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #F59E0B;  /* Warning Yellow */
    font-size: 14px;
}

/* インタラクティブ結果表示のスタイル */
.total-income-display {
    background: #f8f8f8;  /* Gray 100 */
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #e5e5e5;  /* Gray 200 */
}

.total-income-label {
    font-size: 14px;
    color: #666666;  /* Gray 500 */
    margin-right: 8px;
}

.interactive-results {
    margin: 20px 0;
}

.metric-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    width: 120px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    flex-shrink: 0;
}

.metric-value {
    width: 100px;
    font-size: 16px;
    font-weight: bold;
    text-align: right;
    margin-right: 15px;
    flex-shrink: 0;
}

.metric-bar-container {
    flex: 1;
    height: 20px;
    background: #f1f3f4;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.metric-bar {
    height: 100%;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

/* 各メトリクスの色分け */
.metric-bar.business-income {
    background: linear-gradient(90deg, #4285f4, #1a73e8);
}

.metric-bar.tax-change.positive {
    background: linear-gradient(90deg, #ea4335, #d33b2c);
}

.metric-bar.tax-change.negative {
    background: linear-gradient(90deg, #34a853, #137333);
}

.metric-bar.net-income.positive {
    background: linear-gradient(90deg, #34a853, #137333);
}

.metric-bar.net-income.negative {
    background: linear-gradient(90deg, #ea4335, #d33b2c);
}

.metric-bar.effective-rate {
    background: linear-gradient(90deg, #fbbc04, #f9ab00);
}

/* 値の色分け */
.metric-value.positive {
    color: #34a853;
}

.metric-value.negative {
    color: #ea4335;
}

.metric-value.neutral {
    color: #1a73e8;
}

/* 税額内訳表示 */
.tax-breakdown-compact {
    margin-top: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.tax-breakdown-compact small {
    color: #6c757d;
}

/* アニメーション */
.metric-bar {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ホバー効果 */
.metric-row:hover {
    background: #f8f9fa;
    border-radius: 6px;
    cursor: default;
}

.metric-row:hover .metric-bar {
    filter: brightness(1.1);
}

/* 追加納税額 */
.fp-additional-tax-value {
    font-size: 24px;
    font-weight: bold;
    color: #dc3545;
    text-align: center;
}

/* 経費シミュレーター */
.expense-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.expense-input-group input {
    width: 100px;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.arrow {
    color: #6c757d;
    font-weight: bold;
}

.tax-reduction {
    color: #28a745;
    font-weight: bold;
    font-size: 13px;
}

/* 発生ライン診断 */
.tax-thresholds {
    grid-column: 1 / -1;
}

.threshold-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.threshold-label {
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.threshold-bar {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.threshold-progress {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.threshold-progress.under {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.threshold-progress.near {
    background: linear-gradient(90deg, #fd7e14, #ffc107);
}

.threshold-progress.over {
    background: linear-gradient(90deg, #dc3545, #e74c3c);
}

.threshold-status {
    font-size: 12px;
    font-weight: bold;
    text-align: right;
}

.threshold-status.under {
    color: #28a745;
}

.threshold-status.near {
    color: #fd7e14;
}

.threshold-status.over {
    color: #dc3545;
}

.probability-medium {
    color: #f57c00;
    font-weight: bold;
}

.probability-low {
    color: #1a1a1a;  /* Soft Black - 統合デザインルール */
    font-weight: bold;
}

/* 設定ボタン */
.settings-button {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    transition: background-color 0.3s;
}

.settings-button:hover {
    background: #e9e9e9;
    color: #333;
}

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

.settings-modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.settings-section h3 {
    margin-bottom: 15px;
    color: #1a1a1a;  /* Soft Black - 統合デザインルール */
    border-bottom: 2px solid #333333;  /* Gray 600 */
    padding-bottom: 5px;
}


.data-management {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.data-management .btn {
    flex: 1;
    min-width: 120px;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    /* タブレイアウトでは元々1列なので変更不要 */

    .table-section:first-child th:nth-child(2) {
        width: 18%;
    }

    /* クライアント */
    .table-section:first-child th:nth-child(3) {
        width: 12%;
    }

    /* 担当者 */
    .table-section:first-child th:nth-child(4) {
        width: 13%;
    }

    /* 金額 */
    .table-section:first-child th:nth-child(5) {
        width: 25%;
    }

    /* 期間 */

    .table-section:first-child td:nth-child(2) {
        width: 18%;
    }

    .table-section:first-child td:nth-child(3) {
        width: 12%;
    }

    .table-section:first-child td:nth-child(4) {
        width: 13%;
    }

    .table-section:first-child td:nth-child(5) {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    th,
    td {
        padding: 4px 6px;
        font-size: 11px;
    }

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

/* グラフ表示モード切り替えトグルスイッチ */
.chart-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 36px;
}

/* 期間選択トグルスタイル */
.period-toggle-wrapper {
    display: inline-block;
}

.period-toggle {
    display: inline-flex;
    position: relative;
    background: #f0f0f0;
    border-radius: 25px;
    padding: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 36px;
    align-items: center;
}

.period-toggle input[type="radio"] {
    display: none;
}

.period-toggle label {
    position: relative;
    z-index: 1;
    padding: 3px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.period-toggle .period-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    background: white;
    border-radius: 22px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, width 0.3s ease;
    width: 60px;
}

.period-toggle input#currentPeriod:checked ~ .period-slider {
    transform: translateX(0);
    width: 60px;
}

.period-toggle input#nextPeriod:checked ~ .period-slider {
    transform: translateX(60px);
    width: 50px;
}

.period-toggle input#allPeriod:checked ~ .period-slider {
    transform: translateX(160px);
    width: 75px;
}

.period-toggle input:checked + label {
    color: #333;
    font-weight: 600;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 140px;
    height: 36px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e0e0e0;
    border-radius: 18px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 66px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 14px;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #4F46E5;  /* Primary Accent - アクティブ状態 */
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(66px);
}

.toggle-text-monthly,
.toggle-text-cumulative {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    z-index: 1;
    transition: color 0.3s;
    width: 66px;
    text-align: center;
}

.toggle-switch input:not(:checked) + .toggle-slider .toggle-text-monthly {
    color: #4F46E5;  /* Primary Accent - 選択状態 */
}

.toggle-switch input:checked + .toggle-slider .toggle-text-cumulative {
    color: #999;
}

.toggle-switch input:not(:checked) + .toggle-slider .toggle-text-cumulative {
    color: #999;
}

.toggle-switch input:checked + .toggle-slider .toggle-text-monthly {
    color: white;
}


/* ツールチップスタイル */
.help-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.help-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 12px;
    margin-bottom: 5px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    width: max-content;
    line-height: 1.4;
}

/* 長いツールチップ用の改行対応 */
.help-icon[data-tooltip*="・"]:hover::after,
.help-icon[data-tooltip*="。"]:hover::after {
    white-space: pre-line;
    text-align: left;
}

.help-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top: 4px solid rgba(0, 0, 0, 0.8);
    margin-bottom: 1px;
    z-index: 1000;
    pointer-events: none;
}

/* =========================== */
/* フィードバックモーダル */
/* =========================== */

.feedback-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-modal.show {
    opacity: 1;
}

.feedback-modal-content {
    background: white;
    margin: 3% auto;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
    position: relative;
}

.feedback-modal.show .feedback-modal-content {
    transform: translateY(0) scale(1);
}

.feedback-modal-header {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.feedback-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.feedback-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.feedback-modal-body {
    padding: 30px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

.feedback-modal-description {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
}

.feedback-modal iframe {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .feedback-modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 95vh;
    }

    .feedback-modal-header {
        padding: 16px 20px;
    }

    .feedback-modal-title {
        font-size: 18px;
    }

    .feedback-modal-body {
        padding: 20px;
        max-height: calc(95vh - 100px);
    }

    .feedback-modal iframe {
        height: 500px;
    }
}

@media (max-width: 480px) {
    .feedback-modal-content {
        margin: 2% auto;
        width: 98%;
        max-height: 98vh;
    }

    .feedback-modal-header {
        padding: 12px 16px;
    }

    .feedback-modal-title {
        font-size: 16px;
    }

    .feedback-modal-body {
        padding: 16px;
        max-height: calc(98vh - 80px);
    }

    .feedback-modal iframe {
        height: 450px;
    }

    .feedback-modal-description {
        font-size: 14px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .feedback-modal-content {
        background: #1f2937;
        color: #f9fafb;
    }

    .feedback-modal-description {
        color: #9ca3af;
    }

    .feedback-modal iframe {
        border-color: #374151;
        background: #111827;
    }
}

/* フッター */
.site-footer {
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    margin-top: 40px;
    padding: 0;
    width: 100%;
    clear: both;
    text-align: left;
}

.footer-content {
    max-width: 100%;
    padding: 40px 20px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    background: #f8f9fa;
    text-align: left;
}

.footer-section {
    margin-bottom: 20px;
}

.footer-section h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.footer-section h4 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.footer-section p {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
}

.footer-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.footer-links li {
    margin-bottom: 6px;
    padding: 0;
}

.footer-links a {
    color: #6c757d !important;
    text-decoration: none !important;
    font-size: 14px;
    transition: color 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #4F46E5 !important;  /* Primary Accent - リンクホバー */
    text-decoration: none !important;
}

.footer-cta {
    margin-top: 15px;
}

.footer-cta .btn-primary {
    background: #4F46E5 !important;  /* Primary Accent */
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    display: inline-block !important;
    transition: background-color 0.3s ease;
}

.footer-cta .btn-primary:hover {
    background: #45a049 !important;
    color: white !important;
    text-decoration: none !important;
}

.footer-bottom {
    background: #e9ecef;
    border-top: 1px solid #dee2e6;
    padding: 15px 20px;
    text-align: left;
    margin: 0;
}

.footer-bottom p {
    color: #6c757d;
    font-size: 13px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px 15px 15px;
    }

    .footer-section h3 {
        font-size: 16px;
    }

    .footer-section h4 {
        font-size: 15px;
    }
}

/* サポーターバッジ */
.supporter-badge {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
    animation: supporterPulse 3s ease-in-out infinite;
    cursor: help;
    white-space: nowrap;
}

@keyframes supporterPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    }
}

/* サポーターメッセージ */
.supporter-message {
    margin: 15px 0;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.supporter-message-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #34d399;
}

.supporter-message-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #f87171;
}

.supporter-message-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #60a5fa;
}

/* サポーターアニメーション */
@keyframes supporterSuccess {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    50% {
        opacity: 1;
        transform: translateY(0) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ヘッダー応援メッセージ */
.header-supporter-message {
    font-size: 12px;
    color: #4F46E5;  /* Primary Accent - 統一 */
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    padding: 2px 6px;
    border-radius: 12px;
}

.header-supporter-message:hover {
    color: #7C3AED;  /* Secondary Accent */
    background: linear-gradient(135deg, #f9f9ff 0%, #f0f0ff 100%);  /* Subtle Accent グラデーション */
    transform: scale(1.02);
    text-decoration: none;
}

.header-supporter-message::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4F46E5, #0891B2);  /* Primary to Tertiary Accent */
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header-supporter-message:hover::after {
    width: 100%;
}
