/* TFORMer Server's web interface for the product hero (Pages/Shared/Sections/HeroApps/_ServerWindow.cshtml), in
   the shared browser bar: header with job counters and status, tab bar, actions row and the message list, laid out
   like the real interface. Builds on app-window.css (frame, browser bar, keyframes); loaded only by the partial.
   No Tailwind, no site tokens. Colours sampled from the interface. */

.tec-appwin--server {
  --srv-blue: #336699;
  --srv-light: #e0f0ff;
  --srv-green: #008000;
  --srv-gold: #ddaa00;

  border-radius: 12px 12px 0 0;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.5px;
}
.tec-appwin--server u { text-decoration: underline; text-underline-offset: 1px; }

.tec-appwin__srv-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---- header: name, counters, status ---- */
.tec-appwin__srv-head { flex: none; display: flex; align-items: stretch; gap: 3px; padding-left: 8px; background: var(--srv-light); }
.tec-appwin__srv-name { flex: 1.3; min-width: 0; padding: 6px 0 5px; }
.tec-appwin__srv-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tec-appwin__srv-view { margin-top: 3px; font-size: 9.5px; white-space: nowrap; }
.tec-appwin__srv-stats { position: relative; flex: 1; min-width: 0; padding-top: 5px; font-size: 8px; font-weight: 700; line-height: 1.55; white-space: nowrap; }
.tec-appwin__srv-stats p { position: absolute; top: 5px; left: 0; }
.tec-appwin__srv-stats span { display: block; }
.tec-appwin__srv-before { visibility: hidden; }   /* the finished state shows the counters after printing */
.tec-appwin__srv-state { flex: 0 0 18%; display: grid; place-items: center; margin: 2px 0 0; background: var(--srv-green); font-size: 14px; font-weight: 700; color: #fff; }
.tec-appwin__srv-state:last-child { margin-right: 2px; }

/* ---- tabs ---- */
.tec-appwin__srv-tabs { flex: none; display: flex; gap: 2px; padding: 2px 2px 0; }
.tec-appwin__srv-tabs > span { flex: 1; min-width: 0; padding: 5px 2px; background: var(--srv-blue); text-align: center; font-size: 10.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tec-appwin__srv-tabs > span.is-active { background: var(--srv-gold); }
.tec-appwin__srv-tabs > .tec-appwin__srv-busy { flex: 0 0 20px; display: grid; place-items: center; padding: 0; background: #fff; border: 1px solid var(--srv-blue); }
.tec-appwin__srv-busy svg { width: 13px; height: 13px; }

/* ---- actions ---- */
.tec-appwin__srv-actions { flex: none; display: flex; justify-content: space-between; margin-top: 2px; padding: 6px 8px 7px; background: var(--srv-light); font-size: 9.5px; line-height: 1.45; }
.tec-appwin__srv-count { text-align: right; }

/* ---- messages ---- */
.tec-appwin__srv-table { flex: 1; min-height: 0; overflow: hidden; margin-top: 3px; }
.tec-appwin__srv-row { display: grid; grid-template-columns: 78px 36px 58px 72px minmax(0, 1fr); align-items: start; }
.tec-appwin__srv-row > span { padding: 3px 5px; }
.tec-appwin__srv-row > span:nth-child(-n+2) { text-align: right; }
.tec-appwin__srv-row > span:nth-child(3) { display: flex; align-items: center; gap: 4px; }
.tec-appwin__srv-row svg { width: 10px; height: 12px; flex: none; }
.tec-appwin__srv-row > span:last-child { overflow-wrap: anywhere; }
.tec-appwin__srv-row--head { margin-bottom: 2px; background: var(--srv-blue); font-weight: 700; color: #fff; }
.tec-appwin__srv-row--head > span { padding: 4px 5px; border-right: 1px solid #fff; text-align: center !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- narrow windows ---- */
@container (max-width: 560px) {
  .tec-appwin__srv-stats { display: none; }
  .tec-appwin__srv-state { flex-basis: 24%; font-size: 12px; }
  /* Type and Code drop out; the description takes the third column. */
  .tec-appwin__srv-row { grid-template-columns: 46px 26px minmax(0, 1fr); }
  .tec-appwin__srv-row > span:nth-child(3), .tec-appwin__srv-row > span:nth-child(4) { display: none; }
  .tec-appwin__srv-tabs > span { font-size: 9px; }
}

/* ---- animation: the refresh icon turns, the spooled jobs print (the counters change) ---- */
.tec-appwin__srv-busy svg { animation: tec-appwin-spin 1s steps(8) 2.5; }
.tec-appwin__srv-before { animation: tec-appwin-gone 0s calc(var(--aw-start) + 1.4s) both; }
.tec-appwin__srv-after { animation: tec-appwin-key 0s calc(var(--aw-start) + 1.4s) both; }
@keyframes tec-appwin-spin { to { transform: rotate(360deg); } }
@keyframes tec-appwin-gone { from { visibility: visible; } to { visibility: hidden; } }
