:root {
  --ink: #17201c;
  --muted: #647067;
  --line: #d8ddd8;
  --panel: #ffffff;
  --wash: #f4f7f3;
  --primary: #17694f;
  --primary-dark: #0d4f3a;
  --accent: #d89a2b;
  --danger: #a13b2c;
  --font-sans: Arial, Helvetica, sans-serif;
  --text-xs: 0.78rem;
  --text-sm: 0.9rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.45rem;
  --text-2xl: 2rem;
  --weight-bold: 700;
  --weight-heavy: 800;
}

* { box-sizing: border-box; }

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.45;
}

a { color: inherit; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-lg);
  font-weight: var(--weight-heavy);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a, .link-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  padding: 8px 11px;
  white-space: nowrap;
}

nav a:hover,
.link-button:hover,
.nav-menu summary:hover {
  background: #f4f7f3;
  border-color: color-mix(in srgb, var(--primary) 18%, var(--line));
}

nav a.active,
.nav-menu summary.active {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  background: #e6f4ee;
  color: var(--primary-dark);
  font-weight: var(--weight-bold);
}

nav form {
  display: contents;
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
  padding: 8px 11px;
}

.nav-menu summary::-webkit-details-marker { display: none; }

.nav-menu summary::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.nav-menu div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(23, 32, 28, 0.14);
}

.nav-menu:not([open]) div { display: none; }

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

.page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.home-body {
  background: #fff;
}

.home-topbar {
  min-height: 88px;
  padding: 18px clamp(22px, 4vw, 64px);
  border-bottom: 0;
  background: #fff;
  position: static;
}

.home-topbar .brand {
  gap: 14px;
  color: #071464;
  font-size: clamp(1.65rem, 2vw, 2.15rem);
}

.home-topbar .brand-mark {
  width: 40px;
  height: 40px;
}

.home-topbar nav {
  gap: clamp(12px, 2vw, 32px);
}

.home-topbar nav a:not(.button) {
  color: #071464;
  font-size: 1rem;
  font-weight: 800;
}

.home-topbar .button.small {
  --button-height: 48px;
  --button-padding-y: 10px;
  --button-padding-x: 22px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1.18rem;
  box-shadow: 0 12px 26px rgba(0, 124, 55, 0.18);
}

.home-page {
  width: min(1480px, calc(100% - 72px));
  padding-top: 0;
}

.hero {
  min-height: min(560px, calc(100svh - 160px));
  display: flex;
  align-items: center;
  padding: clamp(24px, 4vw, 44px) 0 clamp(48px, 7vw, 76px);
}

.marketing-hero {
  min-height: min(620px, calc(100svh - 128px));
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.8fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  padding: clamp(24px, 4vw, 44px) 0 clamp(48px, 7vw, 76px);
}

.marketing-hero-copy {
  min-width: 0;
}

.home-hero {
  --home-navy: #071464;
  --home-green: var(--primary);
  min-height: min(620px, calc(100svh - 88px));
  display: grid;
  grid-template-columns: minmax(390px, 0.86fr) minmax(620px, 1fr);
  gap: clamp(36px, 5vw, 82px);
  align-items: center;
  padding: clamp(36px, 5vw, 72px) 0 clamp(38px, 4vw, 64px);
  color: var(--home-navy);
}

.home-hero-copy {
  min-width: 0;
}

.home-hero h1 {
  max-width: 600px;
  margin: 0 0 18px;
  color: var(--home-navy);
  font-size: clamp(2.45rem, 3.7vw, 4.15rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.home-hero h1 span {
  color: var(--home-green);
}

.home-audience {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--home-navy);
  font-size: clamp(1rem, 1.22vw, 1.22rem);
  font-weight: 800;
}

.irish-flag {
  width: 28px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: linear-gradient(90deg, #008a45 0 33.33%, #fff 33.33% 66.66%, #f28c28 66.66%);
  box-shadow: 0 0 0 1px rgba(7, 20, 100, 0.08);
}

.home-lead {
  max-width: 540px;
  margin: 0 0 8px;
  color: #4d5874;
  font-size: clamp(1.02rem, 1.22vw, 1.24rem);
  line-height: 1.55;
}

.home-cta-group {
  display: grid;
  justify-items: start;
  gap: 14px;
  margin-top: 28px;
}

.home-cta {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 13px 22px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 18px 34px rgba(0, 124, 55, 0.22);
}

.home-cta:hover {
  background: var(--primary-dark);
}

.home-cta-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #006f52;
  font-size: 0.95rem;
  font-weight: 800;
}

.home-cta-note .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.home-arrow {
  width: 28px;
  height: 18px;
  position: relative;
}

.home-arrow::before,
.home-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  display: block;
}

.home-arrow::before {
  width: 28px;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

.home-arrow::after {
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.home-demo {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) 40px minmax(240px, 0.78fr);
  gap: 22px;
  align-items: center;
  padding: clamp(28px, 3.5vw, 48px);
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(248, 251, 249, 0.95), rgba(255, 255, 255, 0.92));
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
}

.purchase_document-photo {
  position: relative;
  width: 100%;
  max-width: 342px;
  justify-self: end;
  padding: 14px;
  border-radius: 12px;
  background: #eef0f2;
}

.purchase_document-photo::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 10px;
  border: 10px solid #b3a393;
  pointer-events: none;
}

.purchase_document-photo-preview {
  padding: 0;
  background: transparent;
}

.purchase_document-photo-preview::before {
  display: none;
}

.purchase_document-photo-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.purchase_document-badge,
.approval-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: #fff;
  color: var(--home-green);
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(18, 24, 38, 0.2);
}

.purchase_document-badge {
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  padding: 9px 14px;
  font-size: 0.9rem;
  border: 1px solid #dfe4e8;
  white-space: nowrap;
}

.purchase_document-badge .icon,
.approval-badge .icon,
.export-pill .icon {
  width: 21px;
  height: 21px;
}

.purchase_document-paper {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 436px;
  padding: 38px 24px 24px;
  border-radius: 8px;
  background: #fff;
  color: #0d0e13;
  box-shadow: inset 0 0 0 1px #c8cdd2;
}

.purchase_document-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.purchase_document-head div,
.purchase_document-meta,
.purchase_document-total {
  display: grid;
  gap: 4px;
}

.purchase_document-head span {
  display: block;
  font-size: 0.76rem;
}

.purchase_document-paper {
  font-size: 0.88rem;
}

.purchase_document-meta,
.purchase_document-total,
.read-fields {
  margin: 0;
}

.purchase_document-meta div,
.purchase_document-total div,
.read-fields div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.purchase_document-meta dt,
.purchase_document-meta dd,
.purchase_document-total dt,
.purchase_document-total dd,
.read-fields dt,
.read-fields dd {
  margin: 0;
}

.purchase_document-meta dd,
.purchase_document-total dd {
  font-weight: 800;
}

.purchase_document-lines {
  display: grid;
  gap: 12px;
  font-size: 0.76rem;
}

.purchase_document-lines > div {
  display: grid;
  grid-template-columns: 1.45fr 0.62fr 0.72fr 0.84fr;
  gap: 8px;
  align-items: center;
}

.purchase_document-line-head {
  padding: 10px 4px;
  border-radius: 6px;
  background: #ececef;
}

.purchase_document-total {
  align-self: end;
  padding-top: 16px;
  border-top: 1px solid #d8dce0;
}

.purchase_document-total div {
  grid-template-columns: 1fr 92px;
  justify-self: end;
  min-width: 168px;
}

.read-arrow {
  width: 58px;
  height: 24px;
  color: var(--home-green);
  fill: none;
  overflow: visible;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.read-arrow path:first-child {
  stroke-dasharray: 5 6;
}

.supplier-read-card {
  position: relative;
  display: grid;
  gap: 15px;
  min-height: 414px;
  padding: 34px 22px 24px;
  border: 1px solid #e2e7ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--home-navy);
}

.approval-badge {
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  white-space: nowrap;
}

.supplier-read-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.read-fields {
  display: grid;
  gap: 13px;
  font-size: 0.82rem;
}

.read-fields div {
  grid-template-columns: 76px minmax(0, 1fr);
}

.read-fields dd {
  text-align: right;
}

.read-line-proof {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe4ee;
  border-radius: 8px;
  background: #fbfcfd;
}

.read-line-proof > div {
  display: grid;
  gap: 4px;
}

.read-line-proof strong {
  color: var(--home-navy);
  font-size: 0.92rem;
}

.read-line-proof span,
.read-line-proof small {
  color: #334155;
  line-height: 1.35;
}

.read-line-proof > div span {
  font-size: 0.8rem;
}

.read-line-proof ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.read-line-proof li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.read-line-proof li span {
  color: var(--home-navy);
  font-size: 0.8rem;
  font-weight: 800;
}

.read-line-proof li small {
  font-size: 0.74rem;
}

.read-project-row {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 800;
}

.export-pill {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 8px;
  background: #e8f2ed;
  color: var(--home-green);
  font-size: 0.86rem;
  font-weight: 800;
}

.home-steps {
  --home-navy: #071464;
  --home-green: var(--primary);
  display: grid;
  gap: clamp(28px, 4vw, 46px);
  margin: 0 0 clamp(42px, 6vw, 74px);
  padding: clamp(28px, 5vw, 56px) 0;
  color: var(--home-navy);
}

.steps-title-icon,
.step-icon {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e9f3ee;
  color: var(--home-green);
}

.steps-title-icon {
  width: 66px;
  height: 66px;
}

.steps-title-icon .icon {
  width: 36px;
  height: 36px;
}

.home-steps h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
}

.home-step-track {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px minmax(220px, 1fr) 120px minmax(220px, 1fr);
  gap: 22px;
  align-items: center;
}

.home-step {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.step-icon {
  position: relative;
  width: 96px;
  height: 96px;
}

.step-icon .icon {
  width: 48px;
  height: 48px;
}

.step-icon span {
  position: absolute;
  right: -4px;
  bottom: -8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.home-step h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.home-step p {
  margin: 0;
  color: #4d5874;
  font-size: 0.95rem;
  line-height: 1.55;
}

.step-connector {
  height: 3px;
  background-image: linear-gradient(90deg, var(--home-green) 55%, transparent 0);
  background-size: 16px 3px;
}

.home-checks-band,
.home-project-profit {
  --home-navy: #071464;
  display: grid;
  color: var(--home-navy);
}

.home-checks-band {
  grid-template-columns: minmax(300px, 0.34fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  margin-inline: calc((100vw - min(1480px, calc(100vw - 72px))) / -2);
  padding: clamp(42px, 5vw, 66px) calc((100vw - min(1480px, calc(100vw - 72px))) / 2);
  border-top: 1px solid #dfe5ee;
  border-bottom: 1px solid #dfe5ee;
  background: #fbfcfd;
}

.home-checks-band h2,
.home-project-profit h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.3vw, 2.5rem);
  line-height: 1.12;
}

.home-checks-band p,
.home-project-profit p {
  margin: 0;
  color: #4d5874;
  line-height: 1.5;
}

.home-checks-band > div:first-child,
.home-project-profit-copy {
  display: grid;
  gap: 12px;
}

.home-chase-list {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.home-chase-list span {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1px solid #dce8e2;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.home-chase-list .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--primary);
}

.home-project-profit {
  grid-template-columns: minmax(300px, 0.34fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  padding: clamp(54px, 7vw, 86px) 0;
}

.home-project-profit-copy a {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.home-profit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.38fr);
  gap: clamp(22px, 3vw, 36px);
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid #dfe5ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.home-profit-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.home-profit-metrics div {
  display: grid;
  gap: 8px;
  min-height: 106px;
  padding: 8px clamp(18px, 3vw, 34px);
  border-right: 1px solid #dfe5ee;
}

.home-profit-metrics div:nth-child(2n) {
  border-right: 0;
}

.home-profit-metrics div:nth-child(n + 3) {
  padding-top: 28px;
  border-top: 1px solid #dfe5ee;
}

.home-profit-metrics span,
.home-supplier-mini-list > span {
  color: #526073;
  font-size: 0.92rem;
  font-weight: 800;
}

.home-profit-metrics strong {
  color: var(--primary);
  font-size: clamp(1.2rem, 1.45vw, 1.55rem);
}

.home-supplier-mini-list {
  display: grid;
  align-content: center;
  gap: 16px;
  padding-left: clamp(12px, 2vw, 28px);
  border-left: 1px solid #dfe5ee;
}

.home-supplier-mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #4d5874;
}

.hero-logo {
  display: block;
  width: min(286px, 76vw);
  height: auto;
  margin-bottom: 24px;
}

.hero h1,
.marketing-hero h1,
.seo-hero h1 {
  max-width: 820px;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.95;
  margin: 0 0 20px;
}

.lead {
  max-width: 700px;
  font-size: var(--text-lg);
  color: var(--muted);
}

.lead.compact { font-size: var(--text-base); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-note {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: var(--weight-bold);
}

.product-preview {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(23, 32, 28, 0.12);
}

.scan-status {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: 8px;
  background: #f2faf6;
}

.scan-status span,
.preview-fields span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.scan-status strong {
  color: var(--primary-dark);
}

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

.preview-fields div {
  display: grid;
  gap: 6px;
  min-height: 90px;
  align-content: center;
  padding: 14px;
  border: 1px solid #e4e9e4;
  border-radius: 8px;
  background: #f8faf8;
}

.eyebrow {
  color: var(--primary);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  font-size: var(--text-xs);
}

.band {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.steps article {
  min-height: 150px;
}

.steps h2 {
  font-size: var(--text-xl);
}

.feature-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  padding: clamp(44px, 7vw, 72px) 0 0;
}

.audience-band,
.positioning-band,
.pilot-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  padding: clamp(44px, 7vw, 72px) 0 0;
}

.feature-band h2,
.audience-band h2,
.positioning-band h2,
.pilot-band h2 {
  max-width: 520px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.feature-grid,
.audience-grid,
.positioning-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.positioning-list {
  grid-template-columns: 1fr;
}

.feature-grid article,
.audience-grid article,
.positioning-list article,
.pilot-card {
  min-height: 138px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pilot-card {
  min-height: 0;
}

.feature-grid strong,
.audience-grid strong,
.positioning-list strong,
.pilot-card strong {
  font-size: 1.05rem;
}

.feature-grid span,
.audience-grid span,
.positioning-list span,
.pilot-card span,
.pilot-band p {
  color: var(--muted);
}

.pilot-card .button {
  width: fit-content;
  margin-top: 8px;
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding: clamp(44px, 7vw, 80px) 0 0;
  scroll-margin-top: 88px;
}

.workflow h2 {
  max-width: 520px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: 22px;
}

.workflow-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: workflow;
}

.workflow-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  counter-increment: workflow;
}

.workflow-list li::before {
  content: counter(workflow);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.workflow-list strong,
.workflow-list span {
  grid-column: 2;
}

.workflow-list strong {
  font-size: 1.08rem;
}

.workflow-list span {
  color: var(--muted);
}

.screenshot-stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 32px);
  border: 1px dashed color-mix(in srgb, var(--primary) 42%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 105, 79, 0.08), rgba(216, 154, 43, 0.08)),
    #fff;
}

.screenshot-frame {
  width: min(100%, 620px);
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(23, 32, 28, 0.12);
}

.preview-toolbar {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef6f2;
}

.preview-toolbar span {
  color: var(--muted);
  font-weight: 700;
}

.preview-toolbar strong {
  color: var(--primary-dark);
}

.preview-record {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.preview-record div {
  display: grid;
  gap: 6px;
  min-height: 94px;
  align-content: center;
  padding: 14px;
  border: 1px solid #e4e9e4;
  border-radius: 8px;
  background: #f8faf8;
}

.preview-record span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.preview-lines,
.preview-table {
  display: grid;
  gap: 8px;
}

.preview-lines span {
  height: 14px;
  border-radius: 999px;
  background: #e5ece6;
}

.preview-lines span:nth-child(1) { width: 92%; }
.preview-lines span:nth-child(2) { width: 76%; }
.preview-lines span:nth-child(3) { width: 84%; }

.preview-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #edf1ed;
  border-radius: 8px;
  background: #fff;
}

.preview-table span {
  color: var(--muted);
  font-weight: 700;
}

.preview-table strong {
  white-space: nowrap;
}

.trust-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 16px;
  padding-top: clamp(28px, 5vw, 56px);
}

.trust-band article {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trust-band h2,
.trust-band p {
  margin: 0;
}

.trust-band p {
  color: var(--muted);
}

.benefit-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  padding: clamp(44px, 7vw, 72px) 0 0;
}

.benefit-band h2,
.seo-hero h1 {
  max-width: 780px;
}

.benefit-grid,
.seo-content {
  display: grid;
  gap: 12px;
}

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

.benefit-grid article,
.seo-content article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.benefit-grid span,
.seo-content p,
.final-cta p,
.marketing-footer span {
  color: var(--muted);
}

.seo-hero {
  --home-navy: #071464;
  --home-green: var(--primary);
  display: grid;
  gap: 18px;
  max-width: 1040px;
  padding: clamp(48px, 8vw, 92px) 0 clamp(30px, 5vw, 54px);
  color: var(--home-navy);
}

.seo-content {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 24px;
}

.seo-content article {
  min-height: 230px;
  gap: 12px;
  padding: clamp(20px, 2.4vw, 28px);
  border-color: #dfe5ee;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.seo-content h2 {
  margin: 0;
  color: #071464;
  font-size: clamp(1.2rem, 1.45vw, 1.48rem);
  line-height: 1.15;
}

.seo-card-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e8f2ed;
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 800;
}

.seo-page {
  padding-top: 0;
}

.seo-page .eyebrow {
  color: var(--primary);
  font-size: 0.86rem;
  letter-spacing: 0;
}

.seo-page .lead {
  max-width: 760px;
  color: #38445a;
  font-size: clamp(1.03rem, 1.22vw, 1.2rem);
  line-height: 1.55;
}

.seo-page .seo-hero h1 {
  max-width: 960px;
  margin: 0;
  color: #071464;
  font-size: clamp(2.65rem, 5.4vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.seo-page .hero-actions {
  margin-top: 8px;
}

.seo-page .hero-actions .button {
  --button-height: 52px;
  border-radius: 8px;
  font-weight: 800;
}

.seo-page .hero-actions .button.primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 16px 32px rgba(0, 124, 55, 0.18);
}

.seo-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 900px);
  margin-top: 14px;
}

.seo-proof-strip span {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dce8e2;
  border-radius: 8px;
  background: #f8fbf9;
  color: #071464;
  font-weight: 800;
}

.seo-proof-strip .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--primary);
}
}

.final-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(44px, 7vw, 72px);
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 8px;
  background: #fff;
}

.final-cta h2,
.final-cta p {
  margin-bottom: 0;
}

.marketing-footer {
  width: min(1100px, calc(100% - 32px));
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
}

.home-body .marketing-footer {
  width: min(1530px, calc(100% - 76px));
}

.marketing-footer div {
  display: grid;
  gap: 4px;
}

.marketing-footer nav {
  gap: 10px;
}

.marketing-footer a {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  color: #071464;
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.marketing-footer a:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, #dfe5ee);
  background: #e8f2ed;
  color: var(--primary-dark);
}

.steps, .grid {
  display: grid;
  gap: 16px;
}

.steps { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }

.panel, .row-card, .metric, .empty, .steps article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.panel > :first-child,
.empty > :first-child {
  margin-top: 0;
}

.panel > :last-child,
.empty > :last-child {
  margin-bottom: 0;
}

.panel.narrow {
  max-width: 480px;
  margin: 40px auto;
}

.auth-logo {
  display: block;
  width: 180px;
  height: auto;
  margin-bottom: 24px;
}

.upload-panel {
  max-width: 720px;
  margin: 24px auto;
}

.form-panel {
  margin-bottom: 0;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2,
.panel-heading p {
  margin-bottom: 6px;
}

.panel-heading h1,
.panel-heading h2,
.panel-heading p {
  margin-top: 0;
}

.auth-link {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.copy-box {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.copy-box strong {
  white-space: nowrap;
}

.toolbar,
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.toolbar > div,
.page-header > div {
  min-width: 0;
}

.toolbar p,
.page-header p {
  max-width: 760px;
  margin: 0;
}

.section-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.section-tab,
nav a.section-tab {
  min-height: 42px;
  align-items: center;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 12px 9px;
  color: var(--muted);
  font-weight: 800;
}

.section-tab.active,
nav a.section-tab.active {
  border-bottom-color: var(--primary);
  background: transparent;
  color: var(--primary-dark);
}

.section-tab:hover,
nav a.section-tab:hover {
  background: #f8faf8;
}

h1, h2 { line-height: 1.1; }
h1 { margin: 0 0 10px; font-size: var(--text-2xl); }
h2 { margin: 0 0 12px; }
.muted { color: var(--muted); }

/* Button hierarchy: base = neutral utility/navigation, primary = create/save/commit, quiet = low-emphasis clear/cancel. */
.button {
  --button-height: 44px;
  --button-padding-y: 10px;
  --button-padding-x: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--button-height);
  padding: var(--button-padding-y) var(--button-padding-x);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  font-weight: var(--weight-bold);
  text-align: center;
  cursor: pointer;
}

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

.button.primary:hover { background: var(--primary-dark); }
.button.danger {
  border-color: #e7b7ae;
  background: #fff0ed;
  color: var(--danger);
}
.button.danger:hover {
  border-color: var(--danger);
  background: #ffe5df;
}

.confirm-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 26px 80px rgba(20, 26, 23, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(12, 18, 15, 0.5);
}

.confirm-dialog-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
  background: #fff;
}

.confirm-dialog-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.confirm-dialog-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff0ed;
  color: var(--danger);
}

.confirm-dialog-icon .icon {
  width: 23px;
  height: 23px;
}

.confirm-dialog-copy {
  display: grid;
  gap: 7px;
}

.confirm-dialog-copy strong {
  color: #141a17;
  font-size: 1.2rem;
  line-height: 1.25;
}

.confirm-dialog-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.confirm-dialog-actions .button {
  min-width: 118px;
}

.button.small {
  --button-height: 36px;
  --button-padding-y: 7px;
  --button-padding-x: 12px;
}
.button.full { width: 100%; }
.button.icon-button {
  --button-height: 40px;
  --button-padding-y: 8px;
  --button-padding-x: 8px;
  width: var(--button-height);
}
.button.icon-button.danger:hover {
  border-color: #e7b7ae;
  background: #fff0ed;
  color: var(--danger);
}
.button.action {
  --button-height: 44px;
  --button-padding-y: 10px;
  --button-padding-x: 16px;
  white-space: nowrap;
}
.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
}

.button.quiet:hover {
  background: #f8faf8;
  color: var(--ink);
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form {
  display: grid;
  gap: 12px;
}

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

.password-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.form-hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.form.inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.filters {
  margin-bottom: 16px;
  scroll-margin-top: 90px;
}

#export-filter-form {
  scroll-margin-top: 90px;
}

.index-filter-form {
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 0.95fr) minmax(145px, 0.75fr) minmax(145px, 0.75fr) 44px;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.index-filter-form label {
  display: block;
  margin-bottom: 7px;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
}

.index-filter-form input,
.index-filter-form select,
.index-filter-form .ts-wrapper.single .ts-control,
.index-filter-form .ts-wrapper.multi .ts-control,
.index-filter-form .button {
  min-height: 44px;
  border-color: #d9e1ea;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
}

.index-filter-form input::placeholder,
.index-filter-form .ts-wrapper .ts-control > input::placeholder {
  color: #64748b;
  opacity: 1;
}

.index-filter-form input[type="search"] {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3Cpath d='M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15z'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
}

.index-filter-form .ts-wrapper.single .ts-control,
.index-filter-form .ts-wrapper.multi .ts-control,
.index-filter-form select {
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 1px),
    calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.index-filter-form .ts-wrapper.single .ts-control,
.index-filter-form .ts-wrapper.multi .ts-control {
  padding-right: 40px;
}

.index-filter-form .ts-wrapper .ts-control .item,
.index-filter-form .ts-wrapper .ts-control > input {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 400;
}

.purchase-filter-form,
.chase-filter-form,
.income-document-filter-form {
  grid-template-columns: minmax(320px, 1.6fr) minmax(220px, 0.95fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr) 44px;
}

.chase-filter-form {
  grid-template-columns: minmax(320px, 1.45fr) minmax(220px, 0.95fr) minmax(160px, 260px) minmax(160px, 260px) 44px;
}

.catalogue-filter-form {
  grid-template-columns: minmax(300px, 1.55fr) minmax(220px, 0.9fr) minmax(170px, 0.7fr) 44px;
}

.supplier-filter-form {
  grid-template-columns: minmax(300px, 1fr) 44px;
}

.projects-filter-form {
  grid-template-columns: minmax(320px, 1.55fr) minmax(200px, 0.95fr) minmax(200px, 0.95fr) 44px;
}

.filter-actions {
  display: flex;
  width: 100%;
  gap: 0;
  align-self: flex-end;
  align-items: flex-end;
  justify-content: flex-end;
}

.filter-actions .button {
  white-space: nowrap;
}

.clear-filters-button {
  --button-height: 44px;
  --button-padding-y: 0;
  --button-padding-x: 0;
  width: 44px;
  min-width: 44px;
  justify-content: center;
  border-color: #d9e1ea;
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.clear-filters-button .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.clear-filters-button:hover,
.clear-filters-button:focus {
  border-color: #bfd0dc;
  background: #fff;
  color: var(--primary-dark);
}

.supplier-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.supplier-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.project-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.project-summary-metrics {
  margin-bottom: 14px;
}

.getting-started-panel {
  margin-bottom: 14px;
}

.getting-started-progress {
  display: grid;
  gap: 7px;
  min-width: min(220px, 100%);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.getting-started-progress > div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ed;
}

.getting-started-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.getting-started-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.getting-started-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.getting-started-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.getting-started-list li:last-child {
  padding-bottom: 0;
}

.getting-started-list li > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.getting-started-list li > div span {
  color: var(--muted);
}

.getting-started-list li.pending {
  opacity: 0.72;
}

.getting-started-list li.current {
  opacity: 1;
}

.getting-started-status {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-heavy);
}

.getting-started-list li.complete .getting-started-status {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: #eef6f2;
  color: var(--primary-dark);
}

.getting-started-list li.current .getting-started-status {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.add-project-menu .inline-edit {
  width: min(360px, calc(100vw - 32px));
  min-width: 0;
}

#add-project {
  scroll-margin-top: 96px;
}

.add-project-form {
  grid-template-columns: 1fr;
}

.add-project-form .alert-box {
  margin: 0;
}

.add-supplier-menu .inline-edit {
  width: min(360px, calc(100vw - 32px));
  min-width: 0;
}

.add-supplier-form {
  grid-template-columns: 1fr;
}

.add-supplier-form .alert-box {
  margin: 0;
}

.add-supplier-field {
  min-width: 0;
}

.catalogue-form {
  grid-template-columns: minmax(220px, 1.35fr) minmax(130px, 0.75fr) minmax(150px, 0.85fr) minmax(160px, 0.9fr) minmax(92px, 0.45fr) minmax(116px, 0.55fr) auto;
  align-items: end;
}

.catalogue-create-form {
  row-gap: 16px;
}

label { font-weight: var(--weight-bold); }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

select {
  appearance: none;
  padding-right: 40px;
  line-height: 1.35;
}

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

.upload-drop {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  background: #eef6f2;
  text-align: center;
  cursor: pointer;
}

.upload-drop input { max-width: 320px; }

.list { display: grid; gap: 10px; }

.purchase_documents-toolbar h1 {
  font-size: var(--text-2xl);
  letter-spacing: 0;
}

.upload-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  justify-items: center;
  margin: 8px 0 18px;
  padding: 0;
}

.upload-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.upload-hero p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-base);
}

.upload-target {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 28px;
  border: 2px dashed color-mix(in srgb, var(--primary) 68%, var(--line));
  border-radius: 8px;
  background: #eef6f2;
  color: var(--primary-dark);
  text-decoration: none;
}

.upload-support {
  width: min(100%, 720px);
}

.upload-target-form {
  display: grid;
  gap: 12px;
  width: 100%;
}

.dashboard-header-actions form {
  margin: 0;
}

.document-dashboard-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
}

.document-dashboard-topline p {
  margin: 0;
  color: #4b5563;
  font-size: 1.05rem;
}

.document-add-button {
  --button-height: 50px;
  --button-padding-x: 20px;
  min-width: 176px;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(0, 111, 82, 0.15);
}

.upload-target strong {
  font-size: var(--text-xl);
}

.upload-target span {
  color: var(--muted);
  font-weight: var(--weight-bold);
}

.upload-target small {
  max-width: 480px;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.35;
}

.upload-target-content {
  display: flex;
  flex: 1;
  justify-content: center;
}

.upload-target-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-target-text {
  display: grid;
  gap: 4px;
  text-align: left;
}

.upload-target input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-target em {
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-style: normal;
  font-weight: var(--weight-bold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-target.drag-active,
.upload-target:focus-within {
  border-color: var(--primary);
  background: #e4f2ec;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.purchase-progress {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  min-height: 56px;
  margin-bottom: 16px;
  padding: 11px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
}

.purchase-progress-status {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.purchase-progress-status strong,
.purchase-progress-trial {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-heavy);
  white-space: nowrap;
}

.purchase-progress-icon {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex: 0 0 auto;
}

.purchase-progress-icon::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.purchase-progress-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(currentColor 0 0) left top / 10px 2px no-repeat,
    linear-gradient(currentColor 0 0) left top / 2px 10px no-repeat,
    linear-gradient(currentColor 0 0) right top / 10px 2px no-repeat,
    linear-gradient(currentColor 0 0) right top / 2px 10px no-repeat,
    linear-gradient(currentColor 0 0) left bottom / 10px 2px no-repeat,
    linear-gradient(currentColor 0 0) left bottom / 2px 10px no-repeat,
    linear-gradient(currentColor 0 0) right bottom / 10px 2px no-repeat,
    linear-gradient(currentColor 0 0) right bottom / 2px 10px no-repeat;
}

.purchase-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e3e7e5;
  overflow: hidden;
}

.purchase-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary) 0%, #10965f 100%);
}

.upload-target-illustration {
  display: block;
  width: clamp(174px, 15vw, 220px);
  height: auto;
  aspect-ratio: 220 / 112;
  flex: 0 0 clamp(174px, 15vw, 220px);
  overflow: visible;
}

.upload-hero.purchase-upload-hero,
.upload-hero.income-upload-hero {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  align-items: stretch;
  margin: 6px 0 14px;
}

.purchase-upload-hero .upload-target,
.income-upload-hero .upload-target {
  min-height: 138px;
  gap: 34px;
  padding: 20px 24px;
}

.purchase-upload-hero .upload-target-main,
.income-upload-hero .upload-target-main {
  gap: clamp(24px, 3vw, 42px);
}

.purchase-upload-hero .upload-target-content,
.income-upload-hero .upload-target-content {
  justify-content: center;
}

.purchase-upload-hero .upload-target strong,
.income-upload-hero .upload-target strong {
  font-size: var(--text-lg);
}

.purchase-upload-hero .upload-target small,
.purchase-upload-hero .upload-target-notes p,
.income-upload-hero .upload-target small,
.income-upload-hero .upload-target-notes p {
  font-size: var(--text-sm);
}

.purchase-upload-hero .upload-target-notes {
  gap: 8px;
  padding-left: 18px;
}

.upload-hero-notes {
  display: grid;
  gap: 12px;
  width: 100%;
}

.upload-note {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.upload-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.upload-note::before {
  content: "•";
  color: var(--primary);
  font-weight: 900;
  font-size: 1.35rem;
  display: inline-flex;
  width: 1.2em;
  margin-right: 4px;
}

.purchase-summary-cards,
.income-summary-metrics {
  margin-bottom: 12px;
}

.purchase-summary-cards .metric,
.income-summary-metrics .metric {
  position: relative;
  min-height: 96px;
  gap: 6px;
  padding: 16px 58px 16px 18px;
}

.purchase-summary-cards .metric strong,
.income-summary-metrics .metric strong {
  font-size: var(--text-xl);
}

.summary-metric-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.summary-metric-icon .icon {
  width: 18px;
  height: 18px;
}

.summary-metric-icon-success {
  background: #dff1e9;
  color: var(--primary);
}

.summary-metric-icon-warning {
  background: #fff0d6;
  color: #d8791b;
}

.purchase-list-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.purchase-list-heading h2 {
  margin-bottom: 4px;
}

.purchase_document-table th {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: none;
  padding: 14px 0;
}

.purchase_document-table td {
  padding: 18px 0;
  vertical-align: middle;
}

.purchase-document-table tbody tr:hover {
  background: #f8faf9;
}

.upload-target-notes {
  display: grid;
  gap: 12px;
  flex: 1;
  padding-left: 24px;
  border-left: 1px solid rgba(26, 115, 232, 0.15);
}

.upload-note-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.upload-note-icon {
  flex: 0 0 auto;
  color: var(--primary);
  margin-top: 2px;
}

.upload-target-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
}

.upload-summary {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(26, 115, 232, 0.05);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--primary);
}

.upload-project-assignment {
  display: grid;
  grid-template-columns: minmax(80px, 120px) minmax(260px, 420px) minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
}

.upload-project-assignment label {
  margin: 0;
  color: var(--text);
  font-weight: var(--weight-bold);
}

.upload-project-assignment > span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.upload-project-assignment .ts-wrapper {
  min-width: 0;
}

.document-name {
  display: grid;
  gap: 4px;
}

.document-name .muted {
  font-size: 0.93rem;
}

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

.purchase-filter-form {
  grid-template-columns: minmax(320px, 1.55fr) minmax(200px, 0.95fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr) 44px;
}

.chase-filter-form {
  grid-template-columns: minmax(320px, 1.45fr) minmax(220px, 0.95fr) minmax(160px, 260px) minmax(160px, 260px) 44px;
}

.income-document-filter-form {
  grid-template-columns: minmax(320px, 1.55fr) minmax(200px, 0.95fr) minmax(160px, 0.75fr) minmax(160px, 0.75fr) 44px;
}

.purchase-filter-form input,
.purchase-filter-form select,
.purchase-filter-form .ts-wrapper.single .ts-control,
.purchase-filter-form .ts-wrapper.multi .ts-control,
.chase-filter-form input,
.chase-filter-form select,
.chase-filter-form .ts-wrapper.single .ts-control,
.chase-filter-form .ts-wrapper.multi .ts-control,
.chase-filter-form .button,
.income-document-filter-form input,
.income-document-filter-form select,
.income-document-filter-form .ts-wrapper.single .ts-control,
.income-document-filter-form .ts-wrapper.multi .ts-control,
.income-document-filter-form .button {
  min-height: 44px;
}

.purchase-documents-panel,
.income-documents-panel {
  padding: 16px;
}

.purchase-documents-panel,
.income-documents-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.purchase-documents-panel .bulk-action-bar,
.income-documents-panel .bulk-action-bar {
  padding: 10px;
  margin-bottom: 10px;
}

.purchase-documents-panel .purchase_document-list,
.income-documents-panel .purchase_document-list {
  gap: 8px;
}

.purchase-documents-panel .purchase_document-card-shell,
.income-documents-panel .purchase_document-card-shell {
  gap: 8px;
}

.purchase-documents-panel .purchase_document-card,
.income-documents-panel .purchase_document-card {
  gap: 10px;
  padding: 10px 14px;
}

.purchase-documents-panel .purchase_document-card-link,
.income-documents-panel .purchase_document-card-link {
  gap: 14px;
}

.purchase-documents-panel .purchase_document-main,
.income-documents-panel .purchase_document-main {
  gap: 4px;
}

.purchase-documents-panel .purchase_document-title-row strong,
.income-documents-panel .purchase_document-title-row strong {
  font-size: var(--text-base);
}

.purchase-documents-panel .purchase_document-reference,
.income-documents-panel .purchase_document-reference,
.income-documents-panel .purchase_document-signals {
  gap: 5px 10px;
  font-size: var(--text-sm);
}

.purchase-documents-panel .purchase_document-money strong,
.income-documents-panel .purchase_document-money strong {
  font-size: var(--text-lg);
}

.header-scan-progress {
  width: min(560px, 42vw);
  min-height: 42px;
  margin: 0;
  padding: 8px 14px;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 14px;
  border-radius: 10px;
  box-shadow: none;
}

.header-scan-progress .purchase-progress-icon {
  width: 22px;
  height: 22px;
}

.header-scan-progress .purchase-progress-status {
  gap: 10px;
}

.header-scan-progress .purchase-progress-track {
  height: 8px;
}

.header-scan-progress .purchase-progress-status strong,
.header-scan-progress .purchase-progress-trial {
  font-size: var(--text-xs);
}

.purchase-upload-hero .upload-target-content,
.income-upload-hero .upload-target-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.86fr);
  align-items: center;
  width: 100%;
}

.purchase-upload-hero .upload-target-notes,
.income-upload-hero .upload-target-notes {
  gap: 10px;
  border-left-color: #d8e1dc;
}

.purchase-upload-hero .upload-note-icon .icon,
.income-upload-hero .upload-note-icon .icon {
  width: 17px;
  height: 17px;
}

.purchase-list-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.select-all-control.button {
  --button-height: 36px;
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  background: #f4fbf7;
  color: var(--primary-dark);
  box-shadow: none;
}

.select-all-control .icon {
  width: 16px;
  height: 16px;
}

.purchase-selection-toolbar {
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 12px;
  background: transparent;
}

.purchase-selection-toolbar .bulk-action-buttons .button:disabled {
  opacity: 0.42;
}

.purchase-selection-toolbar .bulk-action-buttons {
  align-items: center;
}

.bulk-project-select {
  width: min(360px, 38vw);
  min-width: 220px;
}

.bulk-project-select .ts-wrapper {
  width: 100%;
}

.bulk-project-select .ts-control {
  min-height: 38px;
  border-radius: 7px;
}

.purchase-document-table,
.income-document-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.purchase-document-table-header,
.purchase-document-row,
.income-document-table-header,
.income-document-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(120px, 0.9fr) minmax(120px, 0.85fr) 112px 130px minmax(130px, 0.95fr) 112px;
  align-items: center;
  gap: 12px;
  min-width: 1060px;
}

.chase-document-table .purchase-document-table-header,
.chase-document-table .chase-document-row {
  grid-template-columns: minmax(220px, 1.05fr) minmax(130px, 0.55fr) minmax(180px, 0.8fr) 104px minmax(380px, 1.9fr) 72px;
  min-width: 1120px;
}

.chase-document-row {
  cursor: default;
}

.chase-document-row .purchase_document-card-actions {
  justify-content: flex-end;
  justify-self: end;
}

.chase-document-table .purchase-document-table-header span:nth-child(5),
.chase-required-action {
  justify-self: center;
  text-align: center;
}

.purchase-document-table-header,
.income-document-table-header {
  min-height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
}

.purchase-document-row,
.income-document-row {
  min-height: 66px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.purchase-document-row:last-child,
.income-document-row:last-child {
  border-bottom: 0;
}

.purchase-document-row:hover,
.purchase-document-row.selected,
.income-document-row:hover,
.income-document-row.selected {
  background: #eef7f2;
}

.purchase-document-row.selected,
.income-document-row.selected {
  box-shadow: inset 4px 0 0 var(--primary);
}

.purchase-document-row .document-name strong,
.income-document-row .document-name strong {
  color: var(--ink);
}

.purchase-row-file-count {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border: 1px solid #b9ddcb;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e8f6ee;
  color: #007f5f;
  font-size: var(--text-xs);
  font-weight: 800;
  font-family: inherit;
  line-height: 1.35;
  cursor: pointer;
}

.purchase-row-file-count:hover {
  border-color: #9ed5b9;
  background: #d9f0e4;
  color: #006b50;
}

.purchase-row-file-count .icon {
  width: 13px;
  height: 13px;
}

.purchase-row-attachments {
  width: fit-content;
}

.duplicate-flag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff8e8;
  color: #7a520c;
  font-size: var(--text-xs);
  font-weight: 800;
}

.purchase-document-row .purchase_document-money,
.income-document-row .purchase_document-money {
  justify-items: start;
  text-align: left;
}

.purchase-document-row .purchase_document-money strong,
.income-document-row .purchase_document-money strong {
  font-size: var(--text-base);
}

.purchase-document-row .purchase_document-money span,
.income-document-row .purchase_document-money span {
  font-size: var(--text-xs);
}

.purchase-document-row .purchase_document-card-actions,
.income-document-row .purchase_document-card-actions {
  min-width: 0;
}

.income-due-date {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.3;
}

.income-due-date em,
.income-due-pill {
  display: inline-flex;
  width: fit-content;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff6e8;
  color: #8a4b00;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
}

.income-due-date em.overdue,
.income-due-pill.overdue {
  background: #fff0ed;
  color: #b42318;
}

.purchase-show-toolbar {
  align-items: flex-start;
}

.purchase-show-status-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.purchase-show-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.purchase-show-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 16px;
}

.purchase-show-summary > div {
  display: grid;
  gap: 8px;
  padding: 22px 28px;
  border-right: 1px solid var(--line);
}

.purchase-show-summary > div:last-child {
  border-right: 0;
}

.purchase-show-summary span {
  color: var(--muted);
}

.purchase-show-summary strong {
  font-size: var(--text-xl);
}

.purchase-show-summary-total {
  background: #f3fbf7;
}

.purchase-show-summary-total strong {
  color: var(--primary);
}

.purchase-show-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
  margin-bottom: 16px;
}

.purchase-show-card {
  padding: 24px;
}

.purchase-show-card h2 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.purchase-show-details {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  gap: 22px 28px;
  margin: 0;
}

.purchase-show-details dt {
  color: var(--muted);
}

.purchase-show-details dd {
  margin: 0;
  font-weight: 700;
}

.purchase-show-attachments {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.purchase-show-attachment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.purchase-show-attachment:last-child {
  border-bottom: 0;
}

.purchase-show-attachment-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-show-attachment-name strong,
.purchase-show-attachment-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-show-attachment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-show-line-items {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.purchase-show-line-table {
  overflow-x: auto;
}

.purchase-show-line-header,
.purchase-show-line-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.5fr) minmax(220px, 1.35fr) minmax(70px, 0.35fr) minmax(80px, 0.4fr) minmax(130px, 0.75fr) minmax(130px, 0.75fr) minmax(110px, 0.6fr) minmax(90px, 0.45fr) minmax(110px, 0.6fr);
  gap: 12px;
  min-width: 1160px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.purchase-show-line-header {
  color: var(--muted);
  font-weight: 800;
  padding-top: 0;
}

.purchase-show-line-totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 28px;
  justify-self: end;
  min-width: min(360px, 100%);
  margin: 0;
}

.purchase-show-line-totals dt,
.purchase-show-line-totals dd {
  margin: 0;
}

.purchase-show-line-totals dd {
  text-align: right;
}

.purchase-show-line-totals dt:last-of-type,
.purchase-show-line-totals dd:last-of-type {
  padding: 10px 14px;
  background: #eef8f3;
  color: var(--primary);
  font-weight: 800;
}

.document-history-panel {
  margin-top: 1.25rem;
}

.document-history-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.document-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.document-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.document-history-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 34px;
  bottom: -12px;
  left: 16px;
  width: 2px;
  background: #dcefe6;
}

.document-history-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 999px;
  border: 2px solid #dcefe6;
  color: var(--primary);
  background: #f7fcf9;
}

.document-history-card {
  min-width: 0;
  border: 1px solid #dde5df;
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.document-history-card-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.document-history-card-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.document-history-actor {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
}

.document-history-item strong {
  display: block;
  font-size: 0.95rem;
}

.document-history-item time {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.document-history-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8f6ee;
  color: #007f5f;
  font-weight: 800;
  font-size: var(--text-sm);
}

.document-history-badge .icon {
  width: 16px;
  height: 16px;
}

.document-history-details {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #eef2ef;
}

.document-history-details > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.document-history-details dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.document-history-details dd {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--ink);
}

.document-history-details dd span {
  color: var(--muted);
  text-decoration: line-through;
  overflow-wrap: anywhere;
}

.document-history-details dd strong {
  display: inline;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.document-history-details dd .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--muted);
}

.document-history-empty {
  margin-bottom: 0;
}

.document-history-pagination {
  padding-top: 1rem;
}

.document-history-modal-shell {
  display: contents;
}

.document-history-dialog {
  width: min(980px, calc(100vw - 36px));
  height: auto;
  max-height: min(780px, calc(100vh - 36px));
}

.document-history-modal-panel {
  max-height: min(780px, calc(100vh - 36px));
}

.document-history-modal-heading {
  padding: 26px 28px;
}

.document-history-modal-heading::before {
  content: "";
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #e8f6ee;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23007f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 7v5l3 2'/%3E%3Cpath d='M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
}

.document-history-modal-heading > div {
  margin-right: auto;
}

.document-history-modal-heading strong {
  font-size: 1.65rem;
}

.document-history-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 26px 38px 34px;
}

.document-history-modal-body .document-history-panel {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.document-history-modal-body .document-history-heading {
  display: none;
}

.purchase-row-actions-menu {
  justify-self: end;
}

.purchase-row-actions-menu > summary.button {
  width: 36px;
  height: 36px;
  padding: 0;
  color: #4b5563;
}

.purchase-row-actions-menu[open] > summary.button,
.purchase-row-actions-menu > summary.button:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  background: #f4fbf7;
  color: var(--primary-dark);
}

.purchase-row-actions-menu .purchase-row-actions-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  width: min(240px, calc(100vw - 32px));
  padding: 7px;
}

.purchase-row-actions-list form,
.purchase-row-actions-list [data-controller="modal"] {
  display: contents;
}

.purchase-row-action {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.purchase-row-action:hover {
  background: #f4fbf7;
  color: var(--primary-dark);
}

.purchase-row-action .icon {
  width: 16px;
  height: 16px;
}

.purchase-row-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-row-action.danger {
  color: #b42318;
  font-weight: 700;
}

.purchase-row-action.danger:hover {
  background: #fff1f0;
  color: #981f15;
}

.purchase-row-action-group {
  display: grid;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .upload-hero.purchase-upload-hero,
  .upload-hero.income-upload-hero,
  .purchase-list-heading {
    grid-template-columns: 1fr;
  }

  .purchase-progress {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .purchase-progress-trial {
    justify-self: start;
  }

  .header-scan-progress {
    width: 100%;
  }

  .upload-target {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-target-content {
    justify-content: flex-start;
  }

  .purchase-upload-hero .upload-target-content,
  .income-upload-hero .upload-target-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .purchase-upload-hero .upload-target-main,
  .income-upload-hero .upload-target-main {
    gap: 18px;
  }

  .upload-target-notes {
    border-left: none;
    border-top: 1px solid rgba(26, 115, 232, 0.15);
    padding-left: 0;
    padding-top: 12px;
    margin-top: 12px;
  }
}

@media (max-width: 620px) {
  .upload-target-illustration {
    width: 142px;
    flex-basis: 142px;
  }
}

.review-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #edd5a6;
  border-radius: 8px;
  background: #fff8e8;
}

.review-banner div {
  display: grid;
  gap: 2px;
}

.review-banner span {
  color: var(--muted);
}

.purchase_document-metrics {
  margin-bottom: 18px;
}

.purchase_document-list {
  display: grid;
  gap: 12px;
}

.bulk-actions {
  display: grid;
  gap: 12px;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bulk-action-bar[hidden] {
  display: none;
}

.bulk-selection-count {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.bulk-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
}

.bulk-select input {
  width: 18px;
  height: 18px;
}

.purchase_document-card-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.purchase_document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid transparent;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.purchase_document-card:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  box-shadow: 0 10px 28px rgba(23, 32, 28, 0.1);
  transform: translateY(-1px);
}

.purchase_document-card.approved { border-left-color: var(--primary); }
.purchase_document-card.needs_review { border-left-color: var(--accent); }
.purchase_document-card.could_not_read { border-left-color: var(--danger); }
.purchase_document-card.ignored { border-left-color: var(--muted); }
.purchase_document-card.processing,
.purchase_document-card.uploaded { border-left-color: #4f6f9f; }

.purchase_document-card-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 20px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.purchase_document-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.purchase_document-title-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.1rem;
}

.purchase_document-reference,
.purchase_document-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
}

.purchase_document-reference {
  color: var(--ink);
  font-weight: 700;
}

.purchase_document-signals {
  font-size: 0.92rem;
}

.purchase_document-money {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.purchase_document-money strong {
  font-size: 1.45rem;
}

.purchase_document-money span {
  color: var(--muted);
  font-weight: 700;
}

.purchase_document-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.purchase_document-card-actions form {
  display: contents;
}

.row-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  text-decoration: none;
}

.row-card div {
  display: grid;
  gap: 4px;
}

.pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ecefeb;
  font-size: 0.85rem;
  font-weight: 700;
}

.pill.needs_review, .notice-box { background: #fff8e8; border-color: #edd5a6; }
.pill.approved { background: #e6f4ee; color: var(--primary-dark); }
.pill.planning { background: #edf3ff; color: #274978; }
.pill.active { background: #e6f4ee; color: var(--primary-dark); }
.pill.on_hold { background: #fff8e8; color: #7a520c; }
.pill.complete { background: #ecefeb; color: #4b5b58; }
.pill.needs_review { color: #7a520c; }
.pill.uploaded,
.pill.processing {
  background: #edf3ff;
  color: #274978;
}
.pill.could_not_read, .alert-box {
  background: #fff0ed;
  border-color: #e7b7ae;
  color: #8f2518;
}

.pill.could_not_read {
  box-shadow: inset 0 0 0 1px #e0a092;
}

.flash, .notice-box, .alert-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.flash.notice { background: #e6f4ee; }
.flash.alert { background: #fff0ed; }

.details {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
}

.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.compact-actions {
  align-items: center;
  justify-content: flex-end;
}

.page > .panel + .panel,
.page > .grid + .panel,
.page > .panel + .grid,
.page > .grid + .grid,
.page > .panel + .operations-grid,
.page > .operations-grid + .panel {
  margin-top: 16px;
}

.form-actions {
  align-items: center;
  justify-content: space-between;
}

.form-actions .button {
  width: auto;
}

.form-actions .button.primary {
  min-width: 160px;
}

.form-wide {
  grid-column: 1 / -1;
}

.review-action-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.approval-action-bar {
  color: var(--primary-dark);
  font-weight: var(--weight-bold);
}

.review-action-bar form {
  margin: 0;
}

.review-action-bar .compact-actions .button {
  min-width: 150px;
  width: auto;
}

.processing-status {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  color: var(--primary-dark);
}

.processing-status span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 5px #dcefe7;
}

.app-page > .purchase-edit-form {
  margin: 0;
}

.purchase-edit-form {
  display: block;
  min-height: 100vh;
  background: #f7f8fa;
}

.purchase-edit-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 40px;
  border-bottom: 1px solid #e5e8ec;
  background: #fff;
}

.purchase-edit-title,
.purchase-edit-actions,
.purchase-line-items-heading,
.purchase-line-items-actions {
  display: flex;
  align-items: center;
}

.purchase-edit-title {
  gap: 18px;
  min-width: 0;
}

.purchase-edit-title h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0;
}

.purchase-edit-subtitle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 0;
  font-size: var(--text-sm);
}

.purchase-edit-subtitle span + span::before {
  content: "-";
  margin-right: 10px;
  color: #94a3b8;
}

.purchase-read-only-form input[readonly],
.purchase-read-only-form textarea[readonly],
.purchase-read-only-form select:disabled,
.purchase-read-only-form .ts-wrapper.disabled .ts-control {
  min-height: auto;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #111827;
  -webkit-text-fill-color: #111827;
  opacity: 1;
  cursor: default;
}

.purchase-read-only-form select:disabled {
  appearance: none;
}

.purchase-read-only-form textarea[readonly] {
  resize: none;
}

.purchase-read-only-form input[type="date"][readonly]::-webkit-calendar-picker-indicator,
.purchase-read-only-form input[type="number"][readonly]::-webkit-outer-spin-button,
.purchase-read-only-form input[type="number"][readonly]::-webkit-inner-spin-button {
  display: none;
  appearance: none;
}

.purchase-read-only-form .purchase-field input[readonly],
.purchase-read-only-form .purchase-field select:disabled {
  min-height: 24px;
  font-weight: 700;
}

.purchase-read-only-form .purchase-summary-lines select:disabled {
  border: 0;
  text-align: right;
  font: inherit;
}

.purchase-read-only-form .line-item input[readonly],
.purchase-read-only-form .line-item select:disabled,
.purchase-read-only-form .purchase-section-header select:disabled {
  min-height: 24px;
  width: 100%;
}

.purchase-read-only-value {
  justify-self: end;
  color: #111827;
}

.purchase-read-only-form .line-item-grip-placeholder {
  cursor: default;
}

.purchase-back-link,
.purchase-icon-button {
  width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  cursor: pointer;
}

.purchase-back-link:hover,
.purchase-icon-button:hover {
  background: #f4f7f6;
}

.purchase-edit-actions {
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
}

.purchase-edit-actions .button {
  white-space: nowrap;
}

.purchase-secondary-button {
  min-width: 104px;
  border-color: #d7dee5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.purchase-approve-button {
  min-width: 204px;
  justify-content: center;
  background: #007f5f;
  border-color: #007f5f;
  box-shadow: 0 8px 18px rgba(0, 127, 95, 0.16);
}

.purchase-edit-screen {
  display: grid;
  gap: 24px;
  padding: 30px 40px 32px;
  background: #f7f8fa;
}

.purchase-document-secondary {
  padding-top: 0;
}

.purchase-edit-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.52fr);
  gap: 28px;
}

.purchase-edit-panel {
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.purchase-details-panel,
.purchase-summary-panel,
.purchase-notes-panel {
  padding: 28px;
}

.purchase-edit-panel h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 800;
}

.purchase-document-secondary > .panel {
  margin-top: 0;
  padding: 28px;
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.purchase-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.purchase-panel-heading h2 {
  margin: 0;
}

.purchase-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.purchase-panel-title .icon {
  width: 24px;
  height: 24px;
  color: #007f5f;
}

.purchase-details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 22px 24px;
}

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

.purchase-field label,
.purchase-notes-panel label {
  font-size: 0.92rem;
  font-weight: 800;
}

.purchase-field input,
.purchase-field select,
.purchase-field .ts-wrapper.single .ts-control,
.purchase-field .ts-wrapper.multi .ts-control {
  min-height: 50px;
  border-color: #dce2e6;
  border-radius: 7px;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.purchase-summary-panel {
  min-height: 228px;
}

.purchase-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.purchase-summary-heading h2 {
  margin: 0;
}

.purchase-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #eef2f6;
  color: #374151;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.purchase-status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}

.purchase-status-pill.approved {
  background: #e8f6ee;
  color: #007f5f;
}

.purchase-status-pill.needs_review,
.purchase-status-pill.could_not_read {
  background: #fff4e4;
  color: #a15c00;
}

.purchase-status-pill.uploaded,
.purchase-status-pill.processing {
  background: #eaf2ff;
  color: #1d4ed8;
}

.purchase-summary-lines {
  display: grid;
  gap: 13px;
}

.purchase-summary-lines label {
  display: grid;
  grid-template-columns: 1fr minmax(120px, auto);
  gap: 16px;
  align-items: center;
  font-weight: 400;
}

.purchase-summary-lines input {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: right;
  font-weight: 400;
  color: #111827;
  appearance: textfield;
}

.purchase-summary-lines input::-webkit-outer-spin-button,
.purchase-summary-lines input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.purchase-summary-total {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid #dfe4e8;
  font-weight: 800 !important;
}

.purchase-summary-total input {
  color: #007f5f;
  font-size: 1.55rem;
  font-weight: 800;
}

.purchase-advanced-tax {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dfe4e8;
}

.purchase-advanced-tax summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.purchase-advanced-tax summary::-webkit-details-marker {
  display: none;
}

.purchase-advanced-tax summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: translateY(-2px) rotate(45deg);
}

.purchase-advanced-tax[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.purchase-advanced-tax summary small {
  margin-left: auto;
  color: #64748b;
  font-size: var(--text-xs);
  font-weight: 700;
}

.purchase-advanced-tax .purchase-summary-lines {
  margin-top: 14px;
}

.purchase-help-label > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.purchase-help-label > span small {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: help;
}

.purchase-line-items-panel {
  overflow: hidden;
}

.purchase-line-items-heading {
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border-bottom: 1px solid #dfe4e8;
}

.purchase-line-items-heading h2 {
  margin-bottom: 6px;
}

.purchase-line-items-heading p {
  margin: 0;
}

.purchase-line-items-actions {
  gap: 18px;
}

.purchase-line-items-bulk {
  position: relative;
}

.purchase-line-items-bulk > summary {
  width: max-content;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
}

.purchase-bulk-set-button {
  gap: 10px;
  padding-inline: 16px 18px;
  border-color: #d8e1e6;
  background: #fff;
  color: #17202a;
}

.purchase-bulk-set-button .icon {
  width: 19px;
  height: 19px;
  color: #007f5f;
}

.purchase-bulk-set-button:hover {
  border-color: #a9cfc2;
  background: #f7fbf9;
}

.purchase-line-items-bulk > summary::-webkit-details-marker {
  display: none;
}

.purchase-line-items-bulk-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) auto minmax(200px, 0.9fr) auto;
  align-items: end;
  gap: 10px;
  width: min(760px, calc(100vw - 80px));
  padding: 14px;
  border: 1px solid #d8e1e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgb(15 23 42 / 14%);
}

.purchase-line-items-bulk-panel label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: 700;
}

.purchase-line-items-bulk-panel select,
.purchase-line-items-bulk-panel .ts-wrapper.single .ts-control,
.purchase-line-items-bulk-panel .ts-wrapper.multi .ts-control {
  min-height: 42px;
}

.purchase-line-items-bulk-panel .button {
  min-height: 42px;
}

.purchase-add-item-button {
  min-width: 148px;
  background: #007f5f;
  border-color: #007f5f;
}

.purchase-line-items {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-x: auto;
}

.purchase-line-items .line-items-header,
.purchase-line-items .line-item {
  min-width: 1360px;
  grid-template-columns: 32px minmax(130px, 0.75fr) minmax(270px, 1.7fr) minmax(76px, 0.42fr) minmax(92px, 0.52fr) minmax(150px, 0.85fr) minmax(110px, 0.62fr) minmax(120px, 0.68fr) minmax(118px, 0.68fr) 32px;
  gap: 14px;
}

.purchase-line-items .line-items-header {
  padding: 17px 28px 11px;
  color: #303a45;
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
}

.purchase-sections {
  display: grid;
}

.purchase-section {
  min-width: 1360px;
  border-top: 1px solid #e8edf0;
}

.purchase-section[hidden] {
  display: none;
}

.purchase-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: #f8fbfa;
}

.purchase-section-header label {
  display: grid;
  gap: 6px;
  min-width: 260px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.purchase-section-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-section-items {
  display: grid;
}

.purchase-line-items .line-item {
  padding: 11px 28px;
  border-top: 1px solid #e8edf0;
}

.line-item[hidden],
.purchase-line-items .line-item[hidden],
.purchase-line-items .line-item.line-item-removed {
  display: none;
}

.purchase-line-items .line-item input,
.purchase-line-items .line-item .ts-wrapper.single .ts-control,
.purchase-line-items .line-item .ts-wrapper.multi .ts-control {
  min-height: 54px;
  border-color: #dce2e6;
  border-radius: 7px;
}

.line-item-grip {
  width: 32px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5d6873;
  cursor: grab;
}

.line-item-grip:active {
  cursor: grabbing;
}

body.line-item-drag-active,
body.line-item-drag-active * {
  cursor: grabbing !important;
}

.line-item-grip .icon,
.remove-line-item .icon {
  width: 20px;
  height: 20px;
}

.purchase-line-items .line-item.dragging {
  opacity: 0.55;
  background: #f4f8f6;
}

.remove-line-item-control {
  display: inline-grid;
  place-items: center;
  justify-self: end;
}

.remove-line-item {
  width: 32px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
}

.remove-line-item-control input[name$="[_destroy]"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.purchase-line-items-footer {
  min-width: 1360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 28px 20px;
  border-top: 1px solid #e8edf0;
}

.purchase-line-items-footer span:first-child {
  grid-column: auto;
}

.purchase-line-items-note {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.purchase-read-only-form .purchase-line-items .line-items-header,
.purchase-read-only-form .purchase-line-items .line-item {
  min-width: 1120px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(260px, 1.7fr) minmax(70px, 0.42fr) minmax(74px, 0.45fr) minmax(150px, 0.9fr) minmax(105px, 0.62fr) minmax(125px, 0.7fr) minmax(105px, 0.62fr);
  gap: 16px;
}

.purchase-read-only-form .purchase-line-items .line-items-header {
  padding-block: 14px 12px;
  color: #475569;
  background: #fbfcfd;
  font-size: 0.82rem;
  font-weight: 800;
}

.purchase-read-only-form .purchase-line-items .line-items-header span:first-child,
.purchase-read-only-form .purchase-line-items .line-items-header span:last-child,
.purchase-read-only-form .line-item-grip-placeholder,
.purchase-read-only-form .remove-line-item-control {
  display: none;
}

.purchase-read-only-form .purchase-section {
  min-width: 1120px;
}

.purchase-read-only-form .purchase-section-header {
  display: grid;
  grid-template-columns: minmax(220px, max-content) minmax(260px, max-content);
  justify-content: start;
  align-items: start;
  column-gap: 56px;
  row-gap: 10px;
  padding-block: 12px;
  background: #f8fafb;
}

.purchase-read-only-form .purchase-section-header label {
  gap: 5px;
  min-width: 0;
  max-width: 420px;
}

.purchase-read-only-form .purchase-section-header label span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.purchase-read-only-form .purchase-line-items .line-item {
  align-items: start;
  padding-block: 13px;
  color: #111827;
}

.purchase-read-only-form .line-item-field {
  min-width: 0;
}

.purchase-read-only-form .line-item-description {
  gap: 4px;
}

.purchase-read-only-form .purchase-line-items .line-item input[readonly],
.purchase-read-only-form .purchase-line-items .line-item select:disabled,
.purchase-read-only-form .purchase-section-header select:disabled {
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #111827;
  -webkit-text-fill-color: #111827;
  font: inherit;
  line-height: 1.35;
}

.purchase-read-only-form .purchase-line-items .line-item input[readonly],
.purchase-read-only-form .purchase-line-items .line-item select:disabled {
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-read-only-form .purchase-line-items .line-item input[type="number"][readonly] {
  text-align: left;
}

.purchase-read-only-form .catalogue-suggestion {
  margin-top: 2px;
}

.purchase-read-only-form .catalogue-suggestion strong {
  padding: 2px 7px;
  border-radius: 5px;
  background: #edf7f0;
  color: #0f6b3c;
  font-size: 0.72rem;
}

.purchase-read-only-form .purchase-line-items-footer {
  min-width: 1120px;
  padding-block: 14px 16px;
  color: #475569;
}

.purchase-read-only-form .income-document-line-items .line-items-header,
.purchase-read-only-form .income-document-line-items .line-item {
  min-width: 980px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(280px, 1.8fr) minmax(70px, 0.42fr) minmax(76px, 0.45fr) minmax(115px, 0.68fr) minmax(120px, 0.72fr) minmax(110px, 0.64fr);
}

.purchase-read-only-form .income-document-line-items .purchase-line-items-footer {
  min-width: 980px;
}

.purchase-notes-panel {
  display: grid;
  gap: 9px;
}

.purchase-notes-panel label span {
  color: var(--muted);
  font-weight: 400;
}

.purchase-notes-panel textarea {
  min-height: 112px;
  resize: vertical;
  border-color: #dce2e6;
}

.purchase-review-notice {
  margin: 0;
}

.purchase-files-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.purchase-attachments-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.purchase-attachments-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 5px;
}

.purchase-attachments-heading p {
  margin: 0;
}

.purchase-attachments-heading h2 span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f6ee;
  color: #007f5f;
  font-size: 0.74rem;
  font-weight: 800;
}

.purchase-attachment-list {
  display: grid;
  gap: 8px;
}

.purchase-attachment-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dfe5ea;
  border-radius: 7px;
  background: #fff;
}

.purchase-file-badge {
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #b9ddcb;
  border-radius: 4px;
  background: #eefaf3;
  color: #007f5f;
  font-size: 0.75rem;
  font-weight: 900;
}

.purchase-attachment-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-attachment-main strong,
.purchase-attachment-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-attachment-main span,
.purchase-attachment-summary {
  color: var(--muted);
  font-size: 0.86rem;
}

.purchase-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.purchase-attachment-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.purchase-attachment-action .icon,
.purchase-attachment-remove .icon {
  width: 16px;
  height: 16px;
}

.purchase-attachment-dropzone {
  position: relative;
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 22px;
  border: 1.5px dashed #82c7a4;
  border-radius: 8px;
  background: #f7fcf9;
  color: #1f2937;
  text-align: center;
  cursor: pointer;
}

.purchase-attachment-dropzone .icon {
  width: 34px;
  height: 34px;
  color: #007f5f;
}

.purchase-attachment-dropzone span,
.purchase-attachment-dropzone em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
}

.purchase-attachment-dropzone em {
  font-weight: 700;
}

.purchase-attachment-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.purchase-attachment-dropzone.drag-active,
.purchase-attachment-dropzone:focus-within {
  border-color: #007f5f;
  background: #eefaf3;
  box-shadow: 0 0 0 3px rgba(0, 127, 95, 0.12);
}

.purchase-attachment-direct-form {
  display: none;
}

.purchase-attachment-queue {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #fff;
  min-height: 0;
  max-height: min(330px, 38vh);
  overflow: hidden;
}

.purchase-attachment-queue[hidden] {
  display: none;
}

.purchase-attachment-queue h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.purchase-attachment-queue .purchase-attachment-list {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.purchase-attachment-queue .purchase-attachment-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 8px 10px;
}

.purchase-attachment-queue .purchase-file-badge {
  min-width: 36px;
  min-height: 36px;
}

.purchase-attachment-queue .purchase-attachment-main {
  gap: 2px;
}

.purchase-attachment-remove {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #f0b5af;
  border-radius: 6px;
  background: #fff;
  color: #b42318;
  cursor: pointer;
}

.purchase-attachments-empty {
  margin: 0;
}

.purchase-preview-dialog {
  width: min(1120px, calc(100vw - 36px));
  height: min(820px, calc(100vh - 36px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 26, 23, 0.24);
}

.purchase-preview-dialog::backdrop {
  background: rgba(12, 18, 15, 0.58);
}

.purchase-preview-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
}

.purchase-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe5ea;
}

.purchase-preview-heading div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.purchase-preview-heading strong,
.purchase-preview-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-preview-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

.purchase-preview-close {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #dfe5ea;
  border-radius: 7px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
}

.purchase-preview-close .icon {
  width: 18px;
  height: 18px;
}

.purchase-preview-body {
  min-height: 0;
  display: grid;
  place-items: center;
  background: #f3f6f8;
}

.purchase-preview-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.purchase-preview-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.purchase-preview-stack {
  align-content: stretch;
  place-items: stretch;
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.purchase-preview-file {
  min-height: min(680px, calc(100vh - 170px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #fff;
}

.purchase-preview-file header {
  padding: 10px 12px;
  border-bottom: 1px solid #dfe5ea;
  color: var(--ink);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-preview-file iframe,
.purchase-preview-file img {
  min-height: 0;
}

.purchase-preview-download-only {
  min-height: auto;
}

.purchase-preview-download-list {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.purchase-index-attachment-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 18px;
  background: #f6f8fa;
}

.purchase-attachments-button {
  gap: 8px;
}

.purchase-attachments-button .icon {
  width: 17px;
  height: 17px;
}

.purchase-attachments-button em {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f6ee;
  color: #007f5f;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.income-document-attachments-button {
  min-height: 42px;
  padding: 0 10px 0 14px;
  border-color: #b7d8ca;
  background: #f2fbf7;
  color: #075e49;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 118, 88, 0.08);
}

.income-document-attachments-button:hover,
.income-document-attachments-button:focus-visible {
  border-color: #0f8f6f;
  background: #e8f8f1;
  color: #064e3b;
}

.income-document-attachments-button .icon {
  color: #0f8f6f;
}

.income-document-attachments-button em {
  background: #0f8f6f;
  color: #fff;
}

.purchase-attachments-dialog {
  width: min(1160px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 36px));
}

.purchase-attachments-modal-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.purchase-attachments-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: #fff;
}

.purchase-attachments-modal-body .purchase-files-panel {
  border: 0;
  box-shadow: none;
}

.purchase-attachments-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #dfe5ea;
  background: #fff;
}

.purchase-attachments-modal-hero {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
  border-bottom: 1px solid #dfe5ea;
  background: #fff;
}

.purchase-attachments-hero-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f6ee;
  color: #007f5f;
}

.purchase-attachments-hero-icon .icon {
  width: 22px;
  height: 22px;
}

.purchase-attachments-hero-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.purchase-attachments-hero-copy strong {
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 900;
}

.purchase-attachments-hero-copy span,
.purchase-attachments-hero-copy small {
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.purchase-attachments-hero-copy small {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.purchase-attachments-hero-copy small .icon {
  width: 15px;
  height: 15px;
}

.purchase-attachments-workspace {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.1fr);
  background: #fff;
}

.purchase-attachments-files-pane,
.purchase-attachments-preview-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}

.purchase-attachments-files-pane {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-right: 1px solid #dfe5ea;
}

.purchase-attachments-preview-pane {
  align-content: start;
  overflow: auto;
}

.purchase-attachments-pane-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.purchase-attachment-browser-list {
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.purchase-attachment-browser-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 12px;
}

.purchase-attachment-browser-row.selected {
  border-color: #9ed5b9;
  background: #f4fbf7;
}

.purchase-attachment-select {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.purchase-attachment-browser-row .purchase-attachment-actions {
  justify-content: flex-start;
  padding-left: 55px;
  margin-top: 10px;
}

.purchase-attachment-menu-actions .button {
  min-height: 32px;
  padding-inline: 10px;
}

.purchase-attachment-compact-dropzone {
  min-height: 68px;
  padding: 12px;
  gap: 4px;
  border-color: #9ed5b9;
  background: #f7fcf9;
  color: #174a37;
}

.purchase-attachment-compact-dropzone .icon {
  width: 20px;
  height: 20px;
}

.purchase-attachments-preview-frame {
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f5;
}

.purchase-attachments-preview-frame iframe {
  width: 100%;
  height: min(470px, calc(100vh - 286px));
  min-height: 300px;
  border: 0;
  background: #fff;
}

.purchase-attachments-preview-frame img {
  width: 100%;
  max-height: min(470px, calc(100vh - 286px));
  object-fit: contain;
}

.purchase-attachments-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.purchase-attachments-preview-actions .button {
  min-width: 0;
}

.purchase-attachments-preview-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed #c8d2dc;
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--muted);
  text-align: center;
}

.purchase-attachments-preview-empty .icon {
  width: 34px;
  height: 34px;
  color: #007f5f;
}

.purchase-attachments-preview-empty strong {
  color: var(--ink);
}

.purchase-attachments-preview-actions .button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.file-list { display: grid; gap: 8px; }

.supporting-documents-panel {
  display: grid;
  gap: 14px;
}

.supporting-documents-heading {
  margin-bottom: 0;
}

.supporting-document-list,
.supporting-document-sections {
  display: grid;
  gap: 10px;
}

.supporting-document-section {
  display: grid;
  gap: 8px;
}

.supporting-document-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  text-transform: uppercase;
}

.supporting-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #edf1ed;
}

.supporting-document-row:first-child {
  border-top: 0;
}

.supporting-document-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.supporting-document-form {
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1fr) auto;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.supporting-document-form.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.supporting-document-form input[type="file"] {
  min-height: 42px;
}

.supporting-document-file-field {
  min-width: 0;
  width: max-content;
  max-width: 100%;
}

.supporting-document-file-dropzone {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px dashed #b7d8ca;
  border-radius: 8px;
  background: #f2fbf7;
  color: #075e49;
  cursor: pointer;
  font-weight: 800;
}

.supporting-document-file-dropzone:hover,
.supporting-document-file-dropzone:focus-within {
  border-color: #0f8f6f;
  background: #e8f8f1;
  box-shadow: 0 0 0 3px rgba(15, 143, 111, 0.12);
}

.supporting-document-file-dropzone .icon {
  width: 18px;
  height: 18px;
  color: #0f8f6f;
  flex: 0 0 auto;
}

.supporting-document-file-dropzone span,
.supporting-document-file-dropzone em {
  min-width: 0;
}

.supporting-document-file-dropzone em {
  color: #64748b;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.supporting-document-file-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.metric {
  display: grid;
  gap: 10px;
}

.metric span { color: var(--muted); }
.metric strong { font-size: var(--text-2xl); }
.metric small {
  color: var(--muted);
  font-weight: var(--weight-bold);
}

.metric.highlight {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
}

.metric.attention {
  background: #fff8e8;
  border-color: #edd5a6;
}

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

.trend-up { color: var(--danger) !important; }
.trend-down { color: var(--primary-dark) !important; }

.dashboard-toolbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.toolbar-alert {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid #edd5a6;
  border-radius: 999px;
  background: #fff8e8;
  color: #7a520c;
  text-decoration: none;
  font-weight: var(--weight-bold);
  white-space: nowrap;
}

.toolbar-alert:hover {
  border-color: #d9b46d;
  background: #fff3d8;
}

.toolbar-alert .icon {
  width: 17px;
  height: 17px;
}

.toolbar-alert span {
  min-width: 22px;
  text-align: center;
}

.toolbar-alert small {
  font-size: var(--text-sm);
}

#needs-attention {
  scroll-margin-top: 90px;
}

.compact-actions {
  margin-top: 0;
}

.page-header-actions {
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.page-header-actions .button {
  white-space: nowrap;
}

.dashboard-filter-form {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 200px) minmax(160px, 200px) minmax(140px, auto);
}

.dashboard-metrics {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-metrics .metric {
  min-height: 126px;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.dashboard-metrics .metric span {
  font-size: var(--text-sm);
}

.dashboard-metrics .metric strong {
  font-size: clamp(1.55rem, 2vw, 1.85rem);
  line-height: 1.05;
}

.dashboard-metrics .metric small,
.dashboard-metrics .metric-link {
  margin-top: auto;
  font-size: var(--text-sm);
}

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.dashboard-panel .section-heading {
  margin-bottom: 0;
}

.dashboard-panel h2 {
  margin-bottom: 8px;
}

.dashboard-empty {
  margin: 0;
  padding-top: 2px;
  color: var(--muted);
}

.dashboard-empty-state {
  display: grid;
  gap: 8px;
  align-content: start;
  color: var(--muted);
}

.dashboard-empty-state p {
  margin: 0;
}

.supplier-totals-panel {
  margin-bottom: 0;
}

.bar-list,
.compact-list {
  display: grid;
  gap: 12px;
}

.trend-list {
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.35fr) minmax(180px, 1fr) minmax(104px, auto);
  gap: 16px;
  align-items: center;
}

.bar-row span {
  color: var(--muted);
  font-weight: 700;
}

.bar-row strong {
  text-align: right;
}

.bar-track,
.mini-track {
  overflow: hidden;
  width: 100%;
  background: #edf1ed;
  border-radius: 999px;
}

.bar-track {
  height: 12px;
}

.bar-fill,
.mini-fill {
  height: 100%;
  min-width: 4px;
  background: var(--primary);
  border-radius: inherit;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.compact-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.compact-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.compact-row span:not(.pill) {
  color: var(--muted);
  font-size: 0.9rem;
}

.compact-pill {
  flex: 0 0 auto;
  margin-top: 1px;
  white-space: nowrap;
}

.attention-subsection {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.attention-subsection h3 {
  margin: 0;
  font-size: 1rem;
}

.project-profit-panel {
  margin-bottom: 14px;
}

.project-profit-list {
  display: grid;
  gap: 12px;
}

.project-profit-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(360px, 1.3fr);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.project-profit-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-profit-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-profit-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.project-profit-row dl div {
  display: grid;
  gap: 3px;
}

.project-profit-row dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-profit-row dd {
  margin: 0;
  font-weight: 700;
}

.dashboard-breakdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

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

.operations-panel {
  margin-bottom: 0;
}

.breakdown-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.table-scroll {
  overflow-x: auto;
}

.totals-table th,
.totals-table td {
  padding: 10px 16px 10px 0;
  white-space: nowrap;
}

.totals-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.totals-table th:first-child,
.totals-table td:first-child {
  white-space: normal;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(180px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.breakdown-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.breakdown-row div:first-child {
  display: grid;
  gap: 4px;
}

.breakdown-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.breakdown-total {
  display: grid;
  gap: 6px;
  text-align: right;
}

.export-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0;
}

.export-summary-card {
  display: grid;
  grid-template-rows: minmax(2.8em, auto) auto;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: inherit;
  text-decoration: none;
}

a.export-summary-card:hover,
a.export-quality-card:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  background: #f1f7f1;
}

.export-summary span,
.export-summary-card span {
  color: var(--muted);
  font-weight: 700;
}

.export-summary strong,
.export-summary-card strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.export-panel {
  display: grid;
  gap: 18px;
}

.export-panel .panel-heading {
  margin-bottom: 0;
}

.export-note h2,
.export-note p {
  margin-top: 0;
}

.export-note p {
  margin-bottom: 0;
}

.export-quality {
  display: grid;
  gap: 12px;
}

.export-quality h2,
.export-quality p {
  margin: 0;
}

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

.export-quality-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: inherit;
  text-decoration: none;
}

.export-quality-card.attention {
  background: #fff8e8;
  border-color: #edd5a6;
}

.export-quality-list span {
  color: var(--muted);
  font-weight: 700;
}

.export-filter-form {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 200px) minmax(160px, 200px) 44px;
  margin-top: 4px;
}

.filter-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #edd5a6;
  border-radius: 8px;
  background: #fff8e8;
  color: #4b5560;
}

.export-actions {
  margin-top: 0;
}

.download-button {
  gap: 8px;
}

.download-button .icon {
  width: 17px;
  height: 17px;
}

.row-editor .inline-edit.export-menu-list {
  grid-template-columns: 1fr;
  gap: 0;
  width: min(220px, calc(100vw - 32px));
  min-width: 0;
  padding: 6px;
}

.row-editor .inline-edit.export-menu-list a {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.row-editor .inline-edit.export-menu-list a:hover {
  background: #f8faf8;
}

.settings-page {
  display: grid;
  gap: 16px;
}

.settings-page .dashboard-app-header,
.settings-page .app-page-subtitle {
  margin-bottom: 0;
}

.settings-forwarding-card,
.settings-install-card,
.settings-action-card {
  border: 1px solid #dde5e0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.settings-forwarding-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(150px, 220px);
  gap: 18px 22px;
  align-items: start;
  min-height: 242px;
  padding: 34px 32px 28px;
  overflow: hidden;
}

.settings-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 1px solid #d4e8e0;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef8f4, #dfefe9);
  color: var(--primary);
}

.settings-card-icon .icon {
  width: 29px;
  height: 29px;
  stroke-width: 2.2;
}

.settings-card-icon-small {
  width: 48px;
  height: 48px;
}

.settings-card-icon-small .icon {
  width: 24px;
  height: 24px;
}

.settings-forwarding-content {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.settings-card-heading h2,
.settings-action-card h2 {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 8px;
  color: #111827;
  font-size: 1.35rem;
}

.settings-card-heading p,
.settings-action-card p {
  margin: 0;
  color: #4b5563;
  line-height: 1.5;
}

.settings-copy-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid #dbe7e1;
  border-radius: 8px;
  background: #fbfdfc;
}

.settings-copy-box strong {
  min-width: 0;
  padding: 0 22px;
  overflow: hidden;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-copy-button {
  height: calc(100% - 8px);
  margin-right: 4px;
  border-color: #dbe7e1;
  color: var(--primary);
  font-weight: 800;
}

.settings-copy-button .icon,
.settings-action-button .icon {
  width: 19px;
  height: 19px;
}

.settings-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #5f6b7a;
}

.settings-note .icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: #6b7280;
}

.settings-mail-illustration {
  align-self: center;
  justify-self: center;
  width: min(172px, 100%);
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(0, 111, 82, 0.12));
}

.settings-install-card {
  padding: 18px 24px;
}

.settings-install-help summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.settings-install-help summary::-webkit-details-marker {
  display: none;
}

.settings-install-help summary strong {
  color: #111827;
  font-size: 1.05rem;
}

.settings-install-chevron {
  display: inline-flex;
  color: #4b5563;
  transition: transform 0.16s ease;
}

.settings-install-chevron .icon {
  width: 22px;
  height: 22px;
}

.settings-install-help[open] .settings-install-chevron {
  transform: rotate(180deg);
}

.settings-install-help div {
  display: grid;
  gap: 8px;
  margin: 16px 0 0 66px;
}

.settings-install-help p {
  margin: 0;
}

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

.inbound-inbox-page {
  display: grid;
  gap: 24px;
}

.inbound-email-panel {
  padding: 22px;
}

.inbound-email-panel .panel-heading {
  margin-bottom: 18px;
}

.inbound-email-panel .panel-heading h2 {
  margin-bottom: 8px;
}

.settings-action-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px 18px;
  align-content: start;
  min-height: 190px;
  padding: 28px;
}

.settings-action-card .settings-action-button {
  grid-column: 2;
  justify-self: start;
  min-width: 176px;
  margin-top: 6px;
  box-shadow: 0 8px 18px rgba(0, 111, 82, 0.18);
}

.settings-integration-card {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-column: 1 / -1;
  min-height: 0;
}

.settings-integration-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.settings-integration-heading h2 {
  margin: 0;
}

.settings-integration-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-integration-status.connected {
  background: #e8f6ee;
  color: #007f5f;
}

.settings-integration-status.error {
  background: #fff4e4;
  color: #a15c00;
}

.settings-integration-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 18px 0 0;
}

.settings-integration-details div {
  min-width: 0;
}

.settings-integration-details dt {
  margin-bottom: 3px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-integration-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-weight: 800;
}

.settings-integration-actions {
  align-self: end;
  justify-self: end;
}

.settings-integration-actions form {
  margin: 0;
}

.settings-integration-card .settings-action-button {
  grid-column: auto;
  margin-top: 0;
}

.settings-integration-action-stack {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.xero-mapping-panel {
  display: grid;
  gap: 18px;
}

.xero-mapping-table {
  display: grid;
  gap: 8px;
}

.xero-mapping-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(100px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e5ece8;
  border-radius: 8px;
  background: #fff;
}

.xero-mapping-header {
  background: #f8faf8;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.xero-mapping-row input {
  min-width: 0;
}

.accounting-sync-notice {
  border-color: #dbeafe;
  background: #f8fbff;
}

.accounting-sync-heading,
.accounting-sync-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.accounting-sync-heading {
  justify-content: space-between;
  margin-bottom: 8px;
}

.accounting-sync-heading h2 {
  margin: 0;
}

.accounting-sync-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.78rem;
  font-weight: 800;
}

.accounting-sync-pill.synced,
.accounting-sync-pill.imported {
  background: #dff2eb;
  color: #006f52;
}

.accounting-sync-pill.sync_pending,
.accounting-sync-pill.syncing {
  background: #e0f2fe;
  color: #075985;
}

.accounting-sync-pill.sync_failed {
  background: #fee2e2;
  color: #991b1b;
}

.accounting-sync-actions {
  margin-top: 12px;
}

.accounting-sync-actions .button .icon {
  width: 17px;
  height: 17px;
}

.billing-panel {
  display: grid;
  gap: 16px;
}

.billing-panel h1,
.billing-panel p {
  margin: 0;
}

.billing-summary-list {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.billing-summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.billing-summary-list div:first-child {
  border-top: 0;
}

.billing-summary-list dt {
  color: var(--muted);
  font-weight: 700;
}

.billing-summary-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.mini-track {
  height: 8px;
  align-self: end;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

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

.stacked-actions {
  display: grid;
  gap: 0.65rem;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-user-row > div {
  display: grid;
  gap: 0.15rem;
}

.admin-delete-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-delete-form input {
  min-height: 36px;
}

.inline-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.management-list {
  display: grid;
  gap: 12px;
}

.management-card {
  display: grid;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.management-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.management-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.management-card .management-row {
  padding: 0;
  border-top: 0;
}

.team-overview-panel,
.team-members-panel,
.team-member-edit-panel {
  display: grid;
  gap: 16px;
}

.team-invite-card {
  display: grid;
  grid-template-columns: auto minmax(260px, 0.75fr) minmax(380px, 1.25fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.team-invite-card h2,
.team-member-profile-card h2,
.team-card-section-heading h2 {
  margin: 0;
}

.team-card-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e7f4ef;
  color: #007f5f;
}

.team-card-icon .icon {
  width: 21px;
  height: 21px;
}

.team-overview-panel {
  grid-template-columns: minmax(360px, 1.4fr) minmax(320px, 0.9fr);
  align-items: end;
  padding: 20px;
}

.team-invite-panel {
  display: grid;
  gap: 14px;
}

.team-invite-panel .panel-heading {
  margin-bottom: 0;
}

.team-invite-form {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, auto);
  align-items: end;
  gap: 12px;
}

.team-invite-card .team-invite-form {
  grid-template-columns: minmax(240px, 1fr) minmax(130px, auto);
}

.team-members-heading {
  margin-bottom: 0;
}

.team-filter-form {
  grid-template-columns: minmax(320px, 1.35fr) minmax(200px, 0.85fr) minmax(200px, 0.85fr) 44px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.team-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-self: stretch;
}

.team-stat-strip article {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.team-stat-strip strong {
  font-size: var(--text-2xl);
}

.team-stat-strip span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.team-member-table {
  display: grid;
  gap: 0;
}

.team-member-table-header,
.team-member-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(120px, 0.7fr) minmax(140px, 0.8fr) minmax(110px, 0.6fr) minmax(106px, auto);
  gap: 14px;
  align-items: center;
}

.team-member-table-header {
  padding: 4px 4px 10px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}

.team-member-row {
  min-height: 72px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
}

.team-member-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.team-member-person > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-member-person strong,
.team-member-person span {
  overflow-wrap: anywhere;
}

.team-member-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e7f4ef;
  color: #006f52;
  font-weight: var(--weight-bold);
}

.team-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.team-member-actions form {
  margin: 0;
}

.team-member-actions .button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.team-member-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 22px;
}

.team-member-avatar.large {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  font-size: var(--text-xl);
}

.team-member-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.team-member-detail-card,
.team-member-files-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.team-card-section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.team-card-section-heading .team-card-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.team-card-section-heading .team-card-icon .icon {
  width: 18px;
  height: 18px;
}

.team-member-form {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 18px;
}

.team-member-edit-heading {
  align-items: center;
}

.team-member-edit-heading h2 {
  overflow-wrap: anywhere;
}

.team-member-checkbox {
  width: fit-content;
  min-height: 34px;
}

.team-member-form-section {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5ebef;
}

.team-member-form-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.team-member-field-grid {
  display: grid;
  gap: 14px;
}

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

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

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

.team-member-form-section textarea {
  min-height: 96px;
}

.team-member-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.team-member-meta div {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.team-member-meta dt {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.team-member-meta dd {
  margin: 4px 0 0;
  font-weight: var(--weight-bold);
}

.team-member-form .form-actions {
  grid-column: 1 / -1;
}

.team-file-summary {
  min-height: 134px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid #e4e8ee;
  border-radius: 8px;
  background: #f5f7f8;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.team-file-summary:hover {
  border-color: #b7d7cd;
  background: #f1f8f5;
}

.team-file-summary .icon {
  width: 28px;
  height: 28px;
  color: #007f5f;
}

.team-file-summary strong {
  font-size: var(--text-lg);
}

.team-file-summary span {
  color: var(--muted);
}

.team-files-dialog .purchase-attachments-modal-panel {
  max-width: min(1120px, calc(100vw - 32px));
}

.team-files-dialog[open] {
  position: fixed;
  inset: 0;
  width: min(1180px, calc(100vw - 64px));
  height: min(760px, calc(100vh - 64px));
  margin: auto;
}

.user-documents-workspace {
  display: grid;
  gap: 16px;
  padding: 20px 22px 0;
  background: #fff;
}

.user-documents-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.user-document-stat {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 88px;
  padding: 18px;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #fff;
}

.user-document-stat-icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #e8f6ee;
  color: #007f5f;
}

.user-document-stat-icon.warning {
  background: #fff3df;
  color: #d97706;
}

.user-document-stat-icon.danger {
  background: #ffe9ec;
  color: #dc2626;
}

.user-document-stat-icon .icon {
  width: 21px;
  height: 21px;
}

.user-document-stat > div > span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.user-document-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.user-documents-table {
  display: grid;
  overflow: visible;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #fff;
}

.user-documents-table-header,
.user-document-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) minmax(105px, 0.72fr) minmax(110px, 0.72fr) minmax(120px, 0.8fr) minmax(78px, 0.48fr) minmax(132px, 0.9fr) minmax(76px, 0.42fr);
  gap: 14px;
  align-items: center;
}

.user-documents-table-header {
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid #dfe5ea;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.user-document-row {
  min-height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid #e8edf2;
  color: #324155;
  font-size: 0.86rem;
}

.user-document-row:last-child {
  border-bottom: 0;
}

.user-document-name {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}

.user-document-name .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #007f5f;
}

.user-document-name strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-document-status {
  width: fit-content;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #d8e0e7;
  border-radius: 6px;
  background: #f3f6f8;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 800;
}

.user-document-status i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #64748b;
}

.user-document-status.valid {
  border-color: #b9ddcb;
  background: #eefaf3;
  color: #007f5f;
}

.user-document-status.valid i {
  background: #007f5f;
}

.user-document-status.expiring_soon {
  border-color: #f5d29a;
  background: #fff7e8;
  color: #b45309;
}

.user-document-status.expiring_soon i {
  background: #d97706;
}

.user-document-status.expired {
  border-color: #f3b6b6;
  background: #fff0f0;
  color: #b42318;
}

.user-document-status.expired i {
  background: #dc2626;
}

.user-document-actions {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.user-document-actions .icon,
.user-document-options-list .icon {
  width: 15px;
  height: 15px;
}

.user-document-options-menu {
  position: relative;
}

.user-document-options-menu summary {
  list-style: none;
}

.user-document-options-menu summary::-webkit-details-marker {
  display: none;
}

.user-document-options-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  min-width: 148px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 6px;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.row-editor .inline-edit.user-document-options-list {
  width: 172px;
  min-width: 172px;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 7px;
}

.user-document-options-list a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.user-document-options-list a:hover {
  background: #f1f5f4;
  color: #006f52;
}

.user-documents-empty {
  margin: 0;
  padding: 24px 18px;
}

.user-document-upload-form {
  display: grid;
  gap: 0;
  margin: 0 -22px;
  border-top: 1px solid #dfe5ea;
}

.user-document-upload-card {
  display: grid;
  gap: 12px;
  margin: 16px 22px;
  padding: 16px;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  background: #fff;
}

.user-document-upload-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.user-document-upload-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: end;
}

.user-document-dropzone {
  min-height: 66px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px dashed #90b8aa;
  border-radius: 6px;
  background: #fbfefd;
  color: #007f5f;
  cursor: pointer;
  text-align: center;
}

.user-document-dropzone.drag-active {
  border-color: #007f5f;
  background: #eefaf4;
}

.user-document-dropzone .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.user-document-dropzone strong,
.user-document-dropzone span,
.user-document-dropzone em,
.user-document-dropzone small {
  min-width: 0;
}

.user-document-dropzone strong,
.user-document-dropzone span {
  font-size: 0.8rem;
}

.user-document-dropzone em,
.user-document-dropzone small {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.user-document-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.user-document-queue {
  gap: 14px;
  padding: 16px;
  max-height: min(360px, 42vh);
}

.user-document-queue .purchase-attachment-list {
  display: grid;
  gap: 10px;
}

.user-document-queue .purchase-attachment-summary {
  margin: 0;
}

.user-document-selected-row,
.purchase-attachment-queue .user-document-selected-row {
  grid-template-columns: minmax(230px, 1.15fr) minmax(180px, 0.9fr) minmax(145px, 0.66fr) minmax(150px, 0.66fr) 40px;
  gap: 14px;
  align-items: end;
  padding: 12px;
  border-color: #dbe3ea;
  background: #fbfcfd;
}

.user-document-selected-file,
.user-document-selected-row label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.user-document-field-label,
.user-document-selected-row label span {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.user-document-file-pill {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 42px;
}

.user-document-file-pill .purchase-file-badge {
  min-width: 46px;
  min-height: 38px;
}

.user-document-file-pill .purchase-attachment-main strong {
  font-size: 0.88rem;
}

.user-document-selected-row input,
.user-document-selected-row select {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.86rem;
  border-radius: 6px;
}

.user-document-selected-row .purchase-attachment-remove {
  width: 40px;
  height: 40px;
}

.user-document-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid #dfe5ea;
  background: #fff;
}

.management-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.management-row:last-child {
  padding-bottom: 0;
}

.project-table {
  display: grid;
}

.category-table,
.tax-rate-table {
  display: grid;
}

.management-list-heading,
.catalogue-list-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.management-list-heading h2,
.management-list-heading p,
.catalogue-list-heading h2,
.catalogue-list-heading p {
  margin: 0;
}

.add-management-menu .inline-edit {
  width: min(420px, calc(100vw - 32px));
  min-width: 0;
}

.add-tax-rate-form,
.tax-rate-edit-form {
  grid-template-columns: minmax(160px, 1fr) minmax(100px, 0.55fr) auto;
}

.management-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 26, 23, 0.24);
}

.management-dialog::backdrop {
  background: rgba(12, 18, 15, 0.42);
}

.management-dialog-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: #fff;
}

.management-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.management-dialog-heading h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.management-dialog-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.management-dialog-form {
  display: grid;
  gap: 16px;
}

.management-dialog-form .field-stack {
  display: grid;
  gap: 7px;
}

.management-dialog-form .rate-percent-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.management-dialog-form .rate-percent-field input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.management-dialog-form .rate-percent-field span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f8faf8;
  color: var(--muted);
  font-weight: var(--weight-bold);
}

.management-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.project-table-header,
.project-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(110px, 0.48fr) minmax(110px, 0.48fr) minmax(110px, 0.48fr) minmax(120px, 0.5fr) minmax(96px, auto);
  gap: 16px;
  align-items: center;
}

.project-documents {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.project-supporting-documents-menu {
  width: min(540px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  align-items: stretch;
}

.project-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.project-detail-panel {
  min-height: 260px;
}

.project-details-form {
  max-width: 680px;
}

.project-edit-sidebar {
  display: grid;
  gap: 16px;
}

.project-snapshot-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.project-snapshot-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.project-snapshot-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.project-snapshot-list dt {
  color: var(--muted);
  font-weight: 700;
}

.project-snapshot-list dd {
  margin: 0;
  font-weight: 800;
}

.project-edit-links {
  display: grid;
  gap: 8px;
}

.project-edit-links .button {
  justify-content: space-between;
}

.project-phase-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100svh - 32px);
  margin: -20px -28px 0;
  background: #f8fafc;
}

.app-page > .flash + .project-phase-workspace {
  margin-top: 0;
}

.project-phase-rail {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: visible;
  padding: 24px 12px;
  border-right: 1px solid #dce3ea;
  background: #fff;
  z-index: 20;
}

.project-phase-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 6px 16px;
  border-bottom: 1px solid #dfe5ec;
}

.project-phase-heading h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.project-phase-form-menu > summary,
.project-phase-row-menu > summary {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
}

.project-phase-row-menu > summary {
  width: 30px;
  height: 30px;
  border-color: transparent;
}

.project-phase-form-menu > summary::-webkit-details-marker,
.project-phase-row-menu > summary::-webkit-details-marker {
  display: none;
}

.project-phase-form-menu > summary:hover,
.project-phase-row-menu > summary:hover {
  border-color: #007f5f;
  background: #f0faf6;
  color: #007f5f;
}

.project-phase-form-menu .icon,
.project-phase-row-menu .icon {
  width: 18px;
  height: 18px;
}

.project-phase-list {
  display: grid;
  gap: 8px;
  width: 100%;
  align-items: stretch;
  justify-content: stretch;
  justify-items: stretch;
  max-height: calc(100svh - 104px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 10px 0 0;
}

.project-phase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 0;
  align-items: start;
  width: 100%;
  padding: 8px;
  border-top: 1px solid #dfe5ec;
}

.project-phase-row.active {
  border-top-color: transparent;
  border-radius: 8px;
  background: #f0faf6;
}

.project-phase-link {
  display: grid;
  gap: 6px;
  min-height: 58px;
  align-content: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  width: 100%;
  min-width: 0;
}

.project-phase-link.active {
  background: #e7f6ee;
  color: #0f172a;
}

.project-phase-link:hover {
  background: #f0faf6;
}

.project-phase-link strong {
  color: #0f172a;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.project-phase-link.active strong,
.project-phase-row.active .project-phase-link strong {
  color: #007f5f;
}

.project-phase-link span {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: #536176;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
}

.project-phase-link span .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.project-phase-popover {
  width: min(380px, calc(100vw - 32px));
  right: 0;
  left: auto;
  display: grid;
  gap: 14px;
  padding: 16px;
  z-index: 80;
}

.project-phase-form-menu .project-phase-popover {
  right: auto;
  left: 0;
}

.project-phase-row-menu .project-phase-popover {
  right: auto;
  left: 0;
}

.project-phase-popover h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  letter-spacing: 0;
}

.project-phase-form {
  display: grid;
  gap: 12px;
}

.project-phase-form > div,
.project-phase-form-grid > div {
  display: grid;
  gap: 7px;
}

.project-phase-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
}

.project-phase-form label {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
}

.project-phase-form input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.project-phase-form .button,
.project-phase-delete {
  width: 100%;
  justify-content: center;
}

.project-phase-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.project-phase-delete-form {
  display: none;
}

.project-phase-main {
  min-width: 0;
}

.project-show-header {
  min-height: 86px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 0;
  padding: 20px 28px;
  background: #fff;
}

.project-show-back,
.project-show-edit-details {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  color: #007f5f;
  font-weight: 800;
  text-decoration: none;
}

.project-show-back:hover,
.project-show-edit-details:hover {
  color: #005f47;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-show-back .icon,
.project-show-edit-details .icon {
  width: 18px;
  height: 18px;
}

.project-show-account-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.project-show-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 28px 32px;
  border-bottom: 1px solid #e4e8ee;
  background: #fff;
}

.project-show-title-group {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  min-width: 0;
}

.project-show-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dff2e8;
  color: #0f8a62;
}

.project-show-icon .icon {
  width: 44px;
  height: 44px;
}

.project-show-title-group h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(2rem, 3vw, 2.55rem);
  line-height: 1.1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.project-show-title-group p {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 12px 0 0;
  color: #536176;
  font-size: 1.02rem;
}

.project-show-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
}

.project-show-meta .projects-status-pill.active {
  background: #dff2e8;
  color: #00805f;
}

.project-show-date-range {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: #334155;
  font-weight: 700;
}

.project-show-date-range .icon {
  width: 18px;
  height: 18px;
}

.project-show-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
}

.project-show-edit-button {
  min-height: 42px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.project-show-edit-button:hover {
  border-color: #007f5f;
  background: #f0faf6;
  color: #007f5f;
}

.project-show-edit-button.is-cancel {
  border-color: #e7b7ae;
  background: #fff8f6;
  color: #b42318;
}

.project-show-edit-button.is-cancel:hover {
  border-color: #b42318;
  background: #fff0ed;
}

.project-show-edit-button .icon {
  width: 18px;
  height: 18px;
}

.project-show-content {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 24px 28px 32px;
  background: #f8fafc;
}

.project-show-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.project-show-metric-card,
.project-show-panel {
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.project-show-metric-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 16px 12px;
}

.project-show-metric-card .projects-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.project-show-metric-card .projects-summary-icon .icon {
  width: 24px;
  height: 24px;
}

.project-show-metric-card div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-show-metric-card span:not(.projects-summary-icon) {
  color: #334155;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
}

.project-show-metric-card strong {
  color: #0f172a;
  max-width: 100%;
  font-size: clamp(1.25rem, 1.45vw, 1.7rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.project-show-metric-card strong.positive {
  color: #00805f;
}

.project-show-metric-card strong.negative {
  color: var(--danger);
}

.project-show-metric-card small {
  color: #536176;
  font-size: 0.88rem;
  line-height: 1.25;
}

.project-show-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.project-show-panel {
  padding: 26px;
}

.project-show-panel h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.4rem;
  letter-spacing: 0;
}

.project-show-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.project-show-panel-heading > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dff2e8;
  color: #007f5f;
  font-size: 0.9rem;
  font-weight: 800;
}

.project-show-panel > p {
  margin: 8px 0 20px;
  color: #0f172a;
}

.project-show-edit-form {
  display: grid;
  gap: 22px;
  margin-top: 20px;
}

.project-show-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.project-show-edit-grid > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.project-show-edit-grid label {
  color: #334155;
  font-size: 0.9rem;
  font-weight: 800;
}

.project-show-edit-grid input,
.project-show-edit-grid select,
.project-show-edit-grid textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background-color: #fff;
  color: #0f172a;
  font: inherit;
}

.project-show-edit-grid textarea {
  min-height: 96px;
  resize: vertical;
}

.project-show-edit-wide {
  grid-column: 1 / -1;
}

.project-show-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid #dfe5ec;
}

.project-show-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 0;
}

.project-show-detail-list div {
  min-height: 80px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px 0;
  border-bottom: 1px solid #dfe5ec;
}

.project-show-detail-list div:nth-child(odd) {
  padding-right: 24px;
}

.project-show-detail-list div:nth-child(even) {
  padding-left: 24px;
}

.project-show-detail-list dt {
  color: #334155;
  font-size: 0.92rem;
}

.project-show-detail-list dd {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin: 0;
  color: #0f172a;
  font-weight: 500;
}

.project-show-detail-list dd p {
  margin: 0;
}

.project-show-detail-list dd .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.project-show-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0f9b70;
}

.project-show-detail-wide {
  grid-column: 1 / -1;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.project-show-edit-details {
  margin-top: 22px;
}

.project-show-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
}

.project-show-sidebar .project-show-panel {
  min-height: 0;
}

.project-show-sidebar .project-show-panel:last-child {
  display: flex;
  flex-direction: column;
}

.project-show-document-links {
  display: grid;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
}

.project-show-panel h2 + .project-show-document-links,
.project-show-panel h2 + .project-show-activity-list,
.project-show-panel h2 + .supplier-bars,
.project-show-panel h2 + p.muted {
  margin-top: 20px;
}

.project-show-panel h2 + .project-show-activity-list {
  padding-top: 12px;
  border-top: 1px solid #e4e8ee;
}

.project-show-document-links a {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 18px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  color: #0f172a;
  text-decoration: none;
}

.project-show-document-links a + a {
  border-top: 1px solid #dfe5ec;
}

.project-show-document-links a:hover {
  background: #f6fbf8;
}

.project-show-document-links strong {
  color: #0f172a;
}

.project-show-document-links .icon:last-child {
  width: 18px;
  height: 18px;
}

.project-show-document-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  flex: 0 0 auto;
}

.project-show-document-icon .icon {
  width: 18px;
  height: 18px;
}

.project-show-document-icon.blue {
  background: #e7f0ff;
  color: #1d70d6;
}

.project-show-document-icon.green {
  background: #dff2e8;
  color: #0f8a62;
}

.project-show-document-icon.purple {
  background: #eee6fb;
  color: #7c4bd5;
}

.project-show-activity-list {
  display: grid;
  flex: 1;
  align-content: space-between;
}

.project-show-activity-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid #e4e8ee;
}

.project-show-activity-item:first-child {
  padding-top: 2px;
}

.project-show-activity-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-show-activity-item strong {
  color: #0f172a;
}

.project-show-activity-item span,
.project-show-activity-item time {
  color: #536176;
}

.project-show-activity-item time {
  font-size: 0.88rem;
  white-space: nowrap;
}

.category-table-header,
.category-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.45fr) minmax(110px, 0.45fr) minmax(96px, auto);
  gap: 16px;
  align-items: center;
}

.tax-rate-table-header,
.tax-rate-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(90px, 0.3fr) minmax(110px, 0.35fr) minmax(136px, auto);
  gap: 16px;
  align-items: center;
}

.project-table-header {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.category-table-header,
.tax-rate-table-header {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-table-header span:last-child,
.category-table-header span:last-child,
.tax-rate-table-header span:last-child,
.supplier-table-header span:last-child,
.income-document-table-header span:last-child,
.catalogue-table-header span:last-child {
  justify-self: end;
}

.project-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.category-row,
.tax-rate-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.project-row > div,
.category-row > div,
.tax-rate-row > div,
.supplier-row > div,
.management-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-name {
  min-width: 0;
}

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

.project-name strong,
.management-name strong,
.catalogue-item-name strong {
  overflow-wrap: anywhere;
}

.project-actions,
.management-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-actions {
  flex-wrap: nowrap;
}

.project-row > .project-actions,
.category-row > .management-actions,
.tax-rate-row > .management-actions,
.supplier-row > .supplier-actions,
.catalogue-row > .catalogue-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.project-actions form,
.management-actions form,
.supplier-actions form,
.catalogue-actions form {
  display: contents;
}

.management-actions .management-dialog-form {
  display: grid;
}

.row-action-note {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.supplier-table {
  display: grid;
}

.income-document-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.income-document-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.income-document-row > .purchase_document-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.income-empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 24px;
  align-items: center;
  min-height: 230px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.income-empty h2,
.income-empty p {
  margin-top: 0;
}

.income-empty .actions {
  margin-top: 18px;
}

.income-empty-types {
  display: flex;
  gap: 8px;
  align-content: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.income-empty-types span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.projects-empty-screen {
  min-height: calc(100vh - 190px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 26px;
  margin-top: 46px;
  padding: clamp(42px, 7vh, 70px) clamp(22px, 5vw, 72px) 34px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
}

.projects-empty-hero {
  position: relative;
  width: min(340px, 78vw);
  aspect-ratio: 1.5;
}

.projects-empty-folder,
.projects-empty-document,
.projects-empty-cloud,
.projects-empty-plane,
.projects-empty-flight-path,
.projects-empty-spark {
  position: absolute;
  display: block;
}

.projects-empty-folder {
  left: 25%;
  bottom: 7%;
  width: 50%;
  height: 37%;
  border-radius: 5px 5px 10px 10px;
  background: linear-gradient(180deg, #7ed0a8 0%, #4fae81 100%);
  box-shadow: 0 16px 32px rgba(0, 111, 82, 0.15);
}

.projects-empty-folder::before,
.projects-empty-folder::after {
  content: "";
  position: absolute;
  bottom: 100%;
  border-bottom: 44px solid #007f5f;
}

.projects-empty-folder::before {
  left: 0;
  border-left: 8px solid transparent;
  border-right: 12px solid transparent;
}

.projects-empty-folder::after {
  right: 0;
  border-left: 12px solid transparent;
  border-right: 8px solid transparent;
}

.projects-empty-folder span {
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 16px;
  border-radius: 5px 5px 0 0;
  background: #8bd9b1;
}

.projects-empty-document {
  left: 33%;
  bottom: 35%;
  width: 34%;
  height: 40%;
  display: grid;
  place-items: center;
  border: 2px solid #d8e1ea;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfc 100%);
  color: #c7d1dc;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.projects-empty-document::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 27%;
  aspect-ratio: 1;
  border-left: 2px solid #d8e1ea;
  border-bottom: 2px solid #d8e1ea;
  background: #f3f7f9;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.projects-empty-document .icon {
  width: 54%;
  height: 54%;
  stroke-width: 1.7;
}

.projects-empty-cloud {
  height: 18px;
  border-radius: 999px;
  background: #edf2f6;
}

.projects-empty-cloud::before,
.projects-empty-cloud::after {
  content: "";
  position: absolute;
  bottom: 5px;
  border-radius: 999px;
  background: inherit;
}

.projects-empty-cloud::before {
  left: 12px;
  width: 24px;
  height: 24px;
}

.projects-empty-cloud::after {
  right: 10px;
  width: 36px;
  height: 36px;
}

.cloud-one {
  left: 7%;
  top: 19%;
  width: 48px;
  opacity: 0.72;
}

.cloud-two {
  left: 0;
  bottom: 36%;
  width: 74px;
  opacity: 0.9;
}

.cloud-three {
  right: 3%;
  bottom: 58%;
  width: 86px;
}

.projects-empty-plane {
  right: 27%;
  top: 22%;
  width: 0;
  height: 0;
  transform: rotate(-16deg);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 38px solid #1f966f;
}

.projects-empty-plane::after {
  content: "";
  position: absolute;
  left: -35px;
  top: -5px;
  width: 22px;
  height: 10px;
  transform: skewX(-24deg);
  background: #7ed0a8;
}

.projects-empty-flight-path {
  left: 20%;
  top: 22%;
  width: 45%;
  height: 33%;
  border: 2px dashed #7bc8a7;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 999px 0 0 0;
  transform: rotate(13deg);
}

.projects-empty-flight-path::before {
  content: "";
  position: absolute;
  left: 16%;
  bottom: -24px;
  width: 34px;
  height: 34px;
  border: 2px dashed #7bc8a7;
  border-radius: 999px;
}

.projects-empty-spark {
  color: #8bcfac;
  font-weight: 800;
  line-height: 1;
}

.spark-one {
  left: 50%;
  top: 12%;
  font-size: 1.25rem;
}

.spark-two {
  left: 18%;
  bottom: 22%;
  font-size: 1.4rem;
}

.spark-three {
  right: 17%;
  bottom: 32%;
  font-size: 1.35rem;
}

.projects-empty-copy {
  display: grid;
  gap: 14px;
  text-align: center;
}

.projects-empty-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.45rem);
  letter-spacing: 0;
}

.projects-empty-copy p {
  margin: 0;
  color: #4d5b66;
  font-size: 1.08rem;
  line-height: 1.5;
}

.projects-empty-add-menu {
  position: relative;
}

.projects-empty-primary-button {
  --button-height: 54px;
  --button-padding-x: 24px;
  min-width: min(280px, 100%);
  box-shadow: 0 10px 20px rgba(0, 111, 82, 0.18);
}

.projects-empty-primary-button .icon {
  width: 21px;
  height: 21px;
}

.projects-empty-guide-heading {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 28px;
  color: #4d5b66;
}

.projects-empty-guide-heading span {
  height: 1px;
  background: linear-gradient(90deg, transparent, #dce3ea);
}

.projects-empty-guide-heading span:last-child {
  background: linear-gradient(90deg, #dce3ea, transparent);
}

.projects-empty-guide-heading p {
  margin: 0;
  text-align: center;
}

.projects-empty-steps {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 34px 30px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  list-style: none;
}

.projects-empty-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
  padding-left: 16px;
}

.projects-empty-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid #dce3ea;
  border-right: 2px solid #dce3ea;
  transform: translateY(-50%) rotate(45deg);
}

.projects-empty-step-number {
  position: absolute;
  left: -2px;
  top: -4px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #c8eddd;
  color: #006f52;
  font-size: 0.86rem;
  font-weight: 800;
}

.projects-empty-step-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f0f2f5;
  color: #1b2a3e;
}

.projects-empty-step-icon .icon {
  width: 29px;
  height: 29px;
}

.projects-empty-steps strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-weight: 800;
}

.projects-empty-steps p {
  margin: 0;
  color: #536170;
  font-size: 0.94rem;
  line-height: 1.45;
}

.projects-empty-help {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  color: #0f172a;
}

.projects-empty-help > .icon {
  width: 26px;
  height: 26px;
  color: #12213a;
}

.projects-empty-help .text-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #007f5f;
  font-weight: 800;
}

.projects-empty-help .text-link .icon {
  width: 16px;
  height: 16px;
}

.projects-dashboard {
  display: grid;
  gap: 18px;
  padding-top: 4px;
}

.projects-dashboard-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.projects-dashboard-topline p {
  margin: 0;
  color: #4b5563;
  font-size: 1.05rem;
}

.projects-add-button {
  --button-height: 50px;
  --button-padding-x: 20px;
  min-width: 176px;
  box-shadow: 0 10px 20px rgba(0, 111, 82, 0.15);
}

.projects-add-button .icon {
  width: 18px;
  height: 18px;
}

.projects-add-button .icon:last-child {
  width: 16px;
  height: 16px;
  margin-left: 4px;
}

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

.projects-summary-card {
  min-height: 126px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px 18px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
}

.projects-summary-card div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.projects-summary-card span:not(.projects-summary-icon) {
  color: #334155;
}

.projects-summary-card strong {
  color: #0f172a;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  line-height: 1.05;
  white-space: nowrap;
}

.projects-summary-card small {
  color: #5d6975;
  font-size: 0.98rem;
  font-weight: 800;
}

.projects-summary-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.projects-summary-icon .icon {
  width: 31px;
  height: 31px;
}

.projects-summary-icon.green {
  background: #dff2e8;
  color: #0f8a62;
}

.projects-summary-icon.blue {
  background: #e7f0ff;
  color: #1d70d6;
}

.projects-summary-icon.purple {
  background: #eee6fb;
  color: #7c4bd5;
}

.projects-summary-icon.amber {
  background: #f8edcf;
  color: #c28a17;
}

.projects-filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 150px 50px auto;
  gap: 14px;
  align-items: center;
  padding: 24px 16px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
}

.projects-filter-panel input,
.projects-filter-panel select,
.projects-filter-button {
  width: 100%;
  min-height: 50px;
  border-color: #d8e0e8;
  border-radius: 8px;
  color: #0f172a;
  font: inherit;
}

.projects-filter-panel input,
.projects-filter-panel select {
  padding: 10px 16px;
  background-color: #fff;
}

.projects-filter-panel select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #334155 50%),
    linear-gradient(135deg, #334155 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% + 2px),
    calc(100% - 15px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.projects-search-field {
  position: relative;
}

.projects-search-field::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3Cpath d='M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15z'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.projects-search-field input {
  padding-right: 48px;
}

.projects-clear-filters {
  white-space: nowrap;
}

.projects-table-card {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.projects-table-modern {
  display: grid;
}

.projects-table-modern-header,
.projects-table-modern-row {
  min-width: 1120px;
  display: grid;
  grid-template-columns: minmax(250px, 1.25fr) minmax(170px, 0.9fr) minmax(130px, 0.6fr) minmax(130px, 0.64fr) minmax(140px, 0.68fr) minmax(130px, 0.64fr) minmax(86px, 0.42fr) 52px;
  gap: 16px;
  align-items: center;
}

.projects-table-modern-header {
  min-height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
}

.projects-table-modern-row {
  min-height: 86px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: #111827;
}

.projects-table-modern-row:last-child {
  border-bottom: 0;
}

.projects-no-results {
  min-width: 1120px;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 44px 24px;
  border-bottom: 1px solid #e4e8ee;
  color: #64748b;
  text-align: center;
}

.projects-no-results strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.projects-table-modern-row > div {
  min-width: 0;
}

.projects-modern-name {
  min-width: 0;
}

.projects-modern-link {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.projects-modern-link > span:last-child {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.projects-modern-link strong {
  overflow-wrap: anywhere;
}

.projects-modern-link em {
  color: #64748b;
  font-weight: 500;
  font-style: normal;
}

.projects-modern-link:hover strong {
  color: #006f52;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.projects-row-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.projects-row-icon .icon {
  width: 30px;
  height: 30px;
}

.projects-row-icon.green {
  background: #e3f3ec;
  color: #129266;
}

.projects-row-icon.amber {
  background: #fbf1d8;
  color: #ca941f;
}

.projects-row-icon.purple {
  background: #eee6fb;
  color: #7c4bd5;
}

.projects-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.projects-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.projects-status-pill.active {
  background: #e8f1ff;
  color: #1269d3;
}

.projects-status-pill.planning,
.projects-status-pill.on_hold {
  background: #efe8fb;
  color: #7442c8;
}

.projects-status-pill.complete {
  background: #e4f3ea;
  color: #0f8a53;
}

.projects-profit-cell.positive {
  color: #0b7f4e;
  font-weight: 800;
}

.projects-profit-cell.negative {
  color: var(--danger);
  font-weight: 800;
}

.projects-modern-actions {
  justify-self: end;
}

.projects-row-menu {
  display: inline-block;
  position: relative;
}

.projects-row-menu > summary {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #0f172a;
}

.projects-row-menu > summary:hover {
  background: #f3f6f8;
}

.projects-row-menu > summary .icon {
  width: 20px;
  height: 20px;
}

.projects-row-menu .projects-row-menu-list {
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px;
  z-index: 40;
}

.projects-row-menu-list > a,
.projects-row-menu-list > details,
.projects-row-menu-list > form,
.projects-row-menu-list > span {
  display: block;
  width: 100%;
}

.projects-row-menu-list a,
.projects-row-menu-list summary,
.projects-row-menu-list .link-button,
.projects-row-disabled {
  min-height: 38px;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.projects-row-menu-list a:hover,
.projects-row-menu-list summary:hover,
.projects-row-menu-list .link-button:hover {
  background: #e9f6f1;
  color: #006f52;
}

.projects-row-menu-list form {
  display: block;
  margin: 0;
}

.projects-row-menu-list .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.projects-row-delete {
  color: var(--danger);
}

.projects-row-disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.projects-attach-nested {
  position: static;
}

.projects-attach-nested > .project-supporting-documents-menu {
  position: fixed;
}

.projects-table-footer,
.pagination-footer {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-top: 1px solid #e4e8ee;
}

.projects-table-footer nav,
.pagination-footer nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.projects-table-footer .button,
.pagination-footer .button {
  min-width: 40px;
  border-color: #dce3ea;
}

.projects-table-footer .button.current,
.pagination-footer .button.current {
  background: #dff2eb;
  color: #006f52;
}

.projects-table-footer .button.disabled,
.pagination-footer .button.disabled {
  opacity: 1;
  color: #0f172a;
}

.projects-table-footer .projects-page-prev .icon,
.pagination-footer .pagination-page-prev .icon {
  transform: rotate(180deg);
}

.supplier-table-header,
.supplier-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.5fr) minmax(100px, 0.6fr) minmax(110px, 0.6fr) minmax(96px, auto);
  gap: 16px;
  align-items: start;
}

.supplier-table-header {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.supplier-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.supplier-name {
  min-width: 0;
}

.supplier-name strong {
  overflow-wrap: anywhere;
}

.supplier-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.supplier-aliases {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.supplier-alias-list {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.alias-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  font-size: 0.92rem;
  font-weight: 700;
}

.alias-remove {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.alias-editor {
  justify-self: start;
}

.alias-editor summary {
  font-size: 0.92rem;
  line-height: 1.2;
}

.supplier-alias-form {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.supplier-edit-actions {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 16px;
}

.supplier-edit-actions .button {
  width: auto;
}

.supplier-detail-metrics {
  margin-bottom: 16px;
}

.supplier-detail-metrics .metric strong {
  overflow-wrap: anywhere;
}

.supplier-edit-layout {
  display: block;
  margin-bottom: 16px;
}

.supplier-edit-main {
  display: grid;
  gap: 16px;
}

.supplier-bottom-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.supplier-detail-form {
  grid-template-columns: 1fr;
  gap: 18px;
}

.supplier-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.supplier-form-section h3 {
  margin: 0;
  font-size: 1rem;
}

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

.supplier-wide-field,
.supplier-notes-field {
  grid-column: 1 / -1;
}

.supplier-notes-field textarea {
  min-height: 116px;
  resize: vertical;
}

.supplier-form-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 2px;
}

.supplier-panel-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.supplier-alias-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  width: min(440px, 100%);
}

.supplier-alias-create-form .button {
  min-height: 46px;
  white-space: nowrap;
}

.supplier-alias-edit-list,
.supplier-catalogue-list,
.supplier-purchase-list {
  display: grid;
  gap: 8px;
}

.supplier-alias-edit-list > div,
.supplier-catalogue-row,
.supplier-purchase-row {
  display: grid;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.supplier-alias-edit-list > div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.supplier-alias-edit-list span,
.supplier-catalogue-row strong,
.supplier-purchase-row strong {
  overflow-wrap: anywhere;
}

.supplier-catalogue-row,
.supplier-purchase-row {
  color: inherit;
  text-decoration: none;
}

.supplier-catalogue-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.supplier-purchase-row {
  grid-template-columns: minmax(0, 1.4fr) minmax(90px, 0.5fr) auto minmax(92px, auto);
}

.supplier-catalogue-row > span:first-child,
.supplier-purchase-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.supplier-empty-state {
  padding: 14px;
}

.supplier-merge-form {
  grid-template-columns: 1fr;
}

.supplier-merge-form select,
.supplier-merge-form .ts-wrapper {
  width: 100%;
}

.supplier-merge-page {
  display: grid;
  gap: 16px;
  max-width: 1120px;
}

.supplier-merge-warning {
  border-color: #f1c8c1;
  background: #fff8f6;
}

.supplier-merge-warning h2 {
  color: #9f2f1d;
}

.supplier-merge-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.supplier-merge-source {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.supplier-merge-source > strong {
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

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

.supplier-merge-stats span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.supplier-merge-stats strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.supplier-merge-note {
  margin: 0;
  padding: 12px;
  border: 1px solid #f1c8c1;
  border-radius: 8px;
  color: #9f2f1d;
  background: #fff4f2;
  font-weight: 700;
  line-height: 1.35;
}

.supplier-merge-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 4px;
}

.supplier-merge-actions .button {
  width: auto;
  min-width: 132px;
}

.row-editor {
  position: relative;
}

.row-editor summary {
  list-style: none;
  cursor: pointer;
}

.row-editor summary::-webkit-details-marker { display: none; }

.row-editor .inline-edit {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(420px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(23, 32, 28, 0.14);
  z-index: 3;
}

.row-editor .inline-edit.popover-fixed-panel {
  position: fixed;
  right: auto;
  z-index: 80;
}

.projects-row-menu > .projects-row-menu-list.inline-edit {
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  min-width: 220px;
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px;
  z-index: 40;
}

.row-editor.centered-popover[open]::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 23, 0.34);
  z-index: 20;
}

.row-editor.centered-popover .inline-edit {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 70px rgba(20, 26, 23, 0.24);
  z-index: 21;
}

.row-editor.centered-popover .supporting-document-form,
.row-editor.centered-popover .supporting-document-form.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.text-link {
  color: var(--primary-dark);
  font-weight: 700;
}

button:disabled,
.button:disabled,
.button.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a.button.disabled {
  pointer-events: none;
}

.pagination-gap {
  color: var(--muted);
  font-weight: 800;
  padding: 0 2px;
}

.empty.compact {
  padding: 16px;
}

.empty h2,
.empty p {
  margin-top: 0;
}

.catalogue-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-company-filter-form {
  grid-template-columns: minmax(240px, 1.4fr) minmax(170px, 0.9fr) minmax(150px, 0.75fr) minmax(140px, 0.65fr) 44px;
  margin-bottom: 18px;
}

.add-catalogue-menu .inline-edit,
.catalogue-popover-form {
  width: min(540px, calc(100vw - 32px));
  min-width: 0;
}

.catalogue-popover-form {
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.75fr) minmax(150px, 0.8fr);
}

.catalogue-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.catalogue-insight {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--ink);
  text-decoration: none;
}

.catalogue-insight:hover,
.catalogue-insight.active {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  background: #eef6f2;
}

.catalogue-insight.warning.active,
.catalogue-insight.warning:hover {
  border-color: #e9c46a;
  background: #fff9e8;
}

.catalogue-insight span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.catalogue-insight strong {
  font-size: 1.8rem;
}

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

.catalogue-groups {
  display: grid;
  gap: 18px;
}

.catalogue-group {
  display: grid;
  gap: 0;
}

.catalogue-group-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 0 0 10px;
}

.catalogue-group-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.catalogue-group-heading span {
  color: var(--muted);
  font-weight: 700;
}

.catalogue-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: visible;
}

.catalogue-table-header,
.catalogue-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1.45fr) minmax(110px, 0.55fr) minmax(145px, 0.8fr) minmax(86px, 0.42fr) minmax(104px, 0.5fr) minmax(76px, 0.36fr) minmax(82px, auto) minmax(96px, auto);
  gap: 10px;
  align-items: center;
}

.catalogue-table-header {
  padding: 10px 12px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.catalogue-row {
  padding: 10px 12px;
  border-top: 1px solid #edf1ed;
  background: #fff;
}

.catalogue-row:first-child {
  border-top: 0;
}

.catalogue-row:hover {
  background: #fbfcfb;
}

.catalogue-item-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.catalogue-gap,
.catalogue-price-warning {
  color: #a15c00;
  font-size: 0.9rem;
  font-weight: 700;
}

.catalogue-popover-form input,
.catalogue-popover-form .ts-wrapper.single .ts-control,
.catalogue-popover-form .ts-wrapper.multi .ts-control {
  min-height: 42px;
}

.catalogue-popover-form .ts-wrapper.single .ts-control,
.catalogue-popover-form .ts-wrapper.multi .ts-control {
  overflow: hidden;
  white-space: nowrap;
}

.catalogue-popover-form .ts-wrapper .item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalogue-status {
  white-space: nowrap;
}

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

.row-meta {
  display: grid;
  justify-items: end;
  min-width: 76px;
}

.row-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.line-items {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.line-items [data-line-items-target="items"] {
  display: grid;
  gap: 0;
}

.line-items-header,
.line-item {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) minmax(250px, 2.1fr) minmax(76px, 0.55fr) minmax(82px, 0.6fr) minmax(104px, 0.75fr) minmax(104px, 0.7fr) minmax(112px, 0.8fr) minmax(88px, auto);
  gap: 10px;
  align-items: center;
}

.line-items-header {
  padding: 12px 14px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.line-item {
  padding: 10px 14px;
  border-top: 1px solid #edf1ed;
}

.line-item:hover {
  background: #fbfcfb;
}

.line-item-description {
  min-width: 0;
}

.catalogue-suggestion {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 0;
}

.catalogue-suggestion[hidden] {
  display: none;
}

.catalogue-suggestion strong {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef8f1;
  color: #0f5132;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalogue-suggestion em {
  color: #a15c00;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
}

.line-item-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px 14px;
  border-top: 1px solid #edf1ed;
}

.ts-wrapper {
  width: 100%;
}

.catalogue-price-warning-button {
  display: inline-flex;
  min-height: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  background: #fff6e8;
  color: #8a4b00;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.catalogue-price-warning-button:hover {
  background: #ffedd0;
}

.catalogue-price-dialog {
  width: min(720px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 26, 23, 0.24);
}

.catalogue-price-dialog::backdrop {
  background: rgba(12, 18, 15, 0.58);
}

.catalogue-price-panel {
  display: grid;
  gap: 0;
}

.catalogue-price-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #dfe5ea;
}

.catalogue-price-heading div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.catalogue-price-heading strong,
.catalogue-price-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalogue-price-heading span,
.catalogue-price-empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.catalogue-price-history {
  display: grid;
  padding: 10px 16px 4px;
}

.catalogue-price-history-header,
.catalogue-price-history-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.75fr) minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(70px, 0.65fr) minmax(88px, 0.75fr);
  gap: 10px;
  align-items: center;
}

.catalogue-price-history-header {
  padding: 6px 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.catalogue-price-history-row {
  padding: 10px 0;
  border-top: 1px solid #edf1ed;
  font-size: 0.88rem;
}

.catalogue-price-history-row strong {
  font-size: 0.92rem;
}

.catalogue-price-history-link,
.catalogue-price-empty {
  margin: 12px 16px 16px;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 40px 7px 12px;
  font: inherit;
  line-height: 1.35;
  background: #fff;
  box-shadow: none;
  transition: none;
}

.ts-wrapper .ts-control > input {
  width: auto;
  min-height: 0;
  height: auto;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1.35;
}

.ts-wrapper .ts-control .item {
  line-height: 1.35;
}

.line-item input,
.line-item .ts-wrapper.single .ts-control,
.line-item .ts-wrapper.multi .ts-control {
  min-height: 42px;
  border-color: #cfd7d1;
  background: #fff;
}

.line-item input {
  padding: 8px 10px;
}

.line-item .ts-wrapper.single .ts-control,
.line-item .ts-wrapper.multi .ts-control {
  padding-top: 5px;
  padding-bottom: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.line-item .ts-wrapper.has-items .ts-control {
  font-weight: 700;
}

.line-item .ts-wrapper .ts-control .item {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-item .ts-wrapper.focus .ts-control,
.line-item input:focus {
  border-color: var(--ink);
  box-shadow: none;
  outline: 0;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control,
select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 1px),
    calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.ts-wrapper.single .ts-control:after,
.ts-wrapper.single .ts-control::after,
.ts-wrapper.single.dropdown-active .ts-control:after,
.ts-wrapper.single.dropdown-active .ts-control::after,
.ts-wrapper.dropdown-active .ts-control:after,
.ts-wrapper.dropdown-active .ts-control::after {
  display: none !important;
  content: none !important;
  border: 0 !important;
  margin: 0 !important;
  transform: none !important;
  transition: none !important;
}

.ts-wrapper,
.ts-wrapper *,
select {
  transition-property: none !important;
}

.ts-wrapper .ts-control:hover {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
}

.ts-wrapper.focus .ts-control {
  border-color: var(--ink);
  box-shadow: none;
}

.ts-dropdown {
  z-index: 1000;
  min-width: min(220px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 28, 0.12);
  overflow: hidden;
  margin-top: 6px;
  font: inherit;
}

.ts-dropdown .dropdown-input {
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  outline: 0;
  box-shadow: none;
}

.ts-dropdown .dropdown-input:focus {
  box-shadow: inset 0 -1px 0 var(--ink);
}

.ts-dropdown .active {
  background: #f6f8f6;
  color: var(--ink);
}

.ts-dropdown .option {
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-dropdown .option:not(:last-child) {
  border-bottom: 1px solid #edf1ed;
}

.ts-wrapper.plugin-clear_button .clear-button {
  color: var(--muted);
  font-size: 1.3rem;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
}

.ts-wrapper.plugin-clear_button .clear-button:hover {
  color: var(--danger);
}

.checkbox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.checkbox input { width: auto; min-height: auto; }

.remove-line-item {
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.remove-line-item input {
  accent-color: var(--danger);
}

.remove-line-item:has(input:checked) {
  color: var(--danger);
}

@media (max-width: 980px) {
  .line-items {
    border: 0;
    background: transparent;
    gap: 10px;
  }

  .line-items .line-item-actions {
    padding: 0;
    border-top: 0;
  }

  .line-items-header {
    display: none;
  }

  .line-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .line-item .sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
}

.purchase-line-items.line-items {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-x: auto;
}

.purchase-line-items .line-items-header,
.purchase-line-items .line-item {
  min-width: 1360px;
  grid-template-columns: 32px minmax(130px, 0.75fr) minmax(270px, 1.7fr) minmax(76px, 0.42fr) minmax(92px, 0.52fr) minmax(150px, 0.85fr) minmax(110px, 0.62fr) minmax(120px, 0.68fr) minmax(118px, 0.68fr) 32px;
  gap: 14px;
}

.purchase-line-items-footer {
  min-width: 1360px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.purchase-line-items .line-items-header {
  display: grid;
  padding: 17px 28px 11px;
  color: #303a45;
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
}

.purchase-line-items .line-item {
  padding: 11px 28px;
  border: 0;
  border-top: 1px solid #e8edf0;
  border-radius: 0;
  background: #fff;
}

.purchase-line-items .line-item[hidden],
.purchase-line-items .line-item.line-item-removed {
  display: none;
}

.purchase-line-items .line-item.dragging {
  opacity: 0.55;
  background: #f4f8f6;
}

.purchase-line-items .line-item input,
.purchase-line-items .line-item .ts-wrapper.single .ts-control,
.purchase-line-items .line-item .ts-wrapper.multi .ts-control {
  min-height: 54px;
  border-color: #dce2e6;
  border-radius: 7px;
}

.purchase-line-items .line-item .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.purchase-line-items .remove-line-item-control {
  display: inline-grid;
  place-items: center;
  justify-self: end;
}

.purchase-line-items .remove-line-item {
  width: 32px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
}

.purchase-line-items .remove-line-item-control input[name$="[_destroy]"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 820px) {
  .purchase-line-items.line-items {
    gap: 0;
    overflow-x: visible;
    background: #f7f8fa;
  }

  .purchase-line-items .line-items-header {
    display: none;
  }

  .purchase-line-items [data-line-items-target="items"] {
    gap: 12px;
    padding: 14px;
  }

  .purchase-section {
    min-width: 0;
    border: 1px solid #dfe4e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }

  .purchase-section-header {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .purchase-section-header label {
    min-width: 0;
  }

  .purchase-section-actions {
    justify-content: stretch;
  }

  .purchase-section-actions .button {
    flex: 1;
  }

  .purchase-line-items .line-item {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 40px;
    grid-template-areas:
      ". remove"
      "description description"
      "code code"
      "quantity unit"
      "category category"
      "price vat"
      "total total";
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid #dfe4e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.04);
  }

  .purchase-line-items .line-item-grip {
    display: none;
  }

  .purchase-line-items .line-item-code-field { grid-area: code; }
  .purchase-line-items .line-item-description { grid-area: description; }
  .purchase-line-items .line-item-quantity-field { grid-area: quantity; }
  .purchase-line-items .line-item-unit-field { grid-area: unit; }
  .purchase-line-items .line-item-category-field { grid-area: category; }
  .purchase-line-items .line-item-price-field { grid-area: price; }
  .purchase-line-items .line-item-vat-field { grid-area: vat; }
  .purchase-line-items .line-item-total-field { grid-area: total; }
  .purchase-line-items .remove-line-item-control { grid-area: remove; }

  .purchase-line-items .line-item-field {
    min-width: 0;
    display: grid;
    gap: 6px;
  }

  .purchase-line-items .line-item .sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: #303a45;
    font-size: 0.8rem;
    font-weight: 800;
  }

  .purchase-line-items .line-item input,
  .purchase-line-items .line-item .ts-wrapper.single .ts-control,
  .purchase-line-items .line-item .ts-wrapper.multi .ts-control {
    min-height: 46px;
  }

  .purchase-line-items .remove-line-item-control {
    justify-self: end;
  }

  .purchase-line-items .remove-line-item {
    width: 40px;
    min-height: 44px;
    border: 1px solid #f0b5af;
    border-radius: 7px;
    background: #fff;
  }

  .purchase-line-items-footer {
    min-width: 0;
    padding: 14px;
    background: #fff;
  }
}

@media (max-width: 520px) {
  .purchase-line-items-bulk-panel {
    grid-template-columns: 1fr;
  }

  .purchase-line-items [data-line-items-target="items"] {
    padding: 12px;
  }

  .purchase-line-items .line-item {
    grid-template-columns: minmax(0, 1fr) 40px;
    grid-template-areas:
      ". remove"
      "description description"
      "code code"
      "quantity quantity"
      "unit unit"
      "category category"
      "price price"
      "vat vat"
      "total total";
    padding: 12px;
  }
}

@media (max-width: 1100px) {
  .projects-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .project-show-main-grid {
    grid-template-columns: 1fr;
  }

  .project-phase-workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .projects-filter-panel {
    grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(130px, 0.55fr)) 50px auto;
  }

  .projects-empty-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 10px;
  }

  .projects-empty-steps li:nth-child(2)::after {
    display: none;
  }

  .purchase-edit-top-grid {
    grid-template-columns: 1fr;
  }

  .purchase-details-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 760px) {
  .team-invite-card,
  .team-member-profile-card,
  .team-member-edit-grid {
    grid-template-columns: 1fr;
  }

  .team-filter-form {
    grid-template-columns: 1fr;
  }

  .team-invite-card .team-invite-form {
    grid-template-columns: 1fr;
  }

  .team-member-profile-card {
    justify-items: start;
  }

  .team-overview-panel {
    grid-template-columns: 1fr;
  }

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

  .team-invite-form,
  .team-member-form,
  .user-document-upload-controls {
    grid-template-columns: 1fr;
  }

  .team-member-field-grid.two,
  .team-member-field-grid.three,
  .team-member-field-grid.four {
    grid-template-columns: 1fr;
  }

  .team-files-dialog[open] {
    width: 100vw;
    height: 100svh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .user-documents-workspace {
    padding: 14px;
  }

  .user-documents-summary-grid {
    grid-template-columns: 1fr;
  }

  .user-documents-table {
    overflow-x: auto;
  }

  .user-documents-table-header,
  .user-document-row {
    min-width: 860px;
  }

  .user-document-upload-form {
    margin-inline: -14px;
  }

  .user-document-upload-card {
    margin-inline: 14px;
  }

  .user-document-selected-row,
  .purchase-attachment-queue .user-document-selected-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .user-document-selected-file {
    grid-column: 1 / -1;
  }

  .user-document-selected-row label {
    grid-column: 1 / -1;
  }

  .user-document-modal-actions {
    padding-inline: 14px;
  }

  .team-member-table-header {
    display: none;
  }

  .team-member-table {
    gap: 12px;
  }

  .team-member-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .team-member-actions {
    justify-content: flex-start;
  }

  .team-member-meta {
    grid-template-columns: 1fr;
  }

  .projects-dashboard-topline,
  .document-dashboard-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .projects-add-button,
  .document-add-button {
    width: 100%;
  }

  .projects-summary-grid,
  .projects-filter-panel {
    grid-template-columns: 1fr;
  }

  .project-show-header,
  .project-show-hero {
    padding-left: 18px;
    padding-right: 18px;
  }

  .project-phase-workspace {
    display: block;
    margin: -20px -18px 0;
  }

  .project-phase-rail {
    position: static;
    height: auto;
    padding: 16px 18px;
    border-right: 0;
    border-bottom: 1px solid #dce3ea;
  }

  .project-phase-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 1fr);
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .project-phase-row {
    border-top: 0;
    border-left: 1px solid #dfe5ec;
  }

  .project-phase-popover {
    right: auto;
    left: 0;
  }

  .project-show-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-show-account-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .project-show-hero {
    flex-direction: column;
  }

  .project-show-title-group {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
  }

  .project-show-icon {
    width: 58px;
    height: 58px;
  }

  .project-show-icon .icon {
    width: 34px;
    height: 34px;
  }

  .project-show-actions,
  .project-show-edit-button {
    width: 100%;
  }

  .project-show-content {
    padding: 18px;
  }

  .project-show-metrics,
  .project-show-detail-list,
  .project-show-edit-grid {
    grid-template-columns: 1fr;
  }

  .project-show-edit-wide {
    grid-column: auto;
  }

  .project-show-edit-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .project-show-detail-list div,
  .project-show-detail-list div:nth-child(odd),
  .project-show-detail-list div:nth-child(even) {
    padding-left: 0;
    padding-right: 0;
  }

  .project-show-panel {
    padding: 18px;
  }

  .project-show-sidebar {
    min-width: 0;
  }

  .project-show-activity-item {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .project-show-activity-item time {
    grid-column: 2;
  }

  .projects-filter-panel {
    padding: 16px;
  }

  .projects-table-modern-header {
    display: none;
  }

  .projects-table-modern {
    overflow-x: visible;
  }

  .projects-table-modern-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
  }

  .projects-table-modern-row > div:not(.projects-modern-name):not(.projects-modern-actions) {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .projects-table-modern-row > div:not(.projects-modern-name):not(.projects-modern-actions)::before {
    color: #64748b;
    font-weight: 800;
  }

  .projects-table-modern-row > div:nth-child(2)::before { content: "Client"; }
  .projects-table-modern-row > div:nth-child(3)::before { content: "Status"; }
  .projects-table-modern-row > div:nth-child(4)::before { content: "Project value"; }
  .projects-table-modern-row > div:nth-child(5)::before { content: "Approved costs"; }
  .projects-table-modern-row > div:nth-child(6)::before { content: "Gross profit"; }
  .projects-table-modern-row > div:nth-child(7)::before { content: "Margin"; }

  .projects-modern-actions {
    justify-self: stretch;
  }

  .projects-row-menu {
    width: 100%;
  }

  .projects-row-menu > summary {
    width: 100%;
    border: 1px solid #dce3ea;
  }

  .projects-row-menu .projects-row-menu-list {
    left: 0;
    right: auto;
    width: min(260px, calc(100vw - 64px));
  }

  .projects-table-footer,
  .pagination-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .projects-empty-screen {
    min-height: auto;
    align-content: start;
    margin-top: 18px;
    padding: 30px 18px 26px;
  }

  .projects-empty-hero {
    width: min(280px, 84vw);
  }

  .projects-empty-copy p br {
    display: none;
  }

  .projects-empty-guide-heading {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }

  .projects-empty-guide-heading span {
    display: none;
  }

  .projects-empty-steps {
    grid-template-columns: 1fr;
    padding: 22px 18px;
    gap: 20px;
  }

  .projects-empty-steps li {
    padding-left: 10px;
  }

  .projects-empty-steps li::after {
    display: none;
  }

  .projects-empty-help {
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }

  .purchase-edit-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px;
  }

  .purchase-edit-actions {
    width: 100%;
    overflow-x: auto;
  }

  .purchase-edit-actions .button {
    flex: 0 0 auto;
  }

  .purchase-edit-screen {
    padding: 18px;
  }

  .purchase-details-grid {
    grid-template-columns: 1fr;
  }

  .purchase-details-panel,
  .purchase-summary-panel,
  .purchase-notes-panel,
  .purchase-line-items-heading {
    padding: 18px;
  }

  .purchase-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-attachments-dialog {
    width: 100vw;
    height: 100svh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .purchase-attachments-modal-hero {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 14px;
  }

  .purchase-attachments-hero-icon {
    width: 36px;
    height: 36px;
  }

  .purchase-attachments-hero-copy strong {
    font-size: 1.05rem;
  }

  .purchase-attachments-workspace {
    grid-template-columns: 1fr;
  }

  .purchase-attachments-files-pane {
    border-right: 0;
    border-bottom: 1px solid #dfe5ea;
  }

  .purchase-attachments-files-pane,
  .purchase-attachments-preview-pane {
    padding: 16px;
  }

  .purchase-attachments-files-pane {
    max-height: min(560px, calc(100svh - 210px));
    overflow: hidden;
  }

  .purchase-attachments-preview-pane {
    overflow: visible;
  }

  .purchase-attachments-preview-frame,
  .purchase-attachments-preview-frame iframe,
  .purchase-attachments-preview-empty {
    min-height: 260px;
  }

  .purchase-attachments-preview-frame iframe {
    height: 320px;
  }

  .purchase-attachment-queue {
    max-height: 280px;
  }

  .purchase-line-items-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-line-items-actions {
    justify-content: space-between;
  }

  .purchase-line-items-bulk {
    position: static;
  }

  .purchase-line-items-bulk-panel {
    position: static;
    width: 100%;
    margin-top: 10px;
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  nav {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-menu div {
    left: 0;
    right: auto;
  }

  nav a,
  .link-button,
  .nav-menu summary {
    padding: 8px 10px;
  }

  .steps, .grid.two, .grid.three, .form.inline {
    grid-template-columns: 1fr;
  }

  .purchase-show-toolbar,
  .purchase-show-actions {
    display: grid;
    justify-content: stretch;
  }

  .purchase-show-summary,
  .purchase-show-grid {
    grid-template-columns: 1fr;
  }

  .purchase-show-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .purchase-show-summary > div:last-child {
    border-bottom: 0;
  }

  .purchase-show-details,
  .purchase-show-attachment {
    grid-template-columns: 1fr;
  }

  .purchase-show-attachment-actions {
    justify-content: stretch;
  }

  .purchase-show-attachment-actions .button {
    flex: 1;
  }

  .index-filter-form,
  .catalogue-filter-form,
  .supplier-filter-form {
    grid-template-columns: 1fr;
  }

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

  .filter-actions {
    width: 100%;
    align-self: stretch;
    align-items: flex-end;
    flex-direction: column;
    justify-content: flex-start;
  }

  .bulk-action-bar,
  .bulk-action-buttons,
  .purchase_document-card-shell {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .bulk-action-bar,
  .bulk-action-buttons {
    flex-direction: column;
  }

  .upload-project-assignment {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .bulk-project-select {
    width: 100%;
    min-width: 0;
  }

  .bulk-select {
    justify-content: flex-start;
  }

  .upload-hero,
  .marketing-hero,
  .feature-band,
  .feature-grid,
  .audience-band,
  .audience-grid,
  .positioning-band,
  .positioning-list,
  .benefit-band,
  .benefit-grid,
  .seo-content,
  .pilot-band,
  .purchase_document-card,
  .purchase_document-card-link,
  .export-summary,
  .export-quality-list {
    grid-template-columns: 1fr;
  }

  .preview-record,
  .trust-band {
    grid-template-columns: 1fr;
  }

  .purchase_document-money {
    justify-items: start;
    text-align: left;
  }

  .dashboard-filter-form,
  .dashboard-main,
  .dashboard-breakdowns,
  .operations-grid,
  .settings-forwarding-card,
  .settings-action-grid,
  .workflow {
    grid-template-columns: 1fr;
  }

  .settings-forwarding-card {
    padding: 22px;
  }

  .settings-mail-illustration {
    display: none;
  }

  .settings-copy-box {
    grid-template-columns: 1fr;
  }

  .settings-copy-box strong {
    padding: 14px 16px;
  }

  .settings-copy-button {
    width: calc(100% - 8px);
    height: auto;
    margin: 0 4px 4px;
  }

  .settings-install-help div {
    margin-left: 0;
  }

  .settings-action-card {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 22px;
  }

  .settings-action-card .settings-action-button {
    grid-column: 1;
    width: 100%;
  }

  .settings-integration-card,
  .settings-integration-details {
    grid-template-columns: 1fr;
  }

  .settings-integration-actions {
    justify-self: stretch;
  }

  .settings-integration-action-stack {
    min-width: 0;
  }

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

  .xero-mapping-header {
    display: none;
  }

  .screenshot-stage {
    min-height: 280px;
  }

  .workflow {
    scroll-margin-top: 132px;
  }

  .toolbar, .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .final-cta,
  .marketing-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .final-cta .button {
    width: 100%;
  }

  .full-mobile { width: 100%; }

  .row-card {
    align-items: stretch;
    flex-direction: column;
  }

  .line-items {
    border: 0;
    background: transparent;
    gap: 10px;
  }

  .line-items .line-item-actions {
    padding: 0;
    border-top: 0;
  }

  .line-items-header {
    display: none;
  }

  .line-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .catalogue-suggestion {
    align-items: stretch;
    flex-direction: column;
  }

  .line-item .sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .review-banner,
  .review-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .add-supplier-form,
  .add-tax-rate-form,
  .catalogue-form,
  .catalogue-popover-form,
  .supplier-edit-layout,
  .supplier-bottom-panels,
  .supplier-field-grid,
  .supplier-merge-grid,
  .supplier-merge-stats,
  .supplier-panel-heading,
  .supplier-alias-create-form,
  .supplier-purchase-row,
  .supplier-catalogue-row,
  .project-edit-layout,
  .supporting-document-form,
  .project-table-header,
  .project-row,
  .catalogue-table-header,
  .catalogue-row,
  .category-table-header,
  .category-row,
  .tax-rate-table-header,
  .tax-rate-row,
  .income-document-table-header,
  .income-document-row,
  .supplier-list-heading,
  .supplier-table-header,
  .supplier-row,
  .management-row,
  .inline-edit {
    grid-template-columns: 1fr;
  }

  .supplier-list-heading,
  .supplier-panel-heading,
  .supplier-form-footer,
  .supplier-merge-actions,
  .project-list-heading,
  .income-document-heading,
  .management-list-heading,
  .catalogue-list-heading,
  .catalogue-toolbar,
  .supplier-toolbar,
  .supplier-actions,
  .management-actions,
  .project-actions,
  .supplier-aliases {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
  }

  .page-header-actions {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .supplier-table-header,
  .project-table-header,
  .category-table-header,
  .tax-rate-table-header {
    display: none;
  }

  .income-document-table-header {
    display: none;
  }

  .supplier-row,
  .project-row,
  .category-row,
  .tax-rate-row {
    gap: 8px;
  }

  .income-document-row {
    gap: 8px;
  }

  .getting-started-list li {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .getting-started-list li > .button,
  .getting-started-list li > .pill,
  .getting-started-list li > .muted {
    grid-column: 2;
    justify-self: start;
  }

  .income-empty {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 18px;
  }

  .income-empty-types {
    justify-content: flex-start;
  }

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

  .row-editor,
  .row-editor .inline-edit {
    position: static;
    width: 100%;
    min-width: 0;
    box-shadow: none;
  }

  .catalogue-actions {
    justify-content: flex-start;
  }

  .catalogue-table-header {
    display: none;
  }

  .catalogue-list {
    border: 0;
    gap: 10px;
  }

  .catalogue-row {
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .catalogue-row .sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0 0 4px;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  .row-meta {
    justify-items: start;
  }

  .bar-row,
  .breakdown-row,
  .project-profit-row {
    grid-template-columns: 1fr;
  }

  .project-profit-row dl {
    grid-template-columns: 1fr;
  }

  .bar-row strong,
  .breakdown-total {
    text-align: left;
  }

  .compact-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-pill {
    width: fit-content;
  }

  .totals-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  nav a,
  .link-button,
  .nav-menu summary {
    width: 100%;
    min-height: 42px;
  }
}

.app-shell-body {
  background: #fff;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 32px 16px 24px;
  border-right: 1px solid #e4e8ee;
  background: #fff;
}

.app-sidebar-brand {
  padding: 0 8px;
}

.app-sidebar-brand span {
  font-size: 1.7rem;
  letter-spacing: 0;
}

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

nav.app-nav {
  display: grid;
  align-content: start;
  gap: 12px;
  justify-content: stretch;
}

.app-nav-link,
nav.app-nav a.app-nav-link,
.app-admin-menu summary.app-nav-link,
.app-signout {
  min-height: 52px;
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #132033;
  font: inherit;
  text-decoration: none;
}

.app-nav-link .icon,
.app-signout .icon {
  width: 21px;
  height: 21px;
  color: #1b2a3e;
}

.app-nav-link.active,
nav.app-nav a.app-nav-link.active,
.app-admin-menu summary.app-nav-link.active {
  background: linear-gradient(90deg, #dff2eb, #edf7f2);
  color: #006f52;
  font-weight: 700;
}

.app-nav-link.active .icon {
  color: #007f5f;
}

.app-nav-link:hover,
nav.app-nav a.app-nav-link:hover,
.app-admin-menu summary.app-nav-link:hover,
.app-signout:hover {
  background: #f1f6f4;
  border-color: transparent;
}

.app-admin-menu {
  position: relative;
}

.app-admin-menu summary::-webkit-details-marker {
  display: none;
}

.app-admin-menu div {
  left: 16px;
  right: auto;
}

.app-sidebar-footer form {
  margin: 0;
}

.time-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.time-header h1 {
  margin: 0.2rem 0;
}

.time-dashboard-topline {
  margin-bottom: 12px;
}

.time-topline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.time-header-tools {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.time-week-switcher,
.time-actions,
.time-form-grid,
.time-employee-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.time-employee-switcher label {
  font-weight: 700;
}

.time-workbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.time-workbar-employee {
  display: grid;
  gap: 2px;
}

.time-workbar-employee small {
  color: var(--muted);
  font-weight: 700;
}

.time-week-switcher strong {
  white-space: nowrap;
}

.time-top-strip {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.time-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.time-top-strip article {
  padding: 0.8rem 1rem;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.time-top-strip article:last-child {
  border-right: 0;
}

.time-top-strip small,
.time-entry-row small,
.time-template-list span {
  display: block;
  color: var(--muted);
}

.time-top-strip strong {
  display: block;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.time-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef7f3;
}

.time-status-note {
  display: grid;
  gap: 0.15rem;
}

.time-status-note span {
  color: var(--muted);
}

.time-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
}

.time-panel {
  padding: 1rem;
}

.time-panel + .time-panel {
  margin-top: 1rem;
}

.time-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.time-panel-heading h2,
.time-panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.time-panel-heading p,
.time-panel p {
  margin: 0;
}

.time-entry-composer {
  margin-bottom: 1rem;
}

.time-index-panel {
  margin-top: 1rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.time-create-form {
  gap: 1rem;
}

.time-quick-form {
  grid-template-columns: minmax(118px, 0.85fr) minmax(118px, 0.75fr) minmax(180px, 1.35fr) minmax(150px, 1fr) minmax(96px, 0.55fr) auto;
  align-items: end;
}

.time-quick-form > details {
  grid-column: 1 / -1;
}

.time-advanced-fields {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.time-advanced-fields summary,
.time-repeat-details summary {
  cursor: pointer;
  font-weight: 800;
}

.time-advanced-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.time-notes-field {
  grid-column: span 2;
}

.time-week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.time-day-card {
  min-height: 174px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.time-day-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-muted);
}

.time-day-card > header span,
.time-day-card > header small {
  display: block;
  color: var(--muted);
}

.time-entry-list {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem;
}

.time-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.time-entry-row .time-scope-pill,
.time-entry-row > strong:last-of-type {
  display: none;
}

.time-entry-row > div {
  min-width: 0;
}

.time-entry-row > div strong,
.time-entry-row > div small {
  overflow-wrap: anywhere;
}

.time-empty-day {
  min-height: 104px;
  margin: 0.55rem;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.time-empty-day:hover {
  background: #f8fbfa;
  color: var(--primary-dark);
}

.time-employee-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.time-employee-table-header,
.time-employee-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) 130px 110px 130px 130px minmax(190px, 0.9fr);
  gap: 12px;
  align-items: center;
  min-width: 980px;
}

.time-employee-table-header {
  min-height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 900;
}

.time-employee-row {
  min-height: 66px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.time-employee-row:last-child {
  border-bottom: 0;
}

.time-employee-row:hover {
  background: #eef7f2;
}

.time-employee-table-header > span,
.time-employee-row > div {
  min-width: 0;
}

.time-employee-name {
  display: grid;
  gap: 0.15rem;
}

.time-employee-name strong {
  color: var(--ink);
}

.time-employee-name span {
  color: var(--muted);
}

.time-row-actions {
  display: flex;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.time-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.time-scope-pill {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.time-scope-pill.project {
  background: #e8f0ff;
  color: #173a8a;
}

.time-scope-pill.overhead {
  background: #fff3db;
  color: #7a4d00;
}

.time-form {
  display: grid;
  gap: 0.75rem;
}

.time-form-grid {
  align-items: start;
}

.time-form-grid > div {
  flex: 1;
}

.time-form-grid .checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 1.7rem;
}

.time-form-grid .checkbox-field input {
  width: auto;
}

.time-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.time-form input,
.time-form select,
.time-form textarea,
.time-employee-switcher select {
  width: 100%;
}

.time-sidebar {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.time-sidebar .time-panel + .time-panel {
  margin-top: 0;
}

.time-template-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.time-template-list > div,
.time-cost-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.time-repeat-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.time-cost-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.time-cost-list dt {
  color: var(--muted);
}

.time-cost-list dd {
  margin: 0;
  font-weight: 800;
}

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

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

  .time-top-strip article {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

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

  .time-header,
  .time-header-tools,
  .time-workbar,
  .time-panel-heading,
  .time-command-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .time-top-strip,
  .time-quick-form,
  .time-advanced-grid {
    grid-template-columns: 1fr;
  }

  .time-notes-field {
    grid-column: auto;
  }

  .time-actions,
  .time-week-switcher,
  .time-employee-switcher {
    flex-wrap: wrap;
  }

  .time-employee-table-header {
    display: none;
  }

  .time-employee-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .time-employee-row > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }

  .time-dashboard-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .time-topline-actions {
    justify-content: stretch;
  }

  .time-topline-actions .button {
    width: 100%;
  }
}

.app-signout {
  color: #4b5563;
  cursor: pointer;
}

.app-page {
  --app-page-gutter: 28px;
  --app-page-bottom-space: clamp(72px, 9vh, 120px);
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 calc(var(--app-page-bottom-space) + env(safe-area-inset-bottom));
  scroll-padding-bottom: var(--app-page-bottom-space);
}

.app-page > :not(.dashboard-screen):not(.dashboard-app-header):not(.flash):not(turbo-frame),
.app-page > turbo-frame > :not(.dashboard-screen):not(.dashboard-app-header):not(.flash) {
  margin-left: var(--app-page-gutter);
  margin-right: var(--app-page-gutter);
}

.app-page > turbo-frame {
  display: block;
}

.app-page turbo-frame[id$="_page"] {
  display: block;
  min-width: 0;
}

.app-page > turbo-frame > turbo-frame[id$="_page"] {
  width: auto;
  margin-left: var(--app-page-gutter);
  margin-right: var(--app-page-gutter);
}

.app-page > .purchase-edit-form {
  margin-left: 0;
  margin-right: 0;
}

.app-page > .flash {
  width: min(1216px, calc(100% - 48px));
  margin: 18px auto 16px;
}

.dashboard-screen {
  min-height: 100vh;
  padding: 0 28px 36px;
  background: #fff;
}

.dashboard-app-header {
  min-height: 94px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 0 0 16px;
  padding: 20px 28px;
  border-bottom: 1px solid #e4e8ee;
  background: #fff;
}

.dashboard-screen .dashboard-app-header {
  margin: 0 -28px 16px;
}

.app-page-subtitle {
  max-width: 820px;
  margin-top: -4px;
  margin-bottom: 18px;
  color: var(--muted);
}

.dashboard-app-header h1 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: 0;
}

.dashboard-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.accounting-header-status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #bfe1d4;
  border-radius: 999px;
  background: #e4f4ee;
  color: #006f52;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.accounting-header-status:hover {
  border-color: #94cab5;
  background: #d7eee5;
}

.accounting-header-status .icon {
  width: 18px;
  height: 18px;
}

.dashboard-select-menu {
  position: relative;
}

.dashboard-select-menu summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(19, 32, 51, 0.04);
  color: #101827;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.dashboard-select-menu summary::-webkit-details-marker {
  display: none;
}

.dashboard-select-menu summary:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, #dce3ea);
}

.dashboard-select-menu summary .icon {
  width: 20px;
  height: 20px;
  color: #132033;
}

.dashboard-select-menu summary .icon:last-child {
  width: 16px;
  height: 16px;
  color: #334155;
  pointer-events: none;
}

.dashboard-select-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 220px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.14);
}

.dashboard-select-menu:not([open]) > div {
  display: none;
}

.dashboard-select-section {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f5;
}

.dashboard-select-menu a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #101827;
  text-decoration: none;
  font-weight: 700;
}

.dashboard-select-menu a:hover,
.dashboard-select-menu a.active {
  background: #e4f4ee;
  color: #006f52;
}

.dashboard-date-form {
  display: grid;
  gap: 8px;
  padding: 4px 2px 2px;
}

.dashboard-date-form label {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}

.dashboard-date-form div {
  display: grid;
  gap: 8px;
}

.dashboard-date-form input {
  min-height: 38px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #dce3ea;
  border-radius: 6px;
  font: inherit;
}

.dashboard-date-form .button {
  min-height: 36px;
}

.notification-menu {
  position: relative;
}

.notification-menu summary {
  position: relative;
  width: 52px;
  min-height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  list-style: none;
  cursor: pointer;
}

.notification-menu summary::-webkit-details-marker {
  display: none;
}

.notification-menu summary .icon {
  width: 24px;
  height: 24px;
}

.notification-menu summary > span {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #e21a12;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 20px);
  right: -132px;
  z-index: 25;
  width: min(398px, calc(100vw - 28px));
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
}

.notification-panel::before {
  content: "";
  position: absolute;
  top: -9px;
  right: 254px;
  width: 18px;
  height: 18px;
  border-left: 1px solid #dfe5ec;
  border-top: 1px solid #dfe5ec;
  background: #fff;
  transform: rotate(45deg);
}

.notification-heading,
.notification-updates,
.notification-footer {
  padding: 22px;
}

.notification-heading {
  display: grid;
  grid-template-columns: minmax(0, auto) auto 1fr;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
}

.notification-heading h2,
.notification-updates h2 {
  margin: 0;
  font-size: 1rem;
}

.notification-heading > span {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e21a12;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.notification-heading form {
  justify-self: end;
}

.notification-heading .text-link,
.notification-heading .link-button {
  justify-self: end;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #006f52;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.notification-action-list {
  display: grid;
  gap: 12px;
  padding: 0 10px 18px;
}

.notification-action,
.notification-update {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 20px 18px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.notification-action.warning {
  background: linear-gradient(135deg, #fff8df, #fff3d3);
}

.notification-action.read {
  background: #f8fafc;
}

.notification-action.danger {
  background: linear-gradient(135deg, #fff1f1, #fee8e9);
}

.notification-action .icon,
.notification-update .icon {
  width: 28px;
  height: 28px;
  color: #f59e0b;
}

.notification-action.danger .icon {
  color: #e21a12;
}

.notification-action div,
.notification-update div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notification-action span,
.notification-update span,
.notification-action small,
.notification-update small {
  color: #475569;
  font-size: 0.9rem;
}

.notification-action em {
  width: fit-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 7px 12px;
  border: 1px solid #2b9274;
  border-radius: 5px;
  color: #006f52;
  font-style: normal;
  font-weight: 700;
}

.notification-empty {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 6px;
  background: #f3f8f5;
}

.notification-updates {
  display: grid;
  gap: 12px;
  border-top: 1px solid #edf1f5;
}

.notification-update {
  padding: 8px 0;
}

.notification-update .icon {
  padding: 5px;
  border-radius: 999px;
  background: #e0f2e9;
  color: #007f5f;
}

.notification-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #edf1f5;
  color: #006f52;
  font-weight: 700;
  text-decoration: none;
}

.notification-footer::after {
  content: ">";
  font-size: 1.4rem;
  line-height: 1;
}

.dashboard-user-menu {
  min-height: 52px;
  position: relative;
}

.dashboard-user-menu summary {
  min-height: 52px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #101827;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}

.dashboard-user-menu summary::-webkit-details-marker {
  display: none;
}

.dashboard-avatar-fallback,
.dashboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.dashboard-avatar-fallback {
  display: grid;
  place-items: center;
  background: #e5e7eb;
  font-weight: 700;
}

.dashboard-avatar {
  display: block;
  object-fit: cover;
  background: #e5e7eb;
}

.dashboard-user-menu .icon {
  width: 16px;
  height: 16px;
  color: #334155;
}

.dashboard-user-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 220px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.14);
}

.dashboard-user-menu:not([open]) > div {
  display: none;
}

.dashboard-user-menu > div > strong {
  padding: 8px 10px 10px;
  border-bottom: 1px solid #edf1f5;
  color: #475569;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.dashboard-user-menu a,
.dashboard-user-menu .link-button {
  min-height: 38px;
  justify-content: flex-start;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: #101827;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-user-menu a:hover,
.dashboard-user-menu .link-button:hover {
  background: #e4f4ee;
  color: #006f52;
}

.dashboard-command-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
}

.dashboard-command-row > div {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-basis-note {
  margin: 0;
  color: #4b5b58;
  font-size: 0.92rem;
}

.dashboard-primary-button,
.dashboard-secondary-button {
  min-height: 44px;
  box-shadow: 0 8px 18px rgba(0, 111, 82, 0.16);
}

.dashboard-primary-button .icon,
.dashboard-secondary-button .icon {
  width: 18px;
  height: 18px;
}

.dashboard-secondary-button {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.upload-choice-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 26, 23, 0.24);
}

.upload-choice-dialog::backdrop {
  background: rgba(12, 18, 15, 0.42);
}

.upload-choice-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
  background: #fff;
}

.upload-choice-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.upload-choice-heading h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.upload-choice-heading p {
  margin: 0;
  color: #4b5b58;
  line-height: 1.5;
}

.upload-choice-list {
  display: grid;
  gap: 12px;
}

.upload-choice-form {
  margin: 0;
}

.upload-choice-option {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #d9e4df;
  border-radius: 8px;
  color: #101827;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.upload-choice-option:hover,
.upload-choice-option.drag-active,
.upload-choice-option:focus-within {
  border-color: #8fcdb6;
  background: #f3faf7;
  transform: translateY(-1px);
}

.upload-choice-icon {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e4f4ee;
  color: #006f52;
}

.upload-choice-option strong {
  grid-column: 2 / 3;
  font-size: 1rem;
}

.upload-choice-option small {
  grid-column: 2 / 3;
  color: #4b5b58;
  line-height: 1.4;
}

.upload-choice-option em {
  grid-column: 2 / 3;
  color: #006f52;
  font-style: normal;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-choice-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-kpi-card,
.dashboard-card {
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.dashboard-kpi-card {
  min-height: 156px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 26px 28px;
}

.dashboard-kpi-card div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.dashboard-kpi-card span:first-child,
.dashboard-card-heading h2 {
  color: #101827;
}

.dashboard-kpi-card strong {
  font-size: 2.35rem;
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-kpi-card small {
  font-size: 1rem;
  font-weight: 700;
}

.metric-glyph {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e6f3ee;
  color: #007f5f;
}

.metric-glyph .icon {
  width: 36px;
  height: 36px;
  stroke-width: 2.4;
}

.is-positive {
  color: #007f5f !important;
}

.is-negative {
  color: #e21a12 !important;
}

.dashboard-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.95fr);
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.dashboard-card {
  padding: 24px;
}

.dashboard-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.dashboard-card-heading h2 {
  margin: 0;
  font-size: 1.24rem;
}

.dashboard-card-heading h2 span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-card-heading .text-link {
  color: #006f52;
  font-size: 0.92rem;
  text-decoration: none;
}

.dashboard-period-pill,
.dashboard-trend-menu summary {
  min-height: 38px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #dde4eb;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.dashboard-period-pill .icon,
.dashboard-trend-menu summary .icon {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.dashboard-trend-menu div {
  min-width: 140px;
}

.trend-chart {
  min-height: 244px;
  overflow: hidden;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: -8px;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.trend-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.trend-legend span::before {
  content: "";
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: #007f5f;
}

.trend-legend .previous-line-key::before {
  background: #8da8b7;
}

.trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.trend-chart line {
  stroke: #e7ecf1;
  stroke-width: 1;
}

.trend-chart text {
  fill: #253044;
  font-size: 12px;
}

.trend-chart .trend-label {
  fill: #334155;
}

.trend-chart polygon {
  fill: rgba(0, 127, 95, 0.1);
}

.trend-chart polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.trend-chart .current-line {
  stroke: #007f5f;
}

.trend-chart .previous-line {
  stroke: #8da8b7;
  stroke-dasharray: 8 8;
}

.trend-chart circle {
  fill: #fff;
  stroke-width: 4;
}

.trend-chart .current-point {
  stroke: #007f5f;
}

.trend-chart .previous-point {
  stroke: #8da8b7;
  stroke-width: 3;
}

.dashboard-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: #006f52;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-link .icon {
  width: 17px;
  height: 17px;
}

.project-overview-list {
  display: grid;
}

.project-overview-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 18px;
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid #edf1f5;
  color: inherit;
  text-decoration: none;
}

.project-overview-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-overview-row > div {
  display: grid;
  gap: 2px;
}

.project-overview-row small {
  color: #475569;
  font-size: 0.88rem;
  font-weight: 400;
}

.project-overview-row > strong {
  display: flex;
  gap: 8px;
  align-items: baseline;
  white-space: nowrap;
}

.project-overview-row > .icon {
  color: #334155;
}

.project-folder {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e8f4ef;
  color: #007f5f;
}

.project-folder .icon {
  width: 24px;
  height: 24px;
  fill: #007f5f;
  stroke-width: 1.6;
}

.category-donut-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.category-donut {
  width: 154px;
  aspect-ratio: 1;
  border-radius: 999px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.category-donut::after {
  content: "";
  position: absolute;
  inset: 36px;
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.category-legend {
  display: grid;
  gap: 15px;
}

.category-legend div {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto 44px;
  gap: 12px;
  align-items: center;
}

.category-legend span {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--dot-color);
}

.category-legend em {
  font-style: normal;
}

.category-legend small {
  color: #101827;
  font-weight: 700;
  text-align: right;
}

.supplier-bars {
  display: grid;
  gap: 17px;
}

.supplier-bars div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
}

.supplier-bars span {
  min-width: 0;
}

.supplier-bars strong {
  font-weight: 700;
}

.supplier-bars small {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 0.88rem;
}

.supplier-bars i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.supplier-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #007f5f;
}

.settings-profile-panel {
  margin-bottom: 14px;
}

.settings-profile-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.settings-avatar-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: #e5e7eb;
}

.settings-avatar-preview.avatar-placeholder {
  display: grid;
  place-items: center;
  color: #101827;
  font-size: 1.6rem;
  font-weight: 800;
}

.settings-avatar-form {
  max-width: 420px;
  margin-bottom: 10px;
}

.settings-avatar-form input[type="file"] {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profile-details {
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-details div {
  display: grid;
  grid-template-columns: minmax(120px, 0.25fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.profile-details div:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-details dt {
  color: var(--muted);
  font-weight: 700;
}

.profile-details dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .app-sidebar {
    padding-inline: 12px;
  }

  .app-sidebar-brand span,
  .app-nav-link span,
  .app-signout span {
    display: none;
  }

  .app-nav-link,
  nav.app-nav a.app-nav-link,
  .app-admin-menu summary.app-nav-link,
  .app-signout {
    justify-content: center;
    padding-inline: 12px;
  }

  .dashboard-work-grid,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: relative;
    top: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #e4e8ee;
  }

  .app-sidebar-brand {
    width: fit-content;
    min-height: 44px;
    padding: 0 56px 0 0;
  }

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

  .app-sidebar-brand span {
    font-size: 1.45rem;
  }

  .app-sidebar-footer {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .app-sidebar-footer form {
    display: block;
  }

  .app-signout {
    width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 10px;
  }

  .app-signout span {
    display: none;
  }

  nav.app-nav {
    width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  nav.app-nav::-webkit-scrollbar {
    display: none;
  }

  .app-nav-link,
  nav.app-nav a.app-nav-link,
  .app-admin-menu summary.app-nav-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.92rem;
  }

  .app-nav-link .icon,
  .app-signout .icon {
    width: 18px;
    height: 18px;
  }

  .app-sidebar-brand span,
  .app-nav-link span {
    display: inline;
  }

  .dashboard-screen {
    padding-inline: 16px;
  }

  .app-page {
    --app-page-gutter: 16px;
    --app-page-bottom-space: 96px;
  }

  .dashboard-app-header {
    align-items: stretch;
    flex-direction: column;
    margin-inline: -16px;
    padding: 18px 16px;
  }

  .dashboard-screen .dashboard-app-header {
    margin-inline: -16px;
  }

  .dashboard-header-actions,
  .dashboard-command-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .accounting-header-status {
    min-height: 36px;
    padding: 8px 10px;
  }

  .dashboard-command-row > div {
    justify-content: flex-start;
  }

  .dashboard-period-menu summary,
  .dashboard-user-menu summary {
    min-height: 44px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .notification-panel {
    left: 0;
    right: auto;
  }

  .notification-panel::before {
    right: auto;
    left: 18px;
  }

  .category-donut-layout {
    grid-template-columns: 1fr;
  }

  .settings-profile-row {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .catalogue-insights {
    grid-template-columns: 1fr;
  }

  .dashboard-period-menu {
    flex: 1 1 168px;
  }

  .dashboard-period-menu summary {
    justify-content: flex-start;
    width: 100%;
  }

  .dashboard-select-menu > div {
    left: 0;
    right: auto;
  }

  .dashboard-user-menu summary strong {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .accounting-header-status span {
    display: none;
  }

  .accounting-header-status {
    width: 42px;
    justify-content: center;
    padding-inline: 0;
  }

  .dashboard-command-row .button {
    flex: 1 1 100%;
  }

  .dashboard-command-row .upload-choice-dialog .button {
    flex: 0 0 auto;
  }

  .upload-choice-panel {
    padding: 20px;
  }

  .upload-choice-heading {
    gap: 12px;
  }

  .upload-choice-option {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 14px;
  }

  .upload-choice-icon {
    width: 40px;
    height: 40px;
  }

  .dashboard-card {
    padding: 18px;
  }

  .dashboard-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-overview-row {
    grid-template-columns: 44px minmax(0, 1fr) 18px;
  }

  .project-overview-row > strong {
    grid-column: 2 / 3;
  }
}

@media (max-width: 1320px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .home-hero-copy {
    max-width: 780px;
  }

  .home-demo {
    justify-self: center;
    width: min(100%, 900px);
  }

  .home-step-track {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin-inline: auto;
  }

  .home-step-track .step-connector {
    width: 80px;
    transform: rotate(90deg);
    transform-origin: center;
    justify-self: center;
    margin: 0;
  }

  .home-checks-band,
  .home-project-profit,
  .home-profit-card {
    grid-template-columns: 1fr;
  }

  .home-supplier-mini-list {
    padding-left: 0;
    padding-top: 22px;
    border-left: 0;
    border-top: 1px solid #dfe5ee;
  }
}

@media (max-width: 860px) {
  .home-page {
    width: min(100% - 32px, 720px);
  }

  .home-body .marketing-footer {
    width: min(100% - 32px, 720px);
  }

  .home-topbar {
    min-height: 78px;
    align-items: center;
    flex-direction: row;
    gap: 14px;
    padding: 16px;
  }

  .home-topbar .brand {
    font-size: 1.7rem;
  }

  .home-topbar .brand-mark {
    width: 42px;
    height: 42px;
  }

  .home-topbar nav {
    width: auto;
    margin-left: auto;
    gap: 8px;
  }

  .home-topbar nav a:not(.button) {
    font-size: 1rem;
  }

  .home-topbar .button.small {
    --button-height: 46px;
    --button-padding-y: 10px;
    --button-padding-x: 14px;
    font-size: 1rem;
  }

  .home-hero {
    min-height: 0;
    padding: 34px 0 30px;
  }

  .home-hero h1 {
    font-size: clamp(2.65rem, 11vw, 4rem);
  }

  .home-demo {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .purchase_document-photo {
    justify-self: center;
  }

  .read-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .supplier-read-card {
    width: min(100%, 390px);
    justify-self: center;
  }

  .home-steps {
    padding: 34px 0;
  }

  .home-checks-band {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .home-chase-list,
  .seo-proof-strip {
    grid-template-columns: 1fr;
  }

  .home-chase-list {
    display: grid;
  }

  .home-project-profit {
    padding-inline: 0;
  }

  .home-profit-metrics {
    grid-template-columns: 1fr;
  }

  .home-profit-metrics div,
  .home-profit-metrics div:nth-child(2n) {
    border-right: 0;
  }

  .home-profit-metrics div:nth-child(n + 2) {
    padding-top: 22px;
    border-top: 1px solid #dfe5ee;
  }

  .steps-title-icon,
  .home-steps h2 {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  .home-topbar .brand span {
    display: none;
  }

  .home-audience {
    align-items: flex-start;
  }

  .home-cta {
    width: 100%;
  }

  .home-cta-note {
    width: 100%;
  }

  .purchase_document-paper {
    min-height: 0;
    padding: 44px 24px 26px;
    gap: 22px;
  }

  .purchase_document-photo::before {
    border-width: 10px;
  }

  .purchase_document-lines {
    font-size: 0.82rem;
  }

  .purchase_document-lines > div {
    grid-template-columns: 1.1fr 0.55fr 0.7fr 0.82fr;
  }

  .purchase_document-badge {
    right: 10px;
  }

  .supplier-read-card {
    min-height: 0;
    padding: 42px 22px 24px;
  }

  .read-fields div,
  .read-summary div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .read-fields dd {
    text-align: left;
  }

  .home-step {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
  }

  .step-icon {
    width: 78px;
    height: 78px;
  }

  .step-icon .icon {
    width: 42px;
    height: 42px;
  }
}

.item-filter-form {
  grid-template-columns: minmax(320px, 1.7fr) repeat(6, minmax(128px, 1fr)) 44px;
}

.item-insight-metrics {
  margin-bottom: 18px;
}

.item-insight-metrics .metric strong {
  overflow-wrap: anywhere;
}

.item-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.insight-chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.insight-chart-card[id] {
  scroll-margin-top: 112px;
}

.insight-chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.insight-chart-heading h2,
.insight-chart-heading p {
  margin: 0 0 5px;
}

.insight-chart {
  position: relative;
  height: 280px;
  min-height: 280px;
}

.line-item-table {
  overflow-x: auto;
}

.line-item-table-header,
.line-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) minmax(140px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) 100px 90px 110px 120px 110px;
  gap: 12px;
  align-items: center;
  min-width: 1160px;
}

.line-item-table-header.detail,
.line-item-row.detail {
  grid-template-columns: minmax(220px, 1.45fr) minmax(140px, 1fr) minmax(130px, 0.9fr) 100px 90px 110px 110px 110px;
  min-width: 1020px;
}

.line-item-table-header {
  padding: 10px 12px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}

.line-item-row {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.line-item-row:hover {
  background: #f8faf8;
}

.line-item-name,
.line-item-purchase_document-link {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.line-item-name strong,
.line-item-purchase_document-link strong {
  overflow-wrap: anywhere;
}

.line-item-purchase_document-link {
  color: inherit;
  text-decoration: none;
}

.line-item-purchase_document-link span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.price-up,
.price-down {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.price-up {
  background: #fff4e2;
  color: #9a4c00;
}

.price-down {
  background: #eaf7ef;
  color: #006747;
}

.item-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  margin-bottom: 18px;
}

.supplier-comparison-list {
  display: grid;
  gap: 10px;
}

.supplier-comparison-list > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.supplier-comparison-list span,
.supplier-comparison-list small {
  font-size: var(--text-sm);
}

@media (max-width: 1180px) {
  .item-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-chart-grid,
  .item-detail-grid,
  .grid.four {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .item-filter-form {
    grid-template-columns: 1fr;
  }

  .insight-chart {
    height: 240px;
    min-height: 240px;
  }
}

.items-page {
  --items-card-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  --items-soft-shadow: 0 4px 16px rgba(15, 23, 42, 0.055);
}

.items-page .dashboard-app-header {
  margin: 0 calc(var(--app-page-gutter) * -1) 4px;
}

.items-page .dashboard-app-header h1 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.items-page .dashboard-app-header h1 > .icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.items-page .app-page-subtitle {
  margin-top: 16px;
  margin-bottom: 28px;
}

.items-page .section-tabs {
  margin-bottom: 22px;
}

.items-filter-card {
  margin-bottom: 18px;
}

.items-page .item-filter-form {
  display: grid;
  grid-template-columns: minmax(320px, 1.7fr) repeat(6, minmax(128px, 1fr)) 44px;
  gap: 16px;
  align-items: flex-end;
}

.items-page .item-filter-form label {
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 800;
}

.items-page .item-filter-form input,
.items-page .item-filter-form select,
.items-page .item-filter-form .ts-wrapper.single .ts-control,
.items-page .item-filter-form .ts-wrapper.multi .ts-control {
  min-height: 44px;
  border-color: #d9e1ea;
  border-radius: 8px;
  background-color: #fff;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 400;
}

.items-page .filter-actions {
  align-items: flex-end;
}

.items-page .item-insight-metrics {
  gap: 16px;
  margin-bottom: 18px;
}

.items-page .item-insight-metrics .metric {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 148px;
  border-color: #e2e8f0;
  border-radius: 10px;
  box-shadow: var(--items-soft-shadow);
}

.items-page .item-insight-metrics .metric span:first-child {
  color: #334155;
  font-weight: 600;
}

.items-page .item-insight-metrics .metric strong {
  display: block;
  margin-top: 18px;
  color: #0f172a;
  font-size: clamp(1.65rem, 2.3vw, 2.25rem);
  line-height: 1.16;
}

.items-page .item-insight-metrics .metric small {
  display: block;
  margin-top: 12px;
  color: #334155;
  font-weight: 700;
}

.items-page .item-money {
  color: var(--primary);
}

.item-metric-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #dff2ea;
  color: var(--primary);
}

.item-metric-icon.trend {
  background: #dff2ea;
}

.item-metric-icon.warning {
  background: #fdeccf;
  color: #c66a00;
}

.item-metric-icon .icon {
  width: 25px;
  height: 25px;
}

.items-page .item-chart-grid {
  gap: 16px;
}

.items-page .insight-chart-card {
  min-height: 300px;
  border-color: #e2e8f0;
  border-radius: 10px;
  box-shadow: var(--items-soft-shadow);
}

.items-page .insight-chart-heading {
  align-items: flex-start;
}

.items-page .insight-chart-heading h2 {
  margin-bottom: 5px;
  color: #0f172a;
  font-size: 1.15rem;
}

.items-page .insight-chart-heading p {
  color: #334155;
}

.items-page .insight-chart-action {
  --button-height: 34px;
  min-width: 72px;
  border-color: #d9e1ea;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.items-page .insight-chart {
  height: 250px;
  min-height: 250px;
}

.items-page .dashboard-empty {
  display: grid;
  place-items: center;
  min-height: 205px;
  margin: 0;
  color: #334155;
  text-align: center;
}

.items-page .dashboard-empty::before {
  content: "";
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #eef2f7;
}

.items-table-panel {
  margin-top: 2px;
  border-color: #e2e8f0;
  border-radius: 10px;
  box-shadow: var(--items-soft-shadow);
}

.items-table-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.items-table-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.items-table-actions .button {
  --button-height: 36px;
  border-color: #d9e1ea;
}

.items-table-actions .icon {
  width: 16px;
  height: 16px;
}

.items-page .line-item-table {
  overflow-x: auto;
}

.items-page .line-item-table-header,
.items-page .line-item-row {
  grid-template-columns: minmax(190px, 1.3fr) minmax(180px, 1.05fr) minmax(120px, 0.8fr) minmax(150px, 1fr) 112px 80px 112px 118px 120px;
  min-width: 1120px;
}

.items-page .line-item-table-header {
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.items-page .line-item-row {
  min-height: 62px;
  border-top: 0;
  border-bottom: 1px solid #e8edf3;
  color: #0f172a;
}

.items-page .line-item-row:last-child {
  border-bottom: 0;
}

.items-page .line-item-name strong,
.items-page .line-item-purchase_document-link strong {
  font-size: 0.95rem;
}

.items-page .line-item-name .muted,
.items-page .line-item-purchase_document-link span {
  color: #64748b;
  font-weight: 600;
}

.line-item-supplier {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.line-item-supplier > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-initials {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dff2ea;
  color: #0f513c;
  font-size: 0.7rem;
  font-weight: 800;
}

.movement-neutral {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: var(--text-sm);
}

.movement-neutral i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aab4c0;
}

@media (max-width: 1180px) {
  .items-page .item-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .items-table-heading,
  .items-page .item-insight-metrics .metric {
    flex-direction: column;
  }

  .items-page .item-filter-form {
    grid-template-columns: 1fr;
  }
}

.purchase-documents-panel .purchase-document-row,
.income-documents-panel .income-document-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(120px, 0.9fr) minmax(120px, 0.85fr) 112px 130px minmax(130px, 0.95fr) 112px;
  align-items: center;
  gap: 12px;
}
