/* 利用履歴専用CSS */

/* テーブルコンテナ */
.table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

/* テーブル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-table th:hover {
    background: #f3f4f6;
}

.sort-icon {
    font-size: 14px;
    font-weight: bold;
    color: #9ca3af;
    margin-left: 4px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* バッジ */
.app-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.app-chat {
    background: #fce7f3;
    color: #be185d;
}

.app-bot {
    background: #ccfbf1;
    color: #0f766e;
}

.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.type-faq {
    background: #dbeafe;
    color: #1e40af;
}

.type-category {
    background: #d1fae5;
    color: #065f46;
}

/* サマリー */
.usage-summary {
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 14px;
}

/* 詳細モーダル */
.usage-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.usage-detail-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.detail-row {
    display: flex;
    margin-bottom: 16px;
    gap: 16px;
}

.detail-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
    min-width: 120px;
    flex-shrink: 0;
}

.detail-value {
    color: #1f2937;
    font-size: 13px;
    flex: 1;
    word-break: break-word;
}

/* ステータスバッジ（ご意見・ご要望） */
.opinion-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.status-unresolved {
    background: #fff7ed;
    color: #c2410c;
}

.status-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-resolved {
    background: #d1fae5;
    color: #065f46;
}

.status-on-hold {
    background: #ede9fe;
    color: #5b21b6;
}

.status-not-needed {
    background: #f3f4f6;
    color: #6b7280;
}

/* ステータス選択（詳細モーダル内） */
.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-select {
    padding: 5px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #fff;
}

.status-select:focus {
    outline: none;
    border-color: #10b981;
}

/* メモ */
.memo-area {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    box-sizing: border-box;
}

.memo-area:focus {
    outline: none;
    border-color: #10b981;
}

.memo-area::placeholder {
    color: #d1d5db;
}

/* 保存ボタン */
.btn-save {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #10b981;
    color: #fff;
    transition: all 0.15s;
}

.btn-save:hover {
    background: #059669;
}

/* フィルタチップ */
.filter-chips-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
}

.filter-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.filter-date-input {
    padding: 5px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    color: #374151;
}

.filter-date-input:focus {
    outline: none;
    border-color: #6366f1;
}

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

.filter-chips-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    min-width: 60px;
    flex-shrink: 0;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    transition: all 0.15s;
}

.filter-chip:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.filter-chip.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

.filter-chip.chip-chat.active {
    border-color: #ec4899;
    background: #fce7f3;
    color: #be185d;
}

.filter-chip.chip-bot.active {
    border-color: #14b8a6;
    background: #ccfbf1;
    color: #0f766e;
}

.filter-chip.chip-unresolved.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #c2410c;
}

.filter-chip.chip-in-progress.active {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

.filter-chip.chip-resolved.active {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}

.filter-chip.chip-on-hold.active {
    border-color: #8b5cf6;
    background: #ede9fe;
    color: #5b21b6;
}

.filter-chip.chip-not-needed.active {
    border-color: #9ca3af;
    background: #f3f4f6;
    color: #4b5563;
}

/* 解決/未解決タブ用チップ */
.filter-chip.chip-type-resolved.active {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}

.filter-chip.chip-type-not.active {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.filter-chip.chip-type-form.active {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.filter-chip.chip-user-employee.active {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

.filter-chip.chip-user-engineer.active {
    border-color: #10b981;
    background: #d1fae5;
    color: #065f46;
}

/* 期間・カテゴリ行 */
.resolve-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.resolve-date-row label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    min-width: 30px;
}

.resolve-date-row input[type="date"] {
    padding: 5px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    color: #374151;
}

.resolve-date-row input[type="date"]:focus {
    outline: none;
    border-color: #6366f1;
}

.resolve-date-row span {
    color: #9ca3af;
    font-size: 13px;
}

.category-search-input {
    padding: 5px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    color: #374151;
    width: 140px;
    margin-left: auto;
}

.category-search-input:focus {
    outline: none;
    border-color: #6366f1;
}

.category-search-input::placeholder {
    color: #d1d5db;
}

.btn-csv-export {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    transition: all 0.15s;
}

.btn-csv-export:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.filter-chip.chip-assignee-mine.active {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4338ca;
}

.filter-chip.chip-assignee-none.active {
    border-color: #9ca3af;
    background: #f3f4f6;
    color: #4b5563;
}

.status-completed {
    background: #d1fae5;
    color: #047857;
    font-weight: 700;
}

.filter-chip.chip-completed.active {
    border-color: #059669;
    background: #d1fae5;
    color: #047857;
}
