.tag-history-page { font-size: 11px; }
body[data-page="tagHistoryReport"] main > header { display: none; }
body[data-page="tagHistoryReport"] main { padding-top: 0; }
.tag-history-page > .section-head { padding: 15px 18px; margin-bottom: 12px; border-radius: 17px; background: linear-gradient(115deg,#0d4e3b,#20795b); color: #fff; box-shadow: 0 12px 30px rgba(13,78,59,.18); }
.tag-history-page > .section-head h2 { font-size: 20px; }
.tag-history-page > .section-head h2,.tag-history-page > .section-head p { color: #fff; }
.tag-history-page > .section-head p { opacity: .78; }
.tag-history-search { position: sticky; top: 8px; z-index: 5; display: flex; align-items: end; gap: 12px; padding: 13px 15px; margin-bottom: 14px; border-color: #b8d3c7; box-shadow: 0 9px 25px rgba(16,74,56,.11); }
.tag-history-search label { flex: 1; display: grid; gap: 7px; color: #5f7068; font-size: 12px; }
.tag-history-search input { width: 100%; border: 1px solid #cbd9d2; border-radius: 10px; padding: 12px; font-size: 16px; outline: none; text-transform: uppercase; }
.tag-history-search input:focus { border-color: #258462; box-shadow: 0 0 0 3px rgba(37,132,98,.12); }
.tag-history-message { padding: 45px 20px; text-align: center; color: #718079; }
.tag-history-overview { display: grid; grid-template-columns: 205px minmax(0,1fr); gap: 12px; margin-bottom: 12px; }
.tag-history-image-card,.tag-history-main-card,.tag-history-section { border: 1px solid #dce5e0; border-radius: 16px; background: #fffdf9; box-shadow: 0 6px 22px rgba(20,64,51,.05); }
.tag-history-image-card { overflow: hidden; min-height: 205px; display: grid; place-items: center; background: linear-gradient(145deg,#f0f5f2,#e2ece7); }
.tag-history-image-card img { width: 100%; height: 100%; max-height: 280px; object-fit: contain; background: #fff; cursor: zoom-in; }
.tag-history-image-placeholder { display: grid; place-items: center; gap: 9px; padding: 25px; color: #7a8781; text-align: center; }
.tag-history-image-placeholder b { font-size: 42px; color: #aebbb4; }
.tag-history-main-card { padding: 15px; border-top: 4px solid #d7ae52; }
.tag-history-title { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding-bottom: 13px; border-bottom: 1px solid #e4eae7; }
.tag-history-title small { color: #73827b; }
.tag-history-title h3 { margin: 4px 0 0; color: #123d32; font-size: 17px; }
.tag-history-status { border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 800; }
.tag-status-AVAILABLE { background: #e3f5e9; color: #217047; }
.tag-status-SOLD { background: #e6effb; color: #2b6196; }
.tag-status-STOCK_TRANSFERRED,.tag-status-NOT_AVAILABLE { background: #ffe8e5; color: #b72d27; }
.tag-history-facts { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.tag-history-facts div { padding: 8px 9px; border: 1px solid #e5ece8; border-radius: 10px; background: linear-gradient(145deg,#f8faf8,#f0f5f2); min-width: 0; }
.tag-history-facts small { display: block; color: #74827c; margin-bottom: 4px; }
.tag-history-facts b { display: block; color: #193d34; font-size: 11px; overflow-wrap: anywhere; }
.tag-history-facts em { display: block; margin-top: 3px; color: #7c8983; font-size: 10px; font-style: normal; }
.tag-history-facts .tag-history-mrp { border-color: #e3c273; background: linear-gradient(145deg,#fff9e8,#fff1c9); }
.tag-history-facts .tag-history-mrp small { color: #8b6508; font-weight: 800; }
.tag-history-facts .tag-history-mrp b { color: #9c6800; font-size: 15px; }
.tag-history-facts .tag-history-created-by { border-color: #acd2c0; background: linear-gradient(145deg,#edf9f3,#e1f2ea); }
.tag-history-finance { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 0 0 12px; }
.tag-history-finance article { padding: 15px; border: 1px solid #dce6e1; border-radius: 14px; background: #fff; }
.tag-history-finance small { display: block; color: #718079; margin-bottom: 7px; }
.tag-history-finance strong { color: #123d32; font-size: 16px; }
.tag-history-finance .profit strong { color: #16804d; }
.tag-history-finance .loss strong { color: #c7352e; }
.tag-history-section { padding: 14px; margin-bottom: 12px; overflow: hidden; border-left: 4px solid #79a995; }
.tag-history-section h3 { margin: 0 0 4px; color: #153f34; font-size: 14px; }
.tag-history-section > p { margin: 0 0 12px; color: #718079; font-size: 12px; }
.tag-history-table { width: 100%; border-collapse: collapse; }
.tag-history-table th,.tag-history-table td { padding: 9px 10px; border-bottom: 1px solid #e5ebe8; text-align: left; }
.tag-history-table th { background: #f0f5f2; color: #587068; font-size: 11px; }
.tag-history-table td { color: #28473e; font-size: 10px; }
.tag-stone-inactive { opacity: .62; background: #f4f4f4; }
.tag-stone-status { display:inline-block; padding:3px 7px; border-radius:999px; font-size:9px; font-weight:800; }
.tag-stone-status.active { background:#e2f4e9;color:#26704a; }.tag-stone-status.inactive { background:#f1e7e5;color:#9b4b43; }
.tag-history-timeline { position: relative; display: grid; gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px 8px 2px 23px; scrollbar-color: #8eb7a6 #edf3f0; scrollbar-width: thin; }
.tag-history-timeline:before { content:""; position:absolute; left:7px; top:4px; bottom:4px; width:2px; background:#b8d4c7; }
.tag-history-event { position: relative; padding: 11px 13px; border-radius: 11px; background: #f3f7f5; }
.tag-history-event:before { content:""; position:absolute; left:-21px; top:15px; width:10px; height:10px; border:3px solid #fff; border-radius:50%; background:#28825f; box-shadow:0 0 0 1px #7fb49f; }
.tag-history-event b { color:#1a493b; }
.tag-history-event small { display:block; margin-top:4px; color:#77857f; }
.tag-upload-download-event { border:1px solid #d7e5f2; background:linear-gradient(135deg,#f4f9fd,#eef6fb); }
.tag-upload-download-event:before { background:#2872a8; box-shadow:0 0 0 1px #78a9cb; }
.tag-upload-download-event em { display:block; margin-top:4px; color:#47718f; font-size:9px; font-style:normal; font-weight:700; }
.tag-transfer-alert { padding: 12px 14px; margin-top: 12px; border: 1px solid #efb5ae; border-radius: 11px; background: #fff0ee; color: #a72d27; font-weight: 700; }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body[data-page="tagHistoryReport"] .sidebar,body[data-page="tagHistoryReport"] header,body[data-page="tagHistoryReport"] .section-head button,body[data-page="tagHistoryReport"] .tag-history-search,body[data-page="tagHistoryReport"] #reportBranchBar { display:none!important; }
  body[data-page="tagHistoryReport"] main { margin:0!important; padding:0!important; }
  body[data-page="tagHistoryReport"] .page { display:none!important; }
  body[data-page="tagHistoryReport"] #tagHistoryReport { display:block!important; }
  .tag-history-overview { grid-template-columns: 150px 1fr; }
  .tag-history-image-card { min-height:150px; }
  .tag-history-section,.tag-history-overview,.tag-history-finance { break-inside:avoid; box-shadow:none; }
}
@media (max-width: 760px) {
  .tag-history-page > .section-head { padding: 14px; border-radius: 13px; }
  .tag-history-search { top: 5px; padding: 10px; }
  .tag-history-search { align-items:stretch; flex-direction:column; }
  .tag-history-overview { grid-template-columns: 1fr; }
  .tag-history-image-card { min-height:180px; max-height:260px; }
  .tag-history-finance { grid-template-columns: repeat(2,1fr); }
  .tag-history-facts { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:6px; scrollbar-width:thin; }
  .tag-history-facts > div { flex:0 0 145px; scroll-snap-align:start; }
  .tag-history-section { padding: 13px; }
  .tag-history-table,.tag-history-table tbody,.tag-history-table tr,.tag-history-table td { display:block; }
  .tag-history-table thead { display:none; }
  .tag-history-table tr { padding:8px 0; border-bottom:1px solid #dfe7e3; }
  .tag-history-table td { display:flex; justify-content:space-between; gap:12px; border:0; padding:4px; text-align:right; }
  .tag-history-table td:before { content:attr(data-label); color:#77857f; text-align:left; }
}
