/* ========== 全局重置 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    font-size: 16px;
    height: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
    overscroll-behavior: none;
}
body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

/* ========== 页面切换 ========== */
#page-login { display: flex; -webkit-box-orient: vertical;
            flex-direction: column; height: 100%; height: 100vh; height: -webkit-fill-available; overflow: hidden; }
#page-app { display: none; -webkit-box-orient: vertical; -webkit--webkit-box-orient: vertical;
            flex-direction: column; -webkit-box-orient: vertical;
            flex-direction: column; height: 100%; height: 100vh; height: -webkit-fill-available; overflow: hidden; }

/* ========== 登录页 ========== */
.login-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
            flex-direction: column;
    justify-content: center;
    max-width: 360px;
    margin: 0 auto;
    padding: 60px 24px 40px;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
            flex-direction: column;
    align-items: center;
    justify-content: center;
}
.login-logo { font-size: 64px; margin-bottom: 16px; }
.login-title { font-size: 19px; font-weight: 700; color: #1890ff; }
.login-subtitle { font-size: 14px; color: #999; margin: 8px 0 32px; }
.login-form { width: 100%; }
.error-text { color: #ff4d4f; font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px; }

/* ========== 主应用布局 ========== */
#page-app {
    background: #f5f6fa;
    -webkit-box-orient: vertical;
            flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* 顶部栏 - 固定在顶部不随内容滚动 */
.app-header {
    background: #1890ff;
    color: #fff;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    flex-shrink: 0;
    z-index: 100;
}
.app-header h1 { font-size: 18px; font-weight: 600; }

/* 内容区域 - 可滚动 */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translate3d(0,0,0);
    padding-bottom: calc(70px + constant(safe-area-inset-bottom));
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}


@media (min-width: 481px) {
    .app-content {
        max-width: 480px;
        margin: 0 auto;
    }
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 16px;
    
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #333; }

/* ========== 静态卡片头（非折叠，卡片布局用） ========== */
.card-header-static {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #1677ff 0%, #4096ff 100%);
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.card-header-static .card-title { color: #fff; margin-bottom: 0; }

/* ========== 折叠组件 ========== */
.card-header-collapsible {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #1677ff 0%, #4096ff 100%);
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    transition: filter .15s ease;
}
.card-header-collapsible:active { filter: brightness(.95); }
.card-header-collapsible .card-title { color: #fff; margin-bottom: 0; }
.collapse-hint {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.collapse-hint-text {
    font-size: 12px;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
}
.collapse-arrow {
    font-size: 13px;
    color: rgba(255,255,255,.9);
    transition: transform .15s ease;
    line-height: 1;
    user-select: none;
}
.card-header-collapsible.open .collapse-arrow { color: #fff; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus { border-color: #1890ff; }
textarea { resize: vertical; min-height: 60px; }
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; }

display: -webkit-box;
display: -webkit-flex;
.form-row { display: flex; gap: 8px; align-items: center; }

/* ========== 按钮 ========== */
.btn {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: 0.7; }
.btn-primary { background: #1890ff; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-success { background: #52c41a; color: #fff; }
.btn-warning { background: #faad14; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 32px; background: #1890ff; color: #fff; border-radius: 6px; border: none; }
.btn-sm-danger { padding: 6px 12px; font-size: 13px; min-height: 32px; background: #ff4d4f; color: #fff; border-radius: 6px; border: none; }
.btn-block { width: 100%; }

/* ========== 底部导航 - 绝对固定不随滚动 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    border-top: none;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.06);
    z-index: 200;
    height: 56px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nav-btn {
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
            flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 0 2px;
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.nav-btn.active {
    color: #1677ff;
    background: rgba(24,144,255,0.08);
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(24,144,255,0.25);
    transform: scale(1.05); font-weight: 700; }
    font-size: 10px;
    min-height: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: #1890ff; }
.nav-icon { font-size: 24px; margin-bottom: 1px; line-height: 1; }
.nav-label { font-size: 10px; line-height: 1.2; }

@media (min-width: 481px) {
    .bottom-nav {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 480px;
    }
}

/* ========== iOS safe area for bottom nav ========== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(56px + env(safe-area-inset-bottom));
    }
    .app-content {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

/* ========== Tab 内容 ========== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========== 仪表盘 ========== */
.summary-card { background: linear-gradient(135deg, #1890ff, #096dd9); color: #fff; }
.summary-card .card-title { color: rgba(255,255,255,0.8); }
display: -webkit-box;
display: -webkit-flex;

/* ============ 月报汇总样式 ============ */
.monthly-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-sizing: border-box;
    overflow: hidden;
}
.ms-section { margin-bottom: 0; }
.ms-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    font-size: 13px;
    color: #595959;
    padding: 6px 0;
    line-height: 1.4;
}
.ms-revenue .ms-row { padding: 4px 0 8px; }
.ms-label { color: #595959; }
.ms-value { color: #262626; font-weight: 500; font-variant-numeric: tabular-nums; }
.ms-value-blue { color: #1890ff; font-size: 18px; font-weight: 700; }
.ms-value-wrap { display: inline-flex; align-items: baseline; gap: 4px; }
.ms-rate { font-size: 11px; color: #8c8c8c; font-weight: 500; }
.ms-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
.ms-divider-bold { height: 1px; background: #d9d9d9; margin: 6px 0; }
.ms-cost .ms-row { padding: 5px 0; font-size: 13px; }
.ms-row-profit {
    padding: 8px 0 6px;
    font-size: 14px;
    color: #262626;
    font-weight: 600;
}
.ms-row-profit .ms-label { color: #262626; font-weight: 600; }
.ms-row-net {
    margin-top: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #e6fffb 0%, #b5f5ec 100%);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #08979c;
}
.ms-row-net .ms-value-net { color: #08979c; font-size: 17px; }
.ms-value-profit { color: #52c41a; font-size: 16px; font-weight: 700; }
.ms-value-profit.loss { color: #ff4d4f; }
.ms-biz {
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1px dashed #e8e8e8;
    font-size: 12px;
    color: #8c8c8c;
    text-align: center;
    line-height: 1.5;
}
.ms-biz strong { color: #389e0d; font-weight: 700; font-size: 14px; margin: 0 2px; }

.summary-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between; gap: 8px; }
.summary-item { flex: 1; text-align: center; }
.summary-label { display: block; font-size: 12px; opacity: 0.8; margin-bottom: 4px; }
.summary-value { display: block; font-size: 19px; font-weight: 700; }

/* 仪表盘详情列表 */
.dash-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.dash-detail-item {
    background: #f5f6fa;
    border-radius: 6px;
    padding: 5px 3px;
    border: 1px solid #e8e8e8;
    text-align: center;
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
            flex-direction: column;
    gap: 2px;
}
.dash-detail-name { font-size: 11px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-detail-qty { font-size: 15px; color: #1890ff; font-weight: 700; }
.dash-detail-amt { font-size: 13px; color: #ff4d4f; font-weight: 700; }
.dash-detail-sub { font-size: 10px; color: #999; }

/* ========== 营收金额录入 ========== */
.entry-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.entry-col {
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    padding: 6px 8px;
    border: 1px solid transparent;
}
.entry-col:nth-child(1) { background: #e8f5e9; }
.entry-col:nth-child(2) { background: #e3f2fd; }
.entry-col:nth-child(3) { background: #fff8e1; }
.entry-col-icon {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.entry-col-icon svg {
    width: 32px;
    height: 32px;
}
.entry-col:focus-within { background: #ffcdd2 !important; transform: scale(1.05); transition: all 0.15s ease; box-shadow: 0 0 0 2px #ef5350; border-radius: 8px; }
.entry-col-input {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 17px;
    box-sizing: border-box;
    background: #fff;
}
.entry-total {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    font-size: 17px;
    font-weight: 700;
    border-top: 2px solid #1890ff;
    margin-top: 8px;
}
.msg-text { text-align: center; margin-top: 10px; font-size: 13px; min-height: 20px; }
.msg-text.success { color: #52c41a; }
.msg-text.error { color: #ff4d4f; }

/* ========== 报表 ========== */
.report-tabs {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 12px;
}
.report-tab {
    flex: 1;
    padding: 7px 8px;
    border: none;
    background: none;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    border-radius: 6px;
    border-bottom: none;
    transition: all .15s ease;
}
.report-tab.active { background: #fff; color: #1890ff; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 月报：月份标题 + 左右切换箭头（合并一行） */
.report-month-nav {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.report-month-title { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.report-nav-btn {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 1px solid #1677ff;
    background: #e6f0ff;
    color: #1677ff;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.report-nav-btn:active { background: #1677ff; color: #fff; }
.report-nav-ico { display: block; flex-shrink: 0; }

/* 年报：年份选择行 */
display: -webkit-box;
display: -webkit-flex;
.report-year-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.report-year-label { font-size: 13px; color: #666; white-space: nowrap; }
.report-year-select { flex: 1; font-size: 14px; font-weight: 600; }

/* 月度汇总：日期区间行 */
display: -webkit-box;
display: -webkit-flex;
.report-date-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.report-date-field { flex: 1; }
.report-date-field label { display: block; font-size: 12px; color: #999; margin-bottom: 4px; }
.report-date-field input { width: 100%; padding: 8px 10px; }
.report-date-sep { color: #bbb; padding-bottom: 9px; font-size: 13px; }

.report-content { display: none; padding: 4px 0; }
.report-content.active { display: block; }

.report-total { font-size: 22px; font-weight: 700; color: #1890ff; margin: 8px 0; }

.daily-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.daily-item:last-child { border-bottom: none; }
.daily-item .cat { color: #666; }
.daily-item .amt { font-weight: 600; }

.monthly-day, .yearly-month {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.monthly-day:last-child, .yearly-month:last-child { border-bottom: none; }

/* 报表利润汇总 */
.profit-summary-card {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
}
.profit-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
}
.profit-row:last-child {
    font-size: 18px;
    font-weight: 700;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #b7eb8f;
}
.profit-positive { color: #52c41a; }
.profit-negative { color: #ff4d4f; }

/* 成本明细行 */
.report-cost-line { font-size: 18px; font-weight: 600; color: #ff4d4f; margin: 4px 0; }

/* 月报日历图表 */
.report-calendar { margin-top: 4px; overflow: hidden; }
.cal-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 11px;
    color: #999;
    text-align: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.cal-week-header span { font-size: 12px; font-weight: 600; color: #666; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-top: 3px;
}
.cal-day {
    border-radius: 6px;
    padding: 5px 3px 4px;
    text-align: center;
    font-size: 11px;
    cursor: default;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid transparent;
}
.cal-day-num { font-size: 14px; font-weight: 700; color: #333; line-height: 1.2; }
.cal-day-empty { min-height: 0; padding: 0; border: none; background: transparent; }
/* 有营业 - 绿色 */
.cal-day-open {
    background: #f6ffed;
    border-color: #b7eb8f;
    cursor: pointer;
}
.cal-day-open .cal-day-num { color: #389e0d; }
.cal-day-revenue { font-size: 12px; color: #1890ff; font-weight: 700; line-height: 1.2; padding-bottom: 2px; border-bottom: 1px dashed #d9d9d9; margin-bottom: 2px; white-space: nowrap; overflow: hidden; }
.cal-day-profit { font-size: 12px; color: #52c41a; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; }
/* 无营业 - 红色(休息) */
.cal-day-rest {
    background: #fff1f0;
    border-color: #ffa39e;
    cursor: pointer;
}
.cal-day-rest .cal-day-num { color: #cf1322; }
.cal-day-rest-tag { font-size: 10px; color: #ff4d4f; line-height: 1.2; }
/* 未来日期 - 灰色 */
.cal-day-future { background: #fafafa; border-color: #eee; }
.cal-day-future .cal-day-num { color: #bbb; }
/* 点击高亮 */
.cal-day-open:active, .cal-day-rest:active { opacity: 0.7; }

/* ========== 我的页面 ========== */
.user-card { text-align: center; }
.user-avatar { font-size: 48px; margin-bottom: 8px; }
.user-card h3 { font-size: 18px; }
.user-card p { font-size: 13px; color: #999; }

/* 管理列表 */
.admin-list-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.admin-list-item:last-child { border-bottom: none; }
.admin-item-info { flex: 1; }
.admin-item-name { font-size: 15px; font-weight: 500; color: #333; }
.admin-item-meta { font-size: 12px; color: #999; margin-top: 2px; }
display: -webkit-box;
display: -webkit-flex;
.admin-item-actions { display: flex; gap: 6px; }

/* 模态框表单 */
.modal-form-group { margin-bottom: 12px; }
.modal-form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.modal-form-group input, .modal-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 15px;
}
.modal-checkbox-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.modal-checkbox-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    padding: 6px 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* ========== Canvas 图表 ========== */
canvas { max-width: 100%; }

/* ========== 加载动画 ========== */
.loading { text-align: center; padding: 40px; color: #999; font-size: 14px; }

/* ========== 店铺下拉框 ========== */
.shop-select {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.shop-select label { font-size: 13px; color: #666; white-space: nowrap; }
.shop-select select { flex: 1; }

/* ========== 模态对话框 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
display: -webkit-box;
display: -webkit-flex;
.modal-overlay.show { display: flex; }
.modal-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    width: 92%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.modal-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close {
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    line-height: 28px;
    text-align: center;
    padding: 0;
    flex-shrink: 0;
}
.modal-close:hover { background: #ff4d4f; color: #fff; }
.modal-body { font-size: 13px; }
.modal-footer {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.modal-footer .btn { flex: 1; }

/* 弹窗内 balance-grid 更紧凑 */
.modal-dialog .balance-grid {
    gap: 3px;
}
.modal-dialog .balance-grid-card {
    padding: 3px 2px;
}
.modal-dialog .balance-grid-card:nth-child(16n+1),
.modal-dialog .balance-grid-card:nth-child(16n+2),
.modal-dialog .balance-grid-card:nth-child(16n+3),
.modal-dialog .balance-grid-card:nth-child(16n+4) { background: #e0f7fa; }
.modal-dialog .balance-grid-card:nth-child(16n+5),
.modal-dialog .balance-grid-card:nth-child(16n+6),
.modal-dialog .balance-grid-card:nth-child(16n+7),
.modal-dialog .balance-grid-card:nth-child(16n+8) { background: #e8eaf6; }
.modal-dialog .balance-grid-card:nth-child(16n+9),
.modal-dialog .balance-grid-card:nth-child(16n+10),
.modal-dialog .balance-grid-card:nth-child(16n+11),
.modal-dialog .balance-grid-card:nth-child(16n+12) { background: #e0f7fa; }
.modal-dialog .balance-grid-card:nth-child(16n+13),
.modal-dialog .balance-grid-card:nth-child(16n+14),
.modal-dialog .balance-grid-card:nth-child(16n+15),
.modal-dialog .balance-grid-card:nth-child(16n+16) { background: #e8eaf6; }

.balance-grid-card:nth-child(16n+1),
.balance-grid-card:nth-child(16n+2),
.balance-grid-card:nth-child(16n+3),
.balance-grid-card:nth-child(16n+4) { background: #e0f7fa; }
.balance-grid-card:nth-child(16n+5),
.balance-grid-card:nth-child(16n+6),
.balance-grid-card:nth-child(16n+7),
.balance-grid-card:nth-child(16n+8) { background: #e8eaf6; }
.balance-grid-card:nth-child(16n+9),
.balance-grid-card:nth-child(16n+10),
.balance-grid-card:nth-child(16n+11),
.balance-grid-card:nth-child(16n+12) { background: #e0f7fa; }
.balance-grid-card:nth-child(16n+13),
.balance-grid-card:nth-child(16n+14),
.balance-grid-card:nth-child(16n+15),
.balance-grid-card:nth-child(16n+16) { background: #e8eaf6; }

.modal-dialog .balance-grid-input {
    padding: 4px 3px;
    font-size: 14px;
}
.modal-dialog .balance-grid-unit {
    font-size: 9px;
}
.modal-dialog .entry-col {
    padding: 4px 3px;
}
.modal-dialog .entry-col-icon svg {
    width: 28px;
    height: 28px;
}
.modal-dialog .entry-col:focus-within { background: #ffcdd2 !important; transform: scale(1.05); transition: all 0.15s ease; box-shadow: 0 0 0 2px #ef5350; border-radius: 8px; }
.entry-col-input {
    padding: 5px 3px;
    font-size: 14px;
}

/* ========== 出货数两列卡片 ========== */
.shipment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 10px;
}
.shipment-card {
    background: #fff;
    border-radius: 6px;
    padding: 6px 3px 4px;
    border: 1px solid #e8e8e8;
    text-align: center;
    overflow: hidden;
}
.shipment-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shipment-card .ship-qty {
    width: 48px;
    padding: 5px 2px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 2px;
}
.ship-action-wrap {
    display: flex !important;
    flex-direction: row;
    gap: 2px;
    margin-top: 3px;
}
.ship-action-wrap[style*="display:none"],
.ship-action-wrap[style*="display: none"] {
    display: none !important;
}
.ship-save-one-btn, .ship-del-btn {
    flex: 1;
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 1px !important;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 10px !important;
    cursor: pointer;
    line-height: 1;
    min-width: 0;
}
.ship-save-one-btn { background: #52c41a; }
.ship-del-btn { background: #ff4d4f; }
.ship-btn-svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ========== 结余录入两列布局 ========== */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.balance-grid-card {
    border-radius: 8px;
    padding: 8px 5px 10px;
    border: none;
    position: relative;
    text-align: center;
}
.balance-grid-input {
    width: 100%;
    padding: 5px 3px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    background: #fff;
    color: #1a1a2e;
    font-weight: 600;
    transition: border-color 0.2s;
}
.balance-grid-card:focus-within {
    background: #ffcdd2 !important;
    transform: scale(1.08);
    transition: all 0.15s ease;
    box-shadow: 0 0 0 2px #ef5350;
}
.balance-grid-input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}
.balance-grid-unit { display: none; }
/* 删除按钮 - 小叉号 */
.balance-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    border: none;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}
.balance-grid-card:hover .balance-delete-btn,
.balance-grid-card:active .balance-delete-btn { opacity: 1; }
.balance-delete-btn.visible { opacity: 1; }

/* === 结余界面小屏优化 === */
#tab-balance .card {
    padding: 6px 8px;
    margin: 3px 8px;
}
#tab-balance .card-title {
    font-size: 12px;
    margin-bottom: 4px;
}
#tab-balance .entry-total {
    padding: 6px 0;
    font-size: 18px;
    margin-top: 2px;
    border-top-width: 1px;
}
#tab-balance .form-row { gap: 4px; }
#tab-balance select, #tab-balance input[type="date"] {
    font-size: 13px;
    padding: 4px 6px;
}
#tab-balance .btn {
    padding: 8px 10px;
    font-size: 13px;
}
#tab-balance .balance-grid {
    gap: 3px;
}
#tab-balance .balance-grid-name {
    font-size: 19px;
    color: #1e3a5f;
}
#tab-balance .balance-grid-input {
    padding: 4px 3px;
    font-size: 14px;
}
#tab-balance .balance-grid-unit {
    font-size: 8px;
}
#tab-balance .entry-row {
    gap: 3px;
    margin-bottom: 4px;
}
#tab-balance .entry-col {
    gap: 2px;
    padding: 4px 4px;
}
#tab-balance .entry-col-icon svg {
    width: 22px;
    height: 22px;
}
#tab-balance .entry-col-input {
    padding: 6px 2px;
    font-size: 15px;
}
#tab-balance .entry-col:focus-within { background: #ffcdd2 !important; transform: scale(1.05); transition: all 0.15s ease; box-shadow: 0 0 0 2px #ef5350; border-radius: 8px; }
.entry-col-input {
    padding: 6px 4px;
    font-size: 16px;
}
/* === 出货数小屏优化 === */
#tab-shipment .card {
    padding: 8px 10px;
    margin: 4px 10px;
}
#tab-shipment .card-title {
    font-size: 13px;
    margin-bottom: 8px;
}
#tab-shipment #shipment-sales-total {
    font-size: 14px;
    padding: 6px 10px;
}
#tab-shipment .btn {
    padding: 10px 12px;
    font-size: 14px;
}

/* === 仪表盘小屏优化 === */
#tab-dashboard .card {
    padding: 8px 10px;
    margin: 4px 10px;
}
#tab-dashboard .card-title {
    font-size: 13px;
    margin-bottom: 8px;
}
#tab-dashboard #dash-sold-total {
    font-size: 14px;
}
#tab-balance .balance-delete-btn {
    font-size: 10px;
    line-height: 16px;
}

/* ========== 成本核算表格 ========== */
.cost-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cost-table {
    width: 100%;
    font-size: 11px;
    border-collapse: collapse;
}
.cost-table th {
    padding: 5px 2px;
    color: #888;
    font-size: 10px;
    text-align: center;
    background: #fafafa;
    white-space: nowrap;
}
.cost-table th:first-child { text-align: left; padding-left: 4px; }
.cost-table th:last-child { text-align: right; padding-right: 4px; }
.cost-table td {
    padding: 4px 2px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    vertical-align: middle;
}
.cost-table tr:nth-child(even) td { background: #e8eaed; }
.cost-edit-input {
    width: 42px;
    padding: 3px 2px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    font-size: 11px;
    text-align: center;
    box-sizing: border-box;
}
.cost-edit-input:focus { border-color: #1890ff; }
#tab-cost .card {
    padding: 8px 6px;
    margin: 4px 8px;
}

/* 补售出弹窗产品列表 */
.additional-sales-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}
.additional-sales-item:last-child { border-bottom: none; }
.additional-sales-name { flex: 1; font-size: 14px; }
.additional-sales-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* ========== 数据可视化表格 ========== */
.data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 8px 0;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    padding: 8px 6px;
    background: #1890ff;
    color: #fff;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}
.data-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    font-size: 13px;
}
.data-table tr:nth-child(even) td { background: #f9f9f9; }
.data-table .editable-cell {
    cursor: pointer;
    border: 1px dashed transparent;
    border-radius: 4px;
    padding: 4px 6px;
    transition: border-color 0.2s;
}
.data-table .editable-cell:hover { border-color: #1890ff; background: #e6f7ff; }
.data-table .editing-cell input {
    width: 80px;
    padding: 4px 6px;
    border: 1px solid #1890ff;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.shipment-card:nth-child(4n+1),
.shipment-card:nth-child(4n+2),
.shipment-card:nth-child(4n+3),
.shipment-card:nth-child(4n+4) { background: #fff; }
.shipment-card:nth-child(8n+5),
.shipment-card:nth-child(8n+6),
.shipment-card:nth-child(8n+7),
.shipment-card:nth-child(8n+8) { background: #e8eaed; }

/* ========== 杂项费用弹窗 ========== */
.misc-modal-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f6;
}
.misc-modal-date {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.5px;
}
.misc-modal-section {
    margin-bottom: 4px;
}
.misc-modal-section-title {
    font-size: 12px;
    color: #8c8c8c;
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 2px;
    letter-spacing: 0.5px;
}
.misc-item-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    background: #f8f9fb;
    border-radius: 10px;
    padding: 10px 12px;
    transition: all 0.15s ease;
}
.misc-item-row:focus-within {
    background: #eef5ff;
    box-shadow: 0 0 0 1.5px #91caff;
}
.misc-item-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.misc-item-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    min-width: 48px;
}
.misc-item-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    text-align: right;
    background: #fff;
    transition: border-color 0.15s;
    min-width: 0;
}
.misc-item-input:focus {
    border-color: #1677ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.misc-item-name {
    flex: 1.5;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    transition: border-color 0.15s;
    min-width: 0;
}
.misc-item-name:focus {
    border-color: #1677ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.misc-item-unit {
    font-size: 13px;
    color: #999;
    flex-shrink: 0;
}
.misc-remove-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.misc-remove-btn:hover {
    background: #ff4d4f;
    color: #fff;
}
.misc-empty-hint {
    text-align: center;
    color: #bbb;
    font-size: 13px;
    padding: 10px 0;
}
.misc-add-btn {
    display: block;
    width: 100%;
    padding: 9px 0;
    border: 1.5px dashed #1677ff;
    background: #f0f7ff;
    color: #1677ff;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}
.misc-add-btn:hover {
    background: #e6f4ff;
    border-color: #4096ff;
}
.misc-modal-total {
    display: -webkit-box;
    display: -webkit-flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #fff7e6, #fff1f0);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
}
.misc-modal-total span:last-child {
    font-size: 20px;
    letter-spacing: -0.5px;
}
.btn-sm-delete {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
    background: #fff;
    color: #ff4d4f;
    border: 1px solid #ff4d4f;
    border-radius: 8px;
    cursor: pointer;
    margin-right: auto;
    transition: all 0.15s;
}
.btn-sm-delete:hover {
    background: #ff4d4f;
    color: #fff;
}

/* ========== 店铺按钮行（全局） ========== */
.rpt-shop-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    font-size: 14px;
    background: #fff;
    color: #595959;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    line-height: 1.4;
}
.rpt-shop-btn.active {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}
.rpt-shop-btn:hover {
    filter: brightness(0.95);
}
/* 所有按钮行容器隐藏滚动条 */
[id$="-shop-buttons"]::-webkit-scrollbar {
    display: none;
}

/* ===== 结余到账：输入框保持白色，周围按支付方式提亮（v13-balance-glow）===== */
/* 周围（列容器）提亮：微信绿 / 支付宝蓝 / 现金金 */
#tab-balance .entry-col[data-cat-id="1"] { background: #e7f8ee; }
#tab-balance .entry-col[data-cat-id="2"] { background: #eaf2ff; }
#tab-balance .entry-col[data-cat-id="3"] { background: #fff5e0; }
#tab-balance .entry-col[data-cat-id="1"],
#tab-balance .entry-col[data-cat-id="2"],
#tab-balance .entry-col[data-cat-id="3"] { border-radius: 10px; }
/* 输入框本身保持白色底色，边框呼应支付色 */
#tab-balance .entry-col-input[data-cat-id="1"],
#tab-balance .entry-col-input[data-cat-id="2"],
#tab-balance .entry-col-input[data-cat-id="3"] { background: #fff; }
#tab-balance .entry-col-input[data-cat-id="1"] { border-color: #34c97a; }
#tab-balance .entry-col-input[data-cat-id="2"] { border-color: #4096ff; }
#tab-balance .entry-col-input[data-cat-id="3"] { border-color: #f5b23a; }
/* 聚焦：周围颜色加深 + 对应色光晕，输入框仍为白色 */
#tab-balance .entry-col[data-cat-id="1"]:focus-within { background: #d0f1e0 !important; box-shadow: 0 0 0 2px rgba(7,193,96,.35) !important; }
#tab-balance .entry-col[data-cat-id="2"]:focus-within { background: #d2e6ff !important; box-shadow: 0 0 0 2px rgba(22,119,255,.35) !important; }
#tab-balance .entry-col[data-cat-id="3"]:focus-within { background: #ffecc4 !important; box-shadow: 0 0 0 2px rgba(250,173,20,.35) !important; }
/* 补售出弹窗：同样"输入框白底 + 周围提亮" */
#add-sales-wechat { background: #fff !important; border-color: #34c97a !important; }
#add-sales-alipay { background: #fff !important; border-color: #4096ff !important; }
#add-sales-cash { background: #fff !important; border-color: #f5b23a !important; }
.modal-dialog .entry-col:has(#add-sales-wechat) { background: #e7f8ee !important; border-radius: 10px !important; }
.modal-dialog .entry-col:has(#add-sales-alipay) { background: #eaf2ff !important; border-radius: 10px !important; }
.modal-dialog .entry-col:has(#add-sales-cash) { background: #fff5e0 !important; border-radius: 10px !important; }
.modal-dialog .entry-col:has(#add-sales-wechat):focus-within { background: #d0f1e0 !important; }
.modal-dialog .entry-col:has(#add-sales-alipay):focus-within { background: #d2e6ff !important; }
.modal-dialog .entry-col:has(#add-sales-cash):focus-within { background: #ffecc4 !important; }

