:root {
    --bg-start: #f5f7fb;
    --bg-end: #f5f7fb;
    --panel-bg: #ffffff;
    --panel-border: #e5e7eb;
    --text-main: #111827;
    --text-subtle: #6b7280;
    --line-soft: #e5e7eb;
    --brand-yellow: #2563eb;
    --brand-purple: #2563eb;
    --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
}

html, body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html.page-fit-no-scroll,
body.page-fit-no-scroll {
    overflow-y: hidden;
    height: 100%;
    overscroll-behavior-y: none;
}

body.page-fit-no-scroll.with-bottom-nav {
    padding-bottom: 0 !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", sans-serif;
    background-color: #f5f7fb;
    color: var(--text-main);
    position: relative;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #f5f7fb 0%, #f8fafc 100%);
    pointer-events: none;
    z-index: -1;
}

body.auth-page::before {
    display: none;
}

.container {
    max-width: 960px;
    margin: 24px auto;
    padding: 16px;
}

.wide {
    max-width: 1240px;
}

h1,
h2,
h3 {
    margin: 8px 0 14px;
}

h1 {
    font-size: 34px;
    letter-spacing: 0.5px;
}

h2 {
    font-size: 24px;
}

.card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
}

label {
    font-weight: 700;
    display: block;
    margin-top: 8px;
}

.required-star {
    color: #d32f2f;
    margin-left: 2px;
}

input,
select,
textarea,
button {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
    background: #ffffff;
    color: var(--text-main);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

button,
.btn {
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    width: auto;
    cursor: pointer;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #2563eb;
    box-sizing: border-box;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

button:hover,
.btn:hover {
    transform: none;
    background: #1d4ed8;
    border-color: #1d4ed8;
}

button:active,
.btn:active {
    transform: translateY(1px) scale(0.99);
}

button.is-loading,
.btn.is-loading {
    opacity: 0.82;
    cursor: wait;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    overflow: hidden;
}

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

table tr:not(:first-child) {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

table tr:not(:first-child):hover {
    background: transparent;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.stats .card strong {
    font-size: 24px;
    display: block;
}

.stats .card {
    position: relative;
    overflow: hidden;
}

.stats .card::after {
    display: none;
}

.stat-hint {
    display: block;
    font-size: 12px;
    color: var(--text-subtle);
    font-weight: normal;
    margin-top: 4px;
    line-height: 1.35;
}

.sale-skip-hint {
    color: #888;
    cursor: help;
}

.muted {
    color: var(--text-subtle);
    font-size: 14px;
    margin: -6px 0 16px;
}

.sales-center-cta {
    margin-top: 20px;
}

.sales-center-cta .btn {
    display: inline-block;
}

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

.order-item-line {
    display: block;
    line-height: 1.5;
}

.order-items-list {
    min-width: 0;
}

.order-items-cell .order-item-line+.order-item-line {
    margin-top: 2px;
}

.btn-inline-op {
    width: auto;
    padding: 6px 12px;
    font-size: 14px;
}

.inline-delete-order-form {
    display: inline;
    margin: 0;
}

.btn-danger-outline {
    width: auto;
    padding: 6px 12px;
    font-size: 14px;
    background: #fff5f5;
    border: 2px solid #c62828;
    color: #b3002d;
}

.dot {
    width: 8px;
    height: 8px;
    background: #ff3153;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
}

.tip {
    color: #65408a;
}

.ok {
    color: #0b7a35;
}

.error {
    color: #b3002d;
}

.hidden {
    display: none;
}

.links {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 8px;
}

.remove-item-btn {
    width: auto;
    margin-top: 6px;
    padding: 10px 12px;
    background: #fff;
    color: #7a1830;
    border: 2px solid #d2899d;
}

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

.item-title-row h3 {
    margin: 0;
}

.add-item-btn {
    margin-top: 0;
}

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

.topbar .who {
    font-weight: 700;
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-soft);
}

.c-clean-topbar .topbar {
    justify-content: flex-end;
}

.c-clean-topbar .topbar .who {
    display: none;
}

.c-assets-page .container {
    padding-top: 10px;
    position: relative;
}

.c-assets-page .container::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 12%, rgba(59, 130, 246, 0.07) 0, rgba(59, 130, 246, 0) 34%),
        radial-gradient(circle at 92% 86%, rgba(16, 185, 129, 0.07) 0, rgba(16, 185, 129, 0) 36%),
        repeating-linear-gradient(168deg, rgba(30, 41, 59, 0.02) 0, rgba(30, 41, 59, 0.02) 1px, transparent 1px, transparent 14px);
    z-index: 0;
}

.assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    border-radius: 16px;
    border: 1px solid #e5eaf3;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.assets-user-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.assets-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 24px;
    background: linear-gradient(145deg, #d9f2ff, #bfcfff);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.85), 0 8px 18px rgba(37, 99, 235, 0.2);
    color: #2f6ab6;
}

.assets-username {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.1;
}

.assets-vip-badge {
    margin-top: 2px;
    display: inline-block;
    font-size: 12px;
    color: #4b5563;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 2px 8px;
}

.assets-logout-form {
    margin: 0;
}

.assets-logout-link {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #5b6473;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 7px 12px;
    border: 1px solid #e5eaf3;
    background: rgba(255, 255, 255, 0.92);
}

.assets-logout-link::before {
    content: "⇢ ";
    font-size: 12px;
}

.assets-main-grid,
.assets-sub-grid {
    position: relative;
    z-index: 1;
}

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

.assets-sub-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    border-radius: 17px;
    border: 1px solid #dbe2ed;
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.1),
        0 4px 10px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    padding: 12px;
    position: relative;
    overflow: hidden;
}

.metric-card-lg {
    color: #ffffff;
    min-height: 176px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.metric-profit {
    background: linear-gradient(170deg, #8fbde6 0%, #2a72d9 58%, #1d4f9f 100%);
}

.metric-turnover {
    background: linear-gradient(168deg, #8fe0c3 0%, #2aa37f 58%, #1f7e65 100%);
}

.metric-profit::before,
.metric-turnover::before {
    content: "";
    position: absolute;
    right: -8px;
    top: 16px;
    width: 130px;
    height: 130px;
    opacity: 0.18;
    border-radius: 26px;
    border: 2px solid rgba(255, 255, 255, 0.65);
    transform: rotate(18deg);
}

.metric-profit::after,
.metric-turnover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 42%);
    pointer-events: none;
}

.metric-icon {
    width: 30px;
    height: 30px;
    opacity: 0.92;
    align-self: flex-end;
    background-color: currentColor;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}

.metric-card-lg .metric-icon {
    color: rgba(255, 255, 255, 0.96);
}

.metric-card-sm .metric-icon {
    color: #6b7280;
}

.metric-icon-trend {
    -webkit-mask-image: url("/img/icons/c-assets/trending-up.svg");
    mask-image: url("/img/icons/c-assets/trending-up.svg");
}

.metric-icon-bag {
    -webkit-mask-image: url("/img/icons/c-assets/shopping-bag.svg");
    mask-image: url("/img/icons/c-assets/shopping-bag.svg");
}

.metric-icon-box {
    -webkit-mask-image: url("/img/icons/c-assets/package-check.svg");
    mask-image: url("/img/icons/c-assets/package-check.svg");
}

.metric-icon-pack {
    -webkit-mask-image: url("/img/icons/c-assets/package.svg");
    mask-image: url("/img/icons/c-assets/package.svg");
}

.metric-icon-pending {
    -webkit-mask-image: url("/img/icons/c-assets/hourglass.svg");
    mask-image: url("/img/icons/c-assets/hourglass.svg");
}

.metric-value {
    margin-top: 32px;
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
}

.metric-label {
    margin-top: 3px;
    font-size: 15px;
    opacity: 0.92;
    letter-spacing: 0.02em;
}

.metric-card-sm {
    background: linear-gradient(165deg, #ffffff 0%, #f5f7fc 100%);
    color: #2b3343;
    min-height: 138px;
}

.metric-card-sm::before {
    content: "";
    position: absolute;
    right: -20px;
    top: 24px;
    width: 104px;
    height: 104px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    transform: rotate(28deg);
    opacity: 0.42;
}

.metric-pending {
    background: linear-gradient(165deg, #f9e8be 0%, #f1d38d 100%);
    border-color: #e8c678;
}

.metric-pending .metric-value-sm,
.metric-pending .metric-label-sm,
.metric-pending .metric-icon {
    color: #8b5c19;
}

.metric-value-sm {
    margin-top: 10px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.metric-label-sm {
    margin-top: 4px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.1;
}

.c-assets-page .fixed-bottom-nav .btn {
    border: none;
    border-radius: 0;
    background: transparent;
}

.c-assets-page .fixed-bottom-nav .btn.active {
    background: rgba(37, 99, 235, 0.08);
    border-color: transparent;
    color: #2563eb;
    position: relative;
    border-radius: 14px;
}

.c-assets-page .fixed-bottom-nav .btn.active::after {
    content: "";
    position: absolute;
    left: 24%;
    right: 24%;
    bottom: 2px;
    height: 2px;
    border-radius: 999px;
    background: #2563eb;
}

.inline-logout {
    display: inline;
    margin: 0;
}

.inline-logout button,
.link-btn {
    width: auto;
    padding: 10px 14px;
    font-size: 14px;
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--line-soft);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.inline-logout button:hover,
.link-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.narrow {
    max-width: 420px;
}

.search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search input {
    flex: 1;
    min-width: 220px;
}

.search>div {
    flex: 1;
    min-width: 200px;
}

.dashboard-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

.dashboard-actions .btn,
.dashboard-actions button {
    margin-top: 6px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 8px;
    position: relative;
}

.chart {
    width: 100%;
    height: 360px;
    position: relative;
}

.trend-series-selector {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    align-items: center;
    margin: 10px 0 18px;
}

.trend-series-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #37204f;
    font-weight: 600;
    line-height: 1;
}

.trend-series-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    min-width: 16px;
}

.trend-series-option span {
    display: inline-block;
    line-height: 1.2;
}

.chart-tooltip {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 5;
    pointer-events: none;
    display: none;
    min-width: 120px;
    padding: 8px 10px;
    border: 2px solid #5d3e80;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    color: #37204f;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.with-bottom-nav {
    padding-bottom: 132px;
}

.fixed-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #e5e7eb;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
}

.fixed-bottom-nav .btn {
    margin-top: 0;
    flex: 1;
    min-width: 0;
    max-width: 200px;
    padding: 8px 6px 10px;
    font-size: 12px;
    text-align: center;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: #6b7280;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.fixed-bottom-nav .btn.active {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.22);
}

.fixed-bottom-nav .btn.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.fixed-bottom-nav .btn.nav-item::before {
    font-size: 18px;
    line-height: 1;
}

.nav-order::before {
    content: "📋";
}

.nav-dashboard::before {
    content: "📈";
}

.nav-sales::before {
    content: "💰";
}

.nav-users::before {
    content: "👥";
}

.nav-create::before {
    content: "📝";
}

.nav-orders::before {
    content: "📦";
}

.nav-assets::before {
    content: "👤";
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;
    background-color: #f5f7fb;
    background-image: none;
}

.auth-single {
    position: relative;
    z-index: 1;
}

.auth-single {
    width: 100%;
    max-width: 560px;
}

.auth-panel {
    padding: 28px 28px 24px;
    margin-bottom: 0;
}

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

.auth-panel label {
    margin-top: 12px;
}

.auth-remember-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.auth-remember-row input[type="checkbox"] {
    width: auto;
    min-width: 18px;
    height: 18px;
    margin-top: 4px;
    flex-shrink: 0;
}

.auth-remember-row label {
    margin-top: 0;
    font-weight: 600;
    line-height: 1.4;
}

.auth-panel input {
    height: 48px;
}

.auth-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.auth-actions button,
.auth-actions .btn {
    margin-top: 0;
    min-width: 120px;
    height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.auth-actions-single button,
.auth-actions-single .btn {
    width: 100%;
}

.auth-panel .tip,
.auth-panel .error,
.auth-panel .ok {
    margin-top: 0;
    margin-bottom: 8px;
}

.auth-secondary-btn {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.center-toast {
    position: fixed;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 3000;
    min-width: 200px;
    max-width: min(90vw, 420px);
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.center-toast::before {
    display: block;
    font-size: 18px;
    line-height: 1;
    margin-bottom: 6px;
}

.center-toast.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.center-toast.success {
    background: #1b9f50;
}

.center-toast.success::before {
    content: "✓";
}

.center-toast.error {
    background: #d93030;
}

.center-toast.error::before {
    content: "!";
}

/* 表格内「链接样式」按钮：不触发页面锚点跳转 */
button.table-text-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #5d3e80;
    text-decoration: underline;
    cursor: pointer;
    text-align: left;
}

.dashboard-sale-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 220px;
}

.dashboard-sale-form input[type="number"] {
    width: 96px;
    min-width: 0;
}

.order-entry-card {
    margin-bottom: 14px;
}

.order-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.compact-entry-form {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: auto;
}

.camera-scan-panel {
    width: auto;
}

.order-entry-actions button {
    width: auto;
    min-width: 180px;
    margin-top: 0;
}

.scanner-modal-card {
    width: min(94vw, 520px);
}

.camera-scanner-region {
    width: 100%;
    min-height: 280px;
    border-radius: 14px;
    overflow: hidden;
    background: #120d18;
    margin-top: 10px;
}

.camera-scanner-region video {
    border-radius: 14px;
}

.scanner-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.scanner-modal-actions button {
    width: 100%;
}

.c-orders-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.c-orders-page .container {
    padding-top: 58px;
}

.c-status-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 12px;
    padding: 0;
    border-bottom: 1px solid #ece8f4;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f5f7fb;
}

.c-orders-page .c-status-tabs {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 960;
    padding: 0 8px;
    background: rgba(245, 247, 251, 0.97);
    backdrop-filter: blur(6px);
}

.c-status-tab {
    flex: 1 0 auto;
    text-align: center;
    padding: 10px 12px;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    background: transparent;
    text-decoration: none;
    font-weight: 500;
}

.c-status-tab.active {
    color: #3b78ff;
    border-bottom-color: #3b78ff;
}

.c-order-row {
    padding: 8px 10px;
    border: 1px solid #d8d2e8;
    border-radius: 8px;
    box-shadow: none;
}

.c-order-id-link {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-weight: 700;
    color: var(--brand-purple);
    text-decoration: underline;
    word-break: break-all;
    text-align: left;
    box-shadow: none;
    font-size: 18px;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.c-order-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.c-order-layout {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    touch-action: pan-y;
}

.c-order-left {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 4px;
}

.c-order-meta {
    margin-top: 0;
    color: var(--text-subtle);
    font-size: 12px;
    word-break: break-all;
    user-select: none;
    -webkit-user-select: none;
}

.c-order-summary {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.c-order-summary strong {
    font-size: 28px;
    line-height: 1;
}

.c-order-summary-rows {
    margin-top: 0;
    margin-left: auto;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    font-size: 12px;
    color: var(--text-subtle);
    min-width: 120px;
    user-select: none;
    -webkit-user-select: none;
}

.c-order-summary-rows strong {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 700;
}

.c-order-detail p {
    margin: 8px 0;
}

#cDetailItems {
    white-space: pre-line;
}

.empty-state {
    text-align: center;
    color: var(--text-subtle);
    padding: 28px 18px;
}

.empty-state strong {
    display: block;
    color: var(--text-main);
    font-size: 18px;
    margin-bottom: 6px;
}

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 2800;
    pointer-events: auto;
}

.order-modal.hidden {
    display: none !important;
    pointer-events: none !important;
}

.order-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.order-modal-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);
    background: #fff;
    border: 3px solid #37204f;
    border-radius: 16px;
    padding: 14px;
}

@media (max-width: 768px) {
    .container {
        margin: 12px auto;
        padding: 12px;
    }

    .c-orders-page .container {
        padding-top: 58px;
    }

    .auth-single {
        max-width: 100%;
    }

    .auth-page {
        background-position: center bottom 4vh;
        background-size: min(96vw, 620px) auto;
    }

    .auth-panel {
        padding: 22px 18px 18px;
    }

    .auth-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-actions button,
    .auth-actions .btn {
        width: 100%;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .card {
        border-width: 2px;
        border-radius: 14px;
        padding: 12px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .item-row {
        grid-template-columns: 2fr 1fr auto;
    }

    .item-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .links {
        flex-direction: column;
        gap: 8px;
    }

    .links .btn {
        width: 100%;
        text-align: center;
    }

    .search {
        flex-direction: column;
    }

    .search input {
        min-width: 0;
    }

    .search button {
        width: 100%;
    }

    .dashboard-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions .btn {
        width: 100%;
        text-align: center;
    }

    .topbar {
        padding: 0 12px;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar::before {
        width: 100%;
        justify-content: center;
    }

    .topbar .who {
        max-width: calc(100vw - 140px);
        word-break: break-all;
    }

    .table-wrap {
        overflow-x: visible;
    }

    .orders-table {
        min-width: 0;
        border: none;
        background: transparent;
    }

    .orders-table tr:first-child {
        display: none;
    }

    .orders-table tr {
        display: block;
        background: #fff;
        border: 2px solid var(--line-soft);
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 8px 10px;
    }

    .orders-table tr.orders-empty-row {
        border: 3px solid #2f1a45;
        padding: 0;
    }

    .orders-table tr.orders-empty-row td {
        display: table-cell;
        padding: 8px;
    }

    .orders-table td {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        align-items: flex-start;
        border-bottom: 1px dashed var(--line-soft);
        padding: 8px 0;
        white-space: normal;
        word-break: break-word;
    }

    .orders-table td:last-child {
        border-bottom: none;
    }

    .orders-table td::before {
        content: attr(data-label);
        flex: 0 0 76px;
        color: var(--text-subtle);
        font-weight: 600;
    }

    .orders-table td.order-actions-cell {
        align-items: center;
    }

    .orders-table td.order-actions-cell .inline-delete-order-form,
    .orders-table td.order-actions-cell .inline-delete-order-form button {
        width: 100%;
    }

    .orders-table td.order-items-cell {
        display: grid;
        grid-template-columns: 76px 1fr;
        align-items: start;
    }

    .orders-table td.order-items-cell::before {
        min-width: 0;
    }

    .order-entry-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-entry-actions button {
        width: 100%;
    }

    .camera-scanner-region {
        min-height: 220px;
    }

    .chart {
        height: 300px;
    }

    .fixed-bottom-nav {
        padding: 8px 10px;
    }

    .fixed-bottom-nav .btn {
        flex: 1;
        min-width: 0;
    }

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

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