/* vmatrix · base components
   All scoped under .vmx-theme so multiple themes can coexist on canvas. */

.vmx-theme,
.vmx-theme * {
  box-sizing: border-box;
}

.vmx-theme button,
.vmx-theme input,
.vmx-theme textarea,
.vmx-theme select {
  font: inherit;
  color: inherit;
}

/* Surfaces */
.vmx-theme .vmx-surface {
  background: var(--vmx-bg-secondary);
  border-radius: var(--vmx-r-md);
  padding: var(--vmx-md);
}

.vmx-theme .vmx-card {
  background: var(--vmx-bg-primary);
  border: 0.5px solid var(--vmx-border-tertiary);
  border-radius: var(--vmx-r-lg);
  padding: var(--vmx-md);
}

.vmx-theme .vmx-card--featured {
  border: 1.5px solid var(--vmx-accent-600);
}

/* Buttons */
.vmx-theme .vmx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--vmx-row-h);
  padding: 0 14px;
  border-radius: var(--vmx-r-md);
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--vmx-text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.vmx-theme .vmx-btn:active { transform: scale(0.98); }
/* accent-600 вместо accent-200: пастельное кольцо давало ~1.4:1 и было
   невидимо — клавиатурная навигация фактически не работала. */
.vmx-theme .vmx-btn:focus-visible {
  outline: 2px solid var(--vmx-accent-600);
  outline-offset: 2px;
}
.vmx-theme .vmx-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.vmx-theme .vmx-btn--primary {
  background: var(--vmx-accent-600);
  color: var(--vmx-accent-fg);
  border-color: var(--vmx-accent-600);
}
.vmx-theme .vmx-btn--primary:hover { background: var(--vmx-accent-800); }

.vmx-theme .vmx-btn--secondary {
  background: transparent;
  border-color: var(--vmx-border-secondary);
  color: var(--vmx-text-primary);
}
.vmx-theme .vmx-btn--secondary:hover {
  background: var(--vmx-bg-secondary);
  border-color: var(--vmx-border-primary);
}

.vmx-theme .vmx-btn--ghost {
  background: transparent;
  color: var(--vmx-text-primary);
}
.vmx-theme .vmx-btn--ghost:hover { background: var(--vmx-bg-secondary); }

.vmx-theme .vmx-btn--danger {
  background: var(--vmx-danger-bg);
  color: var(--vmx-danger-fg);
}

.vmx-theme .vmx-btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.vmx-theme .vmx-btn--lg { height: 44px; padding: 0 18px; font-size: 15px; }

.vmx-theme .vmx-btn--icon {
  width: var(--vmx-row-h);
  padding: 0;
  flex: 0 0 auto;
}
.vmx-theme .vmx-btn--icon.vmx-btn--sm { width: 28px; }

/* Pills / Badges */
.vmx-theme .vmx-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--vmx-r-full);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  background: var(--vmx-bg-secondary);
  color: var(--vmx-text-secondary);
  border: 0.5px solid transparent;
  white-space: nowrap;
}
.vmx-theme .vmx-pill--success { background: var(--vmx-success-bg); color: var(--vmx-success-fg); }
.vmx-theme .vmx-pill--warning { background: var(--vmx-warning-bg); color: var(--vmx-warning-fg); }
.vmx-theme .vmx-pill--danger  { background: var(--vmx-danger-bg);  color: var(--vmx-danger-fg); }
.vmx-theme .vmx-pill--info    { background: var(--vmx-info-bg);    color: var(--vmx-info-fg); }
.vmx-theme .vmx-pill--accent  { background: var(--vmx-accent-100); color: var(--vmx-accent-900); }

.vmx-theme .vmx-pill--square { border-radius: var(--vmx-r-sm); padding: 2px 6px; }
.vmx-theme .vmx-pill--sm { font-size: 10.5px; padding: 1px 7px; }

.vmx-theme .vmx-dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

/* Inputs */
.vmx-theme .vmx-input {
  height: var(--vmx-row-h);
  padding: 0 12px;
  background: var(--vmx-bg-primary);
  border: 0.5px solid var(--vmx-border-tertiary);
  border-radius: var(--vmx-r-md);
  font-size: 14px;
  color: var(--vmx-text-primary);
  width: 100%;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.vmx-theme .vmx-input::placeholder { color: var(--vmx-text-tertiary); }
.vmx-theme .vmx-input:hover { border-color: var(--vmx-border-secondary); }
.vmx-theme .vmx-input:focus {
  border-color: var(--vmx-accent-600);
  box-shadow: 0 0 0 2px var(--vmx-accent-200);
}
.vmx-theme .vmx-input:disabled {
  background: var(--vmx-bg-secondary);
  color: var(--vmx-text-tertiary);
  cursor: not-allowed;
}

.vmx-theme .vmx-textarea {
  min-height: 80px;
  padding: 10px 12px;
  background: var(--vmx-bg-primary);
  border: 0.5px solid var(--vmx-border-tertiary);
  border-radius: var(--vmx-r-md);
  font-size: 14px;
  color: var(--vmx-text-primary);
  width: 100%;
  resize: none;
  outline: none;
  font-family: inherit;
}

.vmx-theme .vmx-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--vmx-text-primary);
}
.vmx-theme .vmx-helper {
  font-size: 12px;
  color: var(--vmx-text-secondary);
  margin-top: 4px;
}

/* Avatar */
.vmx-theme .vmx-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--vmx-bg-tertiary);
  color: var(--vmx-text-primary);
  font-size: 12px;
  font-weight: 500;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}
.vmx-theme .vmx-avatar--24 { width: 24px; height: 24px; font-size: 10px; }
.vmx-theme .vmx-avatar--28 { width: 28px; height: 28px; font-size: 11px; }
.vmx-theme .vmx-avatar--32 { width: 32px; height: 32px; font-size: 12px; }
.vmx-theme .vmx-avatar--40 { width: 40px; height: 40px; font-size: 14px; }
.vmx-theme .vmx-avatar--56 { width: 56px; height: 56px; font-size: 18px; }
.vmx-theme .vmx-avatar--80 { width: 80px; height: 80px; font-size: 26px; }

.vmx-theme .vmx-avatar--bot {
  background: var(--vmx-accent-100);
  color: var(--vmx-accent-900);
}

/* Sidebar items */
.vmx-theme .vmx-side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--vmx-r-md);
  font-size: 13.5px;
  color: var(--vmx-text-secondary);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.vmx-theme .vmx-side-item:hover {
  background: var(--vmx-bg-secondary);
  color: var(--vmx-text-primary);
}
.vmx-theme .vmx-side-item--active {
  background: var(--vmx-bg-secondary);
  color: var(--vmx-text-primary);
  font-weight: 500;
}
.vmx-theme .vmx-side-item .vmx-side-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--vmx-text-tertiary);
}

.vmx-theme .vmx-side-section {
  font-size: 11px;
  text-transform: none;
  color: var(--vmx-text-tertiary);
  padding: 12px 8px 6px;
  letter-spacing: 0;
}

/* Dividers */
.vmx-theme .vmx-divider {
  height: 0.5px;
  background: var(--vmx-border-tertiary);
  border: 0;
  margin: 0;
}

/* Misc */
.vmx-theme .vmx-meta { color: var(--vmx-text-secondary); font-size: 12.5px; }
.vmx-theme .vmx-mono { font-family: var(--vmx-font-mono); font-size: 12.5px; }
.vmx-theme h1, .vmx-theme h2, .vmx-theme h3, .vmx-theme h4 {
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--vmx-text-primary);
}

/* Outline icon helper (currentColor strokes) */
.vmx-theme .vmx-icn {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* Kanban shared */
.vmx-theme .vmx-kanban-col {
  background: var(--vmx-bg-secondary);
  border-radius: var(--vmx-r-lg);
  padding: 10px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vmx-theme .vmx-kanban-card {
  background: var(--vmx-bg-primary);
  border: 0.5px solid var(--vmx-border-tertiary);
  border-radius: var(--vmx-r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: grab;
}
.vmx-theme .vmx-kanban-card:hover { border-color: var(--vmx-border-secondary); }

/* Tabs */
.vmx-theme .vmx-tabs {
  display: flex;
  gap: 0;
  border-bottom: 0.5px solid var(--vmx-border-tertiary);
}
.vmx-theme .vmx-tab {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--vmx-text-secondary);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -0.5px;
}
.vmx-theme .vmx-tab--active {
  color: var(--vmx-text-primary);
  border-bottom-color: var(--vmx-accent-600);
  font-weight: 500;
}

/* Tables — использовались в 6 артбордах (files, finance, analytics, integrations,
   notifications, time-tracking) и были задокументированы в README, но не определены:
   рендерились браузерным дефолтом. */
.vmx-theme .vmx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vmx-theme .vmx-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--vmx-text-secondary);
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--vmx-border-secondary);
  white-space: nowrap;
}
.vmx-theme .vmx-table td {
  padding: 9px 10px;
  border-bottom: 0.5px solid var(--vmx-border-tertiary);
  vertical-align: middle;
}
.vmx-theme .vmx-table tbody tr { transition: background 120ms; }
.vmx-theme .vmx-table tbody tr:hover { background: var(--vmx-bg-secondary); }

/* Breadcrumbs — тот же случай: класс использовался, но не существовал. */
.vmx-theme .vmx-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--vmx-text-secondary);
  min-width: 0;
}
.vmx-theme .vmx-breadcrumb > span:last-child { color: var(--vmx-text-primary); }

/* Нативный checkbox (README документирует .vmx-checkbox; div-вариант — .vmx-check
   в components-extra.css). */
.vmx-theme .vmx-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--vmx-accent-600);
  cursor: pointer;
}

/* Видимый фокус для всех интерактивных элементов системы — не только кнопок. */
.vmx-theme .vmx-side-item:focus-visible,
.vmx-theme .vmx-tab:focus-visible,
.vmx-theme .vmx-kanban-card:focus-visible,
.vmx-theme .vmx-checkbox:focus-visible {
  outline: 2px solid var(--vmx-accent-600);
  outline-offset: 1px;
}

/* Logo lockup */
.vmx-theme .vmx-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--vmx-text-primary);
  font-size: 15px;
}
.vmx-theme .vmx-logo svg { width: 18px; height: 18px; }
