:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #17202a;
  --muted: #657282;
  --line: #d8dee6;
  --line-soft: #e8edf3;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c24141;
  --green: #15803d;
  --shadow: 0 1px 3px rgb(15 23 42 / 10%);
  --shadow-lift: 0 14px 34px rgb(15 23 42 / 14%);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgb(15 118 110 / 4%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(37 99 235 / 4%) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto;
  background-position: 0 0, 0 0, center;
  color: var(--text);
  font-size: 14px;
  animation: appGridDrift 26s linear infinite;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(260px, 360px);
  place-content: center;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background:
    repeating-linear-gradient(90deg, rgb(15 118 110 / 5%) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgb(37 99 235 / 5%) 0 1px, transparent 1px 48px),
    linear-gradient(135deg, rgb(15 118 110 / 8%), transparent 36%),
    linear-gradient(315deg, rgb(37 99 235 / 8%), transparent 32%),
    #e8edf3;
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  animation: screenTint 12s ease-in-out infinite alternate;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgb(15 23 42 / 16%);
  padding: 24px;
  animation: riseIn 520ms ease both;
  position: relative;
  overflow: hidden;
}

.login-motto {
  grid-column: 1 / -1;
  width: min(798px, 100%);
  display: grid;
  justify-self: center;
  gap: 5px;
  padding: 14px 18px;
  border: 1px solid rgb(15 118 110 / 18%);
  border-radius: 8px;
  background: rgb(255 255 255 / 68%);
  box-shadow: var(--shadow);
  text-align: center;
  animation: riseIn 420ms ease both, floatSoft 5600ms ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.login-motto::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--blue), transparent);
  animation: scanLine 3200ms linear infinite;
}

.login-motto p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.login-motto strong {
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0;
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 12%, rgb(255 255 255 / 52%) 18%, transparent 24%);
  transform: translateX(-120%);
  animation: surfaceSweep 5200ms ease-in-out infinite;
}

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

.login-panel form {
  display: grid;
  gap: 12px;
}

.login-button {
  width: 100%;
}

.signup-box {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.signup-box summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  list-style-position: inside;
}

.signup-box form {
  margin-top: 12px;
}

.login-preview {
  display: grid;
  gap: 10px;
  animation: riseIn 680ms ease both;
}

.preview-card {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgb(255 255 255 / 62%);
  border-radius: 8px;
  background: rgb(255 255 255 / 74%);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 760;
  transform: translateX(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: cardCascade 560ms ease both, floatSoft 5200ms ease-in-out infinite;
}

.preview-card:hover {
  transform: translateX(4px) translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.preview-card:nth-child(2) {
  animation-delay: 70ms;
}

.preview-card:nth-child(3) {
  animation-delay: 140ms;
}

.preview-card:nth-child(4) {
  animation-delay: 210ms;
}

.preview-card.accent {
  border-color: rgb(15 118 110 / 24%);
  background: #f0fdfa;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  isolation: isolate;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--blue), transparent);
  animation: scanLine 3600ms linear infinite;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  white-space: nowrap;
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgb(15 118 110 / 20%), transparent 28%),
    #111827;
  color: #e5e7eb;
  padding: 16px 12px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 14px);
  opacity: 0.55;
  animation: railDrift 18s linear infinite;
}

.nav {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.nav button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: background 180ms ease, transform 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.nav button::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.nav button:hover,
.nav button.active {
  background: rgb(255 255 255 / 10%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%);
}

.nav button:hover::before,
.nav button.active::before {
  transform: scaleY(1);
}

.nav button:hover {
  transform: translateX(3px);
}

.nav button:hover .icon,
.nav button.active .icon {
  animation: iconBob 720ms ease both;
}

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

.page-motion {
  animation: pageIn 360ms ease both;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.page-meta {
  margin: 5px 0 0;
  color: var(--muted);
}

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

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

.grid > * {
  min-width: 0;
}

.metric-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.quick-action {
  min-height: 58px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  box-shadow: var(--shadow);
  font-weight: 760;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.quick-action::after,
.btn::after,
.icon-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 16%, rgb(255 255 255 / 46%) 24%, transparent 34%);
  transform: translateX(-130%);
}

.quick-action:hover::after,
.btn:hover::after,
.icon-btn:hover::after {
  animation: actionSweep 760ms ease;
}

.quick-action:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: #b8c4d0;
}

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

.two-col {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.split-col {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.partners-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.settings-wide {
  grid-column: 1 / -1;
  min-width: 0;
}

.surface,
.metric,
.record-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  animation: riseIn 420ms ease both;
}

.surface:hover,
.record-card:hover {
  border-color: #c9d3df;
  box-shadow: var(--shadow-lift);
}

.surface:hover {
  transform: translateY(-1px);
}

.surface {
  padding: 16px;
}

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

.surface-head h2,
.surface h2 {
  margin: 0;
  font-size: 16px;
}

.list-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.list-summary span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.partners-list-surface table {
  min-width: 820px;
}

.metric {
  min-height: 112px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.metric::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 8%, rgb(255 255 255 / 42%) 14%, transparent 22%);
  transform: translateX(-120%);
  animation: surfaceSweep 6400ms ease-in-out infinite;
}

.metric[data-action] {
  cursor: pointer;
}

.revenue-details {
  margin-top: 14px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--muted);
}

.metric-green::before {
  background: var(--green);
}

.metric-amber::before {
  background: var(--amber);
}

.metric-blue::before {
  background: var(--blue);
}

.metric-red::before {
  background: var(--red);
}

.metric:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: #c4ceda;
}

.metric-label {
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-value {
  font-size: 23px;
  font-weight: 760;
  line-height: 1.15;
}

.metric-note {
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: var(--muted);
  animation: dotPulse 1800ms ease-in-out infinite;
}

.status-dot.green {
  background: var(--green);
}

.status-dot.amber {
  background: var(--amber);
}

.status-dot.red {
  background: var(--red);
}

.btn,
.icon-btn {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 140ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.icon-btn {
  width: 36px;
  padding: 0;
}

.text-icon {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.btn:hover,
.icon-btn:hover {
  border-color: #b6c0cc;
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn:active,
.icon-btn:active,
.quick-action:active {
  transform: translateY(1px) scale(0.99);
}

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

.btn.primary:hover {
  background: var(--primary-strong);
}

.btn.danger {
  color: var(--red);
}

.btn.compact {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.segmented button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.segmented button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgb(15 23 42 / 10%);
}

.compact-date-filter {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compact-date-filter label {
  display: grid;
  gap: 3px;
}

.compact-date-filter input {
  width: 142px;
  min-height: 30px;
  height: 30px;
  padding: 4px 8px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-size: inherit;
}

.summary-link strong {
  color: var(--text);
}

.icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 17px;
}

.icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.field,
.form-grid label {
  display: grid;
  gap: 6px;
}

.field span,
.form-grid label span {
  color: var(--muted);
  font-size: 12px;
}

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

.check-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.remember-login {
  padding: 2px 0 4px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 36px;
  padding: 8px 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgb(15 118 110 / 18%);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgb(15 118 110 / 10%);
  transform: translateY(-1px);
}

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

.col-2 {
  grid-column: span 2;
}

.col-3 {
  grid-column: span 3;
}

.col-4 {
  grid-column: span 4;
}

.col-5 {
  grid-column: span 5;
}

.col-6 {
  grid-column: span 6;
}

.col-8 {
  grid-column: span 8;
}

.col-12 {
  grid-column: span 12;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #fff;
}

.document-table th:last-child,
.document-table td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -8px 0 12px rgb(255 255 255 / 86%);
  z-index: 1;
}

.document-table th:last-child {
  background: #fbfcfd;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  background: #fbfcfd;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

tbody tr:hover {
  background: #f8fbff;
  transform: translateX(2px);
  box-shadow: inset 3px 0 0 var(--primary);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.strong {
  font-weight: 700;
}

.empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
}

.badge {
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.badge.green {
  border-color: #bbf7d0;
  color: var(--green);
  background: #f0fdf4;
}

.badge.amber {
  border-color: #fde68a;
  color: #9a5b12;
  background: #fffbeb;
}

.badge.red {
  border-color: #fecaca;
  color: var(--red);
  background: #fff1f2;
}

.badge.blue {
  border-color: #bfdbfe;
  color: var(--blue);
  background: #eff6ff;
}

.payment-status-table {
  min-width: 1180px;
}

.payment-amount-input {
  width: 120px;
  height: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.payment-check {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.payment-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-symbol {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 900;
  line-height: 1;
}

.payment-symbol.complete {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgb(21 128 61 / 10%);
}

.payment-symbol.open {
  color: #9a5b12;
  background: #fffbeb;
  border-color: #fde68a;
}

.payment-check:focus-within .payment-symbol {
  outline: 2px solid rgb(15 118 110 / 18%);
  outline-offset: 2px;
}

.export-declaration-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.export-declaration-group {
  display: grid;
  gap: 14px;
}

.export-declaration-record {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.export-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
}

.export-record-head strong,
.export-record-head span {
  display: block;
}

.export-record-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.export-record-total {
  font-weight: 900;
  white-space: nowrap;
}

.export-lines-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.export-lines-wrap tbody tr {
  cursor: pointer;
  user-select: none;
}

.export-lines-wrap tbody tr[data-declared="true"] {
  background: #fbfdfb;
}

.export-product-button {
  max-width: 320px;
  overflow-wrap: anywhere;
}

.export-declaration-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.export-declaration-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}

.export-declaration-check span {
  padding: 5px 8px;
  border-radius: 999px;
}

.export-declaration-check span.complete {
  color: #166534;
  background: #dcfce7;
}

.export-declaration-check span.open {
  color: #92400e;
  background: #fef3c7;
}

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

.line-editor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.35fr) 82px 112px 42px;
  gap: 8px;
  align-items: end;
}

.line-delete {
  align-self: end;
}

.totals {
  margin-left: auto;
  width: min(360px, 100%);
  display: grid;
  gap: 7px;
  padding-top: 12px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.total-line.final {
  font-size: 18px;
  font-weight: 800;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.chart {
  height: 240px;
  display: grid;
  grid-template-columns: repeat(6, minmax(50px, 1fr));
  gap: 10px;
  align-items: end;
  padding-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.bar-set {
  height: 100%;
  display: grid;
  align-items: end;
  gap: 6px;
  text-align: center;
}

.profit-bar-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.profit-bar-button:focus-visible {
  outline: 2px solid rgb(15 118 110 / 30%);
  outline-offset: 4px;
  border-radius: 8px;
}

.profit-detail-modal {
  width: min(1180px, 100%);
}

.payment-customer-modal {
  width: min(1180px, 100%);
}

.payment-customer-modal .surface {
  box-shadow: none;
}

.payment-capture-section {
  margin-top: 14px;
}

.capture-metrics {
  margin-bottom: 14px;
}

.bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: var(--primary);
  transform-origin: bottom;
  animation: barGrow 620ms ease both;
}

.bar.loss {
  background: var(--red);
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.record-card {
  padding: 12px;
  display: grid;
  gap: 8px;
}

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

.ai-hero {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 16px;
}

.ai-hero h2 {
  font-size: 20px;
}

.ai-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ai-chip-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgb(15 118 110 / 16%);
  border-radius: 999px;
  background: #f0fdfa;
  color: var(--primary);
  font-size: 12px;
  font-weight: 760;
}

.ai-layout {
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  align-items: start;
}

.ai-card-primary {
  grid-row: span 2;
}

.ai-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-output,
.ai-draft,
.ai-file-result {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.ai-output {
  white-space: pre-wrap;
  line-height: 1.5;
}

.ai-draft {
  display: grid;
  gap: 10px;
}

.ai-draft-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
}

.ai-draft-meta span,
.ai-draft-meta strong {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

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

.ai-line-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}

.ai-line-list div:last-child {
  border-bottom: 0;
}

.ai-advice-list {
  display: grid;
  gap: 10px;
}

.ai-advice {
  padding: 12px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ai-advice:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.ai-advice.high {
  border-color: #fecaca;
  background: #fff7f7;
}

.ai-advice.medium {
  border-color: #fde68a;
  background: #fffbeb;
}

.ai-advice.low {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.ai-mini-table {
  margin-top: 12px;
}

.ai-mini-table table {
  min-width: 620px;
}

.ai-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.ai-file-result pre {
  max-height: 180px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
  line-height: 1.45;
}

.doc-print {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(15 23 42 / 38%);
  backdrop-filter: blur(8px);
  animation: fadeIn 180ms ease both;
}

.modal-panel {
  width: min(1080px, 100%);
  max-height: min(86vh, 880px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 8px;
  box-shadow: 0 24px 72px rgb(15 23 42 / 28%);
  padding: 16px;
  animation: modalIn 220ms ease both;
}

.document-modal {
  width: min(1120px, 100%);
}

.sales-entry-backdrop {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 58px 24px 16px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.sales-entry-modal {
  width: min(760px, calc(100vw - 380px));
  max-height: calc(100vh - 78px);
  padding: 0;
  background: #f7f8fa;
  border: 1px solid #cfd8e5;
  box-shadow: 0 22px 58px rgb(15 23 42 / 24%);
  pointer-events: auto;
  overflow-anchor: none;
}

.doc-history-backdrop {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 86px 28px 24px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  z-index: 55;
}

.doc-history-modal {
  width: min(760px, calc(100vw - 64px));
  max-height: calc(100vh - 116px);
  pointer-events: auto;
}

.excel-download-modal {
  width: min(520px, calc(100vw - 40px));
}

.excel-download-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(248 250 252 / 88%);
}

.excel-download-summary span,
.excel-download-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.excel-download-actions .btn {
  justify-content: center;
}

.sales-window-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px 0 14px;
  background: #284bd6;
  color: #fff;
}

.sales-window-bar h2 {
  margin: 0;
  font-size: 15px;
}

.sales-window-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sales-window-actions .sales-window-save {
  height: 30px;
  border-color: rgb(255 255 255 / 72%);
  background: #fff;
  color: #284bd6;
  font-weight: 850;
}

.staff-hide-toggle {
  height: 30px;
  padding: 0 8px 0 6px;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  font-weight: 850;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease !important;
}

.staff-hide-toggle.checked {
  background: rgb(255 255 255 / 18%);
  border-color: rgb(255 255 255 / 72%);
  color: #fff;
}

.staff-hide-circle {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background 120ms ease, color 120ms ease !important;
}

.staff-hide-toggle svg {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

.staff-hide-label {
  line-height: 1;
}

.staff-hide-toggle:hover {
  background: rgb(255 255 255 / 22%);
}

.staff-hide-toggle.checked:hover {
  background: #fff;
}

.sales-window-actions .icon-btn {
  border-color: rgb(255 255 255 / 16%);
  background: transparent;
  color: #fff;
}

.sales-window-close {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%);
}

.sales-entry-form {
  padding: 10px 12px 12px;
}

.sales-title-row,
.sales-number-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sales-title-row {
  display: none;
}

.sales-title-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
}

.sales-star {
  color: #d6dbe4;
  font-size: 22px;
}

.sales-title-actions {
  display: flex;
  gap: 8px;
}

.sales-number-row {
  margin-bottom: 8px;
}

.sales-number-chip,
.sales-add-chip {
  height: 32px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.sales-number-chip {
  min-width: 68px;
  background: #284bd6;
  color: #fff;
  font-size: 16px;
}

.sales-add-chip {
  min-width: 52px;
  background: #e9eefc;
  color: #284bd6;
}

.sales-info-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 7px 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
}

.sales-field {
  display: grid;
  grid-template-columns: minmax(70px, 98px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sales-field > span {
  color: #687289;
  font-weight: 760;
  font-size: 13px;
  white-space: nowrap;
}

.sales-field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sales-info-panel input,
.sales-info-panel select,
.sales-info-panel textarea {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.sales-info-panel .icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.sales-date-control {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 8px minmax(58px, 0.82fr) 8px minmax(46px, 0.62fr) 34px;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.sales-date-control span {
  color: #111827;
  text-align: center;
  font-weight: 800;
}

.sales-type-field {
  display: none;
}

.sales-section-title,
.sales-wide-field {
  grid-column: 1 / -1;
}

.sales-section-title {
  margin-top: 0;
  padding-top: 4px;
  border-top: 1px solid #e6ebf2;
  color: #284bd6;
  font-size: 13px;
  font-weight: 850;
}

.sales-wide-field {
  grid-template-columns: minmax(70px, 98px) minmax(0, 1fr);
}

.sales-wide-field textarea {
  min-height: 42px;
  resize: vertical;
}

.sales-grid-wrap {
  overflow: auto;
  overflow-anchor: none;
  border: 1px solid #cfd6df;
  background: #fff;
}

.sales-grid-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  padding: 7px 0 0;
}

.sales-add-line-bottom {
  min-width: 118px;
  height: 34px;
  font-weight: 820;
}

.sales-file-upload {
  min-width: 132px;
  height: 34px;
  font-weight: 820;
}

.sales-file-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sales-entry-grid {
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: fixed;
  overflow-anchor: none;
}

.sales-entry-grid th,
.sales-entry-grid td {
  border: 1px solid #d8dee6;
  padding: 0;
  height: 36px;
  background: #fff;
}

.sales-entry-grid th {
  height: 38px;
  background: #fbfcfd;
  color: #111827;
  font-size: 13px;
  text-align: center;
}

.sales-entry-grid tfoot td {
  height: 34px;
  background: #f7f7f8;
  font-weight: 800;
}

.sales-entry-grid .line-row {
  display: table-row;
}

.sales-entry-grid input {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.sales-money-cell {
  padding: 0;
}

.sales-money-input {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.sales-money-input span {
  color: #687289;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.sales-entry-grid .sales-money-input input {
  min-height: 32px;
  padding-left: 2px;
}

.sales-entry-grid input:focus {
  transform: none;
  box-shadow: inset 0 0 0 2px rgb(40 75 214 / 30%);
}

.sales-check-col,
.sales-row-col {
  width: 44px;
}

.sales-row-action {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #dc2626;
  font-weight: 900;
}

.sales-row-action .icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.sales-row-action .icon svg {
  width: 15px;
  height: 15px;
}

.sales-row-action:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.sales-row-number {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #9aa3b2;
  font-weight: 760;
}

.modal-head {
  position: sticky;
  top: -16px;
  z-index: 2;
  padding: 0 0 12px;
  background: linear-gradient(180deg, var(--panel) 74%, rgb(255 255 255 / 0));
}

.print-paper {
  width: 297mm;
  min-height: 210mm;
  margin: 0 auto;
  padding: 8mm;
  background: white;
  box-sizing: border-box;
}

.trade-print {
  color: #000;
  font-family: Arial, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.trade-top {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 9mm;
  align-items: end;
}

.trade-title {
  margin: 0 0 8mm;
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
}

.trade-recipient {
  min-height: 29mm;
  display: grid;
  place-items: center;
  border: 2px solid #000;
  font-size: 19px;
  font-weight: 800;
}

.trade-recipient span {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
}

.trade-supplier-block {
  display: grid;
  grid-template-columns: 10mm 1fr;
  border: 2px solid #000;
}

.trade-supplier-side {
  display: grid;
  place-items: center;
  border-right: 2px solid #000;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
}

.trade-supplier-table,
.trade-lines,
.trade-summary {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.trade-supplier-table th,
.trade-supplier-table td,
.trade-lines th,
.trade-lines td,
.trade-summary th,
.trade-summary td {
  border: 1.5px solid #000;
  padding: 5px 7px;
  color: #000;
  vertical-align: middle;
}

.trade-supplier-table th {
  width: 30mm;
  background: #f3f3f3;
  text-align: center;
  font-weight: 900;
}

.trade-supplier-table td {
  font-size: 17px;
  font-weight: 700;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.trade-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3mm 0;
  padding: 4px 8mm;
  border: 3px solid #000;
  font-size: 22px;
  font-weight: 900;
}

.trade-amount span {
  font-size: 23px;
}

.trade-lines {
  border: 2px solid #000;
  outline: 1px solid #000;
  outline-offset: -1px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.trade-lines th {
  height: 11mm;
  background: #f3f3f3;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  word-break: keep-all;
}

.trade-lines td {
  height: 9mm;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.trade-lines thead th {
  border-top: 2px solid #000;
}

.trade-lines th:first-child,
.trade-lines td:first-child {
  border-left: 2px solid #000;
}

.trade-lines th:last-child,
.trade-lines td:last-child {
  border-right: 2px solid #000;
}

.trade-lines tbody tr:last-child td {
  border-bottom: 2px solid #000 !important;
}

.trade-lines th:nth-child(1),
.trade-lines td:nth-child(1) {
  width: 18mm;
  text-align: center;
}

.trade-lines th:nth-child(2),
.trade-lines td:nth-child(2) {
  width: 26mm;
}

.trade-lines th:nth-child(3),
.trade-lines td:nth-child(3) {
  width: auto;
}

.trade-lines th:nth-child(4),
.trade-lines td:nth-child(4),
.trade-lines th:nth-child(5),
.trade-lines td:nth-child(5) {
  width: 18mm;
}

.trade-lines th:nth-child(6),
.trade-lines td:nth-child(6),
.trade-lines th:nth-child(7),
.trade-lines td:nth-child(7),
.trade-lines th:nth-child(8),
.trade-lines td:nth-child(8) {
  width: 24mm;
}

.trade-lines th:nth-child(9),
.trade-lines td:nth-child(9) {
  width: 28mm;
}

.trade-summary {
  margin-top: 3mm;
  border: 2px solid #000;
  outline: 1px solid #000;
  outline-offset: -1px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.trade-summary tr:first-child th,
.trade-summary tr:first-child td {
  border-top: 2px solid #000;
}

.trade-summary th,
.trade-summary td {
  height: 10mm;
  font-size: 18px;
  font-weight: 900;
}

.trade-summary th {
  width: 17mm;
  text-align: center;
  background: #f7f7f7;
}

.trade-summary td {
  width: 35mm;
}

.trade-summary .trade-sign {
  width: 34mm;
  text-align: right;
  padding-right: 10px;
}

.trade-note {
  margin: 4mm 0 0;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 8px;
  color: white;
  background: #111827;
  box-shadow: 0 10px 28px rgb(15 23 42 / 24%);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardCascade {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes barGrow {
  from {
    transform: scaleY(0.08);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes dotPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 0 4px transparent;
  }
}

@keyframes appGridDrift {
  from {
    background-position: 0 0, 0 0, center;
  }
  to {
    background-position: 42px 42px, -42px 42px, center;
  }
}

@keyframes railDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 42px 42px;
  }
}

@keyframes scanLine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes actionSweep {
  from {
    transform: translateX(-130%);
  }
  to {
    transform: translateX(130%);
  }
}

@keyframes surfaceSweep {
  0%,
  54% {
    transform: translateX(-120%);
  }
  72%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes floatSoft {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -3px;
  }
}

@keyframes iconBob {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-2px);
  }
}

@keyframes screenTint {
  from {
    background-position: 0 0, 0 0, 0% 0%, 100% 100%, center;
  }
  to {
    background-position: 48px 24px, -48px 24px, 24px 18px, calc(100% - 24px) calc(100% - 18px), center;
  }
}

*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.login-panel::after,
.login-motto::after,
.topbar::after,
.quick-action::after,
.btn::after,
.icon-btn::after,
.metric::after {
  display: none !important;
}

.preview-card:hover,
.nav button:hover,
.nav button:hover::before,
.nav button.active::before,
.quick-action:hover,
.quick-action:active,
.btn:hover,
.btn:active,
.icon-btn:hover,
.icon-btn:active,
.surface:hover,
.record-card:hover,
.metric:hover,
.ai-advice:hover,
tbody tr:hover,
input:focus,
select:focus,
textarea:focus {
  transform: none !important;
}

tbody tr:hover {
  box-shadow: none;
}

@media (max-width: 1180px) {
  .sales-entry-backdrop {
    padding: 64px 16px 16px;
  }

  .doc-history-backdrop {
    padding: 76px 16px 16px;
  }

  .sales-entry-modal {
    width: min(720px, calc(100vw - 56px));
    max-height: calc(100vh - 78px);
  }

  .doc-history-modal {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 96px);
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .two-col,
  .split-col,
  .partners-layout,
  .export-declaration-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sales-entry-backdrop {
    padding: 58px 10px 10px;
  }

  .sales-entry-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 68px);
  }

  .doc-history-backdrop {
    padding: 58px 10px 10px;
  }

  .doc-history-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 68px);
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-motto {
    width: min(420px, 100%);
    padding: 12px 14px;
  }

  .login-motto p {
    font-size: 14px;
  }

  .login-preview {
    width: min(420px, 100%);
  }

  .topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    padding: 12px;
  }

  .brand {
    min-width: 0;
  }

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

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

  .sidebar {
    position: sticky;
    top: 65px;
    z-index: 10;
    overflow-x: auto;
    padding: 8px;
    max-width: 100vw;
  }

  .nav {
    display: flex;
    min-width: 0;
    width: max-content;
  }

  .nav button {
    width: auto;
  }

  .main {
    padding: 14px;
  }

  .page-head {
    display: grid;
  }

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

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .ai-hero,
  .ai-layout,
  .ai-inline-form {
    grid-template-columns: 1fr;
  }

  .ai-chip-row {
    justify-content: flex-start;
  }

  .sales-entry-form {
    padding: 10px;
  }

  .sales-info-panel {
    grid-template-columns: 1fr;
    padding: 10px;
  }

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

  .sales-field-action {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .sales-date-control {
    grid-template-columns: 1fr auto 1fr auto 52px 34px;
  }

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

  .form-grid > * {
    grid-column: 1 / -1 !important;
  }

  .line-row {
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
  }

  .line-row .icon-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: white;
  }

  .app {
    display: none !important;
  }

  .doc-print {
    display: block !important;
  }

  @page {
    size: A4 landscape;
    margin: 0;
  }
}
