:root {
  --primary: #027b68;
  --primary-dark: #016356;
  --primary-light: #039980;
  --primary-soft: #d7f1ec;
  --primary-row: #c5e9e2;
  --header: #027b68;
  --accent: #027b68;
  --accent-dark: #016356;
  --navy: #027b68;
  --navy-2: #016356;
  --navy-3: #039980;
  --bg: #ececec;
  --panel: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --gray-100: #f5f5f5;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --border: #b4b4b4;
  --border-light: #d4d4d4;
  --green: #027b68;
  --shadow: none;
  --radius: 0;
  --caption: #f0f0f0;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
  font-size: 13px;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: 8px;
  top: -40px;
  z-index: 1000;
  padding: 8px 12px;
  background: #163a34;
  color: #fff;
  border-radius: 4px;
}
.skip-link:focus {
  top: 8px;
}

main {
  flex: 1 1 auto;
}

.container,
.home-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 20px;
}

.header-inner,
.footer-inner,
.hero-inner,
.cta-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- header ---------- */
.site-header {
  background: var(--header);
  color: #fff;
  flex: 0 0 auto;
  z-index: 20;
  position: relative;
  border-bottom: 1px solid #015a4c;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  flex-wrap: nowrap;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.brand-mark {
  display: none;
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand-accent { color: #b7eadf; }

.nav {
  display: flex;
  gap: 0;
  align-items: center;
  height: 100%;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

.nav-links,
.nav-guest {
  display: flex;
  align-items: center;
  height: 100%;
  flex-wrap: nowrap;
}

.nav-links { flex: 1 1 auto; }

.nav-burger {
  display: none;
  margin-left: auto;
  width: 36px;
  height: 32px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.nav-link {
  color: #e7f7f4;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 0 12px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  white-space: nowrap;
  transition: background 0.12s;
}

.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.nav-link-active,
.nav-link-active:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.nav-cta {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  height: 28px;
  margin-left: 8px;
  border-radius: 2px;
}

.nav-cta:hover { background: #e8f7f4; color: var(--primary-dark); }

.nav-user {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 10px 0 12px;
  line-height: 1.15;
  max-width: 220px;
  text-decoration: none;
}

.nav-user:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-user-active,
.nav-user-active:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav-user-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-company {
  font-size: 11px;
  color: #b7eadf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-account {
  position: relative;
  margin-left: auto;
  height: 100%;
  flex-shrink: 0;
}

.nav-account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 8px 0 12px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

.nav-account-btn:hover,
.nav-account.is-open .nav-account-btn {
  background: rgba(255, 255, 255, 0.12);
}

.nav-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #016657;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-account-name {
  max-width: 180px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-caret { font-size: 11px; opacity: 0.8; }

.nav-account-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 240px;
  background: #fff;
  color: var(--text);
  border: 1px solid #d8e2df;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 40;
  padding: 6px 0;
}

.nav-account-company {
  padding: 8px 14px 10px;
  color: #888;
  font-size: 12px;
  border-bottom: 1px solid #eee;
}

.nav-account-menu a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}

.nav-account-menu a:hover { background: #f3f7f6; }

@media (max-width: 1023px) {
  .nav-burger { display: inline-flex; align-items: center; justify-content: center; }
  .nav { display: none; }
  .site-header.nav-open .nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    left: 0;
    right: 0;
    top: 48px;
    background: var(--header);
    height: auto;
    padding: 8px 0 12px;
  }
  .nav-links,
  .nav-guest {
    flex-direction: column;
    height: auto;
    align-items: stretch;
  }
  .nav-link { height: 40px; }
  .nav-account { margin-left: 0; height: auto; }
  .nav-account-btn { height: 44px; width: 100%; }
  .nav-account-menu { position: static; box-shadow: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover { transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
}

.btn-primary:hover { background: var(--primary-light); }

.btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); }

.btn-large { padding: 8px 20px; font-size: 14px; }

/* ---------- flash ---------- */
.flash-block { margin: 8px 16px 0; }

.flash {
  padding: 8px 12px;
  border-radius: 2px;
  margin-bottom: 8px;
  font-weight: 500;
}

.flash-error { background: #fdeceb; color: #a33a32; border: 1px solid #f5c6c2; }
.flash-success { background: #e5f6f2; color: #016356; border: 1px solid #9ad4c8; }

/* ---------- hero ---------- */
.hero {
  background: var(--primary);
  color: #fff;
  padding: 56px 0 64px;
  flex: 0 0 auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #d9f4ee;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 18px;
  font-size: 44px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.hero-subtitle {
  margin: 0 0 28px;
  font-size: 17px;
  color: #d9f4ee;
  max-width: 640px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 0; }

.hero-copy {
  margin: 0 0 28px;
  font-size: 17px;
  color: #d9f4ee;
  max-width: 640px;
}

.page-home .home-wrap {
  max-width: 1120px;
  margin: 0 auto;
}

.hero .btn-primary,
.cta-banner .btn-primary {
  background: #fff;
  color: var(--primary);
  border-color: #fff;
}

.hero .btn-primary:hover,
.cta-banner .btn-primary:hover {
  background: #e8f7f4;
}

.hero-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stats strong {
  display: block;
  font-size: 16px;
  color: #fff;
}

.hero-stats span { font-size: 13px; color: #b7eadf; }

.hero-art {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  min-width: 0;
}

.hero-preview {
  width: 100%;
  max-width: 480px;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #cfe8e2;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.hero-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #016356;
  color: #fff;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
}

.hero-preview-badge {
  background: #fff;
  color: #027b68;
  font-size: 12px;
  padding: 2px 8px;
}

.hero-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hero-preview-table th,
.hero-preview-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e4f0ed;
}

.hero-preview-table th {
  color: #6b6b6b;
  font-weight: 600;
  background: #f4fbf9;
}

.hero-preview-table td:last-child,
.hero-preview-table th:last-child {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hero-preview-table tbody td:last-child {
  color: #016356;
  font-weight: 700;
}

.hero-preview-table tfoot td {
  border-bottom: none;
  font-weight: 700;
  background: #f4fbf9;
}

.hero-preview-table tfoot td:last-child {
  color: #027b68;
  font-size: 15px;
}

/* ---------- sections ---------- */
.section { padding: 48px 0; }

.section-alt { background: #e4e4e4; }

.section-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-dark);
}

.section-lead {
  margin: 0 0 32px;
  font-size: 16px;
  color: var(--muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step {
  background: #fff;
  border: 1px solid var(--border);
  padding: 24px;
  position: relative;
}

.step-num {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 32px;
  font-weight: 800;
  color: #d7f1ec;
  font-family: Consolas, monospace;
}

.step h3 { margin: 0 0 10px; font-size: 17px; color: var(--primary-dark); }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature {
  background: #fff;
  border: 1px solid var(--border);
  padding: 22px 20px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature h3 { margin: 0 0 8px; font-size: 16px; color: var(--primary-dark); }
.feature p { margin: 0; font-size: 13px; color: var(--muted); }

.cta-banner {
  background: var(--primary-dark);
  color: #fff;
  padding: 40px 0;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cta-inner h2 { margin: 0 0 6px; font-size: 24px; }
.cta-inner p { margin: 0; color: #b7eadf; }

/* ---------- workspace / create ---------- */
.page-list,
.page-workspace {
  height: 100%;
  overflow: hidden;
}

.page-list main,
.page-workspace main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.form-caption {
  flex: 0 0 auto;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: linear-gradient(#f7f7f7, #e8e8e8);
  border-bottom: 1px solid #c8c8c8;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

.form-caption-icon {
  width: 14px;
  height: 12px;
  background: #f4d35e;
  border: 1px solid #d4b33a;
  border-radius: 1px 1px 0 0;
  box-shadow: inset 0 2px 0 #fff6c8;
}

.workspace-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 24px;
}

.create-layout {
  display: grid;
  grid-template-columns: minmax(320px, 720px) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
}

.create-main { min-width: 0; }

.create-aside {
  min-width: 0;
  padding-top: 8px;
}

.create-scene {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.create-docs {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.create-doc {
  flex: 1;
  background: #fff;
  border: 1px solid #c8c8c8;
  padding: 10px 12px 14px;
  box-shadow: 4px 6px 0 rgba(2, 123, 104, 0.08);
}

.create-doc-spec { transform: rotate(-3deg); }
.create-doc-invoice { transform: rotate(3deg); margin-top: 18px; }

.create-doc-head {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  margin: -10px -12px 10px;
  padding: 8px 12px;
}

.create-doc-invoice .create-doc-head {
  background: #016356;
}

.create-doc-line {
  height: 8px;
  background: #e6f3f0;
  margin-bottom: 8px;
}

.create-doc-line.is-short { width: 62%; }

.create-doc-price {
  margin-top: 6px;
  text-align: right;
  font-weight: 700;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.create-arrow {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.create-result {
  background: #fff;
  border: 1px solid #cfe8e2;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.create-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #016356;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.page-head {
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
}

.page-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.page-lead { margin: 0; color: #d9f4ee; font-size: 14px; }

.form-card,
.success-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin: 0;
  max-width: 720px;
  width: 100%;
}

.form-title {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--primary-dark);
  font-weight: 700;
}

.form-title + .form-title { margin-top: 22px; }

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

.form-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 16px;
}

.form-row > .field {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 16px;
}

.form-row .field .hint {
  display: inline;
  margin-left: 4px;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.field .hint {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.req { color: #c0392b; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #a0a0a0;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.field input[readonly] {
  background: #f5f5f5;
  color: #444;
}

.field input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  background: #fafafa;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.field-check .check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #333;
}

.field-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.field.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.field.is-disabled input[type="file"] {
  cursor: not-allowed;
  background: #eee;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-note { margin: 0; font-size: 12px; color: var(--muted); max-width: 420px; }

.form-note.is-error { color: #a33a32; }

body.modal-open { overflow: hidden; }

.progress-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(1, 80, 68, 0.45);
}

.progress-modal[hidden] { display: none; }

.progress-dialog {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 20px;
}

.progress-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--primary-dark);
}

.progress-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.progress-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.progress-step[hidden] { display: none; }

.progress-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  flex: 0 0 auto;
  position: relative;
}

.progress-step.is-active { color: var(--primary-dark); }

.progress-step.is-active .progress-marker {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 123, 104, 0.2);
  animation: progress-pulse 1.2s ease-in-out infinite;
}

.progress-step.is-done { color: var(--primary); }

.progress-step.is-done .progress-marker {
  border-color: var(--primary);
  background: var(--primary);
}

.progress-step.is-done .progress-marker::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.progress-detail {
  margin: 0;
  min-height: 2.4em;
  font-size: 13px;
  color: var(--primary-dark);
  background: #f4f4f4;
  padding: 10px 12px;
}

.progress-error {
  margin: 12px 0 0;
  color: #a33a32;
  background: #fdeceb;
  border: 1px solid #f5c6c2;
  padding: 8px 10px;
  font-size: 13px;
}

.kp-export-field { margin: 0 0 4px; }

.kp-export-field input[type="file"] {
  width: 100%;
  font-size: 13px;
  font-family: inherit;
}

.kp-export-vat { margin-top: 12px; }

.kp-export-vat .cat-kind-row {
  flex-direction: row;
  gap: 16px;
  margin: 4px 0 6px;
}

.kp-export-vat { margin-top: 12px; }

.kp-export-vat .cat-kind-row {
  flex-direction: row;
  gap: 16px;
  margin: 4px 0 6px;
}

.kp-export-actions { margin-top: 16px; }

#progress-close { margin-top: 14px; }

@keyframes progress-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(2, 123, 104, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(2, 123, 104, 0.08); }
}

/* ---------- materials: 1C list form ---------- */
.page-list { overflow: hidden; }

.page-list main { overflow: hidden; }

.list-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.list-body {
  flex: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  min-height: 0;
}

.nav-panel,
.list-panel {
  background: var(--panel);
  border: 1px solid #9a9a9a;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-caption {
  flex: 0 0 auto;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: linear-gradient(#fafafa, #ececec);
  border-bottom: 1px solid #c8c8c8;
  font-size: 12px;
  font-weight: 700;
  color: #444;
}

.nav-scroll {
  flex: 1;
  overflow: auto;
  padding: 4px 0;
}

.nav-toolbar {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-bottom: 1px solid #c8c8c8;
  background: #f7f7f7;
}

.nav-toolbar .cmd-btn { width: 100%; }

.tree { list-style: none; margin: 0; padding: 0; }

.tree-sub { margin: 0 0 2px 16px; border-left: 1px dotted #c8c8c8; }

.tree-item { margin: 0; }

.tree-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  text-decoration: none;
  font-size: 12px;
  color: #222;
  white-space: nowrap;
}

.tree-link:hover { background: #f0f7f5; }

.tree-link.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.tree-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-folder {
  width: 14px;
  height: 11px;
  flex: 0 0 auto;
  background: #f4d35e;
  border: 1px solid #d4b33a;
  border-radius: 1px 1px 0 0;
  position: relative;
}

.tree-folder::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -3px;
  width: 6px;
  height: 3px;
  background: #f4d35e;
  border: 1px solid #d4b33a;
  border-bottom: none;
  border-radius: 1px 1px 0 0;
}

.tree-folder.is-leaf {
  background: #ffe9a8;
}

.tree-count {
  font-size: 11px;
  color: #888;
  margin-left: auto;
}

.tree-link.is-active .tree-count { color: #d9f4ee; }

.command-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px;
  background: linear-gradient(#fafafa, #ececec);
  border-bottom: 1px solid #c8c8c8;
}

.command-search {
  flex: 0 0 440px;
  width: 440px;
  max-width: 440px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #8a8a8a;
  font-size: 12px;
  font-family: inherit;
}

.command-search:focus {
  outline: none;
  border-color: var(--primary);
}

.page-list .command-search {
  flex: 1 1 240px;
  width: auto;
  max-width: 360px;
  min-width: 160px;
}

.cmd-supplier-label {
  display: inline-flex;
  align-items: center;
}

.cmd-radios {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 0 4px;
  white-space: nowrap;
}

.cmd-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.cmd-radio input {
  margin: 0;
  accent-color: var(--primary);
}

.cmd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid #8a8a8a;
  background: linear-gradient(#fff, #ececec);
  color: #222;
  font-size: 12px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.cmd-btn:hover { background: linear-gradient(#fff, #d7f1ec); border-color: var(--primary); }

.cmd-btn-end {
  margin-left: auto;
}

.cmd-btn-undo,
.cmd-btn-redo {
  min-width: 34px;
  padding: 0 8px;
}

.cmd-btn:disabled,
.cmd-btn-undo:disabled,
.cmd-btn-redo:disabled {
  opacity: 0.35;
  cursor: default;
}

.cmd-btn.disabled,
.cmd-btn.disabled:hover,
.cmd-btn-accent.disabled,
.cmd-btn-accent.disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.cmd-btn:disabled:hover,
.cmd-btn-undo:disabled:hover,
.cmd-btn-redo:disabled:hover {
  background: linear-gradient(#fff, #ececec);
  border-color: #8a8a8a;
}

.upload-dialog .field {
  margin-bottom: 14px;
}

.upload-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.upload-preview {
  flex: 0 0 auto;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #c8c8c8;
  background: #f8fffc;
}

.upload-preview-errors {
  max-height: none;
  background: #fff8f7;
  padding: 8px 12px;
}

.upload-preview-title {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #016356;
  border-bottom: 1px solid #d5ebe5;
}

.upload-preview-errors .upload-preview-title {
  color: #a33a32;
  border-bottom-color: #f0d0cc;
  padding: 0 0 6px;
}

.upload-error-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #7a2e28;
}

.table-wrap-preview {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 240px;
}

.materials-table-preview .col-file {
  width: 14%;
  color: #666;
  font-size: 11px;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.materials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.materials-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 4px 8px;
  background: #f0f0f0;
  color: #333;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #c8c8c8;
  white-space: nowrap;
  overflow: hidden;
}

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

.materials-table.is-resizing,
.materials-table.is-resizing th,
.materials-table.is-resizing td {
  cursor: col-resize;
  user-select: none;
}

.materials-table td {
  padding: 3px 8px;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.materials-table tbody tr { height: 22px; }

.materials-table tbody tr:nth-child(even) { background: #f7f7f7; }

.materials-table tbody tr:hover { background: var(--primary-soft); }

.materials-table tbody tr:hover td { border-color: #c5ddd8; }

.col-num { width: 4%; color: #666; text-align: right; }
.col-name { width: 34%; }
.col-price {
  width: 9%;
  white-space: nowrap;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.col-sim { width: 7%; font-weight: 600; color: var(--primary); }
.col-cat { width: 13%; color: #555; }

.col-unit {
  width: 64px;
  max-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #333;
}

.col-unit.is-empty {
  color: #999999;
  opacity: 0.8;
}

.col-kp {
  width: 36px;
  text-align: center;
}

.col-sort {
  color: inherit;
  text-decoration: none;
}

.col-sort:hover { color: var(--primary-dark); }
.col-sort.is-active { color: var(--primary-dark); }
.col-sort:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.supplier-chip {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.supplier-chip:hover,
.supplier-chip:focus {
  color: var(--primary-dark);
  text-decoration: underline;
  outline: none;
}

.kp-used {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d8d8d8;
  vertical-align: middle;
}

.kp-used.is-on {
  background: #2ea44f;
  color: #fff;
  font: 700 10px/14px inherit;
  text-align: center;
}

.command-supplier {
  width: 220px;
  max-width: 250px;
  height: 24px;
  border: 1px solid #8a8a8a;
  padding: 0 8px;
  font: inherit;
  box-sizing: border-box;
}

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

.supplier-tip {
  position: fixed;
  z-index: 90;
  max-width: 300px;
  padding: 8px 10px;
  background: #fff;
  color: #222;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-line;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  border: 1px solid #d0d0d0;
  pointer-events: none;
}

.supplier-card-dialog { width: min(420px, 100%); }

.supplier-card-row {
  margin: 0 0 8px;
  font-size: 13px;
}

.supplier-card-row dt {
  color: #666;
  font-size: 11px;
  margin-bottom: 2px;
}

.dup-toggle {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 2px;
  padding: 0;
  border: 1px solid #b0b0b0;
  background: #fff;
  color: #333;
  font: 700 11px/14px inherit;
  cursor: pointer;
  vertical-align: middle;
}

.dup-toggle:focus-visible {
  outline: 2px solid var(--primary);
}

.dup-row td {
  background: #f3faf8;
  color: #444;
}

.price-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  vertical-align: middle;
}

.price-badge.is-cheaper {
  background: #d8f3e0;
  color: #1b7a3a;
}

.price-badge.is-expensive {
  background: #f8d4d4;
  color: #a32020;
}

@media (max-width: 1365px) {
  .col-unit,
  .materials-table col.col-unit,
  .materials-table th.col-unit,
  .materials-table td.col-unit {
    display: none;
  }
}

@media (max-width: 767px) {
  .col-kp,
  .materials-table col.col-kp,
  .materials-table th.col-kp,
  .materials-table td.col-kp,
  .price-badge {
    display: none;
  }
  .command-supplier {
    width: 100%;
    max-width: 250px;
  }
}

.cat-pick {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-pick:hover { color: var(--primary-dark); }

.cmd-btn.cat-pick {
  text-decoration: none;
  overflow: visible;
  white-space: nowrap;
  max-width: none;
}

.cat-dialog { width: min(560px, 100%); }

.cat-filter {
  width: 100%;
  height: 28px;
  margin: 0 0 8px;
  padding: 0 8px;
  border: 1px solid #8a8a8a;
  font-size: 12px;
  font-family: inherit;
  box-sizing: border-box;
}

.cat-filter:focus {
  outline: none;
  border-color: var(--primary);
}

.cat-pick-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #c8c8c8;
  background: #fff;
}

.cat-pick-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.cat-pick-item:hover { background: #f0f7f5; }

.cat-pick-item.is-selected {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.cat-pick-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: #888;
}

.cat-actions-spacer { flex: 1; }

.cat-kind-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.material-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.col-supplier { width: 16%; color: #555; }
.col-acc { width: 12%; color: #555; }
.col-date { width: 12%; color: #555; }

.material-link {
  color: inherit;
  text-decoration: none;
  cursor: text;
}

.material-link:hover {
  color: #0a5c96;
  text-decoration: underline;
  cursor: pointer;
}

.material-page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.material-toolbar { flex: 0 0 auto; }

.material-card {
  background: var(--panel);
  border: 1px solid #9a9a9a;
  padding: 12px 16px;
}

.material-field + .material-field { margin-top: 10px; }

.material-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 2px;
}

.material-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.material-value { font-size: 13px; }

.empty-hint { color: #999; }

.material-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #444;
  padding: 4px 2px 0;
}

.material-invoices {
  flex: 1;
  min-height: 120px;
  border: 1px solid #9a9a9a;
  background: #fff;
}

.material-invoices .materials-table {
  width: 100%;
  table-layout: auto;
}

.material-invoices .materials-table td {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.acc-date { font-size: 11px; color: #888; }

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 32px;
}

.empty-state p { margin: 0 0 6px; }
.empty-hint { font-size: 12px; color: #999; }

.status-bar {
  flex: 0 0 auto;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px;
  background: linear-gradient(#fafafa, #ececec);
  border-top: 1px solid #c8c8c8;
  font-size: 12px;
  color: #444;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 2px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid #b0b0b0;
  background: #fff;
  text-decoration: none;
  font-size: 12px;
  color: #222;
}

.page-link:hover { background: var(--primary-soft); border-color: var(--primary); }

.page-link.is-current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
  font-weight: 600;
}

.page-link.is-disabled {
  color: #aaa;
  background: #f4f4f4;
  cursor: default;
  pointer-events: none;
}

/* ---------- footer ---------- */
.site-footer {
  flex: 0 0 auto;
  background: var(--primary-dark);
  color: #b7eadf;
  padding: 10px 0;
  font-size: 12px;
}

.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
}

.hero-keys {
  display: grid;
  gap: 12px;
}

.hero-key {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 20px 22px;
}

.hero-key-label {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #b7eadf;
}

.hero-key h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.hero-key p {
  margin: 0;
  font-size: 14px;
  color: #d9f4ee;
}

.audience-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.audience-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.audience-contractor { border-top: 4px solid var(--primary); }
.audience-customer { border-top: 4px solid #1f4f5a; }

.audience-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary);
}

.audience-customer .audience-kicker { color: #1f4f5a; }

.audience-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  color: var(--primary-dark);
}

.audience-lead {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.audience-list {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  flex: 1;
}

.audience-list li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-top: 1px solid #eee;
  font-size: 14px;
  line-height: 1.4;
}

.audience-list li:last-child { border-bottom: 1px solid #eee; }

.audience-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  height: 8px;
  background: var(--primary);
}

.audience-customer .audience-list li::before { background: #1f4f5a; }

.audience-card .btn { align-self: flex-start; }

.audience-card .btn + .btn { margin-top: 8px; }

.home-closer { text-align: center; }

.closer-inner { max-width: 820px; margin: 0 auto; padding: 8px 16px 4px; }

.closer-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #b7eadf;
}

.home-closer h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.25;
}

.closer-text {
  margin: 0 auto 24px;
  max-width: 640px;
  color: #d9f4ee;
  font-size: 16px;
}

.closer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 28px;
}

.closer-stats div {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 16px 10px;
}

.closer-stats strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.closer-stats span { font-size: 13px; color: #b7eadf; }

/* ---------- landing page (stroybalance-style) ---------- */
.page-home {
  font-family: Inter, "Inter Fallback", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 16px;
  background: #fdfcfa;
  color: var(--text);
  scroll-behavior: smooth;
}

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

.page-home main {
  flex: 1 1 auto;
}

.landing-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* header */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 250, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8e6e2;
}

.landing-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.landing-brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.landing-brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.landing-brand-accent {
  color: var(--primary-light);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-nav-link {
  color: #888;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 8px 14px;
  transition: color 0.15s;
}

.landing-nav-link:hover {
  color: var(--primary-dark);
}

.landing-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: background 0.15s;
}

.landing-header-btn:hover {
  background: var(--primary);
}

/* hero */
.landing-hero {
  padding: 56px 0 0;
  background: linear-gradient(135deg, #fdfcfa 55%, #eef7f5 55%);
  overflow: hidden;
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 48px;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e0ebe8;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.landing-badge svg {
  color: var(--primary);
  flex-shrink: 0;
}

.landing-hero-title {
  margin: 0 0 24px;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.landing-accent {
  color: var(--primary);
}

.landing-hero-lead {
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.65;
  color: #666;
  max-width: 520px;
}

.landing-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.landing-btn-sm {
  padding: 12px 22px;
  font-size: 12px;
}

.landing-btn-lg {
  padding: 18px 32px;
  font-size: 14px;
}

.landing-btn-primary {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}

.landing-btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.landing-btn-outline {
  background: transparent;
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.landing-btn-outline:hover {
  background: var(--primary-soft);
}

.landing-btn-white {
  background: #fff;
  color: var(--primary-dark);
  border-color: #fff;
}

.landing-btn-white:hover {
  background: var(--primary-soft);
}

.landing-btn-ghost-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.landing-btn-ghost-light:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.landing-hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.landing-hero-visual .hero-preview {
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(1, 99, 86, 0.18);
  transform: rotate(1deg);
}

.landing-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 24px;
  background: #fff;
  border-top: 1px solid #e8e6e2;
  font-size: 14px;
  color: #777;
}

.landing-trust svg {
  flex-shrink: 0;
}

/* sections */
.landing-section {
  padding: 80px 0;
}

.landing-section-muted {
  background: #f5f3ef;
}

.landing-kicker {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #a08860;
}

.landing-kicker-light {
  color: #b7eadf;
}

.landing-section-title {
  margin: 0 0 16px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}

.landing-section-lead {
  margin: 0 0 40px;
  font-size: 16px;
  line-height: 1.6;
  color: #777;
  max-width: 640px;
}

.landing-section-lead-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* feature cards */
.landing-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.landing-card {
  background: #fff;
  border: 1px solid #e8e6e2;
  padding: 32px 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.landing-card:hover {
  box-shadow: 0 8px 32px rgba(1, 99, 86, 0.1);
  transform: translateY(-2px);
}

.landing-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-dark);
  color: #fff;
  margin-bottom: 20px;
}

.landing-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
}

.landing-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #777;
}

/* role cards */
.landing-roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.landing-role-card {
  background: #fff;
  border: 1px solid #e8e6e2;
  border-top: 4px solid var(--primary);
  padding: 36px 32px;
}

.landing-role-card-alt {
  border-top-color: #1f4f5a;
}

.landing-role-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
}

.landing-role-card-alt .landing-role-kicker {
  color: #1f4f5a;
}

.landing-role-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
}

.landing-role-lead {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #777;
}

.landing-role-list {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.landing-role-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-top: 1px solid #eee;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
}

.landing-role-list li:last-child {
  border-bottom: 1px solid #eee;
}

.landing-role-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 8px;
  height: 8px;
  background: var(--primary);
}

.landing-role-card-alt .landing-role-list li::before {
  background: #1f4f5a;
}

/* why box */
.landing-why-box {
  background: #fff;
  border: 1px solid #e0ddd8;
  padding: 56px 48px;
  text-align: center;
}

.landing-why-box .landing-section-title {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.landing-benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 40px;
  text-align: left;
}

.landing-benefit {
  display: flex;
  gap: 16px;
  padding: 24px 28px;
  border: 1px solid #eee;
  margin: -0.5px;
}

.landing-benefit-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  border-radius: 50%;
  color: var(--primary);
}

.landing-benefit h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
}

.landing-benefit p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #777;
}

/* steps */
.landing-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.landing-step {
  background: #fff;
  border: 1px solid #e8e6e2;
  padding: 28px 24px;
  position: relative;
}

.landing-step-num {
  display: block;
  margin-bottom: 16px;
  font-size: 36px;
  font-weight: 900;
  color: var(--primary-soft);
  line-height: 1;
  font-family: "Inter", monospace;
}

.landing-step h4 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.landing-step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #777;
}

/* CTA */
.landing-cta {
  background: var(--primary-dark);
  color: #fff;
  padding: 72px 0;
}

.landing-cta-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.landing-cta-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.25;
}

.landing-cta-copy > p {
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.6;
  color: #b7eadf;
  max-width: 520px;
}

.landing-cta-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.landing-cta-stats div {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 14px;
}

.landing-cta-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.landing-cta-stats span {
  font-size: 12px;
  color: #b7eadf;
  line-height: 1.35;
}

.landing-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}

/* footer */
.landing-footer {
  background: var(--primary-dark);
  color: #b7eadf;
  padding: 40px 0 32px;
  border-top: 1px solid #015a4c;
}

.landing-footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 32px;
  align-items: start;
}

.landing-footer-brand p {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8ec9bd;
  max-width: 320px;
}

.landing-footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-footer-nav a {
  color: #b7eadf;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.landing-footer-nav a:hover {
  color: #fff;
}

.landing-footer-copy {
  font-size: 12px;
  color: #8ec9bd;
  text-align: right;
}

/* landing responsive */
@media (max-width: 1024px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .landing-hero-visual .hero-preview {
    transform: none;
    max-width: none;
  }

  .landing-cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .landing-steps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .landing-cta-inner {
    grid-template-columns: 1fr;
  }

  .landing-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .landing-nav {
    display: none;
  }

  .landing-header-inner {
    height: 60px;
  }

  .landing-header-btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .landing-hero {
    padding-top: 32px;
    background: #fdfcfa;
  }

  .landing-section {
    padding: 56px 0;
  }

  .landing-cards-grid,
  .landing-roles-grid,
  .landing-benefits-grid,
  .landing-steps-grid,
  .landing-cta-stats {
    grid-template-columns: 1fr;
  }

  .landing-why-box {
    padding: 32px 20px;
  }

  .landing-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .landing-footer-brand p {
    max-width: none;
  }

  .landing-footer-nav {
    align-items: center;
  }

  .landing-footer-copy {
    text-align: center;
  }
}

@media (max-width: 920px) {
  .hero-inner,
  .home-hero { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
  .hero-art { justify-content: stretch; }
  .hero-preview { max-width: none; }
  .steps, .features, .audience-split, .closer-stats { grid-template-columns: 1fr 1fr; }
  .list-body { grid-template-columns: 1fr; }
  .nav-panel { max-height: 220px; }
  .page-list { overflow: auto; }
  .page-list main { overflow: auto; }
  .create-layout { grid-template-columns: 1fr; }
  .create-aside { display: none; }
}

@media (max-width: 600px) {
  .steps, .features, .form-grid, .audience-split, .closer-stats { grid-template-columns: 1fr; }
  .hero { padding: 36px 0; }
  .hero-title { font-size: 28px; }
  .home-closer h2 { font-size: 22px; }
  .form-row { gap: 12px; }
}

[hidden] { display: none !important; }

/* ---------- auth ---------- */
.page-auth main { padding-bottom: 24px; }

.auth-page {
  display: flex;
  justify-content: center;
  padding: 28px 16px 40px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 24px 28px 20px;
}

.auth-card-wide { max-width: 720px; }

.auth-card .form-title { font-size: 20px; }

.auth-lead {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.auth-link {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-alt {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-alt a { color: var(--primary-dark); font-weight: 700; }

.members-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 13px;
}

.members-table th,
.members-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.members-table th {
  color: var(--muted);
  font-weight: 700;
}

.wizard-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--border-light);
}

.wizard-step {
  padding: 8px 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.wizard-step.is-active {
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary);
}

.wizard-pane[hidden] { display: none; }

.btn-ghost-dark {
  color: var(--primary-dark);
  border-color: var(--border);
  background: #fff;
}

.btn-ghost-dark:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.type-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-pill {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

.type-pill:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.type-pill input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.type-pill-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 600;
}

.type-pill-text small {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.suggest-wrap { position: relative; }

.suggest-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--primary);
  max-height: 240px;
  overflow: auto;
}

.suggest-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}

.suggest-item:last-child { border-bottom: 0; }

.suggest-item:hover { background: var(--primary-soft); }

.company-picked {
  border: 1px solid #9ad4c8;
  background: #e5f6f2;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.company-picked-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--primary-dark);
}

.company-picked p { margin: 0 0 10px; }

/* ---------- contractor KP editor ---------- */
.kp-list-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  margin: 4px;
  border: 1px solid #9a9a9a;
}

.kp-list-bar { flex: 0 0 auto; }

.kp-list-wrap { flex: 1; }

.kp-list-table a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.kp-list-table a:hover { text-decoration: underline; }

.kp-empty {
  padding: 28px 20px;
  color: var(--muted);
}

.kp-empty p { margin: 0 0 8px; }

.list-workspace.kp-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kp-workspace .command-bar,
.kp-workspace .kp-toolbar {
  flex: 0 0 auto;
}

.kp-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: #fff;
  border-bottom: 1px solid #c8c8c8;
}

.kp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.kp-toolbar .kp-save-primary {
  height: 26px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
  font-weight: 700;
}

.kp-toolbar .kp-save-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #fff;
}

.kp-toolbar .kp-save-primary:disabled {
  opacity: 0.65;
  cursor: default;
}

.kp-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #c8c8c8;
  background: linear-gradient(#fafafa, #ececec);
  flex-wrap: wrap;
}

.kp-toolbar-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: #c5c5c5;
  flex: 0 0 auto;
}

.kp-toolbar-sep:has(+ #kp-analogue-btn[hidden]) {
  display: none;
}

.kp-menu { position: relative; }

.kp-menu-toggle::after {
  content: "▾";
  margin-left: 6px;
  font-size: 11px;
  line-height: 1;
  color: #444;
}

.kp-menu.is-open .kp-menu-toggle::after {
  transform: rotate(180deg);
}

.kp-menu-panel {
  position: fixed;
  z-index: 70;
  min-width: 240px;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #8a8a8a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.kp-menu-panel[hidden] { display: none; }

.kp-menu-panel .kp-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  height: auto;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #222;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
  cursor: pointer;
}

.kp-menu-panel .kp-menu-item:hover,
.kp-menu-panel .kp-menu-item:focus {
  background: #d7f1ec;
  outline: none;
}

.kp-menu-panel .kp-menu-item[aria-checked="true"] {
  font-weight: 700;
  color: var(--primary-dark);
}

.kp-menu-panel .kp-menu-item:disabled {
  opacity: 0.4;
}

.kp-menu-panel .kp-menu-item[hidden] { display: none; }

.kp-table-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background: #f7f7f7;
  border-bottom: 1px solid #d8d8d8;
}

.kp-save-status {
  font-size: 12px;
  color: var(--primary-dark);
  margin-left: 8px;
}

.kp-save-status.is-error { color: #a33; }

#kp-filter-missing.is-active,
#kp-filter-missing[aria-pressed="true"] {
  background: linear-gradient(#fff, #d7f1ec);
  border-color: var(--primary);
}

.kp-toolbar-edit,
.kp-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kp-toolbar-actions {
  margin-left: auto;
}

.kp-only-no-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: #555;
  white-space: nowrap;
}

.kp-only-no-price input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.kp-only-no-price input:checked + span {
  font-weight: 600;
  color: #d32f2f;
}

.kp-filter-count {
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}

.kp-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #a33;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.kp-source-tooltip {
  position: fixed;
  z-index: 90;
  max-width: 280px;
  padding: 6px 8px;
  border-radius: 4px;
  background: #222;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.kp-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 1fr;
  gap: 10px 16px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #c8c8c8;
  flex: 0 0 auto;
}

.kp-head .field { margin: 0; }

.kp-head label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  margin-bottom: 4px;
}

.kp-head input {
  width: 100%;
  height: 26px;
  border: 1px solid #8a8a8a;
  padding: 0 8px;
  font: inherit;
}

.kp-head input:focus {
  outline: none;
  border-color: var(--primary);
}

.kp-loading {
  text-align: center;
  padding: 24px 12px;
  color: #666;
}

.kp-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.kp-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  font-size: 12px;
}

.kp-table th,
.kp-table td {
  border: 1px solid #b4b4b4;
  padding: 0;
  vertical-align: middle;
}

.kp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8f4f1;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
  line-height: 1.25;
}

.kp-table thead tr:nth-child(2) th {
  top: 28px;
}

.kp-col-check { width: 28px; text-align: center; }
.kp-col-num { width: 44px; }
.kp-col-name { width: 32%; min-width: 280px; }
.kp-col-supplier { width: 16%; min-width: 140px; }
.kp-col-unit { width: 64px; }
.kp-col-qty { width: 72px; }
.kp-col-coef { width: 56px; }
.kp-col-price { width: 108px; }
.kp-col-sum { width: 100px; }
.kp-col-total { width: 100px; }
.kp-col-act { width: 32px; }

.kp-price-with-source {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 4px;
}

.kp-price-with-source input {
  flex: 1;
  min-width: 0;
  padding-left: 2px;
}

.kp-price-source {
  display: none;
}

.kp-table td.kp-col-price.kp-match-ok,
.tender-compare-money.kp-match-ok {
  background-color: rgba(46, 164, 79, 0.28);
}
.kp-table td.kp-col-price.kp-match-partial,
.tender-compare-money.kp-match-partial {
  background-color: rgba(224, 176, 0, 0.35);
}
.kp-table td.kp-col-price.kp-match-mismatch,
.tender-compare-money.kp-match-mismatch {
  background-color: rgba(148, 148, 148, 0.32);
}
.kp-table td.kp-col-price.kp-match-confirmed,
.tender-compare-money.kp-match-confirmed {
  background-color: rgba(46, 164, 79, 0.22);
}
.kp-table td.kp-col-price.kp-match-unmatched,
.tender-compare-money.kp-match-unmatched {
  background-color: rgba(148, 148, 148, 0.32);
}
.kp-table td.kp-col-price.kp-match-unmatched input,
.kp-table td.kp-col-price.kp-match-unmatched input::placeholder,
.tender-compare-money.is-absent {
  color: #999;
  font-style: italic;
}
.kp-table td.kp-col-price.is-review {
  cursor: pointer;
}

.kp-table td.kp-col-price.kp-match-ok,
.kp-table td.kp-col-price.kp-match-partial,
.kp-table td.kp-col-price.kp-match-mismatch,
.kp-table td.kp-col-price.kp-match-confirmed,
.kp-table td.kp-col-price.kp-match-unmatched,
.kp-table td.kp-col-price.kp-match-ok input,
.kp-table td.kp-col-price.kp-match-partial input,
.kp-table td.kp-col-price.kp-match-mismatch input,
.kp-table td.kp-col-price.kp-match-confirmed input,
.kp-table td.kp-col-price.kp-match-unmatched input,
.tender-compare-money.kp-match-ok,
.tender-compare-money.kp-match-partial,
.tender-compare-money.kp-match-mismatch,
.tender-compare-money.kp-match-confirmed,
.tender-compare-money.kp-match-unmatched {
  color: #111;
  background-clip: padding-box;
}

.kp-source-tooltip.kp-match-tooltip {
  max-width: 320px;
  max-height: calc(1.35em * 2 + 12px);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.invoice-source-type {
  margin: 12px 0 4px;
}

.invoice-source-type .cat-kind-row {
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 0;
}

.kp-match-panel {
  position: fixed;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100vw - 16px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d0d0d0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.kp-match-panel-head {
  flex: 0 0 auto;
}

.kp-match-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#kp-match-panel-spec {
  max-height: 4.2em;
  overflow: auto;
}

.kp-match-panel-row {
  margin: 0 0 8px;
}

.kp-match-panel-row span {
  display: block;
  font-size: 11px;
  color: #666;
}

.kp-match-panel-row p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.kp-match-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.kp-match-panel-actions[hidden] {
  display: none;
}

.kp-match-candidate {
  border: 1px solid #e4e4e4;
  padding: 8px;
  margin: 6px 0 0;
}

.kp-match-candidate.is-current {
  background: #f6faf6;
}

.kp-match-candidate p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.kp-match-candidate-meta {
  margin: 4px 0 0;
  color: #555;
  font-size: 12px;
  line-height: 1.35;
}

.kp-match-alts-title {
  margin: 10px 0 0;
  font-size: 11px;
  color: #666;
}

.kp-match-search {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 6px 8px;
  box-sizing: border-box;
  font-size: 13px;
}

.kp-match-select {
  margin-top: 6px;
}

.kp-table td.kp-col-price {
  cursor: pointer;
}

@media (max-width: 1440px) {
  .kp-table td.kp-col-price.kp-match-ok,
  .tender-compare-money.kp-match-ok {
    background-color: rgba(46, 164, 79, 0.2);
  }
  .kp-table td.kp-col-price.kp-match-partial,
  .tender-compare-money.kp-match-partial {
    background-color: rgba(224, 176, 0, 0.2);
  }
  .kp-table td.kp-col-price.kp-match-mismatch,
  .tender-compare-money.kp-match-mismatch {
    background-color: rgba(148, 148, 148, 0.2);
  }
  .kp-table td.kp-col-price.kp-match-confirmed,
  .tender-compare-money.kp-match-confirmed {
    background-color: rgba(46, 164, 79, 0.16);
  }
  .kp-table td.kp-col-price.kp-match-unmatched,
  .tender-compare-money.kp-match-unmatched {
    background-color: rgba(148, 148, 148, 0.2);
  }
}

@media (max-width: 767px) {
  .kp-table td.kp-col-price.kp-match-ok,
  .kp-table td.kp-col-price.kp-match-partial,
  .kp-table td.kp-col-price.kp-match-mismatch,
  .kp-table td.kp-col-price.kp-match-confirmed,
  .kp-table td.kp-col-price.kp-match-unmatched,
  .tender-compare-money.kp-match-ok,
  .tender-compare-money.kp-match-partial,
  .tender-compare-money.kp-match-mismatch,
  .tender-compare-money.kp-match-confirmed,
  .tender-compare-money.kp-match-unmatched {
    background-color: transparent;
  }
}

.kp-table input {
  width: 100%;
  height: 24px;
  border: 0;
  padding: 0 6px;
  font: inherit;
  background: transparent;
}

.kp-table textarea,
.kp-table .kp-textarea {
  width: 100%;
  min-height: 26px;
  height: auto;
  border: 0;
  padding: 4px 6px;
  font: inherit;
  line-height: 1.35;
  resize: none;
  overflow: hidden;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
  field-sizing: content;
}

.kp-table td.kp-cell-text {
  vertical-align: top;
  height: 1px;
}

.kp-table textarea:focus {
  outline: 1px solid var(--primary);
  background: #fff;
}

.kp-table input:focus {
  outline: 1px solid var(--primary);
  background: #fff;
}

.kp-table .num,
.kp-table td.kp-computed {
  text-align: right;
  padding: 0 6px;
  white-space: nowrap;
}

.kp-section {
  background: #d7f1ec;
  font-weight: 700;
}

.kp-section-group {
  background: #b7e4db;
}

.kp-section input { font-weight: 700; }

.kp-item:nth-child(even) { background: #f7f7f7; }

.kp-item:hover { background: #eef8f6; }

.kp-table tbody tr:focus-within {
  outline: 2px solid rgba(26, 127, 110, 0.35);
  outline-offset: -2px;
}

.kp-table .kp-row-check {
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--primary);
}

.kp-table tbody tr.is-selected {
  background: #d4eee8;
}

.kp-table tbody tr.kp-item.is-selected:nth-child(even) {
  background: #c8e8e0;
}

.kp-table tbody tr.is-selected:hover {
  background: #bfe4da;
}

.kp-grand td {
  background: #f0f0f0;
  font-weight: 700;
  padding: 5px 6px;
}

.kp-row-del {
  width: 100%;
  height: 24px;
  border: 0;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.kp-row-del:hover { color: #a33; background: #fdecec; }

.kp-list-table td.num { text-align: right; }

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

@media (max-width: 720px) {
  .auth-card { padding: 18px 16px; }
}

.object-crumb {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.object-crumb a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.object-crumb a:hover { text-decoration: underline; }

.object-text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.object-text-cell {
  max-width: 360px;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-caption a {
  color: inherit;
  text-decoration: none;
}

.form-caption a:hover { text-decoration: underline; }

.form-caption-sep {
  color: #999;
  font-weight: 400;
}

.form-caption-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.object-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #c8c8c8;
  background: #fff;
  margin: 0;
}

.object-meta-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.object-meta-label {
  font-size: 12px;
  font-weight: 700;
  color: #666;
}

.object-meta-value {
  min-width: 0;
  width: 100%;
  height: 26px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid #a0a0a0;
  border-radius: 0;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: #222;
}

.object-meta-value:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

#section-add-form {
  margin-top: 12px;
}

#section-add-form .field { margin-bottom: 12px; }

.tender-page-body {
  overflow: hidden;
}

.tender-page-body .table-wrap {
  flex: 1;
}

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

.tender-address {
  margin: 0;
  padding: 8px 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.tender-status {
  font-size: 12px;
  color: #444;
  margin-right: 8px;
}

.tender-page-body .command-bar {
  flex-wrap: wrap;
}

.tender-page-body .command-bar form {
  margin: 0;
}

.tender-retry-form {
  margin-left: auto;
}

.tender-page-body .command-bar .cmd-btn-end {
  margin-left: auto;
}

#tender-kp-modal .form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.tender-file-strip {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 4px 12px 6px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.tender-file-strip a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.tender-file-strip a:hover { text-decoration: underline; }

.tender-file-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 0 3px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.tender-match-act {
  white-space: nowrap;
}
.tender-match-act .cmd-btn {
  margin-right: 4px;
}

.tender-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 0;
  padding: 0 8px;
  background: linear-gradient(#f3f3f3, #ececec);
  border-bottom: 1px solid #c8c8c8;
}

.tender-tab {
  height: 26px;
  padding: 0 14px;
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: #444;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.tender-tab:hover { color: var(--primary-dark); }

.tender-tab:disabled,
.tender-tab:disabled:hover,
.tender-tab.disabled,
.tender-tab.disabled:hover {
  color: #9a9a9a;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.tender-tab.is-active {
  background: #fff;
  border-color: #c8c8c8;
  border-bottom-color: #fff;
  font-weight: 700;
  color: #222;
}

.tender-pane {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
}

.tender-pane.is-active { display: flex; }

.tender-pane-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.tender-empty { padding: 16px 20px; }

.tender-summary-table { margin: 0; width: 100%; }

.tender-summary-own td {
  font-weight: 700;
  background: #f0f0f0;
}

.tender-summary-gap td {
  height: 8px;
  padding: 0;
  border: 0;
  background: #ececec;
}

.tender-summary-contractor td {
  background: #fff;
}

.tender-error-hint {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #b42318;
  max-width: 460px;
  white-space: normal;
}

.tender-compare-wrap { max-height: none; }

.tender-compare-table {
  table-layout: fixed;
  width: 100%;
}

.tender-compare-table col.tender-col-name { width: 480px; }
.tender-compare-table col.tender-col-unit { width: 48px; }
.tender-compare-table col.tender-col-qty { width: 64px; }
.tender-compare-table col.tender-col-own { width: 108px; }

.tender-compare-table th,
.tender-compare-table td {
  padding: 5px 8px;
  white-space: nowrap;
}

.tender-compare-table .tender-compare-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  white-space: normal;
  width: 480px;
  min-width: 480px;
  max-width: 480px;
}

.tender-compare-table thead th {
  z-index: 3;
}

.tender-compare-table thead tr:first-child th:not([rowspan]) {
  height: 28px;
}

.tender-compare-table thead tr:nth-child(2) th {
  top: var(--compare-head-h, 28px);
}

.tender-compare-table thead .tender-compare-name {
  z-index: 4;
  background: #f3f3f3;
}

.tender-compare-unit {
  width: 48px;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tender-compare-qty {
  width: 64px;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tender-compare-money { min-width: 108px; }

.tender-compare-own {
  background: #f2f2f2;
}

.tender-compare-table thead th.tender-compare-own,
.tender-compare-table tfoot td.tender-compare-own {
  background: #e8e8e8;
}

.tender-compare-table tbody tr:hover td.tender-compare-own {
  background: #e4e4e4;
}

.tender-compare-contractor {
  border-left: 3px solid #c8c8c8;
}

.tender-compare-table thead th.tender-compare-contractor {
  background: #eef6f4;
  border-left: 3px solid #c8c8c8;
}

.tender-compare-money.is-absent {
  color: #999;
  font-style: italic;
}

.tender-compare-money.is-zero {
  color: #c0392b;
  font-weight: 600;
}

.tender-compare-toolbar {
  justify-content: flex-end;
}

.tender-compare-money .kp-price-with-source {
  justify-content: flex-end;
}

.kp-table.is-spec .kp-col-price { width: 108px; }
.kp-table.is-spec .kp-col-sum { width: 100px; }

.tender-compare-section td {
  font-weight: 700;
  background: #f3f3f3;
  white-space: normal;
}

.tender-compare-over {
  color: #8a4a4a;
  background: #f3eaea;
}

.tender-compare-under {
  color: #2d6a4f;
  background: #eaf3ee;
}

.tender-compare-foot td {
  font-weight: 700;
  background: #f7f7f7;
}

.tender-compare-foot .tender-compare-name {
  background: #f7f7f7;
}

.tender-compare-markup .tender-compare-over {
  color: #8a4a4a;
  background: #f3eaea;
}

.tender-compare-extra td {
  background: #f7f6f3;
  color: #5a5a5a;
}

.tender-compare-extra .tender-compare-name {
  background: #f7f6f3;
}

#tender-pane-spec {
  min-height: 0;
}

#tender-pane-spec .tender-spec-toolbar {
  flex: 0 0 auto;
  border-bottom: 1px solid #c8c8c8;
}

#tender-pane-spec .kp-table-wrap {
  flex: 1;
  min-height: 0;
}

.kp-table.is-spec {
  min-width: 720px;
}

.kp-table.is-spec .kp-col-name {
  width: auto;
}

.tender-analysis-summary {
  flex: 0 0 auto;
  padding: 12px 16px 8px;
}

.tender-analysis-lead {
  margin: 0 0 8px;
  color: #5a5a5a;
  font-size: 13px;
}

.tender-analysis-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 14px;
}

.tender-analysis-empty {
  margin: 24px 16px;
  color: #5a5a5a;
}

.tender-analysis-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  max-height: 280px;
  overflow: auto;
}

.tender-analysis-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.tender-analysis-choice:has(input:checked) {
  border-color: var(--primary-dark);
  background: #f3f8f6;
}

.tender-analysis-choice input {
  margin-top: 3px;
}

.tender-analysis-choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tender-analysis-choice-name {
  font-weight: 600;
}

.tender-analysis-choice-file,
.tender-analysis-choice-note {
  font-size: 12px;
  color: var(--muted);
}

.tender-analysis-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 6px 10px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.tender-analysis-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.tender-analysis-switcher select {
  min-width: 220px;
  height: 28px;
  padding: 0 8px;
  font-family: inherit;
}

.tender-summary-act {
  width: 40px;
  text-align: center;
}

.tender-quote-delete {
  min-width: 28px;
  padding: 0 8px;
  font-size: 16px;
  line-height: 1;
}

.kp-version-wrap {
  position: relative;
  display: inline-block;
  margin-left: 6px;
}

.kp-version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid #c8c8c8;
  border-radius: 9px;
  background: #eef6f3;
  font-size: 11px;
  font-weight: 700;
  color: #1f6b57;
  cursor: pointer;
}

.kp-vor-badge {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark, #015044);
  background: #e8f5f2;
  border: 1px solid #b7ddd4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kp-vor-badge[hidden] { display: none; }

.kp-analogue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  margin-left: 6px;
  padding: 0 8px;
  border: 1px solid #b7cce8;
  border-radius: 9px;
  background: #e8f1fb;
  font-size: 11px;
  font-weight: 700;
  color: #1d4f91;
  vertical-align: middle;
}

.command-bar .kp-analogue-badge {
  margin-left: 0;
  height: 26px;
  padding: 0 10px;
}

.kp-analogue-item-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border: 1px solid #b7cce8;
  border-radius: 9px;
  background: #e8f1fb;
  font-size: 10px;
  font-weight: 700;
  color: #1d4f91;
}

.kp-analogue-links {
  margin: 4px 0 10px;
  padding: 0 2px;
  font-size: 13px;
  color: #444;
}

.kp-analogue-links a {
  margin-right: 2px;
}

td.kp-col-supplier {
  vertical-align: top;
}

.kp-version-badge:disabled {
  cursor: default;
  opacity: 0.85;
}

.kp-version-menu {
  position: absolute;
  z-index: 20;
  top: 22px;
  left: 0;
  min-width: 140px;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #c8c8c8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kp-version-menu a {
  display: block;
  padding: 4px 10px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.kp-version-menu a:hover {
  background: #eef6f3;
}

.kp-version-warn {
  color: #9a5b00;
}

.tender-diff-dialog {
  max-width: 720px;
  width: min(720px, 96vw);
}

.tender-diff-wrap {
  max-height: 60vh;
  overflow: auto;
  margin: 8px 0;
}

.tender-diff-table .is-down {
  color: #1f7a3f;
  font-weight: 600;
}

.tender-diff-table .is-up {
  color: #c0392b;
  font-weight: 600;
}

.tender-diff-table .is-same {
  color: #888;
}

.tender-summary-table td a {
  color: var(--accent, #027b68);
  text-decoration: none;
  font-weight: 500;
}

.tender-summary-table td a:hover {
  text-decoration: underline;
}

.version-badges {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: #e8e8e8;
  color: #666;
  text-decoration: none;
}

.badge-active {
  background: #027b68;
  color: #fff;
}

.analysis-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--accent, #027b68);
  text-decoration: none;
  font-weight: 500;
}

.analysis-back:hover {
  text-decoration: underline;
}

.analysis-detail-page {
  padding: 8px 12px 24px;
}

.analysis-detail-head {
  padding: 8px 4px 0;
}

.analysis-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.analysis-detail-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-contractor-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.analysis-savings {
  margin: 12px 0 24px;
  padding: 12px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 14px;
}

.analysis-savings .savings-negative {
  color: #c0392b;
  font-weight: 600;
}

.analysis-savings .savings-positive {
  color: #27ae60;
  font-weight: 600;
}

.analysis-savings .savings-zero {
  color: #999;
}

.version-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.version-tab {
  padding: 6px 14px;
  border-radius: 6px;
  background: #f0f0f0;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.version-tab.is-active {
  background: #027b68;
  color: #fff;
}

.version-tab:hover:not(.is-active) {
  background: #e0e0e0;
}

.cmd-btn-danger {
  color: #a33;
  border-color: #d9b4b4;
}

.tender-analysis-table tr[data-status="no_benchmark"] td {
  background-color: #f5f5f5;
  color: #888;
}

.tender-analysis-table tr[data-status="no_benchmark"] .tender-compare-money {
  font-style: italic;
}

.tender-analysis-table td.is-no-benchmark {
  background-color: #f5f5f5;
  color: #888;
  font-style: italic;
}

.tender-analysis-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 12px 0 24px;
  padding: 12px 16px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 14px;
}

.ta-overpricing strong { color: #d32f2f; }
.ta-saving strong { color: #2e7d32; }
.ta-no-benchmark strong { color: #666; }

.unit-source {
  color: var(--gray-400);
  font-size: 0.8em;
  margin-left: 4px;
}

.unit-mismatch {
  color: var(--gray-500);
  cursor: help;
  border-bottom: 1px dashed var(--gray-400);
}

.tender-compare-money.is-unit-mismatch,
.tender-compare-money.is-unit-missing {
  background-color: var(--gray-100);
  color: var(--gray-400);
  cursor: default;
  pointer-events: none;
}

.tender-compare-money.is-unit-mismatch .price-muted,
.tender-compare-money.is-unit-missing .price-muted {
  font-style: italic;
}

.match-log-page { padding: 20px 0 40px; }
.match-log-page h1 { margin: 0 0 8px; font-size: 22px; }
.match-log-summary { margin: 16px 0 24px; }
.match-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin: 0 0 16px;
}
.match-log-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.match-log-filters select {
  min-width: 180px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.match-log-row { cursor: pointer; }
.match-log-row:hover { background: #f3faf8; }
.match-log-detail td {
  background: #f7f7f7;
  color: #333;
  font-size: 13px;
}
.match-log-detail p { margin: 0 0 6px; }

.cmd-btn-accent {
  background: linear-gradient(#e7f8f4, #c8efe6);
  border-color: var(--primary);
  color: #01564b;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cmd-btn-accent:hover {
  background: linear-gradient(#d4f3ec, #b4e8dc);
}
.cmd-btn-accent:disabled,
.cmd-btn-accent:disabled:hover {
  background: linear-gradient(#fff, #ececec);
  border-color: #8a8a8a;
  color: inherit;
  font-weight: 500;
}
.cmd-btn-icon { flex: 0 0 auto; }
.tender-summary-my-kp td {
  font-weight: 700;
  background: #eefaf6;
}
.my-kp-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 0;
}
.my-kp-toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.my-kp-export-templates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 12px;
}
.my-kp-empty {
  padding: 40px 16px;
  text-align: center;
}
.my-kp-empty p {
  margin: 0 0 16px;
  font-size: 15px;
  color: #555;
}
.my-kp-banner {
  margin: 8px 12px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.my-kp-banner strong { display: block; margin-bottom: 4px; }
.my-kp-banner-warn {
  background: #fff7e6;
  border: 1px solid #f0d08a;
  color: #7a4d00;
}
.my-kp-banner-info {
  background: #eef6ff;
  border: 1px solid #b9d4f5;
  color: #1d4f91;
}
.my-kp-versions { margin: 0; }
.my-kp-table {
  table-layout: fixed;
  width: 100%;
}
.my-kp-table col.my-kp-col-num { width: 44px; }
.my-kp-table col.my-kp-col-name { width: auto; }
.my-kp-table col.my-kp-col-unit { width: 52px; }
.my-kp-table col.my-kp-col-qty { width: 64px; }
.my-kp-table col.my-kp-col-money { width: 96px; }
.my-kp-table col.my-kp-col-source { width: 150px; }
.my-kp-table col.my-kp-col-total { width: 158px; }
.my-kp-table th,
.my-kp-table td {
  padding: 5px 8px;
}
.my-kp-table th.my-kp-col-num,
.my-kp-table td.my-kp-col-num {
  width: 44px;
  max-width: 50px;
  padding-left: 6px;
  padding-right: 4px;
  white-space: nowrap;
  text-align: right;
}
.my-kp-table td.my-kp-name {
  white-space: normal;
  overflow-wrap: anywhere;
}
.my-kp-table .my-kp-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-kp-table .my-kp-section-head td {
  font-weight: 700;
  background: #eef4f2;
}
.my-kp-table .my-kp-extra-note td {
  background: #f7faf9;
  white-space: normal;
}
.my-kp-extra-source {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted, #666);
}
.my-kp-table .my-kp-subtotal td {
  font-weight: 600;
  background: #f7f7f7;
}
.my-kp-table .my-kp-total-head td {
  font-weight: 800;
  background: #f4f1e6;
  letter-spacing: 0.06em;
}
.my-kp-table .my-kp-total-row td {
  font-weight: 700;
  background: #f7f7f7;
}
.my-kp-table .my-kp-total-grand td {
  background: #eefaf6;
}
.my-kp-table .my-kp-savings-gap td {
  height: 18px;
  padding: 12px 0 0;
  background: transparent;
  border: none;
}
.my-kp-table .my-kp-saving td {
  font-weight: 700;
  background: #f3faf6;
}
.my-kp-table .my-kp-saving.is-positive td.num { color: #2d6a4f; }
.my-kp-table .my-kp-saving.is-negative td.num { color: #8a4a4a; }
.my-kp-table .my-kp-saving.is-zero td.num,
.my-kp-table .my-kp-saving.is-empty td.num { color: #888; }
.my-kp-table .my-kp-line-total,
.my-kp-table .my-kp-total-row td.num,
.my-kp-table .my-kp-subtotal td.num,
.my-kp-table .my-kp-saving td.num {
  white-space: nowrap;
}
.my-kp-table .my-kp-price.is-editable {
  cursor: pointer;
  color: var(--accent, #027b68);
}
.my-kp-table .my-kp-price.is-editable:hover { background: #f3faf8; }
.my-kp-table .is-empty { color: #9a9a9a; }
.my-kp-price-input {
  width: 88px;
  height: 24px;
  padding: 0 6px;
  font: inherit;
  text-align: right;
}
.my-kp-strategy {
  font-size: 13px;
  color: var(--muted, #666);
  background: #f7f7f7;
}
.my-kp-dialog { max-width: 560px; }
.progress-modal.is-busy { cursor: progress; }
.progress-modal.is-busy .progress-dialog { cursor: default; }
.my-kp-fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}
.my-kp-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #016356;
  margin-bottom: 6px;
}
.my-kp-radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid #d5ebe5;
  border-radius: 8px;
  cursor: pointer;
}
.my-kp-radio input { margin-top: 3px; }
.my-kp-radio strong { display: block; }
.my-kp-radio small {
  display: block;
  margin-top: 4px;
  color: #555;
  font-size: 12px;
  line-height: 1.4;
}
.my-kp-radio.is-disabled {
  opacity: 0.55;
  cursor: default;
  background: #f4f4f4;
}

.sub-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}
.sub-badge-trial { background: #d7f1ec; color: #016356; }
.sub-badge-pay,
.sub-badge-expired,
.sub-badge-blocked { background: #fdeceb; color: #a33a32; }
.sub-badge-active { background: #dce8f8; color: #1d4e89; }
.sub-badge-warn { background: #fff3cd; color: #8a6d12; }
.site-header .sub-badge {
  margin-left: 6px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .sub-badge-trial { background: #fff; color: #016356; }
.site-header .sub-badge-active { background: #e8f1fb; color: #163a66; }
.site-header .sub-badge-warn {
  max-width: 280px;
  background: #fff8e5;
  color: #8a6d12;
}
.site-header .sub-badge-pay,
.site-header .sub-badge-expired,
.site-header .sub-badge-blocked { background: #fff3f2; color: #8c2f28; }

.sub-vat-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.sub-vat-check { font-size: 13px; }

.sub-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sub-modal[hidden] { display: none !important; }
.sub-modal-dialog {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  padding: 20px 22px 16px;
}
.sub-modal-title { margin: 0 0 10px; font-size: 18px; }
.sub-modal-text { margin: 0 0 16px; color: var(--muted); }
.sub-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.tariff-grid { margin-top: 8px; }
.tariff-vat {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.tariff-note {
  margin: 20px auto 0;
  max-width: 720px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.sub-reqs {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #f7faf9;
}
.sub-reqs p { margin: 0 0 4px; }
.landing-nav-link-active { font-weight: 800; }
.admin-sub-card { max-width: 960px; }
.admin-pay-form { margin: 0 0 16px; }

/* ---------- trust badges ---------- */
.trust-price-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.trust-badge {
  display: inline-block;
  max-width: 220px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}

.trust-badge-ok,
.trust-badge-confirmed {
  background: #d8f3dc;
  color: #1b5e20;
}

.trust-badge-confirmed { font-weight: 700; }

.trust-badge-review {
  background: #fff3cd;
  color: #8a6d00;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}

.trust-badge-empty,
.trust-badge-unit {
  background: #ececec;
  color: #777;
}

.trust-badge-work-tender {
  background: #d7ebf7;
  color: #0d47a1;
}

.trust-badge-work-base {
  background: #c5d4f5;
  color: #1a237e;
}

.trust-tech {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 50%;
  font-size: 11px;
  vertical-align: middle;
  cursor: default;
}

.trust-tech-ok { background: #e8f5e9; color: #2e7d32; }
.trust-tech-conflict { background: #ffcdd2; color: #b71c1c; }
.trust-tech-ambiguous { background: #fff3cd; color: #8a6d00; }

.name-with-tech { display: flex; align-items: flex-start; gap: 4px; }

.trust-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}

.trust-modal[hidden] { display: none; }

.trust-modal-card {
  background: #fff;
  min-width: 320px;
  max-width: 480px;
  padding: 16px 18px;
  border: 1px solid var(--border);
}

.trust-modal-card h3 { margin: 0 0 10px; }
.trust-modal-card ul { margin: 0 0 12px; padding-left: 18px; }
.trust-candidate { margin: 0 0 6px; }

/* ---------- dashboard ---------- */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 12px;
}

.dash-cards-rest {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 20px;
}

.dash-card {
  background: #fff;
  border: 1px solid #d8e2df;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  padding: 14px 16px;
}

.dash-card-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

.dash-card-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.dash-table a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.dash-table a:hover { text-decoration: underline; }
.dash-row { cursor: pointer; }
.dash-row:hover td { background: #f3f7f6; }

@media (max-width: 960px) {
  .dash-cards,
  .dash-cards-rest { grid-template-columns: 1fr 1fr; }
}

.kp-section-name-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.kp-section-name-line textarea {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.kp-section-kind {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 3px;
  font-weight: 500;
}

.kp-section-kind-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  background: #fff6d8;
  color: #6a5300;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.kp-section-kind-badge[hidden] { display: none; }

.kp-section-kind-btn {
  height: 20px;
  padding: 0 6px;
  border: 1px solid #c8c8c8;
  background: #fff;
  color: #555;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.kp-section-kind-btn:hover,
.kp-section-kind-btn[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.kp-reserve-hint {
  flex-basis: 100%;
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: #8a6d00;
}

.kp-reserve-hint[hidden] { display: none; }

#kp-report-modal .progress-dialog {
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
}

.kp-report-lines {
  margin: 0 0 12px;
}

.kp-report-lines h3 {
  margin: 12px 0 6px;
  font-size: 15px;
}

.kp-report-lines-note,
.check-lines-note {
  margin: 0 0 8px;
  color: #555;
  font-size: 13px;
}

.kp-report-lines table,
.check-lines {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 13px;
}

.kp-report-lines th,
.kp-report-lines td,
.check-lines th,
.check-lines td {
  border-bottom: 1px solid #d8e2df;
  padding: 6px;
  text-align: left;
  vertical-align: top;
}

.kp-report-lines th,
.check-lines th {
  font-weight: 600;
  color: #444;
}

.kp-report-attach {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 4px;
}

.kp-report-attach input {
  margin-top: 3px;
}

.kp-report-attach-hint {
  margin: 0 0 12px;
}

.check-files {
  margin: 0 0 16px;
  padding-left: 18px;
}

.check-files li { margin: 0 0 6px; }

.kp-report-hints {
  margin: 0 0 12px;
  padding-left: 18px;
}

.kp-report-hints li { margin: 0 0 6px; }

.kp-report-list {
  margin-top: 16px;
  border-top: 1px solid #d8e2df;
  padding-top: 12px;
}

.kp-report-item {
  margin: 0 0 12px;
}

.kp-report-item p { margin: 0 0 6px; }

.kp-report-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kp-report-empty {
  margin: 0;
  color: #666;
  font-size: 13px;
}

.check-page {
  max-width: 720px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.check-page h1 {
  margin: 8px 0 16px;
  font-size: 24px;
  color: #027b68;
}

.check-status {
  font-weight: 700;
  margin: 0 0 8px;
}

.check-status-valid { color: #027b68; }
.check-status-stale { color: #8a6d00; }

.check-meta {
  margin: 0 0 16px;
  padding-left: 18px;
}

.check-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
}

.check-table th,
.check-table td {
  border-bottom: 1px solid #d8e2df;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.check-table th { font-weight: 600; width: 62%; }

.check-counts,
.check-note {
  color: #555;
  font-size: 13px;
}

.check-about {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #d8e2df;
  color: #666;
}

