/* NPK corporate UI: management reporting and Tender Pulse shell;
   Client Base Pulse typography, cards and controls. See docs/VISUAL-STYLE.md. */
@font-face {
  font-family: Geologica;
  src: url("/brand/geologica.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ink: #121e35;
  --muted: #626c7c;
  --bg: #edf2f6;
  --surface: #fff;
  --surface-sunken: #f5f7f9;
  --line: #d5dfea;
  --gold: #b79857;
  --gold-ink: #805a32;
  --gold-soft: #f6eedf;
  --green: #18724f;
  --green-bg: #e4f2eb;
  --warn-bg: #fff1db;
  --red: #913b32;
  --red-bg: #fcece9;
  --radius: 14px;
  --sidebar: 232px;
  --masthead: 84px;
  --navy-fg: #c2ccdb;
  --navy-hover: #1c2940;
  --navy-active: #2b3950;
  --gold-light: #e9d4a7;
  --chart-found: #548b6b;
  --chart-not-found: #cf92a0;
  --chart-other: #a6b3c1;
  font:
    16px/1.55 Geologica,
    system-ui,
    -apple-system,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--ink);
  color-scheme: light;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
summary {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: var(--gold-ink);
  text-underline-offset: 3px;
}
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  font-weight: 560;
  line-height: 1.25;
  letter-spacing: -0.8px;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 18px;
  font-weight: 550;
  line-height: 1.4;
}
h3 {
  font-size: 15px;
  font-weight: 550;
}
strong,
b {
  font-weight: 550;
}
small {
  font-size: 12px;
}
svg {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--gold-ink);
  margin-bottom: 10px;
}
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 450;
}
.button:hover {
  background: var(--surface-sunken);
}
.button.primary {
  background: var(--gold-ink);
  border-color: var(--gold-ink);
  color: #fff;
}
.button.primary:hover {
  background: #6c4b29;
  border-color: #6c4b29;
}
.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold-ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 50;
  padding: 12px 18px;
  background: #fff;
  border-radius: 8px;
}
.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.corporate-topbar {
  min-height: var(--masthead);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.corporate-identity {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.brand {
  flex-shrink: 0;
}
.brand img {
  display: block;
  width: 104px;
  height: 60px;
  object-fit: contain;
}
.corporate-product {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
.corporate-product > span {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold-ink);
  margin-bottom: 3px;
}
.corporate-product > strong {
  display: block;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.6px;
  overflow-wrap: anywhere;
}
.corporate-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.corporate-user strong {
  display: block;
  font-size: 14px;
}
.corporate-user small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.corporate-user #logout {
  margin-left: 12px;
  color: var(--muted);
  min-height: 44px;
}
.user-avatar {
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-size: 14px;
}
.pilot-layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100dvh - var(--masthead));
}
.pilot-nav {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  padding: 24px 12px;
  background: var(--ink);
  color: var(--navy-fg);
}
.nav-caption {
  font-size: 12px;
  letter-spacing: 1px;
  color: #d5bc8b;
  margin: 0 12px 18px;
}
.pilot-nav nav {
  display: grid;
  gap: 4px;
}
.pilot-nav nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--navy-fg);
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
}
.pilot-nav nav button:hover {
  background: var(--navy-hover);
  color: #fff;
}
.pilot-nav nav button.active {
  background: var(--navy-active);
  color: var(--gold-light);
  box-shadow: inset 3px 0 var(--gold);
}
.pilot-nav nav button.active svg {
  color: var(--gold-light);
}
.pilot-nav nav button[data-page="imports"] {
  margin-top: 16px;
}
.sidebar-bottom {
  margin: auto 12px 0;
  padding-top: 24px;
  font-size: 12px;
}
.sidebar-bottom p {
  border-top: 1px solid #344157;
  padding-top: 16px;
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--navy-fg);
}
.pilot-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--muted);
}
.sidebar-bottom .pilot-indicator {
  border-color: #46556c;
  color: var(--gold-light);
}
.workspace {
  min-width: 0;
}
.pilot-main {
  width: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: 30px 32px 24px;
  min-width: 0;
}
.pilot-main > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.pilot-main h1 {
  margin: 8px 0 10px;
}
.pilot-main > header p {
  font-size: 14px;
  max-width: 760px;
}
.pilot-main > header #back {
  display: block;
  margin: 0 0 20px;
  color: var(--muted);
}
.pilot-main > header > .button {
  flex-shrink: 0;
}
.pilot-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 3px 12px #121e3503;
}
.pilot-card h2,
.pilot-card h3 {
  margin-bottom: 12px;
}
.pilot-card p {
  line-height: 1.65;
}
.item-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.item-title h2 {
  font-size: 17px;
  margin-bottom: 8px;
}
.item-title .muted {
  font-size: 12px;
}
.badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff2f6;
  color: var(--muted);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1.4;
}
.badge.ready,
.badge[data-status="Найдена"] {
  background: var(--green-bg);
  color: var(--green);
}
.badge.wait,
.badge[data-status="На уточнении"],
.badge[data-status="Ждём поставщика"] {
  background: var(--warn-bg);
  color: var(--gold-ink);
}
.badge[data-status="Не найдена"] {
  background: var(--red-bg);
  color: var(--red);
}
.badge[data-status="В поиске"] {
  background: #eaf0f9;
  color: #3b5e88;
}
.filters-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.filters-row input {
  flex: 1;
  min-width: 160px;
}
.filters-row select {
  max-width: 230px;
}
.pilot-main input,
.pilot-main select,
.pilot-main textarea,
.login input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
.pilot-main input::placeholder,
.login input::placeholder {
  color: #7f8793;
}
.pilot-main textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.6;
}
.pilot-main label,
.login label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}
.pilot-main select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%23626c7c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-size: 12px 12px;
  background-repeat: no-repeat;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-grid > * {
  min-width: 0;
}
.pilot-main input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--ink);
}
.pilot-main label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pilot-main > .form-actions {
  margin-top: 0;
}
.scroll {
  overflow: auto;
  max-width: 100%;
}
.offers-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  margin: 20px 0;
  text-align: left;
}
.offers-table th {
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.offers-table td {
  padding: 15px 14px;
  font-size: 14px;
  border-bottom: 1px solid #e8edf2;
  vertical-align: middle;
}
.offers-table tbody tr:last-child td {
  border-bottom: 0;
}
.offers-table tbody tr:hover {
  background: #fcfbf8;
}
.offer-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.offer-form summary {
  color: var(--gold-ink);
  font-size: 13px;
}
.offer-form form {
  border-top: 0;
  padding-top: 0;
}
.offer-form + .muted {
  font-size: 12px;
  margin-top: 10px;
}
.next {
  background: var(--surface-sunken);
  border: 1px solid #e8edf2;
  border-radius: 8px;
  padding: 13px 16px;
  margin: 18px 0;
  font-size: 13px;
}
.next strong {
  display: block;
  margin-bottom: 3px;
}
.question {
  border: 1px solid #dbcbab;
  border-left: 3px solid var(--gold);
  background: #fffaf0;
  border-radius: 0 8px 8px 0;
  color: var(--gold-ink);
  padding: 14px 16px;
  margin: 16px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.question p {
  margin-top: 5px;
}
.request-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.request-link > div {
  min-width: 0;
}
.request-link .text-button {
  font-size: 16px;
  font-weight: 550;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.request-link .text-button:hover {
  color: var(--gold-ink);
}
.request-link .muted {
  margin-top: 6px;
  font-size: 12px;
}
.item-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid #e8edf2;
}
.item-summary:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.item-summary > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.item-summary small {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
}
.history details {
  padding: 13px 0;
  border-bottom: 1px solid #e8edf2;
}
.history details:last-child {
  border-bottom: 0;
}
.history summary {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font:
    12px/1.65 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  background: var(--surface-sunken);
  color: var(--ink);
}
.note {
  border-bottom: 1px solid #e8edf2;
  padding: 16px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#note-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
#note-form .button {
  justify-self: start;
}
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin: 30px 0 0;
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.preview-counts {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.queue-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.queue-filters input[type="checkbox"] {
  width: 17px;
  flex: 0 0 17px;
}
.pilot-main details > summary {
  cursor: pointer;
}
#message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 20px #121e3526;
  font-size: 13px;
  z-index: 40;
}
#message.error {
  background: var(--red);
}
dialog#conflict {
  width: min(850px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink);
}
dialog#conflict h2 {
  margin-bottom: 12px;
}
dialog#conflict > p {
  color: var(--muted);
  font-size: 13px;
}
dialog::backdrop {
  background: #121e3566;
}
#comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
#comparison > div {
  min-width: 0;
}
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 48px 20px 24px;
}
.login-brand {
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: auto 0 28px;
}
.login-brand img {
  width: 128px;
  height: 70px;
  object-fit: contain;
}
.login-brand span {
  border-left: 1px solid var(--line);
  padding-left: 24px;
  color: var(--muted);
  font-size: 12px;
}
.login {
  width: 100%;
  max-width: 460px;
  padding: 32px;
  margin: 0;
}
.login h1 {
  font-size: 26px;
  margin-bottom: 12px;
}
.login > p {
  font-size: 13px;
}
.login form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}
.login form .button {
  margin-top: 4px;
}
.login-demo {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}
.login-demo small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 12px;
}
.login-footer {
  margin: 28px 0 auto;
  padding-top: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 1100px) {
  .item-title {
    flex-wrap: wrap;
  }
  .corporate-topbar {
    padding-inline: 24px;
  }
  .corporate-identity {
    gap: 18px;
  }
  .corporate-product {
    padding-left: 18px;
  }
  .corporate-product > strong {
    font-size: 20px;
  }
  .pilot-main {
    padding: 26px 24px;
  }
}
@media (max-width: 900px) {
  .pilot-layout {
    grid-template-columns: 1fr;
  }
  .pilot-nav {
    height: auto;
    position: static;
    padding: 10px 16px;
  }
  .nav-caption,
  .sidebar-bottom {
    display: none;
  }
  .pilot-nav nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
  }
  .pilot-nav nav button {
    width: auto;
    flex-shrink: 0;
    padding: 10px 12px;
  }
  .pilot-nav nav button[data-page="imports"] {
    margin-top: 0;
  }
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .item-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  #comparison {
    grid-template-columns: 1fr;
  }
  .corporate-topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
  }
  .corporate-user {
    margin-left: auto;
  }
  .brand img {
    width: 90px;
    height: 52px;
  }
  .pilot-main input,
  .pilot-main select,
  .pilot-main textarea,
  .login input {
    font-size: 16px;
  }
}
@media (max-width: 540px) {
  .corporate-topbar {
    padding: 12px 16px;
    gap: 10px;
  }
  .corporate-identity {
    gap: 14px;
    width: 100%;
  }
  .brand img {
    width: 76px;
    height: 46px;
  }
  .corporate-product {
    padding-left: 14px;
  }
  .corporate-product > span {
    font-size: 12px;
    letter-spacing: 0;
  }
  .corporate-product > strong {
    font-size: 18px;
  }
  .corporate-user {
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .corporate-user #logout {
    margin-left: auto;
  }
  .user-avatar {
    width: 32px;
    height: 32px;
  }
  .pilot-nav {
    padding-inline: 12px;
  }
  .pilot-nav nav button {
    padding: 10px;
    font-size: 14px;
    gap: 8px;
  }
  .pilot-nav nav svg {
    width: 17px;
    height: 17px;
  }
  .pilot-main {
    padding: 24px 16px;
  }
  .pilot-main > header {
    flex-direction: column;
    gap: 16px;
  }
  h1 {
    font-size: 25px;
  }
  .pilot-card {
    padding: 20px 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .item-title {
    gap: 12px;
  }
  .badges {
    flex-shrink: 1;
    gap: 6px;
  }
  .filters-row {
    gap: 10px;
  }
  .filters-row #search {
    flex-basis: 100%;
  }
  .filters-row select {
    flex: 1;
    max-width: none;
    min-width: 0;
  }
  .button,
  input,
  select {
    min-height: 44px;
  }
  .request-link {
    align-items: flex-start;
  }
  .request-link > .button {
    flex-shrink: 0;
  }
  .request-link .text-button {
    font-size: 15px;
  }
  .form-actions {
    justify-content: flex-start;
  }
  .form-actions .button {
    max-width: 100%;
  }
  .footer-note {
    flex-direction: column;
    gap: 6px;
  }
  .login-page {
    padding: 28px 16px;
  }
  .login-brand {
    gap: 18px;
  }
  .login-brand img {
    width: 110px;
    height: 60px;
  }
  .login-brand span {
    padding-left: 18px;
    font-size: 12px;
  }
  .login {
    padding: 26px 22px;
  }
  .login h1 {
    font-size: 24px;
  }
  .login .eyebrow {
    font-size: 12px;
    letter-spacing: 1px;
  }
  dialog#conflict {
    padding: 22px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Original portal sections, restored over the shared PostgreSQL API. */
.portal-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 20px 0 24px;
}
.portal-filters label {
  flex: 1;
  min-width: 130px;
}
.portal-filters label:nth-child(3) {
  flex: 1.5;
}
.portal-filters .text-button {
  min-height: 40px;
  padding: 8px;
}
.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}
.stat-card > span {
  font-size: 14px;
  color: var(--muted);
}
.stat-card > strong {
  font-size: 30px;
  font-weight: 520;
  line-height: 1.2;
}
.stat-card > small {
  font-size: 12px;
  color: var(--muted);
}
.stat-card.featured {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  box-shadow: inset 0 3px var(--gold);
}
.stat-card.featured > span,
.stat-card.featured > small {
  color: #c3cad6;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, 1fr);
  gap: 20px;
}
.overview-grid > * {
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.panel-heading .muted {
  font-size: 12px;
}
.chart-scroll {
  overflow: auto;
  max-width: 100%;
  margin: 20px 0 0;
}
.month-chart {
  display: block;
  width: 100%;
  min-width: 620px;
  height: 230px;
  max-width: none;
}
.month-bar {
  fill: var(--gold);
}
.chart-label,
.chart-value {
  text-anchor: middle;
  font-family: inherit;
  font-size: 12px;
  fill: var(--muted);
}
.chart-value {
  fill: var(--ink);
  font-weight: 500;
}
.search-breakdown > div,
.quality-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.readiness-total {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
}
.readiness-total strong {
  font-size: 28px;
  color: var(--green);
}
.readiness-total span {
  color: var(--muted);
  font-size: 12px;
}
.small-copy {
  font-size: 12px;
  margin-top: 16px !important;
  line-height: 1.7;
}
.portal-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.portal-table th {
  font-size: 14px;
  color: var(--muted);
  font-weight: 450;
  background: #f8fafc;
  padding: 13px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.portal-table td {
  padding: 16px 14px;
  border-bottom: 1px solid #e8edf2;
  vertical-align: middle;
  max-width: 380px;
  overflow-wrap: anywhere;
}
.portal-table tbody tr:last-child td {
  border-bottom: 0;
}
.portal-table small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.portal-table .text-button {
  text-align: left;
}
.portal-table tbody tr:hover {
  background: #fcfbf8;
}
.nowrap {
  white-space: nowrap;
}
.registry-card {
  padding: 0;
  overflow: hidden;
}
.registry-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.registry-toolbar > input {
  flex: 1;
  min-width: 180px;
}
.registry-toolbar > select {
  max-width: 210px;
}
.registry-card > .small-copy {
  padding: 0 20px 16px;
}
.registry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.registry-footer > div {
  display: flex;
  gap: 8px;
}
.inline-check {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  white-space: nowrap;
}
.integration-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.integration-cards p {
  font-size: 13px;
  margin: 16px 0;
}
.integration-cards .button {
  margin: 10px 0;
}
.integration-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 17px;
}
.note > small {
  display: block;
}
.catalog-notice {
  border-color: #dbcbab;
  background: #fffaf0;
}
.catalog-hint {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  margin: 16px 0;
  font-size: 12px;
  color: var(--muted);
}
.catalog-hint small {
  display: block;
  margin-top: 5px;
}
.source-details {
  margin: 16px 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.source-details summary {
  color: var(--gold-ink);
}
.source-grid {
  padding-top: 12px;
  display: grid;
  gap: 9px;
}
.catalog-detail-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  margin: 20px 0 26px;
}
.catalog-detail-grid p {
  margin: 12px 0;
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  min-height: 180px;
  padding: 20px;
  border: 1px dashed #c9d3de;
  background: var(--surface-sunken);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}
#page-dialog {
  width: min(850px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  color: var(--ink);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
#page-dialog-content {
  min-width: 0;
}
#page-dialog-content > .button {
  margin: 5px 0;
}
#page-dialog-content > .rfq-text {
  width: 100%;
  min-height: 400px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  resize: vertical;
  font:
    13px/1.7 ui-monospace,
    monospace;
}
@media (max-width: 1150px) {
  .portal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .integration-cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 850px) {
  .portal-filters {
    gap: 10px;
    padding: 16px;
  }
  .portal-filters label {
    flex-basis: calc(50% - 12px);
  }
  .portal-filters label:nth-child(3) {
    flex: 1 1 calc(50% - 12px);
  }
  .pilot-nav nav {
    padding-bottom: 4px;
  }
  .integration-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 540px) {
  .portal-stats {
    gap: 10px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-card > strong {
    font-size: 25px;
  }
  .stat-card > span,
  .stat-card > small {
    font-size: 12px;
  }
  .portal-filters {
    padding: 14px;
  }
  .portal-filters label {
    min-width: 110px;
  }
  .portal-filters label:nth-child(3) {
    flex-basis: 100%;
  }
  .registry-toolbar {
    padding: 16px;
    gap: 10px;
  }
  .registry-toolbar > input {
    flex-basis: 100%;
  }
  .registry-toolbar > select {
    flex: 1;
    max-width: none;
  }
  .registry-footer {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .catalog-detail-grid {
    grid-template-columns: 1fr;
  }
  .photo-placeholder {
    min-height: 140px;
  }
  .chart-scroll {
    margin-top: 8px;
  }
}

/* SVG geometry keeps charts visible under style-src 'self'. */
.overview-grid {
  align-items: start;
}
.chart-layout {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  min-width: 520px;
  padding-top: 8px;
}
.chart-layout.multiyear {
  min-width: 1000px;
}
.chart-axis {
  height: 160px;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}
.chart-axis span {
  position: relative;
  top: -7px;
  line-height: 1;
}
.month-bars {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 0 0 8px;
}
.month-button {
  flex: 1 0 0;
  min-width: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.month-value {
  display: block;
  height: 24px;
  line-height: 24px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
}
.month-track {
  display: block;
  width: 100%;
  height: 160px;
}
.chart-grid-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.month-fill {
  fill: var(--gold);
}
.month-label {
  display: block;
  margin-top: 10px;
  line-height: 20px;
  white-space: nowrap;
}
.month-label small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.month-button.selected .month-fill,
.month-button:hover .month-fill {
  fill: var(--ink);
}
.month-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.result-ring {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 100%;
  margin: 12px auto;
}
.result-ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 22;
}
.result-segment {
  fill: none;
  stroke-width: 22;
}
.result-segment.found {
  stroke: var(--chart-found);
}
.result-segment.not-found {
  stroke: var(--chart-not-found);
}
.result-segment.other {
  stroke: var(--chart-other);
}
.result-total {
  fill: var(--ink);
  text-anchor: middle;
  font-size: 27px;
  font-weight: 600;
  font-family: inherit;
}
.result-caption {
  fill: var(--muted);
  text-anchor: middle;
  font-size: 13px;
  font-family: inherit;
}
.result-legend > div {
  display: grid;
  grid-template-columns: 10px 1fr auto 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
}
.result-legend small {
  font-size: 13px;
  text-align: right;
  color: var(--muted);
}
.result-marker {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.result-marker.found {
  background: var(--chart-found);
}
.result-marker.not-found {
  background: var(--chart-not-found);
}
.result-marker.other {
  background: var(--chart-other);
}
.search-status-details {
  margin-top: 14px;
}
.search-status-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}
.team-workload {
  display: block;
  width: 100%;
  min-width: 100px;
  max-width: 200px;
  height: 6px;
  margin-top: 10px;
}
.team-workload-track {
  fill: var(--line);
}
.team-workload-fill {
  fill: var(--gold);
}
.client-summary {
  min-width: 780px;
}
.client-summary td:first-child {
  min-width: 220px;
}
.client-positions {
  min-width: 960px;
}
.client-positions td:nth-child(2) {
  min-width: 220px;
}
.client-positions td:first-child {
  min-width: 155px;
}
.work-summary {
  margin-bottom: 32px;
}
.work-summary .panel-heading {
  margin-bottom: 18px;
}
.work-summary .small-copy {
  margin-top: 6px !important;
}
.work-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.work-stat {
  font: inherit;
  color: inherit;
  text-align: left;
  min-height: 154px;
  transition: border-color 0.12s ease;
}
.work-stat:hover {
  border-color: var(--gold);
}
.work-stat > span {
  font-size: 14px;
}
.work-stat > small {
  line-height: 1.65;
}
.analytics-heading {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  .work-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .work-stat {
    padding: 16px;
  }
  .work-summary .panel-heading > div {
    min-width: 0;
  }
}
.request-views {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.request-views [aria-pressed="true"] {
  background: var(--navy, #121e35);
  color: white;
  border-color: #121e35;
}
.kanban-board {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 100%;
  overflow-x: auto;
  padding: 8px 0 24px;
}
.kanban-column {
  flex: 0 0 290px;
  min-width: 0;
  background: #e4eaf0;
  border-radius: 14px;
  padding: 12px;
}
.kanban-column > header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 16px;
  border-bottom: 3px solid #b79857;
  padding-bottom: 12px;
}
.kanban-column h2 {
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
  flex: 1;
}
.kanban-card {
  background: white;
  border: 1px solid #d5dee7;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.kanban-card > .text-button {
  text-align: left;
  font-weight: 600;
}
.kanban-card .muted {
  font-size: 12px;
  line-height: 1.6;
}
.request-stage-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.request-stage-form select {
  width: 100%;
  min-width: 0;
}
.kanban-card .request-stage-form label {
  font-size: 12px;
}
.kanban-card .request-stage-form button {
  width: 100%;
}
.request-phase {
  margin-top: 20px;
}
.request-phase .request-stage-form {
  max-width: 500px;
}
.bitrix-preview {
  margin-top: 20px;
  border-top: 1px solid #d5dee7;
  padding-top: 16px;
}
#bitrix-preview-form,
#bitrix-import-form {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 600px) {
  .kanban-column {
    flex-basis: 270px;
  }
  .kanban-card select {
    font-size: 16px;
  }
}
.supplier-stats .work-stat.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}
.supplier-filters input {
  flex: 2;
  min-width: 180px;
}
.supplier-filters select {
  flex: 1;
  min-width: 180px;
}
.supplier-board .kanban-card > .text-button {
  display: block;
  margin-top: 6px;
}
.supplier-board .form-actions {
  gap: 8px;
  margin-top: 14px;
}
.request-views {
  flex-wrap: wrap;
}
