/* =========================================================
   明亮票据工作台
   Layout: fixed brand header + left function rail + main canvas
   ========================================================= */

:root {
  --header-h: 52px;
  --sidebar-w: 184px;
  --navy-950: #061b2e;
  --navy-900: #08243c;
  --navy-850: #0a2b49;
  --navy-800: #0d3353;
  --navy-700: #164b70;
  --blue-700: #155f8e;
  --blue-600: #1a74aa;
  --blue-500: #2485bf;
  --magenta: #f04483;
  --gold: #e9b46d;
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #1e2d3b;
  --ink-soft: #435465;
  --muted: #71808f;
  --muted-light: #95a2ae;
  --line: #dde5ed;
  --line-soft: #edf1f5;
  --danger: #c13b32;
  --danger-soft: #fff5f3;
  --success: #247a52;
  --serif: "Songti SC", "SimSun", "STSong", "Noto Serif CJK SC", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
  --shadow-sm: 0 2px 8px rgba(19, 47, 71, 0.04);
  --shadow-md: 0 12px 32px rgba(19, 47, 71, 0.07);
  --shadow-paper: 0 22px 48px rgba(28, 49, 68, 0.11), 0 2px 5px rgba(28, 49, 68, 0.04);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

::selection {
  background: rgba(31, 121, 178, 0.2);
}

:focus-visible {
  outline: 2px solid rgba(25, 120, 177, 0.75);
  outline-offset: 2px;
}

/* =========================================================
   Header
   ========================================================= */

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 0 clamp(14px, 2vw, 28px);
  color: #fff;
  background:
    radial-gradient(ellipse at 16% -20%, rgba(74, 138, 188, 0.38), transparent 47%),
    radial-gradient(ellipse at 88% 130%, rgba(30, 92, 136, 0.38), transparent 50%),
    linear-gradient(104deg, var(--navy-950) 0%, #0a2d4d 52%, #0b3153 100%);
  box-shadow: 0 10px 30px rgba(5, 22, 37, 0.2);
  isolation: isolate;
}

.app-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.3;
  background-image:
    linear-gradient(115deg, transparent 0 31%, rgba(255, 255, 255, 0.035) 31.2% 31.5%, transparent 31.7%),
    linear-gradient(115deg, transparent 0 63%, rgba(255, 255, 255, 0.025) 63.2% 63.5%, transparent 63.7%),
    radial-gradient(rgba(255, 255, 255, 0.2) 0.6px, transparent 0.7px);
  background-size: auto, auto, 7px 7px;
  pointer-events: none;
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(238, 181, 108, 0.52) 28%, rgba(240, 68, 131, 0.45) 50%, rgba(238, 181, 108, 0.42) 72%, transparent);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 82px;
  height: 42px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.22));
}

.brand-rule {
  width: 1px;
  height: 24px;
  flex: none;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.brand-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
  margin: 0;
  font-size: clamp(16px, 1.35vw, 19px);
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.brand-shop {
  color: var(--magenta);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.brand-doc {
  color: #fff;
  white-space: nowrap;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: rgba(233, 242, 250, 0.68);
  font-size: 10.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.header-date,
.local-note {
  display: flex;
  align-items: center;
  gap: 7px;
}

.header-date .icon,
.local-note .icon {
  width: 14px;
  height: 14px;
  opacity: 0.72;
}

.header-separator {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.18);
}

/* =========================================================
   Shell / Sidebar
   ========================================================= */

.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  min-height: 548px;
  padding: 22px 14px 14px;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(48, 112, 160, 0.2), transparent 42%),
    linear-gradient(180deg, #0b2c49 0%, #08263f 56%, #061f35 100%);
  border-right: 1px solid rgba(1, 18, 31, 0.28);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 22px;
}

.sidebar-eyebrow {
  color: rgba(236, 244, 251, 0.45);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  white-space: nowrap;
}

.sidebar-heading-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent);
}

.primary-nav,
.system-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-label {
  margin: 4px 11px 7px;
  color: rgba(225, 238, 248, 0.38);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.system-nav {
  position: relative;
  padding-top: 13px;
}

.system-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 9px;
  right: 9px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 47px;
  padding: 5px 11px;
  color: rgba(235, 244, 252, 0.76);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(100deg, rgba(42, 112, 159, 0.86), rgba(26, 78, 116, 0.78));
  border-color: rgba(123, 183, 224, 0.19);
  box-shadow:
    inset 3px 0 0 var(--gold),
    0 8px 18px rgba(1, 19, 33, 0.16);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  color: rgba(229, 241, 250, 0.68);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  transition: color 160ms ease, background 160ms ease;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover .nav-icon,
.nav-item.is-active .nav-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.is-active .nav-icon {
  color: #f0c387;
}

.nav-text {
  min-width: 0;
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  color: rgba(235, 244, 252, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.nav-item.is-active .nav-badge {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-grow {
  flex: 1;
  min-height: 28px;
}

.sidebar-archive {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 11px;
}

.archive-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: rgba(232, 243, 251, 0.56);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}

.archive-mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-archive.is-ready .archive-mark {
  color: #9edbb5;
  background: rgba(103, 190, 139, 0.12);
}

.archive-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.archive-label {
  margin-bottom: 2px;
  color: rgba(226, 238, 248, 0.4);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.archive-copy strong {
  overflow: hidden;
  color: rgba(244, 249, 253, 0.88);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-copy > span:last-child {
  overflow: hidden;
  margin-top: 2px;
  color: rgba(222, 237, 248, 0.4);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-pick {
  display: grid;
  place-items: center;
  width: 24px;
  height: 26px;
  padding: 0;
  color: rgba(237, 246, 253, 0.44);
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
}

.archive-pick:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.archive-pick svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 2px 1px;
  color: rgba(219, 234, 245, 0.27);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}

/* =========================================================
   Main / page header
   ========================================================= */

.main-content {
  min-width: 0;
  padding: 20px clamp(18px, 2.6vw, 36px) 46px;
  overflow-x: clip;
  background:
    radial-gradient(850px 380px at 45% -180px, rgba(78, 145, 193, 0.12), transparent 65%),
    var(--bg);
}

.view {
  display: none;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.view.is-active {
  display: block;
  animation: view-in 260ms ease-out both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
}

.page-heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: #376e95;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.page-heading h2 {
  margin: 0;
  color: #132b3d;
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.page-description {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2385bf, #176a9b);
  border-color: #176693;
  box-shadow: 0 5px 14px rgba(19, 95, 140, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #268fc9, #186f9f);
  box-shadow: 0 7px 18px rgba(19, 95, 140, 0.25);
}

.btn-soft {
  color: #185f88;
  background: #edf6fc;
  border-color: #d2e7f5;
}

.btn-soft:hover {
  background: #e2f2fb;
  border-color: #bcdcee;
}

.btn-quiet {
  color: #486073;
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(24, 48, 70, 0.03);
}

.btn-quiet:hover {
  color: #1f506f;
  background: #fbfdff;
  border-color: #c9d8e4;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
  border-color: #b33129;
}

.btn-danger:hover {
  background: #b3352c;
}

.btn-danger-quiet {
  color: #a7473f;
}

.btn-danger-quiet:hover {
  color: #9c2e25;
  background: #fff9f8;
  border-color: #edc9c5;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  color: #637485;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.icon-btn:hover {
  color: #273e51;
  background: #f4f7fa;
  border-color: #e7edf3;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 1px;
  color: #176c9d;
  background: none;
  border: 0;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  transition: color 150ms ease;
}

.text-btn:hover {
  color: #0e527d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn .icon {
  width: 13px;
  height: 13px;
}

.text-btn-danger {
  color: #aa4941;
}

.text-btn-danger:hover {
  color: #8f2d24;
}

/* =========================================================
   Sales ticket stage
   ========================================================= */

.receipt-stage {
  position: relative;
  padding: 12px clamp(12px, 1.9vw, 22px) 14px;
  overflow: hidden;
  background-color: #eef2f6;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 38%),
    radial-gradient(rgba(110, 138, 161, 0.13) 0.7px, transparent 0.75px);
  background-size: auto, 15px 15px;
  border: 1px solid #dfe6ee;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(24, 57, 83, 0.055);
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 32px;
}

.stage-caption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  color: #a54941;
  font-size: 11.5px;
  line-height: 1.6;
}

.stage-caption strong {
  color: #b73e34;
  font-weight: 600;
}

.caption-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  background: #d8554c;
  border-radius: 999px;
}

.caption-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(216, 85, 76, 0.28);
  border-radius: inherit;
}

.paper-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  color: #587083;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(204, 216, 227, 0.85);
  border-radius: 999px;
  font-size: 10.5px;
  white-space: nowrap;
}

.paper-chip .icon {
  width: 13px;
  height: 13px;
}

.paper-shell {
  display: flex;
  justify-content: center;
  padding: 14px 0 20px;
}

.ticket-editor {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 948px;
  padding: 21px 32px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 70px),
    #fffefa;
  border: 1px solid #e4e2db;
  border-radius: 3px;
  box-shadow: var(--shadow-paper);
}

.ticket-editor::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 8%, rgba(199, 173, 130, 0.28), rgba(199, 173, 130, 0.12), transparent 92%);
}

.ticket-brand {
  text-align: center;
}

.ticket-brand h3 {
  margin: 0;
  color: #172632;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.ticket-brand p {
  margin: 3px 0 0;
  color: #4a5560;
  font-family: var(--serif);
  font-size: 14.5px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.ticket-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-top: 8px;
}

.field-inline {
  display: flex;
  align-items: center;
  min-width: 0;
}

.field-inline-label {
  flex: none;
  color: #293843;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 34px;
  white-space: nowrap;
}

.paper-input {
  height: 34px;
  padding: 4px 8px;
  color: #1c2b36;
  background: rgba(210, 73, 60, 0.03);
  border: 1px dashed rgba(199, 68, 55, 0.67);
  border-radius: 3px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.5;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.paper-input::placeholder {
  color: #b6aaa5;
  opacity: 1;
}

.paper-input:hover {
  border-color: rgba(186, 55, 42, 0.8);
  background: rgba(210, 73, 60, 0.045);
}

.paper-input:focus {
  background: #fff;
  border-color: #ba453b;
  border-style: solid;
  outline: none;
  box-shadow: 0 0 0 3px rgba(199, 68, 55, 0.1);
}

.paper-input.is-invalid {
  border-color: #b5271d;
  border-style: solid;
  background: #fff1ef;
  box-shadow: 0 0 0 3px rgba(181, 39, 29, 0.1);
}

.customer-input {
  width: clamp(190px, 31vw, 290px);
  max-width: 100%;
}

.date-input {
  width: 148px;
  font-family: var(--sans);
  font-size: 14.5px;
  color-scheme: light;
}

.meta-hints {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 5px;
}

.edit-hint {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin: 0;
  color: #b5534a;
  font-family: var(--sans);
  font-size: 10.5px;
  line-height: 1.6;
}

.hint-icon {
  width: 11px;
  height: 11px;
  flex: none;
  margin-top: 3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.hint-customer {
  padding-left: 48px;
}

.hint-right {
  text-align: right;
}

.hide-hints [data-hints],
.hide-hints .stage-head {
  display: none !important;
}

.table-block {
  min-width: 0;
  max-width: 100%;
  margin-top: 4px;
}

.table-hints {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 5px;
}

.table-scroller {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-radius: 2px;
  scrollbar-width: thin;
  scrollbar-color: #c7d2dc transparent;
  -webkit-overflow-scrolling: touch;
}

.mobile-scroll-hint {
  display: none;
  margin: 5px 0 0;
  color: #a56760;
  font-size: 9.5px;
  text-align: right;
}

.table-scroller::-webkit-scrollbar {
  height: 6px;
}

.table-scroller::-webkit-scrollbar-thumb {
  background: #ccd6de;
  border-radius: 8px;
}

.item-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #1c2a35;
  font-family: var(--sans);
  font-size: 12.5px;
}

.col-serial {
  width: 8.5%;
}

.col-name {
  width: 40%;
}

.col-unit {
  width: 9%;
}

.col-price {
  width: 13.5%;
}

.col-qty {
  width: 9.5%;
}

.col-amount {
  width: 14%;
}

.col-actions {
  width: 32px;
}

.item-table th {
  height: 31px;
  padding: 4px 6px;
  color: #26343e;
  background: transparent;
  border: 1px solid #59636c;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
}

.item-table td {
  height: 34px;
  padding: 2px 5px;
  vertical-align: middle;
  background: transparent;
  border: 1px solid #626b73;
}

.actions-head {
  background: transparent;
}

.item-table .actions-cell {
  padding: 0;
  text-align: center;
}

.item-table .serial-cell {
  color: #43515c;
  font-family: var(--sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.item-row:hover td {
  background: transparent;
}

.table-input {
  width: 100%;
  height: 26px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 12.5px;
}

.name-cell .table-input {
  text-align: left;
}

.unit-cell .table-input {
  text-align: center;
}

.price-cell {
  white-space: nowrap;
}

.price-cell .currency {
  display: inline-block;
  width: 10px;
  vertical-align: middle;
}

.price-cell .table-input {
  display: inline-block;
  width: calc(100% - 14px);
  min-width: 0;
  text-align: right;
  vertical-align: middle;
}

.qty-cell .table-input {
  text-align: center;
}

.currency {
  color: #7a858d;
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1;
}

.amount-cell {
  color: #26343e;
  font-family: var(--sans);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-right: 8px !important;
  text-align: right;
  white-space: nowrap;
}

.amount-cell .currency {
  margin-right: 2px;
  font-weight: 400;
}

.row-delete {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  color: #a8b3bc;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  opacity: 0.5;
  transition: color 150ms ease, background 150ms ease, opacity 150ms ease;
}

.row-delete:hover {
  color: #b03b32;
  background: #fff1ef;
  opacity: 1;
}

.item-row:hover .row-delete {
  opacity: 1;
}

.row-delete svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.item-table input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.item-table input[type="number"]::-webkit-outer-spin-button,
.item-table input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.item-table .is-invalid {
  border-color: #b5271d !important;
  background: #fff1ef !important;
  box-shadow: 0 0 0 2px rgba(181, 39, 29, 0.1) !important;
}

.item-table .total-row td {
  height: 43px;
  background: transparent;
  border-color: #4e5861;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
}

.item-table .total-row .serial-cell {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.uppercase-cell {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.uppercase-label {
  color: #394854;
}

#amountUpper {
  color: #202f3a;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.uppercase-guide {
  display: inline-block;
  margin-left: 8px;
  color: #bd6b62;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  vertical-align: 1px;
}

.item-table .total-amount-cell {
  padding-right: 8px;
  color: #1d2b36;
  font-family: var(--sans);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.total-amount-cell .currency {
  margin-right: 2px;
  font-size: 12px;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 28px;
  margin-top: 4px;
}

.add-row-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px 0 6px;
  color: #4b7188;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed #b8c9d6;
  border-radius: 5px;
  font-size: 10.5px;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.add-row-btn:hover {
  color: #185f87;
  background: #f6fbfd;
  border-color: #84b2cb;
}

.add-row-btn .icon {
  width: 13px;
  height: 13px;
}

.total-hint {
  text-align: right;
}

.ticket-info {
  margin-top: 10px;
  color: #33424d;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.6;
  text-align: left;
}

.account-line,
.business-lines p,
.service-line {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.account-line {
  margin-bottom: 2px;
  color: #24343f;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.business-lines > p,
.business-lines > div {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.service-line {
  margin-top: 1px;
}

.address-line {
  margin: 1px 0 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.editable-info {
  outline: none;
  cursor: text;
  border-radius: 3px;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.editable-info:hover {
  background: rgba(247, 242, 232, 0.72);
  box-shadow: 0 0 0 1px rgba(188, 164, 126, 0.25);
}

.editable-info:focus {
  background: #fffdf7;
  box-shadow: 0 0 0 2px rgba(35, 111, 153, 0.15);
}

.editable-info:empty::before {
  content: "点击填写";
  color: #aa9f92;
  font-family: var(--sans);
  font-size: 11px;
}

.ticket-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 6px;
  color: #929ca5;
  border-top: 1px dashed #dedbd4;
  font-family: var(--sans);
  font-size: 10.5px;
}

/* Print CTA and archive strip */
.print-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 1px 0 0;
}

.clear-ticket-btn {
  min-height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 11px;
}

.clear-ticket-btn .icon {
  width: 13px;
  height: 13px;
}

.print-preview-btn {
  min-width: 168px;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 9px;
  font-size: 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 20px rgba(20, 101, 148, 0.25);
}

.print-preview-btn .icon {
  width: 18px;
  height: 18px;
}

.print-explain {
  max-width: 650px;
  margin: 10px auto 0;
  color: #71808c;
  font-size: 10.5px;
  line-height: 1.8;
}

.inline-link {
  padding: 0;
  color: #236f99;
  background: none;
  border: 0;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(35, 111, 153, 0.35);
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: #0e527d;
  text-decoration-color: currentColor;
}

.inline-link:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.save-flow {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  max-width: 948px;
  margin: 15px auto 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(207, 218, 228, 0.85);
  border-radius: 10px;
}

.save-flow-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  color: #437e9f;
  background: #edf5fa;
  border-radius: 8px;
}

.save-flow-icon.is-ready {
  color: var(--success);
  background: #edf7f1;
}

.save-flow-icon .icon {
  width: 16px;
  height: 16px;
}

.save-flow-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.save-flow-copy strong {
  color: #415666;
  font-size: 11px;
  font-weight: 600;
}

.save-flow-copy span {
  overflow: hidden;
  color: #81909b;
  font-size: 10px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-flow .text-btn {
  flex: none;
}

/* =========================================================
   Panels / records
   ========================================================= */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.records-panel {
  overflow: hidden;
}

.records-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 100%);
  height: 38px;
  padding: 0 12px;
  color: #7b8a97;
  background: #f7f9fb;
  border: 1px solid #e3e9ef;
  border-radius: 8px;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.search-box:focus-within {
  background: #fff;
  border-color: #a7c9de;
  box-shadow: 0 0 0 3px rgba(35, 117, 164, 0.08);
}

.search-box .icon {
  width: 16px;
  height: 16px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #9aa7b2;
}

.search-box input::-webkit-search-cancel-button {
  opacity: 0.45;
}

.records-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--muted);
  font-size: 11px;
}

.summary-divider {
  width: 1px;
  height: 13px;
  background: #e5eaf0;
}

.records-grid-head {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 128px 152px;
  gap: 18px;
  padding: 9px 20px;
  color: #8b98a4;
  background: #f8fafb;
  border-bottom: 1px solid var(--line-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.records-list {
  min-height: 0;
}

.record-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 128px 152px;
  gap: 18px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 150ms ease;
}

.record-row:last-child {
  border-bottom: 0;
}

.record-row:hover {
  background: #fcfdfe;
}

.record-thumb {
  width: 152px;
  height: 95px;
  overflow: hidden;
  background: #f2f5f7;
  border: 1px solid #e2e8ed;
  border-radius: 7px;
  box-shadow: 0 3px 9px rgba(24, 48, 70, 0.04);
}

.record-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.record-thumb-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #a7b4bf;
}

.record-thumb-empty .icon {
  width: 21px;
  height: 21px;
}

.record-info {
  min-width: 0;
}

.record-customer-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 3px;
}

.record-customer-line h3 {
  overflow: hidden;
  margin: 0;
  color: #213648;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-date {
  color: #7b8a96;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.record-snippet {
  overflow: hidden;
  margin: 0;
  color: #82909b;
  font-size: 10.5px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.record-tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  color: #6c7d8b;
  background: #f4f7f9;
  border-radius: 4px;
  font-size: 9px;
}

.record-tag-saved {
  color: #2f7554;
  background: #eff8f2;
}

.record-money {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.record-money strong {
  color: #1f3445;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.record-money strong small {
  margin-right: 2px;
  color: #73818c;
  font-size: 10px;
  font-weight: 500;
}

.record-money span {
  color: #96a2ad;
  font-size: 9.5px;
}

.record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.record-actions .btn {
  min-height: 31px;
  padding: 0 10px;
  font-size: 10.5px;
}

.record-actions .btn .icon {
  width: 13px;
  height: 13px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 66px 24px 72px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 20px;
  color: #89a8bb;
  background: linear-gradient(145deg, #f5f9fc, #eaf2f7);
  border: 1px solid #dae6ee;
  border-radius: 23px;
  transform: rotate(-3deg);
}

.empty-illustration svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-plus {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: #277da9;
  border: 3px solid #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: #334a5c;
  font-size: 15px;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 20px;
  color: #8b98a3;
  font-size: 11.5px;
}

.empty-state .btn {
  min-height: 36px;
  font-size: 11.5px;
}

.records-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 62px;
  text-align: center;
}

.no-results-orb {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  color: #85a0b2;
  background: #f3f8fb;
  border: 1px solid #e1ebf1;
  border-radius: 14px;
}

.no-results-orb .icon {
  width: 20px;
  height: 20px;
}

.records-no-results h3 {
  margin: 0 0 5px;
  color: #3a5061;
  font-size: 13px;
  font-weight: 600;
}

.records-no-results p {
  margin: 0;
  color: #92a0aa;
  font-size: 10.5px;
}

/* =========================================================
   Required materials
   ========================================================= */

.materials-panel {
  padding: 18px 20px 16px;
}

.materials-folder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.materials-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.materials-folder-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: #4b89aa;
  background: #edf6fb;
  border: 1px solid #e0edf4;
  border-radius: 8px;
}

.materials-folder-icon .icon {
  width: 16px;
  height: 16px;
}

.materials-folder-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.materials-folder-label {
  color: #99a5af;
  font-size: 9px;
  letter-spacing: 0.06em;
}

#materialsFolderName {
  overflow: hidden;
  color: #405566;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materialsFolderStatus {
  overflow: hidden;
  color: #96a2ac;
  font-size: 9.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.materials-folder-actions .btn {
  min-height: 32px;
  flex: none;
  padding: 0 12px;
  font-size: 10.5px;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.material-card {
  --tone: #315b94;
  --tone-border: #335b8d;
  --tone-soft: #edf3fb;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 300px;
}

.material-card[data-tone="blue"] {
  --tone: #315b94;
  --tone-border: #335b8d;
  --tone-soft: #edf3fb;
}

.material-card[data-tone="red"] {
  --tone: #bb5366;
  --tone-border: #cf9aa5;
  --tone-soft: #fff4f5;
}

.material-title-input {
  width: 100%;
  height: 35px;
  padding: 2px 5px 8px;
  color: var(--tone);
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 3px;
  outline: none;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  transition: background 150ms ease, border-color 150ms ease;
}

.material-title-input[readonly] {
  cursor: default;
}

.material-title-input::placeholder {
  color: #a9b2bb;
  font-weight: 400;
}

.material-box {
  display: flex;
  flex: 1;
  min-height: 215px;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--tone-border);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.material-body-input {
  width: 100%;
  flex: 1;
  min-height: 156px;
  padding: 0;
  overflow: hidden;
  color: #35434e;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.material-body-input[readonly] {
  cursor: default;
}

.material-body-input::placeholder {
  color: #b0b8c0;
}

.material-card.is-editing .material-title-input {
  background: #fff;
  border-color: var(--tone-border);
}

.material-card.is-editing .material-box {
  box-shadow: 0 0 0 3px var(--tone-soft);
}

.material-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.material-btn {
  height: 25px;
  padding: 0 10px;
  color: #fff;
  background: #328dc6;
  border: 1px solid #328dc6;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.material-btn:hover {
  background: #2479ae;
  border-color: #2479ae;
  transform: translateY(-1px);
}

.material-btn:active {
  transform: translateY(0);
}

.material-btn-delete {
  color: #447a96;
  background: #f5fafd;
  border-color: #d7e7ef;
}

.material-btn-delete:hover {
  color: #a0443b;
  background: #fff6f4;
  border-color: #eed6d2;
}

.material-add-card {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 0;
  color: #9aa4ac;
  background: #fff;
  border: 1px dashed #aeb8c1;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 46px;
  font-weight: 200;
  line-height: 1;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.material-add-card:hover:not(:disabled) {
  color: #4f829e;
  background: #fbfdff;
  border-color: #709eb6;
}

.material-add-card:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.materials-help {
  margin-top: 18px;
  padding: 11px 13px;
  color: #667f93;
  background: #f4f9fd;
  border: 1px solid #e2eef6;
  border-radius: 7px;
  font-size: 10px;
  line-height: 1.8;
}

.materials-help p {
  margin: 0;
}

.materials-help strong {
  color: #295d80;
  font-weight: 600;
}

/* =========================================================
   Pension verification sheet
   ========================================================= */

.pension-panel {
  min-height: 430px;
  padding: 0;
  overflow: hidden;
}

.pension-image-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 24px;
  text-align: center;
}

.pension-image-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(460px, 100%);
  min-height: 230px;
  color: #9aa4ac;
  background: #fff;
  border: 1px dashed #aeb8c1;
  border-radius: 8px;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.pension-image-add:hover {
  color: #4f829e;
  background: #fbfdff;
  border-color: #709eb6;
}

.pension-image-add:disabled {
  cursor: default;
  opacity: 0.6;
}

.pension-image-add-plus {
  font-family: var(--sans);
  font-size: 58px;
  font-weight: 200;
  line-height: 1;
}

.pension-image-add-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pension-image-empty > p {
  max-width: 580px;
  margin: 14px 0 0;
  color: #95a1ab;
  font-size: 10.5px;
  line-height: 1.8;
}

.pension-image-content {
  width: 100%;
  background: #fff;
}

#pensionPreviewImage {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: #fff;
  user-select: none;
}

.pension-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 16px 20px 0;
}

.pension-actions .btn {
  min-width: 108px;
  min-height: 37px;
  font-size: 12px;
}

.pension-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.pension-note {
  margin: 9px 0 0;
  padding: 0 20px 16px;
  color: #9aa5ae;
  font-size: 9.5px;
  text-align: center;
}

/* =========================================================
   Proof documents
   ========================================================= */

.proofs-panel {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 22px;
}

.proofs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proof-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  border-radius: 3px;
}

.proof-row-title {
  flex: 1;
  min-width: 0;
  color: #101820;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proof-row-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 12px;
}

.proof-open-btn {
  min-width: 82px;
  height: 30px;
  padding: 0 13px;
  color: #fff;
  background: #2f8cc4;
  border: 1px solid #2f8cc4;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease;
}

.proof-open-btn:hover {
  background: #2578ab;
  border-color: #2578ab;
}

.proof-delete-btn {
  padding: 4px 2px;
  color: #a8b1b9;
  background: transparent;
  border: 0;
  font-size: 12px;
  white-space: nowrap;
  transition: color 150ms ease;
}

.proof-delete-btn:hover {
  color: #df6262;
}

.proof-tone-0 {
  background: #cfe3fa;
}

.proof-tone-1 {
  background: #d5f3e9;
}

.proof-tone-2 {
  background: #fdebc9;
}

.proof-tone-3 {
  background: #e8def8;
}

.proof-tone-4 {
  background: #f9dce6;
}

.proof-tone-5 {
  background: #d9f0f4;
}

.proofs-add-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.proofs-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 50px;
  color: #b7c0c8;
  background: transparent;
  border: 1px dashed #c9d1d8;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.proofs-add:hover {
  color: #4187aa;
  background: #f8fbfd;
  border-color: #a9c7d7;
}

@media (max-width: 860px) {
  .proofs-panel {
    padding: 18px;
  }

  .proof-row-title {
    font-size: 15px;
  }
}

@media (max-width: 700px) {
  .proofs-panel {
    padding: 14px;
  }

  .proof-row {
    min-height: 52px;
    padding: 9px 10px;
    gap: 8px;
  }

  .proof-row-actions {
    gap: 8px;
  }

  .proof-row-title {
    font-size: 14px;
  }

  .proof-open-btn {
    min-width: 72px;
    height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .proof-delete-btn {
    font-size: 11px;
  }

  .proofs-add {
    width: 170px;
    height: 46px;
  }
}

@media (max-width: 540px) {
  .proofs-panel {
    padding: 10px;
  }

  .proof-row {
    padding: 8px;
  }

  .proof-row-actions {
    gap: 6px;
  }

  .proof-row-title {
    font-size: 13px;
  }

  .proof-open-btn {
    min-width: 66px;
    height: 27px;
    padding: 0 7px;
    font-size: 9.5px;
  }

  .proof-delete-btn {
    font-size: 10px;
  }

  .proofs-add {
    width: 160px;
    height: 44px;
  }
}

/* =========================================================
   Settings
   ========================================================= */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 18px;
}

.settings-main,
.settings-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-side {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.settings-card {
  padding: 21px 22px 23px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-heading.compact {
  align-items: center;
  margin-bottom: 15px;
}

.panel-heading h3 {
  margin: 0;
  color: #273d4f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.panel-heading p {
  margin: 4px 0 0;
  color: #8b99a4;
  font-size: 10.5px;
  line-height: 1.7;
}

.section-number {
  flex: none;
  color: #dbe4eb;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-label {
  color: #526575;
  font-size: 11px;
  font-weight: 600;
}

.form-label em {
  margin-left: 4px;
  color: #a8b4be;
  font-size: 9px;
  font-style: normal;
  font-weight: 400;
}

.form-input {
  width: 100%;
  min-height: 39px;
  padding: 8px 11px;
  color: #243746;
  background: #fbfcfd;
  border: 1px solid #dde5ec;
  border-radius: 7px;
  outline: 0;
  font-size: 11.5px;
  line-height: 1.5;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:hover {
  border-color: #cad8e3;
}

.form-input:focus {
  background: #fff;
  border-color: #8fc1dd;
  box-shadow: 0 0 0 3px rgba(38, 122, 166, 0.08);
}

.form-input::placeholder {
  color: #aab5be;
}

.form-textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.75;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 5 5-5' fill='none' stroke='%237d8b97' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.form-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 14px 0 0;
  color: #93a0aa;
  font-size: 9.5px;
  line-height: 1.7;
}

.form-note .icon {
  width: 12px;
  height: 12px;
  flex: none;
  margin-top: 1px;
}

.settings-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  color: #fff;
  background:
    radial-gradient(ellipse at 70% -70%, rgba(83, 153, 199, 0.36), transparent 54%),
    linear-gradient(105deg, #0b2b46, #123e5d);
  border-radius: 11px;
  box-shadow: 0 10px 22px rgba(13, 42, 65, 0.12);
}

.settings-savebar p {
  margin: 0;
  color: rgba(231, 242, 250, 0.62);
  font-size: 10px;
  line-height: 1.6;
}

.settings-save-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.settings-savebar .btn {
  min-height: 33px;
  font-size: 10.5px;
}

.settings-savebar .btn-quiet {
  color: rgba(247, 251, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: none;
}

.settings-savebar .btn-quiet:hover {
  background: rgba(255, 255, 255, 0.1);
}

.settings-savebar .btn-primary {
  color: #183446;
  background: #f2c27d;
  border-color: #e5b26b;
  box-shadow: 0 4px 12px rgba(4, 22, 36, 0.18);
}

.settings-savebar .btn-primary:hover {
  background: #f7cd90;
}

.folder-card {
  position: relative;
  overflow: hidden;
}

.folder-card::before {
  content: "";
  position: absolute;
  top: -55px;
  right: -40px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(48, 126, 169, 0.08), transparent 68%);
  border-radius: 50%;
  pointer-events: none;
}

.folder-orb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: #4c8bad;
  background: #f0f7fb;
  border: 1px solid #e1eef5;
  border-radius: 11px;
}

.folder-orb.is-ready {
  color: #377b58;
  background: #f0f8f3;
  border-color: #deefe4;
}

.folder-orb .icon {
  width: 19px;
  height: 19px;
}

.folder-display {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  background: #f8fafc;
  border: 1px solid #e9eef3;
  border-radius: 8px;
}

.folder-display > .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: #8aa2b4;
}

.folder-display > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.folder-display strong {
  overflow: hidden;
  color: #3d5364;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-display span {
  color: #95a1ab;
  font-size: 9.5px;
  line-height: 1.5;
}

.folder-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.folder-actions .btn {
  min-height: 32px;
  font-size: 10.5px;
}

.folder-help {
  margin: 11px 0 0;
  color: #9aa6b0;
  font-size: 9.5px;
  line-height: 1.7;
}

.tip-card {
  padding: 19px 19px 20px;
  background: linear-gradient(145deg, #fffdf8, #fbf6ec);
  border-color: #eee3d1;
}

.tip-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 11px;
  color: #a67d45;
  background: #f9efde;
  border-radius: 9px;
}

.tip-icon .icon {
  width: 16px;
  height: 16px;
}

.tip-card h3 {
  margin: 0 0 6px;
  color: #6e5c42;
  font-size: 12px;
  font-weight: 600;
}

.tip-card p {
  margin: 0;
  color: #9a8c78;
  font-size: 10px;
  line-height: 1.8;
}

.shortcut-card {
  padding: 20px;
  color: #fff;
  background:
    radial-gradient(ellipse at 95% 0%, rgba(54, 124, 171, 0.35), transparent 50%),
    linear-gradient(145deg, #0c2d48, #103c5a);
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(10, 38, 59, 0.14);
}

.shortcut-kicker {
  display: block;
  margin-bottom: 8px;
  color: #d8ae74;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.shortcut-card h3 {
  margin: 0 0 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.shortcut-card p {
  margin: 0;
  color: rgba(228, 240, 249, 0.58);
  font-size: 10px;
  line-height: 1.85;
}

/* =========================================================
   Dialogs
   ========================================================= */

.dialog {
  width: min(1000px, calc(100vw - 30px));
  max-width: none;
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 15px;
  box-shadow: 0 32px 90px rgba(2, 18, 31, 0.38);
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 210ms ease-out both;
}

.dialog::backdrop {
  background: rgba(5, 22, 37, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

body:has(dialog[open]) {
  overflow: hidden;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 17px 21px 15px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-heading .eyebrow {
  margin-bottom: 3px;
  font-size: 8.5px;
  letter-spacing: 0.17em;
}

.dialog-heading h2 {
  margin: 0;
  color: #1e3344;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 13px 20px;
  background: #fff;
  border-top: 1px solid var(--line-soft);
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dialog-actions .btn {
  min-height: 36px;
  font-size: 11.5px;
}

.preview-dialog {
  width: min(1120px, calc(100vw - 28px));
  height: min(850px, calc(100vh - 30px));
}

.preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #f4f7fa;
}

.preview-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  overflow: auto;
  padding: 24px;
  background-color: #eef2f5;
  background-image: radial-gradient(rgba(92, 122, 145, 0.16) 0.65px, transparent 0.7px);
  background-size: 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: #c6d1da transparent;
}

.preview-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #e8edf2;
}

.preview-summary {
  padding: 15px;
  background: #f7f9fb;
  border: 1px solid #edf1f4;
  border-radius: 10px;
}

.preview-label {
  display: block;
  margin-bottom: 5px;
  color: #8c9aa5;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.preview-summary > strong {
  display: block;
  color: #23394b;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.preview-meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: #84939e;
  font-size: 10px;
}

.dot-separator {
  width: 2px;
  height: 2px;
  background: #a9b4bd;
  border-radius: 50%;
}

.preview-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #e6ebef;
}

.preview-total > span {
  color: #7a8b97;
  font-size: 10px;
}

.preview-total strong {
  color: #a63c32;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.preview-savebox {
  padding: 13px;
  border: 1px solid #e6ecf1;
  border-radius: 10px;
}

.savebox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4f7e64;
  background: #eff8f2;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 600;
}

.status-pill .status-dot {
  width: 4px;
  height: 4px;
  background: #4f9b71;
  border-radius: 50%;
}

.status-pill.is-warning {
  color: #a16b2e;
  background: #fff8ec;
}

.status-pill.is-warning .status-dot {
  background: #d59339;
}

.preview-savebox > p {
  margin: 8px 0 11px;
  color: #7f8e99;
  font-size: 9.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.preview-filename,
.preview-paperline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #f0f3f6;
  color: #96a2ac;
  font-size: 9.5px;
}

.preview-filename + .preview-paperline {
  margin-top: 8px;
}

.preview-filename code {
  max-width: 170px;
  color: #5d7180;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 9px;
  line-height: 1.55;
  text-align: right;
  overflow-wrap: anywhere;
}

.preview-paperline span:last-child {
  color: #5d7180;
  text-align: right;
}

.preview-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 11px;
  color: #71828f;
  background: #f4f9fc;
  border: 1px solid #e5eff5;
  border-radius: 8px;
}

.preview-note .icon {
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 1px;
  color: #6894ad;
}

.preview-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.7;
}

.preview-status {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.preview-status.is-error {
  color: #a4382f;
}

.preview-status.is-success {
  color: #377a58;
}

.preview-status.is-warning {
  color: #9a672d;
}

.preview-doc {
  width: min(100%, 760px);
  flex: none;
}

/* =========================================================
   Static ticket document (preview / print / record)
   ========================================================= */

.ticket-doc {
  padding: 18px 24px 12px;
  color: #1f2b34;
  background: #fffefa;
  border: 1px solid #e6e3dc;
  border-radius: 2px;
  box-shadow: 0 16px 38px rgba(35, 53, 68, 0.13);
  font-family: var(--serif);
}

.doc-head {
  text-align: center;
}

.doc-head h3 {
  margin: 0;
  color: #182630;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.35;
}

.doc-head p {
  margin: 3px 0 0;
  color: #4b5761;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.doc-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0 3px;
  color: #33414c;
  font-size: 12.5px;
  line-height: 1.55;
}

.doc-meta b {
  color: #1e2b35;
  font-weight: 700;
}

.doc-meta .doc-customer {
  min-width: 0;
  overflow-wrap: anywhere;
}

.doc-meta .doc-date {
  flex: none;
  font-family: var(--sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #202d37;
  font-size: 11px;
}

.doc-table th,
.doc-table td {
  padding: 4px 6px;
  border: 0.5px solid #000;
  vertical-align: middle;
}

.doc-table th {
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: center;
}

.doc-table td {
  height: 25px;
}

.doc-table .doc-serial {
  text-align: center;
  color: #46545e;
  font-family: var(--sans);
  font-size: 10px;
}

.doc-table .doc-number {
  font-family: var(--sans);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.doc-table .doc-unit {
  text-align: center;
}

.doc-table .doc-total-row td {
  height: 32px;
  background: transparent;
  border-color: #000;
  font-size: 11px;
  font-weight: 600;
}

.doc-table .doc-total-row .doc-upper {
  overflow: hidden;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-table .doc-total-row .doc-upper strong {
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  font-size: 11.5px;
}

.doc-table .doc-total-row .doc-total-amount {
  color: #1e2b35;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
}

.doc-info {
  margin-top: 10px;
  color: #33424c;
  font-size: 12px;
  line-height: 1.65;
  text-align: left;
}

.doc-info p {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

.doc-info .doc-account {
  margin-bottom: 2px;
  color: #26343e;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.doc-info .doc-service {
  margin-top: 1px;
}

.doc-info .doc-address {
  margin-top: 1px;
}

.doc-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 8px;
  padding-top: 5px;
  color: #929ca4;
  border-top: 1px dashed #dedbd4;
  font-family: var(--sans);
  font-size: 9.5px;
}

/* =========================================================
   Record detail dialog
   ========================================================= */

.record-dialog {
  width: min(1000px, calc(100vw - 30px));
}

.record-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #f4f7fa;
}

.record-image-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 390px;
  overflow: auto;
  padding: 22px;
  background-color: #eef2f5;
  background-image: radial-gradient(rgba(92, 122, 145, 0.16) 0.65px, transparent 0.7px);
  background-size: 14px 14px;
}

.record-image-wrap img {
  display: block;
  width: min(100%, 540px);
  height: auto;
  background: #fff;
  border: 1px solid #e7e2d9;
  box-shadow: 0 14px 30px rgba(30, 50, 66, 0.13);
}

.record-image-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #a5b1bb;
  font-size: 10px;
}

.record-image-empty svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-detail-info {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #e8edf2;
}

.record-detail-hero h3 {
  margin: 0;
  color: #23394b;
  font-size: 22px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.record-detail-hero p {
  margin: 5px 0 0;
  color: #8b99a4;
  font-size: 10.5px;
}

.record-amount {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 0;
  border-top: 1px solid #edf1f4;
  border-bottom: 1px solid #edf1f4;
}

.record-amount span {
  color: #84919b;
  font-size: 10px;
}

.record-amount strong {
  color: #a64a3f;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.record-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  color: #8d9aa4;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.record-items-head span:last-child {
  color: #638b76;
  font-weight: 400;
  letter-spacing: 0;
}

.record-items {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.record-item-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed #edf1f4;
  color: #4b5f6e;
  font-size: 10.5px;
}

.record-item-line:last-child {
  border-bottom: 0;
}

.record-item-line span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-item-line span:last-child {
  flex: none;
  color: #5e7180;
  font-variant-numeric: tabular-nums;
}

.record-filename {
  margin-top: auto;
  padding-top: 16px;
  color: #9ba6b0;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 9px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.dialog-actions-split {
  width: 100%;
  justify-content: space-between;
}

.record-dialog .dialog-footer {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* =========================================================
   Confirm dialog
   ========================================================= */

.confirm-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 25px 24px 20px;
  text-align: center;
}

.confirm-dialog[open] {
  display: block;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 13px;
  color: #b05c31;
  background: #fff7ed;
  border: 1px solid #f4e5d3;
  border-radius: 13px;
}

.confirm-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-dialog h2 {
  margin: 0;
  color: #293e4f;
  font-size: 17px;
  font-weight: 600;
}

.confirm-dialog p {
  margin: 8px 0 20px;
  color: #85939e;
  font-size: 11px;
  line-height: 1.75;
}

.confirm-actions {
  display: flex;
  gap: 8px;
}

.confirm-actions .btn {
  flex: 1;
  min-height: 36px;
  font-size: 11.5px;
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(370px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 10px 13px;
  color: rgba(248, 252, 255, 0.93);
  background: #102e47;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #5badd5;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(5, 22, 37, 0.25);
  font-size: 11px;
  line-height: 1.65;
  animation: toast-in 200ms ease-out both;
}

.toast.is-success {
  border-left-color: #6ac08a;
}

.toast.is-warning {
  border-left-color: #e6af62;
}

.toast.is-error {
  border-left-color: #dc786d;
}

.toast .icon {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 1px;
}

.toast.is-leaving {
  animation: toast-out 180ms ease-in both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(4px);
  }
}

.spin {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   Print rendering
   ========================================================= */

.print-root {
  display: none;
}

@media print {
  html,
  body {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000 !important;
    background: #fff !important;
  }

  body > *:not(.print-root) {
    display: none !important;
  }

  .print-root {
    display: block !important;
    width: 100%;
  }

  #printRoot .ticket-doc {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0;
    color: #000;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-family: "FangSong", "仿宋", "STFangsong", serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #printRoot,
  #printRoot * {
    font-family: "FangSong", "仿宋", "STFangsong", serif !important;
    color: #000 !important;
  }

  #printRoot .doc-head h3 {
    font-size: 17pt;
    line-height: 1.25;
    letter-spacing: 0.08em;
  }

  #printRoot .doc-head p {
    margin-top: 0.5mm;
    font-size: 13.8pt;
    line-height: 1.3;
  }

  #printRoot .doc-meta {
    margin: 0.5mm 0 1.5mm;
    font-size: 12pt;
    line-height: 1.35;
  }

  #printRoot .doc-meta .doc-date {
    font-size: 11.5pt;
  }

  #printRoot .doc-table {
    font-size: 11pt;
    border-collapse: collapse;
  }

  #printRoot .doc-table th,
  #printRoot .doc-table td {
    padding: 0.8mm 1.6mm;
    border: 0.1pt solid #000;
  }

  #printRoot .doc-table th {
    font-size: 11.6pt;
    line-height: 1.15;
  }

  #printRoot .doc-table td {
    height: 6.6mm;
    line-height: 1.2;
  }

  #printRoot .doc-table .doc-serial {
    font-size: 10pt;
  }

  #printRoot .doc-table .doc-unit {
    font-size: 11pt;
  }

  #printRoot .doc-table .doc-number {
    font-size: 11pt;
  }

  #printRoot .doc-table td:nth-child(2) {
    font-size: 12pt;
  }

  #printRoot .doc-table .doc-total-row td {
    height: 8mm;
    font-size: 11pt;
  }

  #printRoot .doc-table .doc-total-row .doc-upper {
    font-size: 11pt;
  }

  #printRoot .doc-table .doc-total-row .doc-upper strong {
    font-family: "Microsoft YaHei Light", "Microsoft YaHei", sans-serif !important;
    font-weight: 300;
    font-size: 14pt;
  }

  #printRoot .doc-table .doc-total-row .doc-total-amount {
    font-size: 15pt;
  }

  #printRoot .doc-info {
    margin-top: 1.5mm;
    font-size: 11pt;
    line-height: 1.35;
    text-align: left;
  }

  #printRoot .doc-info .doc-account {
    margin-bottom: 0.8mm;
    font-size: 13.3pt;
    font-weight: 600;
    line-height: 1.3;
  }

  #printRoot .doc-info .doc-account-label {
    font-size: 11pt;
    font-weight: 400;
  }

  #printRoot .doc-info .doc-biz-label {
    font-size: 11pt;
  }

  #printRoot .doc-info .doc-biz-detail {
    font-size: 10pt;
  }

  #printRoot .doc-info .doc-service {
    font-size: 11pt;
  }

  #printRoot .doc-info .doc-service-note {
    font-size: 7pt;
  }

  #printRoot .doc-info .doc-address {
    margin-top: 0.5mm;
    font-size: 11pt;
  }

  #printRoot .doc-foot {
    justify-content: flex-end;
    margin-top: 1.5mm;
    padding-top: 0.8mm;
    font-size: 9.5pt;
  }

  .toast-host,
  dialog,
  .app-shell {
    display: none !important;
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1200px) {
  .header-meta {
    display: none;
  }

  .brand-title {
    font-size: clamp(16px, 1.5vw, 19px);
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr) 305px;
  }

  .records-grid-head,
  .record-row {
    grid-template-columns: 145px minmax(0, 1fr) 110px 140px;
    gap: 14px;
  }

  .record-thumb {
    width: 132px;
    height: 84px;
  }
}

@media (max-width: 1100px) {
  .materials-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  :root {
    --sidebar-w: 162px;
  }

  .sidebar {
    padding-left: 11px;
    padding-right: 11px;
  }

  .nav-item {
    padding-left: 9px;
    padding-right: 9px;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-side {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .shortcut-card {
    grid-column: 1 / -1;
  }

  .records-grid-head {
    display: none;
  }

  .record-row {
    grid-template-columns: 142px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info money"
      "thumb info actions";
    align-items: center;
    gap: 5px 16px;
    padding: 15px 18px;
  }

  .record-thumb {
    grid-area: thumb;
    width: 142px;
    height: 90px;
    align-self: start;
    margin-top: 2px;
  }

  .record-info {
    grid-area: info;
  }

  .record-money {
    grid-area: money;
    align-self: end;
  }

  .record-actions {
    grid-area: actions;
    align-self: start;
  }

  .records-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .search-box {
    width: 100%;
    max-width: none;
  }

  .records-summary {
    justify-content: space-between;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 58px;
  }

  .app-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand-logo {
    width: 74px;
    height: 38px;
  }

  .brand-title {
    gap: 9px;
    font-size: 16px;
  }

  .app-body {
    display: block;
  }

  .sidebar {
    position: relative;
    top: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 7px 14px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    background:
      linear-gradient(180deg, #0a2a45, #08243c);
    border-right: 0;
    border-bottom: 1px solid rgba(1, 18, 31, 0.22);
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-heading,
  .nav-group-label,
  .sidebar-grow,
  .sidebar-foot {
    display: none;
  }

  .primary-nav,
  .system-nav {
    flex-direction: row;
    flex: none;
    gap: 5px;
    padding-top: 0;
    overflow: visible;
  }

  .system-nav::before {
    display: none;
  }

  .nav-item {
    width: auto;
    min-height: 40px;
    flex: none;
    gap: 7px;
    padding: 4px 12px 4px 8px;
    border-radius: 8px;
    font-size: 12.5px;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -2px 0 var(--gold), 0 6px 14px rgba(1, 19, 33, 0.13);
  }

  .nav-icon {
    width: 27px;
    height: 27px;
    border-radius: 7px;
  }

  .nav-icon svg {
    width: 15px;
    height: 15px;
  }

  .nav-badge {
    min-width: 18px;
    height: 17px;
    margin-left: 1px;
    padding: 0 5px;
    font-size: 9px;
  }

  .main-content {
    padding: 22px 16px 40px;
  }

  .page-header {
    align-items: flex-start;
    gap: 14px;
  }

  .page-actions .btn {
    min-height: 35px;
    padding: 0 11px;
    font-size: 11px;
  }

  .receipt-stage {
    border-radius: 13px;
  }

  .ticket-editor {
    padding: 22px 22px 16px;
  }

  .record-detail-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .record-image-wrap {
    min-height: 285px;
    max-height: 45vh;
  }

  .record-image-wrap img {
    width: min(100%, 490px);
  }

  .record-detail-info {
    overflow: visible;
    border-top: 1px solid #e8edf2;
    border-left: 0;
  }

  .record-filename {
    margin-top: 14px;
  }

  .preview-dialog {
    height: min(900px, calc(100vh - 20px));
  }

  .preview-body {
    grid-template-columns: minmax(0, 1fr) 268px;
  }

  .preview-stage {
    padding: 16px;
  }

  .preview-side {
    padding: 14px;
  }
}

@media (max-width: 760px) {
  .materials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .materials-folder-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .materials-folder,
  .materials-folder-actions .btn {
    width: 100%;
  }

  .materials-folder-actions .btn {
    justify-content: center;
  }

  #materialsFolderStatus {
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .brand {
    gap: 10px;
  }

  .brand-rule {
    display: none;
  }

  .brand-title {
    display: block;
    font-size: clamp(15px, 3.7vw, 18px);
    line-height: 1.25;
  }

  .brand-shop {
    display: block;
    white-space: normal;
  }

  .brand-doc {
    display: block;
    margin-top: 2px;
    font-size: 0.82em;
    opacity: 0.92;
  }

  .brand-logo {
    width: 64px;
    height: 34px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .page-heading h2 {
    font-size: 23px;
  }

  .page-description {
    font-size: 11.5px;
  }

  .stage-head {
    align-items: flex-start;
    gap: 8px;
  }

  .stage-caption {
    font-size: 10px;
  }

  .paper-chip {
    min-height: 23px;
    padding: 0 7px;
    font-size: 9.5px;
  }

  .paper-shell {
    padding: 13px 0 20px;
  }

  .ticket-editor {
    padding: 20px 15px 15px;
  }

  .ticket-brand h3 {
    font-size: 19px;
    letter-spacing: 0.06em;
  }

  .ticket-brand p {
    font-size: 11.5px;
  }

  .ticket-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 16px;
  }

  .field-inline {
    width: 100%;
  }

  .customer-input,
  .date-input {
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .meta-hints {
    flex-direction: column;
    gap: 2px;
    margin-top: 5px;
  }

  .hint-customer {
    padding-left: 0;
  }

  .table-hints {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .hint-right {
    display: none;
  }

  .table-scroller {
    margin-left: -1px;
    margin-right: -1px;
  }

  .mobile-scroll-hint {
    display: block;
  }

  .item-table {
    min-width: 660px;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
  }

  .total-hint {
    text-align: left;
  }

  .ticket-info {
    margin-top: 14px;
    font-size: 11.5px;
    line-height: 1.8;
  }

  .ticket-foot {
    margin-top: 11px;
    font-size: 8.5px;
  }

  .print-preview-btn {
    min-width: 154px;
    min-height: 42px;
    font-size: 13px;
  }

  .print-explain {
    font-size: 9.5px;
    line-height: 1.7;
  }

  .save-flow {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 10px;
  }

  .save-flow-copy {
    flex-basis: calc(100% - 46px);
  }

  .save-flow-copy span {
    white-space: normal;
  }

  .save-flow .text-btn {
    margin-left: 42px;
  }

  .settings-card {
    padding: 18px 16px 19px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-field-wide {
    grid-column: auto;
  }

  .settings-side {
    display: flex;
    flex-direction: column;
  }

  .settings-savebar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .settings-save-actions {
    justify-content: flex-end;
  }

  .records-toolbar {
    padding: 13px 14px;
  }

  .record-row {
    grid-template-columns: 96px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb info info"
      "thumb money actions";
    align-items: center;
    gap: 5px 11px;
    padding: 13px 14px;
  }

  .record-thumb {
    grid-area: thumb;
    width: 96px;
    height: 65px;
    align-self: center;
    margin-top: 0;
  }

  .record-info {
    align-self: end;
  }

  .record-money {
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    align-self: start;
    padding-left: 0;
    text-align: left;
  }

  .record-money strong {
    font-size: 16px;
  }

  .record-money span {
    display: none;
  }

  .record-actions {
    align-self: start;
    justify-content: flex-end;
  }

  .record-actions .btn {
    min-height: 28px;
    padding: 0 7px;
    font-size: 9px;
  }

  .record-actions .btn .icon {
    width: 11px;
    height: 11px;
  }

  .empty-state {
    padding: 50px 18px 54px;
  }

  .dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .preview-dialog {
    height: calc(100vh - 16px);
  }

  .preview-body {
    display: block;
    overflow-y: auto;
  }

  .preview-stage {
    min-height: 300px;
    overflow: visible;
  }

  .preview-side {
    overflow: visible;
    border-top: 1px solid #e8edf2;
    border-left: 0;
  }

  .preview-doc {
    width: 100%;
    padding: 17px 14px 13px;
  }

  .doc-head h3 {
    font-size: 17px;
  }

  .doc-head p {
    font-size: 10px;
  }

  .doc-meta {
    margin-top: 13px;
    font-size: 10.5px;
  }

  .doc-table {
    font-size: 9.5px;
  }

  .doc-table th,
  .doc-table td {
    padding: 5px 4px;
  }

  .doc-info {
    font-size: 9.5px;
  }

  .doc-foot {
    font-size: 8px;
  }

  .dialog-footer {
    gap: 9px;
    flex-direction: column;
    align-items: stretch;
    padding: 11px 13px;
  }

  .dialog-actions {
    justify-content: flex-end;
  }

  .dialog-actions .btn {
    min-height: 35px;
    padding: 0 11px;
    font-size: 10.5px;
  }

  .preview-status:empty {
    display: none;
  }

  .record-detail-body {
    grid-template-columns: 1fr;
  }

  .record-dialog .dialog-footer {
    padding: 10px 13px;
  }

  .dialog-actions-split {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .dialog-actions-split > .text-btn {
    align-self: flex-start;
  }

  .record-detail-info {
    padding: 17px;
  }

  .confirm-dialog {
    padding: 23px 20px 18px;
  }

  .toast-host {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
    max-width: none;
  }

  .toast {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .materials-panel {
    padding: 14px 12px 13px;
  }

  .materials-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-card {
    min-height: 240px;
  }

  .material-box {
    min-height: 160px;
  }

  .material-add-card {
    min-height: 96px;
    font-size: 34px;
  }

  .materials-help {
    font-size: 9.5px;
  }
}

@media (max-width: 430px) {
  :root {
    --header-h: 54px;
  }

  .app-header {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-logo {
    width: 54px;
    height: 32px;
  }

  .brand-title {
    font-size: 13px;
  }

  .main-content {
    padding-left: 11px;
    padding-right: 11px;
  }

  .receipt-stage {
    padding: 11px 9px 13px;
  }

  .stage-caption {
    font-size: 9.5px;
  }

  .paper-chip {
    display: none;
  }

  .ticket-editor {
    padding: 18px 11px 13px;
  }

  .ticket-brand h3 {
    font-size: 17px;
  }

  .ticket-brand p {
    font-size: 10.5px;
  }

  .item-table {
    min-width: 640px;
  }

  .ticket-info {
    font-size: 11px;
  }

  .save-flow {
    margin-top: 11px;
  }

  .page-actions {
    flex-wrap: wrap;
  }

  .show-desktop-only {
    display: none;
  }
}

@media (max-width: 860px) {
  .pension-image-empty {
    min-height: 340px;
    padding: 20px;
  }

  .pension-image-add {
    min-height: 200px;
  }
}

@media (max-width: 700px) {
  .pension-image-empty {
    min-height: 300px;
  }

  .pension-actions {
    gap: 8px;
    padding: 14px 14px 0;
  }

  .pension-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
    font-size: 11px;
  }

  .pension-note {
    padding: 0 14px 14px;
  }
}

@media (max-width: 540px) {
  .pension-image-empty {
    min-height: 260px;
    padding: 16px 12px;
  }

  .pension-image-add {
    min-height: 155px;
  }

  .pension-image-add-plus {
    font-size: 48px;
  }

  .pension-actions {
    gap: 6px;
    padding: 12px 10px 0;
  }

  .pension-actions .btn {
    min-height: 36px;
    gap: 4px;
    padding: 0 5px;
    font-size: 10.5px;
  }

  .pension-note {
    padding: 0 10px 12px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Quick new Word / Excel panel
   ========================================================= */

.quick-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 24px;
}

.quick-card {
  width: 100%;
  max-width: 460px;
  padding: 44px 36px;
  text-align: center;
  background: #fff;
  border: 1px solid #e4e9ef;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(24, 57, 83, 0.08);
}

.quick-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  padding: 12px;
  color: #185f87;
  background: #eaf3f9;
  border-radius: 14px;
}

.quick-card h3 {
  margin: 0 0 8px;
  color: #1c2b36;
  font-size: 20px;
  font-weight: 700;
}

.quick-card p {
  margin: 0 0 24px;
  color: #5a6a76;
  font-size: 13.5px;
  line-height: 1.7;
}

.big-action-btn {
  min-width: 220px;
  min-height: 48px;
  padding: 0 28px;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.big-action-btn .icon {
  width: 18px;
  height: 18px;
}
