/* Unified table system for Live Markets page */
:root{
  --tbl-border: #cfd6df;
  --tbl-border-strong: #b9c2cd;
  --tbl-head-bg: #020f52;
  --tbl-head-text: #ffffff;
  --tbl-row-odd: #f7fbff;
  --tbl-row-even: #ffffff;
  --tbl-row-hover: #eef5ff;
  --tbl-text: #111827;
}

/* Wrap tables you want scrollable inside .table-scroll */
.table-scroll{
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--tbl-border-strong);
  border-radius: 10px;
  background: #fff;
}

/* The table itself */
.lm-table{
  width: 100%;
  height:400px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--tbl-text);
  font-family: sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

/* Header */
.lm-table thead th{
  background: var(--tbl-head-bg);
  color: var(--tbl-head-text);
  text-align: left;
  padding: 10px 10px;
  font-weight: 800;
  border-bottom: 1px solid #1b2b7a;
  white-space: nowrap;
}

/* Make header sticky when inside .table-scroll */
.table-scroll .lm-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Cells and grid lines */
.lm-table tbody td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--tbl-border);
  border-right: 1px solid var(--tbl-border);
  vertical-align: top;
}

/* Left border for the grid */
.lm-table tbody tr td:first-child{
  border-left: 1px solid var(--tbl-border);
}

/* Header grid lines */
.lm-table thead th{
  border-right: 1px solid #1b2b7a;
}
.lm-table thead th:first-child{
  border-left: 1px solid #1b2b7a;
}

/* Alternate row colors */
.lm-table tbody tr:nth-child(odd){ background: var(--tbl-row-odd); }
.lm-table tbody tr:nth-child(even){ background: var(--tbl-row-even); }
.lm-table tbody tr:hover{ background: var(--tbl-row-hover); }

/* Optional: tighter look on small screens */
@media (max-width: 768px){
  .lm-table{ font-size: 12px; }
  .lm-table thead th, .lm-table tbody td{ padding: 8px 8px; }
}

/* Railcar Markets tabs (namespaced so nothing conflicts) */
/* Folder-style tabs */
.lm-tabs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:flex-start;
  margin: 10px 0 0;
  padding-left: 6px;
}

/* Base tab */
.lm-tab{
  appearance:none;
  border:1px solid #cfd6df;
  border-bottom:none;                 /* key to folder look */
  background:#eef2f7;                 /* inactive tab */
  color:#111827;
  padding: 9px 12px 8px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font: 800 13px/1.1 sans-serif;
  cursor:pointer;
  user-select:none;
  position:relative;
  top: 1px;                           /* sits into the table border */
  box-shadow: 0 -1px 0 rgba(0,0,0,0.02);
}

/* Hover */
.lm-tab:hover{
  background:#f7fbff;
}

/* Active tab */
.lm-tab.is-active{
  background:#ffffff;                 /* looks connected to the table */
  color:#020f52;
  z-index: 3;
  top: 0;                             /* lift it 1px above others */
  box-shadow: 0 -2px 0 rgba(2,15,82,0.12);
}

/* Optional: small accent line on active tab */
.lm-tab.is-active::before{
  content:"";
  position:absolute;
  left:0; right:0;
  top:-1px;
  height:3px;
  background:#020f52;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

/* Make the table container look like the tabs sit on it */
.table-scroll{
  border:1px solid #cfd6df;
  border-radius: 10px 20px 10px 10px;    /* square top-left so tab edge looks right */
  background:#fff;
  overflow:auto;
  max-height: 400px;
}

/* If you want perfectly flush join, remove top border behind tabs */
.table-scroll{
  border-top-left-radius: 10px;
}

/* Mobile: tabs full width */
@media (max-width: 520px){
  .lm-tabs{ padding-left: 0; }
  .lm-tab{ flex:1; text-align:center; }
}