/* Base reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

/* Design tokens */
:root {
  --page-gutter: clamp(16px, 3.4vw, 32px);
  --page-vertical: clamp(16px, 2.6vw, 28px);
  --container-max: 1320px;
  --sidebar-w: 260px;

  --scrollbar-size: 12px;
  --scrollbar-track: #e7ebf0;
  --scrollbar-track-edge: #d7dde5;
  --scrollbar-thumb: linear-gradient(180deg, #7f8b98 0%, #667180 100%);
  --scrollbar-thumb-hover: linear-gradient(180deg, #6f7b89 0%, #586270 100%);
  --scrollbar-thumb-active: linear-gradient(180deg, #5f6a77 0%, #4c5562 100%);
  --scrollbar-border: rgba(255, 255, 255, 0.72);
  --scrollbar-shadow: rgba(15, 23, 42, 0.18);

  --bg-0: #070a0f;
  --bg-1: #0c1118;
  --bg-2: #121924;
  --surface-0: rgba(13, 17, 23, 0.96);
  --surface-1: rgba(18, 23, 31, 0.92);
  --surface-2: rgba(24, 30, 39, 0.90);
  --surface-3: rgba(34, 42, 53, 0.76);
  --surface-soft: rgba(255, 255, 255, 0.028);

  --text-1: #eef2f7;
  --text-2: rgba(238, 242, 247, 0.82);
  --text-3: rgba(238, 242, 247, 0.58);
  --text-4: rgba(238, 242, 247, 0.38);

  --line-1: rgba(128, 145, 168, 0.18);
  --line-2: rgba(145, 163, 186, 0.28);
  --line-3: rgba(166, 184, 206, 0.40);

  --accent: #b6915f;
  --accent-strong: #d2b17b;
  --accent-soft: rgba(182, 145, 95, 0.12);
  --accent-soft-2: rgba(182, 145, 95, 0.18);
  --accent-glow: rgba(182, 145, 95, 0.16);

  --success: #8db89d;
  --warning: #d0a562;
  --danger: #d58f89;

  --radius-xs: 9px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-1: 0 14px 30px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 22px 54px rgba(0, 0, 0, 0.34);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --focus-ring: 0 0 0 1px rgba(182, 145, 95, 0.35), 0 0 0 4px rgba(182, 145, 95, 0.12);

  --surface: var(--surface-0);
  --surface-elevated: var(--surface-1);
  --text-primary: var(--text-1);
  --text-secondary: var(--text-2);
  --border: var(--line-1);
  --shadow: var(--shadow-2);
  --radius-xl: 24px;

  --field-h: 42px;
  --field-h-sm: 36px;
  --btn-h: 42px;
  --topbar-h: 60px;
  --table-min-wide: 1160px;

  --fs-z-overlay: 10000;
  --fs-z-modal: 10001;
  --fs-gap: clamp(10px, 2vw, 18px);
  --fs-radius: 16px;
  --fs-header-h: 56px;
  --fs-border: 1px solid var(--line-1);
  --fs-panel-bg: rgba(9, 18, 28, 0.97);
  --fs-divider: 1px solid var(--line-1);
}

/* Html and body */
html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #657282 #0f1620;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #131a25 0%, #0d131c 100%);
  border-left: 1px solid rgba(128, 145, 168, 0.14);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #677382 0%, #515c69 100%);
  border-radius: 999px;
  border: 2px solid #0f1620;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 1px 6px rgba(0, 0, 0, 0.24);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #748090 0%, #5c6775 100%);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #5c6876 0%, #48515d 100%);
}

body {
  min-height: 100vh;
  display: block;
  color: var(--text-1);
  font-family: Inter, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(circle at 0% 0%, rgba(182, 145, 95, 0.06), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(110, 129, 156, 0.08), transparent 26%),
    linear-gradient(180deg, #161d28 0%, #0f141d 24%, var(--bg-0) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 0;
}

/* Base typography and links */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-1);
  line-height: 1.2;
}

p {
  color: var(--text-2);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

/* Shared surfaces */
.section-card,
.login-card,
.wrap,
.report-page .card,
.modal-window {
  background: linear-gradient(180deg, rgba(24, 30, 39, 0.95), rgba(16, 21, 29, 0.98));
  border: 1px solid var(--line-1);
  box-shadow:
    var(--shadow-1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* App layout */
.app-layout {
  min-height: 100vh;
  display: flex;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  padding:
    calc(var(--page-vertical) + env(safe-area-inset-top))
    calc(var(--page-gutter) + env(safe-area-inset-right))
    calc(var(--page-vertical) + env(safe-area-inset-bottom))
    calc(var(--page-gutter) + env(safe-area-inset-left));
}

.container,
.name-pages-zaproskp,
.main-form {
  width: 100%;
  max-width: none;
}

.container {
  max-width: var(--container-max);
  padding: 16px;
  margin: 0 auto;
}

.name-pages-zaproskp,
.container {
  flex: 0 1 auto;
  min-width: 0;
}

.name-pages-zaproskp {
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 14px;
  background: rgba(9, 12, 17, 0.95);
  border-right: 1px solid var(--line-1);
  box-shadow: 12px 0 30px rgba(0, 0, 0, 0.20);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar__brand {
  margin-bottom: 18px;
  padding: 0 4px 10px;
  border-radius: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-1);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar__group-title {
  margin-top: 18px;
  padding: 0 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.03em;
}

.sidebar__divider {
  height: 1px;
  margin: 8px 4px 2px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar__link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar__link:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.sidebar__link.is-active {
  color: var(--text-1);
  background: linear-gradient(180deg, rgba(182, 145, 95, 0.12), rgba(182, 145, 95, 0.07));
  border-color: rgba(182, 145, 95, 0.18);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.sidebar__link--muted {
  opacity: 0.66;
}

.sidebar__link--disabled {
  cursor: default;
  opacity: 0.56;
  pointer-events: none;
}

.sidebar__link--disabled:hover {
  color: var(--text-2);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.sidebar__link--with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar__link-text {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar__badge {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(180deg, #b65252 0%, #8f3535 100%);
  box-shadow: 0 4px 10px rgba(143, 53, 53, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar__link.is-active .sidebar__badge {
  box-shadow: 0 6px 14px rgba(143, 53, 53, 0.28);
}

/* Topbar */
.weved-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--topbar-h);
  background: rgba(10, 13, 18, 0.92);
  color: var(--text-1);
  border-bottom: 1px solid var(--line-1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), var(--shadow-inset);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.weved-topbar__inner {
  max-width: 1440px;
  min-height: var(--topbar-h);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.weved-topbar__left,
.weved-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.weved-topbar__center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.weved-topbar__brand {
  color: var(--accent);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.weved-topbar__rates {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.weved-topbar__rates::-webkit-scrollbar {
  display: none;
}

.weved-topbar__rate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  line-height: 1;
}

.weved-topbar__rate-chip.is-muted {
  opacity: 0.55;
}

.weved-topbar__rate-flag {
  width: 16px;
  height: 12px;
  display: inline-block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  flex: 0 0 auto;
}

.flag--rub { background: linear-gradient(to bottom, #ffffff 0 33%, #224c9f 33% 66%, #d52b1e 66% 100%); }
.flag--usd { background: linear-gradient(to bottom, #b22234 0 14%, #fff 14% 28%, #b22234 28% 42%, #fff 42% 56%, #b22234 56% 70%, #fff 70% 84%, #b22234 84% 100%); }
.flag--eur { background: #1e40af; }
.flag--rsd { background: linear-gradient(to bottom, #c6363c 0 33%, #0c4076 33% 66%, #ffffff 66% 100%); }
.flag--cny { background: #de2910; }
.flag--aed { background: linear-gradient(to right, #ff0000 0 25%, transparent 25% 100%), linear-gradient(to bottom, #00732f 0 33%, #ffffff 33% 66%, #000000 66% 100%); }
.flag--default { background: #6b7280; }

.weved-topbar__rate-code,
.weved-topbar__rate-value {
  font-size: 13px;
  font-weight: 600;
}

.weved-topbar__rate-value {
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
}

.weved-topbar__user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
}

.weved-topbar__user-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.weved-topbar__user-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  min-width: 0;
  color: var(--text-3);
  font-size: 12.5px;
  white-space: nowrap;
}

.weved-topbar__user-company,
.weved-topbar__user-role {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.weved-topbar__user-company {
  overflow: hidden;
  text-overflow: ellipsis;
}

.weved-topbar__user-role[data-prefixed="true"]::before {
  content: "•";
  margin: 0 6px;
  color: var(--text-4);
}

.weved-topbar__user-role {
  white-space: nowrap;
}

.weved-topbar__logout {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.weved-topbar__logout:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(182, 145, 95, 0.18);
  color: var(--text-1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.weved-topbar__logout:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

.btn-action.weved-topbar__feedback-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 700;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.btn-action.weved-topbar__feedback-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 145, 95, 0.18);
  background: rgba(255, 255, 255, 0.07);
}

.btn-action.weved-topbar__feedback-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-inset);
}

/* Forms */
.main-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 18px;
}

.form-row--center {
  justify-content: center;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

label,
.wrap label,
.report-page label {
  display: block;
  margin-bottom: 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.input-readonly,
.select-input,
.input-text,
.input-date,
.comment-input,
.wrap input,
.report-page .input-text,
.table :is(input, select, textarea) {
  width: 100%;
  min-height: var(--field-h);
  padding: 10px 13px;
  border: 1px solid var(--line-1);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.input-readonly {
  cursor: default;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(128, 145, 168, 0.14);
}

.select-input,
.input-text,
.input-date,
.wrap input,
.report-page .input-text,
.table :is(input, select, textarea) {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-1);
}

.input-text::placeholder,
.input-date::placeholder,
.comment-input::placeholder,
.wrap input::placeholder,
.report-page .input-text::placeholder,
.table :is(input, textarea)::placeholder {
  color: var(--text-4);
}

.input-text:focus,
.input-date:focus,
.select-input:focus,
.comment-input:focus,
.wrap input:focus,
.report-page .input-text:focus,
.table :is(input, select, textarea):focus {
  background: rgba(24, 30, 39, 0.96);
  border-color: rgba(182, 145, 95, 0.28);
  box-shadow: var(--focus-ring);
}

.select-input {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: auto;
  padding-right: 12px;
  background-image: none !important;
}

.select-input option,
.report-page select.input-text option {
  color: var(--text-1);
  background: #141a23;
}

.select-input option:checked {
  color: #ffffff;
  background: #6d5434;
}

.name-pages-zaproskpview select.input-text {
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: auto;
  padding-right: 12px;
  background-image: none !important;
}

.name-pages-zaproskpview select.input-text option {
  color: var(--text-1);
  background: #141a23;
}

.name-pages-zaproskpview select.input-text option:checked {
  color: #ffffff;
  background: #6d5434;
}

.input-error,
.select-input.input-error,
.comment-input.input-error,
.wrap input.input-error {
  border-color: rgba(255, 115, 115, 0.76) !important;
  box-shadow: 0 0 0 2px rgba(255, 115, 115, 0.16) !important;
}

/* Buttons */
.btn-action,
#addRowBtn,
#deleteRowBtn,
#attachmentsFileInput,
#addCargoPlaceRowBtn,
#addCargoPlaceRowBtn-tab2,
#deleteCargoPlaceRowBtn,
#deleteCargoPlaceRowBtn-tab2,
#findInfoOpenAi,
#findAnalogAndOpenAi,
#exportToFileBtn,
#importFromFileBtn,
#checkSupplierOfferArchiveBtn,
#deleteServiceRowBtn,
#addServiceRowBtn,
#findAnalog,
#mergeButton,
#requestFinoutBtn,
#loadFromFileBtn,
.save-btn,
.wrap button,
.btn-upload,
.report-page .btn {
  appearance: none;
  min-height: var(--btn-h);
  padding: 9px 14px;
  border: 1px solid var(--line-1);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(49, 57, 69, 0.94), rgba(32, 38, 48, 0.98));
  color: var(--text-1);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.btn-action:hover,
#addRowBtn:hover,
#deleteRowBtn:hover,
#attachmentsFileInput:hover,
#addCargoPlaceRowBtn:hover,
#addCargoPlaceRowBtn-tab2:hover,
#deleteCargoPlaceRowBtn:hover,
#deleteCargoPlaceRowBtn-tab2:hover,
#findInfoOpenAi:hover,
#findAnalogAndOpenAi:hover,
#exportToFileBtn:hover,
#importFromFileBtn:hover,
#checkSupplierOfferArchiveBtn:hover,
#deleteServiceRowBtn:hover,
#addServiceRowBtn:hover,
#findAnalog:hover,
#mergeButton:hover,
#requestFinoutBtn:hover,
#loadFromFileBtn:hover,
.save-btn:hover,
.wrap button:hover,
.btn-upload:hover,
.report-page .btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(58, 67, 81, 0.96), rgba(37, 43, 55, 0.99));
  border-color: var(--line-2);
  box-shadow:
    0 14px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-action:active,
#addRowBtn:active,
#deleteRowBtn:active,
#attachmentsFileInput:active,
#addCargoPlaceRowBtn:active,
#addCargoPlaceRowBtn-tab2:active,
#deleteCargoPlaceRowBtn:active,
#deleteCargoPlaceRowBtn-tab2:active,
#findInfoOpenAi:active,
#findAnalogAndOpenAi:active,
#exportToFileBtn:active,
#importFromFileBtn:active,
#checkSupplierOfferArchiveBtn:active,
#deleteServiceRowBtn:active,
#addServiceRowBtn:active,
#findAnalog:active,
#mergeButton:active,
#requestFinoutBtn:active,
#loadFromFileBtn:active,
.save-btn:active,
.wrap button:active,
.btn-upload:active,
.report-page .btn:active {
  transform: translateY(0);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn-action:disabled,
#addRowBtn:disabled,
#deleteRowBtn:disabled,
#attachmentsFileInput:disabled,
#addCargoPlaceRowBtn:disabled,
#addCargoPlaceRowBtn-tab2:disabled,
#deleteCargoPlaceRowBtn:disabled,
#deleteCargoPlaceRowBtn-tab2:disabled,
#findInfoOpenAi:disabled,
#findAnalogAndOpenAi:disabled,
#exportToFileBtn:disabled,
#importFromFileBtn:disabled,
#checkSupplierOfferArchiveBtn:disabled,
#deleteServiceRowBtn:disabled,
#addServiceRowBtn:disabled,
#findAnalog:disabled,
#mergeButton:disabled,
#requestFinoutBtn:disabled,
#loadFromFileBtn:disabled,
.save-btn:disabled,
.wrap button:disabled,
.btn-upload:disabled,
.report-page .btn:disabled {
  opacity: 0.56;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.save-btn,
.wrap button,
.report-page .btn-primary,
#mergeButton,
#requestFinoutBtn {
  border-color: rgba(182, 145, 95, 0.28);
  background: linear-gradient(180deg, #c5a16e 0%, #a37d4b 100%);
  color: #15110b;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.22),
    0 6px 14px rgba(121, 89, 49, 0.18),
    inset 0 1px 0 rgba(255, 244, 227, 0.30);
}

.save-btn:hover,
.wrap button:hover,
.report-page .btn-primary:hover,
#mergeButton:hover,
#requestFinoutBtn:hover {
  background: linear-gradient(180deg, #cfad7e 0%, #b18a59 100%);
  border-color: rgba(210, 177, 123, 0.34);
}

#deleteRowBtn,
#deleteCargoPlaceRowBtn,
#deleteCargoPlaceRowBtn-tab2,
#deleteServiceRowBtn,
.btn-action--danger {
  color: #ffd8d3;
  border-color: rgba(213, 143, 137, 0.24);
  background: linear-gradient(180deg, rgba(104, 43, 45, 0.86), rgba(77, 31, 33, 0.96));
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#deleteRowBtn:hover,
#deleteCargoPlaceRowBtn:hover,
#deleteCargoPlaceRowBtn-tab2:hover,
#deleteServiceRowBtn:hover,
.btn-action--danger:hover {
  border-color: rgba(213, 143, 137, 0.34);
  background: linear-gradient(180deg, rgba(118, 48, 50, 0.92), rgba(88, 35, 37, 0.98));
}

#addRowBtn::before,
#addCargoPlaceRowBtn::before,
#addCargoPlaceRowBtn-tab2::before,
#addServiceRowBtn::before,
#importFromFileBtn::before,
#loadFromFileBtn::before {
  content: "+";
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

#deleteRowBtn::before,
#deleteCargoPlaceRowBtn::before,
#deleteCargoPlaceRowBtn-tab2::before,
#deleteServiceRowBtn::before {
  content: "−";
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

#findInfoOpenAi::before {
  content: "AI";
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

#exportToFileBtn::before {
  content: "⇩";
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

#findAnalog::before {
  content: "🔍";
  font-size: 12px;
  line-height: 1;
}

#checkSupplierOfferArchiveBtn::before {
  content: "🗂";
  font-size: 12px;
  line-height: 1;
}

#toggleHistoryBtn.btn-action {
  min-height: var(--btn-h);
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px;
}

#toggleHistoryBtn.btn-action::before {
  content: none !important;
}

#toggleHistoryBtn.btn-action::after {
  content: "▾";
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

#toggleHistoryBtn.btn-action.is-open::after {
  content: "▴";
}

a.btn-action.btn-attach {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Section cards */
.section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.section-card:hover {
  border-color: rgba(182, 145, 95, 0.16);
  box-shadow:
    var(--shadow-2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.section-card-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.64), rgba(13, 17, 23, 0.96));
  border-top: 1px solid var(--line-1);
  z-index: 8;
}

.section-title {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 0 12px;
  color: var(--text-1);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-transform: none;
  text-align: left;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(182, 145, 95, 0));
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zaproskpview-page__alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-inset);
}

.zaproskpview-page__alert--warning {
  border-color: rgba(217, 178, 111, 0.34);
  background: rgba(130, 91, 25, 0.18);
  color: #ffe3bb;
}

.zaproskpview-page__alert--error {
  border-color: rgba(217, 138, 131, 0.34);
  background: rgba(120, 43, 37, 0.22);
  color: #ffd3ce;
}

.zaproskpview-page__alert--success {
  border-color: rgba(136, 182, 154, 0.30);
  background: rgba(136, 182, 154, 0.12);
  color: #d8f6e1;
}

.zaproskpview-page__alert-title {
  color: var(--text-1);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.zaproskpview-page__alert-message {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.mail-history-preview-row > td {
  background: rgba(255, 255, 255, 0.03);
}

.mail-history-preview-cell {
  padding: 14px 16px !important;
}

.mail-history-preview {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--surface-elevated);
}

.mail-history-preview__status {
  color: var(--text-secondary);
  font-weight: 600;
}

.mail-history-preview__status--error {
  color: var(--danger);
}

.zaproskpview-page__alert-list {
  margin-top: 8px;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.form-group.is-validation-error label {
  color: #ffb6ae;
}

.section-card.is-validation-error,
.table-container.is-validation-error {
  border-color: rgba(217, 138, 131, 0.28);
  box-shadow:
    0 0 0 1px rgba(217, 138, 131, 0.08),
    var(--shadow-1),
    var(--shadow-inset);
}

.comments-column {
  display: block;
  width: auto;
  padding: 0;
}

.vertical-table {
  width: 100%;
  height: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.field-label {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-1);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Subsection headers inside stacked form rows need their own vertical rhythm. */
.field-label--subsection {
  display: block;
  width: 100%;
}

.section-content > * + .field-label--subsection,
.section-content > * + div > .field-label--subsection {
  margin-top: 12px;
}

.comment-input {
  min-height: 132px;
  resize: vertical;
  box-sizing: border-box;
}

.comment-input[readonly] {
  opacity: 0.86;
  cursor: default;
  background: rgba(255, 255, 255, 0.055);
}

#commentsContent:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.save-btn {
  display: block;
  margin: 24px auto 0;
  padding-inline: 18px;
}

/* Login card and auth */
.login-card {
  padding: 32px;
  border-radius: var(--radius-lg);
}

.login-title,
.wrap h1 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 28px;
  font-weight: 750;
  color: var(--text-1);
  text-transform: none;
  letter-spacing: 0.02em;
}

.error-message,
.wrap .msg {
  min-height: 16px;
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
}

.error-message,
.wrap .msg.err {
  color: var(--danger);
}

.wrap .msg.ok {
  color: var(--success);
}

.wrap {
  width: 100%;
  max-width: 420px;
  margin: clamp(18px, 6vh, 90px) auto 0;
  padding: 32px;
  border-radius: var(--radius-lg);
}

/* Buttons grid tiles */
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.button-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  border-radius: 16px;
  border: 1px solid var(--line-1);
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.88), rgba(15, 23, 42, 0.88));
  box-shadow: var(--shadow-1), var(--shadow-inset);
  color: var(--text-1);
  text-decoration: none;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button-tile:hover {
  transform: translateY(-2px);
  color: #ffffff;
  border-color: var(--line-2);
  background: linear-gradient(180deg, rgba(24, 38, 65, 0.96), rgba(17, 28, 48, 0.96));
  box-shadow: var(--shadow-2), var(--shadow-inset);
}

.button-tile:active {
  transform: scale(0.99);
}

/* Status and helper states */
.loading-message {
  margin: 0;
  padding: 16px 0;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}

.invoice-diff-cell {
  background-color: rgba(255, 115, 115, 0.20);
  color: #ffd8d8;
  font-weight: 700;
}

.invoice-match-cell {
  background-color: rgba(98, 212, 159, 0.12);
}

.invoice-compare-status--ok {
  color: var(--success);
  font-weight: 700;
}

.invoice-compare-status--bad {
  color: var(--danger);
  font-weight: 700;
}

.ai-filled-by-openai {
  background: rgba(255, 196, 87, 0.12) !important;
  border-color: rgba(255, 196, 87, 0.35) !important;
  color: #fff2ce !important;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(3, 8, 15, 0.72);
  backdrop-filter: blur(6px);
}

.modal-overlay[hidden],
.incident-modal__actions[hidden],
.incident-modal__choice-grid[hidden],
.incident-modal__hint[hidden],
.incident-modal__form[hidden],
.incident-modal__feedback[hidden],
.incident-modal__code[hidden] {
  display: none !important;
}

.modal-window {
  position: fixed !important;
  z-index: 10000 !important;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  max-width: 560px;
  padding: 28px;
  border-radius: 16px;
  color: var(--text-1);
  animation: fadeIn 0.22s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.07);
}

.modal-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 22px;
  color: var(--accent);
}

.incident-modal {
  display: grid;
  gap: 14px;
}

.modal-window.incident-modal {
  width: min(680px, calc(100vw - 24px));
  max-width: 680px;
  max-height: calc(100vh - 24px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.incident-modal__summary,
.incident-modal__message,
.incident-modal__code,
.incident-modal__feedback,
.incident-fallback-screen__message {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}

.incident-modal__summary {
  color: var(--text-1);
  font-weight: 700;
}

.incident-modal__code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.incident-modal__actions,
.incident-modal__form-actions,
.incident-fallback-screen__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.incident-modal__form {
  display: grid;
  gap: 12px;
}

.incident-modal__hint {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-1);
  background: rgba(182, 145, 95, 0.08);
  color: var(--text-2);
  line-height: 1.5;
}

.incident-modal__textarea {
  min-height: 110px;
}

.incident-modal__feedback {
  min-height: 20px;
}

@media (max-width: 720px) {
  .modal-window.incident-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .incident-modal__choice-grid {
    grid-template-columns: 1fr;
  }
}

.incident-fallback-screen {
  max-width: 720px;
  margin: 40px auto;
  padding: 28px;
}

.incident-fallback-screen__title {
  margin-bottom: 4px;
}

.file-upload-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#fileInput {
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  cursor: pointer;
  font-size: 14px;
}

#fileInput::file-selector-button {
  display: none;
}

.file-info {
  min-height: 28px;
  padding: 10px 12px;
  margin: 4px 0 0;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Tables */
.table-container,
.table-container.orders,
.logisticstatus-table-wrap,
.report-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-1);
  background: rgba(10, 13, 18, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.table-container.orders {
  margin-bottom: 16px;
}

.table,
.items-table,
.orders-table,
.report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text-1);
}

.table,
.items-table,
.orders-table {
  border: 1px solid var(--line-1);
}

.table thead th,
.items-table thead th,
.orders-table thead th,
.report-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 12px;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(27, 31, 39, 0.98), rgba(19, 23, 30, 0.98));
  color: rgba(238, 242, 247, 0.82);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  border-right: 1px solid rgba(128, 145, 168, 0.12);
  border-bottom: 1px solid rgba(128, 145, 168, 0.18);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.table thead th:first-child,
.items-table thead th:first-child,
.orders-table thead th:first-child,
.report-table thead th:first-child {
  border-top-left-radius: var(--radius-md);
}

.table thead th:last-child,
.items-table thead th:last-child,
.orders-table thead th:last-child,
.report-table thead th:last-child {
  border-top-right-radius: var(--radius-md);
  border-right: none;
}

.table td,
.items-table td,
.orders-table td,
.report-table tbody td {
  padding: 12px;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow: visible;
  color: var(--text-2);
  border-right: 1px solid rgba(128, 145, 168, 0.08);
  border-bottom: 1px solid rgba(128, 145, 168, 0.08);
  background: rgba(255, 255, 255, 0.014);
}

.table th:last-child,
.table td:last-child,
.items-table th:last-child,
.items-table td:last-child,
.orders-table th:last-child,
.orders-table td:last-child,
.report-table th:last-child,
.report-table td:last-child {
  border-right: none;
}

.table tbody tr,
.items-table tbody tr,
.orders-table tbody tr,
.report-table tbody tr {
  transition: background-color 0.14s ease;
}

.table tbody tr:nth-child(even),
.items-table tbody tr:nth-child(even),
.orders-table tbody tr:nth-child(even),
.report-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover,
.items-table tbody tr:hover,
.orders-table tbody tr:hover,
.report-table tbody tr:hover {
  background: rgba(132, 148, 171, 0.06);
}

/* Highlight rows with unassigned manager */
.table tbody tr.is-manager-unassigned > td,
.items-table tbody tr.is-manager-unassigned > td,
.orders-table tbody tr.is-manager-unassigned > td,
.report-table tbody tr.is-manager-unassigned > td {
  background:
    linear-gradient(180deg, rgba(217, 138, 131, 0.18), rgba(120, 43, 37, 0.20));
  color: #ffe2db;
  border-bottom-color: rgba(217, 138, 131, 0.22);
}

.table tbody tr.is-manager-unassigned > td:first-child,
.items-table tbody tr.is-manager-unassigned > td:first-child,
.orders-table tbody tr.is-manager-unassigned > td:first-child,
.report-table tbody tr.is-manager-unassigned > td:first-child {
  box-shadow: inset 3px 0 0 rgba(217, 138, 131, 0.85);
}

.table tbody tr.is-manager-unassigned:hover > td,
.items-table tbody tr.is-manager-unassigned:hover > td,
.orders-table tbody tr.is-manager-unassigned:hover > td,
.report-table tbody tr.is-manager-unassigned:hover > td {
  background:
    linear-gradient(180deg, rgba(217, 138, 131, 0.24), rgba(120, 43, 37, 0.26));
}

.table .row-checkbox,
.row-checkbox,
#selectAll {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

#selectAll {
  margin: 0;
  align-self: center;
}

.table :is(input, select, textarea) {
  min-height: var(--field-h-sm);
  font-size: 13.5px;
  padding: 7px 10px;
}

.table thead .filter-row th {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.table thead .filter-row .table-filter {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line-1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 13px;
  outline: none;
}

.table thead .filter-row .table-filter:focus {
  border-color: rgba(182, 145, 95, 0.26);
  box-shadow: var(--focus-ring);
}

.table--wide,
#itemsTable,
.items-table.table--wide,
.report-table {
  width: max-content;
  min-width: var(--table-min-wide);
  table-layout: fixed;
}

.table--wide th,
.table--wide td,
#itemsTable th,
#itemsTable td {
  text-align: center;
  text-overflow: ellipsis;
}

.table--resizable {
  table-layout: fixed;
}

.table--resizable th,
.table--resizable td {
  position: relative;
  vertical-align: top;
}

.table.table--wide.table--resizable td {
  position: relative;
  vertical-align: top;
}

.table .cell-resize-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 36px;
  box-sizing: border-box;
  padding-right: 14px;
  padding-bottom: 14px;
}

.table.table--wide.table--resizable .cell-resize-wrap {
  height: 100%;
}

.table.table--wide.table--resizable .cell-resize-wrap :is(input, select, textarea) {
  height: 100%;
  min-height: 24px;
  resize: none;
}

.table .cell-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 5;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  cursor: nwse-resize;
  opacity: 0.85;
  pointer-events: auto;
  background: linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, 0.55) 45% 55%, transparent 55% 100%);
}

.table .cell-resize-handle:hover {
  opacity: 1;
}

.th-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
}

.th-resizer:hover {
  background: rgba(255, 255, 255, 0.07);
}

.table--attachments th,
.table--attachments td {
  text-align: center;
  vertical-align: middle;
}

.table--attachments td:first-child {
  word-break: break-word;
}

.attachments-document-type-group,
.attachments-visibility-group {
  min-width: 180px;
}

.attachment-type-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 180px;
  max-width: 280px;
  margin: 0 auto;
  text-align: left;
}

.attachment-type-select {
  width: 100%;
  min-width: 160px;
}

.attachment-type-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line-1);
  border-radius: 8px;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1.25;
  word-break: break-word;
}

.attachment-type-status {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}

.attachment-type-status small {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.35;
}

.attachment-type-status--review {
  color: #b86e14;
}

.table--simple {
  table-layout: fixed;
  min-width: 520px;
}

/* Scroll nav */
.scroll-nav {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.scroll-nav__btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-1);
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(49, 57, 69, 0.94), rgba(32, 38, 48, 0.98));
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}

.scroll-nav__btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(58, 67, 81, 0.96), rgba(37, 43, 55, 0.99));
  border-color: rgba(182, 145, 95, 0.18);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.scroll-nav__btn:active {
  transform: translateY(0);
}

.scroll-nav__btn[disabled] {
  opacity: 0.35;
  cursor: default;
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.scroll-nav__icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
  transform: translateY(-1px);
}

/* Page tabs */
.page-tabs {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 10px 0 12px;
  padding: 0 4px 2px;
  border-bottom: 1px solid var(--line-1);
}

.page-tab,
.report-tab-btn {
  appearance: none;
  border: 1px solid var(--line-1);
  border-bottom: none;
  position: relative;
  top: 1px;
  padding: 10px 16px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: rgba(255, 255, 255, 0.024);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.page-tab:hover,
.report-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-2);
}

.page-tab[aria-selected="true"],
.report-tab-btn.is-active {
  top: 0;
  z-index: 2;
  color: var(--text-1);
  background: rgba(182, 145, 95, 0.10);
  border-color: rgba(182, 145, 95, 0.20);
}

.page-tab:focus-visible,
.report-tab-btn:focus-visible,
.btn-action:focus-visible,
.save-btn:focus-visible,
.wrap button:focus-visible,
.btn-upload:focus-visible,
.weved-topbar__logout:focus-visible,
.sidebar__link:focus-visible,
.registry-sort-button:focus-visible,
.input-text:focus-visible,
.input-date:focus-visible,
.select-input:focus-visible,
.comment-input:focus-visible,
.wrap input:focus-visible,
.report-page .input-text:focus-visible,
.table :is(input, select, textarea):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.registry-page {
  gap: 14px;
}

.registry-filters {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: center;
}

.registry-filters__search {
  min-width: 0;
}

.registry-page__table-wrap {
  max-height: 560px;
  overflow: auto;
}

.registry-page__table {
  min-width: 760px;
}

.registry-sort-button {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.registry-sort-button.is-active {
  color: var(--text-1);
}

.registry-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.registry-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-1);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.registry-indicator--empty,
.registry-indicator--info {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
}

.registry-indicator--warning {
  color: #ffe3bb;
  border-color: rgba(217, 178, 111, 0.34);
  background: rgba(130, 91, 25, 0.18);
}

.registry-indicator--danger {
  color: #ffd3ce;
  border-color: rgba(217, 138, 131, 0.34);
  background: rgba(120, 43, 37, 0.22);
}

.registry-indicator--success {
  color: #d8f6e1;
  border-color: rgba(136, 182, 154, 0.30);
  background: rgba(136, 182, 154, 0.12);
}

@media (max-width: 960px) {
  .registry-filters {
    grid-template-columns: 1fr;
  }

  .registry-page__table {
    min-width: 700px;
  }
}

/* Fullscreen editor */
html.fs-open,
body.fs-open {
  height: 100%;
  overflow: hidden;
}

.fs-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--fs-z-overlay);
  background: rgba(3, 8, 15, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fs-modal {
  position: fixed;
  inset: 0;
  z-index: var(--fs-z-modal);
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--fs-gap) + env(safe-area-inset-top))
    calc(var(--fs-gap) + env(safe-area-inset-right))
    calc(var(--fs-gap) + env(safe-area-inset-bottom))
    calc(var(--fs-gap) + env(safe-area-inset-left));
  background: transparent;
}

.fs-modal > .fs-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--fs-panel-bg);
  border: var(--fs-border);
  border-radius: var(--fs-radius);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.fs-header {
  flex: 0 0 auto;
  height: var(--fs-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 12px 14px;
  border-bottom: var(--fs-divider);
  background: rgba(255, 255, 255, 0.02);
}

.fs-title {
  min-width: 0;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}

.fs-actions > button,
.fs-actions > .btn-action,
#fsItemsSaveBtn,
#fsItemsCloseBtn {
  width: auto;
  min-width: max-content;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 13.5px;
  border-radius: 10px;
}

.fs-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.fs-body .section-card.is-fullscreen-items {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fs-body .section-card.is-fullscreen-items > .section-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fs-body .section-card.is-fullscreen-items .table-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fs-body .section-card.is-fullscreen-items .items-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
}

.fs-body .section-card.is-fullscreen-items #itemsTable {
  width: max-content;
  min-width: var(--table-min-wide);
}

.fs-modal button {
  width: auto !important;
}

.fs-body .section-card.is-fullscreen-items .items-actions,
.fs-body .section-card.is-fullscreen-items .buttons-row,
.fs-body .section-card.is-fullscreen-items .actions-row,
.fs-body .section-card.is-fullscreen-items .fs-items-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.fs-body .section-card.is-fullscreen-items #addRowBtn,
.fs-body .section-card.is-fullscreen-items #deleteRowBtn,
.fs-body .section-card.is-fullscreen-items #exportToFileBtn,
.fs-body .section-card.is-fullscreen-items #importFromFileBtn,
.fs-body .section-card.is-fullscreen-items #deleteServiceRowBtn,
.fs-body .section-card.is-fullscreen-items #addServiceRowBtn,
.fs-body .section-card.is-fullscreen-items #loadFromFileBtn,
.fs-body .section-card.is-fullscreen-items #checkSupplierOfferArchiveBtn,
.fs-body .section-card.is-fullscreen-items #findAnalog,
.fs-body .section-card.is-fullscreen-items #mergeButton,
.fs-body .section-card.is-fullscreen-items #requestFinoutBtn,
.fs-body .section-card.is-fullscreen-items .btn-action,
.fs-body .section-card.is-fullscreen-items .fs-items-actions > button,
.fs-body .section-card.is-fullscreen-items .fs-items-actions > .btn-action {
  width: auto !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  margin-top: 0 !important;
  align-self: center;
  min-width: max-content;
}

/* Logistic status page */
#logisticStatusPage {
  width: 100%;
}

#logisticStatusTitle {
  margin: 0 0 12px;
  font-size: 24px;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.02em;
}

#logisticStatusHint {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-1);
}

.logisticstatus-card {
  margin-bottom: 14px;
}

.logisticstatus-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.logisticstatus-actions .btn-action {
  padding: 8px 12px;
  font-size: 13.5px;
  border-radius: 10px;
}

.logisticstatus-bar {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.logisticstatus-pill {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.05);
}

.logisticstatus-pill.ok { color: var(--success); }
.logisticstatus-pill.err { color: var(--danger); border-color: rgba(255, 115, 115, 0.30); }
.logisticstatus-pill.muted { color: var(--text-3); }

/* Report page */
.report-page {
  --report-accent: var(--accent);
  --report-accent-2: var(--accent-strong);
  --report-text: var(--text-1);
  --report-text-muted: var(--text-2);
  --report-text-soft: var(--text-3);
  --report-panel-bg: rgba(15, 23, 42, 0.84);
  --report-panel-bg-2: rgba(18, 30, 52, 0.88);
  --report-line: var(--line-1);
  --report-line-strong: var(--line-2);
  --report-soft-bg: rgba(255, 255, 255, 0.05);
  --report-soft-bg-2: rgba(255, 255, 255, 0.08);
  --report-hover-bg: rgba(182, 145, 95, 0.10);
  --report-radius: 16px;
  --report-shadow: var(--shadow-1), var(--shadow-inset);

  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.report-page .page-title {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--report-accent);
  text-transform: none;
  letter-spacing: 0.02em;
}

.report-page .page-subtitle {
  max-width: 760px;
  color: var(--report-text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.report-page-actions,
.report-header-stats,
.report-results-toolbar,
.report-selected-summary-actions,
.report-pagination,
.report-panel-toolbar-spread {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-stat {
  min-width: 108px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--report-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-stat-label {
  color: var(--report-text-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
}

#reportDirtyBadge {
  color: var(--report-accent);
}

.report-page .card {
  min-width: 0;
  border-radius: 16px;
}

.report-page .card-header,
.report-page .card-body,
.report-page .card-footer {
  padding: 14px 16px;
}

.report-page .card-header + .card-body {
  padding-top: 6px;
}

.report-page .card-title {
  color: var(--report-accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.report-page .field-hint {
  margin-top: 4px;
  color: var(--report-text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.report-page .btn {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13.5px;
}

.report-page .btn-primary {
  background: linear-gradient(180deg, var(--report-accent), var(--report-accent-2));
}

.report-page .btn-secondary {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--report-line);
  box-shadow: none;
}

.report-page .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}

.report-page .btn-small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

#reportErrorBox {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 115, 115, 0.35);
  background: rgba(180, 35, 24, 0.14);
  color: #ffd6d2;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.report-workspace {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.report-builder {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.report-builder-header {
  border-bottom: 1px solid var(--report-line);
}

.report-builder-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: auto;
}

.report-builder-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.report-builder-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--report-line);
}

.report-selected-summary {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--report-line);
}

.report-selected-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-section-title {
  color: var(--report-accent);
  font-size: 13.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
}

.report-selected-fields {
  min-height: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-pill);
  background: rgba(182, 145, 95, 0.10);
  border: 1px solid rgba(182, 145, 95, 0.18);
  color: var(--text-1);
  font-size: 12.5px;
  line-height: 1.2;
}

.report-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-remove-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.chip-remove-btn:hover {
  color: #ffffff;
  transform: scale(1.08);
}

.report-builder-tabs {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  border-bottom: 1px solid var(--report-line);
  padding: 0 2px;
}

.report-tab-panel {
  display: block;
  min-width: 0;
}

.report-tab-panel[hidden] {
  display: none !important;
}

.report-panel-toolbar {
  margin-bottom: 12px;
}

.report-field-groups,
.report-filter-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-group-card {
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--report-line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.report-group-card[open] {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(182, 145, 95, 0.18);
}

.report-group-summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid transparent;
}

.report-group-card[open] .report-group-summary {
  border-bottom-color: var(--report-line);
}

.report-group-summary::-webkit-details-marker {
  display: none;
}

.report-group-summary-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.report-group-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

.report-group-summary-side {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(182, 145, 95, 0.08);
  border: 1px solid rgba(182, 145, 95, 0.16);
  color: var(--report-accent);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
}

.report-group-body {
  padding: 14px;
}

.report-field-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.report-field-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--report-line);
  cursor: pointer;
}

.report-field-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(182, 145, 95, 0.18);
}

.report-field-option.is-selected {
  background: rgba(182, 145, 95, 0.10);
  border-color: rgba(182, 145, 95, 0.22);
}

.report-field-option input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--report-accent);
  width: 16px;
  height: 16px;
}

.report-field-label-wrap {
  min-width: 0;
}

.report-field-label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.report-field-code {
  margin-top: 5px;
  color: var(--report-text-soft);
  font-size: 11.5px;
  word-break: break-all;
}

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

.report-filter-span-2 {
  grid-column: 1 / -1;
}

.report-filter-range-head {
  margin-bottom: 8px;
}

.report-filter-range-title {
  color: var(--report-accent);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
}

.report-filter-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-results {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.report-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--report-line);
}

.report-size-group {
  min-width: 140px;
}

.report-results-body {
  position: relative;
  min-width: 0;
  min-height: 420px;
}

.report-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 10px;
  color: var(--report-text-muted);
  font-size: 12px;
}

.report-loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--report-accent);
  animation: report-spin 0.8s linear infinite;
}

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

.report-empty-state {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed var(--line-1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--report-text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.report-table {
  min-width: 100%;
  color: #ffffff;
}

.report-table tbody td {
  max-width: 320px;
  min-width: 120px;
  font-size: 12px;
  line-height: 1.4;
  vertical-align: top;
  word-break: break-word;
  white-space: normal;
}

#reportLoadingBox[hidden],
#reportEmptyState[hidden],
#reportTableWrap[hidden] {
  display: none !important;
}

/* Performance hints */
.input-text,
.select-input {
  will-change: transform, box-shadow;
}

.input-text:focus,
.select-input:focus {
  will-change: auto;
}

/* Global transitions */
* {
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

/* Accessibility */
@media (prefers-contrast: high) {
  .input-readonly,
  .select-input,
  .input-text,
  .input-date,
  .comment-input,
  .table :is(input, select, textarea),
  .items-table,
  .table,
  .orders-table {
    border-color: rgba(255, 255, 255, 0.36);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive */
@media (max-width: 1380px) {
  .report-workspace {
    grid-template-columns: 380px minmax(0, 1fr);
  }
}

@media (max-width: 1200px) {
  .weved-topbar__user-role {
    display: none;
  }
}

@media (max-width: 1100px) {
  .report-workspace {
    grid-template-columns: 1fr;
  }

  .report-builder {
    position: static;
    max-height: none;
  }

  .report-results-body {
    min-height: 360px;
  }
}

@media (max-width: 900px) {
  .weved-topbar__inner {
    gap: 10px;
    padding: 8px 12px;
  }

  .weved-topbar__rate-chip {
    min-height: 30px;
    padding: 0 8px;
  }

  .weved-topbar__rate-code,
  .weved-topbar__rate-value {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 220px;
    --field-h: 34px;
    --btn-h: 34px;
  }

  .sidebar__link {
    font-size: 12px;
  }

  .section-card {
    padding: 12px;
    margin-bottom: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  label,
  .wrap label,
  .report-page label {
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .input-readonly,
  .select-input,
  .input-text,
  .input-date,
  .comment-input,
  .table :is(input, select, textarea) {
    font-size: 13px;
  }

  .table--wide,
  #itemsTable {
    width: max-content;
    min-width: var(--table-min-wide);
    font-size: 0.85em;
  }

  .table--wide th,
  .table--wide td,
  #itemsTable th,
  #itemsTable td {
    min-width: 120px;
    padding: 8px 6px;
    font-size: 11.5px;
  }

  .table thead th,
  .items-table thead th,
  .orders-table thead th,
  .report-table thead th {
    font-size: 10.5px;
    padding: 9px 6px;
    letter-spacing: 0.02em;
  }

  #addRowBtn {
    width: 100%;
    justify-content: center;
    text-align: center;
    margin-top: 16px;
  }

  .fs-body .section-card.is-fullscreen-items #addRowBtn {
    width: auto !important;
    margin-top: 0 !important;
  }

  .comments-column {
    width: 100%;
    padding: 10px 0;
    margin-bottom: 16px;
  }

  #commentsContent:not([hidden]) {
    grid-template-columns: 1fr 1fr;
  }

  .orders-table {
    font-size: 0.8rem;
    min-width: 480px;
  }

  .orders-table th,
  .orders-table td {
    padding: 8px 6px;
  }

  .loading-message {
    font-size: 12px;
    padding: 12px 0;
  }

  .report-page {
    gap: 14px;
  }

  .report-header {
    gap: 14px;
  }

  .report-page .page-title,
  #logisticStatusTitle {
    font-size: 19px;
  }

  .report-page .page-subtitle,
  #logisticStatusHint {
    font-size: 12px;
  }

  .report-page-actions,
  .report-header-stats {
    width: 100%;
  }

  .report-stat {
    flex: 1 1 0;
    min-width: 0;
  }

  .report-page .card-header,
  .report-page .card-body,
  .report-page .card-footer {
    padding: 12px;
  }

  .report-selected-summary-head,
  .report-results-header,
  .report-panel-toolbar-spread {
    flex-direction: column;
    align-items: stretch;
  }

  .report-builder-tabs,
  .page-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1px;
  }

  .report-tab-btn,
  .page-tab {
    flex: 1 0 auto;
  }

  .report-filter-grid,
  .report-filter-range {
    grid-template-columns: 1fr;
  }

  .report-filter-span-2 {
    grid-column: auto;
  }

  .report-page .btn {
    min-height: 34px;
    font-size: 12px;
  }

  .report-table tbody td {
    min-width: 110px;
    font-size: 11px;
    padding: 8px 8px;
  }

  .modal-window {
    width: 95%;
    padding: 20px;
  }

  .wrap {
    padding: 22px;
  }

  .wrap h1 {
    font-size: 20px;
  }

  .scroll-nav__btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .scroll-nav__icon {
    font-size: 15px;
  }

  .fs-modal button {
    width: auto;
  }
}

@media (max-width: 720px) {
  .weved-topbar__center {
    justify-content: flex-start;
  }

  .weved-topbar__user {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 8px;
  }

  .section-card {
    padding: 10px;
  }

  .input-text,
  .select-input,
  .input-readonly,
  .input-date,
  .comment-input {
    font-size: 12px;
    padding: 7px 10px;
  }

  #itemsTable th,
  #itemsTable td,
  .table--wide th,
  .table--wide td {
    padding: 6px 4px;
    font-size: 0.75rem;
  }

  .login-card,
  .wrap {
    padding: 20px;
  }

  .login-title,
  .wrap h1 {
    font-size: 20px;
  }

  .button-tile {
    padding: 20px 16px;
    font-size: 14px;
  }

  .table-container.orders {
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .orders-table {
    min-width: 320px;
    font-size: 0.75rem;
  }

  .orders-table th,
  .orders-table td {
    padding: 6px 4px;
  }

  .btn-upload {
    width: 100%;
    align-self: center;
  }

  .report-page .page-title {
    font-size: 17px;
  }

  .report-page .page-subtitle {
    font-size: 11px;
  }

  .report-page .input-text {
    min-height: 34px;
    font-size: 12px;
    padding: 7px 10px;
  }

  .report-field-label {
    font-size: 12px;
  }

  .report-chip {
    font-size: 11px;
  }

  .report-table tbody td {
    max-width: 240px;
  }

  #commentsContent:not([hidden]) {
    grid-template-columns: 1fr;
  }
}


/* Premium palette override */
:root {
  --bg-0: #070a0f;
  --bg-1: #0c1118;
  --bg-2: #121924;
  --surface-0: rgba(13, 17, 23, 0.96);
  --surface-1: rgba(18, 23, 31, 0.92);
  --surface-2: rgba(24, 30, 39, 0.90);
  --surface-3: rgba(34, 42, 53, 0.76);
  --surface-soft: rgba(255, 255, 255, 0.028);
  --text-1: #eef2f7;
  --text-2: rgba(238, 242, 247, 0.82);
  --text-3: rgba(238, 242, 247, 0.58);
  --text-4: rgba(238, 242, 247, 0.38);
  --line-1: rgba(128, 145, 168, 0.18);
  --line-2: rgba(145, 163, 186, 0.28);
  --line-3: rgba(166, 184, 206, 0.40);
  --accent: #b6915f;
  --accent-strong: #d2b17b;
  --accent-soft: rgba(182, 145, 95, 0.12);
  --accent-soft-2: rgba(182, 145, 95, 0.18);
  --accent-glow: rgba(182, 145, 95, 0.16);
  --success: #8db89d;
  --warning: #d0a562;
  --danger: #d58f89;
  --shadow-1: 0 14px 30px rgba(0, 0, 0, 0.24);
  --shadow-2: 0 22px 54px rgba(0, 0, 0, 0.34);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --focus-ring: 0 0 0 1px rgba(182, 145, 95, 0.35), 0 0 0 4px rgba(182, 145, 95, 0.12);
  --fs-panel-bg: rgba(14, 18, 24, 0.985);
}

body {
  background:
    radial-gradient(circle at 0% 0%, rgba(182, 145, 95, 0.06), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(110, 129, 156, 0.08), transparent 26%),
    linear-gradient(180deg, #161d28 0%, #0f141d 24%, #070a0f 100%);
}

a:hover {
  color: #d6bb8f;
}

.section-card,
.login-card,
.wrap,
.report-page .card,
.modal-window {
  background:
    linear-gradient(180deg, rgba(24, 30, 39, 0.95) 0%, rgba(16, 21, 29, 0.98) 100%);
  border-color: var(--line-1);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sidebar,
.weved-topbar {
  background: rgba(10, 13, 18, 0.95);
  border-color: var(--line-1);
}

.sidebar {
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0.20);
}

.sidebar__brand,
.weved-topbar__rate-chip,
.sidebar__link,
.page-tab,
.report-tab-btn,
.report-group-card,
.report-selected-summary,
.logisticstatus-pill {
  background: rgba(255, 255, 255, 0.03);
}

.sidebar__brand {
  color: var(--accent);
  border-color: var(--line-1);
  box-shadow: none;
}

.sidebar__link {
  color: var(--text-2);
  border-color: transparent;
}

.sidebar__link:hover,
.sidebar__link.is-active {
  color: var(--text-1);
  background: linear-gradient(180deg, rgba(182, 145, 95, 0.12), rgba(182, 145, 95, 0.07));
  border-color: rgba(182, 145, 95, 0.18);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.weved-topbar__brand,
.section-title,
.login-title,
.modal-title,
.report-page .page-title,
.report-page .card-title,
.report-section-title,
#logisticStatusTitle {
  color: var(--text-1);
}

.weved-topbar__logout,
.btn-action,
#addRowBtn,
#deleteRowBtn,
#attachmentsFileInput,
#addCargoPlaceRowBtn,
#addCargoPlaceRowBtn-tab2,
#deleteCargoPlaceRowBtn,
#deleteCargoPlaceRowBtn-tab2,
#findInfoOpenAi,
#findAnalogAndOpenAi,
#exportToFileBtn,
#importFromFileBtn,
#checkSupplierOfferArchiveBtn,
#deleteServiceRowBtn,
#addServiceRowBtn,
#findAnalog,
#mergeButton,
#requestFinoutBtn,
#loadFromFileBtn,
.btn-upload,
.report-page .btn {
  color: var(--text-1);
  border-color: var(--line-1);
  background:
    linear-gradient(180deg, rgba(49, 57, 69, 0.94), rgba(32, 38, 48, 0.98));
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.weved-topbar__logout:hover,
.btn-action:hover,
#addRowBtn:hover,
#deleteRowBtn:hover,
#attachmentsFileInput:hover,
#addCargoPlaceRowBtn:hover,
#addCargoPlaceRowBtn-tab2:hover,
#deleteCargoPlaceRowBtn:hover,
#deleteCargoPlaceRowBtn-tab2:hover,
#findInfoOpenAi:hover,
#findAnalogAndOpenAi:hover,
#exportToFileBtn:hover,
#importFromFileBtn:hover,
#checkSupplierOfferArchiveBtn:hover,
#deleteServiceRowBtn:hover,
#addServiceRowBtn:hover,
#findAnalog:hover,
#mergeButton:hover,
#requestFinoutBtn:hover,
#loadFromFileBtn:hover,
.btn-upload:hover,
.report-page .btn:hover {
  background:
    linear-gradient(180deg, rgba(58, 67, 81, 0.96), rgba(37, 43, 55, 0.99));
  border-color: var(--line-2);
  box-shadow:
    0 14px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.save-btn,
.wrap button,
.report-page .btn-primary,
#mergeButton,
#requestFinoutBtn {
  color: #15110b;
  border-color: rgba(182, 145, 95, 0.28);
  background:
    linear-gradient(180deg, #c5a16e 0%, #a37d4b 100%);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.22),
    0 6px 14px rgba(121, 89, 49, 0.18),
    inset 0 1px 0 rgba(255, 244, 227, 0.30);
}

.save-btn:hover,
.wrap button:hover,
.report-page .btn-primary:hover,
#mergeButton:hover,
#requestFinoutBtn:hover {
  background:
    linear-gradient(180deg, #cfad7e 0%, #b18a59 100%);
  border-color: rgba(210, 177, 123, 0.34);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.26),
    0 8px 18px rgba(121, 89, 49, 0.20),
    inset 0 1px 0 rgba(255, 244, 227, 0.34);
}

.report-page .btn-secondary,
.weved-topbar__rate-chip,
.page-tab,
.report-tab-btn,
.report-chip,
.report-field-option,
.report-group-summary,
.report-empty-state,
.file-info,
.logisticstatus-table-wrap,
.table-container.orders,
.table-container,
.report-table-wrap {
  border-color: var(--line-1);
  background-color: rgba(255, 255, 255, 0.03);
}

.report-page .btn-secondary {
  color: var(--text-1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
}

.report-page .btn-secondary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
  border-color: var(--line-2);
}

.input-readonly,
.select-input,
.input-text,
.input-date,
.comment-input,
.wrap input,
.report-page .input-text,
.table :is(input, select, textarea) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border-color: var(--line-1);
}

.input-readonly {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
}

.input-text:focus,
.input-date:focus,
.select-input:focus,
.comment-input:focus,
.wrap input:focus,
.report-page .input-text:focus,
.table :is(input, select, textarea):focus {
  background: linear-gradient(180deg, rgba(28, 34, 43, 0.96), rgba(20, 25, 33, 0.98));
  border-color: rgba(182, 145, 95, 0.28);
  box-shadow: var(--focus-ring);
}

.section-title::after,
.report-loading-spinner {
  background: linear-gradient(90deg, var(--accent) 0%, rgba(182, 145, 95, 0) 100%);
}

.table,
.report-table,
.table-container.orders,
.report-table-wrap {
  border-color: var(--line-1);
}

.table thead th,
.report-table thead th {
  background: linear-gradient(180deg, rgba(27, 31, 39, 0.98), rgba(19, 23, 30, 0.98));
  color: rgba(238, 242, 247, 0.76);
  border-right-color: rgba(128, 145, 168, 0.12);
  border-bottom-color: rgba(128, 145, 168, 0.18);
}

.table td,
.report-table tbody td {
  border-right-color: rgba(128, 145, 168, 0.08);
  border-bottom-color: rgba(128, 145, 168, 0.08);
}

.table tbody tr:nth-child(even),
.report-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover,
.report-table tbody tr:hover {
  background: rgba(132, 148, 171, 0.06);
}

.page-tabs,
.report-builder-tabs {
  border-bottom-color: var(--line-1);
}

.page-tab,
.report-tab-btn {
  color: var(--text-2);
  border-color: var(--line-1);
  box-shadow: none;
}

.page-tab:hover,
.report-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-2);
}

.page-tab[aria-selected="true"],
.report-tab-btn.is-active {
  color: var(--text-1);
  background: rgba(182, 145, 95, 0.10);
  border-color: rgba(182, 145, 95, 0.20);
  box-shadow: none;
}

.invoice-diff-cell {
  background-color: rgba(169, 75, 59, 0.20);
  color: #ffd8cf;
}

.invoice-match-cell {
  background-color: rgba(142, 177, 138, 0.14);
}

.invoice-compare-status--ok {
  color: #a8d1b2;
}

.invoice-compare-status--bad {
  color: #efb0a6;
}

.ai-filled-by-openai {
  background: rgba(182, 145, 95, 0.12) !important;
  border-color: rgba(182, 145, 95, 0.28) !important;
  color: #ead7b6 !important;
}

#reportErrorBox,
.logisticstatus-pill.err {
  border-color: rgba(217, 138, 131, 0.34);
  background: rgba(120, 43, 37, 0.22);
  color: #ffd3ce;
}

.logisticstatus-pill.ok {
  color: #b8d9be;
}

.logisticstatus-pill.muted,
.field-hint,
.report-page .page-subtitle,
#logisticStatusHint {
  color: var(--text-3);
}

/* Commercial offer builder */
.co-builder-page {
  width: 100%;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.co-builder-page__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.co-builder-page__title {
  margin: 0;
  color: var(--text-1);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.co-builder-page__subtitle {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.45;
}

.co-builder-page__section {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}

.co-builder-page__alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.04);
}

.co-builder-page__alert--error {
  border-color: rgba(217, 138, 131, 0.34);
  background: rgba(120, 43, 37, 0.22);
  color: #ffd3ce;
}

.co-builder-page__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px 18px;
  width: 100%;
  min-width: 0;
}

.co-builder-page__form-group--wide {
  grid-column: 1 / -1;
}

.co-builder-page__textarea {
  min-height: 120px;
  resize: vertical;
}

.co-builder-page__checkbox-grid {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px 12px;
}

.co-builder-page__checkbox {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.co-builder-page__checkbox:hover {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.05);
}

.co-builder-page__checkbox.is-required {
  border-color: rgba(182, 145, 95, 0.20);
  background: rgba(182, 145, 95, 0.08);
}

.co-builder-page__checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.co-builder-page__checkbox-text {
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
}

.co-builder-page__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.co-builder-page__status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.co-builder-page__badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 700;
}

.co-builder-page__badge.is-success {
  color: #b8d9be;
  border-color: rgba(136, 182, 154, 0.30);
  background: rgba(136, 182, 154, 0.12);
}

.co-builder-page__badge.is-error {
  color: #ffd3ce;
  border-color: rgba(217, 138, 131, 0.34);
  background: rgba(120, 43, 37, 0.22);
}

@media (max-width: 900px) {
  .co-builder-page__form-grid {
    grid-template-columns: 1fr;
  }

  .co-builder-page__form-group--wide {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .co-builder-page__title {
    font-size: 20px;
  }

  .co-builder-page__checkbox-grid {
    grid-template-columns: 1fr;
  }

  .co-builder-page__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .co-builder-page__actions .btn-action {
    width: 100%;
  }
}

.weved-topbar__notifications {
  position: relative;
  flex: 0 0 auto;
}

.weved-topbar__notif-btn {
  position: relative;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.weved-topbar__notif-btn:hover {
  background: rgba(182, 145, 95, 0.10);
  border-color: rgba(182, 145, 95, 0.22);
}

.weved-topbar__notif-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: currentColor;
  line-height: 1;
}

.weved-topbar__notif-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.weved-topbar__notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff7d7d 0%, #c62828 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(198, 40, 40, 0.30);
}

.weved-topbar__notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(29, 34, 43, 0.98), rgba(17, 20, 27, 0.99));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  z-index: 1100;
}

.weved-topbar__notif-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-1);
  background: rgba(17, 20, 27, 0.98);
}

.weved-topbar__notif-title {
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
}

.weved-topbar__notif-enable {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.weved-topbar__notif-enable:hover:not(:disabled) {
  background: rgba(182, 145, 95, 0.10);
  border-color: rgba(182, 145, 95, 0.22);
}

.weved-topbar__notif-enable:disabled {
  opacity: 0.65;
  cursor: default;
}

.weved-topbar__notif-list {
  display: flex;
  flex-direction: column;
}

.weved-topbar__notif-empty {
  padding: 16px 14px;
  color: var(--text-3);
  font-size: 13px;
}

.weved-topbar__notif-item {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-1);
  background: transparent;
}

.weved-topbar__notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.weved-topbar__notif-item.is-unseen {
  background: linear-gradient(180deg, rgba(182, 145, 95, 0.08), rgba(255, 255, 255, 0.03));
}

.weved-topbar__notif-item-title {
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.weved-topbar__notif-item-body {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.4;
}

.weved-topbar__notif-item-meta {
  margin-top: 6px;
  color: var(--text-4);
  font-size: 12px;
  line-height: 1.3;
}

.weved-notification-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(29, 34, 43, 0.98), rgba(17, 20, 27, 0.99));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  z-index: 1200;
  cursor: pointer;
}

.weved-notification-toast__title {
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.3;
}

.weved-notification-toast__body {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.4;
}
.weved-topbar__notif-item-main {
  display: block;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}

.weved-topbar__notif-item:hover .weved-topbar__notif-item-main {
  background: rgba(255, 255, 255, 0.03);
}

.weved-topbar__notif-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.weved-topbar__notif-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.weved-topbar__notif-close:hover {
  color: var(--text-1);
  background: rgba(182, 145, 95, 0.10);
  border-color: rgba(182, 145, 95, 0.22);
}

.weved-topbar__notif-badge[hidden],
.weved-topbar__notif-panel[hidden],
.weved-topbar__notif-empty[hidden],
.weved-topbar__notif-list[hidden] {
  display: none !important;
}

.carrier-reward-builder-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.carrier-reward-builder-page__head {
  margin-bottom: 20px;
}

.carrier-reward-builder-page__title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
}

.carrier-reward-builder-page__subtitle {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1.5;
}

.carrier-reward-builder-page__section {
  margin-bottom: 20px;
}

.carrier-reward-builder-page__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  gap: 16px 20px;
}

.carrier-reward-builder-page__actions,
.carrier-reward-builder-page__table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.carrier-reward-builder-page__status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carrier-reward-builder-page__badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-1);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.carrier-reward-builder-page__badge.is-success {
  background: rgba(82, 140, 105, 0.16);
  color: #b9d8c2;
}

.carrier-reward-builder-page__badge.is-error {
  background: rgba(136, 56, 61, 0.20);
  color: #f1b9b2;
}

.carrier-reward-builder-page__alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.carrier-reward-builder-page__alert--error {
  background: rgba(104, 43, 45, 0.16);
  border: 1px solid rgba(213, 143, 137, 0.22);
  color: #f1b9b2;
}

.carrier-reward-builder-page__alert--success {
  background: rgba(82, 140, 105, 0.14);
  border: 1px solid rgba(141, 184, 157, 0.20);
  color: #b9d8c2;
}

.carrier-reward-builder-page__note {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.carrier-reward-builder-page__table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.carrier-reward-builder-page__table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
}

.carrier-reward-builder-page__table th,
.carrier-reward-builder-page__table td {
  border: 1px solid rgba(128, 145, 168, 0.14);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.carrier-reward-builder-page__table th {
  background: rgba(21, 26, 34, 0.98);
  font-size: 13px;
  font-weight: 700;
}

.carrier-reward-builder-page__table .input-text,
.carrier-reward-builder-page__table .select-input {
    min-width: 120px;
    width: 100%;
  }

.transportpartner-inline-select {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.transportpartner-inline-select .select-input {
    flex: 1 1 auto;
    min-width: 0;
}

.transportpartner-inline-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 42px;
    padding: 0 12px;
}

.transportpartner-inline-error,
.transportpartner-modal__error {
    color: #ffb6ae;
    font-size: 12px;
    line-height: 1.4;
}

.transportpartner-modal {
    width: min(780px, calc(100vw - 24px));
    max-width: 780px;
    max-height: calc(100vh - 24px);
    box-sizing: border-box;
}

.transportpartner-modal__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 150px);
    overflow: auto;
}

.transportpartner-modal__section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transportpartner-modal__section-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transportpartner-modal__hint {
    color: rgba(235, 239, 244, 0.72);
    font-size: 12px;
    line-height: 1.4;
}

.transportpartner-candidate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transportpartner-candidate {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(182, 145, 95, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.transportpartner-candidate--selected {
    border-color: rgba(182, 145, 95, 0.28);
    background: rgba(109, 84, 52, 0.16);
}

.transportpartner-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .transportpartner-inline-select {
        flex-wrap: wrap;
    }

    .transportpartner-inline-select .select-input {
        flex-basis: 100%;
    }

    .transportpartner-modal {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    }

    .transportpartner-candidate {
        flex-direction: column;
        align-items: stretch;
    }

    .transportpartner-modal__actions .btn-action,
    .transportpartner-inline-btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
  .carrier-reward-builder-page__form-grid {
    grid-template-columns: 1fr;
  }
}

/* Theme toggle */
.weved-topbar__theme-toggle {
  min-width: 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line-1);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(51, 59, 71, 0.92), rgba(31, 37, 47, 0.98));
  color: var(--text-1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.weved-topbar__theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 145, 95, 0.18);
  background: linear-gradient(180deg, rgba(59, 68, 81, 0.96), rgba(38, 44, 55, 0.99));
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.weved-topbar__theme-toggle:active {
  transform: translateY(0);
}

.weved-topbar__theme-toggle:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.weved-topbar__theme-toggle.is-saving {
  border-color: var(--line-2);
}

.weved-topbar__theme-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(182, 145, 95, 0.14), rgba(182, 145, 95, 0.08));
  border-color: rgba(182, 145, 95, 0.24);
}

.weved-topbar__theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-inset);
}

.weved-topbar__theme-icon {
  width: 18px;
  height: 18px;
  display: none;
  flex: 0 0 auto;
  color: currentColor;
}

.weved-topbar__theme-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.weved-topbar__theme-icon--dark {
  display: inline-flex;
}

.weved-topbar__theme-icon--dark path {
  fill: currentColor;
}

.weved-topbar__theme-icon--light circle,
.weved-topbar__theme-icon--light path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="light"] .weved-topbar__theme-icon--dark {
  display: none;
}

html[data-theme="light"] .weved-topbar__theme-icon--light {
  display: inline-flex;
}

html:not([data-theme="light"]) .weved-topbar__theme-icon--light {
  display: none;
}

html[data-theme="light"] .weved-topbar__theme-toggle {
  border-color: rgba(24, 36, 52, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 250, 0.94));
  color: #223a5a;
  box-shadow:
    0 10px 24px rgba(24, 36, 52, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .weved-topbar__theme-toggle:hover {
  border-color: rgba(34, 58, 90, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(236, 242, 248, 0.95));
}

html[data-theme="light"] .weved-topbar__theme-toggle[aria-pressed="true"] {
  border-color: rgba(34, 58, 90, 0.16);
  background: linear-gradient(180deg, rgba(236, 241, 246, 0.96), rgba(247, 250, 252, 0.94));
  color: #223a5a;
}

html[data-theme="light"] .weved-topbar__theme-toggle.is-saving {
  border-color: rgba(34, 58, 90, 0.2);
}

html[data-theme="light"] .weved-topbar__theme-toggle:focus-visible {
  box-shadow:
    0 0 0 3px rgba(34, 58, 90, 0.14),
    0 10px 24px rgba(24, 36, 52, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.weved-topbar__theme-toggle-text {
  display: none !important;
}

.weved-topbar__theme-toggle[aria-pressed="true"] .weved-topbar__theme-toggle-text {
  color: var(--text-1);
}

@media (max-width: 900px) {
  .weved-topbar__theme-toggle {
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .weved-topbar__theme-toggle-text {
    display: none;
  }
}
