.tv-controls { display:flex; flex-wrap:nowrap; gap:8px; align-items:end; min-width:0; padding:10px 0; border-bottom:1px solid var(--line); }
.tv-controls label, .directus-dashboard .tv-controls label { display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:400; margin:0; }
.tv-controls input, .tv-controls select, .directus-dashboard .tv-controls input:not([type="checkbox"]), .directus-dashboard .tv-controls select { font:inherit; min-width:0; box-sizing:border-box; min-height:32px; width:auto; max-width:100%; padding:5px 8px; color:inherit; background:var(--surface, transparent); border:1px solid var(--line); border-radius:5px; }
.tv-search { flex:1 1 160px; min-width:100px; }
.tv-menu { align-self:end; min-width:0; flex:0 1 auto; }
.tv-menu-trigger { display:flex; align-items:center; gap:6px; max-width:100%; white-space:nowrap; }
.tv-menu-summary { overflow:hidden; text-overflow:ellipsis; max-width:240px; font-size:12px; color:var(--muted); }
.tv-menu-trigger.is-active { border-color:var(--arancio, var(--text)); }
.tv-controls > .tv-search input, .directus-dashboard .tv-controls > .tv-search input { width:100%; }
.tv-menu-trigger, .tv-popover-close { cursor: pointer; padding: 6px 10px; min-height: 32px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.tv-menu-trigger[aria-expanded="true"] { background: var(--surface-2, var(--surface)); }
.tv-popover { position: fixed; inset: auto; margin: 0; width: min(380px, calc(100vw - 16px)); box-sizing: border-box; max-height: calc(100dvh - 16px); overflow: auto; padding: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgb(0 0 0 / 22%); }
.tv-popover::backdrop { background: transparent; }
.tv-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tv-popover-head h3 { font-size: 14px; margin: 0; }
.tv-popover .tv-fields { display: grid; grid-template-columns: minmax(0, 1fr); }
.tv-popover :is(input,select), .directus-dashboard .tv-controls .tv-popover :is(input,select) { width: 100%; box-sizing: border-box; }
.tv-popover :is(input,select,button):focus-visible, .tv-menu-trigger:focus-visible { outline: 2px solid var(--arancio, currentColor); outline-offset: 2px; }
.tv-controls .tv-popover .tv-check input { width: 16px; }
.tv-controls .tv-check, .directus-dashboard .tv-controls .tv-check { flex-direction:row; align-items:center; padding:4px; }
.tv-controls .tv-check input, .directus-dashboard .tv-controls .tv-check input { min-height:16px; width:16px; }
.tv-fields { display:flex; gap:8px; flex-wrap:wrap; padding-top:8px; }
.tv-period-label { margin:0; font-size:12px; color:var(--muted); }
.tv-reset { cursor:pointer; margin-top:12px; padding:0; border:0; background:none; color:var(--link, var(--text)); text-decoration:underline; font:inherit; font-size:12px; }
.tv-scope { color:var(--muted); font-size:12px; margin:10px 0; }
.tv-wrap { max-width:100%; overflow:auto; }
.tv-table { width:100%; border-collapse:collapse; font-size:13px; }
.tv-table td, .tv-table th { border-bottom:1px solid var(--line); border-right:1px solid var(--line); padding:7px 9px; text-align:left; vertical-align:top; }
.tv-table th { font-weight:500; color:var(--muted); white-space:nowrap; }
.tv-table thead th { position:sticky; top:0; z-index:3; background:var(--surface); box-shadow:inset 0 -1px 0 var(--line); }
.tv-table .tv-group th { font-weight:600; color:inherit; padding-top:15px; }
.tv-table details > summary { cursor:pointer; }
.tv-table .btn, .tv-cell-edit { padding:3px 6px; min-height:28px; font-size:inherit; }
.tv-cell-edit { border:0; border-radius:4px; background:transparent; color:inherit; cursor:pointer; font-variant-numeric:tabular-nums; }
.tv-cell-edit:hover, .tv-cell-edit:focus-visible { outline:1px solid var(--line); background:var(--surface-2, transparent); }
.tv-table tr[data-project-color] > td:first-child { border-left:3px solid var(--project-color, var(--line)); }
@media(max-width:600px) { .tv-controls { flex-wrap:wrap; } .tv-controls > .tv-search { flex-basis:100%; } .tv-menu { max-width:100%; } .tv-menu-summary { max-width:170px; } .tv-fields { flex-direction:column; } }

.tv-total > :is(th,td) { border-top: 1px solid var(--line); font-weight: 600; background: var(--surface-2, var(--surface)); }
.tv-table .tv-total-number { text-align: right; font-variant-numeric: tabular-nums; }
.tv-total-label, .tv-total-warning { display: block; }
.tv-total-warning { margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--warn, var(--muted)); }

.tv-error { padding: 8px 10px; border-left: 3px solid var(--danger); color: var(--danger); background: var(--surface); }
