:root {
  --ink: #2d3132;
  --muted: #667071;
  --line: #d9e2e2;
  --paper: #f8fbfa;
  --panel: #ffffff;
  --field: #f1f7f6;
  --brand: #08b3ac;
  --brand-dark: #07847f;
  --accent: #ff5b52;
  --lime: #43d61f;
  --sky: #10bce8;
  --ok: #218c50;
  --wait: #8a5b13;
  --danger: #9f2f28;
  --shadow: 0 18px 42px rgba(3, 67, 69, 0.16);
}

.checkbook-wrap {
  display: grid;
  gap: 18px;
}

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

.inset-panel {
  box-shadow: none;
  border: 1px solid var(--line);
}

.notice.warning {
  padding: 14px 16px;
  border: 1px solid #d9a441;
  border-radius: 12px;
  background: #fff8e6;
  color: #684b12;
}

.muted-row {
  opacity: .66;
  text-decoration: line-through;
}

.muted-row button,
.muted-row small {
  text-decoration: none;
}

.check-register td small {
  display: block;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .checkbook-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: #273032;
  color: #f7faf6;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand > div {
  min-width: 0;
  margin-right: auto;
}

.mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  object-fit: cover;
  flex: 0 0 auto;
}

.sidebar .mark {
  width: 48px;
  height: 48px;
}

.mobile-settings-button {
  display: none;
}

.mobile-menu-button {
  display: none;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand span,
.user-panel span,
.small {
  color: #c9d4ce;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button {
  padding: 0 12px;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-panel {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.main {
  min-width: 0;
  padding: 24px;
}

.flash-message {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(8, 179, 172, 0.35);
  border-radius: 8px;
  color: var(--brand-dark);
  background: #e9fbfa;
  box-shadow: 0 12px 28px rgba(3, 67, 69, 0.16);
  font-weight: 800;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2,
.auth h1,
.section-title h3 {
  margin: 0;
}

.topbar h2 {
  font-size: 25px;
}

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

.business-logo-editor {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}

.business-logo-preview {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.business-logo-controls input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.business-logo-controls input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: #e5f5f3;
  font-weight: 700;
  cursor: pointer;
}

.business-logo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .business-logo-editor {
    grid-template-columns: 1fr;
  }

  .business-logo-preview {
    width: 84px;
    height: 84px;
  }

  .business-logo-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.document-notice {
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(8, 179, 172, 0.35);
  border-radius: 8px;
  color: var(--brand-dark);
  background: #e9fbfa;
  font-weight: 800;
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(8, 179, 172, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
}

.language-toggle button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.language-toggle button.active {
  color: #fff;
  background: var(--brand);
}

.sidebar .language-toggle {
  width: fit-content;
  color: #f7faf6;
  border-color: rgba(255, 255, 255, 0.18);
}

.primary,
.secondary,
.danger {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 2px 0 rgba(7, 132, 127, 0.24);
}

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

.secondary {
  color: var(--ink);
  background: #e5f5f3;
}

#newDocument,
#newClient,
#newVendor {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 3px 0 rgba(159, 47, 40, 0.24);
  font-weight: 900;
}

#newDocument:hover,
#newClient:hover,
#newVendor:hover {
  background: #e4473f;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.store-order-colors { display:flex; gap:6px; margin-top:7px; }
.store-order-colors i { width:22px; height:22px; border:2px solid #fff; border-radius:50%; box-shadow:0 0 0 1px #bcc9c7; }

.icon-only {
  width: 34px;
  padding: 0;
  font-size: 15px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.customer-editor-stack,
.vendor-editor-stack,
.customer-related-list {
  display: grid;
  gap: 18px;
}

.vendor-payment-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.vendor-payment-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.customer-related-list {
  gap: 8px;
  margin-top: 12px;
}

.customer-related-item {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--field);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.customer-related-item:hover {
  border-color: rgba(8, 179, 172, 0.55);
  background: #e9fbfa;
}

.customer-related-item > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-document-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  display: grid;
  gap: 10px;
}

.customer-document-heading,
.customer-payment-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-document-heading > strong {
  margin-left: auto;
}

.customer-payment-links {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .customer-related-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .vendor-payment-actions {
    width: 100%;
    justify-content: space-between;
  }

  .customer-document-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-document-heading > strong {
    margin-left: 0;
  }

  .customer-payment-links {
    align-items: stretch;
    flex-direction: column;
  }
}

.project-page {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  align-items: start;
}

.project-workspace {
  display: grid;
  gap: 18px;
}

.document-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.document-list {
  display: grid;
  gap: 6px;
}

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

.document-lines {
  display: grid;
  gap: 10px;
}

.document-line {
  display: grid;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.document-line .field,
.document-editor .field {
  min-width: 0;
}

.invoice-document .document-line {
  grid-template-columns: 76px 150px minmax(190px, 1fr) 100px 120px 120px 42px;
}

.quote-document .document-line {
  grid-template-columns: 76px minmax(190px, 1fr) 100px 120px 120px 42px;
}

.quote-document .invoice-project-field {
  display: none;
}

.document-line .compact {
  min-width: 34px;
  padding: 0;
}

.document-totals {
  width: min(340px, 100%);
  margin-left: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.document-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.document-totals div:last-child {
  color: var(--brand-dark);
  font-size: 18px;
}

.month-picker {
  width: min(220px, 100%);
}

.financial-summary h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.dashboard-profit.profit h2 {
  color: var(--ok);
}

.dashboard-profit.loss h2 {
  color: var(--danger);
}

.financial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.category-totals {
  display: grid;
  gap: 8px;
}

.financial-entry-panel {
  display: grid;
  gap: 16px;
}

.financial-entry-picker {
  width: min(420px, 100%);
}

.financial-entry-form {
  max-width: 860px;
}

.financial-form {
  padding-top: 4px;
}

.category-total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.financial-table-title {
  padding: 18px 18px 0;
}

.invoice-ledger {
  display: grid;
  gap: 8px;
}

.invoice-ledger-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(4, auto);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.invoice-ledger-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.project-detail {
  min-width: 0;
}

.project-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.project-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.file-loader {
  display: grid;
  gap: 10px;
}

.file-tools {
  display: flex;
  justify-content: flex-end;
}

.panel,
.auth,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(31, 39, 38, 0.04);
}

.panel {
  padding: 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

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

.recent-activity-panel {
  display: grid;
  gap: 12px;
}

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

.activity-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 74px minmax(150px, 0.7fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfdfc;
  text-align: left;
}

.activity-item.new {
  border-color: rgba(255, 91, 82, 0.45);
  background: #fff4f2;
}

.activity-item.read {
  opacity: 0.74;
}

.activity-item:hover {
  border-color: var(--brand);
}

.activity-status {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-item.read .activity-status {
  color: var(--muted);
  background: #e5f5f3;
}

.activity-item strong,
.activity-item small,
.activity-item em {
  display: block;
}

.activity-item small,
.activity-item em {
  color: var(--muted);
  font-size: 12px;
}

.activity-item em {
  font-style: normal;
  white-space: nowrap;
}

.activity-text {
  overflow-wrap: anywhere;
}

.dashboard-table-panel {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.dashboard-table {
  min-width: 920px;
}

.dashboard-table th,
.dashboard-table td {
  vertical-align: middle;
  font-size: 12px;
  padding: 10px 8px;
}

.dashboard-table .pill {
  font-size: 12px;
}

.link-button {
  min-height: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}

.link-button:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.table-date {
  min-width: 118px;
  min-height: 34px;
  font-size: 12px;
}

.date-display {
  min-width: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.date-display .icon-button {
  width: 28px;
  min-height: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  background: #fff;
  font-weight: 900;
}

.date-display .icon-button:hover {
  border-color: var(--brand);
  background: #e9fbfa;
}

.customer-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.customer-list-item {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.customer-list-item:hover,
.customer-list-item.active {
  border-color: rgba(8, 179, 172, 0.36);
  background: #e9fbfa;
}

.search-field {
  margin-bottom: 4px;
}

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

.activity-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e9fbfa;
  color: var(--ink);
}

.activity-line strong {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

.activity-line span {
  overflow-wrap: anywhere;
}

.activity-line em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.card {
  padding: 15px;
  display: grid;
  gap: 9px;
}

.card h3,
.card p {
  margin: 0;
}

.card h3 {
  font-size: 17px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--field);
}

.field textarea {
  min-height: 94px;
  resize: vertical;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pill {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.approved {
  color: #12592f;
  background: #dbf7d4;
}

.pending {
  color: #704711;
  background: #f6e8c7;
}

.admin {
  color: #77351f;
  background: #f3d8ce;
}

.status-initial-customer-request {
  color: #6c4b0f;
  background: #fff0c7;
}

.status-development {
  color: #075d5b;
  background: #d8fbf7;
}

.status-development-completed {
  color: #176016;
  background: #dcf8d6;
}

.status-delivered-pending-payment {
  color: #793a23;
  background: #ffe0d9;
}

.status-delivered-completed {
  color: #324044;
  background: #e4e9ea;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 47% 28%, rgba(255, 255, 255, 0.24), transparent 20rem),
    linear-gradient(135deg, #05aaa5, #09b7b2 54%, #078d89);
}

.auth {
  width: min(960px, 100%);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow);
}

.auth-copy {
  padding: 34px;
  color: #fff;
  background: rgba(45, 49, 50, 0.88);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.auth-copy h1 {
  font-size: 36px;
  line-height: 1.02;
}

.auth-copy p {
  color: #d9e2dd;
  line-height: 1.5;
}

.auth-form {
  padding: 30px;
  display: grid;
  gap: 14px;
}

.divider {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.google-button {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.notice {
  padding: 12px;
  border-radius: 8px;
  background: #e7fbfa;
  color: #075d5b;
  border: 1px solid #aae6e3;
}

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

.section-heading {
  margin-bottom: 10px;
}

.section-heading h3 {
  margin: 0 0 3px;
}

.status-field {
  min-width: 240px;
  padding: 10px;
  border: 2px solid rgba(255, 91, 82, 0.65);
  border-radius: 8px;
  background: #fff4f2;
  box-shadow: 0 0 0 3px rgba(255, 91, 82, 0.10);
}

.project-status-inline {
  width: min(360px, 100%);
  margin: 0 0 16px;
}

.status-field label {
  color: var(--danger);
  font-weight: 900;
}

.status-field select {
  border-color: var(--accent);
  background: #fff;
  font-weight: 900;
}

.messages {
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.message {
  border-left: 3px solid var(--accent);
  background: #fff4f2;
  padding: 10px;
  border-radius: 0 8px 8px 0;
}

.message strong {
  display: block;
  font-size: 13px;
}

.message p {
  margin: 5px 0 0;
  line-height: 1.35;
}

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

.file-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 10px;
}

.file-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.file-summary span {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 16px;
}

.clickable {
  cursor: pointer;
}

.clickable:hover {
  border-color: var(--brand);
}

.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(8, 179, 172, 0.16);
}

.file-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.file-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.file-actions .compact {
  min-height: 32px;
  font-size: 12px;
}

.report-controls {
  display: grid;
  gap: 12px;
}

.report-filter-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.report-summary h2 {
  font-size: 22px;
}

.report-table {
  min-width: 920px;
}

.report-pl-panel {
  display: grid;
  gap: 10px;
}

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

.pl-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.pl-line:last-child {
  border-bottom: 0;
}

.pl-line.strong {
  background: #eef9f8;
}

.pl-line span {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.pl-line strong {
  white-space: nowrap;
}

.report-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    gap: 10px;
  }

  .sidebar .brand {
    justify-content: space-between;
  }

  .mobile-settings-button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex: 0 0 auto;
  }

  .nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .user-panel {
    display: none;
    margin-top: 0;
    padding-top: 10px;
  }

  .user-panel.open {
    display: grid;
  }

  .workspace,
  .document-workspace,
  .project-page,
  .project-columns,
  .activity-line,
  .activity-item,
  .document-line,
  .financial-layout,
  .report-filter-grid,
  .two,
  .three,
  .four,
  .auth {
    grid-template-columns: 1fr;
  }

  .status-field {
    min-width: 0;
    width: 100%;
  }

  .document-editor,
  .document-line {
    min-width: 0;
  }

  .invoice-document .document-line,
  .quote-document .document-line {
    grid-template-columns: 1fr;
  }

  .document-line .compact {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .main,
  .auth-form,
  .auth-copy {
    padding: 18px;
  }

  .nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 4px;
  }

  .mobile-menu-button {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    flex: 0 0 auto;
  }

  .nav.open {
    display: grid;
  }

  .nav button {
    min-height: 36px;
    padding: 0 9px;
    font-size: 13px;
  }

  .sidebar .mark {
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand span {
    font-size: 11px;
  }

  .topbar,
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
  }

  .document-workspace .panel,
  .document-editor {
    padding: 14px;
  }

  .document-line {
    padding: 10px;
  }

  .document-totals {
    width: 100%;
  }

.primary,
.secondary,
.danger {
    width: 100%;
  }
}

.compact {
  min-height: 34px;
  padding: 0 10px;
}

.cut-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cut-help {
  margin-bottom: 18px;
  padding: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.6;
}

.cut-help summary {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  background: #eaf7f4;
}

.cut-help summary::-webkit-details-marker {
  display: none;
}

.cut-help summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: -3px;
}

.cut-help summary strong,
.cut-help summary span {
  display: block;
}

.cut-help summary strong {
  color: var(--ink);
  font-size: 19px;
}

.cut-help summary span span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 16px;
}

.cut-help-icon {
  display: grid !important;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 25px;
  font-weight: 900;
}

.cut-help-body {
  padding: 22px;
  border-top: 1px solid var(--line);
}

.cut-help-lead {
  max-width: 980px;
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.cut-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cut-help article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cut-help article h3 {
  margin: 0 0 12px;
  font-size: 19px;
}

.cut-help article svg {
  display: block;
  width: 100%;
  max-height: 190px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #f8fbfa;
}

.cut-help article svg text {
  fill: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
}

.cut-help-wide {
  grid-column: 1 / -1;
}

.cut-help-fields {
  display: grid;
  gap: 14px;
  margin: 0;
}

.cut-help-fields div {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5ecea;
}

.cut-help-fields div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cut-help-fields dt {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.cut-help-fields dd {
  margin: 3px 0 0;
  color: #455457;
  font-size: 16px;
  line-height: 1.55;
}

.cut-raster-help {
  overflow-x: auto;
}

.cut-raster-help svg {
  min-width: 680px;
}

.cut-raster-help > p {
  margin: 0 0 14px;
  color: #455457;
  font-size: 16px;
}

.cut-help-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 28px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

.cut-help-steps li {
  padding-left: 5px;
}

.cut-help-steps li::marker {
  color: var(--teal);
  font-weight: 900;
}

.cut-help-warning {
  margin-top: 18px !important;
  padding: 13px 15px;
  color: var(--ink) !important;
  font-size: 16px !important;
}

.cut-controls {
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding-right: 4px;
}

.cut-controls .panel {
  box-shadow: none;
}

.cut-controls h3 {
  margin: 0 0 14px;
}

.cut-file-button {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

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

.cut-file-name {
  display: block;
  overflow-wrap: anywhere;
}

.cut-file-meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.cut-preview-panel {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.cut-preview {
  width: 100%;
  min-height: 480px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe5e4;
}

.cut-canvas-shell {
  width: 100%;
  margin: auto;
  transition: width .15s ease;
}

.cut-canvas-shell svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 340px);
  margin: auto;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.cut-generate {
  width: 100%;
  margin-top: 16px;
}

.cut-validation {
  margin-top: 16px;
  background: #f3fbf8;
}

.cut-validation dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.cut-validation dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

.cut-validation dt {
  color: var(--muted);
}

.cut-validation dd {
  margin: 0;
  font-weight: 800;
}

.cut-download {
  margin-top: 12px;
  text-decoration: none;
}

.cut-machine-note {
  margin: 4px 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.cut-pass-inactive {
  opacity: .48;
}

.cut-pass-inactive select {
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .cut-workspace {
    grid-template-columns: 1fr;
  }

  .cut-controls {
    max-height: none;
    overflow: visible;
  }

  .cut-preview-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .cut-help summary {
    align-items: flex-start;
    padding: 16px;
  }

  .cut-help-body {
    padding: 14px;
  }

  .cut-help-grid {
    grid-template-columns: 1fr;
  }

  .cut-help-wide {
    grid-column: auto;
  }

  .cut-help article {
    padding: 15px;
  }

  .cut-preview {
    min-height: 340px;
    padding: 10px;
  }

  .cut-four,
  .cut-validation dl {
    grid-template-columns: 1fr 1fr;
  }

  .cut-preview-panel .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .cut-preview-panel .inline-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
}
body{font-family:system-ui,-apple-system,Segoe UI,sans-serif}.review-banner{margin-bottom:24px;border-left:4px solid #07847f;padding:18px;background:#e8f5f3;border-radius:10px}.review-banner p{margin:8px 0}.review-banner a{color:#075f5c}button:disabled{opacity:.55;cursor:not-allowed}
.category-list{display:grid;gap:12px;margin-top:16px}.category-card{border:1px solid var(--line);border-radius:12px;padding:16px;min-width:0}.category-card-title{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.category-add-form{padding:16px;background:var(--field);border-radius:12px;margin-top:16px}.category-inactive{margin-top:20px}.category-inactive summary{cursor:pointer;font-weight:600}.category-card .inline-actions{flex-wrap:wrap}.category-card input{width:100%;min-width:0}@media(max-width:600px){.category-card .two,.category-add-form .two{grid-template-columns:minmax(0,1fr)}.category-card .inline-actions button{flex:1 1 110px}}
.recurrence-controls{display:grid;gap:10px;border:1px solid var(--line);border-radius:12px;padding:16px;background:var(--field);min-width:0}.recurrence-checkbox{display:flex;align-items:center;gap:10px;font-weight:700}.recurrence-checkbox input[type=checkbox]{width:auto;min-width:0;margin:0}.recurrence-controls p{margin:0;overflow-wrap:anywhere}
.help-flow{list-style:none;margin:18px 0 0;padding:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:20px}.help-flow li{position:relative;min-width:0}.help-flow li:not(:last-child)::after{content:'→';position:absolute;right:-17px;top:42%;color:var(--brand-dark);font-weight:800}.help-flow a,.help-support a{display:flex;flex-direction:column;gap:8px;height:100%;padding:12px;border:1px solid var(--brand);border-radius:8px;background:var(--field);color:var(--ink);text-decoration:none;overflow-wrap:anywhere}.help-flow a:hover,.help-support a:hover{background:#e0f5f2}.help-step-number{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--brand-dark);color:white;font-weight:800}.help-flow small,.help-support small{line-height:1.5;color:var(--muted)}.help-support{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:22px;border-top:1px solid var(--line);padding-top:18px}.help-sections{display:grid;gap:16px;max-width:1100px}.help-section{scroll-margin-top:18px}.help-section h3{margin-top:0}.help-section ul{padding-left:22px;margin-bottom:0}.help-section li{margin:9px 0;line-height:1.6}.help-workflow h3{margin:0}@media(max-width:1100px){.help-flow{grid-template-columns:1fr;gap:25px}.help-flow a{display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center}.help-flow small{grid-column:2}.help-flow li:not(:last-child)::after{content:'↓';right:50%;top:auto;bottom:-22px}.help-support{grid-template-columns:1fr}}
