/* Team Status — admin-only live dashboard */

#page-team-status .page-body { padding: 18px 22px; }

.ts-header-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: #64748b;
}
.ts-aggregate {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.ts-agg-cell {
  background: #0f172a;
  border: 1px solid #1e293b60;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  transition: border-color 120ms, background-color 120ms;
}
.ts-agg-clickable { cursor: pointer; }
.ts-agg-clickable:hover { border-color: #334155; background: #111827; }
.ts-agg-active {
  border-color: #3b82f6;
  background: #111c33;
}
.ts-agg-active .ts-agg-num { color: #93c5fd; }
.ts-agg-num {
  font-size: 24px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ts-agg-cell.ts-agg-alert .ts-agg-num { color: #ef4444; }
.ts-agg-lbl {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}
.ts-agg-stamp {
  font-size: 12px;
  color: #64748b;
}
.ts-toolbar {
  display: flex;
  align-items: center;
  margin: 12px 0 8px 0;
}
.ts-search-wrap {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.ts-search-input {
  background: #0b1220;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  width: 360px;
  max-width: 100%;
  outline: none;
  font-family: inherit;
}
.ts-search-input:focus {
  border-color: #3b82f6;
}
.ts-filter-hint {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: #0b1e33;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  margin-bottom: 12px;
  color: #93c5fd;
  font-size: 13px;
}
.ts-filter-hint strong { color: #dbeafe; margin: 0 3px; }
.ts-filter-hint em { color: #fde68a; font-style: normal; }
.ts-filter-clear {
  margin-left: auto;
  background: transparent;
  border: 1px solid #334155;
  color: #93c5fd;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}
.ts-filter-clear:hover { background: #1e293b; }
.ts-refresh-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 8px;
  font-size: 13px;
  line-height: 1;
}
.ts-refresh-btn:hover { background: #1e293b; color: #e2e8f0; }

.ts-table {
  width: 100%;
  border-collapse: collapse;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}
.ts-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1e293b;
  background: #0b1220;
  font-weight: 500;
}
.ts-table th.ts-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 120ms, background-color 120ms;
}
.ts-table th.ts-sortable:hover { color: #cbd5e1; background: #111c33; }
.ts-sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: #334155;
}
.ts-sort-ind.ts-sort-on { color: #60a5fa; }
.ts-table th.ts-num, .ts-table td.ts-num { text-align: right; }
.ts-table th.ts-actions, .ts-table td.ts-actions { text-align: right; white-space: nowrap; }
.ts-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a2537;
  color: #e2e8f0;
  vertical-align: middle;
}
.ts-table tr:last-child td { border-bottom: none; }
.ts-table tr:hover td { background: #111c33; }

.ts-name {
  font-weight: 500;
  color: #f1f5f9;
}
.ts-role {
  font-size: 11px;
  color: #64748b;
  text-transform: capitalize;
}
.ts-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.ts-badge-lbl {
  font-size: 12px;
  color: #94a3b8;
}
.ts-timer-live {
  color: #10b981;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ts-timer-off {
  color: #475569;
}
.ts-work {
  display: inline-block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.ts-dim { color: #475569; }

.ts-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 4px;
}
.ts-btn:hover { background: #1e293b; color: #e2e8f0; }
.ts-btn-warn { border-color: #7f1d1d; color: #fca5a5; }
.ts-btn-warn:hover { background: #7f1d1d; color: #fee2e2; }

.ts-empty {
  padding: 40px;
  text-align: center;
  color: #64748b;
  background: #0f172a;
  border: 1px dashed #1e293b;
  border-radius: 10px;
}
.ts-error {
  padding: 16px;
  background: #3f1d1d;
  color: #fecaca;
  border-radius: 8px;
  margin-bottom: 12px;
}
.ts-retry {
  background: #7f1d1d;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
  margin-left: 8px;
  cursor: pointer;
}

/* Midnight logout warning banner (shared style-space) */
.ts-midnight-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #78350f;
  color: #fef3c7;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.ts-midnight-banner strong { color: #fde68a; }
.ts-midnight-banner .ts-mn-close {
  background: transparent;
  border: 1px solid #92400e;
  color: #fef3c7;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 12px;
}

/* Build 877.1 — idle-detector permission indicators.
   Rendered in the Status cell next to the primary badge. */
.ts-idle-perm-warn {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  color: #fbbf24;
  background: #78350f30;
  border: 1px solid #92400e;
  border-radius: 4px;
  white-space: nowrap;
  cursor: help;
}
.ts-idle-perm-unknown {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  white-space: nowrap;
  cursor: help;
}

/* ── Build 954 — Light-theme overrides ──
   Team Status renders dark-on-dark under html[data-theme="light"]: aggregate
   stat cards, filter banner, table header/body/hover, search input, and the
   "Showing X of Y" banner all need explicit light-mode equivalents. */
html[data-theme="light"] .ts-aggregate .ts-agg-cell {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
html[data-theme="light"] .ts-agg-clickable:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
}
html[data-theme="light"] .ts-agg-active {
  background: #eff6ff;
  border-color: #3b82f6;
}
html[data-theme="light"] .ts-agg-active .ts-agg-num { color: #1d4ed8; }
html[data-theme="light"] .ts-agg-num { color: #111827; }
html[data-theme="light"] .ts-agg-cell.ts-agg-alert .ts-agg-num { color: #dc2626; }
html[data-theme="light"] .ts-agg-lbl { color: #6b7280; }
html[data-theme="light"] .ts-agg-stamp { color: #6b7280; }

html[data-theme="light"] .ts-search-input {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}
html[data-theme="light"] .ts-search-input::placeholder { color: #9ca3af; }
html[data-theme="light"] .ts-search-input:focus { border-color: #3b82f6; }

html[data-theme="light"] .ts-filter-hint {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
html[data-theme="light"] .ts-filter-hint strong { color: #1e3a8a; }
html[data-theme="light"] .ts-filter-hint em { color: #b45309; }
html[data-theme="light"] .ts-filter-clear {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #ffffff;
}
html[data-theme="light"] .ts-filter-clear:hover { background: #dbeafe; }

html[data-theme="light"] .ts-refresh-btn {
  border-color: #d1d5db;
  color: #4b5563;
}
html[data-theme="light"] .ts-refresh-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

html[data-theme="light"] .ts-table {
  background: #ffffff;
  border-color: #e5e7eb;
}
html[data-theme="light"] .ts-table th {
  background: #f9fafb;
  color: #6b7280;
  border-bottom-color: #e5e7eb;
}
html[data-theme="light"] .ts-table th.ts-sortable:hover {
  background: #eff6ff;
  color: #374151;
}
html[data-theme="light"] .ts-sort-ind { color: #cbd5e1; }
html[data-theme="light"] .ts-sort-ind.ts-sort-on { color: #2563eb; }
html[data-theme="light"] .ts-table td {
  color: #1f2937;
  border-bottom-color: #f1f5f9;
}
html[data-theme="light"] .ts-table tr:hover td { background: #f9fafb; }

html[data-theme="light"] .ts-name { color: #111827; }
html[data-theme="light"] .ts-role { color: #6b7280; }
html[data-theme="light"] .ts-badge-lbl { color: #4b5563; }
html[data-theme="light"] .ts-timer-live { color: #059669; }
html[data-theme="light"] .ts-timer-off { color: #9ca3af; }
html[data-theme="light"] .ts-dim { color: #9ca3af; }

html[data-theme="light"] .ts-btn {
  border-color: #d1d5db;
  color: #4b5563;
  background: #ffffff;
}
html[data-theme="light"] .ts-btn:hover {
  background: #f3f4f6;
  color: #111827;
}
html[data-theme="light"] .ts-btn-warn {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #ffffff;
}
html[data-theme="light"] .ts-btn-warn:hover {
  background: #fee2e2;
  color: #7f1d1d;
}

html[data-theme="light"] .ts-empty {
  background: #ffffff;
  border-color: #e5e7eb;
  color: #6b7280;
}
html[data-theme="light"] .ts-error {
  background: #fee2e2;
  color: #991b1b;
}
html[data-theme="light"] .ts-retry {
  background: #b91c1c;
  color: #ffffff;
}

html[data-theme="light"] .ts-idle-perm-warn {
  color: #b45309;
  background: #fef3c7;
  border-color: #fbbf24;
}
html[data-theme="light"] .ts-idle-perm-unknown {
  color: #6b7280;
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Build 1006 Phase B — team status mobile rules.
   Default grid is 6 columns of user cards. On a phone that's
   ~50px each — unreadable. Stack to 1 column on mobile. */
@media (max-width: 640px) {
  .ts-grid { grid-template-columns: 1fr; gap: 8px; }
  .ts-row { padding: 10px 12px; }
  .ts-name { font-size: 14px; }
}
@media (max-width: 900px) and (min-width: 641px) {
  .ts-grid { grid-template-columns: repeat(2, 1fr); }
}
