:root {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #203637;
  background: #f3f5f3;
  font-synthesis: none;
  --ink: #203637;
  --muted: #617471;
  --line: #dce4df;
  --primary: #176251;
  --primary-dark: #104c40;
  --paper: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #d7a531;
  outline-offset: 3px;
}
a {
  color: var(--primary);
  text-underline-offset: 3px;
}
p {
  line-height: 1.6;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin-bottom: 12px;
}
h2 {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: white;
  padding: 12px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}
.initial-state {
  grid-column: 1 / -1;
  max-width: 640px;
  padding: 80px 24px;
  margin: auto;
  text-align: center;
}
.brand-mark {
  background: #d9f0dd;
  color: #153d34;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.06em;
  flex: 0 0 auto;
}
.sidebar {
  background: #173f37;
  color: #d0e1d8;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 38px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}
.brand-name {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.brand-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 400;
  color: #c0d4c8;
  letter-spacing: 0.04em;
}
.nav-label {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  padding: 0 14px;
  margin-bottom: 12px;
  color: #a4bfb0;
}
.navigation {
  display: grid;
  gap: 6px;
}
.nav-button {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  color: #d9e7df;
  background: transparent;
  text-align: left;
  padding: 13px 15px;
  font-size: 0.9rem;
}
.nav-button:hover {
  background: #245247;
}
.nav-button[aria-current='page'] {
  background: #e2eee2;
  color: #173f37;
  font-weight: 700;
}
.nav-symbol {
  display: inline-grid;
  place-items: center;
  width: 19px;
  font-size: 1rem;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #386053;
  padding: 22px 10px 0;
  font-size: 0.76rem;
  line-height: 1.55;
}
.sidebar-footer strong {
  display: block;
  color: #ecf4ef;
  margin-bottom: 5px;
}
.main-wrap {
  min-width: 0;
}
.topbar {
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  background: #fafcf9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 40px;
  gap: 12px;
}
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #3a6555;
  font-size: 0.75rem;
  white-space: nowrap;
}
.connection::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4c8b63;
}
.connection.offline {
  color: #9c4c26;
}
.connection.offline::before {
  background: #b7683e;
}
.workspace {
  max-width: 1330px;
  margin: 0 auto;
  padding: 40px;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 11px;
}
.subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0;
  max-width: 700px;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
  min-height: 40px;
}
.button:hover {
  background: #edf3ec;
}
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.button.primary:hover {
  background: var(--primary-dark);
}
.button.quiet {
  background: transparent;
  border-color: transparent;
  padding: 7px 10px;
  min-height: 34px;
}
.button.danger {
  color: #983e30;
}
.button.small {
  padding: 7px 11px;
  min-height: 34px;
  font-size: 0.78rem;
}
.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.notice {
  border: 1px solid #dce3cc;
  background: #f0f3e6;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  line-height: 1.6;
}
.notice p {
  margin: 0;
}
.notice strong {
  color: #3f5835;
}
.notice.warning {
  background: #fcf4e7;
  border-color: #ead9b8;
}
.notice.warning strong {
  color: #785722;
}
.notice.error {
  background: #fff0eb;
  border-color: #e5c6b8;
  color: #883c2e;
}
.notice.info {
  background: #edf4f5;
  border-color: #cfdee0;
}
.notice-marker {
  font-weight: 800;
  color: #62804c;
  flex-shrink: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.metric {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 22px;
}
.metric-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.metric-number {
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 650;
}
.metric-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 11px 0 0;
}
.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 22px;
  min-width: 0;
}
.panel:last-child {
  margin-bottom: 0;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
}
.panel-description {
  color: var(--muted);
  font-size: 0.83rem;
  margin-bottom: 22px;
}
.setup-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 19px 0;
  border-top: 1px solid #e8ede7;
}
.step-number {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e3db;
  border-radius: 50%;
  font-size: 0.75rem;
  color: #698271;
}
.step-number.complete {
  background: #e4f1df;
  border-color: #e4f1df;
  color: #35643d;
}
.setup-step h3 {
  font-size: 0.87rem;
  margin-bottom: 5px;
}
.setup-step p {
  margin: 0;
  font-size: 0.77rem;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 5px 8px;
  background: #edf1ec;
  color: #57715b;
  white-space: nowrap;
  letter-spacing: 0.015em;
}
.pill.amber {
  background: #f7edd8;
  color: #826531;
}
.pill.dark {
  background: #e2eee4;
  color: #235740;
}
.feature-card {
  background: #e8efe7;
  border-color: #d6e2d5;
}
.feature-card p {
  font-size: 0.86rem;
  color: #4e6958;
}
.feature-card .eyebrow {
  margin-bottom: 16px;
}
.feature-card h2 {
  font-size: 1.45rem;
  line-height: 1.25;
  max-width: 260px;
  margin: 15px 0;
}
.small-note {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.6;
}
.empty-state {
  text-align: center;
  padding: 42px 20px;
}
.empty-glyph {
  width: 48px;
  height: 48px;
  border: 1px solid #d9e4dc;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  background: #f1f6ef;
  color: #60836a;
  font-size: 1.3rem;
}
.empty-state h2 {
  font-size: 1rem;
}
.empty-state p {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 420px;
  margin: 0 auto 20px;
}
.list-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  align-items: center;
}
.list-toolbar input {
  max-width: 340px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.83rem;
}
th {
  color: #6c7c73;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
  white-space: nowrap;
}
td {
  padding: 16px 12px;
  border-bottom: 1px solid #e6ebe5;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.primary-cell {
  font-weight: 650;
}
.secondary-cell {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
  margin-top: 4px;
  font-weight: 400;
}
.money,
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field.wide {
  grid-column: 1 / -1;
}
.field label {
  font-size: 0.8rem;
  font-weight: 600;
}
.field-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}
input,
select,
textarea {
  border: 1px solid #ccd8d0;
  background: white;
  border-radius: 7px;
  color: var(--ink);
  padding: 10px 12px;
  min-height: 42px;
  width: 100%;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: #f0f3ee;
  color: #708076;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.form-section {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.form-section + .form-section {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.form-section legend {
  font-size: 0.96rem;
  font-weight: 650;
  padding: 0;
  margin-bottom: 18px;
}
.form-footer {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.form-footer .small-note {
  margin: 0;
}
.form-errors:empty {
  display: none;
}
.form-errors {
  margin-top: 18px;
}
.item-rows {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}
.item-row {
  display: grid;
  grid-template-columns: minmax(140px, 2fr) minmax(70px, 0.65fr) minmax(110px, 1fr) minmax(
      100px,
      0.8fr
    ) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fafcf8;
  border-radius: 9px;
}
.item-row .field label {
  font-size: 0.72rem;
}
.item-row .button {
  min-height: 42px;
}
.catalog-add {
  display: flex;
  gap: 12px;
  max-width: 570px;
  margin-bottom: 18px;
}
.catalog-add select {
  min-width: 0;
}
.catalog-add .button {
  white-space: nowrap;
}
.total-box {
  margin-left: auto;
  width: 310px;
  max-width: 100%;
  padding: 20px;
  background: #f2f6f0;
  border-radius: 10px;
}
.total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.84rem;
  padding: 6px 0;
}
.total-line.grand {
  border-top: 1px solid #d7e3d2;
  margin-top: 11px;
  padding-top: 14px;
  font-weight: 750;
  font-size: 1.1rem;
}
.total-box .small-note {
  margin: 13px 0 0;
}
.draft-summary {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.detail-label {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.detail-value {
  font-size: 0.88rem;
  font-weight: 600;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 16px;
  position: relative;
  padding-bottom: 29px;
}
.timeline li:last-child {
  padding-bottom: 0;
}
.timeline li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 37px;
  bottom: 7px;
  width: 1px;
  background: var(--line);
}
.timeline h3 {
  font-size: 0.91rem;
}
.timeline p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 7px;
}
.timeline a {
  font-size: 0.8rem;
}
.link-list {
  margin: 18px 0 0;
  padding-left: 18px;
}
.link-list li {
  margin-bottom: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.notifications {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  background: #173f37;
  color: #fff;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 0.86rem;
  box-shadow: 0 10px 35px #153d3426;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
#print-document {
  display: none;
}
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .workspace {
    padding: 30px 25px;
  }
  .topbar {
    padding-left: 25px;
    padding-right: 25px;
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .item-row {
    grid-template-columns: 1fr 1fr 1fr auto;
  }
  .item-row .field:first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: relative;
    padding: 18px 16px 12px;
    gap: 18px;
  }
  .brand {
    padding-left: 3px;
  }
  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .navigation {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 5px;
  }
  .nav-button {
    width: auto;
    white-space: nowrap;
    padding: 10px 12px;
  }
  .nav-symbol,
  .nav-label,
  .sidebar-footer {
    display: none;
  }
  .topbar {
    min-height: 55px;
    padding: 12px 20px;
  }
  .workspace {
    padding: 27px 18px;
  }
  .page-heading {
    flex-direction: column;
    gap: 15px;
  }
  .page-heading .button {
    align-self: flex-start;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px 12px;
  }
  .metric-number {
    font-size: 1.7rem;
  }
  .metric-detail {
    font-size: 0.67rem;
  }
  .metric-label {
    font-size: 0.72rem;
  }
  .panel {
    padding: 20px 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-footer .button-row {
    width: 100%;
  }
  .form-footer .button-row .button {
    flex: 1;
  }
  .setup-step {
    gap: 10px;
    grid-template-columns: 29px minmax(0, 1fr);
  }
  .setup-step .button {
    grid-column: 2;
    justify-self: start;
  }
  .notice {
    padding: 14px;
  }
  .list-toolbar {
    flex-wrap: wrap;
  }
  .list-toolbar input {
    max-width: none;
  }
  .draft-summary {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .notifications {
    bottom: 16px;
    right: 16px;
  }
}
@media (max-width: 430px) {
  .item-row {
    grid-template-columns: 1fr 1fr;
  }
  .item-row .button {
    justify-self: end;
  }
  .catalog-add {
    flex-direction: column;
  }
  .breadcrumb {
    font-size: 0.7rem;
  }
  .topbar-actions {
    gap: 2px;
  }
}
@media print {
  @page {
    size: A4;
    margin: 18mm;
  }
  body {
    background: white;
    color: black;
    font-size: 10pt;
  }
  body > :not(#print-document) {
    display: none !important;
  }
  #print-document {
    display: block !important;
  }
  .print-mark {
    border: 2px solid #333;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 24px;
    font-size: 14pt;
  }
  .print-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
  }
  .print-heading h1 {
    font-size: 19pt;
  }
  .print-heading p {
    margin-bottom: 3px;
    font-size: 10pt;
  }
  #print-document table {
    font-size: 9pt;
  }
  #print-document th,
  #print-document td {
    padding: 9px 6px;
  }
  #print-document thead {
    display: table-header-group;
  }
  #print-document tr {
    break-inside: avoid;
  }
  #print-document .total-box {
    background: none;
    margin-top: 24px;
    break-inside: avoid;
  }
  #print-document .small-note {
    color: #333;
  }
  #print-document .print-footer {
    border-top: 1px solid #999;
    padding-top: 12px;
    margin-top: 30px;
  }
}
