#salesMonthlySheet[hidden],#salesMonthlyShortcuts[hidden] { display:none!important; }
#searchPage.sales-monthly-active #searchResultList,#searchPage.sales-monthly-active #searchEmptyState { display:none!important; }
#searchPage.sales-chart-active #salesMonthlySheet,#searchPage.sales-chart-active #salesMonthlyShortcuts { display:none!important; }
#salesMonthlyShortcuts { display:inline-flex;gap:4px; }
#salesMonthlyShortcuts button { border:1px solid #667eea;color:#485cc9;border-radius:5px;background:white;padding:6px 8px;cursor:pointer;white-space:nowrap; }
#salesMonthlySheet { background:white; }
.monthly-sheet-scroll { overflow:auto;max-height:65vh;scrollbar-gutter:stable; }
.monthly-sheet-table { table-layout:fixed;border-collapse:collapse;font-size:13px;max-width:none!important; }
.monthly-sheet-table th,.monthly-sheet-table td { border:1px solid #94a3b8;padding:4px;position:relative;vertical-align:middle;box-sizing:border-box;overflow-wrap:anywhere; }
.monthly-sheet-table th { background:#f0f4ff;color:#334155; }
.monthly-sheet-table .monthly-title { font-size:16px;text-align:left;padding:8px; }
#monthlyPeriodLabel { color:#888;font-size:12px;font-weight:400;margin-left:8px; }
.monthly-sheet-table input,.monthly-sheet-table textarea { width:100%;min-width:0;border:0;background:transparent;font:inherit;box-sizing:border-box;padding:0;color:inherit; }
.monthly-sheet-table textarea { display:block;resize:none;line-height:18px; }
.monthly-sheet-table textarea { padding-right:12px; }
.monthly-sheet-table input { display:block; }
.monthly-insert { position:absolute;left:100%;top:0;z-index:4;border:1px solid #667eea;background:#fff;color:#485cc9;font-size:11px;padding:2px;white-space:nowrap; }
.monthly-insert[hidden] { display:none; }
.monthly-replace { border:0;background:transparent;color:#667eea;cursor:pointer;font-size:9px;padding:0;position:absolute;right:2px;top:16px; }
.monthly-replace.monthly-unbound,.monthly-association-legend .monthly-unbound { color:#e74c3c; }
.monthly-association-legend { color:#667eea;font-size:11px;font-weight:400; }
.monthly-sheet-table input:not([readonly]),.monthly-sheet-table textarea:not([readonly]) { outline:1px solid #667eea;background:#fffde7; }
.monthly-sheet-table .monthly-amount { text-align:right;font-variant-numeric:tabular-nums; }
.monthly-amount [data-monthly-money] { cursor:pointer; }
.monthly-manual-point { color:#9333ea;border:0;background:transparent;font-size:10px;padding:0 2px 0 0;cursor:pointer;vertical-align:middle; }
.monthly-manual-point[hidden] { display:none; }
.monthly-sheet-table .monthly-col-grip { position:absolute;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;touch-action:none;z-index:2; }
.monthly-sheet-table .monthly-row-grip { position:absolute;left:0;bottom:-3px;width:100%;height:6px;cursor:row-resize;touch-action:none;z-index:2; }
.monthly-add { border:0;background:transparent;color:#485cc9;cursor:pointer;font-size:17px;padding:0 2px; }
.monthly-remove { border:0;background:transparent;color:#94a3b8;cursor:pointer;font-size:12px;padding:0;position:absolute;right:2px;top:0; }
.monthly-sheet-total { padding:8px;text-align:right;font-weight:700;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px; }
.monthly-footer-scroll { overflow:hidden;flex:0 0 auto; }
.monthly-footer-tools { display:flex;align-items:center;gap:8px; }
.monthly-total-value { margin-left:auto;white-space:nowrap; }
.monthly-print-button { border:1px solid #667eea;border-radius:4px;background:white;color:#485cc9;font-size:12px;padding:3px 10px;cursor:pointer; }
.monthly-sheet-total { background:white;position:relative;z-index:3; }
@media (min-width:769px) {
    body.sales-search-desktop-layout #searchPage.sales-monthly-active > #salesMonthlySheet { flex:1 1 0!important;min-height:0;display:flex;flex-direction:column;overflow:hidden; }
    body.sales-search-desktop-layout #searchPage.sales-monthly-active #salesMonthlyBody { flex:1 1 0;min-height:0;display:flex;flex-direction:column;overflow:hidden; }
    body.sales-search-desktop-layout #searchPage.sales-monthly-active .monthly-sheet-scroll { flex:1 1 0;min-height:0;max-height:none; }
    body.sales-search-desktop-layout #searchPage.sales-monthly-active .monthly-sheet-total,
    body.sales-search-desktop-layout #searchPage.sales-monthly-active #monthlySheetStatus { flex:0 0 auto; }
}
#monthlySheetStatus { color:#64748b;font-size:12px;min-height:16px; }
#monthlyShopPicker { position:fixed;inset:0;background:#0005;z-index:10001;display:flex;align-items:center;justify-content:center; }
#monthlyShopPicker[hidden] { display:none; }
#monthlyShopPicker > div { background:white;border-radius:8px;width:min(90vw,480px);padding:14px; }
#monthlyShopPicker input { width:100%;padding:8px;border:1px solid #cbd5e1;box-sizing:border-box;margin:8px 0; }
#monthlyShopChoices { height:45vh;overflow:auto; }
#monthlyShopChoices button { display:block;width:100%;padding:9px;text-align:left;border:0;border-bottom:1px solid #eee;background:white;cursor:pointer; }
#monthlyShopChoices button.selected { background:#667eea;color:white; }
.monthly-print-sheet { font-family:"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px;line-height:18px;width:100%;box-sizing:border-box;color:#000; }
.monthly-print-table { width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;line-height:18px; }
.monthly-print-table th,.monthly-print-table td { border:1px solid #777;padding:4px;vertical-align:middle;overflow-wrap:anywhere;white-space:pre-wrap;box-sizing:border-box; }
.monthly-print-table .monthly-print-title { text-align:left;font-size:16px;line-height:20px;padding:8px; }
.monthly-print-title span { color:#888;font-size:12px;font-weight:400; }
.monthly-print-money { text-align:right; }
.monthly-print-total { text-align:right;font-weight:700;padding:8px 4px;break-inside:avoid; }
.monthly-print-table thead { display:table-header-group; }
.monthly-print-table tr { break-inside:avoid;page-break-inside:avoid; }

/* Keep blank zero cells editable, and paginate only monthly sheets. */
.monthly-amount [data-monthly-money] { display:inline-block;min-width:24px;min-height:18px; }
.monthly-print-page + .monthly-print-page { margin-top:6mm; }
@media print {
    .monthly-print-page + .monthly-print-page { margin-top:0;break-before:page;page-break-before:always; }
    .monthly-print-page { break-inside:avoid;page-break-inside:avoid; }
}
.monthly-image-gallery {position:fixed;inset:0;background:#0006;z-index:10010;display:flex;align-items:center;justify-content:center;}
.monthly-image-gallery[hidden] {display:none!important;}
.monthly-image-gallery section {background:white;width:min(90vw,760px);max-height:85vh;border-radius:8px;padding:16px;display:flex;flex-direction:column;}
.monthly-image-gallery header {display:flex;justify-content:space-between;align-items:center;padding-bottom:12px;}
.monthly-image-list {overflow:auto;}
.monthly-image-list article {display:flex;gap:16px;align-items:center;padding:12px 0;border-bottom:1px solid #ddd;}
.monthly-image-list article img {width:100px;height:135px;object-fit:contain;cursor:pointer;background:#f5f5f5;}
.monthly-image-list article div {flex:1;overflow-wrap:anywhere;}
.monthly-image-list article button {color:#c0392b;}
.monthly-image-view {position:fixed;inset:0;background:#333e;z-index:10011;overflow:auto;text-align:center;padding:48px 12px 12px;}
.monthly-image-view button {position:fixed;right:20px;top:12px;}
.monthly-image-view img {display:block;max-width:100%;height:auto;margin:auto;background:white;}

.monthly-statement-button { display:inline-block;font-size:11px;padding:1px 3px;margin-left:3px;border:1px solid #a5b4fc;border-radius:3px;color:#4058b5;background:#fff;cursor:pointer;white-space:nowrap; }
.monthly-statement-button:disabled { opacity:.4;cursor:default; }
@media print { .monthly-statement-button { display:none!important; } }
