/* =========================================================
   Common UI Elements (buttons, inputs, cards)
   ========================================================= */
button {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.small {
  padding: 6px 10px;
  font-size: 13px;
}

/* Subtle selected state for tab buttons (Library/Rigor) */
button.small.tab-selected {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

.small.kebab {
  width: 30px;
  padding: 6px 0;
  text-align: center;
  line-height: 1;
}

/* Kebab menu */
button.kebab {
  padding: 0 6px;
  font-size: 16px;
  line-height: 1;
}

/* Context menu */
.ctxMenu {
  position: absolute;
  z-index: 1000;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 160px;
  padding: 6px 0;
}

.ctxMenu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: none;
  border: none;
  cursor: pointer;
}

.ctxMenu button:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ctxMenu button[disabled] {
  opacity: 0.5;
  cursor: default;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border: none;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  background: #fff;
}

.mini {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.spacer {
  flex: 1;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}

.pill.good {
  color: var(--good);
  border-color: rgba(22, 163, 74, 0.3);
}

.pill.warn {
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.3);
}

/* Compact badge for inside buttons (like Rigor count) */
button .pill {
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.2;
  vertical-align: middle;
  position: relative;
  top: -1px; /* Fine-tune vertical centering */
}

/* Subtle empty-text cue: reminds user the "claim" is missing */
textarea.emptyTextCue {
  background: rgba(217, 119, 6, 0.08) !important;
}

/* =========================================================
   Real-Time Sync - Control Bar
   ========================================================= */

.control-bar {
  display: none; /* Hidden by default, shown when real-time sync is active */
  position: sticky;
  top: 0;
  z-index: 100;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--r);
  margin-bottom: 12px;
  font-size: 13px;
}

.control-bar-viewers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.control-bar-actions {
  display: flex;
  gap: 6px;
}

.viewer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
}

.viewer-badge.driver {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e40af;
  font-weight: 600;
}

/* Driver focus highlight for observers */
.driverFocus {
  outline: 2px solid #60a5fa !important;
  outline-offset: 2px;
  background: #eff6ff !important;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1) !important;
}

/* Info icon for tooltips */
.infoIcon {
  font-size: 14px;
  color: #94a3b8;
  cursor: help;
  margin-left: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.infoIcon:hover {
  opacity: 1;
  color: #64748b;
}
