/* ============ TaskQuest — Timesheet styles ============ */

/* view tabs in the page head */
.tabs-bar { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm); }
.tabs-bar button {

  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: calc(var(--radius-sm) - 3px); background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; transition: background .14s, color .14s; cursor: pointer; border: 0;
}
.tabs-bar button:hover { color: var(--text); }
.tabs-bar button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.tabs-bar .tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-fg);
}

/* toolbar above the grid */
.ts-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ts-weeknav { display: inline-flex; align-items: center; gap: 4px; }
.ts-week-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--border); background: var(--surface); transition: background .12s, color .12s, border-color .12s;
}
.ts-week-btn:hover { color: var(--text); background: var(--hover); border-color: var(--border-strong); }
.ts-week-label { min-width: 184px; text-align: center; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.ts-week-sub { font-size: 11px; color: var(--faint); font-weight: 600; text-align: center; margin-top: 1px; }
.ts-today-btn { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
  color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.ts-today-btn:hover { background: var(--hover); border-color: var(--border-strong); }

/* status banner */
.ts-status {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-md);
  margin-bottom: 16px; font-size: 13px; font-weight: 600; line-height: 1.4;
}
.ts-status .ts-status-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ts-status.draft { background: var(--surface-3); color: var(--text-2); }
.ts-status.submitted { background: var(--amber-soft); color: #8a6d00; border: 1px solid rgba(242,201,76,0.4); }
[data-theme="dark"] .ts-status.submitted { color: var(--amber); }
.ts-status.approved { background: var(--green-soft); color: var(--green); border: 1px solid rgba(76,183,130,0.4); }
.ts-status.rejected { background: var(--red-soft); color: var(--red); border: 1px solid rgba(235,87,87,0.35); }
.ts-status-main { flex: 1; min-width: 0; }
.ts-status-sub { font-weight: 500; opacity: .85; font-size: 12px; margin-top: 2px; }

/* ============ Weekly grid ============ */
.ts-grid-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ts-scroll { overflow-x: auto; }
.ts-grid { min-width: 860px; }

.ts-row {
  display: grid;
  grid-template-columns: minmax(200px, 2.4fr) 140px 78px repeat(7, minmax(58px, 1fr)) 70px;
  align-items: stretch;
}
.ts-cell { padding: 10px 10px; display: flex; align-items: center; min-width: 0; border-bottom: 1px solid var(--border); }
.ts-cell.num { justify-content: center; }

/* header row */
.ts-row.head .ts-cell { background: var(--surface-2); padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
.ts-th { font-size: 10.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; }
.ts-th-day { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ts-th-day .d { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ts-th-day .n { font-size: 12px; font-weight: 700; color: var(--text); }
.ts-th-day.is-today .d, .ts-th-day.is-today .n { color: var(--accent); }
.ts-th-day.weekend .d, .ts-th-day.weekend .n { color: var(--faint); }

/* project subtotal row */
.ts-row.proj .ts-cell { background: var(--surface-2); border-bottom: 1px solid var(--border); padding-top: 8px; padding-bottom: 8px; }
.ts-proj-name { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.ts-proj-name .pdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ts-proj-sub { font-size: 11px; color: var(--faint); font-weight: 600; margin-left: auto; }
.ts-proj-daynum, .ts-proj-total { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* task rows */
.ts-row.task:hover .ts-cell { background: var(--hover); }
.ts-row.task .ts-cell { transition: background .12s; }
.ts-task-name { min-width: 0; }
.ts-task-t { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-task-id { font-size: 10.5px; color: var(--faint); font-weight: 600; margin-top: 2px; }

.ts-actsel {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs);
  padding: 5px 8px; font-size: 11.5px; font-weight: 600; color: var(--text-2); font-family: inherit;
}
.ts-actsel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ts-actsel:disabled { cursor: default; opacity: .8; background: transparent; border-color: transparent; padding-left: 0; }

.ts-bill {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 24px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.ts-bill.on { background: var(--green-soft); color: var(--green); border-color: rgba(76,183,130,0.4); }
.ts-bill:disabled { cursor: default; }

.ts-num-input {
  width: 46px; height: 30px; text-align: center; border-radius: var(--radius-xs);
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: inherit;
  transition: border-color .12s, background .12s, box-shadow .12s;
  -moz-appearance: textfield;
}
.ts-num-input::-webkit-outer-spin-button, .ts-num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ts-num-input::placeholder { color: var(--faint); font-weight: 500; }
.ts-num-input:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border); }
.ts-num-input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ts-num-input:disabled { color: var(--text); }
.ts-num-input.zero:disabled { color: var(--faint); }
.ts-num-input.weekend:not(:focus) { background: var(--surface-2); }

.ts-row-total { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* footer totals */
.ts-row.foot .ts-cell { background: var(--surface-2); border-bottom: none; border-top: 2px solid var(--border-strong); padding-top: 12px; padding-bottom: 12px; }
.ts-foot-label { font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.ts-foot-day { font-size: 13px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ts-foot-day.warn { color: var(--amber); }
[data-theme="light"] .ts-foot-day.warn { color: #b88a00; }
.ts-foot-total { font-size: 14px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ts-foot-total.warn { color: var(--amber); }
[data-theme="light"] .ts-foot-total.warn { color: #b88a00; }

/* warn note + footer actions */
.ts-warnnote { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #b88a00; margin-top: 12px; }
[data-theme="dark"] .ts-warnnote { color: var(--amber); }
.ts-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ts-actions .spacer { flex: 1; }
.ts-meta-note { font-size: 12px; color: var(--muted); }
.ts-billsum { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ts-billsum b { color: var(--text); }

/* ============ Manager review ============ */
.ts-review { display: flex; flex-direction: column; gap: 10px; }
.ts-review-card {
  display: grid; grid-template-columns: minmax(180px, 1.6fr) 130px 110px 1fr auto;
  align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: border-color .14s, box-shadow .14s, transform .14s; cursor: pointer;
}
.ts-review-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ts-rc-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ts-rc-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-rc-proj { font-size: 11.5px; color: var(--faint); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.ts-rc-proj .pdot { width: 7px; height: 7px; border-radius: 50%; }
.ts-rc-hours { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ts-rc-hours span { font-size: 11px; color: var(--faint); font-weight: 600; }
.ts-rc-chevron { color: var(--faint); display: flex; }
@media (max-width: 980px) {
  .ts-review-card { grid-template-columns: 1.4fr 110px auto; }
  .ts-rc-hide { display: none; }
}

.ts-statusbadge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; }
.ts-statusbadge .dot { width: 6px; height: 6px; border-radius: 50%; }
.ts-statusbadge.draft { background: var(--surface-3); color: var(--muted); }
.ts-statusbadge.submitted { background: var(--amber-soft); color: #8a6d00; }
[data-theme="dark"] .ts-statusbadge.submitted { color: var(--amber); }
.ts-statusbadge.approved { background: var(--green-soft); color: var(--green); }
.ts-statusbadge.rejected { background: var(--red-soft); color: var(--red); }

.ts-review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ts-review-head .spacer { flex: 1; }
.ts-mini-stats { display: flex; gap: 8px; }
.ts-mini-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 13px; text-align: center; }
.ts-mini-stat .v { font-size: 16px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ts-mini-stat .l { font-size: 10px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* read-only grid inside review modal sits flush */
.ts-modal-grid { margin-top: 4px; }
.ts-reject-box { margin-top: 14px; }
