:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #eef2ff;
  --text: #1d2733;
  --muted: #64748b;
  --line: #d8e0e8;
  --line-strong: #aebccc;
  --brand: #062566;
  --brand-strong: #031946;
  --brand-soft: #e5ebff;
  --accent: #174ea6;
  --warning: #a65f00;
  --danger: #b42318;
  --invoice-blue: #062566;
  --invoice-line: #b8b8b8;
  --invoice-gray: #d9d9d9;
  --invoice-gray-soft: #f0f0f0;
  --shadow: 0 18px 45px rgba(6, 37, 102, 0.1);
}


.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
}

body.public-site {
  background:
    radial-gradient(circle at 18% 20%, rgba(6, 37, 102, 0.1), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eef3ff 100%);
  min-height: 100vh;
}

.public-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.public-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(6, 37, 102, 0.14);
  justify-self: center;
  max-width: 720px;
  padding: clamp(28px, 5vw, 54px);
  text-align: center;
  width: min(100%, 720px);
}

.public-logo {
  background: #ffffff;
  border: 1px solid var(--brand-soft);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(6, 37, 102, 0.08);
  height: 76px;
  margin-bottom: 18px;
  object-fit: contain;
  padding: 10px;
  width: 76px;
}

.public-card h1 {
  color: var(--brand);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  margin: 6px 0 14px;
}

.public-copy {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 auto 24px;
  max-width: 560px;
}

.public-contact {
  border-top: 1px solid var(--line);
  color: var(--brand);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 800;
  gap: 10px 18px;
  justify-content: center;
  line-height: 1.45;
  padding-top: 18px;
}

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

button {
  cursor: pointer;
}

body.auth-locked {
  min-height: 100vh;
}

body.auth-locked .app-shell,
body.auth-locked .print-root {
  display: none;
}

.auth-screen {
  align-items: center;
  background:
    radial-gradient(circle at 16% 18%, rgba(6, 37, 102, 0.1), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #eef3ff 100%);
  display: grid;
  min-height: 100vh;
  padding: 24px;
}

.auth-screen[hidden] {
  display: none !important;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(6, 37, 102, 0.16);
  justify-self: center;
  max-width: 440px;
  padding: 30px;
  width: min(100%, 440px);
}

.auth-mark {
  background: #ffffff;
  border: 1px solid var(--brand-soft);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(6, 37, 102, 0.08);
  height: 62px;
  margin-bottom: 18px;
  object-fit: contain;
  padding: 8px;
  width: 62px;
}

.auth-card h1 {
  color: var(--brand);
  font-size: 32px;
  line-height: 1.05;
  margin: 4px 0 10px;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 22px;
}

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

.auth-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

.auth-submit {
  justify-content: center;
  margin-top: 4px;
  width: 100%;
}

.auth-status {
  background: var(--brand-soft);
  border: 1px solid #cad7ff;
  border-radius: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  margin: 18px 0 0;
  padding: 12px 14px;
}

.auth-status.success {
  background: #e8f7ed;
  border-color: #bce5c8;
  color: #0f6b35;
}

.auth-status.warning {
  background: #fff6df;
  border-color: #f4d996;
  color: #8a5200;
}

.auth-status.error {
  background: #fff0ed;
  border-color: #ffc9c0;
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto 18px;
  max-width: 1760px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 18px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-divider {
  align-self: stretch;
  background: linear-gradient(180deg, rgba(166, 189, 47, 0), #a6bd2f 18%, #8aa124 82%, rgba(166, 189, 47, 0));
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(166, 189, 47, 0.08);
  display: inline-block;
  flex: 0 0 3px;
  min-height: 58px;
}

.brand-mark {
  background: #ffffff;
  border: 1px solid var(--brand-soft);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(6, 37, 102, 0.08);
  height: 64px;
  object-fit: contain;
  padding: 8px;
  width: 64px;
}

.topbar h1,
.panel h2,
.preview-toolbar h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.1;
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.topbar-actions,
.form-actions,
.section-title.with-action,
.panel-heading,
.preview-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
}

.topbar-actions,
.form-actions {
  flex-wrap: wrap;
}

.topbar-actions {
  align-content: center;
  column-gap: 10px;
  justify-content: flex-end;
  max-width: 640px;
  row-gap: 10px;
}

.topbar-actions .button {
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  min-height: 38px;
}

.topbar-actions .button.header-action {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #c9d6e8;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  gap: 7px;
  min-width: 112px;
  padding: 8px 11px;
}

.topbar-actions .header-action:hover {
  background: #f5f8ff;
  border-color: var(--brand);
  box-shadow: 0 12px 26px rgba(7, 42, 111, 0.11);
  transform: translateY(-1px);
}

.topbar-actions .header-action:active {
  transform: translateY(0);
}

.topbar-actions .header-action span {
  line-height: 1;
  white-space: nowrap;
}

.session-row {
  align-items: center;
  display: flex;
  flex: 1 1 100%;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.live-sync-indicator {
  align-items: center;
  background: #eef4ff;
  border: 1px solid #cddbf3;
  border-radius: 999px;
  color: var(--brand);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  gap: 7px;
  line-height: 1;
  min-height: 28px;
  padding: 7px 10px;
  white-space: nowrap;
}

.live-sync-dot {
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(7, 42, 111, 0.09);
  flex: 0 0 7px;
  height: 7px;
  width: 7px;
}

.live-sync-indicator.sync-connected {
  background: #e8f8ee;
  border-color: #b8e7c8;
  color: #12743b;
}

.live-sync-indicator.sync-saving {
  background: #eef4ff;
  border-color: #c5d6f2;
  color: var(--brand);
}

.live-sync-indicator.sync-saving .live-sync-dot {
  animation: livePulse 1s ease-in-out infinite;
}

.live-sync-indicator.sync-error {
  background: #fff0ed;
  border-color: #ffc9c0;
  color: var(--danger);
}

.action-icon {
  display: block;
  flex: 0 0 16px;
  height: 16px;
  object-fit: contain;
  width: 16px;
}

.export-action .action-icon,
.import-action .action-icon {
  filter: brightness(0) saturate(100%) invert(13%) sepia(77%) saturate(2366%) hue-rotate(214deg) brightness(88%) contrast(103%);
  opacity: 0.92;
}

.signed-in-email {
  align-items: center;
  color: var(--brand);
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  justify-content: flex-end;
  letter-spacing: 0;
  max-width: none;
  overflow: hidden;
  padding: 0 2px 2px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.14);
  }
}

.signed-in-email::before {
  background: url("assets/user.png") center / contain no-repeat;
  content: "";
  display: inline-block;
  filter: brightness(0) saturate(100%) invert(13%) sepia(77%) saturate(2366%) hue-rotate(214deg) brightness(88%) contrast(103%);
  flex: 0 0 18px;
  height: 18px;
  opacity: 0.94;
  width: 18px;
}

.signed-in-email[hidden] {
  display: none;
}

.topbar-actions .button.logout-button {
  background: #fffafa;
  border-color: #f3c7c1;
  color: var(--danger);
  min-width: 96px;
}

.topbar-actions .logout-button:hover {
  background: #fff1f0;
  border-color: var(--danger);
  color: var(--danger);
}

.logout-button .action-icon {
  filter: brightness(0) saturate(100%) invert(28%) sepia(53%) saturate(2128%) hue-rotate(337deg) brightness(91%) contrast(94%);
  opacity: 0.92;
}

.panel-heading,
.preview-toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.form-panel .panel-heading {
  margin-bottom: 14px;
}

.tabs {
  background: #e9eef5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 0 auto 20px;
  max-width: 1760px;
  padding: 4px;
  width: fit-content;
}

.tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 16px;
}

.tab.active {
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 36, 61, 0.12);
  color: var(--brand);
}

.view {
  display: none;
  margin: 0 auto;
  max-width: 1760px;
}

.view.active {
  display: block;
}

.workspace-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(520px, 0.6fr) minmax(820px, 1fr);
}

.dashboard-hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.9fr);
  margin-bottom: 20px;
  overflow: hidden;
  padding: 24px;
}

.hero-brand {
  display: block;
  min-width: 0;
}

.hero-brand h2 {
  color: var(--brand);
  font-size: 34px;
  line-height: 1.05;
  margin: 0;
}

.hero-brand p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
  max-width: 620px;
}

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

.hero-metric {
  background: #ffffff;
  border: 1px solid var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px 16px;
}

.hero-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-metric strong {
  color: var(--brand);
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.panel,
.preview-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.preview-wrap {
  padding: 20px;
  position: sticky;
  top: 18px;
  overflow-x: auto;
}

.button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

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

.button:active {
  transform: translateY(1px);
}

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

.button.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #ffffff;
}

.button.subtle {
  background: #f8fafc;
}

.button.tiny {
  min-height: 34px;
  padding: 7px 10px;
}

.file-button input,
#importDataInput {
  display: none;
}

form,
.form-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

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

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

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  outline: 0;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.compact-textarea {
  min-height: 42px;
  overflow: hidden;
  resize: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(6, 37, 102, 0.14);
}

.field-hint,
.panel-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}

input[readonly] {
  background: #f1f5f9;
  color: #475569;
}

.section-title {
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  margin-top: 6px;
  padding-top: 16px;
}

.section-title.with-action {
  justify-content: space-between;
}

.items-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.items-head,
.item-row {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(170px, 2fr) 80px 120px 120px 48px;
}

.items-head {
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.items-head span,
.item-row > * {
  align-items: center;
  border-right: 1px solid var(--line);
  display: flex;
  min-height: 44px;
  padding: 8px;
}

.items-head span:last-child,
.item-row > *:last-child {
  border-right: 0;
}

.item-row {
  border-top: 1px solid var(--line);
}

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

.item-row input {
  border: 0;
  border-radius: 0;
  min-height: 34px;
  padding: 6px;
}

.line-total {
  color: var(--text);
  font-weight: 900;
  justify-content: flex-end;
}

.remove-item {
  background: #fff5f5;
  border: 1px solid #ffd5d2;
  border-radius: 6px;
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
  height: 30px;
  line-height: 1;
  margin: auto;
  width: 30px;
}

.summary-strip {
  background: var(--surface-soft);
  border: 1px solid var(--brand-soft);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
}

.summary-strip div {
  display: grid;
  gap: 4px;
}

.summary-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-strip strong {
  font-size: 22px;
}

#quotationView .summary-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.save-status {
  background: #eef5ff;
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin: 0;
  padding: 8px 12px;
}

.invoice-paper {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 36, 61, 0.1);
  color: #111111;
  margin: 0 auto;
  min-height: 1120px;
  overflow: hidden;
  padding: 0;
  width: 794px;
}

.sp-invoice {
  display: flex;
  flex-direction: column;
  font-family: "Trebuchet MS", Arial, sans-serif;
  min-height: 1120px;
  padding: 48px 32px 28px;
}

.sp-header {
  align-items: center;
  border-bottom: 1px solid var(--invoice-line);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr auto;
  padding-bottom: 15px;
}

.sp-header h2 {
  color: var(--invoice-blue);
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}

.sp-wordmark {
  display: block;
  height: auto;
  max-height: 58px;
  max-width: 350px;
  object-fit: contain;
  width: 100%;
}

.sp-logo {
  color: #07056b;
  font-size: 42px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.9;
}

.sp-logo span {
  font-family: "Brush Script MT", "Snell Roundhand", cursive;
  font-size: 56px;
  font-weight: 700;
  margin-right: 4px;
}

.sp-intro {
  align-items: start;
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr 300px;
  margin-top: 28px;
}

.sp-billto h3,
.sp-info h3 {
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 7px;
}

.sp-billto p {
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 3px;
  white-space: pre-line;
}

.sp-docbox {
  padding-top: 2px;
}

.sp-type-badge {
  background: var(--invoice-blue);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 28px;
  padding: 18px 20px;
  text-align: center;
}

.sp-meta-line {
  display: grid;
  font-size: 18px;
  gap: 18px;
  grid-template-columns: 94px 1fr;
  margin: 6px 0;
}

.sp-meta-line strong {
  text-align: right;
}

.sp-product-table {
  border-collapse: collapse;
  margin-top: 26px;
  table-layout: fixed;
  width: 100%;
}

.sp-product-table .product-name-col,
.quote-product-table .quote-product-name-col {
  width: 48%;
}

.sp-product-table .product-qty-col,
.quote-product-table .quote-product-qty-col {
  width: 11%;
}

.sp-product-table .product-price-col,
.quote-product-table .quote-product-price-col {
  width: 18%;
}

.sp-product-table .product-subtotal-col,
.quote-product-table .quote-product-subtotal-col {
  width: 23%;
}

.sp-product-table th,
.sp-product-table td {
  border: 1px solid var(--invoice-line);
  font-size: 18px;
  padding: 13px 10px;
  vertical-align: middle;
}

.sp-product-table th {
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.sp-product-table th:nth-child(1) {
  width: 48%;
}

.sp-product-table th:nth-child(2) {
  width: 11%;
}

.sp-product-table th:nth-child(3) {
  width: 18%;
}

.sp-product-table th:nth-child(4) {
  width: 23%;
}

.sp-product-table .product-name {
  line-height: 1.35;
  max-width: 0;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.sp-product-table .product-qty {
  text-align: center;
}

.sp-product-table .product-money {
  font-size: 18px;
  padding-left: 7px;
  padding-right: 7px;
  text-align: center;
  white-space: nowrap;
}

.money-pair {
  align-items: center;
  display: inline-flex;
  font: inherit;
  gap: 0;
  justify-content: center;
  line-height: inherit;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  width: 100%;
}

.sp-product-table .product-money .money-pair {
  justify-content: center;
}

.sp-product-table .money-pair,
.sp-total-row .money-pair {
  font-variant-numeric: tabular-nums;
}

.empty-product {
  color: #777777;
  font-style: italic;
}

.sales-panel,
.sales-table-panel,
.orders-panel,
.orders-table-panel {
  margin-bottom: 20px;
}

.sales-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.sales-metric {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  border: 1px solid var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 14px 16px;
}

.sales-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sales-metric strong {
  color: var(--brand);
  font-size: 22px;
  line-height: 1.15;
}

.sales-entry-form {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(190px, 0.4fr) minmax(300px, 1fr) auto;
  padding-top: 18px;
}

.sales-entry-form .button {
  min-height: 42px;
  white-space: nowrap;
}

.sales-tools {
  align-items: end;
}

.sales-filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 180px 160px minmax(260px, 340px);
}

.orders-filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 170px 190px 180px minmax(250px, 340px);
}

.sales-table-wrap {
  overflow-x: auto;
}

.orders-table-wrap {
  overflow-x: auto;
}

.sales-table,
.orders-table {
  border-collapse: collapse;
  min-width: 1180px;
  table-layout: fixed;
  width: 100%;
}

.sales-table th,
.sales-table td,
.orders-table th,
.orders-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: center;
  vertical-align: middle;
}

.sales-table th,
.orders-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sales-table td,
.orders-table td {
  font-size: 14px;
  line-height: 1.35;
}

.orders-table {
  min-width: 1120px;
}

.sales-table th:nth-child(1),
.sales-table td:nth-child(1) {
  width: 12%;
}

.sales-table th:nth-child(2),
.sales-table td:nth-child(2) {
  width: 16%;
}

.sales-table th:nth-child(3),
.sales-table td:nth-child(3) {
  width: 15%;
}

.sales-table th:nth-child(4),
.sales-table td:nth-child(4) {
  width: 24%;
}

.sales-table th:nth-child(5),
.sales-table td:nth-child(5) {
  width: 7%;
}

.sales-table th:nth-child(6),
.sales-table td:nth-child(6),
.sales-table th:nth-child(7),
.sales-table td:nth-child(7) {
  width: 11%;
}

.sales-table th:nth-child(8),
.sales-table td:nth-child(8) {
  width: 9%;
}

.sales-table th:nth-child(9),
.sales-table td:nth-child(9) {
  width: 8%;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
  width: 18%;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
  width: 16%;
}

.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
  width: 15%;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
  width: 27%;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5) {
  width: 7%;
}

.orders-table th:nth-child(6),
.orders-table td:nth-child(6) {
  width: 14%;
}

.orders-table th:nth-child(7),
.orders-table td:nth-child(7) {
  width: 13%;
}

.sales-buyer,
.sales-product,
.order-buyer,
.order-product {
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.order-product {
  line-height: 1.35;
}

.sales-number,
.order-number {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sales-money {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.sales-date-input {
  min-height: 36px;
  padding: 7px 8px;
}

.order-deadline-chip {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  line-height: 1.25;
  min-height: 38px;
  min-width: 190px;
  overflow: hidden;
  padding: 8px 28px 8px 12px;
  position: relative;
  text-align: center;
}

.order-deadline-chip span {
  pointer-events: none;
}

.order-deadline-arrow {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  height: 0;
  opacity: 0.8;
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
}

.order-deadline-input {
  cursor: pointer;
  height: 100%;
  inset: 0;
  min-height: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.deadline-overdue {
  background: #fff1f0;
  border-color: #ffb4ad;
  color: var(--danger);
  font-weight: 900;
}

.deadline-today {
  background: #fff7e6;
  border-color: #ffd591;
  color: #8a4b00;
  font-weight: 900;
}

.deadline-soon {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #705400;
  font-weight: 900;
}

.deadline-done {
  background: #e7f8ef;
  border-color: #b7e4c7;
  color: #087443;
  font-weight: 900;
}

.invoice-link-button {
  background: transparent;
  border: 0;
  color: var(--brand);
  font-weight: 900;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invoice-link-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.sales-actions {
  display: flex;
  justify-content: center;
}

.sales-actions button {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 8px;
}

.order-status-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  min-height: 32px;
  padding: 6px 26px 6px 10px;
  width: 150px;
}

.order-status-not-started {
  background: #fff1f0;
  border-color: #ffd1cc;
  color: var(--danger);
}

.order-status-progress {
  background: #eef5ff;
  border-color: #bdd7ff;
  color: var(--accent);
}

.order-status-waiting {
  background: #fff7e6;
  border-color: #ffd591;
  color: #8a4b00;
}

.order-status-done {
  background: #e7f8ef;
  border-color: #b7e4c7;
  color: #087443;
}

.sales-row-muted {
  color: var(--muted);
}

.row-highlight {
  animation: rowHighlight 1.8s ease;
}

@keyframes rowHighlight {
  0% {
    background: #fff4c7;
  }
  100% {
    background: transparent;
  }
}

.sp-lower {
  align-items: start;
  display: grid;
  gap: 38px;
  grid-template-columns: 38% 1fr;
  margin-top: 22px;
}

.sp-info {
  min-width: 0;
  text-align: center;
}

.sp-info h3 {
  margin-top: 0;
}

.sp-info h3:not(:first-child) {
  margin-top: 22px;
}

.sp-info p {
  font-size: 17px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
  word-break: break-word;
}

.sp-totals {
  display: grid;
  gap: 0;
  min-width: 0;
}

.sp-total-row {
  align-items: center;
  background: var(--invoice-gray-soft);
  display: grid;
  font-size: 18px;
  font-weight: 900;
  grid-template-columns: minmax(185px, 1fr) minmax(185px, 0.7fr);
  min-height: 52px;
  padding: 0 12px;
}

.sp-total-row.soft {
  background: var(--invoice-gray);
}

.sp-total-row.light {
  background: var(--invoice-gray-soft);
}

.sp-total-row.grand {
  margin-top: 24px;
}

.sp-total-row.primary {
  background: var(--invoice-blue);
  color: #ffffff;
  margin-top: 24px;
}

.sp-total-row strong {
  justify-self: stretch;
}

.sp-total-row strong .money-pair {
  font-size: inherit;
  font-weight: inherit;
  justify-content: center;
}

.sp-bottom {
  margin-top: auto;
}

.sp-footer {
  border-top: 1px solid var(--invoice-line);
  color: var(--invoice-blue);
  font-size: 18px;
  font-style: italic;
  font-weight: 900;
  margin-top: 0;
  padding-top: 16px;
  text-align: center;
}

.sp-contact-footer {
  font-size: 15px;
  font-style: normal;
  line-height: 1.35;
  padding-top: 14px;
}

.invoice-contact-row {
  gap: 10px 20px;
}

.quote-hero .hero-metric {
  border-left-color: var(--accent);
}

.sp-quotation {
  color: #111111;
  display: flex;
  flex-direction: column;
  font-family: "Trebuchet MS", Arial, sans-serif;
  min-height: 1120px;
  padding: 48px 32px 28px;
}

.quote-header {
  align-items: center;
  border-bottom: 1px solid var(--invoice-line);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr auto;
  padding-bottom: 15px;
}

.quote-wordmark {
  display: block;
  height: auto;
  max-height: 58px;
  max-width: 350px;
  object-fit: contain;
  width: 100%;
}

.quote-header h2 {
  color: var(--invoice-blue);
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}

.quote-meta {
  align-items: start;
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1fr) 330px;
  margin-top: 28px;
}

.quote-recipient {
  display: grid;
  gap: 5px;
}

.quote-recipient p {
  font-size: 18px;
  margin: 0;
}

.quote-recipient strong {
  font-size: 19px;
}

.quote-recipient span {
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.quote-doc-meta {
  display: grid;
  gap: 6px;
}

.quote-meta-line {
  display: grid;
  font-size: 17px;
  gap: 18px;
  grid-template-columns: 94px 1fr;
}

.quote-meta-line strong {
  text-align: right;
}

.quote-opening {
  font-size: 18px;
  line-height: 1.45;
  margin-top: 32px;
}

.quote-opening p {
  margin: 0 0 14px;
}

.quote-product-table {
  border-collapse: collapse;
  margin-top: 8px;
  table-layout: fixed;
  width: 100%;
}

.quote-product-table th,
.quote-product-table td {
  border: 1px solid var(--invoice-line);
  font-size: 18px;
  padding: 13px 10px;
  vertical-align: middle;
}

.quote-product-table th {
  background: #f7f7f7;
  font-weight: 900;
  text-align: center;
}

.quote-product-table th:nth-child(1) {
  width: 48%;
}

.quote-product-table th:nth-child(2) {
  width: 11%;
}

.quote-product-table th:nth-child(3) {
  width: 18%;
}

.quote-product-table th:nth-child(4) {
  width: 23%;
}

.quote-product-name {
  line-height: 1.35;
  max-width: 0;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.quote-product-qty {
  text-align: center;
}

.quote-product-money {
  font-size: inherit;
  padding-left: 7px;
  padding-right: 7px;
  text-align: center;
  white-space: nowrap;
}

.quote-product-money .money-pair {
  font-size: inherit;
  justify-content: center;
}

.quote-grand-row td {
  font-weight: 900;
}

.quote-grand-row td:first-child {
  text-align: center;
}

.quote-grand-row {
  background: var(--invoice-blue);
  color: #ffffff;
}

.quote-grand-row .money-pair {
  color: #ffffff;
  font-weight: 900;
  justify-content: center;
}

.quote-terms {
  font-size: 18px;
  line-height: 1.45;
  margin-top: 28px;
}

.quote-terms p {
  margin: 0 0 12px;
}

.quote-terms ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 25px;
}

.quote-footer {
  border-top: 1px solid var(--invoice-line);
  color: var(--invoice-blue);
  font-size: 15px;
  line-height: 1.35;
  margin-top: auto;
  padding-top: 14px;
}

.quote-contact-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: center;
}

.quote-contact-item {
  align-items: center;
  color: var(--invoice-blue);
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  gap: 7px;
  line-height: 1.2;
  white-space: nowrap;
}

.quote-contact-icon {
  display: block;
  height: 20px;
  object-fit: contain;
  width: 20px;
}

.quote-status-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  min-height: 32px;
  padding: 6px 26px 6px 10px;
  width: 118px;
}

.quote-status-draft {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #52525b;
}

.quote-status-sent {
  background: #eef2ff;
  border-color: #c8d4ff;
  color: var(--brand);
}

.quote-status-approved {
  background: #e7f8ef;
  border-color: #b7e4c7;
  color: #087443;
}

.quote-status-rejected {
  background: #fff1f0;
  border-color: #ffd1cc;
  color: var(--danger);
}

.quote-archive-table {
  min-width: 1120px;
}

.quote-archive-table th,
.quote-archive-table td {
  padding-left: 10px;
  padding-right: 10px;
  text-align: center;
  vertical-align: middle;
}

.quote-archive-table th:first-child,
.quote-archive-table td:first-child {
  width: 16%;
}

.quote-archive-table th:nth-child(2),
.quote-archive-table td:nth-child(2) {
  width: 11%;
}

.quote-archive-table th:nth-child(3),
.quote-archive-table td:nth-child(3) {
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  width: 20%;
}

.quote-archive-table th:nth-child(4),
.quote-archive-table td:nth-child(4) {
  width: 13%;
}

.quote-archive-table th:nth-child(5),
.quote-archive-table td:nth-child(5) {
  width: 13%;
}

.quote-archive-table th:nth-child(6),
.quote-archive-table td:nth-child(6) {
  width: 27%;
}

.quote-archive-table th:first-child,
.quote-archive-table td:first-child,
.quote-archive-table th:nth-child(4),
.quote-archive-table td:nth-child(4) {
  text-align: center;
}

.quote-actions {
  gap: 10px;
}

.quote-actions button {
  font-size: 12px;
  min-height: 34px;
  padding: 7px 10px;
}

.invoice-header {
  align-items: start;
  border-bottom: 4px solid var(--brand);
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr auto;
  padding-bottom: 24px;
}

.brand-block h3,
.invoice-title {
  margin: 0;
}

.brand-block h3 {
  font-size: 24px;
}

.brand-block p,
.invoice-meta p,
.bill-block p,
.note-block p,
.invoice-footer {
  color: #536275;
  line-height: 1.5;
  margin: 4px 0 0;
  white-space: pre-line;
}

.invoice-title {
  color: var(--brand);
  font-size: 38px;
  text-align: right;
}

.invoice-meta {
  margin-top: 16px;
  min-width: 260px;
}

.meta-row,
.totals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.meta-row span,
.totals-row span {
  border-bottom: 1px solid #e3e8ef;
  padding: 8px 0;
}

.meta-row span:first-child,
.totals-row span:first-child {
  color: #536275;
  font-weight: 800;
}

.meta-row span:last-child,
.totals-row span:last-child {
  font-weight: 900;
  text-align: right;
}

.status-pill {
  background: var(--brand-soft);
  border-radius: 999px;
  color: var(--brand-strong);
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  margin-top: 12px;
  padding: 8px 12px;
}

.invoice-section-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  margin: 28px 0;
}

.bill-block h4,
.note-block h4 {
  color: var(--brand);
  margin: 0 0 8px;
}

.invoice-items {
  border-collapse: collapse;
  margin-top: 24px;
  width: 100%;
}

.invoice-items th {
  background: var(--brand);
  color: #ffffff;
  font-size: 12px;
  padding: 11px 10px;
  text-align: left;
  text-transform: uppercase;
}

.invoice-items td {
  border-bottom: 1px solid #e3e8ef;
  padding: 12px 10px;
  vertical-align: top;
}

.invoice-items .number,
.invoice-items .money {
  text-align: right;
}

.invoice-summary {
  display: grid;
  gap: 6px;
  margin-left: auto;
  margin-top: 22px;
  max-width: 330px;
}

.totals-row.grand {
  background: var(--brand);
  color: #ffffff;
  margin-top: 4px;
  padding: 0 12px;
}

.totals-row.grand span {
  border: 0;
  font-size: 18px;
}

.note-block {
  border-top: 1px solid #e3e8ef;
  margin-top: 26px;
  padding-top: 20px;
}

.invoice-footer {
  margin-top: 34px;
  text-align: center;
}

.archive-table-wrap {
  overflow-x: auto;
}

.archive-table {
  border-collapse: collapse;
  min-width: 1240px;
  table-layout: fixed;
  width: 100%;
}

.archive-table th,
.archive-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 6px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.archive-table td {
  font-size: 14px;
  line-height: 1.25;
}

.archive-table th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.archive-table th:first-child,
.archive-table td:first-child,
.archive-table th:nth-child(4),
.archive-table td:nth-child(4) {
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.archive-table th:first-child,
.archive-table td:first-child {
  width: 14%;
}

.invoice-archive-table th:first-child,
.invoice-archive-table td:first-child,
.invoice-archive-table th:nth-child(4),
.invoice-archive-table td:nth-child(4) {
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.archive-table th:nth-child(2),
.archive-table td:nth-child(2) {
  width: 8%;
}

.archive-table th:nth-child(3),
.archive-table td:nth-child(3) {
  width: 9%;
}

.archive-table th:nth-child(4),
.archive-table td:nth-child(4) {
  width: 12%;
}

.archive-table th:nth-child(5),
.archive-table td:nth-child(5) {
  width: 8%;
}

.archive-table th:nth-child(6),
.archive-table td:nth-child(6) {
  width: 9%;
}

.archive-table th:nth-child(7),
.archive-table td:nth-child(7) {
  width: 17%;
}

.archive-table th:nth-child(8),
.archive-table td:nth-child(8) {
  width: 10%;
}

.archive-table th:nth-child(9),
.archive-table td:nth-child(9) {
  width: 13%;
}

.invoice-archive-table th:first-child,
.invoice-archive-table td:first-child {
  width: 15%;
}

.invoice-archive-table th:nth-child(2),
.invoice-archive-table td:nth-child(2) {
  width: 9%;
}

.invoice-archive-table th:nth-child(3),
.invoice-archive-table td:nth-child(3) {
  width: 13%;
}

.invoice-archive-table th:nth-child(4),
.invoice-archive-table td:nth-child(4) {
  width: 13%;
}

.invoice-archive-table th:nth-child(5),
.invoice-archive-table td:nth-child(5) {
  width: 10%;
}

.invoice-archive-table th:nth-child(6),
.invoice-archive-table td:nth-child(6) {
  width: 15%;
}

.invoice-archive-table th:nth-child(7),
.invoice-archive-table td:nth-child(7) {
  width: 12%;
}

.invoice-archive-table th:nth-child(8),
.invoice-archive-table td:nth-child(8) {
  width: 13%;
}

.quote-archive-table {
  min-width: 1120px;
}

.quote-archive-table th,
.quote-archive-table td {
  padding-left: 10px;
  padding-right: 10px;
  text-align: center;
  vertical-align: middle;
}

.quote-archive-table th:first-child,
.quote-archive-table td:first-child {
  width: 16%;
}

.quote-archive-table th:nth-child(2),
.quote-archive-table td:nth-child(2) {
  width: 11%;
}

.quote-archive-table th:nth-child(3),
.quote-archive-table td:nth-child(3) {
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  width: 20%;
}

.quote-archive-table th:nth-child(4),
.quote-archive-table td:nth-child(4) {
  width: 13%;
}

.quote-archive-table th:nth-child(5),
.quote-archive-table td:nth-child(5) {
  width: 13%;
}

.quote-archive-table th:nth-child(6),
.quote-archive-table td:nth-child(6) {
  width: 27%;
}

.quote-archive-table th:first-child,
.quote-archive-table td:first-child,
.quote-archive-table th:nth-child(4),
.quote-archive-table td:nth-child(4) {
  text-align: center;
}

.status-badge {
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft);
  border-radius: 999px;
  box-sizing: border-box;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.sales-table .status-badge {
  min-width: 118px;
}

.orders-table .status-badge {
  width: 150px;
}

.archive-payment-status {
  min-width: 118px;
}

.archive-due-paid {
  color: #087443;
}

.status-badge.status-paid {
  background: #e7f8ef;
  border-color: #b7e4c7;
  color: #087443;
}

.status-badge.status-pending {
  background: #fff7df;
  border-color: #f4d996;
  color: #8a5200;
}

.status-badge.status-unpaid {
  background: #fff1f0;
  border-color: #ffd1cc;
  color: var(--danger);
}

.status-badge.status-cancelled {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #52525b;
}

.archive-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
}

.invoice-archive-table .archive-actions {
  gap: 8px;
}

.archive-actions.quote-actions {
  gap: 10px;
}

.archive-actions button {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 7px;
}

.archive-actions.quote-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.proof-cell {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}

.proof-thumbs {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: center;
}

.proof-thumb-wrap {
  display: inline-flex;
  position: relative;
}

.proof-thumb {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 34px;
  overflow: hidden;
  padding: 0;
  width: 34px;
}

.proof-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.proof-remove {
  align-items: center;
  background: #fff5f5;
  border: 1px solid #ffd5d2;
  border-radius: 999px;
  color: var(--danger);
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 16px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: -5px;
  top: -5px;
  width: 16px;
}

.proof-upload {
  align-items: center;
  background: #eef2ff;
  border: 1px dashed var(--brand);
  border-radius: 6px;
  color: var(--brand);
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.proof-upload input {
  display: none;
}

.proof-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.proof-modal {
  align-items: center;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

.proof-modal.visible {
  display: flex;
}

.proof-modal-backdrop {
  background: rgba(2, 6, 23, 0.72);
  inset: 0;
  position: absolute;
}

.proof-modal-dialog {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.28);
  max-height: min(86vh, 900px);
  max-width: min(88vw, 900px);
  padding: 14px;
  position: relative;
  width: fit-content;
}

.proof-modal-dialog img {
  border-radius: 6px;
  display: block;
  max-height: 74vh;
  max-width: 84vw;
  object-fit: contain;
}

.proof-modal-close {
  align-items: center;
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  position: absolute;
  right: -10px;
  top: -10px;
  width: 30px;
}

#proofModalCaption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 10px 4px 0;
}

.search-input {
  max-width: 320px;
}

.empty-state {
  color: var(--muted);
  display: none;
  margin: 18px 0 0;
}

.empty-state.visible {
  display: block;
}

.settings-panel {
  margin: 0 auto;
  max-width: none;
  width: 100%;
}

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

.settings-group {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
  padding: 20px;
}

.settings-field-wide {
  grid-column: 1 / -1;
}

.settings-group-heading {
  border-bottom: 1px solid #e7edf5;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.settings-group-heading h3 {
  color: var(--text);
  font-size: 18px;
  margin: 0;
}

.settings-group-heading p {
  color: var(--muted);
  line-height: 1.45;
  margin: 5px 0 0;
}

.toast-stack {
  bottom: 24px;
  display: grid;
  justify-items: end;
  pointer-events: none;
  position: fixed;
  right: 24px;
  z-index: 60;
}

.toast-card {
  background: #ffffff;
  border: 1px solid #c9d7ee;
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(6, 37, 102, 0.18);
  color: var(--text);
  display: grid;
  gap: 3px;
  min-width: min(360px, calc(100vw - 32px));
  opacity: 0;
  padding: 13px 15px;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-card strong {
  color: var(--brand);
  font-size: 14px;
}

.toast-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.print-root {
  display: none;
}

@media (max-width: 1440px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .preview-wrap {
    position: static;
  }

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

}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .panel-heading,
  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }

  .session-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    justify-content: flex-start;
  }

  .signed-in-email {
    justify-content: flex-start;
    text-align: left;
  }

  .topbar-actions .button.header-action {
    flex: 1 1 0;
    font-size: 12px;
    min-width: 0;
    gap: 6px;
    padding: 10px 6px;
  }

  .topbar-actions .button.logout-button {
    min-width: 0;
  }

  .action-icon {
    flex-basis: 16px;
    height: 16px;
    width: 16px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-divider {
    align-self: flex-start;
    flex-basis: 3px;
    height: 3px;
    min-height: 3px;
    width: 64px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    padding: 10px 8px;
  }

  .form-grid.two,
  .form-grid.three,
  .settings-layout,
  .settings-grid,
  .summary-strip,
  .sales-entry-form,
  .sales-filters,
  .orders-filters,
  .invoice-header,
  .invoice-section-grid,
  .sp-intro,
  .sp-lower,
  .quote-header,
  .quote-meta {
    grid-template-columns: 1fr;
  }

  .sales-summary {
    grid-template-columns: 1fr;
  }

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

  .items-head,
  .item-row {
    min-width: 620px;
  }

  .invoice-paper {
    min-height: 0;
  }

  .invoice-title {
    text-align: left;
  }

  .sp-invoice {
    min-height: 0;
    padding: 34px 22px 24px;
  }

  .sp-quotation {
    min-height: 0;
    padding: 34px 22px 24px;
  }

  .sp-logo {
    font-size: 32px;
  }

  .sp-logo span {
    font-size: 42px;
  }

  .sp-header h2 {
    text-align: left;
  }

  .quote-header h2 {
    text-align: left;
  }

  .toast-stack {
    bottom: 14px;
    left: 14px;
    right: 14px;
  }

  .sp-product-table {
    margin-top: 30px;
  }

  .sp-product-table th,
  .sp-product-table td,
  .sp-billto p,
  .sp-info p,
  .sp-total-row,
  .quote-product-table th,
  .quote-product-table td,
  .quote-opening,
  .quote-terms {
    font-size: 15px;
  }

  .sp-product-table .product-money,
  .quote-product-money {
    font-size: 15px;
  }
}

@media print {
  @page {
    margin: 0;
    size: A4;
  }

  html {
    height: 297mm;
    width: 210mm;
  }

  body {
    background: #ffffff;
    height: 297mm;
    margin: 0;
    width: 210mm;
  }

  .app-shell {
    display: none;
  }

  .toast-stack {
    display: none;
  }

  .print-root {
    display: grid;
    height: 297mm;
    margin: 0;
    place-items: center;
    width: 210mm;
  }

  .invoice-paper {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    height: 297mm;
    margin: 0;
    min-height: 297mm;
    overflow: visible;
    padding: 0;
    place-items: center;
    width: 210mm;
  }

  .sp-invoice {
    height: 273mm;
    margin: 0 auto;
    min-height: 0;
    padding: 0 10mm;
    width: 100%;
  }

  .sp-quotation {
    height: 273mm;
    margin: 0 auto;
    min-height: 0;
    padding: 0 10mm;
    width: 100%;
  }

  .sp-intro {
    grid-template-columns: 1fr 300px;
  }

  .sp-lower {
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.35fr);
  }

  .quote-header {
    grid-template-columns: 1fr auto;
  }

  .quote-meta {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .sp-product-table th,
  .sp-product-table td,
  .quote-product-table th,
  .quote-product-table td {
    font-size: 18px;
    padding-left: 7px;
    padding-right: 7px;
  }

  .sp-product-table .product-money,
  .quote-product-money {
    font-size: 18px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .sp-product-table .product-money .money-pair,
  .quote-product-money .money-pair {
    justify-content: center;
  }

  .sp-type-badge,
  .sp-total-row.primary,
  .quote-grand-row {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .sp-total-row.soft {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .sp-total-row,
  .sp-total-row.light {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Tumbler Kreatif theme and document templates */
:root {
  --bg: #f3f4ec;
  --surface: #ffffff;
  --surface-soft: #f7f8f1;
  --text: #23251f;
  --muted: #72776b;
  --line: #dde1d3;
  --line-strong: #bec5b1;
  --brand: #252721;
  --brand-strong: #161812;
  --brand-soft: #edf2d3;
  --accent: #a6bd2f;
  --invoice-blue: #a6bd2f;
  --invoice-line: #d8d9d3;
  --invoice-gray: #ececea;
  --invoice-gray-soft: #f4f4f2;
  --shadow: 0 20px 52px rgba(38, 42, 28, 0.1);
}

html {
  background:
    radial-gradient(circle at 5% 0%, rgba(166, 189, 47, 0.13), transparent 26%),
    var(--bg);
}

.app-shell {
  background: transparent;
}

.tk-logo-crop {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  overflow: visible;
  position: relative;
}

.tk-logo-crop img {
  display: block;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  position: static;
  width: 100%;
}

.tk-logo-dashboard {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 64px;
  width: 244px;
}

.tk-logo-dashboard img {
  height: 100%;
  width: 100%;
}

.tk-auth-card {
  max-width: 480px;
  overflow: hidden;
  position: relative;
}

.tk-auth-card::before {
  background: linear-gradient(90deg, #ff3939 0 16.6%, #ff914d 16.6% 33.2%, #ffd95b 33.2% 49.8%, #93ef23 49.8% 66.4%, #2d7ff9 66.4% 83%, #974df7 83% 100%);
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.tk-logo-auth {
  height: 72px;
  margin: 0 0 14px;
  width: 264px;
}

.tk-logo-auth img {
  height: 100%;
  width: 100%;
}

.tk-auth-card .auth-submit {
  min-height: 46px;
}

.topbar h1 {
  color: var(--brand-strong);
}

.eyebrow {
  color: #839522;
  letter-spacing: 0.1em;
}

.local-mode-badge {
  align-items: center;
  background: #f4f7e7;
  border: 1px solid #d5dfa2;
  border-radius: 999px;
  color: #5e6d13;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.local-mode-badge > span {
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(166, 189, 47, 0.16);
  height: 8px;
  width: 8px;
}

.topbar-actions .button.header-action {
  background: #ffffff;
  border-color: var(--line);
}

.export-action .action-icon,
.import-action .action-icon {
  filter: brightness(0) saturate(100%);
}

.tabs {
  background: #e8eadf;
  border-color: #d7dacb;
  border-radius: 14px;
  padding: 5px;
}

.tab {
  border-radius: 10px;
}

.tab.active {
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(104, 119, 26, 0.2);
  color: #171912;
}

.dashboard-hero {
  background:
    linear-gradient(90deg, #ff3939 0 16.6%, #ff914d 16.6% 33.2%, #ffd95b 33.2% 49.8%, #93ef23 49.8% 66.4%, #2d7ff9 66.4% 83%, #974df7 83% 100%) top / 100% 5px no-repeat,
    linear-gradient(135deg, #22241f 0%, #36382f 100%);
  border: 0;
  border-radius: 18px;
  padding-top: 29px;
}

.hero-brand h2,
.dashboard-hero .eyebrow {
  color: #ffffff;
}

.hero-brand p:not(.eyebrow) {
  color: #d7dacd;
}

.hero-metric {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent);
}

.hero-metric span {
  color: #cfd4c4;
}

.hero-metric strong {
  color: #ffffff;
}

.panel,
.preview-wrap {
  border-radius: 18px;
}

.button {
  border-radius: 10px;
}

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

.button.primary:hover {
  background: #96ab28;
  border-color: #96ab28;
}

.save-status {
  background: var(--brand-soft);
  color: #667516;
}

.invoice-paper {
  border-color: #d8dad2;
  border-radius: 3px;
}

.sp-invoice,
.sp-quotation {
  background: #ffffff;
  color: #11120f;
  font-family: "Avenir Next", Avenir, "Century Gothic", Montserrat, Arial, sans-serif;
  min-height: 1120px;
  padding: 40px 0 0;
}

.tk-document {
  letter-spacing: 0.02em;
}

.tk-document-header {
  align-items: center;
  border: 0;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 62px;
}

.tk-logo-document {
  height: 104px;
  width: 370px;
}

.tk-logo-document img {
  height: 100%;
  width: 100%;
}

.tk-document-title {
  align-items: flex-end;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.tk-document-title h2,
.sp-header h2,
.quote-header h2 {
  color: #0e0f0d;
  font-size: 40px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
  margin: 0;
}

.tk-document-title > span {
  background: var(--accent);
  border-radius: 999px;
  color: #171912;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.tk-invoice-intro {
  align-items: start;
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.75fr);
  margin: 42px 0 0;
  padding: 0 74px;
}

.tk-meta-block {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.tk-meta-line {
  align-items: baseline;
  display: grid;
  font-size: 14px;
  gap: 12px;
  grid-template-columns: 126px 8px minmax(0, 1fr);
  letter-spacing: 0.12em;
}

.tk-meta-line strong {
  font-weight: 800;
}

.tk-meta-line span {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tk-small-label {
  color: #7c8e20;
  font-size: 10px !important;
  font-weight: 900;
  letter-spacing: 0.16em;
  margin: 0;
  text-transform: uppercase;
}

.tk-billto {
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding-left: 14px;
}

.tk-billto strong {
  font-size: 16px;
  letter-spacing: 0.05em;
}

.tk-billto p {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.48;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.tk-product-table,
.sp-product-table,
.quote-product-table {
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 68px;
  table-layout: fixed;
  width: 100%;
}

.tk-product-table .product-number-col,
.tk-product-table .quote-product-number-col {
  width: 6.5%;
}

.tk-product-table .product-name-col,
.tk-product-table .quote-product-name-col {
  width: 49.5%;
}

.tk-product-table .product-price-col,
.tk-product-table .quote-product-price-col {
  width: 15%;
}

.tk-product-table .product-qty-col,
.tk-product-table .quote-product-qty-col {
  width: 9%;
}

.tk-product-table .product-subtotal-col,
.tk-product-table .quote-product-subtotal-col {
  width: 20%;
}

.tk-product-table th:nth-child(1),
.tk-product-table td:nth-child(1) {
  width: 6.5%;
}

.tk-product-table th:nth-child(2),
.tk-product-table td:nth-child(2) {
  width: 49.5%;
}

.tk-product-table th:nth-child(3),
.tk-product-table td:nth-child(3) {
  width: 15%;
}

.tk-product-table th:nth-child(4),
.tk-product-table td:nth-child(4) {
  width: 9%;
}

.tk-product-table th:nth-child(5),
.tk-product-table td:nth-child(5) {
  width: 20%;
}

.tk-product-table th,
.sp-product-table th,
.quote-product-table th {
  background: var(--accent);
  border: 0;
  color: #151711;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
  padding: 14px 8px;
  text-align: center;
}

.tk-product-table th:first-child,
.tk-product-table td:first-child {
  padding-left: 12px;
  padding-right: 12px;
}

.tk-product-table td,
.sp-product-table td,
.quote-product-table td {
  background: #f0f0ef;
  border: 0;
  border-bottom: 7px solid #ffffff;
  font-size: 13px;
  font-weight: 600;
  min-height: 68px;
  padding: 20px 10px;
  text-align: center;
  vertical-align: middle;
}

.sp-product-table .product-number,
.quote-product-number,
.sp-product-table .product-qty,
.quote-product-qty,
.sp-product-table .product-money,
.quote-product-money {
  font-size: 13px;
  text-align: center;
}

.sp-product-table .product-name,
.quote-product-name {
  font-size: 13px;
  line-height: 1.45;
  max-width: none;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: pre-line;
  word-break: normal;
}

.document-amount {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.tk-invoice-lower {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 390px);
  margin: 8px 0 0;
  padding: 0 62px 0 74px;
}

.tk-payment-info {
  padding-top: 48px;
  text-align: left;
}

.tk-payment-info h3 {
  font-size: 15px;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
}

.tk-payment-details {
  display: grid;
  gap: 6px;
}

.tk-payment-line {
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 8px;
  grid-template-columns: 150px 8px minmax(0, 1fr);
  letter-spacing: 0.045em;
}

.tk-payment-line span,
.tk-payment-line b {
  font-weight: 650;
}

.tk-payment-line span {
  white-space: nowrap;
}

.tk-payment-line strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tk-payment-line-full {
  display: block;
}

.tk-invoice-note {
  margin-top: 24px;
}

.tk-invoice-note > strong {
  font-size: 12px;
  letter-spacing: 0.14em;
}

.tk-invoice-note p {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
  margin: 5px 0 0;
  white-space: pre-line;
}

.sp-totals {
  justify-self: end;
  min-width: 0;
  width: min(100%, 390px);
}

.sp-total-row,
.sp-total-row.soft,
.sp-total-row.light,
.sp-total-row.primary {
  align-items: center;
  background: #efefed;
  color: #11120f;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.9fr);
  letter-spacing: 0.1em;
  margin: 0;
  min-height: 42px;
  padding: 0 14px;
}

.sp-total-row.total {
  background: #f7f7f5;
}

.sp-total-row.payment {
  background: #e8e8e5;
  border-top: 5px solid #ffffff;
}

.sp-total-row.due {
  background: var(--accent);
  font-size: 16px;
  margin-top: 5px;
  min-height: 50px;
  text-transform: none;
}

.sp-total-row strong {
  justify-self: stretch;
  text-align: center;
}

.tk-document-bottom {
  margin-top: auto;
  padding-top: 28px;
}

.tk-thank-you {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 13px;
  text-align: center;
}

.tk-dark-footer,
.sp-footer.tk-dark-footer,
.quote-footer.tk-dark-footer {
  align-items: center;
  background: #393a35;
  border: 0;
  border-radius: 34px 34px 0 0;
  color: #ffffff;
  display: grid;
  font-style: normal;
  margin: 0 24px;
  min-height: 92px;
  padding: 20px 34px;
  text-align: center;
}

.tk-dark-footer .quote-contact-row {
  gap: 12px 28px;
}

.tk-dark-footer .quote-contact-item {
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  gap: 7px;
  letter-spacing: 0.08em;
}

.quote-contact-label {
  color: #cbd88b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tk-business-address {
  color: #d4d5ce;
  font-size: 9px;
  letter-spacing: 0.06em;
  margin: 8px auto 0;
  max-width: 560px;
  white-space: pre-line;
}

.sp-quotation .tk-document-header {
  padding-bottom: 0;
}

.quote-meta {
  align-items: start;
  display: grid;
  gap: 38px;
  grid-template-columns: minmax(0, 0.85fr) minmax(350px, 1.15fr);
  margin: 40px 0 0;
  padding: 0 68px;
}

.quote-recipient {
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 4px;
  padding-left: 14px;
}

.quote-recipient strong {
  font-size: 16px;
}

.quote-recipient span {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.48;
}

.quote-doc-meta {
  display: grid;
  gap: 8px;
}

.quote-meta-line {
  align-items: baseline;
  display: grid;
  font-size: 12px;
  gap: 8px;
  grid-template-columns: 112px 7px minmax(0, 1fr);
  letter-spacing: 0.08em;
}

.quote-meta-line strong {
  text-align: left;
}

.quote-opening {
  font-size: 13px;
  line-height: 1.55;
  margin: 30px 68px 0;
}

.quote-opening p {
  margin-bottom: 8px;
}

.sp-quotation .tk-product-table {
  margin-top: 12px;
}

.quote-grand-row,
.quote-grand-row td {
  background: var(--accent) !important;
  color: #151711;
  font-size: 13px;
  font-weight: 900;
}

.quote-grand-row td:first-child {
  text-align: right;
}

.quote-terms {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  margin: 24px 68px 0;
}

.quote-terms > p {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.quote-terms ol {
  gap: 6px;
  padding-left: 20px;
}

.quote-document-bottom {
  padding-top: 18px;
}

@media (max-width: 760px) {
  .tk-logo-dashboard {
    height: 48px;
    width: 184px;
  }

  .brand-divider {
    height: 3px;
    min-height: 3px;
    width: 64px;
  }

  .local-mode-badge {
    flex: 1 1 100%;
    justify-content: center;
  }

  .sp-invoice,
  .sp-quotation {
    min-height: 1120px;
    padding: 40px 0 0;
  }

}

@media print {
  .sp-invoice,
  .sp-quotation {
    height: 297mm;
    margin: 0;
    min-height: 297mm;
    padding: 10mm 0 0;
    width: 210mm;
  }

  .tk-product-table th,
  .tk-product-table td,
  .sp-product-table th,
  .sp-product-table td,
  .quote-product-table th,
  .quote-product-table td,
  .quote-grand-row td,
  .sp-total-row,
  .sp-total-row.payment,
  .sp-total-row.due,
  .tk-dark-footer {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
