/* PRIMIX_SMART_HISTORY_CSS_V9 */
#pmxSmartHistoryPanel{
  margin-top:12px;
  margin-bottom:14px;
  border:1px solid rgba(99,102,241,.10);
  box-shadow:0 8px 24px rgba(15,23,42,.04);
}

#pmxSmartHistoryPanel .pmx-sh-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}

#pmxSmartHistoryPanel .pmx-sh-title{
  font-size:17px;
  font-weight:800;
  margin-bottom:4px;
  letter-spacing:-.01em;
}

#pmxSmartHistoryPanel .pmx-sh-sub{
  font-size:12px;
  opacity:.74;
  max-width:760px;
  line-height:1.6;
}

#pmxSmartHistoryPanel .pmx-sh-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

#pmxSmartHistoryPanel .pmx-sh-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

#pmxSmartHistoryPanel .pmx-sh-stats{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}

#pmxSmartHistoryPanel .pmx-sh-stat{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(99,102,241,.10);
  background:rgba(99,102,241,.04);
  color:#334155;
  font-size:11px;
  font-weight:800;
}

#pmxSmartHistoryPanel .pmx-sh-controls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

#pmxSmartHistoryPanel .pmx-sh-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

#pmxSmartHistoryPanel .pmx-sh-filter{
  border:1px solid rgba(148,163,184,.22);
  border-radius:999px;
  background:#fff;
  color:#334155;
  padding:7px 12px;
  font-size:12px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  transition:.16s ease;
}

#pmxSmartHistoryPanel .pmx-sh-filter:hover{
  border-color:rgba(99,102,241,.26);
  background:rgba(99,102,241,.04);
}

#pmxSmartHistoryPanel .pmx-sh-filter.active{
  background:linear-gradient(180deg, rgba(99,102,241,.12), rgba(99,102,241,.08));
  border-color:rgba(99,102,241,.24);
  color:#4338ca;
}

#pmxSmartHistoryPanel .pmx-sh-search{
  min-width:240px;
  max-width:320px;
  width:min(42vw,320px);
  border:1px solid rgba(148,163,184,.22);
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  padding:10px 12px;
  font-size:13px;
  outline:none;
  box-shadow:none;
}

#pmxSmartHistoryPanel .pmx-sh-search:focus{
  border-color:rgba(99,102,241,.35);
  box-shadow:0 0 0 3px rgba(99,102,241,.08);
}

#pmxSmartHistoryPanel .pmx-sh-sort{
  border:1px solid rgba(148,163,184,.22);
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  padding:10px 12px;
  font-size:13px;
  min-height:40px;
  outline:none;
}

#pmxSmartHistoryPanel .pmx-sh-sort:focus{
  border-color:rgba(99,102,241,.35);
  box-shadow:0 0 0 3px rgba(99,102,241,.08);
}

#pmxSmartHistoryPanel .pmx-sh-list{
  display:grid;
  gap:8px;
  margin-top:12px;
}

#pmxSmartHistoryPanel .pmx-sh-section{
  margin-top:12px;
}

#pmxSmartHistoryPanel .pmx-sh-section-title{
  font-size:13px;
  font-weight:800;
  margin-bottom:8px;
  opacity:.9;
  color:#334155;
}

#pmxSmartHistoryPanel .pmx-sh-item{
  border:1px solid rgba(148,163,184,.18);
  border-radius:14px;
  padding:12px;
  background:linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.96));
  box-shadow:0 4px 14px rgba(15,23,42,.03);
}

#pmxSmartHistoryPanel .pmx-sh-item.pinned{
  border-color:rgba(245,158,11,.24);
  background:linear-gradient(180deg, rgba(255,251,235,.96), rgba(255,255,255,.96));
  box-shadow:0 8px 18px rgba(245,158,11,.05);
}

#pmxSmartHistoryPanel .pmx-sh-itemhead{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  flex-wrap:wrap;
}

#pmxSmartHistoryPanel .pmx-sh-name{
  font-weight:800;
  margin-bottom:6px;
  color:#0f172a;
  line-height:1.45;
}

#pmxSmartHistoryPanel .pmx-sh-meta{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}

#pmxSmartHistoryPanel .pmx-sh-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  border:1px solid transparent;
  line-height:1;
}

#pmxSmartHistoryPanel .pmx-sh-chip.invoice{
  background:rgba(59,130,246,.10);
  border-color:rgba(59,130,246,.20);
  color:#1d4ed8;
}

#pmxSmartHistoryPanel .pmx-sh-chip.purchase_bill{
  background:rgba(245,158,11,.12);
  border-color:rgba(245,158,11,.22);
  color:#b45309;
}

#pmxSmartHistoryPanel .pmx-sh-chip.review{
  background:rgba(148,163,184,.12);
  border-color:rgba(148,163,184,.22);
  color:#475569;
}

#pmxSmartHistoryPanel .pmx-sh-chip.status{
  background:rgba(34,197,94,.10);
  border-color:rgba(34,197,94,.20);
  color:#15803d;
}

#pmxSmartHistoryPanel .pmx-sh-chip.pin{
  background:rgba(245,158,11,.10);
  border-color:rgba(245,158,11,.20);
  color:#a16207;
}

#pmxSmartHistoryPanel .pmx-sh-kv{
  display:grid;
  grid-template-columns:138px 1fr;
  gap:7px 12px;
  margin-top:10px;
}

#pmxSmartHistoryPanel .pmx-sh-k{
  opacity:.72;
  font-size:12px;
  color:#475569;
}

#pmxSmartHistoryPanel .pmx-sh-v{
  word-break:break-word;
  color:#0f172a;
  font-size:13px;
}

#pmxSmartHistoryPanel .pmx-sh-links{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

#pmxSmartHistoryPanel .pmx-sh-empty{
  margin-top:12px;
  padding:13px 14px;
  border:1px dashed rgba(148,163,184,.26);
  border-radius:14px;
  background:rgba(248,250,252,.72);
  color:#475569;
  font-size:13px;
}

#pmxSmartHistoryPanel .pmx-sh-hidden{
  display:none !important;
}

#pmxSmartHistoryPanel .pmx-sh-compact{
  margin-top:12px;
  border:1px dashed rgba(99,102,241,.20);
  border-radius:14px;
  padding:12px;
  background:linear-gradient(180deg, rgba(99,102,241,.04), rgba(255,255,255,.92));
}

#pmxSmartHistoryPanel .pmx-sh-compact-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}

#pmxSmartHistoryPanel .pmx-sh-compact-title{
  font-size:13px;
  font-weight:800;
  margin-bottom:4px;
  color:#1e293b;
}

#pmxSmartHistoryPanel .pmx-sh-compact-sub{
  font-size:12px;
  opacity:.78;
  color:#475569;
  line-height:1.6;
  max-width:780px;
}

#pmxSmartHistoryPanel .pmx-sh-compact-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}

#pmxSmartHistoryPanel.pmx-sh-collapsed .pmx-sh-body{
  display:none;
}

#pmxSmartHistoryPanel:not(.pmx-sh-collapsed) .pmx-sh-compact{
  display:none;
}

#pmxSmartHistoryPanel.pmx-sh-collapsed .pmx-sh-expanded-only{
  display:none !important;
}

#pmxSmartHistoryPanel .pmx-btn{
  min-height:36px;
  padding:8px 12px;
  border-radius:10px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(148,163,184,.20);
  background:#fff;
  color:#334155;
  line-height:1.1;
  box-shadow:none;
  transition:.16s ease;
}

#pmxSmartHistoryPanel .pmx-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(99,102,241,.24);
  background:rgba(99,102,241,.04);
}

#pmxSmartHistoryPanel .pmx-btn.primary,
#pmxSmartHistoryPanel .pmx-btn.pmx-btn-primary{
  background:linear-gradient(180deg, #6366f1, #5856eb);
  color:#fff;
  border-color:transparent;
}

#pmxSmartHistoryPanel .pmx-btn.primary:hover,
#pmxSmartHistoryPanel .pmx-btn.pmx-btn-primary:hover{
  background:linear-gradient(180deg, #5b5ff0, #4f46e5);
}

#pmxSmartHistoryPanel .pmx-btn.warn{
  background:#fff7ed;
  color:#c2410c;
  border-color:rgba(251,146,60,.22);
}

#pmxSmartHistoryPanel .pmx-btn.bad{
  background:#fff1f2;
  color:#be123c;
  border-color:rgba(244,63,94,.20);
}

#pmxSmartHistoryToast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%) translateY(12px);
  background:#0f172a;
  color:#fff;
  padding:10px 14px;
  border-radius:12px;
  font-size:12px;
  font-weight:800;
  opacity:0;
  pointer-events:none;
  transition:.18s ease;
  z-index:9999;
  box-shadow:0 10px 28px rgba(15,23,42,.18);
}

#pmxSmartHistoryToast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

@media (max-width: 860px){
  #pmxSmartHistoryPanel .pmx-sh-toolbar{
    flex-direction:column;
    align-items:stretch;
  }
  #pmxSmartHistoryPanel .pmx-sh-controls{
    width:100%;
  }
  #pmxSmartHistoryPanel .pmx-sh-search{
    min-width:unset;
    max-width:unset;
    width:100%;
  }
}

@media (max-width: 760px){
  #pmxSmartHistoryPanel .pmx-sh-kv{
    grid-template-columns:1fr;
  }
}
