/* ============================================================
   Chemtex ERP - Sales : Tally Sync console
   Uses the existing token set only - no new colours are introduced.
   ============================================================ */

/* Which books are we about to write to. The clone and the live company share a
   Tally GUID, so this banner is a safety device, not decoration. */
/* .card carries NO padding of its own - it comes from .card-body / .card-head,
   and .card has overflow:hidden. Content dropped straight into a .card therefore
   sits flush against the border and clips. These two own their spacing. */
/* Two-column banner (MIS, 27 Oct): identity on the left, live status chips on
   the right, so the card reads across the width instead of stacking four rows
   and eating vertical space. Wraps to stacked on a narrow viewport. */
.tl-banner { display:flex; flex-direction:row; flex-wrap:wrap; align-items:center;
  justify-content:space-between; gap:8px 24px; padding:12px 16px;
  border-left:3px solid var(--green); }
.tl-ident { display:flex; flex-direction:column; gap:3px; min-width:220px; }
.tl-status { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin-left:auto; }
.tl-status .tl-sub { margin:0; }
.tl-banner.tl-live { border-left-color:var(--red); background:var(--red-50); }
/* The clone had no rule at all, so it fell through to the base green border on a
   white card - the one state that most needs to look different looked like
   nothing. Amber matches the TEST CLONE pill it sits beside. */
.tl-banner.tl-clone { border-left-color:var(--amber-solid); background:var(--amber-50); }
.tl-banner strong { font-size:14px; }
.tl-pad { padding:14px 16px; }

.tl-k { display:block; margin-bottom:2px; font-size:11px; letter-spacing:.04em; text-transform:uppercase; color:var(--ink-3); }
.tl-sub { font-size:12px; color:var(--ink-3); }
/* Agent down / failing. This line sits inside an already-amber clone banner, so
   muted --ink-3 would let it disappear into the surround - the one line that
   must be read would be the least readable. Full ink weight and a tinted strip. */
.tl-agent-bad { color:var(--ink-1); font-weight:500;
  background:var(--red-50); border-radius:6px; padding:6px 8px; margin-top:2px; }
.tl-agent-bad em { font-style:normal; color:var(--red); }
.tl-rev { font-size:11px; color:var(--ink-3); }
.tl-ok { color:var(--green); font-weight:600; }
.tl-bad { color:var(--red); }
.tl-h { margin:0 0 4px; font-size:13px; letter-spacing:.03em; text-transform:uppercase; color:var(--ink-2); }

.tl-head {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:14px; padding:12px 0 16px; border-bottom:1px solid var(--line);
}

/* Three severities, three treatments. Blocking stops the submit outright;
   a warning is something the reviewer should read but may accept. */
.tl-err, .tl-warn, .tl-good { border-radius:var(--r-sm); padding:10px 12px; margin:12px 0; font-size:13px; }
.tl-err  { background:var(--red-50);    border-left:3px solid var(--red); }
.tl-good { background:var(--green-50);  border-left:3px solid var(--green); }
.tl-warn { background:var(--surface-2); border-left:3px solid var(--copper); }
.tl-err ul, .tl-warn ul { margin:6px 0 0 16px; padding:0; }
.tl-err p { margin:4px 0 0; }

.tl-list { margin:4px 0 0 16px; padding:0; font-size:13px; color:var(--ink-2); }
.tl-list li { margin:2px 0; }

/* The exact payload, collapsed. Nobody needs it until something is wrong,
   and then nothing else will do. */
.tl-xml { margin-top:18px; }
.tl-xml summary { cursor:pointer; font-size:12px; color:var(--ink-3); }
.tl-xml pre {
  margin-top:8px; max-height:260px; overflow:auto; white-space:pre-wrap; word-break:break-all;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm);
  padding:10px; font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--ink-2);
}

.tl-ovr { margin-top:4px; max-width:100%; font-size:12px; }

/* Sales-order page Tally panel. Sits among the order's own cards, so it must
   read as one of them - not as a console bolted onto the side. */
.tl-sopanel { display:flex; flex-direction:column; gap:6px; }
.tl-acts { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.tl-issues { margin:6px 0 0; padding-left:18px; }
.tl-issues li { margin:2px 0; }
.tl-sopanel { border:1px solid var(--line); border-left:3px solid var(--copper);
  border-radius:var(--r-sm); padding:12px 14px; margin-bottom:14px; }
