/* Saved imports share the contact workspace's warm colors and compact controls. */
.import-history-page { min-width:0; }
.import-history-page>.page-heading { margin-bottom:22px; }
.import-history-page .page-heading h1 { font-size:28px; letter-spacing:-1px; }
.import-history-page .page-heading p { font-size:12px; }
.import-history-page .heading-actions .btn { min-height:39px; border-radius:8px; font-size:11px; }
.history-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:22px; }
.history-stat { display:flex; align-items:center; gap:12px; min-width:0; padding:19px 20px; border:1px solid var(--line); border-radius:11px; background:var(--card); box-shadow:0 4px 16px #30233004; }
.history-stat-symbol { display:grid; place-items:center; flex:0 0 36px; height:36px; border-radius:10px; background:#f0e9f5; color:#8d70a4; }
.history-stat-symbol>.icon { width:17px; height:17px; }
.history-stat-green>.history-stat-symbol { background:#e8f0e7; color:#70906a; }
.history-stat-sand>.history-stat-symbol { background:#f6ebde; color:#b08154; }
.history-stat-neutral>.history-stat-symbol { background:#efebe6; color:#998a80; }
.history-stat>div { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; row-gap:5px; flex:1; min-width:0; }
.history-stat-label { font-size:11px; font-weight:550; color:#7d6e7c; line-height:1.5; }
.history-stat strong { grid-column:2; grid-row:1/3; align-self:center; font-size:28px; font-weight:650; letter-spacing:-.9px; line-height:1.2; }
.history-stat small { grid-column:1; color:#ac9ca5; font-size:9px; line-height:1.5; }
.import-history-list { overflow:hidden; border-radius:12px; box-shadow:0 5px 24px #30233006; }
.history-list-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:21px 24px 0; }
.history-list-heading h2 { display:flex; align-items:center; gap:9px; margin:0; font-size:14px; font-weight:600; }
.history-list-heading h2>span { display:grid; place-items:center; min-width:24px; height:23px; padding:0 6px; background:#f2ece5; border:1px solid #e8dfd5; border-radius:6px; color:#a28c9a; font-size:10px; font-weight:500; }
.history-timezone { display:flex; align-items:center; gap:5px; font-size:10px; color:#a18f9d; }
.history-timezone>.icon { width:12px; height:12px; }
.import-history-page .import-history-toolbar { display:flex; align-items:flex-end; gap:12px; padding:19px 24px 22px; }
.import-history-page .import-history-toolbar>.search-input { flex:1; flex-basis:auto; min-width:220px; max-width:520px; min-height:40px; margin-right:auto; border-color:#e4dacf; border-radius:7px; background:#fffdf9; }
.import-history-page .import-history-toolbar input[type="search"] { min-width:0; width:100%; font-size:11px; }
.import-history-page .import-history-filter { flex:0 1 172px; min-width:135px; }
.import-history-page .import-history-filter>label { margin-bottom:6px; font-size:10px; color:#9b8796; }
.import-history-page .import-history-filter>select { width:100%; min-width:0; max-width:none; min-height:40px; padding:9px 11px; border-radius:7px; border-color:#e4dacf; background:#fffdf9; font-size:11px; }
.import-history-page .import-history-toolbar>.btn { min-height:40px; padding-inline:8px; font-size:10px; }
.history-legacy-note { margin:0 24px 18px; padding:10px 12px; border-radius:7px; background:#f8f2e9; color:#a38463; font-size:11px; line-height:1.6; }
.history-list-table { border-top:1px solid var(--line); }
.import-history-page .import-history-table { width:100%; min-width:950px; }
.import-history-page .import-history-table th { padding:13px 22px; background:#f8f5f0; border-bottom:1px solid var(--line); font-size:10px; font-weight:550; letter-spacing:.2px; white-space:nowrap; }
.import-history-page .import-history-table td { padding:18px 22px; vertical-align:middle; border-bottom:1px solid #eee7df; font-size:12px; }
.import-history-page .import-history-table tbody tr:last-child td { border-bottom:0; }
.import-history-page .import-history-table tbody tr:hover { background:#fdfbf7; }
.import-history-page .import-history-table td:first-child { max-width:460px; min-width:260px; }
.history-file-cell { display:flex; align-items:center; gap:12px; min-width:0; }
.history-file-symbol { display:grid; place-items:center; flex:0 0 39px; height:43px; border:1px solid #e8ddcf; border-radius:9px; background:#f7f0e5; color:#ad8055; }
.history-file-symbol>.icon { width:18px; height:18px; }
.history-file-cell>div { min-width:0; }
.history-file-cell strong { display:block; font-size:12px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.import-history-page .history-file-cell .cell-secondary { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-top:4px; font-size:10px; color:#a18d9b; }
.history-timestamp { display:block; white-space:nowrap; }
.history-timestamp>strong { display:block; font-size:11px; font-weight:500; line-height:1.5; }
.history-timestamp>span { display:block; margin-top:3px; color:#a18d9b; font-size:10px; }
.history-missing { font-size:11px; color:#a18d9b; }
.history-teammate { display:inline-flex; align-items:center; gap:8px; max-width:100%; font-size:11px; line-height:1.5; }
.history-teammate>span:last-child { overflow-wrap:anywhere; }
.history-avatar { display:grid; place-items:center; flex:0 0 28px; height:28px; border-radius:50%; background:#eee8f2; color:#92799f; font-size:9px; font-weight:600; }
.import-history-page .history-number { text-align:center; }
.history-count { display:inline-grid; place-items:center; min-width:30px; min-height:28px; padding:3px 7px; border-radius:6px; background:#f5f2ed; color:#b1a49f; font-size:11px; font-weight:550; }
.history-count.green { background:#eaf2e9; color:#698b65; }
.history-count.purple { background:#f0eaf6; color:#9071a9; }
.history-count.sand { background:#f8eddf; color:#b18354; }
.import-history-page .import-history-actions .btn { min-height:33px; font-size:10px; border-radius:7px; }
.history-details-button { gap:9px; background:#fffdf9; border-color:#e3d6c9; }
.history-details-button>.icon { width:12px; height:12px; color:#ae8c77; }
.history-list-footer.section-foot { display:flex; align-items:center; justify-content:space-between; gap:15px; margin:0; padding:16px 24px; border-top:1px solid var(--line); }
.history-list-footer>div { display:flex; gap:6px; flex-direction:column; font-size:10px; color:#a18d9b; }
.history-list-footer small { color:#b3a3ad; font-size:9px; }
.history-list-footer .btn { min-height:31px; border-radius:6px; font-size:10px; }
.history-list-footer .btn>.icon { width:12px; height:12px; }
.history-empty { padding:24px; }

/* The details dialog gives contacts their own scroll area beside import metadata. */
.modal:has(#import-history-detail) { display:flex; flex-direction:column; width:1080px; max-width:calc(100vw - 48px); height:min(840px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); border:1px solid #ffffffa0; border-radius:16px; overflow:hidden; box-shadow:0 24px 90px #21182d36; }
.modal:has(#import-history-detail)>.modal-header { flex-shrink:0; padding:22px 26px; }
.modal:has(#import-history-detail) .modal-header h2 { font-size:22px; font-weight:650; letter-spacing:-.6px; }
.modal:has(#import-history-detail) .modal-header .icon-btn { flex-shrink:0; width:32px; height:32px; border-radius:8px; background:#f7f3ee; }
#import-history-detail.import-history-dialog { display:flex; flex-direction:column; flex:1; gap:18px; min-height:0; padding:22px 24px; overflow:hidden; background:#faf8f4; }
.history-detail-file { display:flex; align-items:center; gap:12px; flex-shrink:0; min-width:0; }
.history-detail-file>.history-file-symbol { flex-basis:43px; height:47px; background:#fffaf2; }
.history-detail-file>div { flex:1; min-width:0; }
.history-detail-file strong { display:block; font-size:15px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.history-detail-file>div>span { display:block; margin-top:3px; color:#a08b99; font-size:10px; }
.history-file-type { padding:5px 8px; border:1px solid #e5d6c5; border-radius:5px; background:#f4ecdf; color:#a7835b; font-size:9px; font-weight:600; letter-spacing:.6px; }
.history-detail-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; flex-shrink:0; }
.history-detail-stats>.history-stat { gap:10px; padding:13px 15px; border-radius:9px; box-shadow:none; }
.history-detail-stats .history-stat-symbol { flex-basis:31px; height:31px; border-radius:8px; }
.history-detail-stats .history-stat-symbol>.icon { width:15px; height:15px; }
.history-detail-stats .history-stat>div { display:block; }
.history-detail-stats .history-stat-label { font-size:10px; }
.history-detail-stats .history-stat strong { display:block; margin-top:5px; font-size:24px; line-height:1.1; }
.history-detail-layout { display:grid; grid-template-columns:minmax(0,1fr) 238px; gap:18px; flex:1; min-height:0; }
.history-affected { display:flex; flex-direction:column; min-width:0; min-height:0; border:1px solid #e6ddd3; border-radius:11px; background:var(--card); overflow:hidden; }
.history-affected-heading { flex-shrink:0; padding:17px 18px 15px; }
.history-affected-heading h3 { margin:0; font-size:13px; font-weight:600; }
.history-affected-heading p { margin:6px 0 0; color:#a08b99; font-size:10px; line-height:1.5; }
.history-affected .import-history-contacts { flex:1; min-height:100px; max-height:none; margin:0; overflow:auto; border-top:1px solid var(--line); }
.history-affected .import-history-contacts .data-table { width:100%; min-width:590px; }
.history-affected .import-history-contacts thead { background:#f8f5f0; }
.history-affected .import-history-contacts th { padding:11px 14px; border-bottom:1px solid var(--line); font-size:9px; white-space:nowrap; }
.history-affected .import-history-contacts td { min-width:0; max-width:none; padding:15px 14px; font-size:11px; vertical-align:middle; border-bottom:1px solid #eee7df; }
.history-affected .import-history-contacts th:first-child,.history-affected .import-history-contacts td:first-child { width:44px; padding-right:0; }
.history-affected .import-history-contacts tr:last-child td { border-bottom:0; }
.history-source-row { color:#b29da8; font-size:10px; }
.history-contact-identity { display:flex; align-items:flex-start; gap:9px; min-width:0; }
.history-contact-identity>.history-avatar { flex-basis:29px; height:29px; border-radius:8px; background:#f3e7da; color:#aa7954; margin-top:2px; }
.history-contact-identity>div { min-width:0; }
.history-contact-identity strong { display:block; font-size:11px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.history-contact-identity>div>span { display:block; margin-top:3px; font-size:10px; color:#a08b99; overflow-wrap:anywhere; }
.history-contact-identity small { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:4px; font-size:9px; color:#b29eab; }
.history-contact-tags { display:flex; flex-wrap:wrap; gap:4px; min-width:65px; max-width:150px; }
.history-contact-tags>span { max-width:100%; padding:3px 6px; border:1px solid #e7dccf; border-radius:5px; background:#f6f0e7; color:#aa8b6d; font-size:9px; line-height:1.5; overflow-wrap:anywhere; }
.history-contact-tags>.history-no-tags { border:0; padding:0; background:none; color:#baabb5; }
.history-contact-open { min-height:30px; gap:6px; padding:6px 9px; white-space:nowrap; border-radius:6px; font-size:9px; }
.history-contact-open>.icon { width:11px; height:11px; }
.history-contact-unavailable { background:#faf7f3; color:#a18c98; }
.history-contact-unavailable .cell-secondary { margin-top:5px; font-size:9px; }
.history-contact-note { flex-shrink:0; margin:0; padding:11px 15px; border-top:1px solid var(--line); color:#b19da9; font-size:9px; line-height:1.7; }
.history-detail-sidebar { min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; }
.history-settings { padding:17px; border:1px solid #e6ddd3; border-radius:11px; background:var(--card); }
.history-settings h3 { display:flex; align-items:center; gap:7px; margin:0 0 17px; color:#736374; font-size:11px; font-weight:600; }
.history-settings h3>.icon { width:14px; height:14px; color:#a68caf; }
.history-settings dl { margin:0; }
.history-settings dl>div+div { margin-top:15px; padding-top:13px; border-top:1px solid #eee7df; }
.history-settings dt { color:#aa95a4; font-size:9px; line-height:1.5; }
.history-settings dd { margin:5px 0 0; color:#7a6878; font-size:11px; line-height:1.7; overflow-wrap:anywhere; }
.history-settings .history-teammate { font-size:11px; }
.history-settings .history-timestamp>strong { font-size:11px; font-weight:400; }
.history-settings .history-timestamp>span { margin-top:2px; font-size:10px; }
.history-detail-empty { display:flex; flex:1; align-items:center; justify-content:center; flex-direction:column; gap:9px; padding:35px 20px; text-align:center; }
.history-detail-empty>.icon { width:24px; height:24px; margin-bottom:4px; color:#b39dbd; }
.history-detail-empty strong { font-size:12px; font-weight:550; }
.history-detail-empty>span { color:#a48e9d; font-size:11px; line-height:1.7; }
.modal:has(#import-history-detail)>.modal-footer { flex-shrink:0; justify-content:space-between; padding:16px 24px; background:var(--card); }
.modal:has(#import-history-detail)>.modal-footer>.btn:last-child { margin-left:auto; min-height:36px; border-radius:7px; font-size:11px; }
.modal:has(.import-history-loading) { height:260px; }
#import-history-detail.import-history-loading { display:grid; place-items:center; flex:1; }

@media(max-width:1100px) {
 .history-overview { gap:10px; }
 .history-overview .history-stat { padding:15px 13px; gap:9px; }
 .history-overview .history-stat-symbol { flex-basis:30px; height:30px; }
 .history-overview .history-stat strong { font-size:25px; }
 .history-overview .history-stat small { font-size:8px; }
 .history-overview .history-stat-label { font-size:10px; }
}
@media(max-width:900px) {
 .history-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .import-history-page .import-history-toolbar { flex-wrap:wrap; }
 .import-history-page .import-history-toolbar>.search-input { flex-basis:100%; max-width:none; min-width:0; }
 .import-history-page .import-history-filter { flex:1; min-width:120px; }
 .history-detail-layout { display:flex; flex-direction:column; }
 #import-history-detail.import-history-dialog { display:block; overflow:auto; }
 .history-detail-stats { margin-top:18px; }
 .history-detail-layout { margin-top:18px; }
 .history-affected .import-history-contacts { flex:none; max-height:360px; }
 .history-detail-sidebar { margin-top:16px; overflow:visible; }
}
@media(max-width:600px) {
 .import-history-page>.page-heading { gap:14px; }
 .import-history-page .page-heading h1 { font-size:24px; }
 .import-history-page .page-heading p { font-size:11px; line-height:1.7; }
 .import-history-page .heading-actions { flex-wrap:wrap; }
 .history-overview .history-stat>div { display:block; }
 .history-overview .history-stat strong { display:block; margin-top:4px; font-size:24px; }
 .history-overview .history-stat small { display:none; }
 .history-list-heading { flex-wrap:wrap; padding:17px 17px 0; gap:9px; }
 .history-list-heading h2 { font-size:13px; }
 .history-timezone { font-size:9px; }
 .import-history-page .import-history-toolbar { padding:17px; gap:10px; }
 .history-list-footer.section-foot { flex-wrap:wrap; padding:15px 17px; }
 .history-list-footer small { display:none; }
 .history-legacy-note { margin:0 17px 15px; font-size:10px; }
 .modal:has(#import-history-detail) { max-width:calc(100vw - 24px); height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); border-radius:12px; }
 .modal:has(#import-history-detail)>.modal-header { padding:19px; }
 .modal:has(#import-history-detail) .modal-header h2 { font-size:20px; }
 #import-history-detail.import-history-dialog { padding:18px 16px; }
 .history-detail-file strong { font-size:13px; }
 .history-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
 .history-detail-stats>.history-stat { padding:12px; }
 .modal:has(#import-history-detail)>.modal-footer { padding:14px 17px; }
 .modal:has(.import-history-loading) { height:260px; }
}
