.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  transition: all var(--duration) var(--ease);
}

.chip:hover,
.chip.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-success { background: rgba(61, 214, 140, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 196, 81, 0.15); color: var(--warning); }
.badge-danger { background: rgba(255, 107, 122, 0.15); color: var(--danger); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: none;
}

.card-hover {
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.is-invalid,
.textarea.is-invalid {
  border-color: var(--danger);
}

.label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field {
  margin-bottom: var(--space-4);
}

.field-error {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}

tr:last-child td {
  border-bottom: none;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tab.is-active,
.tab:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--muted);
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 1rem);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
}

.toast {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  animation: toast-in 0.28s var(--ease);
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: var(--z-modal);
  display: grid;
  place-items: end center;
  padding: 1rem;
}

.modal {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .modal-backdrop {
    place-items: center;
  }
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--surface-2);
}

.avatar-lg {
  width: 64px;
  height: 64px;
}

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: var(--space-8) 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.search-bar {
  position: relative;
}

.search-bar .input {
  padding-left: 2.5rem;
}

.search-bar svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.accordion details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.65rem;
  padding: 0.85rem 1rem;
}

.accordion summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion details[open] summary {
  margin-bottom: 0.65rem;
  color: var(--accent);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-hover), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.pricing-card.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
  position: relative;
}

.pricing-card .price {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: -0.04em;
}

.toggle {
  display: inline-flex;
  padding: 0.25rem;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.toggle button {
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 0.85rem;
}

.toggle button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
