/* 利用履歴専用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: 10px;
    color: #6366f1;
    margin-left: 2px;
}

.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: 960px;
    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;
}

/* 旧互換: status-completed */
.status-completed {
    background: #d1fae5;
    color: #047857;
    font-weight: 700;
}

/* フィルターカード */
.filter-card-section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; position: relative; }
.filter-card-section .filter-count { position: absolute; bottom: 10px; right: 16px; font-size: 12px; color: #6b7280; }
.filter-top-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-preset { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden; }
.filter-preset-btn { padding: 5px 12px; font-size: 11px; cursor: pointer; border: none; border-right: 1px solid #e5e7eb; color: #6b7280; background: #fff; font-weight: 500; }
.filter-preset-btn:last-child { border-right: none; }
.filter-preset-btn:hover { background: #f3f4f6; }
.filter-preset-btn.active { background: #6366f1; color: #fff; }
.filter-date-card { display: inline-flex; align-items: center; gap: 6px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px 10px; }
.filter-date-card svg { flex-shrink: 0; }
.filter-date-card input[type=date] { border: none; background: transparent; font-size: 12px; padding: 2px 0; color: #374151; font-family: inherit; }
.filter-date-card input[type=date]:focus { outline: none; }
.filter-date-card .sep { color: #9ca3af; font-size: 11px; }
.filter-search-wrap { position: relative; }
.filter-search-wrap input { padding: 5px 8px 5px 28px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12px; width: 140px; background: #fff; }
.filter-search-wrap input:focus { outline: none; border-color: #6366f1; }
.filter-search-wrap svg { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); }
.filter-btn-csv { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border: 1px solid #86efac; border-radius: 6px; font-size: 12px; background: #f0fdf4; cursor: pointer; color: #15803d; font-weight: 500; }
.filter-btn-csv:hover { background: #dcfce7; }
.filter-cards-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fcard { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; }
.fcard .fcard-label { font-size: 10px; color: #9ca3af; font-weight: 600; display: block; margin-bottom: 4px; }
.fcard .fcard-label::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.fcard.fc-app .fcard-label::before { background: #ec4899; }
.fcard.fc-type .fcard-label::before { background: #f59e0b; }
.fcard.fc-user .fcard-label::before { background: #10b981; }
.fcard.fc-status .fcard-label::before { background: #6366f1; }
.fcard.fc-assign .fcard-label::before { background: #8b5cf6; }
.fcard .fcard-chip { display: inline-block; padding: 3px 10px; border-radius: 5px; font-size: 11px; font-weight: 500; cursor: pointer; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; margin: 2px; }
.fcard .fcard-chip:hover { background: #f3f4f6; }
.fcard .fcard-chip.active { background: #6366f1; color: #fff; border-color: #6366f1; }
