/* TagInput chips widget - ported from qonda_vault, fonts inherit from the app */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border: 1px solid #ccc;
  padding: 4px;
  border-radius: 5px;
  position: relative;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.tag-container:focus-within {
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.tag-input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 80px;
  font-family: inherit;
  font-size: 12px;
  padding: 3px 6px;
  background: transparent;
}

.tag {
  border: 1px solid #b4d0de;
  background-color: #eff3f5;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
}

.tag button {
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  color: #666;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tag button:hover {
  background-color: #f6e5e5;
  border-color: #fac2c2;
  color: #c0392b;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 20000;
  max-height: 150px;
  overflow-y: auto;
}

.suggestion {
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.suggestion:hover,
.suggestion--active {
  background-color: #e8f0fe;
}

/* ── Bulk wizard (Manager) ─────────────────────────────── */
.bulk-note {
  font-size: 12px;
  color: #666;
}

.bulk-hint {
  font-size: 11px;
  color: #888;
}

.bulk-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.bulk-textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  resize: vertical;
  background: #fff;
  color: inherit;
}

.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bulk-table th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  background: #fafafa;
}

.bulk-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.bulk-table td.bulk-nowrap { white-space: nowrap; }

.bulk-ok  { color: #2f7d4f; }
.bulk-bad { color: #c0392b; }
.bulk-dim { color: #999; }

/* ── Dark theme (class "theme-dark", tokens from dark.css) ── */
.theme-dark .tag-container {
  border-color: var(--dk-border);
  background: var(--dk-input);
}

.theme-dark .tag-container:focus-within {
  border-color: var(--dk-blue);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.25);
}

.theme-dark .tag-input {
  color: var(--dk-text);
}

.theme-dark .tag-input::placeholder {
  color: var(--dk-text3);
}

.theme-dark .tag {
  border-color: var(--dk-border);
  background-color: var(--dk-surface3);
  color: var(--dk-text);
}

.theme-dark .tag button {
  color: var(--dk-text2);
}

.theme-dark .tag button:hover {
  background-color: rgba(192, 57, 43, 0.25);
  border-color: rgba(192, 57, 43, 0.5);
  color: #f28b82;
}

.theme-dark .suggestions {
  background: var(--dk-surface);
  border-color: var(--dk-border);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.theme-dark .suggestion {
  color: var(--dk-text);
}

.theme-dark .suggestion:hover,
.theme-dark .suggestion--active {
  background-color: var(--dk-hover);
}

.theme-dark .bulk-note,
.theme-dark .bulk-hint {
  color: var(--dk-text2);
}

.theme-dark .bulk-wrap {
  border-color: var(--dk-border);
}

.theme-dark .bulk-textarea {
  background: var(--dk-input);
  border-color: var(--dk-border);
  color: var(--dk-text);
}

.theme-dark .bulk-table th {
  background: var(--dk-surface2);
  border-bottom-color: var(--dk-border);
  color: var(--dk-text);
}

.theme-dark .bulk-table td {
  border-bottom-color: var(--dk-border2);
}

.theme-dark .bulk-ok  { color: #5fbf87; }
.theme-dark .bulk-bad { color: #e57373; }
.theme-dark .bulk-dim { color: var(--dk-text3); }
