/* BYNZO reusable components — keep class names stable for Blade/Vue later */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: var(--fw-sb);
  border: 1px solid transparent;
  transition: 160ms var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--bnz-orange);
  color: #fff;
  box-shadow: 0 8px 18px var(--bnz-orange-ring);
}
.btn-primary:hover { background: var(--bnz-orange-hover); }
.btn-primary:active { background: var(--bnz-orange-pressed); }
.btn-dark { background: var(--bnz-black); color: #fff; }
.btn-dark:hover { background: #2a2a2e; }
.btn-ghost {
  background: #fff;
  border-color: var(--bnz-border);
  color: var(--bnz-text);
}
.btn-ghost:hover { background: var(--bnz-surface-2); border-color: var(--bnz-border-strong); }
.btn-soft { background: var(--bnz-orange-soft); color: var(--bnz-orange-pressed); }
.btn-soft:hover { background: #ffe4d2; }
.btn-danger { background: var(--bnz-danger); color: #fff; }
.btn-danger-soft { background: var(--bnz-danger-soft); color: var(--bnz-danger); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: var(--fs-xs); border-radius: 10px; }
.btn-lg { min-height: 48px; padding: 0 18px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; padding: 0; min-height: 0;
  border-radius: 12px; border: 1px solid var(--bnz-border); background: #fff;
}
.btn-icon:hover { background: var(--bnz-bg); }
.btn-icon.plain { border-color: transparent; background: transparent; }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; }

.icon { width: 18px; height: 18px; flex: none; }
.icon-lg { width: 22px; height: 22px; }

.card {
  background: var(--bnz-surface);
  border: 1px solid var(--bnz-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-hover { transition: 180ms var(--ease); }
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #dddde3;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 0;
}
.card-title { font-weight: var(--fw-bd); letter-spacing: -0.02em; }

.label { display: block; font-size: var(--fs-xs); font-weight: var(--fw-sb); margin-bottom: 6px; color: var(--bnz-text-2); }
.help { font-size: var(--fs-xs); color: var(--bnz-muted); margin-top: 6px; }
.field { width: 100%; }
.input, .select, .textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--bnz-border);
  border-radius: 12px;
  min-height: 44px;
  padding: 0 12px;
  transition: 150ms var(--ease);
}
.textarea { min-height: 110px; padding: 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--bnz-orange);
  box-shadow: 0 0 0 4px var(--bnz-orange-ring);
  outline: none;
}
.input-group { position: relative; }
.input-group .lead {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--bnz-muted);
}
.input-group .input { padding-left: 40px; }

.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='2' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.toggle {
  position: relative; width: 44px; height: 26px; flex: none;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span {
  position: absolute; inset: 0; background: #d4d4d8; border-radius: 99px; transition: 180ms var(--ease);
}
.toggle span::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: 180ms var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.toggle input:checked + span { background: var(--bnz-orange); }
.toggle input:checked + span::after { transform: translateX(18px); }

.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--bnz-bg);
  border-radius: 14px; overflow: auto;
}
.tab {
  border: 0; background: transparent; min-height: 36px; padding: 0 12px;
  border-radius: 10px; color: var(--bnz-muted); font-weight: var(--fw-sb); font-size: var(--fs-sm);
  white-space: nowrap;
}
.tab.active, .tab[aria-selected="true"] { background: #fff; color: var(--bnz-text); box-shadow: var(--shadow-sm); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 11px; font-weight: var(--fw-sb); background: var(--bnz-bg); color: var(--bnz-text-2);
}
.badge-orange { background: var(--bnz-orange-soft); color: var(--bnz-orange-pressed); }
.badge-green { background: var(--bnz-success-soft); color: #15803d; }
.badge-red { background: var(--bnz-danger-soft); color: var(--bnz-danger); }
.badge-blue { background: var(--bnz-info-soft); color: var(--bnz-info); }
.badge-amber { background: var(--bnz-warning-soft); color: #b45309; }
.verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--bnz-orange); color: #fff;
}
.verified svg { width: 10px; height: 10px; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bd); color: #fff; flex: none; overflow: hidden;
  letter-spacing: -0.03em; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 88px; height: 88px; font-size: 32px; }
.avatar-2xl { width: 112px; height: 112px; font-size: 40px; }
.online-dot {
  position: absolute; right: 0; bottom: 0; width: 10px; height: 10px;
  background: #22c55e; border: 2px solid #fff; border-radius: 50%;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 10px; border-radius: 99px;
  background: var(--bnz-bg); font-size: var(--fs-xs); font-weight: var(--fw-sb);
}
.chip.selected { background: var(--bnz-orange-soft); color: var(--bnz-orange-pressed); }

.empty, .error-state, .loading-state {
  text-align: center; padding: 48px 20px; color: var(--bnz-muted);
}
.empty-icon, .state-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  display: grid; place-items: center; background: var(--bnz-bg); color: var(--bnz-text);
}

.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f7f7f8 37%, #eee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.toast-wrap {
  position: fixed; right: 18px; bottom: 18px; z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 260px; max-width: 360px;
  background: var(--bnz-ink); color: #fff; padding: 12px 14px;
  border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn 220ms var(--ease);
}
.toast.success { box-shadow: 0 10px 30px rgba(22,163,74,.2); }
.toast.error { background: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,10,12,.48);
  z-index: var(--z-modal); display: grid; place-items: center; padding: 16px;
  backdrop-filter: blur(6px);
}
.modal {
  width: min(560px, 100%);
  background: #fff; border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow-lg); animation: fadeUp 200ms var(--ease);
}
.modal-lg { width: min(760px, 100%); }
.modal h3 { font-size: 1.15rem; letter-spacing: -0.03em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--bnz-border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: var(--z-dropdown);
}
.dropdown-item {
  width: 100%; text-align: left; padding: 10px 10px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm);
}
.dropdown-item:hover { background: var(--bnz-bg); }
.dropdown-item.danger { color: var(--bnz-danger); }
.sep { height: 1px; background: var(--bnz-border); margin: 6px 4px; }

.app-card {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 150px;
}
.app-card .app-ico {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
}
.app-card h3 { font-size: var(--fs-md); letter-spacing: -0.02em; }
.app-card p { color: var(--bnz-muted); font-size: var(--fs-xs); }

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--bnz-border);
}
.list-row:last-child { border-bottom: 0; }
.grow { flex: 1; min-width: 0; }

.stat {
  padding: 16px;
}
.stat b { display: block; font-size: 1.4rem; letter-spacing: -0.04em; }
.stat span { color: var(--bnz-muted); font-size: var(--fs-xs); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

.table-wrap { overflow: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
}
table.data th, table.data td {
  text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--bnz-border); white-space: nowrap;
}
table.data th { color: var(--bnz-muted); font-weight: var(--fw-sb); font-size: var(--fs-xs); }

.file-tile {
  padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 150px;
}
.file-thumb {
  height: 88px; border-radius: 12px; display: grid; place-items: center; font-weight: var(--fw-bd); color: #fff;
}

.bubble {
  max-width: min(72%, 520px); padding: 10px 12px; border-radius: 16px; font-size: var(--fs-sm);
}
.bubble.me { background: var(--bnz-orange); color: #fff; border-bottom-right-radius: 6px; margin-left: auto; }
.bubble.them { background: #fff; border: 1px solid var(--bnz-border); border-bottom-left-radius: 6px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--bnz-border);
}
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--bnz-orange); box-shadow: 0 0 0 4px var(--bnz-orange-soft);
}

.privacy-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--bnz-border);
}
.privacy-row:last-child { border-bottom: 0; }

.section-add {
  border: 1.5px dashed var(--bnz-border-strong); background: transparent;
  border-radius: var(--radius-lg); min-height: 64px; width: 100%;
  color: var(--bnz-muted); font-weight: var(--fw-sb);
}
.section-add:hover { border-color: var(--bnz-orange); color: var(--bnz-orange); background: var(--bnz-orange-soft); }

.qr-box {
  width: 148px; height: 148px; border-radius: 16px; border: 1px dashed var(--bnz-border-strong);
  display: grid; place-items: center; background:
    repeating-conic-gradient(#111 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  position: relative;
}
.qr-box::after {
  content: "QR"; position: absolute; background: #fff; padding: 4px 8px; border-radius: 8px;
  font-weight: var(--fw-bd); color: var(--bnz-orange);
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 280ms var(--ease); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .toast-wrap { left: 12px; right: 12px; bottom: calc(var(--bottom-h) + 12px); }
}
