:root {
  --brand-red: #e30613;
  --brand-blue: #006eb6;
  --brand-blue-dark: #00508f;
  --brand-red-soft: #ffe5e8;
  --brand-blue-soft: #e3f2fb;
  --bg: #f5f8fb;
  --panel: #ffffff;
  --panel-soft: #edf5fb;
  --border: #b7c9d8;
  --border-strong: #006eb6;
  --text: #172434;
  --muted: #627386;
  --blue: var(--brand-blue);
  --blue-soft: var(--brand-blue-soft);
  --amber: #c47a05;
  --amber-soft: #fff1d6;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: var(--brand-red);
  --red-soft: var(--brand-red-soft);
  --focus: var(--brand-blue);
  --input-bg: #ffffff;
  --surface-hover: #f8fafc;
  --button-secondary-bg: #ffffff;
  --topbar-bg:
    linear-gradient(90deg, rgba(0, 110, 182, 0.08), rgba(227, 6, 19, 0.04) 38%, rgba(255, 255, 255, 0.96) 72%),
    rgba(255, 255, 255, 0.98);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-hover: 0 4px 10px rgba(16, 24, 40, 0.10);
  --shadow-panel: 0 18px 44px rgba(16, 24, 40, 0.20);
  --hard-border: #000000;
  --range-empty: #e5e7eb;
  --workspace-min-width: 1024px;
  --workspace-max-width: 1760px;
  --task-detail-list-width: min(620px, 38vw);
  --task-detail-panel-gap: 16px;
  font-family: "Segoe UI", Arial, sans-serif;
}

body[data-theme="dark"] {
  --brand-red: #ff3445;
  --brand-blue: #1f9cf0;
  --brand-blue-dark: #74c7ff;
  --brand-red-soft: #3a1219;
  --brand-blue-soft: #102f4a;
  --bg: #07131f;
  --panel: #0f2133;
  --panel-soft: #132c43;
  --border: #385872;
  --border-strong: #2586d4;
  --text: #eff7ff;
  --muted: #a9bed0;
  --blue: var(--brand-blue);
  --amber: #f3b13c;
  --amber-soft: #3b2a0f;
  --green: #43d17d;
  --green-soft: #103722;
  --red: var(--brand-red);
  --red-soft: var(--brand-red-soft);
  --focus: #78c9ff;
  --input-bg: #0b1a2a;
  --surface-hover: #142a40;
  --button-secondary-bg: #10263a;
  --topbar-bg:
    linear-gradient(90deg, rgba(31, 156, 240, 0.18), rgba(255, 52, 69, 0.10) 42%, rgba(7, 19, 31, 0.94) 78%),
    rgba(7, 19, 31, 0.98);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.34);
  --shadow-hover: 0 8px 18px rgba(0, 0, 0, 0.30);
  --shadow-panel: 0 22px 56px rgba(0, 0, 0, 0.48);
  --hard-border: #d9e9f7;
  --range-empty: #2b4359;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: auto;
  color: var(--text);
  background: var(--bg);
  transition: background-color 180ms ease, color 180ms ease;
}

body.modal-open {
  overflow: hidden;
}

body.task-detail-docked main {
  width: 100%;
  max-width: none;
  margin: 0;
}

body.is-dnd-active {
  user-select: none;
}

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

button {
  min-height: 36px;
  border: 2px solid var(--brand-blue-dark);
  border-radius: 6px;
  color: #ffffff;
  background: var(--blue);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease;
}

button:hover {
  background: var(--brand-blue-dark);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.button-secondary,
.filter-button {
  color: var(--text);
  border-color: var(--border);
  background: var(--button-secondary-bg);
}

a.button-secondary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

a.button-secondary:hover {
  border-color: var(--brand-blue-dark);
}

input[type="range"] {
  --range-track-height: 8px;
  --range-thumb-size: 18px;
  --range-fill: 0%;
  width: 100%;
  min-height: var(--range-thumb-size);
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--brand-red);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: var(--range-track-height);
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--brand-red) 0%,
    var(--brand-red) var(--range-fill),
    var(--range-empty) var(--range-fill),
    var(--range-empty) 100%
  );
  box-sizing: border-box;
}

input[type="range"]::-webkit-slider-thumb {
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  margin-top: calc((var(--range-track-height) - var(--range-thumb-size)) / 2);
  border: 0;
  border-radius: 999px;
  background: var(--brand-red);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.24);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 120ms ease, box-shadow 140ms ease;
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: var(--range-track-height);
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: var(--range-empty);
  box-sizing: border-box;
}

input[type="range"]::-moz-range-progress {
  height: var(--range-track-height);
  border-radius: 999px;
  background: var(--brand-red);
}

input[type="range"]::-moz-range-thumb {
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  border: 0;
  border-radius: 999px;
  background: var(--brand-red);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.24);
  transition: transform 120ms ease, box-shadow 140ms ease;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.28);
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:focus-visible::-moz-range-thumb {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.28);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-runnable-track {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(0, 118, 200, 0.16);
}

input[type="range"]:focus-visible::-moz-range-track {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(0, 118, 200, 0.16);
}

.button-secondary:hover,
.filter-button:hover {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

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

.login-panel {
  display: grid;
  gap: 14px;
  width: min(380px, 100%);
  padding: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.login-panel h1 {
  margin-bottom: 4px;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.remember-login input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

::placeholder {
  color: #8796a8;
  opacity: 1;
}

.app-shell {
  min-height: 100vh;
  min-width: var(--workspace-min-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 6px 12px;
  border-bottom: 3px solid var(--brand-blue);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(0, 110, 182, 0.10);
}

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

.brand h1 {
  display: none;
}

.company-logo {
  display: block;
  width: 128px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
}

h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  flex: 0 0 auto;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 132px;
  width: 132px;
  max-width: 132px;
  min-height: 22px;
  padding: 1px 7px;
  border: 2px solid rgba(0, 110, 182, 0.35);
  border-radius: 999px;
  color: var(--brand-blue-dark);
  background: var(--panel);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-state.is-error {
  color: var(--red);
  border-color: rgba(227, 6, 19, 0.45);
  background: var(--red-soft);
}

.offline-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 310px;
  padding: 2px 9px;
  border: 1px solid var(--red);
  border-radius: 999px;
  color: #b91c1c;
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}

.offline-state.is-active {
  color: #ffffff;
  background: var(--red);
}

.offline-state.is-scheduled {
  color: #854d0e;
  border-color: #d97706;
  background: #fff7d6;
}

.header-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.account-label {
  max-width: 130px;
  min-width: 0;
  padding: 5px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--brand-blue-dark);
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.path-form {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.folder-picker-form {
  grid-template-columns: 42px minmax(260px, 420px) 100px 112px;
  justify-content: end;
  width: 100%;
}

.folder-picker-form select {
  min-width: 0;
}

#requestFolderSelect {
  min-width: 0;
}

#requestFolderSelect {
  max-width: 420px;
  justify-self: stretch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-picker-form > span:empty {
  min-height: 1px;
}

.path-label {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar button,
.topbar input,
.topbar select {
  min-height: 30px;
  height: 30px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar button {
  padding: 0 8px;
  overflow: visible;
  text-overflow: clip;
}

#pathCheckButton {
  min-width: 98px;
}

#pickRootFolderButton {
  min-width: 86px;
}

#refreshButton {
  min-width: 100px;
}

#pickFileButton {
  min-width: 112px;
}

#adminButton {
  min-width: 104px;
}

#diagnosticsButton {
  min-width: 116px;
}

#logoutButton {
  min-width: 70px;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 24px));
  padding: 12px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  white-space: normal;
  animation: menu-pop-in 130ms ease-out both;
}

.settings-root-form {
  display: grid;
  gap: 8px;
}

.settings-password-form {
  display: grid;
  gap: 12px;
}

.settings-offline-form {
  display: grid;
  gap: 12px;
}

.settings-offline-heading,
.settings-offline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-offline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.settings-offline-toggle input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}

.settings-offline-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-offline-dates label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.settings-offline-form textarea {
  min-height: 86px;
  resize: vertical;
}

.settings-offline-footer .settings-state {
  flex: 1 1 auto;
}

.settings-offline-footer button {
  flex: 0 0 auto;
}

.settings-view-form,
.settings-theme-form {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.settings-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
}

.settings-launch-button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 11px;
  text-align: left;
}

.settings-launch-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.settings-launch-button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-launch-copy {
  display: grid;
  gap: 1px;
}

.settings-launch-copy strong,
.settings-launch-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-launch-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.settings-launch-button.is-active {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.settings-preferences {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.72fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
}

.settings-menu input,
.settings-menu select,
.settings-menu button {
  min-height: 34px;
  height: auto;
}

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

.settings-actions,
.settings-menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-actions button,
.settings-menu-actions button {
  flex: 1 1 120px;
  min-width: 0;
}

.settings-state {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-state.is-ok {
  color: #166534;
}

.settings-state.is-error {
  color: var(--red);
}

.settings-dialog-modal {
  z-index: 45;
}

.settings-dialog-panel {
  width: min(520px, calc(100vw - 24px));
  max-height: min(680px, calc(100dvh - 24px));
  gap: 14px;
  padding: 18px;
  border-width: 1px;
}

.settings-dialog-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.settings-dialog-header .modal-heading {
  display: grid;
  gap: 2px;
}

.settings-dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.settings-dialog-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.password-input-with-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}

.password-visibility-button {
  min-width: 88px;
  min-height: 36px;
  padding: 0 12px;
  border-color: var(--border);
  background: var(--panel-soft);
  color: var(--brand-blue-dark);
  font-size: 12px;
}

.settings-dialog-modal.is-forced {
  z-index: 80;
}

.settings-dialog-modal.is-forced .modal-backdrop {
  cursor: default;
}

.settings-dialog-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-dialog-panel .settings-offline-toggle {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.settings-dialog-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.settings-dialog-footer button {
  min-width: 128px;
}

.settings-dialog-actions {
  display: flex;
  gap: 8px;
}

.admin-password-account {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.admin-password-account > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-password-account code {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--brand-blue-dark);
}

.topbar input,
.topbar select {
  padding: 0 8px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--input-bg);
}

input,
select {
  padding: 0 10px;
}

textarea {
  min-height: 74px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.35;
}

main {
  width: min(100%, var(--workspace-max-width));
  min-width: var(--workspace-min-width);
  margin: 0 auto;
  padding: 18px 20px 28px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-left: 5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 140ms ease,
    background-color 160ms ease;
}

.metric:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.metric.status-preparation,
.column.status-preparation {
  border-left-color: #64748b;
}

.metric.status-in_work,
.column.status-in_work {
  border-left-color: var(--blue);
}

.metric.status-in_production,
.column.status-in_production {
  border-left-color: var(--amber);
}

.metric.status-done,
.column.status-done {
  border-left-color: var(--green);
}

.metric.status-paused,
.column.status-paused {
  border-left-color: var(--red);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-button {
  min-width: 88px;
  padding: 0 12px;
}

.filter-button.is-active {
  color: #ffffff;
  border-color: var(--brand-red);
  background: var(--brand-red);
}

.carryover-filter-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.carryover-filter-button {
  min-width: 96px;
  padding: 0 12px;
}

.warehouse-task-filter-button {
  min-width: 150px;
  padding: 0 12px;
}

.manager-all-in-work-button {
  min-width: 178px;
  padding: 0 12px;
}

.manager-all-in-work-button.is-active {
  color: #ffffff;
  border-color: var(--brand-blue-dark);
  background: var(--brand-blue-dark);
}

.warehouse-task-filter-button.is-active {
  color: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
}

.carryover-filter-button.is-active {
  color: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
}

.carryover-filter-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.carryover-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 14;
  display: grid;
  gap: 6px;
  width: max-content;
  min-width: 190px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 180px));
  overflow: auto;
  padding: 8px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  animation: menu-pop-in 120ms ease-out;
}

.carryover-filter-option {
  justify-content: flex-start;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--button-secondary-bg);
  text-align: left;
  white-space: normal;
}

.carryover-filter-option.is-active {
  color: #ffffff;
  border-color: var(--brand-red);
  background: var(--brand-red);
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 2px solid #d92d20;
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  animation: notice-in 140ms ease-out both;
}

.notice.is-info {
  color: var(--brand-blue-dark);
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.notice.is-warning {
  color: #7a4a00;
  border-color: #f2a900;
  background: #fff3cd;
}

.notice.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
}

.noscript-message {
  position: fixed;
  z-index: 20001;
  inset: 50% auto auto 50%;
  width: min(440px, calc(100% - 32px));
  margin: 0;
  padding: 18px 20px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-panel);
  text-align: center;
}

body.is-loading {
  overflow: hidden;
  cursor: wait;
}

.loading-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  width: min(440px, calc(100vw - 32px));
  min-height: 124px;
  padding: 18px;
  border: 2px solid var(--brand-blue);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  font-weight: 700;
}

.loading-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.loading-content > strong {
  font-size: 16px;
  line-height: 1.3;
}

.loading-detail {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.loading-progress {
  position: relative;
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-muted, var(--bg));
}

.loading-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple, #7667f5));
  transition: width 180ms ease;
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.loading-meta span:last-child {
  text-align: right;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--brand-blue-soft);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.column {
  min-width: 0;
  min-height: 180px;
  padding: 10px;
  border: 2px solid var(--border-strong);
  border-left: 6px solid var(--border-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: var(--shadow-soft);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 140ms ease;
}

.column.is-drop-target {
  border-color: var(--blue);
  background: var(--brand-blue-soft);
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.28);
  transition: background-color 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 0 10px;
}

.column-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  border: 2px solid var(--border);
  border-radius: 999px;
  color: var(--brand-blue-dark);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.column-search {
  height: 36px;
  margin-bottom: 10px;
  border-color: var(--border-strong);
  background: var(--input-bg);
}

.column-search::-webkit-search-cancel-button {
  cursor: pointer;
}

.done-stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.done-stage-filter {
  min-height: 30px;
  padding: 4px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--button-secondary-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
}

.done-stage-filter.is-active {
  border-color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
}

.production-role-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.production-role-filter {
  min-height: 30px;
  padding: 4px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--button-secondary-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
}

.production-role-filter.is-active {
  border-color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
}

.production-role-filter:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.production-role-split {
  margin-left: auto;
}

.production-role-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  width: 100%;
}

.production-role-column {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.production-role-column-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.cards {
  display: grid;
  grid-auto-rows: max-content;
  gap: 10px;
  padding-left: 0;
}

.board.board-focus-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  min-height: 360px;
  overflow: hidden;
}

.board.board-focus-layout .column {
  transition:
    opacity 180ms ease,
    transform 300ms cubic-bezier(0.22, 0.85, 0.28, 1),
    width 280ms cubic-bezier(0.22, 0.85, 0.28, 1),
    min-height 180ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.board.board-focus-layout .column.is-focused-column {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  z-index: 2;
  opacity: 1;
  transform: translateX(0);
}

.board.board-focus-layout .column.is-side-column {
  position: absolute;
  top: 0;
  width: min(420px, 42vw);
  max-width: 420px;
  min-height: 260px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  z-index: 1;
}

.board.board-focus-layout .column.is-before-focused-column {
  left: 0;
  transform: translateX(calc(-100% - 24px));
}

.board.board-focus-layout .column.is-after-focused-column {
  right: 0;
  transform: translateX(calc(100% + 24px));
}

.board.board-focus-layout .column.is-side-column .column-title {
  white-space: nowrap;
}

body.task-detail-docked .board.board-focus-layout {
  min-height: calc(100vh - 160px);
}

body.task-detail-docked .board.board-focus-layout .column.is-focused-column {
  width: var(--task-detail-list-width);
}

body.task-detail-docked .board.board-focus-layout .cards {
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-right: 4px;
}

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

.board.board-side-layout .column {
  display: grid;
  grid-template-areas:
    "header cards"
    "search cards"
    "filters cards";
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 10px 14px;
  min-height: 260px;
}

.board.board-side-layout .column-header {
  grid-area: header;
  align-self: start;
  min-height: 0;
  padding: 0;
}

.board.board-side-layout .column-search {
  grid-area: search;
  margin-bottom: 0;
}

.board.board-side-layout .done-stage-filters {
  grid-area: filters;
  align-self: start;
  margin: 0;
}

.board.board-side-layout .cards {
  grid-area: cards;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-content: start;
  min-height: 100%;
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 1px 4px 1px 1px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: flex-start;
  justify-content: stretch;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  text-align: left;
  white-space: normal;
  cursor: grab;
  touch-action: none;
  box-shadow: var(--shadow-soft);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease,
    opacity 140ms ease;
}

.task-card.is-archived {
  cursor: pointer;
  background: var(--surface-hover);
}

.task-card.is-folder {
  border: 2px solid #596879;
  box-shadow:
    inset 0 0 0 1px #d7dee6,
    var(--shadow-soft);
}

.task-card:hover {
  color: var(--text);
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px #d7dee6,
    var(--shadow-hover);
}

.task-card:active {
  cursor: grabbing;
}

.task-card.is-dragging {
  opacity: 0.55;
  border-style: dashed;
  pointer-events: none;
  transform: scale(0.99);
}

.task-card.is-saving {
  border-color: var(--brand-red);
}

.card-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: start;
}

.task-title {
  display: block;
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.importance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 26px;
  padding: 2px 7px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.task-progress {
  --task-progress-percent: 0%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 26px;
  padding: 2px 7px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  color: var(--brand-blue-dark);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--brand-blue) 46%, var(--panel)) 0%,
    color-mix(in srgb, var(--brand-blue) 46%, var(--panel)) var(--task-progress-percent),
    var(--brand-blue-soft) var(--task-progress-percent),
    var(--brand-blue-soft) 100%
  );
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 180ms ease;
}

.task-card-status-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-self: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.task-card-status-line .task-progress {
  flex: 1 1 auto;
  width: auto;
  min-width: 80px;
}

.warehouse-task-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--brand-blue) 45%, var(--hard-border));
  border-radius: 6px;
  color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.done-stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 24px;
  padding: 2px 7px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.carryover-badge,
.task-months {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.carryover-badge {
  color: #7f1d1d;
  background: #fee2e2;
}

.task-months {
  color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
}

@media (min-width: 981px) {
  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, max-content) auto auto;
    align-items: start;
  }

  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .task-title {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
  }

  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .importance-badge {
    grid-column: 4;
    grid-row: 1;
  }

  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .task-progress {
    grid-column: 4;
    grid-row: 2;
  }

  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .carryover-badge,
  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .task-months {
    grid-column: 2 / span 2;
    justify-self: start;
    max-width: min(520px, 42vw);
  }

  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .carryover-badge {
    grid-row: 1;
  }

  body:not(.task-detail-docked) .board.board-focus-layout .column.is-focused-column .task-card:is(:has(.carryover-badge), :has(.task-months)) .task-months {
    grid-row: 2;
  }
}

.modal-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 8px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.modal-progress.is-complete {
  background: #ecfdf5;
  color: #166534;
}

.modal-progress-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-top: 4px;
}

.modal-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 28px;
  min-width: 0;
}

.modal-progress-label {
  min-width: 0;
  color: var(--brand-blue-dark);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.modal-progress-track {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.modal-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue-dark), #16a34a);
  transition: width 160ms ease;
}

.modal-progress-fill.is-complete {
  background: #16a34a;
}

.importance-low {
  background: #edf7ee;
  color: #166534;
}

.importance-medium {
  background: #fff7df;
  color: #8a5400;
}

.importance-high {
  background: #ffe8d6;
  color: #9a3412;
}

.importance-critical {
  background: var(--red-soft);
  color: var(--red);
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 2px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 600;
}

.remove-file-button {
  min-height: 26px;
  padding: 0 8px;
  border-color: #f1a7a1;
  color: var(--red);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.remove-file-button:hover {
  background: var(--red-soft);
}

.task-path {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#taskModal .task-path {
  font-size: 13px;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) minmax(132px, 1fr);
  gap: 8px;
}

#taskModal .field-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: start;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#taskModal .field {
  gap: 8px;
}

.task-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  justify-self: start;
}

.task-tab-button {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.task-tab-button.is-active {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  color: #fff;
}

.task-tab-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.tz-file-field {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.tz-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.tz-file-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.worker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 12px;
  min-height: 0;
}

.worker-main,
.worker-side {
  min-width: 0;
}

.worker-task-field,
.worker-tz-field,
.worker-progress-field {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.worker-task-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.worker-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.worker-tz-info {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.worker-tz-info.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.worker-role-task-item .role-task-step-text:disabled {
  opacity: 1;
  color: var(--text);
}

@media (max-width: 900px) {
  .tz-file-row,
  .worker-layout {
    grid-template-columns: 1fr;
  }
}

.manager-tab-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 260px);
  gap: 12px;
  align-items: stretch;
}

.manager-description-field {
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
  box-sizing: border-box;
}

.manager-description-field textarea {
  min-height: 118px;
}

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

#taskModal .field label {
  font-size: 14px;
}

.comments {
  display: grid;
  gap: 8px;
}

#taskModal .comments {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

#taskModal .comments .field {
  gap: 6px;
}

#taskModal .comments textarea {
  min-height: 160px;
}

.manager-images-field {
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
}

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

.manager-image-actions .button-secondary {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.manager-images-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.manager-images-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.manager-image-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  min-width: 0;
}

.manager-image-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: zoom-in;
}

.manager-image-caption {
  width: 100%;
  min-width: 0;
}

.manager-image-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.manager-image-remove {
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: var(--panel);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.manager-image-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quantity-field {
  align-content: start;
}

#taskModal .quantity-field {
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
  box-sizing: border-box;
}

.importance-field {
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
  box-sizing: border-box;
  overflow: hidden;
}

.progress-field {
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
  box-sizing: border-box;
}

.importance-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.importance-control input[type="range"] {
  width: 100%;
  --range-track-height: 8px;
  --range-thumb-size: 18px;
  min-height: 18px;
}

.importance-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.importance-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.importance-value.importance-low {
  background: #edf7ee;
  color: #166534;
}

.importance-value.importance-medium {
  background: #fff7df;
  color: #8a5400;
}

.importance-value.importance-high {
  background: #ffe8d6;
  color: #9a3412;
}

.importance-value.importance-critical {
  background: var(--red-soft);
  color: var(--red);
}

.task-month-field {
  padding: 8px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
}

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

.month-actions .button-secondary {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.month-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.month-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 6px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.month-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding: 6px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.month-option {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 28px;
  padding: 3px 5px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.12;
}

.month-option input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand-blue-dark);
}

.month-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.transfer-history {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.quantity-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quantity-list {
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 6px;
  height: 320px;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
  padding: 6px;
}

.quantity-row {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 42px;
  padding: 6px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  box-sizing: border-box;
}

.quantity-row input {
  min-height: 0;
  padding: 0 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.quantity-label-input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.quantity-value-input {
  text-align: center;
  flex: 0 0 104px;
  width: 104px;
  height: 42px;
  min-height: 42px;
}

.quantity-urgency-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  grid-template-rows: 14px 20px;
  align-items: center;
  gap: 2px 6px;
  flex: 0 0 176px;
  width: 176px;
  min-height: 42px;
  padding: 4px 6px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-sizing: border-box;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.quantity-urgency-control:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(0, 118, 200, 0.16);
}

.quantity-urgency-label {
  grid-column: 1;
  grid-row: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.quantity-urgency-input {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  --range-track-height: 6px;
  --range-thumb-size: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}

.quantity-urgency-value {
  grid-column: 2;
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.quantity-image-box {
  display: grid;
  grid-template-columns: auto 42px;
  grid-template-rows: 30px auto;
  align-items: start;
  gap: 6px;
  flex: 0 0 178px;
  width: 178px;
  min-width: 0;
  box-sizing: border-box;
}

.quantity-image-add {
  grid-column: 1;
  grid-row: 1;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.quantity-image-count {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quantity-image-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 28px;
  min-width: 0;
}

.quantity-image-empty {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quantity-image-thumb {
  position: relative;
  width: 38px;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-soft);
  cursor: zoom-in;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.quantity-image-thumb:hover,
.quantity-image-thumb:focus-visible {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(0, 118, 200, 0.18);
  transform: translateY(-1px);
  outline: none;
}

.quantity-image-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quantity-image-remove {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1px solid var(--red);
  border-radius: 0 4px 0 5px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.quantity-image-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.attachment-preview-modal {
  z-index: 120;
}

.attachment-preview-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(92vw, 980px);
  max-height: 92vh;
  padding: 14px;
  border: 2px solid var(--hard-border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.attachment-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-preview-header h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

#attachmentPreviewImage {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 720px);
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

#attachmentPreviewCaption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quantity-remove-button,
.quantity-add-button {
  min-height: 0;
  padding: 0 10px;
  font-size: 14px;
}

.quantity-remove-button {
  width: 34px;
  height: 100%;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.quantity-add-button {
  justify-self: start;
  min-height: 36px;
}

.quantity-add-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.status-pill.status-preparation {
  color: var(--muted);
  background: var(--panel-soft);
}

.status-pill.status-in_work {
  color: #174fbf;
  background: var(--blue-soft);
}

.status-pill.status-in_production {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.status-done {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.status-paused {
  color: var(--red);
  background: var(--red-soft);
}

.status-archive,
.archive-column {
  border-color: #111827;
}

.archive-column {
  grid-column: 1 / -1;
}

.empty {
  min-height: 92px;
  padding: 16px;
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(24, 33, 43, 0.46);
}

.modal-backdrop:hover {
  background: rgba(24, 33, 43, 0.5);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  margin: auto 0;
  overflow: auto;
  padding: 18px;
  border: 2px solid #596879;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  animation: modal-panel-in 140ms ease-out;
}

#taskModal .modal-panel {
  width: min(1220px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 16px);
  padding: 30px 32px;
  gap: 22px;
  font-size: 15px;
  box-sizing: border-box;
}

#taskModal.is-docked {
  position: fixed;
  inset: var(--task-detail-top, 72px) 14px 14px var(--task-detail-left, calc(var(--task-detail-list-width) + var(--task-detail-panel-gap) + 28px));
  z-index: 12;
  display: block;
  overflow: visible;
  padding: 0;
  min-width: 640px;
  pointer-events: none;
}

#taskModal.is-docked .modal-backdrop {
  display: none;
}

#taskModal.is-docked .modal-panel {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  overflow: auto;
  padding: 18px;
  pointer-events: auto;
  animation: task-detail-dock-in 160ms ease-out;
}

#taskModal.is-docked .modal-header {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) minmax(160px, 220px) auto;
  gap: 10px;
}

#taskModal.is-docked .modal-heading h2 {
  font-size: 21px;
}

#taskModal.is-docked .field-grid {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}

#taskModal.is-docked textarea {
  min-height: 150px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#taskModal .modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) minmax(180px, 260px) auto;
  align-items: start;
  gap: 16px;
}

.modal-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-status-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#taskModal .modal-status-field {
  justify-self: stretch;
}

#taskModal #modalCloseButton {
  grid-column: 4;
}

#taskModal .modal-header-actions {
  grid-column: 4;
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.task-ready-button {
  min-height: 40px;
  padding: 0 12px;
  border-color: var(--brand-blue-dark);
  color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.task-ready-button:hover {
  background: color-mix(in srgb, var(--brand-blue-soft) 70%, white);
}

#taskModal .modal-status-field label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

#taskModal .modal-status-field select {
  width: 100%;
}

.modal-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.25;
}

#taskModal .modal-heading h2 {
  font-size: 26px;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--panel);
  font-size: 22px;
  line-height: 1;
}

#taskModal .modal-close {
  width: 40px;
  height: 40px;
  min-height: 40px;
  font-size: 24px;
}

.modal-close:hover {
  background: var(--panel-soft);
}

.modal-fields {
  display: grid;
  gap: 12px;
}

#taskModal .modal-fields {
  gap: 20px;
}

.task-dates-field {
  margin: 0;
}

.task-dates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.date-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.date-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
}

#taskModal .modal-footer {
  min-height: 48px;
}

#taskModal .modal-actions button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

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

#taskModal textarea {
  min-height: 200px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.45;
}

#taskModal input,
#taskModal select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
}

#taskModal input[type="range"] {
  min-height: var(--range-thumb-size);
  padding: 0;
  border: 0;
}

#taskModal .importance-control input[type="range"] {
  height: 18px;
  min-height: 18px;
}

#taskModal textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#taskModal .quantity-row input {
  min-height: 0;
  padding: 0 10px;
  font-size: 14px;
  box-sizing: border-box;
}

#taskModal .quantity-row .quantity-label-input,
#taskModal .quantity-row .quantity-value-input,
#taskModal .quantity-row .quantity-urgency-input {
  width: auto;
}

#taskModal .quantity-row .quantity-label-input {
  flex: 1 1 0;
  width: 0;
  min-height: 42px;
  padding: 8px 10px;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

#taskModal .quantity-row .quantity-value-input {
  appearance: textfield;
  -moz-appearance: textfield;
  flex: 0 0 104px;
  height: 42px;
  min-height: 42px;
}

#taskModal .quantity-row .quantity-urgency-control {
  flex: 0 0 176px;
  width: 176px;
}

#taskModal .quantity-row .quantity-urgency-input {
  width: 100%;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

#taskModal .quantity-row .quantity-value-input::-webkit-outer-spin-button,
#taskModal .quantity-row .quantity-value-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#taskModal .quantity-row .quantity-remove-button {
  min-height: 0;
  height: 42px;
  width: 34px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

#taskModal .quantity-add-button {
  min-height: 36px;
}

.diagnostics-panel {
  width: 1180px;
  max-width: none;
}

.diagnostics-panel .modal-header {
  align-items: center;
}

.diagnostics-panel #diagnosticsRefreshButton,
.diagnostics-panel #diagnosticsLoadTestButton {
  margin-left: auto;
  min-width: 104px;
}

.diagnostics-panel #diagnosticsLoadTestButton + #diagnosticsRefreshButton {
  margin-left: 0;
}

.diagnostics-content {
  display: grid;
  gap: 12px;
  min-height: 160px;
}

.diagnostics-updated {
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.diagnostics-summary {
  display: none;
  gap: 8px;
}

.diagnostics-summary-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
}

.diagnostics-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.diagnostics-summary-item strong {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.diagnostics-summary-item.diagnostics-ok {
  border-color: #15803d;
  background: var(--green-soft);
}

.diagnostics-summary-item.diagnostics-warning {
  border-color: #c47a05;
  background: var(--amber-soft);
}

.diagnostics-summary-item.diagnostics-error {
  border-color: var(--red);
  background: var(--red-soft);
}

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

.diagnostics-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
}

.diagnostics-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.diagnostics-card h3 {
  margin: 0;
  font-size: 16px;
}

.diagnostics-status {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 2px 8px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.diagnostics-ok .diagnostics-status {
  border-color: #15803d;
  background: var(--green-soft);
  color: #166534;
}

.diagnostics-warning .diagnostics-status {
  border-color: #c47a05;
  background: var(--amber-soft);
  color: #8a5400;
}

.diagnostics-error .diagnostics-status {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.diagnostics-card-body {
  display: grid;
  gap: 6px;
}

.diagnostics-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.diagnostics-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.diagnostics-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.diagnostics-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.diagnostics-log {
  max-height: 180px;
  margin: 4px 0 0;
  padding: 8px;
  overflow: auto;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #0f172a;
  color: #e5eefb;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.diagnostics-load-steps {
  max-height: 130px;
}

textarea:disabled,
input:disabled,
select:disabled {
  color: var(--muted);
  background: var(--panel-soft);
  cursor: not-allowed;
}

.assignment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.assignment-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 4px 8px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.assignment-option input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}

#taskModal .assignment-option input {
  width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--brand-blue-dark);
}

#taskModal .assignment-option {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  min-width: 132px;
  max-width: 230px;
  min-height: 32px;
  box-sizing: border-box;
  white-space: normal;
  overflow: visible;
}

#taskModal .assignment-option span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.assignment-readonly {
  cursor: default;
}

.role-tasks-field {
  padding: 12px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
}

.role-tasks-list {
  display: grid;
  gap: 12px;
  align-content: start;
  align-items: start;
}

.role-task-item {
  display: grid;
  gap: 10px;
  align-content: start;
  align-self: start;
  padding: 8px 10px 10px;
  border: 2px solid var(--hard-border);
  border-radius: 8px;
  background: var(--panel);
}

.role-task-item.is-complete {
  background: #f0fdf4;
}

.role-task-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 28px;
}

.role-task-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.role-task-header-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.role-task-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  padding: 2px 8px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.role-task-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand-blue-dark);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.role-task-add:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.role-task-steps {
  display: grid;
  gap: 8px;
  align-content: start;
  align-items: start;
}

.role-task-history {
  border-top: 1px solid var(--hard-border);
  padding-top: 8px;
}

.role-task-history > summary {
  width: max-content;
  max-width: 100%;
  color: var(--brand-blue-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.role-task-history-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.role-task-history-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--brand-blue);
  border-radius: 7px;
  background: var(--panel);
}

.role-task-history-entry.action-created,
.role-task-history-entry.action-delivered {
  border-left-color: var(--green);
}

.role-task-history-entry.action-removed {
  border-left-color: var(--red);
}

.role-task-history-entry.action-ordered {
  border-left-color: var(--amber);
}

.role-task-history-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.role-task-history-main strong,
.role-task-history-main span,
.role-task-history-main small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-task-history-main strong {
  font-size: 12px;
}

.role-task-history-main span {
  color: var(--text);
  font-size: 12px;
}

.role-task-history-main small,
.role-task-history-meta {
  color: var(--muted);
  font-size: 10px;
}

.role-task-history-meta {
  align-self: start;
  text-align: right;
  white-space: nowrap;
}

.role-task-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 110px minmax(150px, 180px) 30px;
  gap: 8px;
  align-items: center;
}

.role-task-step.is-warehouse-step {
  grid-template-columns: minmax(0, 1fr) 78px 110px minmax(170px, 220px) minmax(150px, 190px) auto 30px;
}

.role-task-step.is-supply-step {
  grid-template-columns: minmax(0, 1fr) 92px 110px minmax(190px, 230px) 30px;
}

.role-task-step-text {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 10px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--input-bg);
  font-size: 14px;
  line-height: 1.25;
}

.role-task-step-done-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand-blue-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.role-task-step-quantity,
.role-task-step-unit {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 36px;
  padding: 7px 8px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--input-bg);
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
}

.role-task-step-unit {
  padding: 0 8px;
}

#taskModal .role-task-step-unit {
  min-height: 36px;
  padding: 0 8px;
  font-size: 14px;
}

.role-task-step-progress-box {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 5px 7px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  box-sizing: border-box;
}

.warehouse-step-box,
.supply-step-box {
  display: grid;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid var(--ui-line-strong, var(--hard-border));
  border-radius: var(--ui-radius-sm, 6px);
  background: var(--panel);
  box-sizing: border-box;
}

.warehouse-step-box {
  grid-template-columns: 70px minmax(0, 1fr);
}

.warehouse-available-input {
  width: 70px;
  min-width: 0;
  min-height: 26px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

.warehouse-missing {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.warehouse-missing-value {
  color: var(--red);
}

.warehouse-missing-value.is-empty,
.warehouse-missing .is-empty {
  color: #15803d;
}

.warehouse-approve-label,
.supply-status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--ui-line-strong, var(--hard-border));
  border-radius: var(--ui-radius-sm, 6px);
  background: var(--panel);
  color: var(--brand-blue-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.warehouse-approve-label input,
.supply-status-label input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.warehouse-transfer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #16a34a;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.supply-step-box {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.warehouse-approve-all-button,
.warehouse-transfer-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--brand-blue);
  border-radius: 6px;
  background: var(--brand-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.warehouse-approve-all-button {
  width: 100%;
  min-height: 38px;
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.warehouse-approve-all-button:hover {
  background: #bbf7d0;
}

.warehouse-approve-all-button.is-approved {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red-soft) 55%, var(--panel) 45%);
  color: var(--red);
  filter: brightness(0.82) saturate(0.85);
}

.warehouse-approve-all-button.is-approved:hover {
  background: color-mix(in srgb, var(--red-soft) 55%, var(--panel) 45%);
}

.warehouse-approve-all-button:disabled,
.warehouse-transfer-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.role-task-step-done-quantity {
  width: 70px;
  min-width: 0;
  min-height: 26px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

.role-task-step-left {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

#taskModal .role-task-step-done {
  width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--brand-blue-dark);
  flex: 0 0 auto;
}

.role-task-step-remove {
  width: 30px;
  height: 30px;
  border: 2px solid var(--hard-border);
  border-radius: 6px;
  background: var(--panel);
  color: #b91c1c;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.role-task-step-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.role-task-step-images {
  grid-column: 1 / -1;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.role-task-step-image {
  position: relative;
  display: inline-grid;
  grid-template-columns: 34px minmax(72px, 1fr) 30px;
  flex: 0 1 290px;
  width: min(100%, 290px);
  min-width: 0;
  max-width: 290px;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  box-sizing: border-box;
}

.role-task-step-image-preview {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #b9d4e6;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.role-task-step-image-preview.is-file {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: #eef6fb;
  color: #075c91;
  cursor: default;
}

.role-task-step-image-preview.is-file strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  letter-spacing: -0.02em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-task-step-image-preview.is-file small {
  display: none;
}

.role-task-step-image-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-task-step-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-task-step-image-download {
  display: inline-flex;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9d4e6;
  border-radius: 7px;
  background: #fff;
  color: #075c91;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
}

.role-task-step-image-download:hover,
.role-task-step-image-download:focus-visible {
  border-color: #1684c6;
  background: #e8f6ff;
}

.role-task-step-image-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e11d2e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  cursor: pointer;
}

.role-task-step-image-add {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px dashed #1684c6;
  border-radius: 8px;
  background: #eef8ff;
  color: #075c91;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.role-task-step-image-count {
  color: #52677a;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 520px) {
  .role-task-step-image {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }
}

.role-task-step-text:disabled,
.role-task-step-quantity:disabled,
.role-task-step-unit:disabled,
.role-task-step-done-quantity:disabled,
.role-task-step-done:disabled + span,
.role-task-step-text:disabled {
  color: var(--muted);
}

.role-task-step-text:disabled,
.role-task-step-quantity:disabled,
.role-task-step-unit:disabled,
.role-task-step-progress-box:has(.role-task-step-done-quantity:disabled),
.role-task-step-done-label.is-disabled {
  background: var(--panel-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.role-task-step-text::placeholder {
  color: #94a3b8;
}

.role-task-step.is-complete .role-task-step-text {
  background: #f0fdf4;
}

@media (max-width: 720px) {
  body.timesheet-day-open {
    overflow: hidden;
  }

  .role-task-header {
    flex-wrap: wrap;
  }

  .role-task-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .role-task-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-step.is-warehouse-step,
  .role-task-step.is-supply-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-step-quantity,
  .role-task-step-unit,
  .role-task-step-done-label,
  .role-task-step-progress-box,
  .warehouse-step-box,
  .warehouse-approve-label,
  .supply-step-box {
    width: 100%;
  }

  .role-task-step-remove {
    justify-self: end;
  }
}

/* Task notes share the existing notes storage, but stay inside the active task. */
#taskModal #notesTaskPanel {
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.task-notes-composer,
.task-notes-history {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ui-line-strong, var(--border));
  border-radius: var(--ui-radius, 8px);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.task-notes-composer {
  grid-template-rows: auto minmax(0, 1fr);
}

.task-notes-history {
  grid-template-rows: auto minmax(0, 1fr);
}

.task-notes-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-notes-heading > div {
  display: grid;
  gap: 4px;
}

.task-notes-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.task-notes-kicker {
  color: var(--brand-blue-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-notes-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 10px;
  font-weight: 800;
}

.task-note-form {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
  gap: 8px;
}

.task-note-form > label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

#taskModal .task-note-form textarea {
  width: 100%;
  min-height: 180px;
  height: 100%;
  resize: none;
  box-sizing: border-box;
  line-height: 1.5;
}

.task-note-help {
  display: grid;
  min-height: 34px;
  align-content: start;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.task-note-status {
  min-height: 14px;
  color: var(--muted);
  font-weight: 800;
}

.task-note-status.is-ok {
  color: var(--green);
}

.task-note-status.is-error {
  color: var(--brand-red);
}

.task-note-form > button {
  justify-self: end;
  min-width: 160px;
}

.task-notes-list {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 9px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.task-notes-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--ui-radius, 8px);
  color: var(--muted);
  background: var(--panel-soft);
  text-align: center;
}

.task-note-card {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--ui-radius, 8px);
  background: var(--panel-soft);
}

.task-note-card > header,
.task-note-card > footer,
.task-note-author,
.task-note-images {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-note-card > header {
  justify-content: space-between;
}

.task-note-author {
  min-width: 0;
  flex-wrap: wrap;
}

.task-note-author strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.task-note-card time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.task-note-card > p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.task-note-card > footer {
  justify-content: flex-end;
}

.task-note-images {
  flex-wrap: wrap;
}

.task-note-images button {
  min-height: 28px;
  max-width: 220px;
  overflow: hidden;
  padding: 0 8px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  #taskModal #notesTaskPanel {
    grid-template-columns: 1fr;
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .task-notes-composer,
  .task-notes-history {
    min-height: 330px;
    padding: 12px;
  }

  .task-notes-list {
    overflow: visible;
  }

  .task-note-card > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-note-form > button {
    width: 100%;
  }
}

.role-task-done-label {
  display: none;
  cursor: pointer;
}

.role-task-done-label input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--brand-blue-dark);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.admin-panel {
  width: min(1500px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.admin-tab {
  min-height: 40px;
  border-color: var(--border);
  color: var(--text);
  background: var(--panel);
  font-weight: 700;
}

.admin-tab:hover {
  background: var(--panel-soft);
}

.admin-tab.is-active {
  color: #ffffff;
  border-color: #2f3a45;
  background: #2f3a45;
}

.admin-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}

.admin-section h3 {
  margin: 0;
  font-size: 16px;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-row,
.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.admin-form {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.admin-row > input[type="text"] {
  grid-column: 1 / -1;
}

.admin-row > button {
  justify-self: end;
  min-width: 120px;
}

.user-row {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.user-row > input[type="text"] {
  grid-column: auto;
}

.user-row > button {
  grid-column: 2;
}

.admin-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-check input[type="checkbox"] {
  justify-self: end;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
}

.admin-username {
  grid-column: 1 / -1;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-users-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto auto;
  gap: 8px;
  align-items: center;
}

.roles-admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.roles-admin-toolbar button {
  min-width: 120px;
}

.roles-table-wrap,
.accounts-table-wrap {
  overflow: auto;
  border: 2px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
}

.roles-table,
.accounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.roles-table {
  min-width: 1120px;
}

.accounts-table {
  min-width: 860px;
}

.role-interface-cell {
  min-width: 116px;
}

.role-interface-select {
  min-width: 108px;
}

.roles-table th,
.roles-table td,
.accounts-table th,
.accounts-table td {
  padding: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.roles-table th,
.accounts-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #ffffff;
  background: var(--brand-blue-dark);
  text-align: left;
  font-size: 12px;
}

.roles-table input,
.roles-table select,
.accounts-table input,
.accounts-table select {
  width: 100%;
  min-height: 34px;
  font-size: 13px;
}

.account-field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.admin-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.company-member-account-identity {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.company-member-account-identity span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.company-member-account-identity strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.company-members-table th:last-child,
.company-members-table td:last-child {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
}

.copy-button,
.account-save-button {
  min-height: 34px;
  padding: 6px 9px;
  white-space: nowrap;
}

.danger-button {
  border-color: var(--red);
  background: var(--panel);
  color: var(--red);
}

.danger-button:hover:not(:disabled) {
  background: var(--red-soft);
}

.copy-button:disabled,
.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-login-cell,
.account-password-cell {
  min-width: 190px;
}

.account-action-cell {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
}

.accounts-table th:last-child,
.accounts-table td:last-child {
  width: 104px;
}

.accounts-empty {
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.role-name-cell {
  min-width: 200px;
}

.role-flag-cell {
  width: 68px;
  min-width: 68px;
  max-width: 68px;
}

.role-flag-cell .admin-check {
  width: 100%;
}

.role-action-cell {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  white-space: nowrap;
}

.roles-table th:last-child,
.roles-table td:last-child {
  width: 104px;
}

.role-action-cell .admin-action-buttons {
  justify-content: center;
}

.admin-check.admin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--red);
  border-radius: var(--ui-radius-sm);
  background: var(--red-soft);
  color: #991b1b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.admin-check.admin-toggle.is-active {
  border-color: #16a34a;
  background: var(--green-soft);
  color: #166534;
}

.admin-check.admin-toggle.is-inactive {
  border-color: color-mix(in srgb, var(--red) 60%, var(--border));
  background: var(--red-soft);
  color: #991b1b;
}

.admin-toggle-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-toggle-state {
  display: block;
  width: 100%;
  text-align: center;
}

.account-add-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
}

.account-add-form button {
  min-width: 150px;
}

body[data-theme="dark"] .task-card.is-folder,
body[data-theme="dark"] .task-card:hover {
  box-shadow:
    inset 0 0 0 1px rgba(169, 190, 208, 0.22),
    var(--shadow-hover);
}

body[data-theme="dark"] .importance-value.importance-low,
body[data-theme="dark"] .admin-check.admin-toggle.is-active,
body[data-theme="dark"] .modal-progress.is-complete,
body[data-theme="dark"] .role-task-item.is-complete,
body[data-theme="dark"] .role-task-step.is-complete .role-task-step-text,
body[data-theme="dark"] .diagnostics-summary-item.diagnostics-ok,
body[data-theme="dark"] .diagnostics-ok .diagnostics-status {
  background: var(--green-soft);
  color: #b9f6cf;
}

body[data-theme="dark"] .importance-value.importance-medium,
body[data-theme="dark"] .diagnostics-summary-item.diagnostics-warning,
body[data-theme="dark"] .diagnostics-warning .diagnostics-status {
  background: var(--amber-soft);
  color: #ffd892;
}

body[data-theme="dark"] .importance-value.importance-high {
  background: #3c2114;
  color: #ffbd8a;
}

body[data-theme="dark"] .carryover-badge,
body[data-theme="dark"] .admin-check.admin-toggle.is-inactive,
body[data-theme="dark"] .diagnostics-summary-item.diagnostics-error,
body[data-theme="dark"] .diagnostics-error .diagnostics-status {
  background: var(--red-soft);
  color: #ffb8c0;
}

body[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 8, 14, 0.68);
}

body[data-theme="dark"] .modal-backdrop:hover {
  background: rgba(0, 8, 14, 0.74);
}

body[data-ui-mode="mobile"] .board.board-side-layout .column {
  grid-template-areas:
    "header"
    "search"
    "filters"
    "cards";
  grid-template-columns: minmax(0, 1fr);
  min-height: 180px;
}

body[data-ui-mode="mobile"] .board.board-side-layout .cards {
  grid-template-columns: minmax(0, 1fr);
  max-height: none;
  overflow: visible;
  padding: 0;
}

body[data-ui-mode="mobile"] .board.board-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

body[data-ui-mode="mobile"] .board.board-focus-layout .column.is-side-column {
  position: absolute;
  width: min(420px, 82vw);
  max-width: 420px;
  min-height: 220px;
  opacity: 0;
  pointer-events: none;
}

html.board-view-transition .column,
html.board-view-transition .task-card {
  animation: none;
}

html.board-static-update .column,
html.board-static-update .task-card {
  animation: none !important;
  transition: none !important;
}

html.board-static-update::view-transition-old(root),
html.board-static-update::view-transition-new(root) {
  animation: none !important;
}

html.board-view-transition::view-transition-old(root),
html.board-view-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

html.board-view-transition::view-transition-group(column-preparation),
html.board-view-transition::view-transition-group(column-in_work),
html.board-view-transition::view-transition-group(column-in_production),
html.board-view-transition::view-transition-group(column-done),
html.board-view-transition::view-transition-group(column-paused),
html.board-view-transition::view-transition-group(column-archive) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.22, 0.85, 0.28, 1);
}

html.board-view-transition::view-transition-old(column-preparation),
html.board-view-transition::view-transition-new(column-preparation),
html.board-view-transition::view-transition-old(column-in_work),
html.board-view-transition::view-transition-new(column-in_work),
html.board-view-transition::view-transition-old(column-in_production),
html.board-view-transition::view-transition-new(column-in_production),
html.board-view-transition::view-transition-old(column-done),
html.board-view-transition::view-transition-new(column-done),
html.board-view-transition::view-transition-old(column-paused),
html.board-view-transition::view-transition-new(column-paused),
html.board-view-transition::view-transition-old(column-archive),
html.board-view-transition::view-transition-new(column-archive) {
  height: 100%;
  overflow: clip;
  mix-blend-mode: normal;
}

@media (max-width: 1180px) {
  body.task-detail-docked main {
    width: min(100%, var(--workspace-max-width));
    margin: 0 auto;
  }

  body.task-detail-docked .board.board-focus-layout .column.is-focused-column {
    width: 100%;
  }

  #taskModal.is-docked {
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: start center;
    overflow: auto;
    padding: 18px;
    pointer-events: auto;
  }

  #taskModal.is-docked .modal-backdrop {
    display: block;
  }

  #taskModal.is-docked .modal-panel {
    width: min(1220px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100vh - 16px);
    margin: auto 0;
  }

  .board {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 980px) {
  .board.board-focus-layout,
  body[data-ui-mode="tablet"] .board.board-focus-layout,
  body[data-ui-mode="mobile"] .board.board-focus-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .board.board-focus-layout .column.is-side-column,
  body[data-ui-mode="tablet"] .board.board-focus-layout .column.is-side-column,
  body[data-ui-mode="mobile"] .board.board-focus-layout .column.is-side-column {
    position: absolute;
    width: min(420px, 82vw);
    max-width: 420px;
    min-height: 220px;
    opacity: 0;
    pointer-events: none;
  }

  .board.board-side-layout .column,
  body[data-ui-mode="tablet"] .board.board-side-layout .column,
  body[data-ui-mode="mobile"] .board.board-side-layout .column {
    grid-template-areas:
      "header"
      "search"
      "filters"
      "cards";
    grid-template-columns: minmax(0, 1fr);
    min-height: 180px;
  }

  .board.board-side-layout .cards,
  body[data-ui-mode="tablet"] .board.board-side-layout .cards,
  body[data-ui-mode="mobile"] .board.board-side-layout .cards {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  #taskModal .modal-panel {
    padding: 20px;
    gap: 16px;
  }

  #taskModal .modal-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  #taskModal .modal-status-field {
    grid-column: 1 / -1;
  }

  #taskModal #modalCloseButton {
    grid-column: 2;
  }

  #taskModal .modal-header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  #taskModal .field-grid,
  .manager-tab-grid,
  #taskModal .comments {
    grid-template-columns: 1fr;
  }

  .task-dates-grid {
    grid-template-columns: 1fr;
  }

  .modal-progress-head {
    align-items: stretch;
  }

  .modal-progress {
    width: 100%;
    box-sizing: border-box;
  }

  .role-task-step {
    grid-template-columns: minmax(0, 1fr) 78px 110px minmax(150px, 180px) 30px;
  }
}

@media (max-width: 760px) {
  #taskModal .comments {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: sticky;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: center;
  }

  .brand {
    justify-content: flex-start;
  }

  .path-form {
    grid-template-columns: 42px minmax(220px, 1fr) auto auto;
  }

  .folder-picker-form {
    grid-template-columns: 42px minmax(260px, 1fr) 100px 112px;
  }

  .folder-picker-form > span:empty {
    display: block;
  }

  .account-bar {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .account-label {
    flex: 0 1 auto;
  }

  .admin-users-toolbar,
  .account-add-form {
    grid-template-columns: 1fr;
  }

  .accounts-table {
    min-width: 980px;
  }

  .path-label {
    font-size: 12px;
  }

  main {
    padding: 18px 20px 28px;
  }

  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .board {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .admin-row,
  .admin-form,
  .user-row {
    grid-template-columns: 1fr;
  }

  .user-row > button {
    grid-column: auto;
  }
}

@media (max-width: 460px) {
  #taskModal .modal-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #taskModal .modal-status-field {
    grid-column: 1 / -1;
  }

  #taskModal #modalCloseButton {
    grid-column: 2;
  }

  #taskModal .modal-header-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .role-task-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-step.is-warehouse-step,
  .role-task-step.is-supply-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-step-quantity,
  .role-task-step-unit,
  .role-task-step-done-label,
  .role-task-step-progress-box,
  .warehouse-step-box,
  .warehouse-approve-label,
  .supply-step-box {
    width: 100%;
  }

  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

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

  #taskModal .field-grid {
    grid-template-columns: 1fr;
  }

  .manager-tab-grid {
    grid-template-columns: 1fr;
  }

  .task-tabs {
    width: 100%;
    box-sizing: border-box;
  }

  .task-tab-button {
    flex: 1 1 0;
    padding: 0 10px;
  }

  .toolbar {
    display: flex;
    grid-template-columns: none;
  }

  .modal-panel {
    padding: 18px;
  }

  .modal-heading {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .modal-footer {
    align-items: center;
    flex-direction: row;
  }

  .modal-actions {
    justify-content: flex-end;
  }

  .modal-actions button {
    width: auto;
  }

  .filter-button {
    min-width: 88px;
  }
}

/* Production schedule */

body[data-workspace="schedule"] {
  overflow-x: hidden;
}

body[data-workspace="schedule"] .app-shell,
body[data-workspace="schedule"] main,
body[data-workspace="schedule"] .schedule-workspace {
  min-width: 0;
}

.production-schedule-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(210px, 0.65fr) minmax(230px, 0.7fr);
  gap: 18px;
  align-items: stretch;
  min-height: 230px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 0%, rgba(227, 6, 19, 0.10), transparent 30%),
    radial-gradient(circle at 10% 110%, rgba(0, 110, 182, 0.16), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow-soft);
}

.production-schedule-copy {
  align-self: center;
}

.production-schedule-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.production-schedule-copy h2,
.production-schedule-heading h2 {
  margin: 0;
}

.production-schedule-copy h2 {
  font-size: clamp(26px, 3vw, 42px);
}

.production-schedule-copy p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.production-schedule-month-card,
.production-schedule-open {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.production-schedule-month-card > span,
.production-schedule-month-card > small,
.production-schedule-open > small {
  color: var(--muted);
  font-size: 11px;
}

.production-schedule-month-card > strong {
  font-size: 20px;
  text-transform: capitalize;
}

.production-schedule-open {
  border-color: var(--brand-blue);
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  text-align: left;
  box-shadow: 0 14px 30px rgba(0, 110, 182, 0.24);
}

.production-schedule-open:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.production-schedule-open > span {
  font-size: 18px;
  font-weight: 800;
}

.production-schedule-open > small {
  color: rgba(255, 255, 255, 0.78);
}

.production-schedule-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(250px, 1.2fr);
  gap: 10px;
  margin-top: 14px;
}

.production-schedule-preview > article,
.production-schedule-preview-legend {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.production-schedule-preview > article {
  display: grid;
  align-content: center;
  gap: 5px;
}

.production-schedule-preview > article span {
  color: var(--muted);
  font-size: 10px;
}

.production-schedule-preview > article strong {
  font-size: 22px;
}

.production-schedule-preview-legend,
.production-schedule-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.production-schedule-preview-legend i,
.production-schedule-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
}

.production-schedule-preview-legend i.is-start,
.production-schedule-legend i.is-start {
  background: var(--brand-blue);
}

.production-schedule-preview-legend i.is-end,
.production-schedule-legend i.is-end {
  background: var(--brand-red);
}

.production-schedule-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.production-schedule-status.is-error {
  color: var(--brand-red);
}

.production-schedule-modal {
  z-index: 80;
}

.production-schedule-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(97vw, 1880px);
  max-width: none;
  height: min(94vh, 1120px);
  max-height: none;
  padding: 0;
  overflow: hidden;
}

.production-schedule-modal-header {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.production-schedule-heading .production-schedule-kicker {
  margin-bottom: 4px;
}

.production-schedule-month-navigation {
  display: flex;
  align-items: center;
  gap: 10px;
}

.production-schedule-month-navigation > div {
  display: grid;
  min-width: 190px;
  gap: 2px;
  text-align: center;
}

.production-schedule-month-navigation strong {
  text-transform: capitalize;
}

.production-schedule-month-navigation span {
  color: var(--muted);
  font-size: 10px;
}

.production-schedule-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.production-schedule-legend-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.production-schedule-inline-status {
  min-width: 170px;
  margin: 0;
  text-align: left;
}

.production-schedule-scroll-controls {
  display: flex;
  gap: 8px;
}

.production-schedule-scroll {
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  scrollbar-gutter: stable;
}

.production-schedule-grid {
  width: max-content;
  min-width: 100%;
  border-spacing: 0;
  border-collapse: separate;
}

.production-schedule-grid th,
.production-schedule-grid td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.production-schedule-day-header {
  position: sticky;
  z-index: 4;
  top: 0;
  width: 114px;
  min-width: 114px;
  height: 58px;
  padding: 8px;
  color: var(--text);
  background: var(--panel-soft);
  text-align: center;
}

.production-schedule-day-header strong,
.production-schedule-day-header span {
  display: block;
}

.production-schedule-day-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.production-schedule-day-header.is-weekend {
  color: var(--brand-red);
}

.production-schedule-person {
  position: sticky;
  z-index: 3;
  left: 0;
  width: 250px;
  min-width: 250px;
  padding: 12px;
  background: var(--panel);
  text-align: left;
  vertical-align: middle;
}

.production-schedule-corner {
  z-index: 6;
  top: 0;
  background: var(--panel-soft);
}

.production-schedule-corner > span,
.production-schedule-corner > small {
  display: block;
}

.production-schedule-corner > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.production-schedule-person-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.production-schedule-avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--brand-blue);
  font-size: 10px;
  font-weight: 800;
}

.production-schedule-person-content > span:last-child {
  min-width: 0;
}

.production-schedule-person strong,
.production-schedule-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-schedule-person small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.production-schedule-day-cell {
  width: 114px;
  min-width: 114px;
  padding: 7px;
  background: var(--panel);
}

.production-schedule-day-cell.is-weekend {
  background: color-mix(in srgb, var(--brand-red-soft) 30%, var(--panel));
}

.production-schedule-day-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--brand-blue);
}

.production-schedule-times {
  display: grid;
  gap: 5px;
}

.production-schedule-time-field {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}

.production-schedule-time-field > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.production-schedule-time-field.is-start > span {
  color: var(--brand-blue);
}

.production-schedule-time-field.is-end > span {
  color: var(--brand-red);
}

.production-schedule-time-input {
  width: 76px;
  min-width: 0;
  height: 30px;
  padding: 3px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  font-size: 10px;
}

.production-schedule-time-input.has-value {
  border-color: var(--brand-blue);
}

.production-schedule-time-field.is-end .production-schedule-time-input.has-value {
  border-color: var(--brand-red);
}

.production-schedule-day-cell.is-saving {
  opacity: 0.55;
}

.production-schedule-empty {
  height: 150px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1050px) {
  .production-schedule-hero {
    grid-template-columns: 1fr 1fr;
  }

  .production-schedule-copy {
    grid-column: 1 / -1;
  }

  .production-schedule-preview {
    grid-template-columns: repeat(3, 1fr);
  }

  .production-schedule-preview-legend {
    grid-column: 1 / -1;
  }

  .production-schedule-modal-header {
    grid-template-columns: 1fr auto auto;
  }

  .production-schedule-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .production-schedule-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .production-schedule-copy {
    grid-column: auto;
  }

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

  .production-schedule-preview-legend {
    grid-column: 1 / -1;
  }

  .production-schedule-panel {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
  }

  .production-schedule-modal-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px;
  }

  .production-schedule-month-navigation {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .production-schedule-modal-header > #productionScheduleTodayButton {
    justify-self: end;
  }

  .production-schedule-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .production-schedule-legend-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .production-schedule-inline-status {
    min-width: 0;
  }

  .production-schedule-scroll-controls button {
    flex: 1;
  }

  .production-schedule-person {
    width: 190px;
    min-width: 190px;
  }
}

body[data-ui-mode="compact"] {
  --workspace-min-width: 900px;
}

body[data-ui-mode="compact"] .topbar {
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 46px;
  padding: 4px 8px;
}

body[data-ui-mode="compact"] .company-logo {
  width: 106px;
  height: 30px;
}

body[data-ui-mode="compact"] main {
  padding: 12px;
}

body[data-ui-mode="compact"] .metrics {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

body[data-ui-mode="compact"] .metric,
body[data-ui-mode="compact"] .column {
  padding: 8px;
}

body[data-ui-mode="compact"] .board {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

body[data-ui-mode="tablet"],
body[data-ui-mode="mobile"],
body[data-ui-mode="workstation"] {
  --workspace-min-width: 0px;
}

body[data-ui-mode="tablet"] .app-shell,
body[data-ui-mode="mobile"] .app-shell,
body[data-ui-mode="workstation"] .app-shell {
  min-width: 0;
}

body[data-ui-mode="tablet"] .topbar {
  grid-template-columns: 170px minmax(0, 1fr);
  padding: 8px;
}

body[data-ui-mode="tablet"] .company-logo {
  width: 116px;
  height: 34px;
}

body[data-ui-mode="tablet"] .header-controls {
  grid-template-columns: minmax(0, 1fr) 42px;
}

body[data-ui-mode="tablet"] .account-label {
  display: none;
}

body[data-ui-mode="tablet"] .folder-picker-form {
  grid-template-columns: 42px minmax(180px, 1fr) 96px 104px;
}

body[data-ui-mode="tablet"] main {
  padding: 14px;
}

body[data-ui-mode="tablet"] .board {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

body[data-ui-mode="tablet"] .task-card,
body[data-ui-mode="mobile"] .task-card {
  touch-action: pan-y;
}

body[data-ui-mode="mobile"] {
  overflow-x: hidden;
}

body[data-ui-mode="mobile"] .topbar {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
}

body[data-ui-mode="mobile"] .brand {
  justify-content: space-between;
}

body[data-ui-mode="mobile"] .company-logo {
  width: 112px;
  height: 32px;
}

body[data-ui-mode="mobile"] .sync-state {
  flex: 0 1 116px;
  width: auto;
  max-width: 116px;
}

body[data-ui-mode="mobile"] .header-controls {
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
}

body[data-ui-mode="mobile"] .folder-picker-form {
  grid-template-columns: 1fr 1fr;
  justify-content: stretch;
}

body[data-ui-mode="mobile"] .folder-picker-form .path-label,
body[data-ui-mode="mobile"] .folder-picker-form select {
  grid-column: 1 / -1;
}

body[data-ui-mode="mobile"] .path-label {
  justify-self: start;
}

body[data-ui-mode="mobile"] .account-label {
  display: none;
}

body[data-ui-mode="mobile"] .settings-menu {
  left: auto;
  right: 0;
  width: min(360px, calc(100vw - 16px));
}

body[data-ui-mode="mobile"] main {
  padding: 10px max(8px, env(safe-area-inset-right)) 18px max(8px, env(safe-area-inset-left));
}

body[data-ui-mode="mobile"] .metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body[data-ui-mode="mobile"] .metric {
  min-height: 58px;
  padding: 9px;
}

body[data-ui-mode="mobile"] .toolbar {
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

body[data-ui-mode="mobile"] .filter-button {
  flex: 0 0 auto;
}

body[data-ui-mode="mobile"] .board {
  grid-template-columns: 1fr;
  gap: 10px;
}

body[data-ui-mode="mobile"] .column {
  min-height: 0;
  padding: 8px;
}

body[data-ui-mode="mobile"] .task-card {
  grid-template-columns: minmax(0, 1fr);
  min-height: 54px;
}

body[data-ui-mode="mobile"] .importance-badge,
body[data-ui-mode="mobile"] .task-progress {
  justify-self: start;
}

body[data-ui-mode="mobile"] #taskModal .modal-panel,
body[data-ui-mode="mobile"] .admin-panel,
body[data-ui-mode="mobile"] .diagnostics-panel {
  width: calc(100vw - 12px);
  max-width: calc(100vw - 12px);
  max-height: calc(100vh - 12px);
  padding: 12px;
}

body[data-ui-mode="mobile"] .diagnostics-panel {
  gap: 10px;
  height: calc(100vh - 12px);
  margin: 0;
  overflow: hidden;
}

body[data-ui-mode="mobile"] .diagnostics-panel .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  min-height: 44px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  background: var(--panel);
}

body[data-ui-mode="mobile"] .diagnostics-panel .modal-heading {
  min-width: 0;
}

body[data-ui-mode="mobile"] .diagnostics-panel .modal-heading h2 {
  font-size: 18px;
  line-height: 1.15;
}

body[data-ui-mode="mobile"] .diagnostics-panel .kind-badge {
  display: none;
}

body[data-ui-mode="mobile"] .diagnostics-panel #diagnosticsRefreshButton,
body[data-ui-mode="mobile"] .diagnostics-panel #diagnosticsLoadTestButton {
  min-width: 92px;
  margin-left: 0;
  padding: 0 8px;
  font-size: 12px;
}

body[data-ui-mode="mobile"] .diagnostics-panel .modal-close {
  width: 38px;
  min-width: 38px;
}

body[data-ui-mode="mobile"] .diagnostics-content {
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 0 2px 4px;
}

body[data-ui-mode="mobile"] .diagnostics-updated {
  padding: 7px 9px;
  font-size: 12px;
}

body[data-ui-mode="mobile"] .diagnostics-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-ui-mode="mobile"] .diagnostics-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

body[data-ui-mode="mobile"] .diagnostics-card {
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
}

body[data-ui-mode="mobile"] .diagnostics-card-header {
  align-items: flex-start;
}

body[data-ui-mode="mobile"] .diagnostics-card h3 {
  font-size: 15px;
  line-height: 1.2;
}

body[data-ui-mode="mobile"] .diagnostics-status {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 11px;
}

body[data-ui-mode="mobile"] .diagnostics-card-body {
  gap: 5px;
}

body[data-ui-mode="mobile"] .diagnostics-row {
  grid-template-columns: minmax(92px, 0.48fr) minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  padding-bottom: 5px;
}

body[data-ui-mode="mobile"] .diagnostics-row span {
  font-size: 11px;
  line-height: 1.25;
}

body[data-ui-mode="mobile"] .diagnostics-row strong {
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

body[data-ui-mode="mobile"] .diagnostics-log {
  max-height: 220px;
  font-size: 11px;
}

body[data-ui-mode="mobile"] .modal {
  padding: 6px;
}

body[data-ui-mode="mobile"] .modal-footer,
body[data-ui-mode="mobile"] .modal-actions {
  align-items: stretch;
  flex-direction: column;
}

body[data-ui-mode="mobile"] .modal-actions button,
body[data-ui-mode="mobile"] .modal-footer button {
  width: 100%;
}

body[data-ui-mode="mobile"] .quantity-row,
body[data-ui-mode="mobile"] .role-task-step {
  grid-template-columns: 1fr;
}

body[data-ui-mode="mobile"] .quantity-remove-button,
body[data-ui-mode="mobile"] .role-task-step-remove {
  justify-self: end;
}

body[data-ui-mode="workstation"] .topbar {
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 64px;
}

body[data-ui-mode="workstation"] .company-logo {
  width: 146px;
  height: 42px;
}

body[data-ui-mode="workstation"] .sync-state,
body[data-ui-mode="workstation"] .account-label,
body[data-ui-mode="workstation"] .topbar button,
body[data-ui-mode="workstation"] .topbar select,
body[data-ui-mode="workstation"] .topbar input {
  min-height: 38px;
  font-size: 15px;
}

body[data-ui-mode="workstation"] main {
  padding: 18px;
}

body[data-ui-mode="workstation"] .metrics {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

body[data-ui-mode="workstation"] .board {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

body[data-ui-mode="workstation"] .column-title {
  font-size: 18px;
}

body[data-ui-mode="workstation"] .column-search {
  height: 44px;
  font-size: 16px;
}

body[data-ui-mode="workstation"] .task-card {
  min-height: 70px;
  padding: 14px;
}

body[data-ui-mode="workstation"] .task-title {
  font-size: 18px;
}

body[data-ui-mode="workstation"] .importance-badge,
body[data-ui-mode="workstation"] .task-progress {
  min-height: 32px;
  font-size: 14px;
}

@media (max-width: 900px) {
  body[data-ui-mode="auto"] {
    --workspace-min-width: 0px;
    overflow-x: hidden;
  }

  body[data-ui-mode="auto"] .app-shell {
    min-width: 0;
  }

  body[data-ui-mode="auto"] .topbar {
    grid-template-columns: 160px minmax(0, 1fr);
    padding: 8px;
  }

  body[data-ui-mode="auto"] .company-logo {
    width: 110px;
    height: 32px;
  }

  body[data-ui-mode="auto"] .header-controls {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  body[data-ui-mode="auto"] .account-label {
    display: none;
  }

  body[data-ui-mode="auto"] .folder-picker-form {
    grid-template-columns: 42px minmax(170px, 1fr) 96px 104px;
  }

  body[data-ui-mode="auto"] main {
    padding: 12px;
  }

  body[data-ui-mode="auto"] .board {
    grid-template-columns: 1fr;
  }

  body[data-ui-mode="auto"] .task-card {
    touch-action: pan-y;
  }
}

@media (max-width: 560px) {
  body[data-ui-mode="auto"] .topbar {
    grid-template-columns: 1fr;
  }

  body[data-ui-mode="auto"] .brand {
    justify-content: space-between;
  }

  body[data-ui-mode="auto"] .header-controls {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  body[data-ui-mode="auto"] .folder-picker-form {
    grid-template-columns: 1fr 1fr;
  }

  body[data-ui-mode="auto"] .folder-picker-form .path-label,
  body[data-ui-mode="auto"] .folder-picker-form select {
    grid-column: 1 / -1;
  }

  body[data-ui-mode="auto"] .path-label {
    justify-self: start;
  }

  body[data-ui-mode="auto"] .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-mode="auto"] .modal {
    padding: 6px;
  }

  body[data-ui-mode="auto"] #taskModal .modal-panel,
  body[data-ui-mode="auto"] .admin-panel,
  body[data-ui-mode="auto"] .diagnostics-panel {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    padding: 12px;
  }

  body[data-ui-mode="auto"] .diagnostics-panel {
    gap: 10px;
    height: calc(100vh - 12px);
    margin: 0;
    overflow: hidden;
  }

  body[data-ui-mode="auto"] .diagnostics-panel .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    min-height: 44px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    background: var(--panel);
  }

  body[data-ui-mode="auto"] .diagnostics-panel .modal-heading {
    min-width: 0;
  }

  body[data-ui-mode="auto"] .diagnostics-panel .modal-heading h2 {
    font-size: 18px;
    line-height: 1.15;
  }

  body[data-ui-mode="auto"] .diagnostics-panel .kind-badge {
    display: none;
  }

  body[data-ui-mode="auto"] .diagnostics-panel #diagnosticsRefreshButton,
  body[data-ui-mode="auto"] .diagnostics-panel #diagnosticsLoadTestButton {
    min-width: 92px;
    margin-left: 0;
    padding: 0 8px;
    font-size: 12px;
  }

  body[data-ui-mode="auto"] .diagnostics-panel .modal-close {
    width: 38px;
    min-width: 38px;
  }

  body[data-ui-mode="auto"] .diagnostics-content {
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding: 0 2px 4px;
  }

  body[data-ui-mode="auto"] .diagnostics-updated {
    padding: 7px 9px;
    font-size: 12px;
  }

  body[data-ui-mode="auto"] .diagnostics-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-mode="auto"] .diagnostics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-ui-mode="auto"] .diagnostics-card {
    gap: 8px;
    padding: 10px;
  }

  body[data-ui-mode="auto"] .diagnostics-card-header {
    align-items: flex-start;
  }

  body[data-ui-mode="auto"] .diagnostics-card h3 {
    font-size: 15px;
    line-height: 1.2;
  }

  body[data-ui-mode="auto"] .diagnostics-status {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
  }

  body[data-ui-mode="auto"] .diagnostics-card-body {
    gap: 5px;
  }

  body[data-ui-mode="auto"] .diagnostics-row {
    grid-template-columns: minmax(92px, 0.48fr) minmax(0, 1fr);
    gap: 7px;
    min-height: 0;
    padding-bottom: 5px;
  }

  body[data-ui-mode="auto"] .diagnostics-row span {
    font-size: 11px;
    line-height: 1.25;
  }

  body[data-ui-mode="auto"] .diagnostics-row strong {
    font-size: 12px;
    line-height: 1.25;
    word-break: break-word;
  }

  body[data-ui-mode="auto"] .diagnostics-log {
    max-height: 220px;
    font-size: 11px;
  }

  body[data-ui-mode="auto"] .modal-actions,
  body[data-ui-mode="auto"] .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-ui-mode="auto"] .modal-actions button,
  body[data-ui-mode="auto"] .modal-footer button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .role-task-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-step.is-warehouse-step,
  .role-task-step.is-supply-step {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-step-quantity,
  .role-task-step-unit,
  .role-task-step-done-label,
  .role-task-step-progress-box,
  .warehouse-step-box,
  .warehouse-approve-label,
  .supply-step-box {
    width: 100%;
  }

  .quantity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px 150px 150px 34px;
    align-items: start;
  }

  .quantity-label-input,
  #taskModal .quantity-row .quantity-label-input {
    width: 100%;
  }

  .quantity-value-input,
  #taskModal .quantity-row .quantity-value-input {
    width: 82px;
    flex-basis: 82px;
  }

  .quantity-urgency-control,
  #taskModal .quantity-row .quantity-urgency-control {
    width: 150px;
    flex-basis: 150px;
  }

  .quantity-image-box {
    width: 150px;
    flex-basis: 150px;
  }
}

@media (max-width: 520px) {
  .quantity-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .quantity-label-input,
  #taskModal .quantity-row .quantity-label-input,
  .quantity-value-input,
  #taskModal .quantity-row .quantity-value-input,
  .quantity-urgency-control,
  #taskModal .quantity-row .quantity-urgency-control,
  .quantity-image-box {
    width: 100%;
    flex-basis: auto;
  }

  .quantity-value-input,
  #taskModal .quantity-row .quantity-value-input,
  .quantity-urgency-control,
  #taskModal .quantity-row .quantity-urgency-control,
  .quantity-image-box {
    grid-column: 1;
  }

  .quantity-remove-button {
    grid-column: 2;
    grid-row: 1 / span 4;
  }
}

@keyframes modal-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes task-detail-dock-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes menu-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Minimal interface refresh: calmer surfaces, consistent sizing, fewer visual layers. */
:root {
  --ui-radius: 8px;
  --ui-radius-sm: 6px;
  --ui-line: #d6e2ec;
  --ui-line-strong: #a9bed0;
  --ui-surface-muted: #f8fbfd;
  --shadow-soft: none;
  --shadow-hover: 0 2px 8px rgba(16, 24, 40, 0.08);
  --shadow-panel: 0 18px 42px rgba(16, 24, 40, 0.18);
  --hard-border: var(--ui-line-strong);
}

body[data-theme="dark"] {
  --ui-line: #28465f;
  --ui-line-strong: #4b6f8c;
  --ui-surface-muted: #0b1a2a;
  --shadow-soft: none;
  --shadow-hover: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-panel: 0 22px 54px rgba(0, 0, 0, 0.44);
  --hard-border: var(--ui-line-strong);
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, white) 0, var(--bg) 220px),
    var(--bg);
}

button {
  min-height: 34px;
  padding: 0 12px;
  border-width: 1px;
  border-radius: var(--ui-radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.button-secondary,
.filter-button {
  border-color: var(--ui-line-strong);
}

.button-secondary:hover,
.filter-button:hover {
  border-color: var(--brand-blue-dark);
  background: var(--brand-blue-soft);
}

input,
select,
textarea {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
}

input:disabled,
select:disabled,
textarea:disabled {
  border-color: var(--ui-line);
}

.topbar {
  border-bottom-width: 2px;
  box-shadow: none;
}

.brand h1 {
  font-size: 17px;
  line-height: 1.1;
}

main {
  padding-top: 14px;
}

.metrics {
  gap: 8px;
  margin-bottom: 10px;
}

.metric {
  min-height: 44px;
  padding: 8px 12px;
  border-width: 1px;
  border-left-width: 4px;
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: none;
}

.metric:hover {
  transform: none;
  box-shadow: none;
  background: var(--ui-surface-muted);
}

.metric-value {
  font-size: 22px;
}

.metric-label {
  font-size: 12px;
}

.toolbar {
  gap: 6px;
  margin-bottom: 12px;
}

.filter-button,
.carryover-filter-button,
.manager-all-in-work-button,
.warehouse-task-filter-button,
.done-stage-filter,
.production-role-filter {
  min-width: 0;
  min-height: 32px;
  padding: 4px 10px;
  border-width: 1px;
  font-size: 13px;
}

.filter-button.is-active,
.carryover-filter-option.is-active {
  border-color: var(--brand-red);
  background: var(--brand-red);
}

.carryover-filter-menu {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  box-shadow: var(--shadow-panel);
}

.notice {
  border-width: 1px;
  border-radius: var(--ui-radius);
}

.board {
  gap: 12px;
}

.column {
  padding: 10px;
  border-width: 1px;
  border-left-width: 4px;
  border-color: var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--panel);
  box-shadow: none;
}

.column.is-drop-target {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-blue) 35%, transparent);
}

.column-header {
  min-height: 32px;
  padding-bottom: 8px;
}

.column-title {
  font-size: 14px;
}

.column-count {
  min-width: 24px;
  height: 24px;
  border-width: 1px;
  border-color: var(--ui-line-strong);
  font-size: 12px;
}

.column-search {
  height: 34px;
  margin-bottom: 8px;
  border-color: var(--ui-line-strong);
}

.cards {
  gap: 8px;
}

.task-card {
  min-height: 40px;
  padding: 8px 10px;
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  box-shadow: none;
}

.task-card.is-folder {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  box-shadow: none;
}

.task-card:hover {
  transform: none;
  border-color: var(--brand-blue-dark);
  background: var(--ui-surface-muted);
  box-shadow: var(--shadow-hover);
}

body:not([data-theme="dark"]) .task-card,
body:not([data-theme="dark"]) .task-card .task-title,
body:not([data-theme="dark"]) .task-card .task-card-status-line {
  color: var(--text) !important;
}

body:not([data-theme="dark"]) .task-card .task-progress {
  color: var(--brand-blue-dark) !important;
}

.task-title {
  font-size: 14px;
  line-height: 1.28;
}

.importance-badge,
.task-progress,
.done-stage-badge,
.modal-progress,
.role-task-summary {
  min-height: 24px;
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  font-size: 12px;
}

.importance-badge {
  min-width: 54px;
}

.modal-panel {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-panel);
}

#taskModal .modal-panel {
  padding: 16px;
}

#taskModal .modal-header {
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ui-line);
}

#taskModal .modal-heading h2 {
  font-size: 22px;
  line-height: 1.2;
}

.modal-close,
#taskModal .modal-close {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-width: 1px;
}

.task-ready-button {
  min-height: 36px;
  border-width: 1px;
}

#taskModal .modal-fields {
  gap: 14px;
}

#taskModal .field label,
#taskModal .modal-status-field label {
  font-size: 12px;
}

#taskModal input,
#taskModal select {
  min-height: 38px;
  padding: 0 10px;
  font-size: 14px;
}

#taskModal textarea {
  min-height: 150px;
  padding: 10px 12px;
  font-size: 14px;
}

#taskModal .quantity-field,
.importance-field,
.manager-description-field,
.manager-comment-field,
.assignment-field,
.technologist-comment-field,
.progress-field,
.manager-images-field,
.role-tasks-field,
.task-month-field {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius);
  background: var(--panel);
}

.quantity-row,
.role-task-item,
.role-task-step-text,
.role-task-step-quantity,
.role-task-step-unit,
.role-task-step-progress-box,
.warehouse-step-box,
.warehouse-approve-label,
.supply-step-box,
.supply-status-label,
.warehouse-transfer-button,
.role-task-step-done-label,
.role-task-step-remove,
.quantity-remove-button,
.quantity-add-button,
.quantity-image-add,
.quantity-image-count,
.quantity-image-thumb,
.production-role-column {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
}

.quantity-row,
.role-task-item,
.production-role-column {
  background: var(--ui-surface-muted);
}

.role-task-step {
  gap: 6px;
}

.role-task-step-text {
  min-height: 34px;
}

.importance-value,
.quantity-urgency-value {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
}

.admin-tabs {
  gap: 6px;
}

.admin-tab,
.copy-button,
.account-save-button {
  border-width: 1px;
}

.roles-table-wrap,
.accounts-table-wrap {
  border-width: 1px;
  border-color: var(--ui-line-strong);
  border-radius: var(--ui-radius);
  box-shadow: none;
}

.roles-table th,
.accounts-table th {
  background: var(--ui-surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.roles-table th,
.roles-table td,
.accounts-table th,
.accounts-table td {
  border-bottom-color: var(--ui-line);
}

.roles-table input,
.roles-table select,
.accounts-table input,
.accounts-table select {
  min-height: 32px;
  border-width: 1px;
}

#taskModal .role-task-step.is-warehouse-step {
  grid-template-columns: minmax(260px, 1fr) 72px 88px minmax(190px, 0.7fr) 30px;
}

#taskModal .role-task-step.is-warehouse-step.is-no-supply-needed {
  grid-template-columns: minmax(260px, 1fr) 72px 88px minmax(190px, 0.7fr) 30px;
}

#taskModal .role-task-step.is-warehouse-step.is-warehouse-transferred {
  grid-template-columns: minmax(260px, 1fr) 72px 88px minmax(190px, 0.7fr) 74px 30px;
}

#taskModal .role-task-step.is-supply-step {
  grid-template-columns: minmax(260px, 1fr) 72px 88px minmax(170px, 0.55fr) 30px;
}

#taskModal .role-task-step {
  gap: 6px;
}

#taskModal .role-task-step-text,
#taskModal .role-task-step-quantity,
#taskModal .role-task-step-unit,
#taskModal .warehouse-step-box,
#taskModal .supply-step-box,
#taskModal .warehouse-approve-label,
#taskModal .supply-status-label {
  min-height: 34px;
  border-width: 1px;
}

#taskModal .role-task-step-text {
  padding: 6px 9px;
}

#taskModal .role-task-step-quantity {
  padding: 5px 6px;
}

#taskModal .role-task-step-unit {
  padding: 0 6px;
}

#taskModal .warehouse-approve-label,
#taskModal .supply-status-label {
  width: 100%;
  min-height: 34px;
  padding: 6px 7px;
  gap: 5px;
  overflow: hidden;
  color: var(--text);
  background: var(--panel);
}

#taskModal .warehouse-approve-label span,
#taskModal .supply-status-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#taskModal .warehouse-approve-label input[type="checkbox"],
#taskModal .supply-status-label input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--brand-blue);
}

#taskModal .warehouse-approve-label:has(input:checked),
#taskModal .supply-status-label:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

#taskModal .warehouse-transfer-badge {
  width: 100%;
  min-height: 26px;
  padding: 3px 5px;
  font-size: 11px;
}

#taskModal .warehouse-step-box {
  grid-template-columns: 64px minmax(0, 1fr);
  padding: 4px 6px;
}

#taskModal .warehouse-available-input {
  width: 64px;
}

#taskModal .supply-step-box {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px 6px;
}

#taskModal .warehouse-approve-all-button,
#taskModal .warehouse-transfer-button {
  min-height: 34px;
  padding: 0 9px;
  white-space: nowrap;
}

#taskModal .warehouse-approve-all-button {
  min-width: 112px;
}

#taskModal .warehouse-transfer-button {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#taskModal:not(.is-docked) {
  place-items: center;
  overflow: hidden;
  padding: 10px;
}

#taskModal .modal-panel {
  width: min(1760px, calc(100vw - 20px));
  height: calc(100vh - 20px);
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
  padding: 18px;
}

#taskModal .task-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#taskModal.is-docked .modal-panel {
  height: 100%;
  max-height: none;
}

#taskModal .modal-header-actions {
  flex-wrap: wrap;
}

.manager-word-export-button {
  min-height: 36px;
  padding: 0 12px;
  border-width: 1px;
  color: var(--brand-blue-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#taskModal .modal-fields {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding-right: 2px;
}

#taskModal .task-tab-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#taskModal #managerTaskPanel,
#taskModal #technologistTaskPanel,
#taskModal #workerTaskPanel {
  height: 100%;
  min-height: 0;
}

#taskModal #managerTaskPanel {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

#taskModal .manager-top-dates {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 8px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-sizing: border-box;
}

#taskModal .manager-top-dates > label {
  align-self: center;
  white-space: nowrap;
}

#taskModal .manager-top-dates .task-dates-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#taskModal .manager-top-dates .date-field label {
  min-height: 17px;
  line-height: 17px;
  white-space: nowrap;
}

#taskModal .manager-top-dates input[type="date"] {
  min-height: 36px;
}

.manager-layout,
.technologist-layout {
  display: grid;
  grid-template-columns: minmax(760px, 3.15fr) minmax(310px, 0.85fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.manager-left-column,
.manager-right-column,
.technologist-left-column,
.technologist-right-column {
  display: grid;
  gap: 14px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-content: start;
}

.manager-left-column,
.manager-right-column,
.manager-left-column > *,
.manager-right-column > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.manager-left-column {
  grid-template-rows: minmax(0, 1fr) auto;
}

.manager-right-column {
  grid-template-rows: auto minmax(150px, 1fr) minmax(110px, 0.7fr);
  overflow: hidden;
}

.technologist-layout {
  grid-template-columns: minmax(680px, 1.55fr) minmax(360px, 0.85fr);
}

.technologist-left-column {
  grid-template-rows: auto minmax(0, 1fr);
}

.technologist-right-column {
  grid-template-rows: auto minmax(110px, auto) minmax(120px, 1fr);
  overflow: hidden;
}

#taskModal .manager-tab-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}


#taskModal .date-field input[type="date"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#taskModal .quantity-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

#taskModal .quantity-field-head {
  align-items: center;
}

.field-title-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#taskModal .quantity-total {
  white-space: nowrap;
}

.quantity-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

#taskModal .quantity-add-button {
  min-height: 34px;
  padding: 0 12px;
}

#taskModal .quantity-fullscreen-button {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

#taskModal .quantity-list {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: auto;
  padding: 4px 2px;
}

#taskModal .quantity-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 76px 158px minmax(166px, 190px) 34px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#taskModal .quantity-row .quantity-label-input {
  width: 100%;
}

#taskModal .quantity-row .quantity-value-input {
  width: 76px;
  flex: 0 0 76px;
  padding: 0 8px;
}

#taskModal .quantity-row .quantity-urgency-control {
  grid-template-columns: minmax(0, 1fr) 30px;
  width: 158px;
  flex: 0 0 158px;
}

#taskModal .quantity-row .quantity-urgency-value {
  width: 30px;
  height: 28px;
  font-size: 13px;
}

#taskModal .quantity-row .quantity-image-box {
  grid-template-columns: minmax(96px, 1fr) 42px;
  grid-template-rows: 28px minmax(28px, auto);
  width: 100%;
  min-width: 166px;
  flex: 1 1 166px;
}

#taskModal .quantity-row .quantity-image-add {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#taskModal .quantity-row .quantity-image-count {
  min-width: 42px;
  min-height: 28px;
  padding: 0 4px;
  font-size: 11px;
  white-space: nowrap;
}

#taskModal .quantity-row .quantity-image-list {
  max-height: 72px;
  overflow: auto;
  align-content: flex-start;
}

#taskModal .quantity-row .quantity-image-thumb {
  width: 34px;
  height: 28px;
}

#taskModal .quantity-row.is-long-label {
  --quantity-long-controls-top: 66px;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 260px) 34px;
  grid-template-areas:
    "label side remove";
  align-items: start;
}

#taskModal .quantity-row.is-long-label .quantity-label-input {
  grid-area: label;
}

#taskModal .quantity-row.is-long-label .quantity-value-input {
  grid-area: side;
  align-self: start;
  justify-self: start;
  margin-top: var(--quantity-long-controls-top);
}

#taskModal .quantity-row.is-long-label .quantity-urgency-control {
  grid-area: side;
  align-self: start;
  justify-self: start;
  width: calc(100% - 82px);
  margin-top: var(--quantity-long-controls-top);
  margin-left: 82px;
}

#taskModal .quantity-row.is-long-label .quantity-image-box {
  grid-area: side;
  grid-template-columns: minmax(96px, 1fr) 42px;
  min-width: 0;
  width: 100%;
}

#taskModal .quantity-row.is-long-label .quantity-image-list {
  max-height: 30px;
}

#taskModal .quantity-row.is-long-label .quantity-remove-button {
  grid-area: remove;
  align-self: start;
  height: 36px;
  min-height: 36px;
  width: 34px;
}

#taskModal.is-quantity-fullscreen .manager-layout {
  grid-template-columns: minmax(0, 1fr);
}

#taskModal.is-quantity-fullscreen .manager-left-column {
  grid-template-rows: minmax(0, 1fr);
}

#taskModal.is-quantity-fullscreen .manager-right-column,
#taskModal.is-quantity-fullscreen .manager-images-field {
  display: none;
}

#taskModal.is-quantity-fullscreen .quantity-field {
  min-height: 0;
  height: 100%;
}

#taskModal.is-quantity-fullscreen .quantity-row {
  grid-template-columns: minmax(360px, 1fr) 86px 180px minmax(280px, 340px) 34px;
}

#taskModal.is-quantity-fullscreen .quantity-row.is-long-label {
  grid-template-columns: minmax(420px, 1fr) minmax(280px, 360px) 34px;
}

#taskModal .manager-images-field {
  display: grid;
  grid-template-rows: auto;
  align-self: start;
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px;
}

#taskModal .manager-images-hint {
  display: none;
}

#taskModal .manager-images-field .field-head {
  min-height: 38px;
}

#taskModal .manager-image-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.manager-images-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

#taskModal .manager-images-list {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

#taskModal .manager-image-card {
  gap: 6px;
  padding: 6px;
}

#taskModal .manager-image-card img {
  height: 92px;
}

.manager-images-modal {
  z-index: 116;
}

.manager-images-panel {
  width: min(1200px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.manager-images-panel .manager-images-list {
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

#taskModal .manager-description-field,
#taskModal .manager-comment-field,
#taskModal .technologist-comment-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

#taskModal .manager-description-field {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

#taskModal .manager-description-field textarea {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  resize: none;
  box-sizing: border-box;
}

#taskModal .manager-comment-field textarea,
#taskModal .technologist-comment-field textarea {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  resize: none;
  box-sizing: border-box;
}

#taskModal .assignment-field,
#taskModal .task-month-field,
#taskModal .technologist-progress-field {
  min-height: 0;
  overflow: hidden;
}

#taskModal .assignment-field {
  display: grid;
  grid-template-rows: auto auto;
  padding: 12px;
  overflow: visible;
}

#taskModal .assignment-list,
#taskModal .month-picker,
#taskModal .month-badges,
#taskModal .transfer-history {
  min-height: 0;
}

#taskModal .assignment-list {
  max-height: none;
  overflow: visible;
}

#taskModal .role-tasks-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

#taskModal .role-tasks-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  align-items: start;
  padding-right: 4px;
}

#taskModal .role-task-item,
#taskModal .role-task-steps {
  align-content: start;
  align-items: start;
}

@media (max-width: 1180px) {
  .manager-layout,
  .technologist-layout {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .manager-left-column,
  .technologist-left-column {
    grid-template-rows: auto auto;
  }

  #taskModal .quantity-field {
    min-height: 430px;
  }

  #taskModal .manager-tab-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .role-task-history-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-task-history-meta {
    text-align: left;
    white-space: normal;
  }

  #taskModal:not(.is-docked) {
    padding: 6px;
  }

  #taskModal .modal-panel {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    max-width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    padding: 12px;
  }

  #taskModal .manager-top-dates {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  #taskModal .manager-top-dates .task-dates-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #taskModal .role-task-step.is-warehouse-step,
  #taskModal .role-task-step.is-supply-step {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .accounts-table-wrap {
    overflow: visible;
    border-color: #333333;
  }

  .accounts-table {
    min-width: 0;
    font-size: 11px;
  }

  .accounts-table th {
    color: #000000;
    background: #ffffff;
  }

  .copy-button,
  .account-save-button,
  .admin-users-toolbar,
  .account-add-form {
    display: none;
  }
}

body.has-offline-state .topbar {
  grid-template-columns: minmax(480px, max-content) minmax(0, 1fr);
}

body.has-offline-state .brand {
  overflow: visible;
}

@media (max-width: 1180px) {
  body.has-offline-state .topbar {
    grid-template-columns: minmax(420px, max-content) minmax(0, 1fr);
  }

  .offline-state {
    max-width: 250px;
  }
}

@media (max-width: 720px) {
  body.has-offline-state .topbar,
  body[data-ui-mode="mobile"].has-offline-state .topbar {
    grid-template-columns: 1fr;
  }

  body.has-offline-state .brand {
    flex-wrap: wrap;
  }

  .offline-state {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }

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

  .settings-offline-heading,
  .settings-offline-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Workspace navigation, notifications, chat and request notes */
.push-notification-control {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 142px;
  min-width: 142px;
  height: 38px;
  padding: 4px 9px 4px 5px;
  gap: 7px;
  border-color: rgba(0, 110, 182, 0.34);
  background: linear-gradient(135deg, rgba(0, 110, 182, 0.1), rgba(70, 179, 255, 0.04));
  text-align: left;
}

.push-notification-control:hover {
  border-color: rgba(0, 110, 182, 0.58);
}

.push-notification-control.is-active {
  border-color: rgba(24, 147, 85, 0.45);
  background: rgba(24, 147, 85, 0.09);
}

.push-notification-control-icon {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #006eb6;
  background: rgba(0, 110, 182, 0.12);
}

.push-notification-control.is-active .push-notification-control-icon {
  color: #17894f;
  background: rgba(24, 147, 85, 0.13);
}

.push-notification-control.is-active .push-notification-control-icon::after {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: #22a461;
  content: "";
}

.push-notification-control-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.push-notification-control-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.push-notification-control-copy strong,
.push-notification-control-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.push-notification-control-copy strong {
  color: var(--text);
  font-size: 11px;
}

.push-notification-control-copy small {
  color: var(--muted);
  font-size: 9px;
}

.push-notification-launch {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  width: calc(100% - 20px);
  margin: 10px;
  padding: 10px 12px;
  gap: 10px;
  border-color: rgba(0, 110, 182, 0.3);
  background: linear-gradient(135deg, rgba(0, 110, 182, 0.09), rgba(70, 179, 255, 0.04));
  text-align: left;
}

.push-notification-launch:hover {
  border-color: rgba(0, 110, 182, 0.55);
  transform: translateY(-1px);
}

.push-notification-launch.is-active {
  border-color: rgba(24, 147, 85, 0.4);
  background: rgba(24, 147, 85, 0.08);
}

.push-notification-launch-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #006eb6;
  background: rgba(0, 110, 182, 0.12);
}

.push-notification-launch-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.push-notification-launch-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.push-notification-launch-copy strong {
  color: var(--text);
  font-size: 13px;
}

.push-notification-launch-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.push-notification-launch-action {
  color: #006eb6;
  font-size: 11px;
  font-weight: 800;
}

body.push-onboarding-open {
  overflow: hidden;
}

.push-onboarding-modal {
  position: fixed;
  z-index: 260;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 22px;
}

.push-onboarding-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(5, 15, 26, 0.68);
  backdrop-filter: blur(7px);
}

.push-onboarding-panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: calc(100dvh - 44px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(0, 110, 182, 0.24);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 26px 90px rgba(3, 20, 33, 0.34);
}

.push-onboarding-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 36px;
  align-items: start;
  gap: 14px;
}

.push-onboarding-bell {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  color: #ffffff;
  background: linear-gradient(145deg, #006eb6, #25a9e8);
  box-shadow: 0 10px 24px rgba(0, 110, 182, 0.24);
}

.push-onboarding-bell svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.push-onboarding-kicker {
  display: block;
  margin-bottom: 4px;
  color: #006eb6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.push-onboarding-header h2 {
  color: var(--text);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.08;
}

.push-onboarding-header p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.push-onboarding-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 24px;
  line-height: 1;
}

.push-onboarding-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  padding: 10px 14px;
  gap: 12px;
  border-radius: 15px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 700;
}

.push-onboarding-flow span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.push-onboarding-flow b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #006eb6;
  font-size: 11px;
}

.push-onboarding-flow i {
  color: rgba(0, 110, 182, 0.65);
  font-style: normal;
}

.push-platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.push-platform-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--panel-soft) 68%, transparent);
}

.push-platform-card > header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.push-platform-card > header > div {
  display: grid;
  gap: 1px;
}

.push-platform-card header strong {
  color: var(--text);
  font-size: 14px;
}

.push-platform-card header small {
  color: var(--muted);
  font-size: 10px;
}

.push-platform-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: #273444;
  font-size: 13px;
}

.push-platform-card.is-android .push-platform-icon {
  background: #16884a;
}

.push-platform-card.is-desktop .push-platform-icon {
  background: #006eb6;
}

.push-device-preview {
  position: relative;
  display: grid;
  min-height: 76px;
  align-content: center;
  justify-items: center;
  margin: 12px 0;
  padding: 10px;
  gap: 3px;
  overflow: hidden;
  border: 1px solid rgba(125, 145, 162, 0.24);
  border-radius: 13px;
  color: var(--text);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.74), rgba(226, 238, 246, 0.65));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .push-device-preview {
  background: linear-gradient(150deg, rgba(20, 40, 55, 0.9), rgba(7, 24, 38, 0.82));
}

.push-device-preview span,
.push-device-preview em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.push-device-preview b {
  color: #006eb6;
  font-size: 15px;
}

.push-platform-card ol {
  display: grid;
  margin: 0;
  padding-left: 20px;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.push-platform-card li::marker {
  color: #006eb6;
  font-weight: 800;
}

.push-platform-card li b {
  color: var(--text);
}

.push-onboarding-status {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.push-onboarding-status.is-success {
  color: #17894f;
  font-weight: 800;
}

.push-onboarding-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.push-onboarding-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  gap: 8px;
}

.push-onboarding-actions button {
  min-height: 42px;
  padding-inline: 18px;
}

@media (max-width: 820px) {
  .push-onboarding-modal {
    align-items: end;
    padding: 0;
  }

  .push-onboarding-panel {
    width: 100%;
    max-height: 94dvh;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  .push-onboarding-header {
    grid-template-columns: 44px minmax(0, 1fr);
    padding-right: 34px;
    gap: 10px;
  }

  .push-onboarding-close {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .push-onboarding-header h2 {
    overflow-wrap: anywhere;
  }

  .push-onboarding-bell {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .push-onboarding-flow {
    align-items: stretch;
    flex-direction: column;
    margin: 14px 0;
    gap: 7px;
  }

  .push-onboarding-flow i {
    display: none;
  }

  .push-platform-grid {
    grid-template-columns: 1fr;
  }

  .push-device-preview {
    min-height: 62px;
  }

  .push-onboarding-actions {
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom));
    margin: 14px -14px calc(-18px - env(safe-area-inset-bottom));
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: var(--panel);
    box-shadow: 0 -10px 24px rgba(5, 24, 39, 0.08);
  }

  .push-onboarding-actions button:last-child {
    flex: 1;
  }

  .push-onboarding-actions button {
    min-width: 0;
    padding-inline: 10px;
    font-size: 12px;
    white-space: normal;
  }
}

.icon-button {
  position: relative;
  display: inline-flex;
  width: 38px;
  min-width: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-button svg,
.workspace-tab svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 2;
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand-red);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 44px;
  z-index: 32;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(440px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 78px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
  white-space: normal;
  animation: menu-pop-in 130ms ease-out both;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.notification-panel-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-panel-header strong {
  font-size: 15px;
}

.notification-panel-header span {
  color: var(--muted);
  font-size: 11px;
}

.notification-panel-header button {
  min-height: 30px;
  height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.notification-list {
  min-height: 90px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 12px 14px 12px 17px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  background: var(--panel);
  text-align: left;
  white-space: normal;
}

.notification-item::before {
  position: absolute;
  top: 18px;
  left: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  content: "";
}

.notification-item.is-unread {
  background: color-mix(in srgb, var(--brand-blue-soft) 55%, var(--panel));
}

.notification-item.is-unread::before {
  background: var(--brand-red);
}

.notification-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.notification-item strong {
  font-size: 13px;
}

.notification-item > span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.notification-item time {
  color: var(--muted);
  font-size: 10px;
}

.notification-load-more {
  width: calc(100% - 24px);
  min-height: 34px;
  margin: 10px 12px;
  font-size: 11px;
}

.notification-panel-actions {
  display: flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px !important;
}

.notification-panel-header .notification-clear-button {
  border-color: color-mix(in srgb, var(--brand-red) 34%, var(--border));
  color: var(--brand-red);
}

.notification-panel-header .notification-clear-button:hover:not(:disabled) {
  color: #ffffff;
  background: var(--brand-red);
}

.notification-feed-block {
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  background: color-mix(in srgb, var(--panel-soft) 54%, var(--panel));
}

.notification-feed-block .notification-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  height: 100%;
  min-height: 110px;
  padding-right: 3px;
  gap: 7px;
}

.notification-feed-block .notification-item {
  gap: 4px;
  padding: 11px 12px 10px 17px;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 3px 10px rgba(5, 28, 45, 0.05);
}

.notification-feed-block .notification-item::before {
  top: 16px;
  left: 7px;
}

.notification-feed-block .notification-item strong {
  line-height: 1.2;
}

.notification-feed-block .notification-item > span {
  display: block;
  overflow: hidden;
  max-height: 2.7em;
  line-height: 1.35;
  white-space: normal;
}

.notification-feed-block .notification-item time {
  justify-self: end;
}

@media (max-width: 1180px) {
  .push-notification-control {
    grid-template-columns: 28px;
    width: 38px;
    min-width: 38px;
    padding: 4px;
  }

  .push-notification-control-copy {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.workspace-tabs {
  position: sticky;
  top: 54px;
  z-index: 4;
  display: flex;
  justify-self: start;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: -6px auto 14px 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.workspace-tab {
  position: relative;
  display: inline-flex;
  width: 40px;
  min-width: 40px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.workspace-tab > span:not(.nav-badge) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.workspace-tab::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 50%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow-hover);
  content: attr(data-label);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  visibility: hidden;
  white-space: nowrap;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.workspace-tab:hover::after,
.workspace-tab:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.workspace-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.workspace-tab.is-active {
  color: #ffffff;
  background: var(--brand-blue);
  box-shadow: 0 1px 3px rgba(0, 80, 143, 0.2);
}

.workspace-tab .nav-badge {
  top: -6px;
  right: -5px;
}

.workspace-view {
  min-width: 0;
}

.chat-sidebar-header h2 {
  margin: 0;
  font-size: 18px;
}

.workspace-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.workspace-empty.compact {
  min-height: 90px;
  padding: 16px;
}

.timesheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

body[data-workspace="timesheet"] {
  overflow-x: hidden;
}

body[data-workspace="timesheet"] .app-shell,
body[data-workspace="timesheet"] main {
  min-width: 0;
}

body[data-workspace="timesheet"] .timesheet-workspace {
  width: min(100%, 1540px);
  margin-inline: auto;
}

.timesheet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr)) minmax(80px, 0.45fr);
  gap: 8px;
  margin-bottom: 12px;
}

.timesheet-summary-item {
  display: grid;
  min-width: 0;
  min-height: 64px;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue);
  border-radius: 7px;
  background: var(--panel);
}

.timesheet-summary-item > span,
.timesheet-summary-item > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timesheet-summary-item > strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timesheet-summary-item.is-primary {
  border-left-color: var(--green);
}

.timesheet-summary-item.is-night {
  border-left-color: var(--brand-red);
}

.timesheet-summary-item.is-paid {
  border-left-color: #d08a00;
}

.timesheet-summary-item.is-compact {
  text-align: center;
}

.timesheet-month-navigation {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timesheet-month-navigation > div {
  min-width: 190px;
  text-align: center;
}

.timesheet-month-navigation h2 {
  margin: 0;
  font-size: 18px;
  text-transform: capitalize;
}

.timesheet-month-navigation span {
  color: var(--muted);
  font-size: 11px;
}

.timesheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.5fr);
  gap: 12px;
  align-items: start;
}

.timesheet-calendar-panel,
.timesheet-day-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.timesheet-weekdays,
.timesheet-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.timesheet-weekdays {
  border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}

.timesheet-weekdays span {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.timesheet-day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 80px;
  align-content: space-between;
  gap: 4px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  background: var(--panel);
  text-align: left;
}

.timesheet-day:nth-child(7n) {
  border-right: 0;
}

.timesheet-day:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.timesheet-day.is-outside {
  color: var(--muted);
  background: var(--panel-soft);
  opacity: 0.58;
}

.timesheet-day.is-weekend .timesheet-day-number {
  color: var(--brand-red);
}

.timesheet-day.is-today {
  box-shadow: inset 0 0 0 2px var(--brand-red);
}

.timesheet-day.is-selected {
  color: var(--text);
  background: var(--brand-blue-soft);
  box-shadow: inset 0 0 0 2px var(--brand-blue);
}

.timesheet-day.is-selected.is-today {
  box-shadow: inset 0 0 0 2px var(--brand-blue), inset 0 -4px 0 var(--brand-red);
}

.timesheet-day-number {
  font-size: 13px;
  font-weight: 800;
}

.timesheet-day-total {
  overflow: hidden;
  color: var(--brand-blue-dark);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timesheet-day-shifts {
  position: absolute;
  top: 7px;
  right: 7px;
  display: inline-flex;
  min-width: 19px;
  min-height: 19px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand-blue);
  font-size: 9px;
  font-weight: 800;
}

.timesheet-day-shifts:empty {
  display: none;
}

.timesheet-load-error {
  grid-column: 1 / -1;
}

.timesheet-day-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.timesheet-day-backdrop,
.timesheet-day-close {
  display: none;
}

.timesheet-day-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timesheet-day-panel h3 {
  margin: 2px 0 0;
  font-size: 15px;
  text-transform: capitalize;
}

.timesheet-day-panel > header > strong {
  flex: 0 0 auto;
  color: var(--brand-blue-dark);
  font-size: 13px;
}

.timesheet-kicker {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.timesheet-form {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-soft);
}

.timesheet-form label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.timesheet-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.timesheet-time-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.timesheet-form textarea {
  min-height: 64px;
  resize: vertical;
}

.timesheet-form-actions,
.timesheet-entry > div:last-child {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.timesheet-form-error,
.chat-composer-status {
  min-height: 16px;
  color: var(--brand-red);
  font-size: 10px;
  font-weight: 700;
}

.timesheet-entry-list {
  display: grid;
  gap: 8px;
}

.timesheet-empty {
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.timesheet-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}

.timesheet-entry > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.timesheet-entry strong {
  font-size: 12px;
}

.timesheet-entry span,
.timesheet-entry p {
  color: var(--muted);
  font-size: 10px;
}

.timesheet-entry p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  overflow: clip;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.chat-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overflow: clip;
  border-right: 1px solid var(--border);
}

.chat-sidebar-header {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.chat-status-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.chat-status-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status-row span.is-error,
.chat-composer-status.is-error {
  color: var(--brand-red);
}

.chat-status-row span.is-success,
.chat-composer-status.is-success {
  color: var(--green);
}

.chat-realtime-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.chat-realtime-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.chat-realtime-status[data-status="connected"] {
  color: var(--green);
}

.chat-realtime-status[data-status="connected"]::before {
  background: var(--green);
}

.chat-realtime-status[data-status="fallback"]::before {
  background: var(--warning, #d89216);
}

.chat-status-row button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.chat-contact-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chat-contact {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  background: var(--panel);
  text-align: left;
}

.chat-contact:hover,
.chat-contact.is-active {
  color: var(--text);
  background: var(--brand-blue-soft);
}

.chat-avatar {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--brand-blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.chat-avatar::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: transparent;
  content: "";
}

.chat-avatar.is-online::after {
  background: var(--green);
}

.chat-contact-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.chat-contact-content > span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-contact-content strong,
.chat-contact-content > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact-content strong {
  font-size: 12px;
}

.chat-contact-content time,
.chat-contact-content > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

.chat-unread {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--brand-red);
  font-size: 10px;
  font-weight: 800;
}

.chat-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overflow: clip;
  background: color-mix(in srgb, var(--panel-soft) 42%, var(--panel));
}

.chat-dialog-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.chat-dialog-header > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.chat-dialog-header strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.chat-back-button {
  display: none;
}

#chatBackButton {
  display: none;
}

.chat-message-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px;
  scrollbar-gutter: stable;
}

.chat-message-row {
  display: flex;
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.chat-message-list > .chat-message-row:first-child {
  margin-top: auto;
}

.chat-message-list > .workspace-empty {
  width: 100%;
  margin: auto;
}

.chat-message-row.is-own {
  justify-content: flex-end;
}

.chat-message {
  position: relative;
  display: grid;
  max-width: min(72%, 720px);
  gap: 4px;
  padding: 9px 11px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  min-width: 0;
}

.chat-message-row.is-own .chat-message {
  border-color: color-mix(in srgb, var(--brand-blue) 45%, var(--border));
  background: var(--brand-blue-soft);
}

.chat-message-row.is-highlighted .chat-message {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

.chat-message-reply,
.chat-message-task {
  display: grid;
  width: 100%;
  justify-items: start;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--brand-blue) 45%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand-blue-soft) 58%, transparent);
  color: var(--text);
  text-align: left;
}

.chat-message-reply {
  border-left: 3px solid var(--brand-blue);
  font-size: 11px;
  font-weight: 700;
  opacity: .9;
}

.chat-message-task strong,
.chat-message-task span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.chat-message p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.4;
}

.chat-message > span {
  justify-self: end;
  color: var(--muted);
  font-size: 9px;
}

.chat-message-files {
  display: grid;
  gap: 6px;
}

.chat-message-file {
  display: grid;
  min-width: min(280px, 60vw);
  min-height: 44px;
  align-content: center;
  justify-items: start;
  gap: 3px;
  padding: 8px 10px;
  border-color: color-mix(in srgb, var(--brand-blue) 88%, #000);
  background: #075f9e;
  color: #ffffff;
  text-align: left;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.chat-message-file:hover:not(:disabled) {
  border-color: #1a7ec7;
  background: #1172b8;
  transform: translateY(-1px);
}

.chat-message-file:disabled {
  opacity: .72;
}

.chat-message-file-preview {
  width: 100%;
  max-width: 240px;
  height: 120px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 6px;
  background: rgba(255, 255, 255, .16);
  object-fit: contain;
}

.chat-message-file strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message-file span {
  color: rgba(255, 255, 255, .82);
  font-size: 10px;
}

body:not([data-theme="dark"]) .chat-message:not(.chat-message-file),
body:not([data-theme="dark"]) .chat-message p,
body:not([data-theme="dark"]) .chat-message-reply,
body:not([data-theme="dark"]) .chat-message-task {
  color: var(--text);
}

.chat-message-actions {
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 5px);
  right: 0;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.chat-message-row.is-other .chat-message-actions {
  right: auto;
  left: 0;
}

.chat-message-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

.chat-message-actions button.is-danger {
  border-color: var(--brand-red);
  color: var(--brand-red);
  background: transparent;
}

.chat-typing {
  min-height: 20px;
  padding: 2px 17px;
  color: var(--brand-blue-dark);
  font-size: 10px;
  font-weight: 700;
}

.chat-typing:empty {
  display: none;
}

.chat-composer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.chat-file-tools {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.chat-file-tools button {
  min-height: 30px;
  padding: 0 10px;
}

.chat-file-tools small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.chat-reply-preview,
.chat-selected-task,
.chat-task-panel {
  grid-column: 1 / -1;
}

.chat-reply-preview,
.chat-selected-task {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--brand-blue-soft);
}

.chat-reply-preview span,
.chat-selected-task span {
  min-width: 0;
  overflow: hidden;
  color: var(--brand-blue-dark);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-task-panel {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.chat-task-list {
  display: grid;
  max-height: 210px;
  overflow: auto;
  gap: 6px;
}

.chat-task-option {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.chat-task-option.is-active,
.chat-task-option:hover {
  border-color: var(--brand-blue);
  color: var(--text);
  background: var(--brand-blue-soft);
}

.chat-task-option strong,
.chat-task-option span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.chat-selected-file {
  min-width: 0;
  overflow: hidden;
  color: var(--brand-blue-dark);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-composer textarea {
  min-width: 0;
  height: 42px;
  min-height: 42px;
  max-height: 112px;
  overflow-y: auto;
  resize: none;
}

.chat-composer button {
  min-height: 42px;
  padding: 0 16px;
}

.chat-composer-status {
  grid-column: 1 / -1;
}

.chat-composer-status:empty {
  display: none;
}

body[data-workspace="chat"] {
  overflow: hidden;
}

body[data-workspace="chat"] .app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body[data-workspace="chat"] main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, var(--workspace-max-width));
  height: auto;
  min-height: 0;
  margin: 0 auto;
  align-self: stretch;
  overflow: hidden;
  padding: 14px 20px 16px;
}

body[data-workspace="chat"] .workspace-tabs {
  position: static;
  align-self: start;
  justify-self: start;
  margin: -6px auto 14px 0;
}

body[data-workspace="chat"] .chat-workspace {
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body[data-workspace="chat"] .chat-contact-list {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.note-role {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 10px;
  font-weight: 800;
}

.note-role-manager {
  color: #8a2d00;
  border-color: #f4a261;
  background: #fff2e8;
}

.note-role-technologist {
  color: var(--brand-blue-dark);
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.note-role-director {
  color: #7f1d1d;
  border-color: var(--brand-red);
  background: var(--brand-red-soft);
}

body[data-theme="dark"] .note-role-manager {
  color: #ffd3b8;
  background: #3a2012;
}

.note-remove {
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
  background: transparent;
  font-size: 10px;
}

.note-remove:hover {
  color: #ffffff;
  background: var(--brand-red);
}

@media (max-width: 900px) {
  .chat-shell {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }

  .timesheet-layout {
    grid-template-columns: 1fr;
  }

  .timesheet-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 720px) {
  .app-shell,
  main {
    min-width: 0;
  }

  main {
    width: 100%;
    padding: 10px;
  }

  .workspace-tabs {
    top: 0;
    width: max-content;
    justify-content: flex-start;
    margin: 0 0 10px;
    overflow: visible;
    scrollbar-width: none;
  }

  .workspace-tabs::-webkit-scrollbar {
    display: none;
  }

  .workspace-tab {
    flex: 0 0 40px;
    justify-content: center;
    padding: 0;
  }

  .notification-panel {
    position: fixed;
    top: 58px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 70px);
  }

  .settings-preferences,
  .settings-offline-dates {
    grid-template-columns: 1fr;
  }

  .settings-dialog-panel {
    width: min(100%, calc(100vw - 16px));
    padding: 14px;
  }

  .chat-shell {
    position: relative;
    display: block;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  body[data-workspace="chat"] main {
    padding: 8px;
  }

  .chat-sidebar,
  .chat-dialog {
    position: absolute;
    inset: 0;
  }

  .chat-dialog {
    display: none;
  }

  .chat-workspace.has-open-dialog .chat-sidebar {
    display: none;
  }

  .chat-workspace.has-open-dialog .chat-dialog {
    display: grid;
  }

  #chatBackButton {
    display: inline-flex;
    order: -1;
  }

  .chat-dialog-header {
    justify-content: flex-start;
  }

  .chat-message {
    width: fit-content;
    max-width: 88%;
  }

  .chat-message-actions {
    right: 2px;
    max-width: calc(100vw - 42px);
    flex-wrap: wrap;
  }

  .chat-message-row.is-other .chat-message-actions {
    right: auto;
    left: 2px;
  }

  .chat-file-tools {
    flex-wrap: wrap;
  }

  .chat-file-tools small {
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
    overflow-wrap: anywhere;
  }

  .chat-selected-file {
    flex: 1 1 100px;
  }

  .chat-composer > button[type="submit"] {
    min-width: 42px;
    padding: 0 10px;
  }

  .timesheet-toolbar {
    align-items: stretch;
  }

  .timesheet-layout {
    display: block;
  }

  .timesheet-day-panel {
    position: fixed;
    z-index: 49;
    inset: 8px;
    display: none;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px;
    box-shadow: var(--shadow-panel);
  }

  .timesheet-day-panel > *,
  .timesheet-form,
  .timesheet-time-row {
    min-width: 0;
    max-width: 100%;
  }

  .timesheet-workspace.has-open-day .timesheet-day-panel {
    display: grid;
    animation: modal-panel-in 140ms ease-out;
  }

  .timesheet-workspace.has-open-day .timesheet-day-backdrop {
    position: fixed;
    z-index: 48;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(8, 18, 31, 0.58);
  }

  .timesheet-day-close {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .timesheet-day {
    min-height: 68px;
    padding: 6px;
  }

  .timesheet-day-total {
    font-size: 9px;
  }

  .timesheet-time-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timesheet-time-row label:last-child {
    grid-column: 1 / -1;
  }

  .timesheet-entry {
    grid-template-columns: 1fr;
  }

  .timesheet-entry > div:last-child {
    justify-content: flex-start;
  }

}

@media (max-width: 460px) {
  .timesheet-toolbar {
    flex-direction: column;
  }

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

  .timesheet-summary-item {
    min-height: 64px;
    padding: 8px 9px;
  }

  .timesheet-summary-item.is-compact {
    text-align: left;
  }

  .timesheet-month-navigation {
    justify-content: space-between;
  }

  .timesheet-month-navigation > div {
    min-width: 0;
  }

  .timesheet-day {
    min-height: 58px;
  }

  .timesheet-time-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .timesheet-time-row label:last-child {
    grid-column: auto;
  }

  .timesheet-form-actions button {
    width: 100%;
    white-space: normal;
  }

  .timesheet-day-total {
    font-size: 0;
  }

  .timesheet-day-total:not(:empty)::after {
    font-size: 9px;
    content: "смена";
  }

  .timesheet-day-shifts {
    top: 5px;
    right: 5px;
    min-width: 17px;
    min-height: 17px;
  }
}

@media (max-width: 520px) {
  #taskModal .task-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: hidden;
    padding: 3px;
    box-sizing: border-box;
  }

  #taskModal .task-tab-button {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0 3px;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 0.78rem;
}

.auth-legal-links a,
.registration-consent a {
  color: #006eb6;
}

.registration-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(0, 110, 182, 0.24);
  border-radius: 12px;
  background: rgba(0, 110, 182, 0.06);
  font-size: 0.82rem;
  line-height: 1.45;
}

.registration-consent input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
