/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #0f172a;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.container   { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.page        { min-height: 100vh; display: flex; flex-direction: column; }
.section     { padding: 48px 0; }
.stack       { display: flex; flex-direction: column; gap: 16px; }
.row         { display: flex; align-items: center; gap: 12px; }
.grid-2      { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3      { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ── Surface / Card ── */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 28px;
}
.card-sm     { padding: 20px; border-radius: 6px; background: #ffffff; border: 1px solid #e2e8f0; }
.card-header { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid #e2e8f0; }

/* ── Typography ── */
h1 { font-size: 2rem;   font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: #64748b; line-height: 1.7; }
.text-muted  { color: #64748b; font-size: 0.875rem; }
.text-subtle { color: #94a3b8; font-size: 0.8rem; }
.text-strong { font-weight: 600; color: #0f172a; }
.label       { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem; font-weight: 500; font-family: inherit;
  border-radius: 5px; border: 1px solid transparent;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap; text-decoration: none;
}
.btn-primary   { background: #0f172a; color: #fff; border-color: #0f172a; }
.btn-primary:hover { background: #1e293b; border-color: #1e293b; }
.btn-secondary { background: #ffffff; color: #0f172a; border-color: #e2e8f0; }
.btn-secondary:hover { background: #f1f5f9; }
.btn-ghost     { background: transparent; color: #64748b; border-color: transparent; }
.btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
.btn-danger    { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-sm        { padding: 7px 13px; font-size: 0.8rem; }
.btn-lg        { padding: 13px 24px; font-size: 1rem; }
.btn:disabled  { opacity: 0.45; cursor: not-allowed; }

/* ── Forms ── */
.form-group   { display: flex; flex-direction: column; gap: 6px; }
.form-label   { font-size: 0.85rem; font-weight: 500; color: #0f172a; }
.form-hint    { font-size: 0.8rem; color: #94a3b8; }

input, select, textarea {
  width: 100%; padding: 10px 14px;
  font-size: 0.9rem; font-family: inherit;
  color: #0f172a; background: #ffffff;
  border: 1px solid #e2e8f0; border-radius: 5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
input::placeholder { color: #94a3b8; }

/* ── Navigation ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 60px;
  background: #ffffff; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1rem; color: #0f172a; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link  { padding: 6px 12px; border-radius: 5px; font-size: 0.875rem; color: #64748b; text-decoration: none; }
.nav-link:hover  { background: #f1f5f9; color: #0f172a; }
.nav-link.active { background: #f1f5f9; color: #0f172a; font-weight: 500; }

/* ── Badges / Status ── */
.badge         { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 0.75rem; font-weight: 500; }
.badge-default { background: #f1f5f9; color: #64748b; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-blue    { background: #dbeafe; color: #1d4ed8; }

/* ── Feedback ── */
.alert         { padding: 14px 18px; border-radius: 5px; border: 1px solid transparent; font-size: 0.875rem; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid #e2e8f0; }

/* ── Tabs ── */
.tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn.active {
  color: #0f172a;
  border-bottom-color: #0f172a;
}
.tab-btn:hover {
  color: #0f172a;
}

/* ── Loading Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #0f172a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav { padding: 0 16px; }
}