:root {
  --navy: #1d2d50;
  --red: #d72638;
  --red-dark: #b91f2f;
  --green: #0e9f6e;
  --amber: #d97706;
  --page: #f3f6f9;
  --card: #ffffff;
  --subtle: #f7f9fc;
  --line: #d7dee8;
  --text: #1d2d50;
  --muted: #667085;
  --shadow: 0 8px 28px rgba(29, 45, 80, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.danger-text {
  color: var(--red);
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  width: min(1680px, 100%);
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 124px;
  height: auto;
}

.brand-title {
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operator-pill {
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--subtle);
  border-radius: 999px;
  font-size: 12px;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  margin-right: 7px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.icon-button:hover,
.icon-button.active {
  background: #eef2f6;
  color: var(--navy);
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stats-strip {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .65);
}

.stats-grid {
  width: min(1680px, 100%);
  margin: auto;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 66px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  font-size: 21px;
  font-weight: 900;
  margin-top: 2px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef2f8;
  color: var(--navy);
}

.stat-icon.danger {
  background: #fff0f2;
  color: var(--red);
  border: 1px solid #ffcbd2;
}

.tabs {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 64px;
  z-index: 15;
}

.tabs-inner {
  width: min(1680px, 100%);
  margin: auto;
  padding: 0 24px;
  display: flex;
  gap: 26px;
}

.tab-button {
  padding: 14px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-button.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.workspace {
  width: min(1680px, 100%);
  margin: auto;
  padding: 20px 24px 42px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.production-head {
  margin-bottom: 16px;
}

.production-head h1 {
  font-size: 24px;
  letter-spacing: -.02em;
}

.board-toolbar {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(29, 45, 80, .04);
}

.board-search {
  width: 100%;
  min-height: 42px;
}

.board-filters {
  display: flex;
  gap: 10px;
}

.filter-control {
  display: grid;
  gap: 4px;
}

.filter-control span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.filter-control select {
  min-width: 170px;
  padding: 9px 34px 9px 11px;
}

.results-count {
  min-width: 76px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--subtle);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
}

.button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #eef2f6;
  color: var(--navy);
  padding: 9px 14px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.button:hover {
  background: #e3e8ef;
}

.button.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 14px rgba(215, 38, 56, .2);
}

.button.primary:hover {
  background: var(--red-dark);
}

.button.secondary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.button.success {
  background: #def8ed;
  border-color: #9cddc6;
  color: #087a54;
}

.button.danger {
  background: #fff0f2;
  border-color: #ffc7ce;
  color: var(--red);
}

.button.small {
  padding: 6px 9px;
  font-size: 12px;
}

.button.icon-only {
  width: 30px;
  height: 30px;
  padding: 0;
}

.button .icon,
.tab-button .icon {
  width: 16px;
  height: 16px;
}

.button:disabled {
  opacity: .4;
  cursor: default;
}

.search {
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
}

.search-box {
  width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding-left: 10px;
  background: #fff;
}

.search-box:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 38, 56, .1);
}

.search-box .icon {
  color: var(--muted);
  flex: 0 0 auto;
}

.search-box .search {
  width: 100%;
  border: 0;
  padding-left: 0;
  box-shadow: none;
}

.workers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.worker-column {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.worker-head {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.worker-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f6;
  color: var(--red);
  font-weight: 900;
  border: 1px solid var(--line);
}

.counter {
  background: #f1f4f8;
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.task-list {
  padding: 9px;
  display: grid;
  gap: 7px;
  max-height: 650px;
  overflow: auto;
}

.task-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: #fff;
}

#workers-grid .task-card {
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#workers-grid .task-card:hover {
  border-color: #aeb9c8;
  box-shadow: 0 8px 22px rgba(29, 45, 80, .09);
  transform: translateY(-1px);
}

.task-card.done {
  opacity: .55;
}

.task-card.done .task-content {
  text-decoration: line-through;
}

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

.task-title-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.task-title-main span:nth-child(2) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #94a3b8;
}

.priority-dot.p1 {
  background: var(--red);
  box-shadow: 0 0 5px rgba(215, 38, 56, .55);
}

.priority-dot.p2 {
  background: var(--navy);
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}

.deadline {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-align: right;
  line-height: 1.2;
}

.deadline small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 650;
}

.deadline.late {
  color: var(--red);
  font-weight: 800;
}

.deadline.soon {
  color: var(--amber);
  font-weight: 800;
}

.task-product {
  margin: 5px 0;
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
}

.task-desc {
  background: #f6f8fb;
  border-left: 2px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 8px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #3e4c63;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-actions {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e6ebf1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.task-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-order {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.task-more {
  position: relative;
}

.task-more summary {
  width: 34px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .08em;
  list-style: none;
}

.task-more summary::-webkit-details-marker {
  display: none;
}

.task-more[open] summary {
  border-color: var(--navy);
  color: var(--navy);
}

.task-more-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  top: calc(100% + 6px);
  width: 165px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 2px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(16, 24, 40, .18);
}

.task-more-menu button {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.task-more-menu button:hover {
  background: var(--subtle);
}

/* Panel Operatora: spokojny, tabelaryczny widok kolejek. */
.workers-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.queue-section {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: visible;
  background: #fff;
  box-shadow: var(--shadow);
}

.queue-worker-head {
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.queue-worker-name {
  display: grid;
  gap: 1px;
}

.queue-worker-name b {
  font-size: 15px;
}

.queue-worker-name span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}

.queue-worker-summary {
  display: flex;
  align-items: center;
  gap: 7px;
}

.counter.urgent {
  border-color: #ffcbd2;
  color: var(--red);
  background: #fff0f2;
}

.queue-table-head,
.queue-row {
  display: grid;
  grid-template-columns: 116px minmax(250px, 1.25fr) minmax(230px, 1fr) 120px 230px;
  gap: 16px;
  align-items: center;
}

.queue-table-head {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.queue-list {
  overflow: visible;
}

.queue-row {
  position: relative;
  min-height: 92px;
  padding: 13px 16px;
  border-bottom: 1px solid #e9edf3;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}

.queue-row::before {
  content: '';
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #a9b4c4;
}

.queue-row.priority-1::before {
  background: var(--red);
}

.queue-row.priority-2::before {
  background: var(--navy);
}

.queue-row:last-child {
  border-bottom: 0;
  border-radius: 0 0 13px 13px;
}

.queue-row:hover {
  z-index: 2;
  background: #fbfcfe;
  box-shadow: 0 7px 20px rgba(29, 45, 80, .08);
}

.queue-row.is-dragging {
  position: relative;
  z-index: 50;
  opacity: .28;
  box-shadow: none;
}

.queue-row.drop-before::after,
.queue-row.drop-after::after {
  content: '';
  position: absolute;
  z-index: 5;
  right: 12px;
  left: 12px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 38, 56, .12);
}

.queue-row.drop-before::after {
  top: -2px;
}

.queue-row.drop-after::after {
  bottom: -2px;
}

.queue-row.done {
  opacity: .76;
  background: #f4fbf8;
}

.queue-row.done .queue-client,
.queue-row.done .queue-product {
  text-decoration: line-through;
}

.queue-order {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drag-handle {
  width: 30px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #8491a5;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: grab;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  border-color: var(--line);
  color: var(--navy);
  background: #fff;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:disabled {
  opacity: .25;
  cursor: not-allowed;
}

.queue-position {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}

.queue-order-buttons {
  display: grid;
  gap: 3px;
}

.queue-order-buttons .button.icon-only {
  width: 25px;
  height: 22px;
  border-radius: 6px;
  background: #fff;
}

.queue-order-buttons .icon {
  width: 13px;
  height: 13px;
}

.queue-task-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.queue-task-meta {
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.priority-label {
  padding: 2px 6px;
  border-radius: 5px;
  color: #536175;
  background: #edf1f6;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.priority-label.p1 {
  color: var(--red);
  background: #fff0f2;
}

.priority-label.p2 {
  color: var(--navy);
  background: #edf2fa;
}

.queue-client,
.queue-product {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.queue-client {
  font-size: 13px;
}

.queue-product {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.queue-description {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #536175;
  font-size: 12px;
  line-height: 1.45;
}

.queue-deadline {
  display: grid;
  justify-items: start;
  text-align: left;
}

.queue-deadline>span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.queue-deadline strong {
  font-size: 12px;
}

.queue-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.queue-actions .button {
  white-space: nowrap;
}

.queue-empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* Kompaktowy widok wielu kolejek. */
.workers-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  align-items: start;
}

.queue-section {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(29, 45, 80, .06);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.queue-section.is-drop-target {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 38, 56, .1), var(--shadow);
}

.queue-worker-head {
  min-height: 50px;
  padding: 9px 11px;
}

.queue-worker-name b {
  font-size: 14px;
}

.queue-worker-summary {
  gap: 5px;
}

.queue-worker-summary .counter {
  padding: 3px 7px;
  font-size: 10px;
}

.queue-table-head {
  display: none;
}

.queue-list {
  min-height: 58px;
  max-height: 340px;
  padding: 4px;
  display: grid;
  align-content: start;
  gap: 3px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f7f9fc;
  scrollbar-width: thin;
}

.queue-row {
  height: 64px;
  min-height: 64px;
  padding: 5px;
  border: 1px solid #dfe5ed;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 92px;
  gap: 7px;
  align-items: center;
  background: #fff;
}

.queue-row.is-reorderable {
  cursor: grab;
}

.queue-row.is-reorderable:active {
  cursor: grabbing;
}

.queue-row button,
.queue-row [popover] {
  cursor: pointer;
}

.queue-row:last-child {
  border-bottom: 1px solid #dfe5ed;
  border-radius: 8px;
}

.queue-row::before {
  inset: 6px auto 6px 0;
}

.queue-row:hover {
  transform: none;
  border-color: #b8c3d1;
  box-shadow: 0 5px 14px rgba(29, 45, 80, .08);
}

.queue-row > .queue-position {
  width: 32px;
  height: 46px;
  border-color: var(--line);
  border-radius: 7px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 10px;
}

.queue-task-main {
  gap: 1px;
}

.queue-task-meta {
  min-height: 14px;
}

.priority-label {
  padding: 1px 5px;
  font-size: 8px;
}

.queue-task-meta .badge {
  padding: 1px 4px;
  font-size: 8px;
}

.queue-client {
  font-size: 12px;
}

.queue-product {
  font-size: 10px;
  line-height: 1.35;
}

.queue-description {
  display: none;
}

.queue-side {
  align-self: stretch;
  display: grid;
  align-content: space-between;
  justify-items: end;
  gap: 4px;
}

.compact-hide {
  min-height: 24px;
  padding: 3px 6px;
  gap: 3px;
  border-color: #a9ddc8;
  color: #087a54;
  background: #e7f8f1;
  font-size: 9px;
}

.compact-hide .icon {
  width: 12px;
  height: 12px;
}

.queue-side .queue-deadline {
  display: grid;
  grid-column: auto;
  grid-row: auto;
  justify-items: end;
  text-align: right;
}

.queue-side .queue-deadline strong {
  font-size: 10px;
}

.queue-side .queue-deadline small {
  margin-top: 1px;
  font-size: 9px;
}

.queue-side .queue-actions {
  display: flex;
  grid-column: auto;
  grid-row: auto;
  gap: 4px;
}

.queue-actions .button.icon-only,
.queue-actions .task-more-trigger {
  width: 28px;
  height: 25px;
  padding: 0;
}

.task-more-trigger {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .08em;
}

.task-more-trigger:hover,
.task-more-trigger[aria-expanded="true"] {
  border-color: var(--navy);
  color: var(--navy);
}

.task-popover-menu {
  position: fixed;
  inset: auto;
  z-index: 1000;
  margin: 0;
}

.task-popover-menu:not(:popover-open) {
  display: none;
}

.task-popover-menu:popover-open {
  display: grid;
}

.task-popover-menu::backdrop {
  background: transparent;
}

.queue-actions .icon {
  width: 13px;
  height: 13px;
}

.task-more-menu button:disabled {
  opacity: .35;
  cursor: default;
}


.queue-row.drop-before::after,
.queue-row.drop-after::after {
  right: 4px;
  left: 4px;
}

.queue-empty {
  min-height: 72px;
  padding: 18px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
}

.empty-state {
  text-align: center;
}

.empty-results {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.table-card,
.form-card,
.panel-card,
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.content-layout,
.settings-layout {
  display: grid;
  align-items: start;
  gap: 16px;
}

.announcement-layout {
  grid-template-columns: minmax(0, 1fr);
}

.history-toolbar {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(130px, auto)) auto;
  align-items: end;
  gap: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.history-search {
  min-width: 0;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table td {
  vertical-align: middle;
}

.history-table td:nth-child(1) {
  min-width: 150px;
}

.history-table td:nth-child(2) {
  min-width: 230px;
}

.history-table td:nth-child(2) strong,
.history-table td:nth-child(2) span,
.history-table td:nth-child(2) small,
.history-table td:nth-child(4) span,
.history-table td:nth-child(4) small {
  display: block;
}

.history-table td:nth-child(2) span,
.history-date,
.history-table td:nth-child(4) small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.history-status {
  display: inline-flex;
  margin-bottom: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.history-status.completed {
  color: #087a54;
  background: #e7f8f1;
}

.history-status.cancelled {
  color: #8a5260;
  background: #f6edf0;
}

.history-visible {
  display: block;
  margin-top: 4px;
  color: #087a54;
  font-weight: 750;
}

.history-reason {
  margin-top: 6px;
  color: #8a5260;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.history-actions button {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--navy);
  background: #fff;
  font-size: 10px;
  font-weight: 750;
}

.history-actions button:hover {
  border-color: #a9b4c4;
  background: var(--subtle);
}

.history-actions .icon {
  width: 13px;
  height: 13px;
}

.history-pagination {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.history-pagination > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.settings-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
}

.panel-card {
  min-width: 0;
}

.panel-card-head {
  min-height: 74px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-card-title h3 {
  margin: 0;
  font-size: 15px;
}

.panel-card-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: #fff0f2;
  flex: 0 0 auto;
}

.card-icon.neutral {
  color: var(--navy);
  background: #edf2fa;
}

.panel-card-body {
  padding: 18px;
}

.panel-card-foot {
  min-height: 66px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
}

.save-note,
.field-help {
  color: var(--muted);
  font-size: 11px;
}

.field-help {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.toggle-row {
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--subtle);
}

.toggle-row input {
  width: auto;
  margin-top: 3px;
}

.toggle-row span {
  display: grid;
  gap: 2px;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 500;
}

.preview-card {
  position: sticky;
  top: 128px;
}

.preview-stage {
  min-height: 255px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #172440, #253960);
}

.announcement-preview {
  width: 100%;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 11px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 14px 34px rgba(7, 16, 35, .24);
  transition: opacity .18s ease, background .18s ease, border-color .18s ease;
}

.announcement-preview.wazne {
  border-color: #f5bf68;
  background: rgba(217, 119, 6, .22);
}

.announcement-preview.pilne {
  border-color: #ff8e9b;
  background: rgba(215, 38, 56, .28);
}

.announcement-preview.inactive {
  opacity: .48;
  filter: grayscale(.45);
}

.preview-status {
  float: right;
  padding: 3px 7px;
  border-radius: 999px;
  color: #dbe5f3;
  background: rgba(0, 0, 0, .2);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.announcement-preview strong {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.announcement-preview p {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.settings-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 14px;
}

.account-settings-card {
  position: sticky;
  top: 128px;
}

.security-note {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--subtle);
  font-size: 11px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 13px 15px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
}

td {
  padding: 13px 15px;
  border-top: 1px solid var(--line);
}

.right {
  text-align: right;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f8f1;
  color: #087a54;
  font-size: 11px;
  font-weight: 800;
}

.status.off {
  background: #eef2f6;
  color: var(--muted);
}

.form-card {
  max-width: 720px;
  margin: auto;
  padding: 24px;
}

.security-settings-card {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 12px;
  font-weight: 750;
  color: #475467;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 38, 56, .1);
}

textarea {
  resize: vertical;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check input {
  width: auto;
}

.worker-checks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.worker-checks label {
  padding: 9px;
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 7px;
  align-items: center;
}

.animation-settings {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--subtle);
  padding: 14px;
}

.animation-settings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.animation-settings-head small {
  color: var(--muted);
}

.timing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.timing-grid label::after {
  content: ' (s)';
  color: var(--muted);
  font-weight: 500;
}

dialog {
  width: min(620px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(16, 24, 40, .25);
}

dialog::backdrop {
  background: rgba(15, 23, 42, .66);
  backdrop-filter: blur(2px);
}

.modal-head {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 850;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 14px;
  max-height: 70vh;
  overflow: auto;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.task-drawer {
  inset: 0 0 0 auto;
  width: min(620px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-width: 0 0 0 1px;
  border-radius: 18px 0 0 18px;
}

.task-drawer[open] {
  animation: drawer-in .22s ease-out;
}

@keyframes drawer-in {
  from {
    opacity: .7;
    transform: translateX(28px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.task-drawer-form {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

.task-drawer-head {
  flex: 0 0 auto;
  padding: 21px 24px;
  background: #fff;
}

.task-drawer-head>div {
  display: grid;
  gap: 3px;
}

.drawer-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.task-drawer-head #task-dialog-title {
  font-size: 20px;
}

.task-drawer-body {
  flex: 1 1 auto;
  max-height: none;
  padding: 18px;
  align-content: start;
}

.task-drawer .worker-checks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-section {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 16px;
  background: #fff;
}

.drawer-section.compact {
  padding: 14px 17px;
}

.drawer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.drawer-section-head>div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.drawer-section-head small {
  color: var(--muted);
  text-align: right;
}

.drawer-step {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  font-size: 11px;
  font-weight: 850;
}

.task-drawer-foot {
  flex: 0 0 auto;
  min-height: 74px;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: #fff;
}

.task-drawer-foot>div {
  display: flex;
  gap: 9px;
  flex: 0 0 auto;
}

.task-modal {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  border-radius: 16px;
  overflow: hidden;
}

.task-modal[open] {
  animation: modal-in .18s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.task-modal-form {
  max-height: calc(100dvh - 50px);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.task-modal-head {
  flex: 0 0 auto;
  padding: 20px 22px;
}

.modal-title-block {
  display: grid;
  gap: 2px;
}

.modal-eyebrow {
  color: var(--red);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.task-modal-head #task-dialog-title {
  font-size: 21px;
  letter-spacing: -.01em;
}

.task-modal-body {
  flex: 1 1 auto;
  max-height: none;
  padding: 18px;
  background: var(--page);
}

.task-form-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 14px;
}

.task-form-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  align-content: start;
  gap: 16px;
  background: #fff;
}

.task-form-section-head>div {
  display: grid;
  gap: 2px;
}

.task-form-section-head b {
  font-size: 14px;
}

.task-form-section-head small {
  color: var(--muted);
  font-size: 11px;
}

.assignment-section .worker-checks {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planning-grid {
  grid-template-columns: 1fr 1fr;
}

.new-task-check {
  margin-top: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  align-items: flex-start;
  background: var(--subtle);
}

.new-task-check span {
  display: grid;
  gap: 2px;
}

.new-task-check small {
  color: var(--muted);
  font-weight: 500;
}

.task-modal-foot {
  flex: 0 0 auto;
  min-height: 70px;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: #fff;
}

.task-modal-foot>div {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.modal-save-hint {
  max-width: 440px;
  color: var(--muted);
  font-size: 11px;
}

.drawer-save-hint {
  max-width: 280px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stats-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.stats-kpi strong {
  display: block;
  font-size: 25px;
  margin-top: 4px;
}

.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

.chart-card {
  padding: 18px;
}

.chart-title {
  font-weight: 850;
  margin-bottom: 14px;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 32px;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}

.bar-track {
  height: 10px;
  border-radius: 99px;
  background: #edf1f5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
}

.bar-fill.green {
  background: var(--green);
}

.stats-dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-dashboard .wide {
  grid-column: 1 / -1;
}

.chart-legend {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  margin: -32px 0 12px;
  font-size: 11px;
  color: var(--muted);
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--navy);
}

.chart-legend .legend-completed {
  background: var(--green);
}

.trend-chart {
  height: 190px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-top: 8px;
  border-bottom: 1px solid var(--line);
}

.trend-week {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}

.trend-bars {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.trend-bars i {
  width: min(16px, 38%);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--navy);
  transition: height .35s ease;
}

.trend-bars i.completed {
  background: var(--green);
}

.trend-week small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 160px;
}

.donut {
  --done: 0%;
  width: 128px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: radial-gradient(circle at center, #fff 0 54%, transparent 55%), conic-gradient(var(--green) 0 var(--done), #e8edf3 var(--done) 100%);
}

.donut strong {
  font-size: 25px;
}

.donut span {
  font-size: 10px;
  color: var(--muted);
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-list span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.done-dot {
  background: var(--green);
}

.active-dot {
  background: #e8edf3;
  border: 1px solid #cbd5e1;
}

.throughput-row {
  display: grid;
  grid-template-columns: 82px 1fr 25px 48px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  margin: 9px 0;
}

.throughput-row small {
  color: var(--muted);
  text-align: right;
}

.priority-summary {
  display: grid;
  gap: 13px;
  padding: 16px 4px;
}

.priority-summary>div {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

::view-transition-group(*) {
  animation-duration: .42s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

::view-transition-group(moving-task) {
  z-index: 1000;
}

::view-transition-old(moving-task),
::view-transition-new(moving-task) {
  z-index: 1000;
  mix-blend-mode: normal;
}

::view-transition-group(moving-tv-task) {
  z-index: 2000;
}

::view-transition-old(moving-tv-task),
::view-transition-new(moving-tv-task) {
  z-index: 2000;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation: .2s ease both fade-out;
}

::view-transition-new(root) {
  animation: .3s ease both fade-in;
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-logo {
  width: 150px;
  display: block;
  margin: 0 auto 18px;
}

.login-card h1 {
  text-align: center;
  margin: 0;
  font-size: 20px;
}

.login-card>p {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 24px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.error {
  background: #fff0f2;
  color: #a61726;
  border: 1px solid #ffc7ce;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
}

.announcement {
  border: 1px solid #f5bf68;
  background: #fff8e8;
  color: #7a4c00;
  border-radius: 11px;
  padding: 13px 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}

.announcement.pilne {
  border-color: #ff98a5;
  background: #fff0f2;
  color: #9f1626;
}

.readonly-note {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
}

.readonly-note b {
  display: block;
  margin-bottom: 2px;
  color: var(--navy);
}

.worker-page {
  width: min(900px, 100%);
  margin: auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.panel-footer {
  width: min(1680px, 100%);
  margin: 18px auto 0;
  padding: 18px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.panel-footer img {
  width: 112px;
  max-height: 28px;
  object-fit: contain;
}

/* Tablica TV */
.tv-body {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #dfe6ed;
  isolation: isolate;
}

.tv-background-video,
.tv-background-shade {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tv-background-video {
  z-index: -3;
  object-fit: cover;
}

.tv-background-shade {
  z-index: -2;
  background: linear-gradient(135deg, rgba(238, 244, 248, .76), rgba(210, 220, 230, .64));
  backdrop-filter: saturate(75%);
}

.tv-background-brand {
  position: fixed;
  z-index: -1;
  left: 50%;
  top: 53%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  opacity: .1;
  filter: grayscale(1);
  pointer-events: none;
}

.tv-stage {
  position: relative;
  z-index: 1;
  width: min(100vw, calc(100vh * 16 / 9));
  aspect-ratio: 16/9;
  padding: .65%;
  display: flex;
  flex-direction: column;
  gap: .55cqw;
  container-type: size;
}

.tv-topbar {
  position: relative;
  min-height: 4.35cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1cqw;
}

.tv-page-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: .34cqw .8cqw;
  border: 1px solid rgba(29, 45, 80, .12);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, .72);
  font-size: .62cqw;
  font-weight: 800;
  letter-spacing: .03em;
  box-shadow: 0 .18cqw .7cqw rgba(29, 45, 80, .08);
}

.tv-corner {
  width: 18cqw;
  min-height: 3.7cqw;
  display: flex;
  justify-content: center;
}

.tv-brand-corner {
  align-items: center;
  padding: .62cqw 1.25cqw;
}

.tv-brand-corner img {
  display: block;
  width: 100%;
  height: 2.35cqw;
  object-fit: contain;
  object-position: left center;
}

.tv-clock {
  align-items: flex-end;
  flex-direction: column;
  padding: .34cqw 1cqw .42cqw;
  color: var(--navy);
}

.tv-clock time {
  display: block;
  width: 100%;
  font-size: 2.08cqw;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .05em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tv-clock div {
  width: 100%;
  margin-top: .22cqw;
  font-size: .67cqw;
  line-height: 1;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.tv-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--tv-columns, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--tv-rows, 2), minmax(0, 1fr));
  gap: .6cqw;
  transition: grid-template-columns .4s ease, grid-template-rows .4s ease;
}

.tv-worker {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .82);
  border-top: .18cqw solid rgba(215, 38, 56, .9);
  padding: .45cqw .65cqw;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.5);
  border-radius: .5cqw;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tv-worker.has-overflow::before,
.tv-worker.has-overflow::after {
  content: '';
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
}

.tv-worker.has-overflow::before {
  width: 100%;
  background: rgba(29, 45, 80, .12);
}

.tv-worker.has-overflow::after {
  width: 0;
  background: var(--red);
}

.tv-worker.has-overflow.progress-running::after {
  animation: tv-scroll-progress var(--scroll-duration, 3s) linear infinite;
}

@keyframes tv-scroll-progress {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

.tv-worker-title {
  position: relative;
  min-height: 1.85cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #d7dee8;
}

.tv-name {
  font-size: 1.3cqw;
  font-weight: 850;
  text-align: center;
}

.tv-count {
  position: absolute;
  right: 0;
  color: var(--muted);
  font-size: .56cqw;
  font-weight: 650;
  white-space: nowrap;
}

.tv-head,
.tv-meta {
  display: grid;
  grid-template-columns: 1.05fr .95fr 4.35cqw;
  gap: .45cqw;
  align-items: center;
}

.tv-head {
  padding: .26cqw 0;
  font-size: .48cqw;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.tv-head div:first-child {
  padding-left: 1.2cqw;
}

.tv-tasks {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tv-tasks-track {
  height: 100%;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.tv-task {
  flex: 0 0 20%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .22cqw;
  border-bottom: 1px solid #d7dee8;
  padding: .2cqw;
  overflow: hidden;
}

.tv-task:last-child {
  border-bottom: 0;
}

.tv-task.new {
  border: 0;
  border-top: 1px solid var(--green);
  border-bottom: 1px solid var(--green);
  border-radius: 0;
  background: #f6fcf9;
}

.tv-client {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .42cqw;
}

.tv-client .priority-dot {
  align-self: center;
  display: block;
  margin: 0;
}

.tv-client .tv-marquee,
.tv-product {
  min-width: 0;
  font-size: .82cqw;
}

.tv-client .tv-marquee {
  flex: 1;
}

.tv-product {
  color: #4b5563;
}

.tv-deadline {
  min-width: 0;
  text-align: right;
  font-size: .66cqw;
  line-height: 1.05;
  font-weight: 800;
  white-space: nowrap;
}

.tv-deadline small {
  display: block;
  margin-top: .12cqw;
  font-size: .57cqw;
  font-weight: 700;
  color: var(--muted);
}

.tv-deadline.late {
  color: var(--red);
}

.tv-deadline.soon {
  color: var(--amber);
}

.tv-marquee {
  overflow: hidden;
  white-space: nowrap;
}

.tv-marquee>span {
  display: inline-block;
  min-width: max-content;
}

.tv-marquee.is-overflowing>span {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .tv-marquee.is-overflowing>span {
    transition: none !important;
    transform: none !important;
  }

  ::view-transition-group(*) {
    animation-duration: 0s;
  }
}

.tv-meta {
  padding-bottom: .18cqw;
  border-bottom: 1px solid #edf0f4;
}

.tv-description {
  display: grid;
  grid-template-columns: 1.05cqw minmax(0, 1fr);
  gap: .25cqw;
  align-items: center;
  min-height: 1.2cqw;
  padding-top: .08cqw;
}

.tv-desc {
  grid-column: 2;
  font-size: .72cqw;
  color: #475467;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tv-badge {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  transform: rotate(-90deg);
  padding: .06cqw .24cqw;
  border-radius: .15cqw;
  background: var(--green);
  color: #fff;
  font-size: .46cqw;
  font-weight: 900;
}

.tv-task.done {
  opacity: .4;
}

.tv-task.done .tv-client,
.tv-task.done .tv-product,
.tv-task.done .tv-deadline,
.tv-task.done .tv-desc {
  text-decoration: line-through;
}

.tv-message {
  min-height: 4cqw;
  display: flex;
  align-items: center;
  gap: .7cqw;
  padding: .6cqw 1cqw;
  background: rgba(29, 45, 80, .2);
  border: 1px solid  rgba(12, 24, 50, 0.5);
  border-radius: .5cqw;
  box-shadow: 0 .45cqw 1.2cqw rgba(29, 45, 80, .09);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  font-size: 1.25cqw;
  font-weight: 750;
}

.tv-message .icon {
  width: 1.65cqw;
  height: 1.65cqw;
  flex: 0 0 auto;
}
.tv-message.wazne {
  background: rgba(255, 248, 232, .75);
  border-color: var(--amber);
  color: #9f611a;
}
.tv-message.pilne {
  background: rgba(255, 240, 242, .78);
  border-color: var(--red);
  color: #9f1626;
}

.tv-alert-flash .tv-stage {
  animation: alert-flash .85s ease;
}

@keyframes alert-flash {

  0%,
  100% {
    filter: none;
  }

  25%,
  65% {
    filter: drop-shadow(0 0 8px rgba(215, 38, 56, .35));
  }
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  padding: 11px 15px;
  border-radius: 9px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--red);
  color: #fff;
  border: 0;
}

@media (max-width: 1200px) {
  .queue-row {
    grid-template-columns: 38px minmax(0, 1fr) 92px;
  }
}

@media (max-width: 900px) {

  .content-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .preview-card,
  .account-settings-card {
    position: static;
  }

  .board-toolbar {
    grid-template-columns: 1fr auto;
  }

  .board-search {
    grid-column: 1 / -1;
  }

  .queue-table-head {
    display: none;
  }

  .queue-row {
    grid-template-columns: 38px minmax(0, 1fr) 92px;
    align-items: center;
  }

  .history-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-search {
    grid-column: 1 / -1;
  }

  .workers-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .stats-grid,
  .stats-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts {
    grid-template-columns: 1fr;
  }

  .stats-dashboard .wide {
    grid-column: auto;
  }

  .operator-pill {
    display: none;
  }

  .brand-title,
  .brand-subtitle {
    display: none;
  }

  .worker-checks {
    grid-template-columns: repeat(2, 1fr);
  }

  .timing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .task-form-columns {
    grid-template-columns: 1fr;
  }

  .assignment-section .worker-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {

  .topbar-inner,
  .workspace,
  .stats-grid,
  .tabs-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand img {
    width: 110px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    min-height: 70px;
    padding: 10px;
  }

  .stat-value {
    font-size: 20px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .head-actions,
  .search,
  .search-box {
    width: 100%;
  }

  .production-head .button {
    width: 100%;
  }

  .board-toolbar {
    padding: 11px;
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .board-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .filter-control select {
    min-width: 0;
  }

  .results-count {
    align-self: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .timing-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .settings-options {
    grid-template-columns: 1fr;
  }

  .panel-card-head,
  .panel-card-body,
  .panel-card-foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel-card-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-card-foot .button {
    width: 100%;
  }

  .queue-worker-head {
    align-items: flex-start;
  }

  .queue-worker-summary {
    align-items: flex-end;
    flex-direction: column;
  }

  .queue-row {
    grid-template-columns: 38px minmax(0, 1fr) 92px;
    gap: 7px;
    padding: 7px;
  }

  .history-toolbar {
    grid-template-columns: 1fr;
  }

  .history-search {
    grid-column: auto;
  }

  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .workers-grid {
    grid-template-columns: 1fr;
  }

  .task-modal {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .task-modal-form {
    max-height: calc(100dvh - 22px);
  }

  .task-modal-head,
  .task-modal-body {
    padding: 14px;
  }

  .task-form-section {
    padding: 14px;
  }

  .task-modal-foot {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .task-modal-foot>div {
    width: 100%;
  }

  .task-modal-foot .button {
    flex: 1;
  }

  .modal-save-hint {
    max-width: none;
  }

  .tabs-inner {
    gap: 18px;
    overflow-x: auto;
  }
}
