/* Buttons retired here — Phase 0.2 (DECISIONS 2026-05-28). The button rules
   live in core/css/tms_theme.css under the .tms-btn* vocabulary. Login
   migrated from .btn .btn-primary / .btn-icon to .tms-btn .tms-btn-primary /
   .tms-btn-icon (one button system). */

/* ─── Status pills ─────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.pill-unassigned {
  background: var(--status-unassigned-bg);
  color: var(--status-unassigned-fg);
}

.pill-dsp {
  background: var(--status-dsp-bg);
  color: var(--status-dsp-fg);
}

.pill-it {
  background: var(--status-it-bg);
  color: var(--status-it-fg);
}

.pill-del {
  background: var(--status-del-bg);
  color: var(--status-del-fg);
}

.pill-inactive {
  background: var(--status-inactive-bg);
  color: var(--status-inactive-fg);
  border-color: var(--status-inactive-border);
  cursor: pointer;
}

.pill-inactive:hover {
  background: var(--surface-sunken);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.pill.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

.pill.is-loading::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: var(--space-1);
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: pill-spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes pill-spin {
  to { transform: rotate(360deg); }
}

/* ─── Pill group ───────────────────────────────────────────── */

.pill-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* ─── Card ─────────────────────────────────────────────────── */

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ─── Table ────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

.table th {
  padding: 9px var(--space-4);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table td {
  padding: 11px var(--space-4);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--surface-row-hover);
}

/* ─── Navigation ───────────────────────────────────────────── */

.nav {
  display: flex;
  flex-direction: column;
  width: var(--nav-width);
  height: 100%;
  background: var(--surface-nav);
  overflow-y: auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  min-height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-section {
  padding: var(--space-3) 0;
}

.nav-section + .nav-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-section-label {
  padding: 0 var(--space-4) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-inverse-dim);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-inverse-dim);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}

.nav-item:hover {
  background: var(--surface-nav-hover);
  color: var(--text-inverse);
}

.nav-item.is-active {
  background: var(--surface-nav-active);
  color: var(--text-inverse);
}

.nav-footer {
  margin-top: auto;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-navy-600);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: 600;
  flex-shrink: 0;
}

/* ─── Topbar ───────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  min-height: var(--header-height);
}

.topbar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-meta {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.topbar-spacer {
  flex: 1;
}

/* ─── Tabs ─────────────────────────────────────────────────── */

.tabs {
  display: flex;
  align-items: center;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.is-active {
  color: var(--brand-accent);
  border-bottom-color: var(--brand-accent);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-1);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
}

/* ─── Search ───────────────────────────────────────────────── */

.search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--space-2);
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-input {
  padding: var(--space-2) var(--space-3);
  padding-left: var(--space-6);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.1s;
}

.search-input:focus {
  border-color: var(--brand-accent);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

/* ─── Form inputs ──────────────────────────────────────────── */

.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.1s;
}

.form-input:focus {
  border-color: var(--brand-accent);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-error {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-danger);
}

/* ─── Form field wrapper ───────────────────────────────────── */

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="email"] {
  display: block;
  width: 100%;
  padding: 9px var(--space-3);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input[type="text"]:focus,
.form-field input[type="password"]:focus,
.form-field input[type="email"]:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-field.has-error input[type="text"],
.form-field.has-error input[type="password"],
.form-field.has-error input[type="email"] {
  border-color: var(--text-danger);
}

.form-field.has-error input[type="text"]:focus,
.form-field.has-error input[type="password"]:focus,
.form-field.has-error input[type="email"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* ─── Form messages ────────────────────────────────────────── */

.form-message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.form-message-error {
  background: var(--status-error-bg);
  color: var(--status-error-fg);
  border-color: var(--status-error-border);
}

.form-message-success {
  background: var(--status-success-bg);
  color: var(--status-success-fg);
  border-color: var(--status-success-border);
}

.form-message-info {
  background: var(--status-info-bg);
  color: var(--status-info-fg);
  border-color: var(--status-info-border);
}
