/* 卡曼智能出入库系统 - 业务页面样式 */

/* ---------- 工作台 ---------- */
.dash-greeting { font-size: 28px; font-weight: 730; letter-spacing: -.6px; }
.dash-sub { color: var(--text-2); font-size: 13px; margin-top: 7px; }
.dash-date { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow-xs); white-space: nowrap; }
.dash-date svg { width: 15px; height: 15px; color: var(--primary); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chart-card .card-body { padding: 16px 20px 20px; }
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--primary); display: inline-block; }
.chart-legend i.teal { background: var(--teal); }
.trend-chart { width: 100%; height: 216px; margin-top: 10px; position: relative; }
.trend-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-axis-label { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart-bar { fill: color-mix(in srgb, var(--primary) 24%, transparent); transition: fill var(--transition); }
.chart-bar:hover { fill: color-mix(in srgb, var(--primary) 42%, transparent); }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 5px 8px rgba(15, 166, 151, .22)); }
.chart-dot { fill: var(--surface); stroke: var(--teal); stroke-width: 2.5; }
.chart-tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; box-shadow: var(--shadow-md); font-size: 11px; color: var(--text-2); opacity: 0; transform: translate(-50%, -110%); transition: opacity var(--transition); white-space: nowrap; z-index: 3; }
.chart-tooltip.show { opacity: 1; }
.chart-tooltip strong { color: var(--text); }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); border-radius: 10px; }
.recent-item:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-item:hover { background: var(--surface-2) !important; }
.recent-doc-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.recent-doc-icon.out { background: var(--teal-soft); color: var(--teal); }
.recent-doc-icon svg { width: 17px; height: 17px; }
.recent-copy { flex: 1; min-width: 0; }
.recent-title { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.recent-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-amount { text-align: right; flex: 0 0 auto; }
.recent-amount strong { display: block; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.recent-amount span { font-size: 10.5px; color: var(--text-3); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-action { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); text-align: left; transition: all var(--transition); }
.quick-action:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.quick-action-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--primary); border: 1px solid var(--border); flex: 0 0 auto; }
.quick-action-icon svg { width: 16px; height: 16px; }
.quick-action strong { display: block; font-size: 12px; font-weight: 650; color: var(--text); }
.quick-action span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.batch-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.batch-item:last-child { border-bottom: 0; }
.batch-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: 0 0 auto; }
.batch-icon svg { width: 14px; height: 14px; }
.batch-copy { flex: 1; min-width: 0; }
.batch-name { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-meta { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.batch-count { font-size: 11px; color: var(--success); font-weight: 650; white-space: nowrap; }

/* ---------- 单据管理 / 发票台账 ---------- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.filter-bar .search-box { flex: 0 1 300px; }
.filter-bar .date-field { width: 148px; }
.filter-bar .date-field .input { height: 38px; }
.docs-summary { display: flex; align-items: center; gap: 14px; padding: 11px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.docs-summary strong { color: var(--text); font-weight: 700; }
.docs-summary .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); flex: 0 0 auto; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--primary-soft); border-bottom: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); flex-wrap: wrap; animation: fadeIn 160ms ease both; }
.bulk-bar .bulk-text { font-size: 12px; color: var(--text-2); flex: 1; min-width: 160px; }
.bulk-bar .bulk-text strong { color: var(--primary); }
.doc-type { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 6px; }
.doc-type.in { background: var(--primary-soft); color: var(--primary); }
.doc-type.out { background: var(--teal-soft); color: var(--teal); }
.doc-no-link { border: 0; background: transparent; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--primary); font-family: "SFMono-Regular", Consolas, monospace; text-align: left; }
.doc-no-link:hover { text-decoration: underline; }
.doc-party { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-3); background: var(--surface-3); border-radius: 5px; padding: 1px 5px; margin-left: 6px; }
.invoice-docs { display: flex; gap: 4px; flex-wrap: wrap; }
.ledger-lock { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; background: var(--success-soft); color: var(--success); align-items: center; justify-content: center; }
.ledger-lock svg { width: 11px; height: 11px; }
.ledger-tabs-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ledger-tabs-tip { font-size: 11.5px; color: var(--text-3); }

/* 发票总表（Excel 风格） */
.ledger-card { overflow: hidden; }
.ledger-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ledger-toolbar .search-box { flex: 0 1 300px; }
.ledger-date { width: 140px; height: 38px; min-height: 38px; }
.ledger-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ledger-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ledger-legend span { margin-left: 4px; }
.ledger-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.ledger-summary strong { color: var(--text); font-weight: 700; }
.ledger-tip { margin-left: auto; font-size: 10.5px; color: var(--text-3); }
.ledger-wrap { overflow: auto; max-height: calc(100vh - 276px); min-height: 380px; }
.ledger-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1115px; table-layout: fixed; font-size: 10.5px; }
.ledger-table th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); padding: 9px 8px; text-align: left; font-size: 10.5px; color: var(--text-3); font-weight: 650; white-space: nowrap; }
.ledger-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 32px; }
.ledger-table tbody tr:last-child td { border-bottom: 0; }
.ledger-row.g-row td { background: color-mix(in srgb, var(--gc) 2.8%, var(--surface)); }
.ledger-row.g-row td:first-child { border-left: 1.5px solid var(--gc); }
.ledger-row.g-row td:last-child { border-right: 1.5px solid var(--gc); }
.ledger-row.g-start td { border-top: 1.5px solid var(--gc); }
.ledger-row.g-end td { border-bottom: 1.5px solid var(--gc); }
.ledger-index { color: var(--text-3); font-variant-numeric: tabular-nums; }
.ledger-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.ledger-invoice { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10.5px; color: var(--text); }
.ledger-invoice.strong { font-weight: 700; color: var(--gc); }
.ledger-product { white-space: normal !important; font-weight: 600; line-height: 1.4; }
.ledger-row td.center { text-align: center; }
.ledger-row td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-row .strong { font-weight: 700; }
.ledger-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ledger-info { font-size: 11.5px; color: var(--text-3); }
.ledger-info strong { color: var(--text); }
.ledger-pager { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.ledger-pager strong { color: var(--primary); }
.ledger-jump { width: 64px; height: 30px; min-height: 30px; text-align: center; padding: 3px 6px; }
.ledger-empty { padding: 20px; }

/* 发票明细弹窗 */
.invoice-detail-head { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; }
.invoice-detail-head span { display: block; font-size: 10px; color: var(--text-3); }
.invoice-detail-head strong { display: block; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 账号管理 */
.role-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 6px; }
.role-badge.admin { background: var(--warning-soft); color: var(--warning); }
.role-badge.user { background: var(--surface-3); color: var(--text-2); }
.role-badge svg { width: 11px; height: 11px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status-dot i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-dot.disabled i { background: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3); }

/* 生成单据弹窗 */
.gen-summary { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 13px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.gen-summary-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.gen-summary-icon svg { width: 19px; height: 19px; }
.gen-summary strong { display: block; font-size: 14px; }
.gen-summary span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.gen-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gen-option { border: 1.5px solid var(--border); border-radius: 12px; padding: 13px; cursor: pointer; transition: all var(--transition); background: var(--surface); }
.gen-option:hover { border-color: var(--primary); }
.gen-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.gen-option-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.gen-option-top svg { width: 17px; height: 17px; color: var(--primary); }
.gen-option p { font-size: 11px; color: var(--text-3); margin-top: 5px; line-height: 1.55; }
.gen-preview { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 11.5px; color: var(--text-3); line-height: 1.7; }
.gen-preview strong { color: var(--text-2); }

@media (max-width: 1280px) {
    .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
    .ledger-legend { display: none; }
    .ledger-wrap { max-height: calc(100vh - 262px); }
}
@media (max-width: 860px) {
    .dash-greeting { font-size: 23px; }
    .filter-bar .date-field { width: calc(50% - 18px); }
    .filter-bar .search-box { max-width: none; width: 100%; flex-basis: 100%; }
    .gen-options { grid-template-columns: 1fr; }
    .bulk-bar .btn { flex: 1; }
    .ledger-toolbar .search-box { flex-basis: 100%; max-width: none; }
    .ledger-date { width: calc(50% - 18px); }
    .ledger-tabs-tip { display: none; }
    .ledger-summary { gap: 8px; }
    .ledger-tip { display: none; }
    .ledger-foot { justify-content: center; }
    .ledger-pager { justify-content: center; }
    .invoice-detail-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .quick-actions { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ledger-tabs-bar { padding: 12px 14px; }
    .ledger-toolbar { padding: 12px 14px; }
    .ledger-summary { padding: 8px 14px; }
}



.gen-doc-row { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.gen-doc-row svg { width: 16px; height: 16px; color: var(--primary); flex: 0 0 auto; }
.doc-type svg { width: 12px; height: 12px; flex: 0 0 auto; }

/* ---------- 生成状态超链接 ---------- */
.status-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 650;
    color: var(--primary);
    padding: 2px 0;
    border-bottom: 1px dashed color-mix(in srgb, currentColor 45%, transparent);
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.status-link:hover { text-decoration: none; border-bottom-color: currentColor; }
.status-link svg { width: 11px; height: 11px; opacity: .72; }
.status-link.is-green { color: var(--success); }
.status-link.is-amber,
.status-link.is-gray { color: var(--warning); }
.status-cell { overflow: visible !important; }

/* ---------- 工作台（新版排版） ---------- */
.dash-view { display: flex; flex-direction: column; gap: 16px; }
.dash-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 24px 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(720px 240px at 100% -60%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 72%),
        var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.dash-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--teal) 10%, transparent), transparent 68%);
    pointer-events: none;
}
.dash-hero-copy { position: relative; z-index: 1; min-width: 0; }
.dash-hero-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.dash-hero-eyebrow svg { width: 14px; height: 14px; color: var(--primary); flex: 0 0 auto; }
.dash-hero-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.dash-hero-title { font-size: 24px; line-height: 1.25; font-weight: 720; letter-spacing: -.5px; margin-top: 9px; }
.dash-hero-desc { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.dash-hero-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.stat-cell { background: var(--surface); padding: 17px 20px; min-width: 0; transition: background var(--transition); }
.stat-cell:hover { background: color-mix(in srgb, var(--primary) 2.5%, var(--surface)); }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-icon.teal { background: var(--teal-soft); color: var(--teal); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-value { margin-top: 12px; font-size: 26px; font-weight: 730; letter-spacing: -.9px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value.small { font-size: 21px; }
.stat-value small { font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.stat-foot { margin-top: 6px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-foot strong { color: var(--text-2); font-weight: 600; }

.dash-body { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.todo-card .card-body { padding: 16px; }
.todo-inner { display: flex; align-items: center; gap: 12px; }
.todo-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: 0 0 auto; }
.todo-icon.is-active { background: var(--warning-soft); color: var(--warning); }
.todo-icon svg { width: 18px; height: 18px; }
.todo-copy { flex: 1; min-width: 0; }
.todo-copy strong { display: block; font-size: 12.5px; font-weight: 650; line-height: 1.4; }
.todo-copy span { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.dash-side .quick-actions { grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-side .quick-action { flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px 12px; }
.quick-action-copy { display: block; min-width: 0; width: 100%; }
.quick-action-copy strong { display: block; font-size: 12px; font-weight: 650; color: var(--text); }
.quick-action-copy span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-view .recent-item { padding: 11px 8px; margin: 0 -8px; border-radius: 10px; }

@media (max-width: 1280px) {
    .dash-body { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .dash-hero { padding: 20px; }
    .dash-hero-title { font-size: 21px; }
    .dash-hero-actions { width: 100%; }
    .dash-hero-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
    .stat-strip { grid-template-columns: 1fr; }
    .dash-side .quick-actions { grid-template-columns: 1fr; }
}
