/*
 * TTech OneStop - Targets app (Client/Apps/Targets, /targets). Linked by Components/App.razor right after app.css,
 * before connect.css and downtime.css. The pages also use the shared panels, tables, KPIs, empty boxes, notices,
 * subtabs, chart box and demo bar of app.css, and some rules here adjust them for Targets. A few of these have the same
 * weight as the app.css rule they override and win only because this file is linked after app.css, for example
 * .tg-table td over .table td (cells aligned to the top), .tg-empty p over .panel p, .tg-days-head h3 over .panel h3:
 * keep the link order. Only tg- rules here.
 * Copyright (c) 2026 Toupin Technologies Inc. All rights reserved.
 */

/* ---- List and filters, target page, forms and dialogs, trees of sections and owners ---- */
/* Inside the Reporting portal (html.framed) the app bar is hidden: the app's pages show as tabs on the page instead
   (TargetsHeader.razor) */
.subtabs.tg-framed-nav { display: none; margin-bottom: 10px; }
html.framed .subtabs.tg-framed-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tg-filters .spacer { flex: 1; }
.tg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text); font-size: 0.84rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.tg-chip b { padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.74rem; }
.tg-chip:hover { border-color: var(--accent); }
.tg-chip.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.tg-chip.on b { background: color-mix(in srgb, var(--on-accent) 25%, transparent); color: var(--on-accent); }
.tg-chip .mud-icon-root { font-size: 1rem; }
.tg-chip-issues { color: var(--warn); }
.tg-chip-issues.on { border-color: var(--warn); background: var(--warn); color: var(--on-accent); }
.tg-picker { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); }
.tg-picker .tg-input { min-width: 180px; max-width: 320px; border: 0; background: transparent; }
.tg-picker.tg-search .tg-input { min-width: 200px; }
.tg-input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
  color: var(--text); font: inherit; font-size: 0.88rem;
}
.tg-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.tg-num { text-align: right; font-variant-numeric: tabular-nums; }
.tg-of { color: var(--muted); font-weight: 600; }
.tg-clear { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 0.84rem; font-weight: 700; text-decoration: none; }
.tg-clear:hover { text-decoration: underline; }
.tg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.tg-empty { flex-direction: column; gap: 8px; }
.tg-empty p { margin: 0; }
.tg-table td { vertical-align: top; }
.tg-table .sub { margin-top: 2px; }
.tg-code { font-weight: 800; color: var(--text); text-decoration: none; }
.tg-code:hover { color: var(--accent); text-decoration: underline; }
.tg-path { font-weight: 600; }
.tg-other-lang { font-style: italic; }
.tg-sum { width: 36px; color: var(--accent); text-align: center; }
.tg-sum .mud-icon-root { font-size: 1.05rem; }
.tg-go { width: 28px; color: var(--faint); text-align: right; }
.tg-status {
  display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--muted);
  font-size: 0.74rem; font-weight: 800; white-space: nowrap;
}
.tg-status.ok { background: var(--good-soft); color: var(--good-text); }
.tg-status.gap, .tg-status.ended { background: var(--warn-soft); color: var(--warn); }
.tg-status.overlap { background: var(--bad-soft); color: var(--bad); }
.tg-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 2px 10px; color: var(--muted); font-size: 0.86rem; }
.tg-crumbs a { color: var(--accent); font-weight: 700; text-decoration: none; }
.tg-crumbs a:hover { text-decoration: underline; }
.tg-crumbs span { color: var(--text); font-weight: 700; }
.tg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tg-head-icon { display: inline-flex; padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tg-head-text { flex: 1; min-width: 0; }
.tg-head h1 { margin: 0; font-size: 1.35rem; font-weight: 900; }
.tg-type { margin-left: 6px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.74rem; font-weight: 800; vertical-align: middle; }
.tg-kpis { margin-bottom: 12px; }
.tg-kpis .value small { font-size: 0.9rem; font-weight: 600; }
.tg-warn-text { color: var(--warn); }
.tg-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.tg-cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tg-table tr.tg-overlap td { background: var(--bad-soft); }
.tg-table tr.tg-overlap td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.tg-table tr.tg-today td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.tg-table tr.tg-overlap.tg-today td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.tg-table tr.tg-gap-row td { padding: 4px 10px; background: var(--note-soft); color: var(--warn); font-size: 0.8rem; font-weight: 700; }
.tg-table tr.tg-gap-row .mud-icon-root { font-size: 1rem; vertical-align: -3px; }
.tg-actions { width: 84px; white-space: nowrap; text-align: right; }
.tg-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.tg-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tg-field > span { color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.tg-field.tg-wide, .tg-check { grid-column: 1 / -1; }
.tg-check { display: flex; align-items: flex-start; gap: 8px; font-weight: 700; cursor: pointer; }
.tg-check input { margin-top: 3px; }
.tg-check small { display: block; font-weight: 400; }
.tg-savebar { display: flex; gap: 8px; margin-top: 12px; }
.tg-danger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 12px;
  border: 1px solid var(--bad-soft); border-radius: 8px;
}
.tg-dialog-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.tg-dialog-error { margin-top: 10px; }
.tg-warning { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px; border-radius: 8px; font-size: 0.84rem; font-weight: 600; }
.tg-warning.bad { background: var(--bad-soft); color: var(--bad); }
.tg-notice { margin: 0 0 12px; }
.tg-tree-search { max-width: 220px; margin-left: auto; }
.tg-tree { margin: 4px 0 0; padding: 0; list-style: none; }
.tg-tree li {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 2px 6px 2px calc(8px + var(--level, 0) * 26px);
  border-bottom: 1px solid var(--rule);
}
.tg-tree li:hover { background: var(--accent-soft); }
.tg-tree li .spacer { flex: 1; }
.tg-tree li.inactive .tg-tree-name { color: var(--muted); text-decoration: line-through; }
.tg-tree-icon { color: var(--accent); }
.tg-tree-name { font-weight: 700; }
.tg-tree-actions { display: inline-flex; opacity: 0.35; transition: opacity 0.15s; }
.tg-tree li:hover .tg-tree-actions, .tg-tree-actions:focus-within { opacity: 1; }
.tg-count { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.74rem; font-weight: 800; text-decoration: none; }
.tg-count:hover { background: var(--accent); color: var(--on-accent); }
@media (max-width: 1100px) {
  .tg-cols, .tg-cols.even { grid-template-columns: minmax(0, 1fr); }
  .tg-legend { margin-left: 0; }
}
@media (max-width: 640px) {
  .tg-form { grid-template-columns: minmax(0, 1fr); }
  .tg-picker, .tg-picker .tg-input { max-width: 100%; min-width: 0; }
}

/* ---- Names in two languages, daily distribution ---- */
/* The other-language name in the trees (TreeEditor), and the daily distribution of the target page (TargetDays.razor:
   year links, chart, month table with a bar per month). */
.tg-tree-other { color: var(--muted); font-size: 0.8rem; font-style: italic; }
.tg-days-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; }
.tg-days-head h3 { margin: 0; }
.tg-days-head .tg-chips { margin-left: auto; }
.tg-days-empty { gap: 8px; margin-top: 8px; }
.tg-days td { vertical-align: middle; }
.tg-days tfoot td { border-top: 2px solid var(--rule); color: var(--muted); font-weight: 800; }
.tg-days .tg-days-bar-col { width: 32%; }
.tg-days-bar { display: block; height: 8px; min-width: 2px; border-radius: 999px; background: var(--accent); opacity: 0.55; }
.tg-days tr.tg-overlap .tg-days-bar { background: var(--bad); }
@media (max-width: 640px) {
  .tg-days .tg-days-bar-col { display: none; }
  .tg-days-head .tg-chips { margin-left: 0; }
}
