/* 工数予実管理 — mọi class có tiền tố eb- để không đụng joy_aio và core. */
.eb-filters fieldset { padding: 8px 12px 10px; }
.eb-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 20px; }
.eb-filter-row + .eb-filter-row { margin-top: 10px; align-items: center; }
.eb-field { display: flex; flex-direction: column; gap: 4px; }
.eb-field > label { font-size: 0.85em; color: #666; white-space: nowrap; }
.eb-filters input[type="date"], .eb-filters input.eb-text { height: 28px; box-sizing: border-box; }
.eb-filters input.eb-text { width: 180px; }
.eb-filters .select2-container .select2-choice { height: 28px; line-height: 26px; }
.eb-range { display: inline-flex; align-items: center; gap: 6px; }
.eb-range-sep { color: #888; }
.eb-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.eb-filter-buttons { gap: 12px; }

.eb-tiles { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 16px; }
.eb-tile { flex: 1 1 170px; border: 1px solid #ddd; border-radius: 6px; padding: 10px 12px; background: #fff; }
.eb-tile.eb-alert { border-color: #e0a3a3; background: #fff7f7; }
.eb-tile-label { font-size: 0.85em; color: #666; }
.eb-tile-value { font-size: 1.7em; font-weight: bold; margin: 2px 0; font-variant-numeric: tabular-nums; }
.eb-tile-split span { margin-right: 10px; }
.eb-tile-note { font-size: 0.8em; color: #777; line-height: 1.5; }

.eb-table td.eb-num, .eb-table th.eb-num, .eb-panel-table td.eb-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eb-table td.eb-center { text-align: center; }
.eb-table td.eb-subject { text-align: left; min-width: 220px; }
.eb-table tr.eb-retro td { background-color: #fff3f0; }
.eb-table tfoot tr.eb-total td { font-weight: bold; border-top: 2px solid #bbb; }
.eb-numbers { width: auto; }
.eb-numbers th, .eb-numbers td { padding: 4px 12px; }

.eb-bad { color: #c0392b; }
.eb-good { color: #1e7e34; }

.eb-badge { display: inline-block; padding: 1px 6px; margin: 1px 2px; border-radius: 3px; font-size: 0.8em; background: #eee; color: #555; white-space: nowrap; }
.eb-badge-bad { background: #fbe3e0; color: #b02a1a; }

.eb-meta { color: #555; }
.eb-note { font-size: 0.85em; color: #777; }
.eb-warnings div { margin: 2px 0; }

.eb-panel-title { margin-bottom: 4px; }
.eb-panel-title a { margin-left: 8px; }
.eb-panel-table th { text-align: left; padding: 2px 8px 2px 0; color: #555; font-weight: normal; }
.eb-panel-table td { padding: 2px 16px 2px 0; }

@media (prefers-color-scheme: dark) {
  .eb-tile { background: transparent; }
}

/* Viền mờ cho mọi ô; viền đậm hơn ở đầu mỗi nhóm 仕様策定 / 開発 / テスト / 合計 để dễ dò cột. */
table.eb-table { border-collapse: collapse; }
table.eb-table th, table.eb-table td { border: 1px solid #e4e4e4; }
table.eb-table thead th { background: #f4f6f8; }
table.eb-table th.eb-group { border-bottom-color: #cfd6dd; }
table.eb-table th.eb-group, table.eb-table .eb-group-start { border-left: 1px solid #b9c2cb; }

/* Dòng điều kiện tính (đơn giá, ngưỡng, status được tính). */
.eb-rules { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -4px 0 12px; padding: 6px 10px;
            background: #f4f6f8; border: 1px solid #e1e5ea; border-radius: 4px; font-size: 0.85em; color: #555; }
.eb-rules-title { font-weight: bold; color: #444; }
.eb-rule + .eb-rule::before { content: "・"; margin-right: 6px; color: #aaa; }

/* Lối sang ticket Redmine từ bảng thống kê. */
.eb-row-links { margin-top: 2px; font-size: 0.8em; }
.eb-row-links .eb-link { margin-right: 8px; color: #6b7a89; }
.eb-row-links .eb-link:hover { color: #169; }
.eb-row-links .eb-link-edit { font-weight: bold; }
a.eb-badge-link { text-decoration: none; border: 1px dashed #c9a227; background: #fff8e1; color: #8a6d00; }
a.eb-badge-link:hover { background: #ffefb3; }

/* 見積合計 / 結果合計: bấm để mở modal chi tiết giờ */
a.eb-breakdown-link { color: inherit; text-decoration: underline dotted #8a96a3; text-underline-offset: 3px; cursor: pointer; }
a.eb-breakdown-link:hover { color: #169; text-decoration-style: solid; }
table.eb-breakdown { width: 100%; margin: 4px 0 0; border-collapse: collapse; }
table.eb-breakdown th, table.eb-breakdown td { border: 1px solid #e4e4e4; padding: 4px 8px; }
table.eb-breakdown thead th { background: #f4f6f8; }
table.eb-breakdown td.eb-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.eb-breakdown tbody th { text-align: left; background: #f4f6f8; font-weight: normal; width: 30%; }
table.eb-breakdown tr.eb-total th, table.eb-breakdown tr.eb-total td { font-weight: bold; border-top: 2px solid #bbb; }
.eb-table td.eb-facility { min-width: 7em; }
.eb-table td.eb-owner { white-space: nowrap; }

/* Ticket chưa điền 請求区分: khối nhắc phía trên bảng */
details.eb-billing-blank { margin: 0 0 12px; padding: 8px 12px; border: 1px solid #e6c36b; border-radius: 4px; background: #fff8e1; }
details.eb-billing-blank summary { cursor: pointer; color: #7a5a00; }
details.eb-billing-blank .eb-billing-blank-hint { font-size: 0.9em; color: #8a7a50; margin-left: 6px; }
table.eb-billing-blank-table { margin-top: 6px; }
table.eb-billing-blank-table td { text-align: left; }
table.eb-billing-blank-table td:first-child, table.eb-billing-blank-table td:nth-child(3), table.eb-billing-blank-table td:nth-child(4) { white-space: nowrap; }
.eb-table td.eb-nowrap, .eb-table td.eb-teams { white-space: nowrap; }
.eb-badge.eb-badge-order { background: #e8f0fe; color: #1a4f9c; border-color: #b6ccf2; }
