:root {
  --sidebar-width: 248px;
  --sidebar-compact-width: 208px;
  --sidebar-mobile-width: 88px;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --line: #d8e0e8;
  --line-strong: #b8c4d1;
  --text: #172026;
  --muted: #637383;
  --teal: #08756f;
  --teal-strong: #075f5a;
  --blue: #2458b8;
  --amber: #9b650c;
  --red: #b42318;
  --green: #237a43;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.12);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

#app,
.react-app-root {
  min-height: 100vh;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.link-button {
  display: inline;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
  text-align: left;
  white-space: normal;
}

.link-button:hover {
  text-decoration: underline;
}

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

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.brand-subtitle {
  color: var(--muted);
  margin-top: 2px;
}

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

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

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

.field label {
  color: #304151;
  font-weight: 650;
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 82px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 117, 111, 0.15);
}

.react-combo-host {
  min-width: 220px;
}

.combo-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.combo-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 32px;
  align-items: stretch;
}

.combo-input-row .combo-clear {
  grid-column: 2;
  grid-row: 1;
}

.combo-input-row .combo-toggle {
  grid-column: 3;
  grid-row: 1;
}

.combo-input {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 8px 64px 8px 10px;
  outline: none;
}

.combo-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 117, 111, 0.15);
}

.combo-clear,
.combo-toggle {
  z-index: 1;
  min-width: 28px;
  min-height: 28px;
  align-self: center;
  justify-self: end;
  margin: 0 4px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.combo-clear:hover,
.combo-toggle:hover {
  background: #e5edf6;
  color: var(--text);
}

.combo-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(320px, 50vh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(23, 32, 38, 0.18);
}

.combo-option {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.combo-option:hover,
.combo-option.active {
  background: #e8f4f3;
}

.combo-option.selected {
  background: #d6eeeb;
  font-weight: 750;
}

.combo-option:disabled {
  color: var(--muted);
  background: #f4f6f8;
}

.combo-empty {
  padding: 10px;
  color: var(--muted);
}

.readonly-field {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #eef3f7;
  color: var(--text);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  font-weight: 700;
}

.month-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

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

.split-inputs label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.stack-line + .stack-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.warning-text {
  margin-top: 4px;
  color: #9a3412;
  font-weight: 700;
}

.live-control {
  display: grid;
  gap: 14px;
}

.live-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: stretch;
}

.live-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f8fafc;
}

.live-card span {
  color: var(--muted);
  font-weight: 650;
}

.live-card strong {
  font-size: 24px;
  line-height: 1;
}

.live-table .is-offline {
  opacity: 0.65;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--muted);
}

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

.status-dot.offline {
  background: var(--red);
}

.warn-cell {
  color: var(--amber);
  font-weight: 800;
}

.live-revision {
  justify-self: end;
}

.primary,
.secondary,
.danger,
.ghost {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.primary {
  background: var(--teal);
  color: #fff;
}

.primary:hover {
  background: var(--teal-strong);
}

.secondary {
  background: #e5edf6;
  color: #17385f;
}

.secondary:hover {
  background: #d6e3f2;
}

.action-link {
  text-decoration: none;
}

.danger {
  background: #f8dfdc;
  color: var(--red);
}

.danger:hover {
  background: #f2cbc6;
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.error {
  color: var(--red);
  background: #fff1ef;
  border: 1px solid #f1b8b0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.success {
  color: #135b32;
  background: #e8f6ed;
  border: 1px solid #9fd1b2;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: #111a20;
  color: #eef5f5;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.sidebar .brand {
  flex: 0 0 auto;
  margin: 0;
}

.sidebar .brand-subtitle {
  color: #9fb0bc;
}

.nav {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #465762 transparent;
}

.nav button {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: #c7d4dc;
  text-align: left;
  padding: 9px 10px;
  font-weight: 700;
}

.nav button:hover,
.nav button.active {
  background: #22313a;
  color: #fff;
}

.user-box {
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.user-name {
  font-weight: 800;
}

.user-role {
  color: #9fb0bc;
  font-size: 13px;
}

.main {
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.page-subtitle {
  color: var(--muted);
  margin-top: 5px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar .field {
  min-width: 180px;
}

.toolbar .search-field {
  min-width: min(360px, 100%);
  flex: 1;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.subnav button {
  min-height: 36px;
  border-radius: 6px;
  padding: 8px 12px;
  background: #e8eef5;
  color: #203444;
  font-weight: 800;
}

.subnav button.active,
.subnav button:hover {
  background: var(--teal);
  color: #fff;
}

.surface {
  background: var(--surface);
  border: 1px solid #aab8c5;
  border-radius: 8px;
  overflow: hidden;
}

.section-gap {
  margin-top: 16px;
}

.section-gap-small {
  margin-top: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #b4c0cc;
}

.section-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.month-group {
  padding: 0 16px 16px;
}

.month-group + .month-group {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.month-group h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.year-group {
  padding: 16px 0 0;
  border-top: 2px solid #8ea1b4;
}

.year-group:first-of-type {
  border-top: 0;
}

.section-head + .year-group {
  border-top: 0;
}

.year-group > h2 {
  margin: 0 16px 14px;
  font-size: 20px;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  table-layout: auto;
  border: 1px solid #717171;
}

.table-wrap table,
.items-editor table {
  width: max-content;
  min-width: max(100%, var(--context-table-width, 920px));
}

.table-wrap .production-work-types-table {
  width: 100%;
}

.production-work-types-table col.production-work-types-col-work-type {
  width: var(--production-work-type-col-width);
}

.production-work-types-table col.production-work-types-col-name {
  width: var(--production-work-name-col-width);
}

.production-work-types-table col.production-work-types-col-rate {
  width: var(--production-hourly-rate-col-width);
}

.production-work-types-table th:first-child,
.production-work-types-table td:first-child,
.production-work-types-table th:nth-child(2),
.production-work-types-table td:nth-child(2),
.production-work-types-table th:nth-child(3),
.production-work-types-table td:nth-child(3) {
  white-space: nowrap;
}

.production-work-types-table th:nth-child(2),
.production-work-types-table td:nth-child(2) {
  min-width: var(--production-work-name-col-width);
}

.production-work-types-table input,
.production-work-types-table select {
  width: 100%;
  min-width: 0;
}

.production-work-types-table td:nth-child(2) input {
  min-width: var(--production-work-name-col-width);
}

th,
td {
  padding: 11px 12px;
  border: 1px solid #757575;
  text-align: left;
  vertical-align: top;
}

th {
  color: #102235;
  background: #dfe7ef;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

td {
  color: #172534;
}

.purchase-wrap-text {
  display: inline-block;
  max-width: 20ch;
  white-space: normal;
  vertical-align: top;
}

.permissions-cell {
  min-width: 420px;
  white-space: normal;
}

.permission-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}

.permission-summary-item {
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

tbody tr:nth-child(even) {
  background: #f4f7fa;
}

tbody tr:hover {
  background: #e8f1f5;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #15313a;
  background: #e8eef5;
  white-space: nowrap;
}

.status[data-status="Отримано"],
.status[data-status="Закрито"] {
  background: #daf0e3;
  color: var(--green);
}

.status[data-status="Очікує погодження"],
.status[data-status="Очікує оплати"],
.status[data-status="Оплачено"] {
  background: #fff0cf;
  color: var(--amber);
}

.status[data-status="В дорозі"] {
  background: #e1ebfb;
  color: var(--blue);
}

.status[data-status="Скасовано"] {
  background: #f8dfdc;
  color: var(--red);
}

.status.status-paid {
  background: #daf0e3;
  color: var(--green);
}

.status.status-wait {
  background: #fff0cf;
  color: var(--amber);
}

.status.status-cancel {
  background: #f8dfdc;
  color: var(--red);
}

.price-warning-row {
  background: #fff8d8 !important;
}

.price-warning-cell,
.price-warning-panel {
  background: #fff3b0 !important;
  border-color: #d39a14 !important;
}

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

.stat-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  min-height: 88px;
  display: grid;
  gap: 6px;
  text-align: left;
}

.stat-title {
  color: var(--muted);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  font-size: 22px;
  font-weight: 850;
  line-height: 1.1;
}

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

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(9, 18, 25, 0.48);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(1100px, 100%);
  max-height: min(900px, 94vh);
  overflow: auto;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal.wide-modal {
  width: min(1280px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 16px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 12px;
}

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

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

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

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

.dropzone {
  min-height: 72px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #fbfcfd;
}

.dropzone.dragging {
  border-color: var(--teal);
  background: #ecf8f6;
}

.dropzone input {
  display: none;
}

.drop-meta {
  min-width: 0;
}

.drop-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.compact-file-list {
  margin-top: 6px;
}

.file-list a,
.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #8fa2b4;
  border-radius: 6px;
  background: #eef4f8;
  color: #183142;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tiny-button {
  min-height: 24px;
  padding: 3px 6px;
  font-size: 12px;
}

.items-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  margin-top: 14px;
}

.items-editor table {
  min-width: 780px;
}

.compact-table {
  min-width: 780px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.items-editor input,
.items-editor select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 34px;
  padding: 6px 8px;
}

.modal table input,
.modal table select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
}

.modal table input:focus,
.modal table select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 117, 111, 0.15);
  outline: none;
}

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

.compact-meta-grid > div {
  display: grid;
  gap: 4px;
}

.compact-meta-grid strong {
  font-size: 18px;
}

.item-meta-row td {
  background: #fbfcfd;
  padding: 12px;
}

.items-editor tr.purchase-item-row.is-separated td:first-child,
.items-editor tr.item-meta-row.is-separated td {
  border-left: 6px solid #0f766e;
}

.items-editor tr.purchase-item-row.item-start td {
  border-top: 4px solid #7e8c9a;
}

.items-editor tr.item-meta-row.is-separated td {
  border-bottom: 3px solid #a9b5c2;
}

.meta-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.meta-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

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

.warehouse-type-section + .warehouse-type-section {
  margin-top: 18px;
}

.issue-card + .issue-card {
  margin-top: 14px;
}

.issue-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.small-stat {
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.section-head.compact {
  margin-top: 4px;
  margin-bottom: 8px;
}

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

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.audit-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-details span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7f7;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.audit-details strong {
  margin-right: 4px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.admin-form {
  padding: 16px;
}

.danger-zone {
  border-color: #d98f87;
}

.danger-zone .section-head {
  background: #fff5f3;
}

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

.permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.permission-group-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
}

.permission-group .checks {
  grid-template-columns: minmax(0, 1fr);
}

.compact-checks {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.check input {
  width: 16px;
  height: 16px;
}

.inline-form {
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e7f0ef;
  color: #11524e;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .sidebar {
    width: var(--sidebar-compact-width);
    padding: 16px 12px;
    gap: 16px;
  }

  .sidebar .brand {
    gap: 10px;
  }

  .sidebar .brand-title {
    font-size: 19px;
  }

  .sidebar .brand-subtitle,
  .user-role {
    font-size: 12px;
  }

  .nav button {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 13px;
  }

  .main {
    margin-left: var(--sidebar-compact-width);
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .page-title {
    font-size: 23px;
  }

  .toolbar .field {
    flex: 1 1 170px;
    min-width: 160px;
  }

  .grid-3,
  .grid-4,
  .admin-grid,
  .permission-groups,
  .live-summary,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 820px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .sidebar {
    width: var(--sidebar-mobile-width);
    padding: 10px 6px;
    gap: 10px;
  }

  .sidebar .brand {
    justify-content: center;
  }

  .sidebar .brand > div:not(.brand-mark) {
    display: none;
  }

  .sidebar .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav {
    gap: 6px;
    padding-right: 0;
  }

  .nav button {
    min-height: 44px;
    border-radius: 7px;
    padding: 7px 4px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .user-box {
    gap: 7px;
    padding-top: 10px;
  }

  .user-name {
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-role {
    display: none;
  }

  .user-box .secondary {
    width: 100%;
    min-height: 32px;
    padding: 6px 4px;
    font-size: 11px;
  }

  .main {
    margin-left: var(--sidebar-mobile-width);
    padding: 10px;
  }

  .page-title {
    font-size: 20px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .topbar,
  .toolbar {
    margin-bottom: 12px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .field,
  .toolbar .search-field,
  .toolbar button {
    width: 100%;
    min-width: 0;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .admin-grid,
  .permission-groups,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .month-picker {
    grid-template-columns: 1fr;
  }

  .split-inputs {
    grid-template-columns: 1fr;
  }

  .project-strip,
  .type-strip {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .issue-summary,
  .row-actions {
    justify-content: flex-start;
  }

  table {
    min-width: 720px;
  }

  th,
  td {
    padding: 9px 10px;
  }

  .items-editor table {
    min-width: 700px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .login-panel {
    padding: 20px;
  }

  .project-strip,
  .type-strip {
    grid-template-columns: 1fr;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    max-height: 100vh;
    border-radius: 0;
  }
}

.table-wrap table,
.items-editor table {
  width: max-content;
  min-width: max(100%, var(--context-table-width, 920px));
}
