/* ============================================================
   Terminals — two-column master-detail (checkout stations).
   Mirrors the Brands layout: flat list + sticky side editor.
   ============================================================ */

.term-list { list-style: none; padding: 0; margin: 0; }

.term-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  position: relative;
  transition: background 100ms ease;
}
.term-list > li:last-child .term-row { border-bottom: none; }
.term-row:hover { background: var(--bg-hover); }

.term-row.is-selected { background: var(--bg-hover); }
.term-row.is-selected::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 2.5px;
  background: var(--accent);
}

.term-row-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.term-row-link::before {
  content: '';
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.term-row-toggle,
.term-row-use,
.term-row-active,
.prod-del-btn { position: relative; z-index: 1; }

/* "Use on this device" — outlined pill that binds the workstation. */
.term-row-use {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding-inline: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 100ms ease, color 100ms ease;
}
.term-row-use:hover { border-color: var(--accent); color: var(--accent); }
.term-row-use:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.term-row-use:disabled { opacity: 0.5; cursor: not-allowed; }

/* Active binding — success-tinted badge that doubles as "unbind". */
.term-row-active {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding-inline: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--positive);
  background: var(--positive-soft);
  border: 1px solid color-mix(in oklab, var(--positive) 35%, transparent);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.term-row-active:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }

/* Station glyph tile. */
.term-tile {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.term-row-body { flex: 1; min-width: 0; line-height: 1.3; }
.term-row-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-row-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term-row-meta .mono { font-family: var(--font-mono); }
.term-row-dot { margin-inline: 2px; }

/* ── Status toggle (shared shape with .brand-row-toggle) ────── */
.term-row-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  padding: 0;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.term-row-toggle:hover { border-color: var(--accent); }
.term-row-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.term-row-toggle:disabled { opacity: 0.6; cursor: progress; }

.term-row-toggle-thumb {
  display: block;
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--text-tertiary);
  transition: transform 140ms cubic-bezier(.4,0,.2,1), background 120ms ease;
}
.term-row-toggle.is-on {
  background: var(--accent);
  border-color: var(--accent);
}
.term-row-toggle.is-on .term-row-toggle-thumb {
  background: #fff;
  transform: translateX(16px);
}
[dir="rtl"] .term-row-toggle.is-on .term-row-toggle-thumb {
  transform: translateX(-16px);
}

.term-row.is-inactive .term-row-name,
.term-row.is-inactive .term-row-meta { opacity: 0.55; }

/* ── List empty state ───────────────────────────────────────── */
.term-empty { padding: 48px 24px; text-align: center; }
.term-empty-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.term-empty-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.term-empty-sub {
  font-size: 12px; color: var(--text-tertiary);
  margin-top: 6px; max-width: 280px; margin-inline: auto; line-height: 1.5;
}

/* ── Right-column editor ────────────────────────────────────── */
.term-editor { position: sticky; top: 16px; }
.term-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.term-editor-head .term-tile {
  width: 48px; height: 48px;
  border-radius: 10px;
}
.term-editor-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.term-editor-id   { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.term-editor-id .mono { font-family: var(--font-mono); }

/* Read-only store indicator in the editor — terminals are storewise, so
   the store isn't editable; it just shows which store the terminal is in. */
.term-editor-store { display: flex; align-items: center; min-height: 34px; }

.term-editor-empty { padding: 40px 24px; text-align: center; }
.term-editor-empty-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.term-editor-empty-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.term-editor-empty-sub   { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

.term-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Hardware sub-section in the editor ─────────────────────── */
.term-hw {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.term-hw-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.term-hw-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.term-hw-paired {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Customer-display attract media (Slice 3) ─────────────── */
.term-cfd-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.term-cfd-thumb {
  position: relative;
  width: 84px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  flex: 0 0 auto;
}
.term-cfd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.term-cfd-thumb-x {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-end: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
}
.term-cfd-thumb-x:hover { background: var(--danger); }
.term-cfd-add {
  width: 84px;
  height: 60px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.term-cfd-add:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.term-cfd-add:disabled { cursor: wait; opacity: 0.7; }

/* Kiosk category whitelist — a compact, scrollable checkbox list. */
.term-kiosk-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
  margin-top: 6px;
  padding: 2px;
}
.term-kiosk-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.term-kiosk-cat:hover { border-color: var(--border-strong); }
.term-kiosk-cat:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
