/* Identity page — Account Merges + Pro Teams.
   Layered on styles.css. Two-tab interface; clean drop-in box workflow. */

body[data-page="identity"] .sheet-surface { padding: 0; }

.identity-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--BORDER_SUBTLE);
  padding: 0 14px;
  background: rgba(var(--surf-2), 0.4);
}
.identity-tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--FG_MUTED);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 160ms ease, border-color 160ms ease;
}
.identity-tab:hover { color: var(--FG_COLOR); }
.identity-tab.is-active {
  color: var(--FG_COLOR);
  border-bottom-color: var(--ACCENT_CYAN, #1DE9FF);
}
.identity-tab-count {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(166, 186, 218, 0.18);
  color: var(--FG_MUTED);
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}
.identity-tab.is-active .identity-tab-count {
  background: rgba(var(--accent-cyan-rgb), 0.22);
  color: var(--ACCENT_CYAN, #1DE9FF);
}

.identity-tab-pane {
  display: none;
  padding: 18px 22px 22px;
}
.identity-tab-pane.is-active { display: block; }

.identity-help {
  background: rgba(var(--surf-1), 0.55);
  border: 1px dashed rgba(166, 186, 218, 0.28);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--FG_MUTED);
  margin-bottom: 16px;
  line-height: 1.55;
}
.identity-help kbd {
  font-family: "JetBrains Mono", monospace;
  background: rgba(var(--surf-4), 0.85);
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78em;
}

/* ─────── Quick-add row ─────── */
.identity-quick-add {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: end;
  gap: 12px;
  background: rgba(var(--surf-4), 0.55);
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.identity-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.identity-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--FG_MUTED);
}
.identity-field input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 8px;
  background: var(--BUTTON_GHOST, rgba(var(--surf-2), 0.6));
  color: var(--FG_COLOR);
  font: inherit;
  font-size: 0.96rem;
  transition: border-color 140ms ease, background 140ms ease;
}
.identity-field input:focus {
  outline: none;
  border-color: var(--ACCENT_CYAN, #1DE9FF);
  background: rgba(var(--surf-2), 0.85);
}
.identity-arrow {
  align-self: center;
  font-size: 1.6rem;
  color: var(--ACCENT_CYAN, #1DE9FF);
  padding-bottom: 4px;
}
.identity-add-btn {
  min-height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: var(--ACCENT_PINK, #E04077);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: filter 140ms ease;
}
.identity-add-btn:hover { filter: brightness(1.1); }

.identity-form-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.identity-form-status.is-error {
  background: rgba(231, 128, 107, 0.12);
  border: 1px solid rgba(231, 128, 107, 0.32);
  color: #FFB39F;
}
.identity-form-status.is-success {
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.32);
  color: #7BE4AD;
}

/* ─────── Mappings table ─────── */
.identity-mappings {
  background: rgba(var(--surf-2), 0.45);
  border: 1px solid var(--BORDER_SUBTLE);
  border-radius: 12px;
  overflow: hidden;
}
.identity-mappings-head {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--BORDER_SUBTLE);
  background: rgba(var(--surf-4), 0.55);
}
.identity-mappings-head h3 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--FG_MUTED);
}
.identity-mappings-head input[type="text"] {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--BORDER_COLOR);
  border-radius: 6px;
  background: var(--BUTTON_GHOST, rgba(var(--surf-2), 0.6));
  color: var(--FG_COLOR);
  font: inherit;
  font-size: 0.86rem;
}
.identity-mappings-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.identity-dirty {
  font-size: 0.72rem;
  color: var(--ACCENT_PINK, #E04077);
  font-weight: 700;
  margin-right: 6px;
}
.identity-save, .identity-secondary {
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: filter 140ms ease, background 140ms ease;
}
.identity-save {
  background: var(--ACCENT_CYAN, #1DE9FF);
  color: #00141A;
  border: none;
}
.identity-save:hover { filter: brightness(1.1); }
.identity-secondary {
  background: transparent;
  color: var(--FG_MUTED);
  border: 1px solid var(--BORDER_COLOR);
}
.identity-secondary:hover {
  background: rgba(166, 186, 218, 0.06);
  color: var(--FG_COLOR);
}

.identity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.identity-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--FG_MUTED);
  background: rgba(var(--surf-2), 0.4);
  padding: 10px 14px;
  border-bottom: 1px solid var(--BORDER_SUBTLE);
}
.identity-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(166, 186, 218, 0.08);
  color: var(--FG_COLOR);
  vertical-align: middle;
}
.identity-table tbody tr:hover { background: rgba(var(--accent-cyan-rgb), 0.04); }
.identity-table tbody tr:last-child td { border-bottom: none; }
.identity-table .identity-row-alt {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-weight: 600;
}
.identity-table .identity-row-canon { color: var(--ACCENT_CYAN, #1DE9FF); font-weight: 700; }
.identity-row-actions { text-align: right; white-space: nowrap; }
.identity-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--FG_MUTED);
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.identity-icon-btn:hover {
  background: rgba(231, 128, 107, 0.10);
  color: #FFB39F;
  border-color: rgba(231, 128, 107, 0.32);
}

.identity-empty {
  margin: 0;
  padding: 22px 14px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--FG_MUTED);
  font-style: italic;
}

/* ─────── Pro Teams table ─────── */
.identity-table-teams td:nth-child(1) { width: 38px; }
.identity-table-teams .identity-team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  display: block;
}
.identity-table-teams .identity-team-logo.placeholder {
  background: rgba(166, 186, 218, 0.10);
  border: 1px dashed rgba(166, 186, 218, 0.24);
}
.identity-table-teams .identity-team-name { font-weight: 700; color: var(--FG_COLOR); }
.identity-table-teams .identity-team-short {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--FG_MUTED);
}
.identity-table-teams .identity-team-region {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--FG_MUTED);
}
.identity-roster-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.identity-roster-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(var(--accent-cyan-rgb), 0.10);
  border: 1px solid rgba(var(--accent-cyan-rgb), 0.28);
  color: var(--FG_COLOR);
  border-radius: 999px;
  padding: 2px 8px 2px 10px;
  font-size: 0.78rem;
  font-family: "JetBrains Mono", monospace;
}
.identity-roster-pill button {
  background: transparent;
  border: none;
  color: var(--FG_MUTED);
  padding: 0 0 0 4px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.identity-roster-pill button:hover { color: #FFB39F; }
.identity-roster-empty {
  font-size: 0.78rem;
  color: var(--FG_MUTED);
  font-style: italic;
}
.identity-roster-add {
  background: transparent;
  border: 1px dashed rgba(166, 186, 218, 0.28);
  color: var(--FG_MUTED);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  font: inherit;
}
.identity-roster-add:hover {
  background: rgba(var(--accent-cyan-rgb), 0.04);
  border-color: rgba(var(--accent-cyan-rgb), 0.32);
  color: var(--ACCENT_CYAN, #1DE9FF);
}
.identity-roster-input {
  min-width: 120px;
  border: 1px solid var(--ACCENT_CYAN, #1DE9FF);
  border-radius: 999px;
  padding: 2px 10px;
  background: rgba(var(--surf-2), 0.55);
  color: var(--FG_COLOR);
  font: inherit;
  font-size: 0.82rem;
  font-family: "JetBrains Mono", monospace;
}

@media (max-width: 760px) {
  .identity-quick-add {
    grid-template-columns: 1fr;
  }
  .identity-arrow { transform: rotate(90deg); padding-bottom: 0; }
  .identity-mappings-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
