/* ============================================================
   Components — Voyage / Lobbyos
   ============================================================ */

/* ─── Button ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 0 12px; height: 32px;
  font-family: inherit; font-size: var(--fz-base); font-weight: 500;
  line-height: 1; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--text);
  transition: background-color var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out),
              transform var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out),
              color var(--t-fast) var(--e-out);
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--sm { height: 26px; padding: 0 9px; font-size: var(--fz-sm); border-radius: var(--r-xs); }
.btn--lg { height: 38px; padding: 0 16px; font-size: var(--fz-md); border-radius: var(--r-md); }
.btn--full { width: 100%; }

.btn--primary {
  background: var(--primary); color: var(--text-on-primary);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-0.5px); box-shadow: var(--shadow-sm), inset 0 -1px 0 rgba(0,0,0,0.08); }
.btn--primary:active:not(:disabled) { background: var(--primary-pressed); transform: translateY(0); }

.btn--secondary {
  background: var(--bg-elevated); border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--text-faint); }

.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-hover); }

.btn--accent { background: var(--accent); color: var(--text-on-accent); }
.btn--accent:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-0.5px); }

.btn--destructive { background: var(--danger); color: #fff; }
.btn--destructive:hover:not(:disabled) { background: var(--danger-strong); }

.btn--soft { background: var(--primary-soft); color: var(--primary); }
.btn--soft:hover:not(:disabled) { background: var(--primary-soft-hover); }

.btn__label { white-space: nowrap; }

/* ─── Icon button ──────────────────────────────────────────── */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted);
  transition: background-color var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out);
}
.iconbtn--sm { width: 24px; height: 24px; }
.iconbtn--lg { width: 32px; height: 32px; }
.iconbtn--ghost:hover { background: var(--bg-hover); color: var(--text); }
.iconbtn--solid { background: var(--bg-elevated); border-color: var(--border); color: var(--text-muted); box-shadow: var(--shadow-xs); }
.iconbtn--solid:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.iconbtn.is-active { background: var(--primary-soft); color: var(--primary); }

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: var(--r-xs);
  font-size: var(--fz-xs); font-weight: 500; line-height: 1.4;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge--md { font-size: var(--fz-sm); padding: 3px 8px; }
.badge--neutral { background: var(--bg-subtle); color: var(--text-muted); border-color: var(--border); }
.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--success { background: var(--success-soft); color: var(--success-strong); }
.badge--danger { background: var(--danger-soft); color: var(--danger-strong); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge__dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85;
}

/* ─── Chip ──────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; height: 26px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px; font-size: var(--fz-sm); color: var(--text);
  transition: background-color var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out);
}
.chip:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 999px; margin-right: -4px;
  color: var(--text-faint);
}
.chip__close:hover { background: var(--bg-active); color: var(--text); }

/* ─── Input ──────────────────────────────────────────────── */
.input {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px; height: 32px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out);
}
.input--sm { height: 26px; padding: 0 8px; }
.input--lg { height: 38px; padding: 0 12px; }
.input:focus-within { border-color: var(--border-focus); box-shadow: var(--ring-focus); }
.input__el {
  flex: 1; min-width: 0; background: transparent; border: 0;
  outline: none; font-family: inherit; font-size: var(--fz-base);
  color: var(--text);
}
.input__el::placeholder { color: var(--text-faint); }

/* Standalone form fields — для CreateView/UpdateView форм (вне обёртки .input) */
.bk-input,
.form-field {
  display: block;
  padding: 9px 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out);
}
.bk-input:focus,
.form-field:focus { border-color: var(--border-focus); box-shadow: var(--ring-focus); }
select.bk-input option,
select.form-field option { background: var(--bg-elevated); color: var(--text); }
textarea.bk-input,
textarea.form-field { min-height: 64px; resize: vertical; font-family: inherit; }
.input__icon { color: var(--text-faint); display: inline-flex; }
.input__slot { color: var(--text-faint); font-size: var(--fz-xs); display: inline-flex; align-items: center; gap: 4px; }

/* ─── Select ──────────────────────────────────────────────── */
.select { position: relative; display: inline-block; }
.select__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 8px 0 10px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); font-size: var(--fz-base);
  transition: background-color var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out);
}
.select--sm .select__btn { height: 26px; font-size: var(--fz-sm); }
.select__btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.select__label { font-weight: 500; }
.select__menu {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 160px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 4px;
  z-index: 100; animation: fade-scale-in var(--t-fast) var(--e-out);
  transform-origin: top left;
}
.select__item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border-radius: var(--r-xs); background: transparent;
  border: 0; color: var(--text); font-size: var(--fz-base); text-align: left;
}
.select__item:hover { background: var(--bg-hover); }
.select__item.is-selected { background: var(--primary-soft); color: var(--primary); }
.select__check { margin-left: auto; }

/* ─── Switch ──────────────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch__track {
  position: relative; display: inline-block; width: 32px; height: 18px;
  background: var(--bg-active); border-radius: 999px;
  transition: background-color var(--t-fast) var(--e-out);
  cursor: pointer;
}
.switch__track.is-on { background: var(--primary); }
.switch__thumb {
  position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  background: var(--bg-elevated); border-radius: 50%;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--e-out);
}
.switch__track.is-on .switch__thumb { transform: translateX(14px); }
.switch__label { font-size: var(--fz-sm); color: var(--text-muted); }

/* ─── Segmented ─────────────────────────────────────────── */
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--bg-subtle); border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.seg__btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; min-height: 22px;
  background: transparent; border: 0; border-radius: 4px;
  color: var(--text-muted); font-family: inherit; font-size: var(--fz-sm); font-weight: 500;
  transition: background-color var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
}
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active {
  background: var(--bg-elevated); color: var(--text);
  box-shadow: var(--shadow-xs);
}
.seg--sm .seg__btn { padding: 2px 7px; font-size: var(--fz-xs); }
.seg--lg .seg__btn { padding: 6px 14px; font-size: var(--fz-base); }

/* ─── Avatar ──────────────────────────────────────────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; border-radius: 50%; font-weight: 600;
  flex-shrink: 0; letter-spacing: 0.01em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ─── Card ──────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: box-shadow var(--t-fast) var(--e-out), border-color var(--t-fast) var(--e-out);
}
.card--padded { padding: 16px; }
.card--hover:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ─── KBD ──────────────────────────────────────────────── */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--bg-subtle); border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px; font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500; color: var(--text-muted);
  line-height: 1;
}

/* ─── Tooltip ────────────────────────────────────────── */
.tt-wrap { position: relative; display: inline-flex; }
.tt {
  position: absolute; z-index: 90; pointer-events: none;
  background: var(--text); color: var(--bg-elevated);
  padding: 4px 8px; border-radius: var(--r-xs);
  font-size: var(--fz-xs); white-space: nowrap;
  animation: fade-in var(--t-fast) var(--e-out);
}
.tt--top { left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); }
.tt--bottom { left: 50%; top: calc(100% + 6px); transform: translateX(-50%); }
.tt--right { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }

/* ─── Toast ────────────────────────────────────────────── */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 280px; max-width: 380px; padding: 12px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: toast-in var(--t-base) var(--e-out);
}
.toast--success { border-left: 3px solid var(--success); }
.toast--success > svg { color: var(--success); }
.toast--danger { border-left: 3px solid var(--danger); }
.toast--danger > svg { color: var(--danger); }
.toast--neutral > svg { color: var(--text-muted); }
.toast__title { font-weight: 600; font-size: var(--fz-base); color: var(--text); }
.toast__desc { font-size: var(--fz-sm); color: var(--text-muted); margin-top: 2px; }

/* ─── Sidepanel ────────────────────────────────────────── */
.sidepanel { position: fixed; inset: 0; z-index: 500; display: flex; justify-content: flex-end; }
.sidepanel__backdrop { position: absolute; inset: 0; background: var(--bg-overlay); animation: fade-in var(--t-base) var(--e-out); }
.sidepanel__panel {
  position: relative; height: 100%; background: var(--bg-elevated);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slide-in-right var(--t-base) var(--e-out);
}
.sidepanel__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 16px; gap: 12px; border-bottom: 1px solid var(--divider);
}
.sidepanel__subtitle { font-size: var(--fz-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 4px; }
.sidepanel__title { font-size: var(--fz-lg); font-weight: 600; margin: 0; color: var(--text); }
.sidepanel__body { flex: 1; overflow: auto; padding: 20px; }
.sidepanel__foot { padding: 14px 20px; border-top: 1px solid var(--divider); display: flex; gap: 8px; }

/* ─── Status blot (legend dot) ─────────────────────────── */
.stb { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid; }
.stb--confirmed   { background: var(--status-confirmed-bg);   border-color: var(--status-confirmed-border); }
.stb--checked_in  { background: var(--status-checked-in-bg);  border-color: var(--status-checked-in-border); }
.stb--checked_out { background: var(--status-checked-out-bg); border-color: var(--status-checked-out-border); }
.stb--pending     { background: var(--status-pending-bg);     border-color: var(--status-pending-border); }
.stb--cancelled   { background: var(--status-cancelled-bg);   border-color: var(--status-cancelled-border); }

/* ─── Popover ─────────────────────────────────────────── */
.popover {
  position: fixed; z-index: 200;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-xl);
  padding: 14px; animation: fade-scale-in var(--t-fast) var(--e-out);
  transform-origin: top left;
}
