/* today-dashboard.css — tab "Hôm nay" (05/10/2026). Dùng biến màu của style.css nên tự theo chế độ tối. */
.td-wrap { margin: 16px 0 24px; color: var(--text-main); }
.td-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.td-title { margin: 0; font-size: 22px; font-weight: 800; color: var(--text-main); }
.td-title i { color: var(--color-primary); margin-right: 6px; }
.td-meta { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.td-actions { display: flex; gap: 8px; align-items: center; }
.td-select, .td-refresh {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-white);
    color: var(--text-main);
    font: 600 14px inherit;
    cursor: pointer;
}
.td-refresh { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.td-refresh.spinning i { animation: tdSpin 0.8s linear infinite; }
@keyframes tdSpin { to { transform: rotate(360deg); } }

.td-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.td-kpi { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--bg-white); }
.td-kpi-ico { flex: 0 0 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 19px; }
.td-kpi.blue .td-kpi-ico { background: var(--bg-blue-light); color: var(--color-blue); }
.td-kpi.green .td-kpi-ico { background: var(--bg-green-light); color: var(--color-green); }
.td-kpi.red .td-kpi-ico { background: var(--bg-red-light); color: var(--color-red); }
.td-kpi.purple .td-kpi-ico { background: var(--bg-purple-light); color: var(--color-purple); }
.td-kpi.yellow .td-kpi-ico { background: var(--bg-yellow-light); color: var(--color-yellow); }
.td-kpi.teal .td-kpi-ico { background: rgba(13, 148, 136, 0.12); color: #0d9488; }
.td-kpi-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.td-kpi-lbl { color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.td-kpi-val { font-size: 28px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.td-kpi-sub { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.td-note { color: var(--text-muted); font-size: 13px; }
.td-chg { font-size: 13px; font-weight: 700; }
.td-chg small { font-weight: 500; color: var(--text-muted); }
.td-chg.up { color: var(--color-green); }
.td-chg.down { color: var(--color-red); }
.td-chg.neutral { color: var(--text-muted); }

.td-h { margin: 20px 0 10px; font-size: 15px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.td-lives { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.td-live { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-white); }
.td-live > i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-active); color: var(--color-primary); }
.td-live div { display: flex; flex-direction: column; min-width: 0; }
.td-live strong { font-size: 22px; font-weight: 800; line-height: 1.1; }
.td-live span { font-size: 13.5px; font-weight: 600; }
.td-live small { color: var(--text-muted); font-size: 12px; }

.td-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.td-card { margin-top: 12px; padding: 18px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--bg-white); }
.td-cols .td-card { margin-top: 0; }
.td-card.alert { border-left: 4px solid var(--color-yellow); }
.td-card.alert.red { border-left-color: var(--color-red); }
.td-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; }
.td-card-head.sub { margin-top: 18px; }
.td-card-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.td-card-head h3 i { color: var(--color-primary); margin-right: 4px; }
.td-card-head > span { color: var(--text-muted); font-size: 13px; }
.td-count { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--bg-yellow-light); color: var(--color-yellow); font-size: 13px; }
.td-card.alert.red .td-count { background: var(--bg-red-light); color: var(--color-red); }
.td-highlights { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-active); font-size: 13.5px; }
.td-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.td-chip { padding: 4px 10px; border-radius: 999px; background: var(--bg-yellow-light); color: var(--text-main); font-size: 12.5px; }
.td-chip.muted { background: var(--bg-active); }
.td-card.alert.red .td-chip { background: var(--bg-red-light); }

.td-table-wrap { overflow-x: auto; }
.td-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.td-table th { padding: 8px 10px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-size: 12px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
.td-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.td-table tr:last-child td { border-bottom: 0; }
.td-table td small { display: block; color: var(--text-muted); font-size: 11.5px; }
.td-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-table .green { color: var(--color-green); font-weight: 700; }
.td-table .red { color: var(--color-red); font-weight: 700; }
.td-table tr.warn td { background: var(--bg-red-light); }
.td-table tr.warn .fa-triangle-exclamation { color: var(--color-red); }
.td-rank { width: 34px; font-size: 16px; text-align: center; }
.td-empty-row { padding: 18px 10px !important; color: var(--text-muted); text-align: center; }
.td-link { padding: 0; border: 0; background: none; color: var(--color-primary); font: 700 13.5px inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.td-svc { padding: 2px 8px; border-radius: 999px; background: var(--bg-blue-light); color: var(--color-blue); font-size: 12px; font-weight: 700; white-space: nowrap; }
.td-svc.HOATOC { background: var(--bg-red-light); color: var(--color-red); }
.td-svc.DICHAM { background: var(--bg-green-light); color: var(--color-green); }
.td-more { margin: 10px 0 0; color: var(--text-muted); font-size: 13px; }

.td-legend { display: inline-flex; align-items: center; gap: 6px; }
.td-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.td-legend i.c, .td-bars .c { background: var(--color-primary); }
.td-legend i.d, .td-bars .d { background: var(--color-green); }
.td-trend { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.td-bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border-radius: 12px; }
.td-bar-col.today { background: var(--bg-active); }
.td-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.td-bars span { width: 12px; min-height: 2px; border-radius: 4px 4px 0 0; }
.td-bar-col small { color: var(--text-muted); font-size: 11.5px; }
.td-bar-col b { font-size: 11.5px; white-space: nowrap; }
.td-empty { padding: 40px; text-align: center; color: var(--text-muted); }
.td-empty.error { color: var(--color-red); }

@media (max-width: 1200px) {
    .td-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .td-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .td-lives { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .td-kpis, .td-lives { grid-template-columns: 1fr; }
    .td-kpi-val { font-size: 24px; }
    .td-bars span { width: 8px; }
}

/* Chi phí hôm nay (05/10/2026) */
.td-kpis.cost { margin-bottom: 0; }
.td-exp-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.td-input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
    color: var(--text-main);
    font: 500 14px inherit;
    min-width: 0;
}
.td-input.wide { flex: 1 1 220px; }
#td-exp-amount { width: 150px; }
.td-input.static { display: inline-flex; align-items: center; background: var(--bg-active); font-weight: 600; }
.td-input:focus { outline: none; border-color: var(--color-primary); }
.td-del { width: 32px; height: 32px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--color-red); cursor: pointer; }
.td-del:hover { background: var(--bg-red-light); }
@media (max-width: 560px) {
    .td-exp-form > * { flex: 1 1 100%; width: 100% !important; }
}
.td-partners { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--bg-active); font-size: 13.5px; }
.td-partners small { color: var(--text-muted); }
.td-partners .td-chips { margin: 4px 0 0; }

/* Xem theo kỳ + đơn treo + dự án (06/10/2026) */
.td-periods { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 14px; }
.td-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-white); }
.td-seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font: 600 13.5px inherit; cursor: pointer; white-space: nowrap; }
.td-seg button:hover { background: var(--bg-active); color: var(--text-main); }
.td-seg button.on { background: var(--color-primary); color: #fff; }
.td-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-range label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.td-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.td-stack .td-card { margin-top: 0; }
.td-chart { display: grid; gap: 6px; align-items: end; }
.td-chart.dense { gap: 2px; }
.td-chart.dense .td-bars span { width: 100%; max-width: 9px; }
.td-chart.dense .td-bars { gap: 1px; width: 100%; justify-content: center; }
.td-chart .td-bar-col { min-width: 0; }
.td-chart small { white-space: nowrap; }
.td-legend i.r, .td-bars .r { background: var(--color-red); }
.td-table .amber { color: var(--color-yellow); font-weight: 700; }
.td-chip.red { background: var(--bg-red-light); }
.td-tip { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-yellow-light); font-size: 13.5px; }
.td-tip i { color: var(--color-yellow); margin-right: 4px; }
.td-hold-row { cursor: pointer; }
.td-hold-row:hover td { background: var(--bg-active); }
.td-hold-row.warn td { background: transparent; }
.td-expand { width: 26px; height: 26px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-white); color: var(--text-muted); cursor: pointer; }
.td-hold-detail td { background: var(--bg-body); }
.td-hold-label { margin: 2px 0 6px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.td-hold-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.td-hold-order { display: inline-flex; flex-direction: column; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-white); }
.td-hold-order.old { border-color: var(--color-red); }
.td-hold-order small { color: var(--text-muted); font-size: 11.5px; }
.td-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-white); font-size: 14px; }
.td-banner > div { flex: 1 1 320px; }
.td-banner > i { font-size: 20px; color: var(--color-primary); }
.td-banner.warn { border-color: var(--color-yellow); background: var(--bg-yellow-light); }
.td-banner.warn > i { color: var(--color-yellow); }
.td-banner small { color: var(--text-muted); }
.td-refresh[disabled] { opacity: 0.6; cursor: wait; }
.td-pnl { display: flex; flex-direction: column; gap: 2px; }
.td-pnl-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 14.5px; }
.td-pnl-row b { font-variant-numeric: tabular-nums; }
.td-pnl-row b.red { color: var(--color-red); }
.td-pnl-row.sub { padding: 3px 0 3px 14px; border-bottom: 0; color: var(--text-muted); font-size: 13px; }
.td-pnl-row.total { margin-top: 6px; padding-top: 12px; border-top: 2px solid var(--border-color); border-bottom: 0; font-size: 17px; font-weight: 800; }
.td-pnl-row.total.pos b { color: var(--color-green); }
.td-pnl-row.total.neg b { color: var(--color-red); }
@media (max-width: 560px) {
    .td-seg { width: 100%; }
    .td-seg button { flex: 1 1 auto; padding: 0 10px; }
}
.td-more-btn { display: block; margin: 10px auto 0; padding: 8px 16px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-white); color: var(--color-primary); font: 600 13.5px inherit; cursor: pointer; }
.td-more-btn:hover { background: var(--bg-active); }

/* Chi tiết cước (06/10/2026) */
.td-kpi.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.td-kpi.clickable:hover, .td-kpi.clickable:focus-visible { border-color: var(--color-primary); box-shadow: 0 6px 18px rgba(8, 116, 182, 0.12); outline: none; }
.td-kpi-more { margin-left: 6px; color: var(--color-primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.td-kpi-more i { font-size: 10px; }
.td-drill { position: fixed; inset: 0; z-index: 9000; display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; background: rgba(15, 23, 42, 0.45); overflow-y: auto; }
.td-drill.open { display: flex; }
html.td-drill-lock, html.td-drill-lock body { overflow: hidden !important; }
.td-drill-panel { width: min(1100px, 100%); padding: 20px 22px; border-radius: 20px; background: var(--bg-white); color: var(--text-main); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
.td-drill-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.td-drill-head h3 { margin: 0; font-size: 19px; font-weight: 800; }
.td-drill-head h3 i { color: var(--color-yellow); margin-right: 6px; }
.td-drill-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; }
.td-drill-x { width: 38px; height: 38px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-white); color: var(--text-muted); font-size: 17px; cursor: pointer; }
.td-drill-x:hover { background: var(--bg-active); color: var(--text-main); }
.td-drill-sum { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.td-drill-sum > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg-active); }
.td-drill-sum span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.td-drill-sum b { font-size: 16px; font-variant-numeric: tabular-nums; }
.td-drill-sum > div.warn { background: var(--bg-yellow-light); }
.td-howto { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 12px; font-size: 13.5px; }
.td-howto summary { cursor: pointer; font-weight: 700; color: var(--color-primary); }
.td-howto ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.td-drill-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 10px; border: 1px solid var(--border-color); border-radius: 12px; }
.td-drill-tabs button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font: 600 13.5px inherit; cursor: pointer; }
.td-drill-tabs button.on { background: var(--color-primary); color: #fff; }
.td-drill-body { max-height: 60vh; overflow-y: auto; }
.td-drill-body thead th { position: sticky; top: 0; background: var(--bg-white); z-index: 1; }
.td-kind { padding: 2px 8px; border-radius: 999px; background: var(--bg-active); font-size: 12px; font-weight: 700; white-space: nowrap; }
.td-kind.THOA_THUAN { background: var(--bg-purple-light); color: var(--color-purple); }
.td-kind.NONE { background: var(--bg-yellow-light); color: var(--color-yellow); }
@media (max-width: 900px) { .td-drill-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .td-drill { padding: 0; } .td-drill-panel { border-radius: 0; min-height: 100%; padding: 16px; } .td-drill-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
