/* ════════════════════════════════════════════════════════════════
   Bench Tester — MAGNETTO CAN PRO desktop-app mockup
   ────────────────────────────────────────────────────────────────
   Replaces the light blue "Pro Analyzer" UI with a dark, real-app
   feel matching the actual Magnetto CAN PRO desktop client:
   logo + brand + status pills, connection bar with COM/CAN cards,
   two rows of colored gradient pill buttons, and a dark traffic
   table with the exact column labels (Czas, D…, B…, K…, ID, D…,
   Dane, Count, Period).
   ════════════════════════════════════════════════════════════════ */

.bt-az-win--magnetto {
  background: linear-gradient(180deg, #0d0e14 0%, #11131a 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--bt-sans, "Barlow", system-ui, sans-serif);
  color: #e6e8ee;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(200, 0, 28, .08),
    0 0 60px rgba(200, 0, 28, .05);
}

/* ────────────── Top header bar ────────────── */
.bt-az-topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background:
    linear-gradient(90deg, rgba(13, 14, 20, .96), rgba(20, 22, 32, .92)),
    radial-gradient(ellipse 60% 100% at 30% 50%, rgba(34, 197, 94, .06), transparent 60%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.bt-az-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(34, 197, 94, .08) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center;
  pointer-events: none;
  opacity: .5;
}
.bt-az-topbar > * { position: relative; }

.bt-az-topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.bt-az-topbar__logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1f2330 0%, #14161e 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.bt-az-topbar__logo svg {
  width: 18px;
  height: 18px;
  color: #fff;
}
.bt-az-topbar__brand-text strong {
  display: block;
  font-family: var(--bt-cond, "Barlow Condensed", sans-serif);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1;
  text-transform: uppercase;
}
.bt-az-topbar__brand-text span {
  display: block;
  font-family: var(--bt-mono, monospace);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, .35);
  margin-top: 3px;
  text-transform: uppercase;
}

/* Decorative center nodes */
.bt-az-topbar__center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.bt-az-topbar__node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(34, 197, 94, .4);
  box-shadow: 0 0 6px rgba(34, 197, 94, .5);
}
.bt-az-topbar__node--mid {
  width: 8px;
  height: 8px;
  background: rgba(34, 197, 94, .7);
}
.bt-az-topbar__line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, .3), transparent);
}

.bt-az-topbar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.bt-az-topbar__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  font-family: var(--bt-mono, monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, .8);
}
.bt-az-topbar__pill svg { color: rgba(255, 255, 255, .55); }
.bt-az-topbar__pill strong { color: #fff; font-weight: 700; }
.bt-az-topbar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, .8);
  animation: btAzPulse 2s ease infinite;
}
@keyframes btAzPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}
.bt-az-topbar__flag {
  width: 22px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, .2);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.bt-az-topbar__flag:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, .55);
}
/* Polish flag — white over red */
.bt-az-topbar__flag--pl {
  background: linear-gradient(180deg, #fff 0 50%, #DC143C 50% 100%);
}
/* English flag (Union Jack — schematic) */
.bt-az-topbar__flag--gb {
  background:
    linear-gradient(45deg, transparent 44%, #C8102E 44% 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #C8102E 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 38%, #fff 38% 62%, transparent 62%),
    linear-gradient(90deg, transparent 38%, #fff 38% 62%, transparent 62%),
    linear-gradient(0deg, transparent 44%, #C8102E 44% 56%, transparent 56%),
    linear-gradient(90deg, transparent 44%, #C8102E 44% 56%, transparent 56%),
    #012169;
}
.bt-az-topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 6px;
  background: rgba(220, 38, 38, .14);
  border: 1px solid rgba(220, 38, 38, .35);
  color: #fca5a5;
  font-family: var(--bt-cond, sans-serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ────────────── Connection bar ────────────── */
.bt-az-conn {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .015);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  flex-wrap: wrap;
}
.bt-az-conn__group {
  display: flex;
  gap: 6px;
}
.bt-az-cbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  border-radius: 6px;
  font-family: var(--bt-cond, sans-serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .2s ease, transform .2s ease;
}
.bt-az-cbtn:hover:not([disabled]) { filter: brightness(1.1); transform: translateY(-1px); }
.bt-az-cbtn[disabled] { opacity: .45; cursor: not-allowed; }
.bt-az-cbtn--green {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, .3);
}
.bt-az-cbtn--red {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .3);
}
.bt-az-cbtn--ghost {
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 255, 255, .12);
}
.bt-az-cbtn--detect {
  background: linear-gradient(180deg, rgba(59, 130, 246, .15), rgba(59, 130, 246, .05));
  border-color: rgba(59, 130, 246, .25);
  color: rgba(147, 197, 253, .85);
  flex-shrink: 0;
}

.bt-az-conn__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: 6px 12px;
  min-width: 160px;
}
.bt-az-conn__lbl {
  font-family: var(--bt-mono, monospace);
  font-size: 8.5px;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, .4);
  text-transform: uppercase;
}
.bt-az-conn__row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12.5px;
}
.bt-az-conn__row svg { color: rgba(255, 255, 255, .55); flex-shrink: 0; }
.bt-az-conn__val {
  font-family: var(--bt-mono, monospace);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.bt-az-conn__caret {
  color: rgba(255, 255, 255, .4);
  font-size: 10px;
  margin-left: auto;
}
.bt-az-conn__icon {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, .45);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
}
.bt-az-conn__icon:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.bt-az-conn__check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--bt-mono, monospace);
  font-size: 9.5px;
  color: rgba(255, 255, 255, .55);
  letter-spacing: 0.5px;
  cursor: pointer;
}
.bt-az-conn__check input { width: 12px; height: 12px; accent-color: #3b82f6; margin: 0; }

/* ────────────── Tools — colored pills ────────────── */
.bt-az-tools {
  display: flex;
  align-items: center;
  flex: 1 1 420px;
  min-width: 0;
  margin-left: auto;
}
.bt-az-tools__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.bt-az-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  font-family: var(--bt-cond, sans-serif);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4),
              inset 0 1px 0 rgba(255, 255, 255, .14);
}
.bt-az-pill:hover { filter: brightness(1.18); transform: translateY(-1px); }
.bt-az-pill--purple  { background: linear-gradient(180deg, #7e22ce, #581c87); }
.bt-az-pill--violet  { background: linear-gradient(180deg, #8b5cf6, #6d28d9); }
.bt-az-pill--magenta { background: linear-gradient(180deg, #be185d, #9d174d); }
.bt-az-pill--orange  { background: linear-gradient(180deg, #f97316, #c2410c); }
.bt-az-pill--green   { background: linear-gradient(180deg, #22c55e, #16a34a); }
.bt-az-pill--teal    { background: linear-gradient(180deg, #14b8a6, #0f766e); }
.bt-az-pill--cyan    { background: linear-gradient(180deg, #06b6d4, #0e7490); }
.bt-az-pill--blue    { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.bt-az-pill--slate   { background: linear-gradient(180deg, #475569, #1e293b); }
.bt-az-pill--red     { background: linear-gradient(180deg, #ef4444, #b91c1c); box-shadow: 0 4px 14px rgba(220, 38, 38, .35), inset 0 1px 0 rgba(255, 255, 255, .15); }

/* ────────────── Body — dark 3-column layout ────────────── */
.bt-az-win--magnetto .bt-az-body {
  background: #0e1018;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.bt-az-win--magnetto .bt-az-left {
  background: rgba(255, 255, 255, .015);
  border-right: 1px solid rgba(255, 255, 255, .04);
  max-height: 480px;
}
.bt-az-win--magnetto .bt-az-panel-hdr {
  color: rgba(255, 255, 255, .85);
  border-bottom-color: rgba(255, 255, 255, .04);
  font-family: var(--bt-cond, sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 12px 14px;
  text-transform: uppercase;
}
.bt-az-win--magnetto .bt-az-link,
.bt-az-win--magnetto .bt-az-link--grey {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: var(--bt-cond, sans-serif);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.bt-az-win--magnetto .bt-az-link {
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85);
}
.bt-az-win--magnetto .bt-az-link--grey {
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .45);
}
.bt-az-win--magnetto .bt-az-id-chip {
  border-bottom-color: rgba(255, 255, 255, .03);
  color: rgba(255, 255, 255, .8);
  padding: 5px 14px;
  font-size: 9.5px;
}
.bt-az-win--magnetto .bt-az-id-chip:hover {
  background: rgba(59, 130, 246, .08);
}
.bt-az-win--magnetto .bt-az-idcount {
  color: rgba(255, 255, 255, .35);
  border-top-color: rgba(255, 255, 255, .04);
  padding: 8px 14px;
  font-size: 9px;
}

.bt-az-win--magnetto .bt-az-center {
  background: #0a0c12;
}
.bt-az-win--magnetto .bt-az-traffic-hdr {
  background: rgba(255, 255, 255, .015);
  border-bottom-color: rgba(255, 255, 255, .05);
  padding: 10px 16px;
  gap: 10px;
}
.bt-az-win--magnetto .bt-az-traffic-hdr__t {
  color: #fff !important;
  font-family: var(--bt-cond, sans-serif);
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 13px !important;
}
.bt-az-traffic-hdr__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #7e22ce, #581c87);
  color: #fff;
  font-family: var(--bt-cond, sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.bt-az-win--magnetto .bt-az-check {
  color: rgba(255, 255, 255, .7) !important;
  font-size: 10.5px;
  letter-spacing: 0.3px;
}
.bt-az-win--magnetto .bt-az-check input { accent-color: #3b82f6; }

.bt-az-win--magnetto .bt-az-thead {
  background: rgba(255, 255, 255, .025);
  border-bottom: 2px solid rgba(59, 130, 246, .35);
  color: rgba(255, 255, 255, .55);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 14px;
}
.bt-az-win--magnetto .bt-az-row {
  border-bottom-color: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .8);
  font-size: 9.5px;
  padding: 4px 14px;
}
.bt-az-win--magnetto .bt-az-row:hover { background: rgba(59, 130, 246, .06); }
.bt-az-win--magnetto .bt-az-row.flash {
  background: rgba(34, 197, 94, .12);
  animation: btAzFlash 1s ease-out;
}
@keyframes btAzFlash {
  0%   { background: rgba(34, 197, 94, .25); }
  100% { background: transparent; }
}
.bt-az-win--magnetto .bt-az-ts { color: rgba(255, 255, 255, .4) !important; }
.bt-az-win--magnetto .bt-az-id-dbc { color: #c084fc; }
.bt-az-win--magnetto .bt-az-id-std { color: #5eead4; }
.bt-az-win--magnetto .bt-az-id-ext { color: #fb923c; }
.bt-az-win--magnetto .bt-az-dir-in { color: #f87171; }
.bt-az-win--magnetto .bt-az-dir-out { color: rgba(255, 255, 255, .35); }
.bt-az-win--magnetto .bt-az-byte {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85) !important;
  font-size: 8.5px !important;
}
.bt-az-win--magnetto .bt-az-byte.changed {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, .6);
}
.bt-az-win--magnetto .bt-az-cnt { color: rgba(147, 197, 253, .85); }
.bt-az-win--magnetto .bt-az-period { color: rgba(255, 255, 255, .35); }

.bt-az-win--magnetto .bt-az-statusbar {
  background: rgba(0, 0, 0, .35);
  border-top-color: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .45);
  font-size: 9px;
  padding: 6px 14px;
}
.bt-az-win--magnetto .bt-az-statusbar .bt-az-blue { color: #93c5fd !important; }
.bt-az-win--magnetto .bt-az-statusbar .bt-az-green { color: #86efac !important; }

.bt-az-win--magnetto .bt-az-right {
  background: rgba(0, 0, 0, .25);
  border-left: 1px solid rgba(255, 255, 255, .05);
}
.bt-az-win--magnetto .bt-az-send {
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .07);
  border-radius: 6px;
}
.bt-az-win--magnetto .bt-az-send__hdr {
  color: rgba(255, 255, 255, .85);
  font-family: var(--bt-cond, sans-serif);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.bt-az-win--magnetto .bt-az-send__lbl { color: rgba(255, 255, 255, .55); }
.bt-az-win--magnetto .bt-az-input {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
  color: #93c5fd;
  font-weight: 600;
}
.bt-az-win--magnetto .bt-az-sbyte {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .85);
  border-radius: 4px;
  height: 28px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.bt-az-win--magnetto .bt-az-sbyte.is-sel {
  background: rgba(59, 130, 246, .18);
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 8px rgba(59, 130, 246, .35);
}
.bt-az-win--magnetto .bt-az-curval {
  color: rgba(255, 255, 255, .65);
}
.bt-az-win--magnetto .bt-az-multi-hdr {
  color: rgba(255, 255, 255, .55);
}
.bt-az-win--magnetto .bt-az-frame-hdr { color: rgba(255, 255, 255, .8); }
.bt-az-win--magnetto .bt-az-mini-l { color: rgba(255, 255, 255, .35); }
.bt-az-win--magnetto .bt-az-sending {
  color: #93c5fd;
}

.bt-az-win--magnetto .bt-az-statusbar--bottom {
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .45);
  border-top-color: rgba(255, 255, 255, .05);
}

/* ────────────── Responsive ────────────── */
@media (max-width: 1100px) {
  .bt-az-tools__row { justify-content: flex-start; }
}
@media (max-width: 900px) {
  .bt-az-topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .bt-az-topbar__center { display: none; }
  .bt-az-topbar__meta {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  .bt-az-conn {
    gap: 8px;
    padding: 10px 12px;
  }
  .bt-az-conn__group {
    order: 1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bt-az-conn__field {
    width: calc(50% - 4px);
    min-width: 0;
  }
  .bt-az-cbtn--detect {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .bt-az-tools {
    order: 4;
    width: 100%;
    margin-left: 0;
  }
  .bt-az-tools__row {
    justify-content: flex-start;
    gap: 6px;
  }
  .bt-az-pill {
    font-size: 10px;
    padding: 6px 10px;
  }
  .bt-az-traffic-hdr {
    padding: 10px 12px;
  }
  .bt-az-win--magnetto .bt-az-statusbar {
    flex-wrap: wrap;
    gap: 6px;
  }
}
@media (max-width: 600px) {
  .bt-az-topbar {
    padding: 10px 12px;
  }
  .bt-az-topbar__brand-text strong { font-size: 13px; }
  .bt-az-topbar__brand-text span { display: none; }
  .bt-az-topbar__pill { padding: 4px 7px; font-size: 10px; }
  .bt-az-topbar__status { font-size: 10px; padding: 4px 8px; }
  .bt-az-topbar__flag { display: none; }
  .bt-az-topbar__meta {
    justify-content: flex-start;
  }
  .bt-az-conn {
    padding: 10px;
  }
  .bt-az-conn__group {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .bt-az-cbtn { font-size: 11px; height: 34px; padding: 0 9px; justify-content: center; }
  .bt-az-conn__field {
    width: 100%;
    padding: 5px 10px;
    min-width: 0;
  }
  .bt-az-tools__row {
    gap: 5px;
  }
  .bt-az-pill {
    font-size: 9px;
    padding: 5px 8px;
  }
  .bt-az-win--magnetto .bt-az-traffic-hdr {
    align-items: flex-start;
  }
  .bt-az-win--magnetto .bt-az-check {
    font-size: 9.5px;
  }
  .bt-az-win--magnetto .bt-az-thead,
  .bt-az-win--magnetto .bt-az-row {
    padding-left: 10px;
    padding-right: 10px;
  }
  .bt-az-win--magnetto .bt-az-right {
    padding: 8px;
  }
}

@media (max-width: 420px) {
  .bt-az-conn__group {
    grid-template-columns: 1fr;
  }
  .bt-az-cbtn {
    width: 100%;
  }
  .bt-az-topbar__pill {
    font-size: 9px;
  }
  .bt-az-topbar__status {
    width: 100%;
    justify-content: center;
  }
  .bt-az-pill {
    font-size: 8.5px;
    padding: 5px 7px;
  }
  .bt-az-tools__row {
    gap: 4px;
  }
}
