:root {
  --bg: #17100d;
  --bg-2: #201512;
  --panel: #281a16;
  --panel-2: #321f19;
  --paper: #3a241d;
  --line: #4c2f25;
  --line-strong: #664035;
  --text: #fff5ee;
  --muted: #ad9589;
  --muted-2: #765f55;
  --orange: #ed8a56;
  --orange-2: #ffb07b;
  --orange-soft: #3b241b;
  --green: #69cf9d;
  --red: #ef7c7b;
  --blue: #8ec7ff;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
  --radius: 10px;
}
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
body {
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
input,
select,
textarea {
  width: 100%;
  background: #1d1310;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: #735d53;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(237, 138, 86, 0.12);
  outline: 0;
}
textarea {
  resize: vertical;
  min-height: 78px;
}
.button,
.icon-button {
  border-radius: 7px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  white-space: nowrap;
}
.button {
  padding: 9px 13px;
  background: #42271e;
  color: var(--text);
}
.button:hover {
  background: #553027;
}
.button.primary {
  background: var(--orange);
  color: #24130d;
}
.button.primary:hover {
  background: var(--orange-2);
}
.button.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.button.ghost:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
}
.button.wide {
  width: 100%;
  margin-top: 10px;
}
.button.small {
  padding: 7px 9px;
  font-size: 12px;
}
.icon-button {
  background: #261713;
  border-color: var(--line);
  padding: 8px;
  color: var(--muted);
}
.icon-button:hover {
  color: var(--text);
  border-color: var(--orange);
}
.button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 460px;
  background: var(--bg);
}
.auth-art {
  position: relative;
  overflow: hidden;
  padding: 10vh 10%;
  background: #211410;
  display: flex;
  align-items: center;
}
.auth-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(#9c5533 1px, transparent 1px),
    linear-gradient(90deg, #9c5533 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: linear-gradient(120deg, black, transparent 75%);
}
.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 490px;
}
.auth-copy .logo-mark {
  width: 55px;
  height: 55px;
  font-size: 27px;
  margin-bottom: 20px;
}
.logo-word {
  font:
    700 clamp(42px, 6vw, 84px) / 0.96 "Space Grotesk",
    sans-serif;
  display: block;
  letter-spacing: -0.07em;
}
.auth-copy p {
  font:
    600 27px/1.1 "Space Grotesk",
    sans-serif;
  color: var(--orange-2);
  margin: 25px 0 10px;
}
.auth-copy small {
  color: var(--muted);
  font-size: 14px;
}
.auth-orbit {
  position: absolute;
  border: 1px solid rgba(237, 138, 86, 0.32);
  border-radius: 50%;
  transform: rotate(-26deg);
}
.orbit-one {
  width: 590px;
  height: 230px;
  right: -170px;
  top: 23%;
}
.orbit-two {
  width: 620px;
  height: 240px;
  right: -160px;
  top: 35%;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px clamp(30px, 6vw, 80px);
  background: #190f0c;
  border-left: 1px solid var(--line);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font:
    700 20px "Space Grotesk",
    sans-serif;
  margin-bottom: 36px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--orange);
  color: #28140c;
  display: inline-grid;
  place-items: center;
  font:
    700 18px "Space Grotesk",
    sans-serif;
  box-shadow: 0 0 0 5px rgba(237, 138, 86, 0.08);
}
.logo-mark.small {
  width: 28px;
  height: 28px;
  font-size: 14px;
  border-radius: 7px;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 25px;
  gap: 19px;
}
.auth-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0 0 11px;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}
.auth-tab.active {
  color: var(--text);
  border-color: var(--orange);
}
.auth-panel .field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 6px;
}
.auth-status {
  color: var(--orange-2);
  min-height: 20px;
  font-size: 12px;
}
.auth-note {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 24px;
}
.app-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  padding: 19px 14px;
  background: #1b100d;
  border-right: 1px solid var(--line);
  transition: width 0.2s;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 30px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand strong {
  display: block;
  font:
    700 18px "Space Grotesk",
    sans-serif;
  letter-spacing: -0.03em;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}
.sidebar-collapse {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px;
}
.sidebar-collapse:hover {
  color: var(--orange);
}
.sidebar-collapse svg {
  width: 17px;
}
.side-caption {
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  padding: 0 12px;
  margin: 0 0 8px;
}
.settings-caption {
  margin-top: 26px;
}
.main-nav {
  display: grid;
  gap: 4px;
}
.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 7px;
  text-align: left;
  font-weight: 700;
}
.nav-item:hover {
  color: var(--text);
  background: #2a1813;
}
.nav-item.active {
  color: var(--orange-2);
  background: #352016;
  border-color: #5b3828;
}
.nav-item svg {
  width: 17px;
  height: 17px;
}
.sidebar-spacer {
  flex: 1;
}
.sidebar-account {
  border-top: 1px solid var(--line);
  padding: 15px 8px 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.account-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6d3d2b;
  color: #ffd9c1;
  font-size: 11px;
  font-weight: 800;
}
.account-copy {
  min-width: 0;
  flex: 1;
}
.account-copy strong,
.account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-copy strong {
  font-size: 12px;
}
.account-copy small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.sidebar-account button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px;
}
.sidebar-account button:hover {
  color: var(--orange);
}
.main {
  min-width: 0;
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 14, 11, 0.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.breadcrumb svg {
  width: 14px;
}
.breadcrumb strong {
  color: var(--text);
  font-size: 15px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
}
.sync-badge svg {
  width: 13px;
}
.sync-badge.online {
  color: var(--green);
  border-color: #366d53;
}
.view {
  display: none;
  padding: 32px 34px 50px;
  max-width: 1600px;
  margin: auto;
}
.view.active {
  display: block;
}
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.eyebrow {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page-heading h1 {
  font:
    700 30px "Space Grotesk",
    sans-serif;
  letter-spacing: -0.06em;
  margin: 6px 0 4px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}
.stat-card,
.panel,
.client-card,
.catalog-card,
.settings-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-card {
  padding: 16px;
  min-height: 113px;
  position: relative;
  overflow: hidden;
}
.stat-card:after {
  content: "";
  width: 94px;
  height: 94px;
  position: absolute;
  border-radius: 50%;
  right: -33px;
  top: -30px;
  background: rgba(237, 138, 86, 0.08);
}
.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--orange-soft);
  color: var(--orange);
  display: grid;
  place-items: center;
  margin-bottom: 13px;
}
.stat-icon svg {
  width: 16px;
}
.stat-value {
  font:
    700 24px "Space Grotesk",
    sans-serif;
  letter-spacing: -0.04em;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
}
.stat-delta {
  position: absolute;
  right: 14px;
  bottom: 15px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 15px;
}
.panel {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.11);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font:
    600 15px "Space Grotesk",
    sans-serif;
  margin: 0;
}
.panel-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.panel-body {
  padding: 18px;
}
.bar-chart {
  height: 170px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 13px;
  align-items: end;
}
.bar-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 8px;
}
.bar-stack {
  width: 100%;
  max-width: 39px;
  height: 135px;
  display: flex;
  align-items: end;
  gap: 4px;
}
.bar {
  width: 50%;
  background: #71422e;
  border-radius: 4px 4px 2px 2px;
}
.bar.received {
  background: var(--orange);
}
.bar-label {
  font-size: 10px;
  color: var(--muted);
}
.bar-legend {
  display: flex;
  gap: 13px;
  color: var(--muted);
  font-size: 11px;
}
.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #71422e;
}
.dot.orange {
  background: var(--orange);
}
.aging-list {
  display: grid;
  gap: 16px;
}
.aging-row {
  display: grid;
  grid-template-columns: 75px 1fr 75px;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.aging-name {
  color: var(--muted);
}
.aging-track {
  height: 7px;
  background: #1b110e;
  border-radius: 99px;
  overflow: hidden;
}
.aging-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 99px;
}
.aging-row:nth-child(2) .aging-fill {
  background: #c26e48;
}
.aging-row:nth-child(3) .aging-fill {
  background: #914638;
}
.aging-row:nth-child(4) .aging-fill {
  background: #704032;
}
.aging-amount {
  text-align: right;
  font-weight: 800;
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.data-table th {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: left;
}
.data-table td {
  padding: 13px 18px;
  border-bottom: 1px solid #38231e;
  font-size: 13px;
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table tr:hover td {
  background: #2e1b16;
}
.invoice-id {
  font-weight: 800;
}
.client-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}
.client-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #3b2b48;
  color: #d5bdff;
  font-size: 10px;
  font-weight: 900;
}
.client-avatar.orange {
  background: #4b2d25;
  color: #ffc2a0;
}
.client-avatar.green {
  background: #1f4438;
  color: #9be4bc;
}
.muted {
  color: var(--muted);
}
.money {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}
.status-pill:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-paid {
  color: var(--green);
  background: #173a2d;
}
.status-sent {
  color: var(--blue);
  background: #1d3244;
}
.status-draft {
  color: #c0aaa0;
  background: #352821;
}
.status-overdue {
  color: var(--red);
  background: #482221;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  opacity: 1;
}
.row-actions button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 5px;
  border-radius: 5px;
}
.row-actions button:hover {
  background: #40251d;
  color: var(--orange-2);
}
.row-actions svg {
  width: 15px;
  height: 15px;
}
.row-actions select {
  width: auto;
  padding: 5px 7px;
  font-size: 11px;
  background: #1b110e;
}
.toolbar-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.searchbox {
  position: relative;
  min-width: 230px;
}
.searchbox svg {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 15px;
  color: var(--muted);
}
.searchbox input {
  padding-left: 32px;
}
.select-compact {
  width: auto;
  min-width: 132px;
  padding: 8px 10px;
  font-size: 12px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--orange-2);
  font-weight: 800;
  font-size: 12px;
  padding: 4px;
}
.link-btn:hover {
  text-decoration: underline;
}
.client-grid,
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.client-card,
.catalog-card {
  padding: 16px;
}
.client-card-head,
.catalog-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.client-card h3,
.catalog-card h3 {
  margin: 0;
  font:
    600 15px "Space Grotesk",
    sans-serif;
}
.client-card p,
.catalog-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0;
}
.client-card-footer {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.empty {
  padding: 46px;
  text-align: center;
  color: var(--muted);
}
.empty svg {
  width: 28px;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.empty p {
  margin: 4px 0 14px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  max-width: 1000px;
}
.settings-card {
  padding: 20px;
}
.settings-card h2 {
  font:
    600 16px "Space Grotesk",
    sans-serif;
  margin: 0;
}
.section-copy {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 17px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field.full {
  grid-column: 1/-1;
}
.integration-box,
.notice {
  margin-top: 13px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #21130f;
  color: var(--muted);
  font-size: 11px;
}
.notice {
  border-style: solid;
  border-color: #70412c;
  background: #3a2119;
  color: #e8b497;
}
.integration-box p {
  margin: 7px 0 0;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.toggle {
  position: relative;
  width: 38px;
  height: 21px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle span {
  position: absolute;
  inset: 0;
  background: #4a3027;
  border-radius: 99px;
}
.toggle span:before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  top: 3px;
  left: 3px;
  background: #c3a79a;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + span {
  background: var(--orange);
}
.toggle input:checked + span:before {
  transform: translateX(17px);
  background: #26140d;
}
.editor-view {
  padding: 0 !important;
  max-width: none !important;
  height: calc(100vh - 70px);
  overflow: hidden;
}
.editor-shell {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
}
.inspector {
  background: #211410;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.editor-toolbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
  background: #1c100d;
  position: sticky;
  top: 0;
  z-index: 3;
}
.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-button:hover {
  color: var(--orange);
}
.save-state {
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}
.inspector-body {
  padding: 15px;
}
.form-section {
  background: #291a15;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 11px;
  overflow: hidden;
}
.form-section summary {
  list-style: none;
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.form-section summary::-webkit-details-marker {
  display: none;
}
.form-section summary:after {
  content: "+";
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
}
.form-section[open] summary:after {
  content: "−";
}
.form-content {
  padding: 0 14px 15px;
}
.form-content .field input,
.form-content .field select,
.form-content .field textarea {
  font-size: 12px;
  padding: 8px;
}
.items-editor {
  display: grid;
  gap: 8px;
}
.item-editor {
  background: #21130f;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}
.item-top {
  display: flex;
  gap: 7px;
  align-items: flex-start;
}
.item-top .field:first-child {
  flex: 1;
}
.item-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 7px;
}
.item-delete {
  background: #44221f;
  color: #ef9289;
  border: 0;
  border-radius: 6px;
  padding: 7px;
}
.item-delete svg {
  width: 14px;
}
.item-total {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-top: 5px;
}
.add-row {
  width: 100%;
  margin-top: 9px;
}
.custom-fields {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}
.custom-field {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 7px;
}
.custom-field button {
  background: #44221f;
  color: #ef9289;
  border: 0;
  border-radius: 6px;
  padding: 7px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.template-choice {
  background: #21130f;
  border: 1px solid var(--line-strong);
  padding: 0;
  border-radius: 7px;
  overflow: hidden;
  text-align: left;
}
.template-choice.active {
  border: 2px solid var(--orange);
}
.template-choice:hover {
  border-color: var(--orange);
}
.template-thumb {
  height: 55px;
  display: block;
  position: relative;
}
.template-label {
  display: block;
  padding: 7px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}
.thumb-atelier {
  background: #f7eee8;
}
.thumb-atelier:before {
  content: "";
  position: absolute;
  inset: 11px 9px auto;
  height: 4px;
  background: #a75637;
  box-shadow:
    0 11px 0 #e0c6b8,
    0 22px 0 #e8d5cb;
}
.thumb-midnight {
  background: #1d2631;
}
.thumb-midnight:before {
  content: "";
  position: absolute;
  left: 9px;
  top: 11px;
  width: 39px;
  height: 4px;
  background: #ed8a56;
  box-shadow:
    0 12px 0 #455969,
    0 24px 0 #455969;
}
.thumb-editorial {
  background: #efe2d7;
}
.thumb-editorial:before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 11px;
  height: 3px;
  background: #ad5a3b;
  box-shadow:
    0 13px 0 #d6bcad,
    0 26px 0 #d6bcad;
}
.thumb-mono {
  background: #e8dfd6;
}
.thumb-mono:before {
  content: "";
  position: absolute;
  inset: 10px 9px auto;
  height: 6px;
  background: #70412f;
  box-shadow:
    0 14px 0 #d2b6a6,
    0 28px 0 #d2b6a6;
}
.thumb-bold {
  background: #f0c7ad;
}
.thumb-bold:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  background: #c55a3d;
  box-shadow: 0 33px 0 #f7e9df;
}
.thumb-ledger {
  background: #ead6c6;
}
.thumb-ledger:before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 20px;
  height: 20px;
  background: #b45b3c;
  box-shadow:
    29px 0 0 #ddc4b5,
    58px 0 0 #ddc4b5;
}
.thumb-client {
  background: #f5f5f4;
}
.thumb-client:before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 10px;
  height: 10px;
  background: #22292f;
  box-shadow:
    0 20px 0 #d9dde0,
    0 32px 0 #d9dde0;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.color-row > label {
  margin: 0;
}
.color-row input[type="color"] {
  width: 35px;
  height: 30px;
  padding: 2px;
}
.swatches {
  display: flex;
  gap: 6px;
}
.swatch {
  border: 2px solid #25150f;
  box-shadow: 0 0 0 1px var(--line-strong);
  width: 21px;
  height: 21px;
  border-radius: 50%;
  padding: 0;
}
.advance-note {
  padding: 10px 11px;
  border: 1px solid #79502d;
  background: #3a2618;
  border-radius: 7px;
  color: #f0c8a5;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 11px;
}
.advance-note strong {
  color: #ffd8bc;
}
.payment-summary {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
  font-size: 12px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
}
.summary-row.total {
  font-size: 14px;
  color: var(--orange-2);
  font-weight: 800;
  margin-top: 3px;
}
.preview-area {
  background: #160e0b;
  overflow: auto;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.preview-toolbar {
  width: min(800px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.zoom-controls button {
  background: #271712;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 7px;
}
.zoom-controls svg {
  width: 14px;
}
.invoice-paper {
  width: 794px;
  height: 1123px;
  max-width: none;
  background: #fff;
  color: #2c1a14;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  transform-origin: top center;
  overflow: hidden;
  flex: 0 0 1123px;
}
.invoice-inner {
  width: 794px;
  height: 1123px;
  overflow: hidden;
  padding: 59px 61px 49px;
  display: flex;
  flex-direction: column;
}
.invoice-paper h1,
.invoice-paper h2,
.invoice-paper h3,
.invoice-paper p {
  margin: 0;
}
.doc-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.doc-brand {
  font:
    700 22px "Space Grotesk",
    sans-serif;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.doc-tagline {
  font-size: 10px;
  color: #8d6e60;
  margin-top: 6px;
}
.doc-meta {
  text-align: right;
}
.doc-title {
  font:
    700 39px "Space Grotesk",
    sans-serif;
  letter-spacing: -0.07em;
  line-height: 0.95;
}
.doc-number {
  font-size: 11px;
  font-weight: 800;
  margin-top: 7px;
}
.doc-dates {
  font-size: 10px;
  color: #8d6e60;
  line-height: 1.45;
  margin-top: 4px;
}
.doc-rule {
  height: 2px;
  background: #b75c3d;
  margin: 24px 0 30px;
}
.doc-bill {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-bottom: 33px;
}
.doc-kicker {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9b6a56;
  margin-bottom: 7px;
}
.doc-party {
  font-size: 14px;
  font-weight: 800;
}
.doc-small {
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-line;
  color: #84695d;
  margin-top: 3px;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
}
.doc-table th {
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 7px;
  border-bottom: 1px solid #ddc6b8;
  color: #a07561;
}
.doc-table th:not(:first-child),
.doc-table td:not(:first-child) {
  text-align: right;
}
.doc-table td {
  font-size: 10px;
  padding: 11px 7px;
  border-bottom: 1px solid #eadbd2;
  color: #876c60;
}
.doc-table td:first-child {
  font-weight: 800;
  color: #3a231a;
}
.item-note {
  font-size: 8px;
  font-weight: 400;
  color: #a08070;
  margin-top: 3px;
}
.doc-bottom {
  display: flex;
  justify-content: space-between;
  gap: 35px;
  margin-top: auto;
  padding-top: 30px;
}
.doc-notes {
  max-width: 320px;
}
.doc-notes p {
  font-size: 9px;
  line-height: 1.5;
  color: #876c60;
  white-space: pre-line;
}
.doc-totals {
  width: 230px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 10px;
  color: #876c60;
  padding: 4px 0;
}
.total-row.discount {
  color: #3a8a67;
}
.total-row.total {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  background: #b75c3d;
  border-radius: 5px;
  padding: 11px 12px;
  margin-top: 8px;
}
.doc-footer {
  border-top: 1px solid #e2d3c9;
  margin-top: 32px;
  padding-top: 9px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 8px;
  color: #a18171;
}
.template-midnight {
  background: #202b37;
  color: #f9f0e8;
}
.template-midnight .invoice-inner {
  color: #f9f0e8;
}
.template-midnight .doc-title {
  color: #ed8a56;
}
.template-midnight .doc-rule {
  background: #ed8a56;
}
.template-midnight .doc-kicker {
  color: #df9471;
}
.template-midnight .doc-small,
.template-midnight .doc-dates,
.template-midnight .doc-table td,
.template-midnight .doc-notes p,
.template-midnight .total-row {
  color: #bca69b;
}
.template-midnight .doc-table th {
  border-color: #40505c;
  color: #df9471;
}
.template-midnight .doc-table td {
  border-color: #394852;
}
.template-midnight .doc-table td:first-child {
  color: #f9f0e8;
}
.template-midnight .total-row.total {
  background: #ed8a56;
  color: #23130e;
}
.template-editorial {
  background: #f3e9df;
}
.template-editorial .doc-title {
  font-family: Georgia, serif;
  font-weight: 400;
  color: #a45336;
}
.template-editorial .doc-rule {
  height: 1px;
  background: #a45336;
}
.template-editorial .total-row.total {
  background: #a45336;
}
.template-mono {
  background: #f5eee8;
}
.template-mono .doc-brand,
.template-mono .doc-title {
  font-family: Georgia, serif;
}
.template-mono .doc-rule {
  height: 4px;
  background: #71412f;
}
.template-mono .total-row.total {
  background: #71412f;
}
.template-bold {
  background: #fff;
}
.template-bold .invoice-inner {
  padding: 0;
}
.template-bold .doc-top {
  background: #b95339;
  color: #fff;
  padding: 53px 61px 48px;
}
.template-bold .doc-title {
  color: #fff;
}
.template-bold .doc-rule {
  display: none;
}
.template-bold .doc-bill,
.template-bold .doc-table,
.template-bold .doc-bottom,
.template-bold .doc-footer {
  margin-left: 61px;
  margin-right: 61px;
}
.template-bold .doc-bill {
  margin-top: 35px;
}
.template-bold .total-row.total {
  background: #b95339;
}
.template-ledger {
  background: #fff9f4;
}
.template-ledger .doc-brand:before {
  content: "";
  display: inline-block;
  width: 27px;
  height: 27px;
  background: #b75c3d;
  border-radius: 5px;
  vertical-align: middle;
  margin-right: 8px;
}
.template-ledger .doc-title {
  color: #b75c3d;
  font-size: 34px;
}
.template-ledger .doc-rule {
  height: 1px;
  background: #b75c3d;
}
.template-ledger .total-row.total {
  color: #b75c3d;
  background: transparent;
  border: 1px solid #b75c3d;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  transform: translateY(15px);
  opacity: 0;
  pointer-events: none;
  background: #3a2018;
  color: #fff0e7;
  border: 1px solid #75412c;
  padding: 11px 14px;
  border-radius: 7px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 4, 3, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  width: min(520px, 100%);
  background: #281813;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h2 {
  font:
    600 17px "Space Grotesk",
    sans-serif;
  margin: 0;
}
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.inline-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-status select {
  width: auto;
  padding: 5px 8px;
  font-size: 11px;
}
.catalog-edit {
  color: var(--orange-2) !important;
}
.user-pill {
  font-size: 11px;
  color: var(--muted);
  padding: 5px 0;
}
@media (max-width: 1120px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .client-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 820px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-art {
    min-height: 250px;
    padding: 35px 28px;
  }
  .auth-copy p {
    font-size: 20px;
  }
  .auth-copy small {
    font-size: 12px;
  }
  .auth-panel {
    border-left: 0;
    padding: 34px 25px;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    min-height: 0;
    position: static;
    padding: 12px;
  }
  .sidebar-top {
    padding: 0 5px 12px;
  }
  .sidebar-collapse,
  .side-caption,
  .sidebar-spacer,
  .sidebar-account {
    display: none;
  }
  .main-nav {
    display: flex;
    overflow: auto;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    padding: 9px 11px;
  }
  .nav-item span {
    display: none;
  }
  .settings-caption {
    display: none;
  }
  .topbar {
    height: 62px;
    padding: 0 15px;
  }
  .topbar-actions .icon-button {
    display: none;
  }
  .view {
    padding: 23px 15px 35px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .editor-view {
    height: auto;
    overflow: visible;
  }
  .editor-shell {
    display: block;
    height: auto;
  }
  .inspector {
    height: auto;
    overflow: visible;
    border-right: 0;
  }
  .preview-area {
    min-height: 790px;
    padding: 18px 8px;
    display: block;
  }
  .preview-toolbar {
    margin: 0 auto 10px;
    width: calc(100% - 10px);
  }
  .invoice-paper {
    transform: scale(0.45);
    transform-origin: top left;
    margin-left: calc((100% - 358px) / 2);
    margin-bottom: -620px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .template-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.item-duplicate,
.item-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.item-duplicate {
  background: #f0e7ff;
  color: #7051a0;
}

.item-duplicate svg,
.item-delete svg {
  width: 14px;
  height: 14px;
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-shell {
  min-height: 100vh;
  background: #eeeae4;
  color: #2b241f;
  padding: 28px 18px 44px;
}

.public-wrap {
  width: min(100%, 1040px);
  margin: 0 auto;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 54px;
}

.public-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 11px;
}

.public-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #c85d32;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.public-header strong,
.public-header span {
  display: block;
}

.public-header strong {
  font-size: 15px;
}

.public-header span {
  margin-top: 3px;
  color: #8b7e74;
  font-size: 11px;
}

.public-live {
  padding: 7px 10px;
  border: 1px solid #dfd2c7;
  border-radius: 999px;
  color: #89786d !important;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-heading {
  margin-bottom: 24px;
}

.public-eyebrow {
  color: #b35632;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.public-heading h1 {
  max-width: 720px;
  margin: 8px 0 7px;
  color: #241c18;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
}

.public-heading p {
  margin: 0;
  color: #7e7065;
  font-size: 15px;
}

.public-invoice-card,
.public-list {
  overflow: hidden;
  border: 1px solid #e0d6cc;
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(66, 43, 29, 0.08);
}

.public-invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 32px;
  border-bottom: 1px solid #eadfd6;
}

.public-invoice-head h1 {
  margin: 7px 0 4px;
  font-size: 30px;
}

.public-invoice-head p {
  margin: 0;
  color: #827268;
}

.public-total {
  min-width: 180px;
  text-align: right;
}

.public-total span,
.public-meta span,
.public-totals span,
.public-list-card span {
  display: block;
  color: #99897e;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-total strong {
  display: block;
  margin: 6px 0 9px;
  color: #a84f2d;
  font-size: 26px;
}

.public-status {
  display: inline-flex !important;
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0 !important;
  text-transform: capitalize !important;
}

.public-status-paid {
  background: #e1f3e9;
  color: #277c55 !important;
}

.public-status-sent {
  background: #e2f0f7;
  color: #346e8e !important;
}

.public-status-draft {
  background: #eee9e4;
  color: #786d64 !important;
}

.public-status-overdue {
  background: #fae3e1;
  color: #b0443f !important;
}

.public-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 32px;
  background: #faf5ef;
}

.public-meta strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.public-table-wrap {
  overflow-x: auto;
  padding: 0 32px;
}

.public-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.public-table th {
  padding: 17px 9px 11px;
  border-bottom: 1px solid #e5d9cf;
  color: #a28676;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.public-table th:not(:first-child),
.public-table td:not(:first-child) {
  text-align: right;
}

.public-table td {
  padding: 17px 9px;
  border-bottom: 1px solid #efe7df;
  color: #6f6259;
  font-size: 13px;
}

.public-table td:first-child {
  color: #34261f;
  text-align: left !important;
}

.public-table td strong,
.public-table td small,
.public-table td em {
  display: block;
}

.public-table td small {
  margin-top: 4px;
  color: #9a897c;
  font-size: 11px;
  font-weight: 400;
}

.public-table td em {
  margin-top: 5px;
  color: #b35632;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.public-invoice-foot {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 32px 32px;
}

.public-invoice-foot h3 {
  margin: 0 0 5px;
  color: #9b6a56;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.public-invoice-foot p {
  max-width: 380px;
  margin: 0 0 16px;
  color: #786b61;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.public-totals {
  width: min(100%, 250px);
}

.public-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
}

.public-totals strong {
  font-size: 13px;
}

.public-totals .public-credit strong {
  color: #2b815c;
}

.public-totals .grand {
  margin-top: 7px;
  padding: 12px;
  border-radius: 7px;
  background: #c85d32;
  color: #fff;
}

.public-totals .grand span,
.public-totals .grand strong {
  color: #fff;
}

.public-secondary-button,
.public-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  padding: 10px 14px;
  border: 1px solid #e0b39e;
  border-radius: 7px;
  background: #fff5ee;
  color: #a84f2d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.public-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 13px;
}

.public-list-head {
  padding: 24px 28px;
  border-bottom: 1px solid #eadfd6;
}

.public-list-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.public-list-head p {
  margin: 0;
  color: #887a70;
  font-size: 13px;
}

.public-list-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  align-items: center;
  gap: 15px;
  padding: 21px 28px;
  border-bottom: 1px solid #eee6df;
}

.public-list-card:last-child {
  border-bottom: 0;
}

.public-list-card strong {
  display: block;
  margin-top: 5px;
  color: #30251f;
  font-size: 13px;
}

.public-list-card > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.public-empty,
.public-error,
.public-loading {
  padding: 56px 28px;
  color: #85766c;
  text-align: center;
}

.public-footer {
  padding: 24px 0 0;
  color: #9a8b80;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 700px) {
  .public-shell {
    padding: 18px 12px 30px;
  }

  .public-header {
    margin-bottom: 38px;
  }

  .public-live {
    display: none !important;
  }

  .public-invoice-head,
  .public-invoice-foot {
    flex-direction: column;
    padding: 23px 19px;
  }

  .public-total {
    text-align: left;
  }

  .public-meta {
    grid-template-columns: 1fr;
    padding: 18px 19px;
  }

  .public-table-wrap {
    padding: 0 10px;
  }

  .public-list-card {
    grid-template-columns: 1fr 1fr;
    padding: 19px;
  }

  .public-list-card > div:last-child {
    justify-content: flex-start;
  }
}

@media print {
  .public-shell {
    padding: 0;
    background: #fff;
  }

  .public-header,
  .public-heading,
  .public-actions,
  .public-footer {
    display: none;
  }

  .public-invoice-card {
    border: 0;
    box-shadow: none;
  }
}

@media print {
  body,
  .main,
  .preview-area {
    background: #fff !important;
  }

  .invoice-paper {
    transform: none !important;
  }
}

.invoice-paper {
  --invoice-accent: #b75c3d;
  --invoice-font: "DM Sans";
}

.invoice-paper,
.invoice-paper .doc-brand,
.invoice-paper .doc-title,
.invoice-paper .doc-table,
.invoice-paper .doc-table td,
.invoice-paper .doc-table th,
.invoice-paper .doc-small,
.invoice-paper .doc-notes,
.invoice-paper .doc-footer,
.invoice-paper .total-row {
  font-family: var(--invoice-font), system-ui, sans-serif;
}

.invoice-paper .doc-rule,
.invoice-paper .total-row.total {
  background: var(--invoice-accent) !important;
}

.invoice-paper .template-ledger .total-row.total,
.invoice-paper.template-ledger .total-row.total {
  color: var(--invoice-accent);
  border-color: var(--invoice-accent);
  background: transparent !important;
}

.invoice-paper.template-midnight .doc-title,
.invoice-paper.template-editorial .doc-title,
.invoice-paper.template-ledger .doc-title {
  color: var(--invoice-accent) !important;
}

.invoice-paper.template-bold .doc-top {
  background: var(--invoice-accent) !important;
}

.invoice-paper.template-ledger .doc-brand::before {
  background: var(--invoice-accent) !important;
}

.invoice-paper.template-ledger .total-row.total {
  color: var(--invoice-accent) !important;
  border-color: var(--invoice-accent) !important;
  background: transparent !important;
}

.invoice-sparse .doc-brand {
  font-size: 27px;
}

.invoice-sparse .doc-title {
  font-size: 44px;
}

.invoice-sparse .doc-number,
.invoice-sparse .doc-dates,
.invoice-sparse .doc-small {
  font-size: 11px;
}

.invoice-sparse .doc-party {
  font-size: 16px;
}

.invoice-sparse .doc-table th {
  font-size: 9px;
}

.invoice-sparse .doc-table td {
  font-size: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.invoice-sparse .item-note,
.invoice-sparse .item-delivery {
  font-size: 9px;
}

.invoice-sparse .doc-notes p {
  font-size: 10px;
}

.invoice-sparse .total-row {
  font-size: 11px;
}

.invoice-sparse .total-row.total {
  font-size: 16px;
}

.item-delivery {
  color: #a35438;
  font-size: 8px;
  font-weight: 700;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.doc-delivery-summary {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 180px;
  margin-bottom: 13px;
  padding: 8px 10px;
  border-left: 3px solid var(--invoice-accent);
  background: #fff6ef;
  color: #8a6a5b;
  font-size: 9px;
}

.doc-delivery-summary strong {
  color: #4a2e23;
  font-size: 11px;
}

.delivery-controls {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 7px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.delivery-controls .field input,
.delivery-controls .field select {
  font-size: 11px;
}

.delivery-cell {
  white-space: nowrap;
}

.delivery-chip {
  display: inline-flex;
  align-items: center;
  min-width: 34px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: #fff0e7;
  color: #a65332;
  font-size: 11px;
  font-weight: 800;
}

.delivery-caption {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.email-preview {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f0eb;
  padding: 12px;
}

.email-html {
  min-height: 130px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .client-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .topbar .breadcrumb span,
  .topbar .breadcrumb svg {
    display: none;
  }
  .topbar-actions {
    margin-left: auto;
  }
  .searchbox {
    min-width: 100%;
    width: 100%;
  }
}
@media print {
  body {
    background: #fff;
  }
  .app-shell,
  .auth-screen,
  .toast,
  .modal-backdrop {
    display: none !important;
  }
  .invoice-paper {
    display: block !important;
    transform: none !important;
    box-shadow: none;
    width: 794px;
    height: 1123px;
  }
  .preview-area {
    padding: 0;
    background: #fff;
    display: block;
  }
  .editor-view {
    display: block !important;
    height: auto;
  }
  .inspector,
  .preview-toolbar {
    display: none !important;
  }
}

/* Product shell refresh: compact charcoal navigation with a warm, high-contrast workspace. */
:root {
  --bg: #151311;
  --bg-2: #1d1916;
  --panel: #fffdf9;
  --panel-2: #f7f3ed;
  --paper: #ffffff;
  --line: #e3ddd4;
  --line-strong: #cfc6bb;
  --text: #27231f;
  --muted: #80766c;
  --muted-2: #a49a90;
  --orange: #c85d32;
  --orange-2: #e97943;
  --orange-soft: #f8e7de;
  --green: #2c8e63;
  --red: #c9534d;
  --blue: #3c7fa5;
  --shadow: 0 16px 45px rgba(38, 27, 19, 0.12);
  --radius: 12px;
}

html,
body {
  background: #eeeae4;
  color: var(--text);
}

body {
  min-width: 320px;
}

button,
input,
select,
textarea {
  color: var(--text);
}

input,
select,
textarea {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  border-radius: 8px;
}

input::placeholder,
textarea::placeholder {
  color: #aaa198;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(200, 93, 50, 0.12);
}

.auth-screen {
  background: #eeeae4;
}

.auth-art {
  background: #181613;
}

.auth-grid {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(233, 121, 67, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 121, 67, 0.35) 1px, transparent 1px);
}

.auth-copy p {
  color: #f39a6b;
}

.auth-panel {
  background: #fffdf9;
  border-left-color: var(--line);
}

.auth-brand,
.logo-word,
.page-heading h1,
.stat-value,
.panel-head h2,
.client-card h3,
.catalog-card h3,
.settings-card h2,
.modal-head h2,
.doc-brand,
.doc-title {
  font-family: "DM Sans", system-ui, sans-serif;
  letter-spacing: -0.035em;
}

.auth-tabs {
  border-bottom-color: var(--line);
}

.auth-tab {
  color: var(--muted);
}

.auth-tab.active {
  color: var(--text);
  border-color: var(--orange);
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
  background: #eeeae4;
}

.sidebar {
  background: #191715;
  border-right-color: #302b27;
  padding: 18px 12px;
}

.brand strong {
  color: #fffaf5;
}

.brand small,
.side-caption,
.account-copy small,
.sidebar-collapse,
.sidebar-account button {
  color: #958b82;
}

.nav-item {
  color: #aaa199;
  border-radius: 8px;
  padding: 10px 11px;
}

.nav-item:hover {
  color: #fffaf5;
  background: #28221e;
}

.nav-item.active {
  color: #ffd3bb;
  background: #4b281b;
  border-color: #70402d;
  box-shadow: inset 3px 0 0 var(--orange-2);
}

.sidebar-account {
  border-top-color: #302b27;
}

.account-copy strong {
  color: #fffaf5;
}

.main {
  background: #eeeae4;
}

.topbar {
  height: 68px;
  padding: 0 30px;
  background: rgba(255, 253, 249, 0.94);
  border-bottom-color: var(--line);
}

.breadcrumb {
  color: var(--muted);
}

.breadcrumb strong {
  color: var(--text);
  font-size: 16px;
}

.sync-badge {
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.button,
.icon-button {
  border-radius: 8px;
}

.button {
  background: #f3eee8;
  border-color: var(--line);
  color: var(--text);
}

.button:hover {
  background: #ebe3da;
}

.button.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 4px 10px rgba(200, 93, 50, 0.2);
}

.button.primary:hover {
  background: var(--orange-2);
  border-color: var(--orange-2);
}

.button.ghost,
.icon-button {
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.button.ghost:hover,
.icon-button:hover {
  background: var(--orange-soft);
  border-color: #e0a88e;
  color: var(--orange);
}

.view {
  padding: 30px 32px 48px;
  max-width: 1500px;
}

.page-heading {
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--orange);
}

.page-heading h1 {
  font-size: 29px;
  color: #221d19;
}

.page-heading p,
.panel-head p,
.section-copy {
  color: var(--muted);
}

.stats-grid {
  gap: 12px;
}

.stat-card,
.panel,
.client-card,
.catalog-card,
.settings-card {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 4px 15px rgba(58, 43, 32, 0.05);
}

.stat-card {
  min-height: 124px;
  padding: 16px 17px;
}

.stat-card:after {
  background: rgba(200, 93, 50, 0.07);
}

.stat-icon {
  background: var(--orange-soft);
  color: var(--orange);
}

.stat-value {
  color: #231e1a;
}

.stat-label,
.muted {
  color: var(--muted);
}

.stat-delta {
  color: var(--green);
}

.dashboard-grid {
  gap: 13px;
}

.panel-head {
  padding: 16px 18px 13px;
  border-bottom-color: var(--line);
}

.panel-head h2 {
  color: #2b241f;
}

.panel-body {
  padding: 18px;
}

.bar-chart {
  height: 165px;
}

.bar {
  background: #ded5cb;
}

.bar.received {
  background: var(--orange);
}

.dot {
  background: #c4b8ac;
}

.aging-track {
  background: #eee8e1;
}

.aging-fill,
.aging-row:nth-child(2) .aging-fill,
.aging-row:nth-child(3) .aging-fill,
.aging-row:nth-child(4) .aging-fill {
  background: var(--orange);
}

.data-table {
  min-width: 720px;
}

.data-table th {
  border-bottom-color: var(--line);
  color: #a59b91;
}

.data-table td {
  border-bottom-color: #eee8e1;
  color: #3b332c;
}

.data-table tr:hover td {
  background: #fff8f2;
}

.invoice-id {
  color: #29231e;
}

.client-avatar {
  background: #f0e6ff;
  color: #7256a5;
}

.client-avatar.orange {
  background: #fbe3d8;
  color: #aa4b29;
}

.client-avatar.green {
  background: #dff2e8;
  color: #2b815c;
}

.status-pill {
  padding: 5px 8px;
}

.status-paid {
  color: #277c55;
  background: #e1f3e9;
}

.status-sent {
  color: #346e8e;
  background: #e2f0f7;
}

.status-draft {
  color: #786d64;
  background: #eee9e4;
}

.status-overdue {
  color: #b0443f;
  background: #fae3e1;
}

.inline-status select,
.row-actions select,
.select-compact {
  background: #fff;
  border-color: var(--line);
}

.client-card,
.catalog-card {
  padding: 16px;
}

.client-card h3,
.catalog-card h3 {
  color: #2b241f;
}

.client-card p,
.catalog-card p {
  color: var(--muted);
}

.client-card-footer {
  border-top-color: var(--line);
}

.link-btn {
  color: var(--orange);
}

.settings-card {
  padding: 20px;
}

.settings-card h2 {
  color: #2b241f;
}

.integration-box,
.notice {
  background: #fcf7f2;
  border-color: #e5c2ae;
  color: #786b61;
}

.notice {
  color: #8e4d34;
}

.editor-view {
  background: #eae5df;
}

.editor-shell {
  grid-template-columns: minmax(350px, 405px) minmax(0, 1fr);
}

.inspector {
  background: #f5f1ec;
  border-right-color: var(--line);
}

.editor-toolbar {
  background: #fffdf9;
  border-bottom-color: var(--line);
}

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

.save-state {
  color: var(--green);
}

.form-section {
  background: #fffdf9;
  border-color: var(--line);
  border-radius: 10px;
}

.form-section summary {
  color: #302822;
}

.form-content .field input,
.form-content .field select,
.form-content .field textarea {
  background: #fff;
}

.item-editor {
  background: #faf7f3;
  border-color: var(--line);
}

.item-delete,
.custom-field button {
  background: #fbe7df;
  color: #b55431;
}

.template-choice {
  background: #fff;
  border-color: var(--line);
}

.template-choice.active {
  border-color: var(--orange);
}

.advance-note {
  background: #fff3e9;
  border-color: #edb99d;
  color: #91573c;
}

.payment-summary {
  border-top-color: var(--line);
}

.preview-area {
  background: #eae5df;
}

.preview-toolbar {
  color: #887c72;
}

.zoom-controls button {
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.toast {
  background: #2b211b;
  border-color: #6e3b28;
}

.modal-backdrop {
  background: rgba(21, 18, 15, 0.58);
}

.modal {
  background: #fffdf9;
  border-color: var(--line);
}

.modal-head h2 {
  color: #2b241f;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    background: #191715;
  }

  .topbar {
    padding: 0 15px;
  }

  .view {
    padding: 23px 15px 35px;
  }

  .editor-shell {
    grid-template-columns: 1fr;
  }
}

/* Layout hardening: keep actions, icons, and the A4 preview stable at every size. */
svg {
  display: block;
  flex: 0 0 auto;
}

button {
  min-width: 0;
  max-width: 100%;
}

.button,
.icon-button {
  min-height: 36px;
  line-height: 1;
}

.button svg,
.icon-button svg,
.link-btn svg,
.back-button svg,
.sidebar-collapse svg,
.sidebar-account button svg,
.modal-close svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.icon-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  overflow: hidden;
}

.button.small {
  min-height: 32px;
  padding: 7px 10px;
}

.sidebar-collapse,
.sidebar-account button,
.modal-close {
  display: inline-grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  place-items: center;
}

.nav-item,
.sidebar-top,
.topbar,
.page-heading,
.panel-head,
.toolbar-line,
.client-card-head,
.client-card-footer,
.modal-head,
.modal-actions {
  min-width: 0;
}

.nav-item svg {
  width: 17px;
  height: 17px;
}

.breadcrumb {
  min-width: 0;
}

.breadcrumb strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
}

.page-heading h1,
.logo-word,
.brand strong,
.stat-value,
.doc-brand,
.doc-title {
  letter-spacing: 0;
}

.row-actions {
  min-width: max-content;
}

.row-actions button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  place-items: center;
}

.row-actions svg {
  width: 15px;
  height: 15px;
}

.editor-shell {
  min-width: 0;
}

.inspector {
  min-width: 0;
}

.editor-toolbar {
  height: auto;
  min-height: 96px;
  padding: 11px 14px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 9px;
  overflow: hidden;
}

.editor-toolbar-left {
  width: 100%;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
}

.back-button {
  min-height: 28px;
  padding: 4px 2px;
  flex: 0 0 auto;
}

.save-state {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-toolbar-actions {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.editor-toolbar-actions .icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.editor-toolbar-actions .button {
  flex: 0 0 auto;
}

.automatic-badge {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  vertical-align: 1px;
}

.automatic-input,
.automatic-input:focus {
  background: #f3eee8;
  border-color: var(--line);
  box-shadow: none;
  color: #5e554d;
  cursor: default;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.item-actions {
  flex: 0 0 auto;
}

.item-duplicate,
.item-delete,
.custom-field button,
.zoom-controls button {
  flex: 0 0 auto;
}

.preview-area {
  min-width: 0;
}

.preview-toolbar > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.preview-toolbar > span svg {
  width: 16px;
  height: 16px;
}

.zoom-controls button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  place-items: center;
}

.zoom-controls svg {
  width: 14px;
  height: 14px;
}

.invoice-stage {
  position: relative;
  flex: 0 0 auto;
  margin: 0 auto;
}

.invoice-stage .invoice-paper {
  position: absolute;
  inset: 0 auto auto 0;
  margin: 0 !important;
  transform-origin: top left;
}

.modal-actions,
.email-actions {
  flex-wrap: wrap;
}

.app-shell:has(.sidebar.collapsed) {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar.collapsed {
  padding-inline: 11px;
}

.sidebar.collapsed .brand,
.sidebar.collapsed .side-caption,
.sidebar.collapsed .account-copy {
  display: none;
}

.sidebar.collapsed .sidebar-top,
.sidebar.collapsed .nav-item,
.sidebar.collapsed .sidebar-account {
  justify-content: center;
}

.sidebar.collapsed .nav-item {
  padding-inline: 0;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .account-avatar {
  display: none;
}

@media (max-width: 1100px) and (min-width: 821px) {
  .editor-view {
    height: calc(100vh - 68px);
  }

  .editor-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 48%) minmax(0, 1fr);
  }

  .inspector {
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-area {
    min-height: 0;
    padding: 18px;
  }
}

@media (max-width: 820px) {
  .app-shell:has(.sidebar.collapsed) {
    grid-template-columns: 1fr;
  }

  .sidebar.collapsed .brand {
    display: flex;
  }

  .editor-toolbar {
    position: sticky;
    top: 0;
  }

  .editor-toolbar-actions {
    justify-content: flex-start;
  }

  .preview-area {
    padding: 16px 10px 24px;
  }

  .invoice-paper {
    margin: 0 !important;
  }

  .panel-head,
  .client-card-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 9px;
  }

  .sync-badge {
    display: none;
  }

  .page-heading > .button,
  .page-heading > button {
    width: 100%;
  }

  .toolbar-line > div {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .editor-toolbar-actions {
    gap: 5px;
  }

  .editor-toolbar-actions .icon-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .editor-toolbar-actions .button.small {
    padding-inline: 8px;
  }

  .custom-field {
    grid-template-columns: 1fr auto;
  }

  .custom-field input:nth-child(2) {
    grid-column: 1;
  }

  .custom-field button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .modal {
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 16px;
  }

  .modal-actions .button,
  .email-actions .button {
    flex: 1 1 auto;
  }

  #restore-data {
    margin-top: 7px;
    margin-left: 0 !important;
  }
}

/* Client-provided invoice layout. Kept separate from the existing templates so its hierarchy stays faithful to the reference. */
.template-client {
  background: #ffffff;
  color: #22292f;
}

.client-invoice-inner {
  width: 794px;
  height: 1123px;
  padding: 55px 58px 44px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

.client-doc-title {
  color: #22292f;
  font-size: 35px;
  font-weight: 800;
  line-height: 1;
}

.client-doc-business {
  margin-top: 11px;
  color: #555555;
  font-size: 15px;
}

.client-doc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  margin-top: 36px;
  color: #33383d;
  font-size: 12px;
  line-height: 1.55;
}

.client-doc-label {
  margin-bottom: 6px;
  color: #888888;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.client-doc-parties > div > div:not(.client-doc-label):first-of-type {
  color: #22292f;
  font-weight: 700;
}

.client-doc-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 33px;
  padding: 14px 0;
  border-top: 1px solid #e1e3e5;
  border-bottom: 1px solid #e1e3e5;
}

.client-doc-meta strong {
  display: block;
  color: #33383d;
  font-size: 12px;
  font-weight: 700;
}

.client-doc-table {
  width: 100%;
  margin-top: 28px;
  border-collapse: collapse;
  table-layout: fixed;
}

.client-doc-table th {
  padding: 10px 9px;
  background: #22292f;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.client-doc-table th:nth-child(1) {
  width: 52%;
}

.client-doc-table th:nth-child(2) {
  width: 13%;
  text-align: center;
}

.client-doc-table th:nth-child(3),
.client-doc-table th:nth-child(4) {
  width: 17.5%;
  text-align: right;
}

.client-doc-table td {
  padding: 13px 9px;
  border-bottom: 1px solid #e5e7e9;
  color: #555d63;
  font-size: 12px;
  vertical-align: top;
}

.client-doc-table td:first-child {
  color: #22292f;
  font-weight: 600;
}

.client-doc-table td:not(:first-child) {
  text-align: right;
}

.client-doc-table td:nth-child(2) {
  text-align: center;
}

.client-doc-table td small,
.client-doc-table td em {
  display: block;
  margin-top: 4px;
  color: #858d93;
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
}

.client-doc-table td em {
  color: #b35c3b;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-doc-table tfoot th,
.client-doc-table tfoot td {
  padding: 10px 9px 0;
  border-bottom: 0;
  background: transparent;
  color: #555d63;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.client-doc-table tfoot td {
  color: #22292f;
  text-align: right;
}

.client-doc-table .client-doc-total th,
.client-doc-table .client-doc-total td {
  padding-top: 13px;
  color: #22292f;
  font-size: 15px;
  font-weight: 800;
}

.client-doc-payment {
  margin-top: auto;
  padding-top: 25px;
  color: #555d63;
  font-size: 11px;
  line-height: 1.55;
}

.client-doc-payment > div:not(.client-doc-label) {
  display: grid;
  gap: 3px;
}

.client-doc-payment strong {
  color: #22292f;
  font-size: 10px;
  text-transform: none;
}

.client-doc-payment span {
  white-space: pre-line;
}

.client-doc-custom {
  display: grid;
  gap: 4px;
  margin-top: 15px;
  color: #555d63;
  font-size: 10px;
}

.client-doc-note {
  display: flex;
  gap: 6px;
}

.client-doc-note strong {
  color: #22292f;
}

.client-doc-thanks {
  margin-top: 23px;
  color: #22292f;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .client-invoice-inner {
    padding: 42px 46px 35px;
  }

  .client-doc-parties {
    gap: 26px;
  }
}
