* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f2f5; color: #1a1a2e; padding: 16px; font-size: 14px; }
.container { max-width: 1400px; margin: 0 auto; }
h1 { font-size: 1.3rem; } h2 { font-size: 1rem; margin-bottom: 10px; } h3 { font-size: 0.92rem; margin-bottom: 8px; }
.subtitle { color: #666; font-size: 0.85rem; margin: 4px 0 16px; }
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; font-size: 0.92rem; }
.banner.green { background: #d4edda; color: #155724; border-left: 4px solid #2ECC71; }
.banner.red { background: #f8d7da; color: #721c24; border-left: 4px solid #E74C3C; }
.banner.pending { background: #fff3cd; color: #856404; border-left: 4px solid #F39C12; }
.banner .test-list { margin-top: 8px; font-size: 0.82rem; font-weight: 400; }
.banner .test { padding: 2px 0; }
.banner .test.pass::before { content: '✓ '; color: #2ECC71; font-weight: 700; }
.banner .test.fail::before { content: '✗ '; color: #E74C3C; font-weight: 700; }
.banner .test .detail { color: #555; font-size: 0.78rem; margin-left: 16px; margin-top: 1px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; background: #fff; padding: 4px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow-x: auto; }
.tab { padding: 8px 16px; border-radius: 8px; border: none; background: transparent; cursor: pointer; font-weight: 600; font-size: 0.85rem; white-space: nowrap; color: #555; }
.tab.active { background: #6C63FF; color: white; }
.tab:hover:not(.active) { background: #f0f2f5; }
.page { display: none; } .page.active { display: block; }
.card { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
button { padding: 8px 14px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; background: #f0f2f5; color: #1a1a2e; font-family: inherit; }
button.primary { background: #6C63FF; color: white; }
button.success { background: #2ECC71; color: white; }
button.danger { background: #E74C3C; color: white; }
button:hover { opacity: 0.88; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: flex-end; }
.form-group { flex: 1; min-width: 130px; position: relative; }
.form-group label { display: block; font-size: 0.76rem; font-weight: 600; margin-bottom: 3px; color: #555; text-transform: uppercase; letter-spacing: 0.02em; }
.form-group input, .form-group select { width: 100%; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.88rem; background: white; font-family: inherit; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #6C63FF; box-shadow: 0 0 0 3px rgba(108,99,255,0.12); }
.suggest { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #d1d5db; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); max-height: 200px; overflow-y: auto; z-index: 100; display: none; margin-top: 2px; }
.suggest.open { display: block; }
.suggest-item { padding: 7px 10px; cursor: pointer; font-size: 0.85rem; border-bottom: 1px solid #f0f2f5; }
.suggest-item:hover { background: #f0f5ff; }
.suggest-item .meta { font-size: 0.75rem; color: #888; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; }
th { background: #f8f9fc; font-weight: 600; color: #555; font-size: 0.72rem; text-transform: uppercase; border-right: 1px solid #cbd5e1; border-bottom: 2px solid #cbd5e1; }
th:last-child, td:last-child { border-right: none; }
td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: #888; padding: 20px; font-style: italic; font-size: 0.85rem; }
.chip { background: #f0f2f5; padding: 4px 10px; border-radius: 14px; font-size: 0.78rem; display: inline-block; margin: 2px; }
.chip-system { background: #e8e4ff; color: #5a52d5; }
.chip-intercompany { background: #ffe4e1; color: #c0392b; }
.chip-crossentity { background: #fef3c7; color: #92400e; }
.line-row { display: grid; grid-template-columns: 1fr 1fr 1fr 100px 30px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #e5e7eb; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: 12px; max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.25); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #888; padding: 0; width: 30px; height: 30px; }
.modal-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.template-btn { padding: 12px 14px; text-align: left; border-radius: 8px; border: 2px solid #e5e7eb; background: white; cursor: pointer; }
.template-btn:hover { border-color: #6C63FF; background: #f8f7ff; }
.template-btn .tname { font-weight: 700; font-size: 0.88rem; margin-bottom: 2px; }
.template-btn .tdesc { font-size: 0.75rem; color: #666; }
.batch-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 120px 1.5fr 30px; gap: 4px; padding: 8px; background: #fafbfc; border-radius: 6px; margin-bottom: 6px; align-items: center; }
.batch-row.custom-override { background: #fff8e1; border-left: 3px solid #F39C12; }
.batch-legend { display: flex; gap: 12px; margin-bottom: 8px; font-size: 0.78rem; color: #666; flex-wrap: wrap; }
.batch-legend .mode-group { background: #f0f2f5; padding: 4px 10px; border-radius: 6px; display: flex; gap: 6px; align-items: center; }
.batch-legend .mode-group label { font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.toast { position: fixed; bottom: 20px; right: 20px; padding: 10px 16px; border-radius: 8px; background: #333; color: white; font-size: 0.85rem; box-shadow: 0 4px 12px rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 9999; }
.toast.show { opacity: 1; } .toast.error { background: #E74C3C; } .toast.success { background: #2ECC71; }
code { background: #f0f2f5; padding: 1px 5px; border-radius: 3px; font-size: 0.78rem; font-family: monospace; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }
.badge-same { background: #d4edda; color: #155724; }
.badge-cross { background: #f8d7da; color: #721c24; }
.badge-dist { background: #fff3cd; color: #856404; }
.badge-settle { background: #d1ecf1; color: #0c5460; }
.badge-adv { background: #e2e3e5; color: #383d41; }
.add-form { background: #fafbfc; padding: 12px; border-radius: 8px; margin-top: 12px; border: 1px dashed #cbd5e1; }
.nbv-pos { color: #1e6f5c; font-weight: 700; }
.dep-cell { color: #b45309; font-weight: 600; }
.report-section { margin-bottom: 20px; }
.report-summary { display: flex; gap: 20px; flex-wrap: wrap; padding: 10px 14px; background: #f8f9fc; border-radius: 8px; margin-bottom: 10px; font-size: 0.88rem; }
.report-summary .item { display: flex; flex-direction: column; }
.report-summary .item .label { font-size: 0.72rem; color: #666; text-transform: uppercase; }
.report-summary .item .value { font-weight: 700; font-size: 0.95rem; }
.report-summary .item .value.pos { color: #2ECC71; }
.report-summary .item .value.neg { color: #E74C3C; }
.report-row-clickable { cursor: pointer; }
.report-row-clickable:hover td { background: #f0f5ff; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.table-wrap { overflow-x: auto; border-radius: 8px; }
.archived-tag { color: #999; font-weight: 400; font-size: 0.75rem; font-style: italic; }
.budget-hint { padding: 10px 14px; border-radius: 6px; font-size: 0.85rem; margin-top: 8px; background: #f8f9fc; border-left: 3px solid #6C63FF; line-height: 1.6; }
.budget-hint.over { border-left-color: #E74C3C; }
.budget-hint.low { border-left-color: #F39C12; }
.budget-hint.good { border-left-color: #2ECC71; }
.budget-hint .hint-row { display: flex; justify-content: space-between; padding: 2px 0; }
.budget-hint .hint-row .label { color: #666; }
.budget-hint .hint-row .amt { font-weight: 600; }
.budget-hint .amt.pos { color: #2ECC71; }
.budget-hint .amt.neg { color: #E74C3C; }
.budget-hint .cf-btn { margin-top: 8px; padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; background: #6C63FF; color: white; border: none; cursor: pointer; }
.budget-hint .cf-btn:hover { background: #5a52d5; }
.qr-card { background: #fafbfc; padding: 12px; border-radius: 8px; margin-bottom: 12px; border: 1px dashed #cbd5e1; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.qr-grid .form-group { margin: 0; }
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0 4px; flex-wrap: wrap; font-size: 0.82rem; }
.pagination-bar .info { color: #666; }
.pagination-bar .controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination-bar select { padding: 4px 8px; border-radius: 6px; border: 1px solid #d1d5db; font-size: 0.82rem; background: white; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: #eef2ff; }
.sortable .arrow { color: #6C63FF; font-size: 0.7rem; margin-left: 3px; }
.budget-pill { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; margin-left: 4px; }
.budget-pill.good { background: #d4edda; color: #155724; }
.budget-pill.low { background: #fff3cd; color: #856404; }
.budget-pill.over { background: #f8d7da; color: #721c24; }
.budget-pill.none { background: #e5e7eb; color: #555; }
.period-card { background: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.period-card .pl { font-weight: 700; font-size: 0.9rem; }
.period-card .pr { font-size: 0.75rem; color: #888; }
.period-card .actions { display: flex; gap: 6px; }
.period-card .actions button { padding: 5px 10px; font-size: 0.78rem; }
.font-preview { padding: 8px 10px; background: #f8f9fc; border-radius: 6px; margin-top: 6px; font-size: 0.85rem; color: #555; }
.csv-import-area { width: 100%; min-height: 160px; font-family: monospace; font-size: 0.78rem; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }
.budget-preview-cell { font-size: 0.72rem; color: #666; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-preview-cell.over { color: #E74C3C; font-weight: 600; }
.budget-preview-cell.low { color: #b45309; font-weight: 600; }
.budget-preview-cell.good { color: #1e6f5c; }
.entity-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 14px; flex-wrap: wrap; }
.entity-bar label { font-size: 0.72rem; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.02em; }
.entity-bar select { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; font-weight: 600; min-width: 200px; background: white; }
.entity-bar .eb-version { color: #888; font-size: 0.75rem; margin-left: auto; }
.division-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 6px; background: #fff; }
.division-row .dr-name { flex: 1; font-weight: 600; }
.division-row .dr-actions { display: flex; gap: 6px; }
.division-row .dr-actions button { font-size: 0.75rem; padding: 4px 10px; }
.ob-input { width: 100%; padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 0.82rem; text-align: right; background: #fff; }
.ob-input:focus { outline: none; border-color: #6C63FF; box-shadow: 0 0 0 2px rgba(108,99,255,0.12); }

/* === Phase 10 additions === */
.tx-deleted td { text-decoration: line-through; color: #999; background: #fafafa; }
.tx-deleted .tx-actions-cell { text-decoration: none; }
.tx-actions-cell button { padding: 2px 8px; font-size: 0.72rem; }
.tx-actions-cell button[data-edit-tx] { background: #f0f2f5; color: #1a1a2e; }
.tx-actions-cell button[data-del-tx] { background: #E74C3C; color: white; }
.edit-mode-banner { background: #fff3cd; padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border-left: 3px solid #F39C12; font-size: 0.85rem; color: #856404; }
.edit-mode-banner strong { color: #664d03; }
.entity-checks { display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: #f8f9fc; border-radius: 8px; margin-bottom: 12px; align-items: center; }
.entity-checks > strong { font-size: 0.82rem; color: #555; }
.entity-checks label { display: flex; align-items: center; gap: 5px; font-size: 0.85rem; font-weight: 500; cursor: pointer; padding: 4px 10px; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; }
.entity-checks label input { margin: 0; }
.entity-checks label:hover { border-color: #6C63FF; }
.consolidated-note { padding: 8px 12px; background: #e8e4ff; color: #5a52d5; border-radius: 6px; font-size: 0.8rem; margin-bottom: 10px; }
.consolidated-subsection { margin-top: 16px; padding-top: 12px; border-top: 2px solid #e5e7eb; }
.consolidated-subsection h3 { color: #5a52d5; font-size: 0.9rem; margin-bottom: 8px; }