/*! @brand/core v1.0.0 — Multi-brand engine (LSC-Lab) — built 2026-04-21 */
/* Componentes neutros que referenciam variáveis do tema. */

/* ===== Reset / Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body.brand, .brand-app {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--fg);
  background: var(--bg);
}
.brand-app a { color: var(--accent); text-decoration: none; transition: color var(--motion-fast) var(--motion-ease); }
.brand-app a:hover { opacity: 0.85; }
.brand-app h1, .brand-app h2, .brand-app h3, .brand-app h4 { font-family: var(--font-display); margin: 0 0 var(--space-3) 0; font-weight: var(--weight-display); line-height: var(--leading-display); color: var(--fg); }
.brand-app h1 { font-size: var(--text-4xl); }
.brand-app h2 { font-size: var(--text-3xl); }
.brand-app h3 { font-size: var(--text-2xl); }
.brand-app h4 { font-size: var(--text-xl); }
.brand-app p { margin: 0 0 var(--space-3) 0; }
.brand-app code, .brand-app pre { font-family: var(--font-mono); font-size: 0.9em; }
.brand-app pre { background: var(--surface); padding: var(--space-3); border-radius: var(--radius-md); overflow-x: auto; }
.brand-app code:not(pre code) { background: var(--surface); padding: 2px 6px; border-radius: var(--radius-sm); }

/* ===== Button ===== */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--btn-py) var(--btn-px);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--weight-medium);
  border-radius: var(--radius-btn); border: 1px solid transparent;
  cursor: pointer; transition: all var(--motion-fast) var(--motion-ease);
  text-decoration: none; line-height: 1; user-select: none; white-space: nowrap;
  background: var(--primary); color: var(--on-primary);
  letter-spacing: var(--btn-tracking);
}
.b-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.b-btn:active { transform: translateY(0); }
.b-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.b-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.b-btn--secondary { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.b-btn--secondary:hover { background: var(--surface-hover); }
.b-btn--ghost { background: transparent; color: var(--fg-muted); }
.b-btn--ghost:hover { background: var(--surface); color: var(--fg); }
.b-btn--accent { background: var(--accent); color: var(--on-accent); }
.b-btn--accent:hover { background: var(--accent-hover); }
.b-btn--cta { background: var(--cta, var(--primary)); color: var(--on-cta, var(--on-primary)); padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.b-btn--cta:hover { background: var(--cta-hover, var(--primary-hover)); }
.b-btn--danger { background: var(--danger); color: #fff; }
.b-btn--success { background: var(--success); color: #fff; }
.b-btn--sm { padding: 6px var(--space-3); font-size: var(--text-xs); }
.b-btn--lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.b-btn--block { display: flex; width: 100%; }

/* ===== Card ===== */
.b-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-padding);
  transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease);
  box-shadow: var(--shadow-card);
}
.b-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card-hover); }
.b-card--elevated { box-shadow: var(--shadow-md); }
.b-card--glass { background: var(--surface-glass, rgba(255,255,255,0.6)); backdrop-filter: blur(12px); }
.b-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.b-card__title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-display); margin: 0; color: var(--fg); }
.b-card__body { color: var(--fg-muted); }
.b-card__footer { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }

/* ===== Input ===== */
.b-input, .b-textarea, .b-select {
  width: 100%; padding: var(--input-py) var(--input-px);
  background: var(--input-bg, var(--bg));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  color: var(--fg);
  font-family: var(--font-body); font-size: var(--text-sm);
  transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease);
}
.b-input:focus, .b-textarea:focus, .b-select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring);
}
.b-input::placeholder { color: var(--fg-subtle); }
.b-textarea { min-height: 100px; resize: vertical; }
.b-field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.b-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--fg); }
.b-help { font-size: var(--text-xs); color: var(--fg-muted); }
.b-error { font-size: var(--text-xs); color: var(--danger); }

/* ===== Badge ===== */
.b-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold);
  border-radius: var(--radius-full); background: var(--surface-hover); color: var(--fg);
  letter-spacing: 0.02em;
}
.b-badge--primary { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.b-badge--accent { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.b-badge--success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.b-badge--warning { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.b-badge--danger  { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

/* ===== Table ===== */
.b-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; }
.b-table th, .b-table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.b-table th { background: var(--bg); color: var(--fg-muted); font-weight: var(--weight-semibold); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-body); }
.b-table tbody tr:hover { background: var(--surface-hover); }
.b-table tbody tr:last-child td { border-bottom: none; }

/* ===== Modal ===== */
.b-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: var(--space-4); animation: b-fade var(--motion-base) var(--motion-ease); }
.b-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-6); max-width: 500px; width: 100%; box-shadow: var(--shadow-xl); animation: b-slide var(--motion-base) var(--motion-ease); }
.b-modal--lg { max-width: 800px; }
.b-modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.b-modal__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-display); margin: 0; }
.b-modal__close { background: none; border: none; color: var(--fg-muted); cursor: pointer; padding: var(--space-1); font-size: var(--text-xl); border-radius: var(--radius-sm); }
.b-modal__close:hover { background: var(--surface-hover); color: var(--fg); }
@keyframes b-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes b-slide { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Toast ===== */
.b-toast-container { position: fixed; top: var(--space-4); right: var(--space-4); z-index: 1200; display: flex; flex-direction: column; gap: var(--space-2); }
.b-toast { background: var(--surface); border: 1px solid var(--border-strong); border-left-width: 4px; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-lg); display: flex; gap: var(--space-3); min-width: 280px; animation: b-slide-in var(--motion-base) var(--motion-ease); }
.b-toast--success { border-left-color: var(--success); }
.b-toast--error   { border-left-color: var(--danger); }
.b-toast--warning { border-left-color: var(--warning); }
.b-toast--info    { border-left-color: var(--primary); }
@keyframes b-slide-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ===== Skeleton ===== */
.b-skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%); background-size: 200% 100%; animation: b-shim 1.5s infinite; border-radius: var(--radius-sm); display: inline-block; }
.b-skel--text { height: 14px; width: 100%; }
.b-skel--title { height: 24px; width: 60%; }
.b-skel--avatar { height: 40px; width: 40px; border-radius: var(--radius-full); }
.b-skel--card { height: 200px; width: 100%; border-radius: var(--radius-md); }
@keyframes b-shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Empty / KPI ===== */
.b-empty { text-align: center; padding: var(--space-12) var(--space-4); color: var(--fg-muted); }
.b-empty__icon { font-size: 48px; margin-bottom: var(--space-3); opacity: 0.5; }
.b-empty__title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-display); color: var(--fg); margin-bottom: var(--space-2); }
.b-empty__msg { font-size: var(--text-sm); margin-bottom: var(--space-4); }

.b-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-5); }
.b-kpi__label { font-size: var(--text-xs); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: var(--weight-semibold); margin-bottom: var(--space-2); }
.b-kpi__value { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-display); color: var(--fg); line-height: 1; margin-bottom: var(--space-1); }
.b-kpi__delta { font-size: var(--text-sm); display: inline-flex; align-items: center; gap: var(--space-1); }
.b-kpi__delta--up   { color: var(--success); }
.b-kpi__delta--down { color: var(--danger); }

/* ===== Shell ===== */
.b-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.b-shell__sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: var(--space-4); }
.b-shell__main { display: flex; flex-direction: column; min-width: 0; }
.b-shell__topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--space-3) var(--space-6); display: flex; align-items: center; justify-content: space-between; }
.b-shell__content { padding: var(--space-6); flex: 1; overflow: auto; }
@media (max-width: 768px) { .b-shell { grid-template-columns: 1fr; } .b-shell__sidebar { display: none; } }

/* ===== Nav / Tabs / Tooltip / Avatar / Misc ===== */
.b-nav { display: flex; flex-direction: column; gap: 2px; }
.b-nav__item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--fg-muted); text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-medium); transition: all var(--motion-fast) var(--motion-ease); cursor: pointer; }
.b-nav__item:hover { background: var(--surface-hover); color: var(--fg); }
.b-nav__item--active { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }

.b-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); gap: var(--space-1); }
.b-tab { padding: var(--space-2) var(--space-4); cursor: pointer; color: var(--fg-muted); border-bottom: 2px solid transparent; font-weight: var(--weight-medium); background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; font-size: var(--text-sm); transition: color var(--motion-fast) var(--motion-ease); }
.b-tab:hover { color: var(--fg); }
.b-tab--active { color: var(--primary); border-bottom-color: var(--primary); }

.b-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: b-spin 0.8s linear infinite; }
.b-spinner--lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes b-spin { to { transform: rotate(360deg); } }

.b-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.b-switch input { opacity: 0; width: 0; height: 0; }
.b-switch__slider { position: absolute; inset: 0; background: var(--surface-hover); border-radius: var(--radius-full); cursor: pointer; transition: background var(--motion-fast) var(--motion-ease); }
.b-switch__slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform var(--motion-fast) var(--motion-ease); }
.b-switch input:checked + .b-switch__slider { background: var(--primary); }
.b-switch input:checked + .b-switch__slider::before { transform: translateX(18px); }

.b-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--primary); font-weight: var(--weight-semibold); font-size: var(--text-xs); }
.b-avatar--lg { width: 48px; height: 48px; font-size: var(--text-base); }

.b-tooltip { position: relative; display: inline-block; }
.b-tooltip::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface-hover); color: var(--fg); font-size: var(--text-xs); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--motion-fast) var(--motion-ease); z-index: 100; }
.b-tooltip:hover::after { opacity: 1; }

.b-progress { width: 100%; height: 6px; background: var(--surface-hover); border-radius: var(--radius-full); overflow: hidden; }
.b-progress__bar { height: 100%; background: var(--primary); transition: width var(--motion-base) var(--motion-ease); }

.b-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-6); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.b-page-header__title { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-display); margin: 0; }
.b-page-header__subtitle { color: var(--fg-muted); font-size: var(--text-sm); margin-top: var(--space-1); }
.b-page-header__actions { display: flex; gap: var(--space-2); }

/* ===== Layout helpers ===== */
.b-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.b-stack--sm { gap: var(--space-2); }
.b-stack--lg { gap: var(--space-6); }
.b-row { display: flex; align-items: center; gap: var(--space-3); }
.b-row--between { justify-content: space-between; }
.b-row--wrap { flex-wrap: wrap; }
.b-grid { display: grid; gap: var(--space-4); }
.b-grid--2 { grid-template-columns: repeat(2, 1fr); }
.b-grid--3 { grid-template-columns: repeat(3, 1fr); }
.b-grid--4 { grid-template-columns: repeat(4, 1fr); }
.b-grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 768px) { .b-grid--2, .b-grid--3, .b-grid--4 { grid-template-columns: 1fr; } }

/* ===== Utility ===== */
.b-text-muted   { color: var(--fg-muted); }
.b-text-subtle  { color: var(--fg-subtle); }
.b-text-success { color: var(--success); }
.b-text-danger  { color: var(--danger); }
.b-text-primary { color: var(--primary); }
.b-text-accent  { color: var(--accent); }
.b-text-sm { font-size: var(--text-sm); }
.b-text-xs { font-size: var(--text-xs); }
.b-text-lg { font-size: var(--text-lg); }
.b-display { font-family: var(--font-display); font-weight: var(--weight-display); }
.b-mono { font-family: var(--font-mono); }
.b-divider { height: 1px; background: var(--border); margin: var(--space-6) 0; }

/* ===== Hero ===== */
.b-hero { padding: var(--hero-py, var(--space-20)) var(--space-6); text-align: var(--hero-align, left); }
.b-hero__eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); font-weight: var(--weight-semibold); margin-bottom: var(--space-3); }
.b-hero__title { font-family: var(--font-display); font-size: var(--text-6xl, 60px); font-weight: var(--weight-display); line-height: var(--leading-display); margin: 0 0 var(--space-4); color: var(--fg); }
.b-hero__subtitle { font-size: var(--text-lg); color: var(--fg-muted); max-width: 720px; margin-bottom: var(--space-6); }

@import url("./a11y-baseline.css");
