/* Change history shares the ERP typography and its page scroll. */
.history-screen{width:100%;min-width:0;background:var(--panel,#fff);border:1px solid var(--line);border-radius:9px;overflow:visible}
.history-filters{display:grid;grid-template-columns:minmax(210px,1.5fr) minmax(150px,1fr) minmax(140px,1fr) 140px 140px auto;gap:10px;padding:14px;align-items:end}
.history-filters label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--muted);min-width:0}
.history-filters input,.history-filters select{width:100%;min-width:0;height:36px;border:1px solid var(--line);border-radius:7px;background:#fff;padding:7px 9px;color:var(--text);font:inherit;font-size:13px}

.history-types{display:flex;flex-wrap:wrap;gap:4px;padding:0 14px 10px;border-bottom:1px solid var(--line)}
.history-types button{border:0;background:transparent;color:var(--muted);font:inherit;font-size:13px;border-radius:6px;min-height:34px;padding:7px 10px;cursor:pointer}
.history-types button.active{background:var(--accent-soft,#edf3ff);color:var(--accent,#3264cf);font-weight:600}
.history-summary{display:flex;align-items:center;gap:14px;padding:10px 14px;font-size:12px;color:var(--muted)}.history-order{margin-left:auto}
.history-day{background:#f5f7fa;margin:0;padding:8px 14px;font-size:12px;font-weight:600;color:var(--text)}
.history-event{display:grid;grid-template-columns:68px minmax(0,1fr) 175px 16px;gap:14px;text-align:left;width:100%;padding:12px 14px;border:0;border-bottom:1px solid #edf0f4;border-radius:0;background:#fff;color:var(--text);font:inherit;cursor:pointer;align-items:start}
.history-event:hover,.history-event:focus-visible{background:#f8faff}.history-event time{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;padding-top:2px}
.history-event-main{min-width:0;display:block}.history-object{font-size:14px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
.history-action{margin-left:10px;font-size:12px;color:var(--muted);display:inline-block}
.history-who{display:flex;flex-direction:column;gap:4px;font-size:12px;line-height:1.4}.history-who b{font-weight:500}.history-who small{font-size:12px;color:var(--muted)}.history-chevron{color:var(--muted);font-size:20px;align-self:center}
.history-diff{display:grid;gap:10px;margin-top:18px}.history-diff>div{display:grid;grid-template-columns:130px minmax(0,1fr) 16px minmax(0,1fr);gap:10px;align-items:start;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.history-field,.history-before{color:var(--muted)}.history-diff strong{font-weight:500;color:var(--text)}
.history-diff.compact{gap:3px;margin-top:6px}.history-diff.compact>div{display:flex;flex-wrap:wrap;gap:4px 8px;font-size:13px}.history-diff.compact .history-field{font-size:12px}.history-diff.compact small{font-size:12px;color:var(--muted)}
.history-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;font-size:13px;line-height:1.5;margin-top:5px;color:var(--muted)}
.history-empty{padding:32px 16px;text-align:center}.history-empty b{font-size:14px}.history-empty p{font-size:13px;color:var(--muted)}
.history-more{display:flex;align-items:center;justify-content:center;gap:12px;padding:16px;font-size:12px;color:var(--muted)}
.history-screen>.form-error{margin:4px 14px 12px}
.history-layer{z-index:1150}.history-detail{width:min(720px,calc(100vw - 32px));max-height:calc(100dvh - 32px);display:flex;flex-direction:column}
.history-detail .bravo-dialog-body{overflow:auto;overscroll-behavior:contain;padding:18px 20px;min-height:0}
.history-detail header{flex-shrink:0}.history-detail h3{font-size:16px;line-height:1.4;margin:18px 0 0;overflow-wrap:anywhere}
.history-event-meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12px;color:var(--muted)}
.history-note,.history-current{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}.history-note h4,.history-current h4{font-size:12px;color:var(--muted);font-weight:500;margin:0 0 8px}.history-note p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:14px;line-height:1.6}
.history-current b{font-size:14px}.history-current p{font-size:13px;margin:5px 0;color:var(--muted)}
.history-detail>footer{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid var(--line);padding:12px 20px;flex-shrink:0}
.desk-activity>button.activity-event{width:100%;text-align:left;font:inherit;border:0;border-bottom:1px solid var(--line);background:transparent;cursor:pointer}
@media(max-width:1200px){.history-filters{grid-template-columns:minmax(180px,1fr) minmax(150px,1fr) minmax(140px,1fr)}.history-search{align-self:end}}
@media(max-width:760px){
 .history-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);padding:12px;gap:10px}
 .history-search{grid-column:1/-1}.history-search input,.history-filters input,.history-filters select{font-size:16px;height:40px}
 .history-filters>.btn{grid-column:1/-1}.history-types{padding:0 8px 8px;gap:0}.history-types button{font-size:12px;min-height:40px;padding:8px}
 .history-summary{padding:10px 12px;gap:8px}.history-order{display:none}
 .history-event{grid-template-columns:56px minmax(0,1fr) 12px;gap:6px 10px;padding:12px}
 .history-event time{font-size:11px}.history-who{grid-column:2;flex-direction:row;flex-wrap:wrap;gap:4px 10px}.history-chevron{grid-column:3;grid-row:1/3}.history-object{font-size:14px}
 .history-detail{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.history-detail .bravo-dialog-body{padding:14px}
 .history-diff>div{grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr);gap:6px}.history-diff:not(.compact) .history-field{grid-column:1/-1}
 .history-detail>footer{padding:12px;flex-wrap:wrap}
}
