/* ============================================================
   Buttons — .pos-btn family + .icon-btn + .kbd keyboard hint
   ============================================================ */

.pos-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 44px; padding: 0 14px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500; line-height: 1;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
  white-space: nowrap;
}
.pos-btn:hover { background: var(--bg-hover); }
.pos-btn:active { background: var(--bg-active); }
.pos-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
  border-color: var(--accent);
}
.pos-btn-primary {
  background: var(--accent); color: var(--accent-fg); border-color: transparent;
}
.pos-btn-primary:hover { background: var(--accent-hover); }
.pos-btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-secondary);
}
.pos-btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.pos-btn-danger {
  background: transparent; color: var(--danger); border-color: var(--border-default);
}
.pos-btn-danger:hover { background: var(--danger-soft); border-color: transparent; }
.pos-btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.pos-btn-xs { height: 26px; padding: 0 8px; font-size: 11.5px; border-radius: 5px; }
.pos-btn:disabled, .pos-btn[disabled] { opacity: 0.65; }

/* Loading state — applied automatically to a submit button while its
   form is submitting (see resources/js/lib/submit-loader.js). The loader
   prepends a spinner SVG and keeps the label visible ("⟳ Save changes"),
   matching the project's spinner-plus-text pattern. The button's own
   leading icon is hidden so the spinner takes its place. Buttons that
   ship their own spinner are skipped by the loader (no double-up). */
.pos-btn.is-loading {
  pointer-events: none;
  opacity: 1;            /* stay vibrant — don't apply the :disabled dim */
}
/* Hide the button's original leading icon; the injected `.pos-btn-spin`
   spinner stays visible alongside the label. */
.pos-btn.is-loading > svg:not(.pos-btn-spin),
.pos-btn.is-loading > .pos-icon:not(.pos-btn-spin) {
  display: none;
}

/* Icon-only square button (used in topbar / inline action rows) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
  border-color: var(--accent);
}
.icon-btn-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

/* Keyboard hint chip */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--border-default);
  border-bottom-width: 1.5px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", "Segoe UI", system-ui, var(--font-mono), sans-serif;
  font-size: 11px; font-weight: 500; line-height: 1;
  border-radius: 4px;
}
