/* ===== Ticket managers settings page ===== */
.tm-section {
  width: 100%;
  padding: 0;
}

.tm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tm-title {
  color: #1a1a1a;
  font-size: var(--font-size-subtitle);
  font-weight: 600;
}

.tm-desc {
  color: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  margin-top: 6px;
  max-width: 560px;
  line-height: 1.5;
}

.tm-add-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.15s;
}

.tm-add-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.tm-add-btn:active {
  transform: translateY(0);
}

.tm-status {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
  margin-bottom: 12px;
}

.tm-status-error {
  color: #e74c3c;
  font-style: normal;
}

.tm-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 620px;
  /* Cap the list height so it scrolls internally instead of pushing the page
     down as the employee roster grows. 2px inline padding + gutter keep the
     card hover shadow and the scrollbar from clipping. */
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px 8px 2px 2px;
  scrollbar-gutter: stable;
}

.tm-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s, border-color 0.2s;
}

.tm-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* A row whose employee currently has manager access. */
.tm-card-on {
  background: rgba(245, 166, 35, 0.10);
  border-color: rgba(245, 166, 35, 0.45);
}

.tm-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.tm-info {
  flex: 1 1 auto;
  min-width: 0;
}

.tm-name {
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-email {
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-remove {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(231, 76, 60, 0.25);
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, filter 0.15s;
}

.tm-remove:hover {
  background: #e74c3c;
  color: #fff;
}

.tm-empty {
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
  padding: 28px 4px;
  font-style: italic;
}

/* Live "N managers" count chip in the header. */
.tm-count {
  flex: 0 0 auto;
  align-self: center;
  background: rgba(245, 166, 35, 0.12);
  color: #b8710f;
  border: 1px solid rgba(245, 166, 35, 0.35);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Search toolbar. */
.tm-toolbar {
  margin-bottom: 14px;
  max-width: 620px;
}

.tm-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 13px;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tm-search:focus {
  outline: none;
  border-color: #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18);
}

/* Toggle switch (checkbox + track). */
.tm-switch {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
}

.tm-switch-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.tm-switch-track {
  pointer-events: none;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  transition: background 0.18s;
}

.tm-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s;
}

.tm-switch-input:checked + .tm-switch-track {
  background: var(--accent-gradient, #f5a623);
}

.tm-switch-input:checked + .tm-switch-track::after {
  transform: translateX(18px);
}

.tm-switch-input:focus-visible + .tm-switch-track {
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.3);
}

.tm-switch-input:disabled {
  cursor: progress;
}

.tm-switch-input:disabled + .tm-switch-track {
  opacity: 0.55;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .tm-header {
    flex-direction: column;
    align-items: stretch;
  }
  .tm-count {
    align-self: flex-start;
  }
}

/* ── #134 dark mode overrides ─────────────────────────────── */
html[data-theme="dark"] .tm-title,
html[data-theme="dark"] .tm-name { color: #e2e8f0; }

html[data-theme="dark"] .tm-desc,
html[data-theme="dark"] .tm-status,
html[data-theme="dark"] .tm-email,
html[data-theme="dark"] .tm-empty { color: #94a3b8; }

html[data-theme="dark"] .tm-status-error { color: #fca5a5; }

/* The card wash flips polarity — a black film is invisible on slate. */
html[data-theme="dark"] .tm-card { background: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .tm-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
html[data-theme="dark"] .tm-card-on {
  background: rgba(245, 166, 35, 0.14);
  border-color: rgba(245, 166, 35, 0.42);
}

html[data-theme="dark"] .tm-remove {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}
html[data-theme="dark"] .tm-remove:hover { background: #e74c3c; color: #fff; }

html[data-theme="dark"] .tm-count {
  background: rgba(245, 166, 35, 0.16);
  color: #f5a623;
  border-color: rgba(245, 166, 35, 0.38);
}

html[data-theme="dark"] .tm-search {
  color: #e2e8f0;
  background: #0f172a;
}
html[data-theme="dark"] .tm-search::placeholder { color: #64748b; }

html[data-theme="dark"] .tm-switch-track { background: rgba(255, 255, 255, 0.20); }
