:root {
    --bg: #f4eee2;
    --bg-strong: #e9dec8;
    --panel: rgba(255, 252, 246, 0.96);
    --panel-strong: #ffffff;
    --line: rgba(21, 50, 72, 0.12);
    --brand: #153248;
    --brand-soft: #244d6b;
    --accent: #d89337;
    --accent-soft: #f5e2c3;
    --text-main: #1f2932;
    --text-soft: #69747d;
    --danger: #c6544d;
    --success: #2e9162;
    --shadow: 0 18px 38px rgba(21, 50, 72, 0.10);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top right, rgba(216, 147, 55, 0.16), transparent 30%),
        linear-gradient(180deg, #f7f1e8 0%, #eee4d4 100%);
}

body {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.loading-mask {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(21, 50, 72, 0.18);
    backdrop-filter: blur(1px);
}

.loading-dialog {
    min-width: 180px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(21, 50, 72, 0.92);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 68vh;
    background:
        radial-gradient(circle at 15% 40%, rgba(16, 124, 191, 0.28), transparent 42%),
        radial-gradient(circle at 75% 35%, rgba(139, 211, 33, 0.23), transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(21, 50, 72, 0.14), transparent 46%);
    pointer-events: none;
    z-index: 0;
}

.login-panel {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 30px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.brand-block,
.card,
.sidebar,
.topbar,
.content-panel {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.brand-block {
    padding: 48px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 10%, rgba(109, 201, 255, 0.14), transparent 42%),
        radial-gradient(circle at 86% 80%, rgba(148, 217, 46, 0.12), transparent 40%),
        linear-gradient(135deg, rgba(21, 50, 72, 0.99), rgba(26, 69, 98, 0.95)),
        rgba(21, 50, 72, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-head {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo-lg {
    width: 92px;
    height: 92px;
    border-radius: 22px;
    object-fit: cover;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    flex: 0 0 auto;
}

.brand-block h1 {
    margin: 12px 0 18px;
    font-size: 44px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.brand-block p {
    margin: 0;
    font-size: 16px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.82);
}

.brand-kicker {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 12px;
    letter-spacing: 0.2em;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
}

.form-card {
    padding: 34px 32px;
    backdrop-filter: blur(8px);
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(255, 250, 241, 0.92));
}

.login-form-head {
    margin-bottom: 18px;
}

.login-form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 0.01em;
}

.login-form-subtitle {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.7;
}

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

.form-card .field-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: var(--text-soft);
}

.required-mark {
    color: var(--danger);
    font-style: normal;
    font-weight: 700;
    margin-left: 4px;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select,
.inline-form input,
.inline-form select,
.inline-form textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    background: #fffdfa;
    font-size: 14px;
    color: var(--text-main);
}

.field textarea,
.inline-form textarea {
    min-height: 90px;
    resize: vertical;
}

.action-row,
.toolbar,
.panel-actions,
.inline-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-row,
.hint-row {
    margin-top: 22px;
}

.hint-row {
    font-size: 13px;
    color: var(--text-soft);
}

.btn {
    appearance: none;
    border: none;
    border-radius: 16px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-with-icon {
    padding-top: 11px;
    padding-bottom: 11px;
}

.btn-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.btn-mini {
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.btn-primary {
    color: #1b1d20;
    background: linear-gradient(135deg, var(--accent), #e0a24f);
}

.btn-secondary {
    color: var(--brand);
    background: var(--accent-soft);
}

.btn-ghost {
    color: var(--brand);
    background: rgba(21, 50, 72, 0.08);
}

.btn-danger {
    color: var(--danger);
    background: rgba(198, 84, 77, 0.12);
}

/* Top filters (role/user pages): make selects match the card visual language */
.panel-actions > select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    min-width: 200px;
    height: 44px;
    padding: 0 36px 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    background:
        linear-gradient(180deg, #fffefb 0%, #f8f2e8 100%);
    background-image: linear-gradient(180deg, #fffefb 0%, #f8f2e8 100%);
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: 100% 100%;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(21, 50, 72, 0.06);
    outline: none;
    transition: all .16s ease;
}

.panel-actions > input[type="text"],
.panel-actions > input[type="search"] {
    min-width: 240px;
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    background: linear-gradient(180deg, #fffefb 0%, #f8f2e8 100%);
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(21, 50, 72, 0.06);
    outline: none;
    transition: all .16s ease;
}

.panel-actions > input[type="text"]::placeholder,
.panel-actions > input[type="search"]::placeholder {
    color: rgba(57, 78, 96, 0.62);
    font-weight: 500;
}

.panel-actions > input[type="text"]:hover,
.panel-actions > input[type="search"]:hover {
    border-color: rgba(216, 147, 55, 0.42);
    box-shadow: 0 4px 12px rgba(216, 147, 55, 0.16);
}

.panel-actions > input[type="text"]:focus,
.panel-actions > input[type="search"]:focus {
    border-color: rgba(216, 147, 55, 0.58);
    box-shadow: 0 0 0 3px rgba(216, 147, 55, 0.16);
}

.panel-actions > select::-ms-expand {
    display: none;
}

.panel-actions > select::-webkit-contacts-auto-fill-button,
.panel-actions > select::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
}

.panel-actions > select:hover {
    border-color: rgba(216, 147, 55, 0.42);
    box-shadow: 0 4px 12px rgba(216, 147, 55, 0.16);
}

.panel-actions > select:focus {
    border-color: rgba(216, 147, 55, 0.58);
    box-shadow: 0 0 0 3px rgba(216, 147, 55, 0.16);
}

.btn-link {
    background: transparent;
    color: var(--brand-soft);
    padding: 0;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    padding: 18px;
}

.sidebar {
    padding: 20px;
    background: rgba(18, 42, 61, 0.97);
    color: #fff;
}

.sidebar-brand {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
    padding: 3px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
    flex: 0 0 auto;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar .brand-kicker {
    padding: 5px 10px;
    font-size: 11px;
    letter-spacing: 0.14em;
}

.brand-title {
    margin-top: 7px;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.2;
}

.sidebar-nav {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-group-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(191, 219, 242, 0.9);
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.nav-group-title-text {
    display: inline-block;
}

.nav-group-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: rgba(245, 248, 252, 0.86);
    background: transparent;
    box-shadow: none;
}

.nav-group-trigger {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.nav-group-trigger:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-group-trigger:hover .nav-group-title {
    color: rgba(220, 237, 251, 0.92);
}

.nav-group-caret {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.80);
    font-size: 12px;
    line-height: 1;
}

.nav-group-children {
    display: grid;
    gap: 2px;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px dashed rgba(255, 255, 255, 0.14);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 7px 14px 7px 18px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: rgba(218, 234, 248, 0.86);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
}

.nav-item-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    color: rgba(233, 239, 247, 0.72);
    opacity: 1;
}

.nav-item-text {
    display: inline-block;
}

.nav-item.active,
.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.98);
    font-weight: 500;
}

.nav-item.active .nav-item-icon,
.nav-item:hover .nav-item-icon {
    color: rgba(255, 255, 255, 0.98);
}

.main-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 18px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: rgba(255, 252, 246, 0.96);
    border: 1px solid var(--line);
}

.topbar-title {
    font-size: 28px;
    font-weight: 700;
}

.topbar-subtitle {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 14px;
}

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

.session-pill-btn {
    appearance: none;
    border: none;
    cursor: pointer;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    gap: 6px;
}

.user-menu-caret {
    font-size: 10px;
    opacity: 0.8;
}

.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 144px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fffdfa;
    box-shadow: 0 12px 28px rgba(15, 29, 42, 0.16);
    z-index: 40;
    display: grid;
    gap: 4px;
}

.user-menu-item {
    appearance: none;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--brand);
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(21, 50, 72, 0.08);
}

.session-pill,
.tag,
.tag-light {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
}

.session-pill {
    color: var(--brand);
    background: rgba(21, 50, 72, 0.08);
}

.tag {
    color: var(--brand);
    background: var(--accent-soft);
}

.tag-light {
    color: var(--text-soft);
    background: rgba(21, 50, 72, 0.06);
}

.content-shell {
    display: grid;
    gap: 18px;
}

.content-panel {
    padding: 22px 24px;
    background: rgba(255, 252, 246, 0.96);
    border: 1px solid var(--line);
}

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

.panel-title {
    font-size: 20px;
    font-weight: 700;
}

.panel-subtitle {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.7;
}

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

.stat-card {
    padding: 18px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid rgba(21, 50, 72, 0.08);
}

.stat-label {
    color: var(--text-soft);
    font-size: 13px;
}

.stat-value {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 700;
    color: var(--brand);
}

.content-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
}

.relation-layout {
    grid-template-columns: 0.55fr 1.45fr 0.95fr;
}

.relation-main-panels {
    display: grid;
    gap: 14px;
}

.relation-layout.relation-layout-2 {
    grid-template-columns: 0.62fr 1.38fr;
}

.relation-layout-3 .relation-main-panels {
    display: contents;
}

.relation-dict-panel table tbody tr[data-action="select-relation-dict-row"] {
    cursor: pointer;
}

.relation-toolbar {
    grid-template-columns: minmax(0, 1fr);
}

.relation-toolbar .goods-filter-actions {
    grid-column: auto;
}

.content-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.table-wrap {
    overflow: auto;
}

.cell-actions {
    min-width: 136px;
}

.table-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.link-btn {
    border: none;
    background: transparent;
    color: #285f9f;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.link-btn:hover {
    text-decoration: underline;
}

tr.is-active-row td {
    background: rgba(64, 122, 201, 0.08);
}

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

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(21, 50, 72, 0.08);
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    color: var(--text-soft);
    font-weight: 700;
}

.toolbar {
    margin-bottom: 16px;
}

.toolbar > * {
    min-width: 140px;
}

.goods-filter-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: center;
}

.goods-filter-toolbar > input,
.goods-filter-toolbar > select {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
}

.goods-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.supplier-picker {
    position: relative;
    width: 100%;
    min-width: 0;
}

.supplier-picker-trigger {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    background: #fffdfa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
}

.supplier-picker-caret {
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1;
}

.supplier-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    border-radius: 12px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 29, 42, 0.18);
    padding: 10px;
}

.supplier-picker-search-row {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 8px;
    margin-bottom: 8px;
}

.supplier-picker-search-input {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    font-size: 13px;
    color: var(--text-main);
    background: #fffdfa;
}

.supplier-picker-search-btn {
    min-width: 0;
    border: 1px solid rgba(111, 97, 197, 0.28);
    border-radius: 10px;
    background: rgba(111, 97, 197, 0.08);
    color: #6f61c5;
    font-size: 16px;
    cursor: pointer;
}

.supplier-picker-options {
    max-height: 220px;
    overflow: auto;
    display: grid;
    gap: 4px;
}

.supplier-picker-option {
    text-align: left;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
}

.supplier-picker-option:hover,
.supplier-picker-option.active {
    background: rgba(21, 50, 72, 0.08);
}

.status-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.status-switch {
    border: none;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: rgba(21, 50, 72, 0.16);
    position: relative;
    cursor: pointer;
    padding: 0;
}

.status-switch-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 3px;
    left: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all .18s ease;
}

.status-switch.is-on {
    background: #66bb6a;
}

.status-switch.is-on .status-switch-dot {
    left: 23px;
}

.status-switch-text {
    font-size: 13px;
    color: var(--text-soft);
}

.goods-status-field {
    margin-top: 2px;
}

.goods-form-actions {
    margin-top: 20px;
}

.report-pagination {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.report-pagination-meta {
    font-size: 13px;
    color: var(--text-soft);
}

.report-pagination-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.report-pagination-size {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-soft);
}

.report-pagination-size select {
    width: 86px;
    min-width: 86px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(21, 50, 72, 0.14);
    background: #fffdfa;
    color: var(--text-main);
}

.inline-form.report-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px 10px;
    margin-bottom: 8px;
}

.report-filter-grid .field {
    gap: 4px;
    font-size: 12px;
}

.report-filter-grid .field input,
.report-filter-grid .field select {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.report-filter-toolbar {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.report-filter-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.report-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 14px;
}

.report-check input {
    width: auto;
    min-width: 0;
    margin: 0;
}

.report-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-filter-actions .btn {
    padding: 8px 12px;
    border-radius: 10px;
}

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

.goods-form-grid {
    gap: 12px 14px;
}

.goods-form-grid .field {
    gap: 6px;
}

.goods-form-grid .field span {
    font-size: 12px;
}

.goods-form-grid input,
.goods-form-grid select,
.goods-form-grid textarea {
    padding: 10px 12px;
    border-radius: 12px;
}

.inline-form .span-2 {
    grid-column: span 2;
}

.list-note {
    font-size: 13px;
    color: var(--text-soft);
}

.empty-state {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-soft);
    border: 1px dashed rgba(21, 50, 72, 0.16);
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.7);
}

.detail-table input,
.detail-table select {
    min-width: 90px;
}

.detail-table .goods-select {
    min-width: 180px;
}

.sale-entry-panel {
    padding: 18px 20px 16px;
}

.sale-entry-head-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: end;
    margin-bottom: 10px;
}

.sale-entry-head-grid .field {
    gap: 4px;
    font-size: 12px;
}

.sale-entry-head-grid .field span {
    font-size: 12px;
}

.sale-entry-head-grid .field input {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.sale-entry-cache-tip {
    grid-column: span 3;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: var(--text-soft);
    font-size: 12px;
}

.sale-inline-link {
    margin-left: 6px;
    font-size: 12px;
    color: #3f6699;
    text-decoration: none;
}

.sale-inline-link:hover {
    color: #274d78;
    text-decoration: underline;
}

.sale-entry-main-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px 10px;
    margin-bottom: 12px;
}

.sale-entry-main-grid .field {
    gap: 4px;
    font-size: 12px;
}

.sale-entry-main-grid .field span {
    font-size: 12px;
}

.sale-entry-main-grid .field input,
.sale-entry-main-grid .field select {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
}

.sale-input-with-btn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.sale-input-with-btn .btn {
    padding: 7px 12px;
    border-radius: 10px;
    white-space: nowrap;
}

.sale-entry-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.sale-entry-toolbar .btn {
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
}

.sale-entry-toolbar .btn-with-icon {
    padding-top: 7px;
    padding-bottom: 7px;
}

.sale-entry-table-wrap {
    border: 1px solid rgba(21, 50, 72, 0.12);
    border-radius: 12px;
    overflow: auto;
    background: rgba(255, 253, 249, 0.78);
}

.sale-entry-table th,
.sale-entry-table td {
    padding: 7px 8px;
    font-size: 13px;
    white-space: nowrap;
    vertical-align: middle;
}

.sale-entry-table th {
    background: rgba(130, 170, 205, 0.26);
    color: #2a3a4a;
}

.sale-entry-table td input,
.sale-entry-table td select {
    min-width: 70px;
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(21, 50, 72, 0.16);
    background: #fffdfa;
    font-size: 13px;
}

.sale-entry-table td:nth-child(2) input {
    min-width: 240px;
}

.sale-entry-table .money {
    min-width: 80px;
    text-align: right;
}

.sale-line-readonly {
    min-width: 110px;
    color: #5d6b78;
    font-weight: 600;
    background: rgba(21, 50, 72, 0.05);
}

.sale-line-index-cell {
    width: 58px;
}

.sale-line-index-btn {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(21, 50, 72, 0.16);
    border-radius: 8px;
    background: rgba(21, 50, 72, 0.04);
    color: var(--brand);
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
}

.sale-line-row.active td {
    background: rgba(116, 113, 255, 0.11);
}

.sale-line-summary td {
    font-weight: 700;
    background: rgba(21, 50, 72, 0.04);
}

.sale-goods-table-picker {
    position: fixed;
    z-index: 2400;
    background: #fffdfa;
    border: 1px solid rgba(21, 50, 72, 0.2);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(21, 50, 72, 0.22);
    overflow: hidden;
}

.sale-goods-table-scroll {
    max-height: 300px;
    overflow: auto;
}

.sale-goods-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 12px;
}

.sale-goods-table th,
.sale-goods-table td {
    border: 1px solid rgba(21, 50, 72, 0.12);
    padding: 4px 6px;
    white-space: nowrap;
}

.sale-goods-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #8fb3d6;
    color: #112233;
    font-weight: 700;
}

.sale-goods-table tbody tr {
    cursor: pointer;
}

.sale-goods-table tbody tr:nth-child(even) {
    background: rgba(143, 179, 214, 0.08);
}

.sale-goods-table tbody tr:hover {
    background: rgba(116, 113, 255, 0.14);
}

.sale-entry-remark {
    margin-top: 10px;
    margin-bottom: 8px;
}

.sale-entry-remark input {
    border-radius: 10px;
    padding: 9px 10px;
}

.sale-entry-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-soft);
}

.sale-entry-links .btn-link {
    font-size: 12px;
    color: #6e7f90;
}

.money {
    color: var(--accent);
    font-weight: 700;
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

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

.wx-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(21, 50, 72, 0.12);
}

/* 微信用户页搜索框：对齐“销售出库-备注输入框”的视觉 */
.panel-actions > input.wx-search-input {
    min-width: 240px !important;
    height: 44px !important;
    padding: 9px 10px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(21, 50, 72, 0.16) !important;
    background: #fffdfa !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--text-main) !important;
}

.panel-actions > input.wx-search-input::placeholder {
    color: #8a98a6 !important;
    font-weight: 400 !important;
}

.panel-actions > input.wx-search-input:focus {
    outline: none;
    border-color: rgba(216, 147, 55, 0.58) !important;
    box-shadow: 0 0 0 3px rgba(216, 147, 55, 0.16) !important;
}

.wx-edit-actions {
    margin-top: 18px;
}

.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    display: grid;
    gap: 10px;
    z-index: 9999;
}

.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #fff;
    box-shadow: var(--shadow);
    animation: fade-in 0.2s ease-out;
}

.toast.info {
    background: rgba(21, 50, 72, 0.92);
}

.toast.success {
    background: rgba(46, 145, 98, 0.92);
}

.toast.error {
    background: rgba(198, 84, 77, 0.92);
}

.print-preview-mask {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(13, 27, 39, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.print-preview-dialog {
    width: min(1320px, 96vw);
    max-height: 94vh;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    box-shadow: 0 24px 56px rgba(15, 29, 42, 0.24);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.print-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #f9f5ed;
}

.print-preview-actions {
    display: flex;
    gap: 8px;
}

.print-preview-body {
    padding: 14px 18px 18px;
    overflow: auto;
}

.print-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 10px;
    border: 1px solid rgba(21, 50, 72, 0.12);
    border-radius: 12px;
    background: #fbfcfd;
    padding: 10px 12px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

.print-meta-item {
    min-height: 22px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.print-meta-label {
    color: var(--text-soft);
}

.print-meta-value {
    color: var(--text-main);
    font-weight: 600;
}

.print-settings-panel {
    border: 1px solid rgba(21, 50, 72, 0.12);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    margin-bottom: 12px;
}

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

.print-columns-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
    margin-bottom: 10px;
}

.print-col-item {
    border: 1px solid rgba(21, 50, 72, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: auto 1fr 86px;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 12px;
}

.print-col-item input[type="checkbox"] {
    width: auto;
    min-width: 0;
    margin: 0;
}

.print-col-item input[type="number"] {
    width: 86px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.print-preview-note {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 8px;
}

.print-preview-table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    max-height: 52vh;
    overflow: auto;
}

.print-preview-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 8px;
    text-align: center;
}

.print-preview-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: var(--preview-font-size, 13px);
    font-family: var(--preview-font-family, "Microsoft YaHei", "PingFang SC", sans-serif);
    box-sizing: border-box;
}

.print-preview-table th,
.print-preview-table td {
    border: 1px solid rgba(21, 50, 72, 0.16);
    padding: 4px 6px;
    height: var(--preview-row-height, 34px);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: inherit;
    font-family: inherit;
}

.print-preview-table th {
    background: #f2f5f8;
    font-weight: 700;
}

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

@media (max-width: 1200px) {
    .stat-grid,
    .content-grid,
    .inline-form,
    .login-panel {
        grid-template-columns: 1fr;
    }

    .sale-entry-head-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sale-entry-cache-tip {
        grid-column: span 2;
    }

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

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

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

    .brand-head {
        align-items: flex-start;
    }

    .brand-logo-lg {
        width: 72px;
        height: 72px;
        border-radius: 18px;
    }
}

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

    .sidebar {
        order: 2;
    }

    .print-columns-grid,
    .print-settings-grid,
    .print-meta-grid {
        grid-template-columns: 1fr;
    }

    .goods-filter-toolbar {
        grid-template-columns: 1fr;
    }

    .sale-entry-head-grid,
    .sale-entry-main-grid {
        grid-template-columns: 1fr;
    }

    .sale-entry-cache-tip {
        grid-column: span 1;
    }
}
