/* ==================== 歷史紀錄樣式 (history.css) ==================== */
/* 從 HistoryRecordsUI.html <style> 提取 */

.history-group {
    background: white;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #eee;
}

.history-group-header {
    display: flex;
    flex-direction: column;
    padding: 12px 15px;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s;
    gap: 8px;
}

.history-group-header:hover {
    background: #fdfdfd;
}

/* 標題列第一行: 類型與日期 */
.history-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 標題列第二行: 客戶名稱 (最重要，給予完整寬度) */
.history-header-main {
    font-size: 16px;
    color: #1d1d1f;
    line-height: 1.4;
    word-break: break-all;
    padding: 2px 0;
}

/* 標題列第三行: 數量、業務與展開圖示 */
.history-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    margin-top: 4px;
    color: #666;
    font-size: 13px;
}

.history-group-toggle {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.history-group-toggle.expanded {
    transform: rotate(90deg);
}

.history-group-items {
    display: none;
    padding: 0 15px 10px;
    background: #fafafa;
}

.history-group-items.show {
    display: block;
}

.history-item-row {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    gap: 4px;
}

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

.history-item-main {
    font-weight: 500;
    color: #333;
}

.history-item-sub {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #777;
}

@media (min-width: 768px) {
    .history-group-header {
        padding: 15px 20px;
    }

    .history-header-main {
        font-size: 17px;
    }
}
