:root {
  color-scheme: light;
  --navy: #062760;
  --navy-2: #041a3f;
  --blue: #0072bc;
  --sky: #bfeefd;
  --sky-2: #80cce9;
  --line: #1b76ff;
  --text: #061326;
  --white: #ffffff;
  --ok: #7fd83b;
  --warning: #fff200;
  --danger: #d90000;
  --delay: #d85a16;
}

* {
  box-sizing: border-box;
}

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Arial", "Segoe UI", sans-serif;
  background: var(--navy);
  overflow: hidden;
}

button {
  font: inherit;
}

.tv-shell {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

.screen-frame {
  display: grid;
  position: relative;
  grid-template-rows: clamp(50px, 7.2vh, 82px) 1fr clamp(48px, 6.5vh, 70px);
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #dff6ff 0%, var(--sky) 45%, var(--sky-2) 100%);
  box-shadow: inset 0 0 0 8px #111820;
  overflow: hidden;
}

.screen-frame::before {
  content: "";
  position: absolute;
  inset: clamp(82px, 10vh, 130px) clamp(34px, 6vw, 110px) clamp(70px, 9vh, 120px) auto;
  width: min(58vw, 760px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at center, transparent 0 27%, rgba(0, 114, 188, 0.14) 28% 39%, transparent 40%),
    repeating-conic-gradient(
      from 8deg,
      rgba(0, 44, 105, 0.11) 0deg 8deg,
      transparent 8deg 16deg
    ),
    radial-gradient(circle at center, transparent 0 54%, rgba(0, 114, 188, 0.09) 55% 64%, transparent 65%);
  border-radius: 50%;
  opacity: 0.75;
  pointer-events: none;
}

.screen-tabs,
.board,
.ticker {
  position: relative;
  z-index: 1;
}

.screen-tabs {
  display: grid;
  grid-template-columns: 1fr clamp(170px, 12vw, 260px);
  min-height: 0;
  background: var(--navy);
  padding: 6px 14px 0;
}

.flow-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  max-width: min(760px, 58vw);
  gap: clamp(14px, 2vw, 32px);
  align-items: center;
  padding: 0;
}

.flow-tab {
  height: calc(100% - 6px);
  min-height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #092e70;
  color: var(--white);
  font-size: clamp(1.08rem, 1.45vw, 1.7rem);
  font-weight: 800;
  cursor: pointer;
}

.flow-tab.active {
  border-color: var(--white);
  background: var(--navy-2);
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  align-self: stretch;
}

.brand-block img {
  width: min(88%, 220px);
  max-height: calc(100% - 10px);
  height: auto;
}

.board {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
  padding: clamp(8px, 1.2vh, 16px) clamp(36px, 4vw, 76px) 0;
}

.board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin-bottom: clamp(2px, 0.4vh, 6px);
  font-size: clamp(1.85rem, 2.55vw, 3.35rem);
}

h2 {
  margin-bottom: clamp(2px, 0.4vh, 6px);
  font-size: clamp(1.8rem, 2.45vw, 3.1rem);
  text-align: right;
}

.status-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 1.6vw, 26px);
  min-height: clamp(18px, 2.2vh, 28px);
  margin-bottom: clamp(3px, 0.5vh, 7px);
  color: #153150;
  font-size: clamp(0.88rem, 1.08vw, 1.18rem);
  font-weight: 900;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 50%;
}

.dot.ok {
  background: var(--ok);
}

.dot.warning {
  background: var(--warning);
}

.dot.danger {
  background: var(--danger);
}

.table-wrap {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(212, 242, 255, 0.72);
}

th,
td {
  border: 1px solid var(--line);
  padding: 3px 7px;
  text-align: center;
  line-height: 1.05;
}

th {
  height: clamp(32px, 4.2vh, 58px);
  background: #0a356d;
  color: var(--white);
  font-size: clamp(0.82rem, 0.98vw, 1.16rem);
  font-weight: 900;
}

td {
  background: rgba(177, 224, 246, 0.9);
  font-size: clamp(0.88rem, 1.08vw, 1.26rem);
  font-weight: 800;
}

tbody tr:nth-child(even) td:not(.time-cell) {
  background: rgba(154, 211, 239, 0.88);
}

.orders-table th:nth-child(1) {
  width: 10%;
}

.orders-table th:nth-child(2) {
  width: 6%;
}

.orders-table th:nth-child(3) {
  width: 12%;
}

.orders-table th:nth-child(4) {
  width: 13%;
}

.orders-table th:nth-child(5) {
  width: 24%;
}

.orders-table th:nth-child(6) {
  width: 15%;
}

.orders-table th:nth-child(7) {
  width: 12%;
}

.orders-table th:nth-child(8) {
  width: 8%;
}

.orders-table td:nth-child(1),
.orders-table td:nth-child(3),
.orders-table td:nth-child(4),
.orders-table td:nth-child(6),
.orders-table td:nth-child(7) {
  white-space: nowrap;
}

.orders-table td:nth-child(1),
.orders-table td:nth-child(3),
.orders-table td:nth-child(4),
.orders-table td:nth-child(6),
.orders-table td:nth-child(7) {
  letter-spacing: -0.01em;
}

.destination {
  text-transform: uppercase;
}

.time-cell {
  color: #ffffff;
  font-weight: 900;
}

.time-cell.ok {
  background: var(--ok);
  color: #092100;
}

.time-cell.warning {
  background: var(--warning);
  color: #201d00;
}

.time-cell.danger {
  background: var(--danger);
}

.empty-state {
  margin: 60px 0 0;
  text-align: center;
  color: #16466b;
  font-size: 1.4rem;
  font-weight: 700;
}

.ticker {
  display: grid;
  grid-template-columns: 1.15fr 0.78fr 0.9fr 1.18fr 0.88fr 1.05fr 0.95fr 1.75fr;
  align-items: center;
  gap: 0;
  min-height: 0;
  margin-top: 0;
  padding: 0 clamp(18px, 2vw, 36px);
  background: var(--navy);
  color: var(--white);
  font-size: clamp(0.98rem, 1.14vw, 1.32rem);
  font-weight: 800;
}

.ticker span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-right: 4px solid rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.ticker span:first-child {
  justify-content: flex-start;
}

.ticker span:last-child {
  justify-content: flex-end;
  border-right: 0;
}

.ticker strong {
  margin-left: 5px;
}

.delay-badge {
  background: var(--delay);
  font-weight: 800;
}

.sync {
  font-size: clamp(0.82rem, 0.94vw, 1.08rem);
}

.summary-table {
  width: min(64vw, 920px);
  height: auto;
  margin: clamp(28px, 5vh, 60px) auto 0;
  background: transparent;
}

.summary-table .summary-label-col {
  width: 42%;
}

.summary-table col:not(.summary-label-col) {
  width: 29%;
}

.summary-table th,
.summary-table td {
  height: clamp(42px, 6vh, 68px);
  border: 2px dotted rgba(0, 33, 72, 0.55);
  font-size: clamp(1.15rem, 1.55vw, 1.9rem);
  font-weight: 800;
}

.summary-table thead tr:first-child th {
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: clamp(1.35rem, 1.8vw, 2.1rem);
}

.summary-table thead tr:first-child th:not(:first-child) {
  background: var(--blue);
}

.summary-table thead tr:nth-child(2) th {
  background: var(--navy);
  color: var(--white);
}

.summary-table td {
  background: rgba(239, 252, 255, 0.82);
}

.summary-status {
  color: #061326;
  text-align: left;
  white-space: nowrap;
}

.summary-wave {
  background: #e8ffb8 !important;
}

.summary-process {
  background: var(--ok) !important;
}

.summary-loaded {
  background: var(--warning) !important;
}

.summary-shipped {
  background: #00b050 !important;
}

.summary-invoiced {
  background: #ffffff !important;
}

.summary-total td,
.summary-total {
  background: #ffffff !important;
  font-weight: 900;
}

@media (max-width: 1280px) {
  .board {
    padding-inline: 28px;
  }

  .flow-tabs {
    gap: 14px;
    grid-template-columns: repeat(2, 1fr);
  }
}
