/* Article Farm — минимальные стили поверх design system */

/* Toast notifications */
.app-toasts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-surface, #1e293b);
  border: 1px solid var(--color-border, #334155);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: toastIn 0.2s ease;
}

.toast--success { border-left: 3px solid #10b981; }
.toast--error   { border-left: 3px solid #ef4444; }
.toast--info    { border-left: 3px solid #3b82f6; }
.toast--warning { border-left: 3px solid #f59e0b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Page loader */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border, #334155);
  border-top-color: var(--color-primary, #3b82f6);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Article content rendering */
.article-body h1, .article-body h2, .article-body h3 { margin: 1.5rem 0 0.75rem; font-weight: 700; }
.article-body p  { margin-bottom: 1rem; line-height: 1.7; }
.article-body ul, .article-body ol { margin: 0.75rem 0 1rem 1.5rem; }
.article-body li { margin-bottom: 0.25rem; }
.article-body code { font-family: monospace; background: rgba(255,255,255,0.06); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.875em; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

/* Auth pages (before nav shown) */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Fix: <a> elements used as tab buttons */
a.tab {
  text-decoration: none;
}

/* Fix: active nav link in dark navbar */
.navbar--dark .nav-link--active {
  color: var(--color-brand-blue, #3b82f6);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

/* Section header row */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

/* KPI cards — компактные карточки для дашборда */
.kpi-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}
.kpi-card--blue  { border-left: 3px solid #3b82f6; }
.kpi-card--green { border-left: 3px solid #10b981; }
.kpi-card--amber { border-left: 3px solid #f59e0b; }
.kpi-card--red   { border-left: 3px solid #ef4444; }
.kpi-card--slate { border-left: 3px solid #94a3b8; }

/* Docs page */
.docs-grid     { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
.docs-sidebar  { position: sticky; top: 1rem; }
.docs-nav a    { display: block; padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500; color: #475569; text-decoration: none; }
.docs-nav a:hover { background: #f1f5f9; color: #0f172a; }
.docs-nav a.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.docs-nav-section { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #94a3b8; padding: 0.75rem 0.75rem 0.25rem; }
.docs-body h2  { font-size: 1.5rem; font-weight: 900; margin: 2rem 0 1rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; text-transform: uppercase; letter-spacing: 0.1em; }
.docs-body h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.docs-body h3  { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; color: #1d4ed8; }
.docs-body p   { color: #475569; line-height: 1.75; margin-bottom: 1rem; }
.docs-body ol, .docs-body ul { color: #475569; margin: 0.5rem 0 1rem 1.5rem; }
.docs-body li  { margin-bottom: 0.5rem; line-height: 1.6; }
.docs-body code { font-family: monospace; background: #f1f5f9; padding: 0.15em 0.5em; border-radius: 4px; font-size: 0.85em; color: #1e40af; }
.docs-body pre { background: #0f172a; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: 0.75rem; overflow-x: auto; margin: 1rem 0; font-size: 0.875rem; line-height: 1.6; }
.docs-body pre code { background: none; color: inherit; padding: 0; }
.docs-callout  { background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 0 0.5rem 0.5rem 0; padding: 0.875rem 1rem; margin: 1rem 0; }
.docs-callout--warn { background: #fffbeb; border-color: #f59e0b; }
.docs-callout--tip  { background: #f0fdf4; border-color: #10b981; }
.docs-table    { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.875rem; }
.docs-table th { background: #f8fafc; text-align: left; padding: 0.625rem 0.875rem; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; border-bottom: 2px solid #e2e8f0; }
.docs-table td { padding: 0.625rem 0.875rem; border-bottom: 1px solid #f1f5f9; color: #475569; vertical-align: top; line-height: 1.5; }
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: #fafafa; }
