/* ============================================================
   BASE STYLES — base.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-base), color var(--transition-base);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-light); }

img, svg { display: block; max-width: 100%; }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

h1,h2,h3,h4,h5,h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-color-strong);
  border-radius: var(--border-radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Utilities ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }
.text-primary-color { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.p-4 { padding: var(--sp-4); }
.p-6 { padding: var(--sp-6); }
.rounded { border-radius: var(--border-radius); }
.rounded-full { border-radius: var(--border-radius-full); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.grid { display: grid; }

/* ── Grid helpers ── */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--border-radius-full);
  white-space: nowrap;
}
.badge-primary { background: var(--color-primary-alpha); color: var(--color-primary); }
.badge-success { background: var(--color-accent-alpha); color: var(--color-accent); }
.badge-warning { background: var(--color-warning-alpha); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-alpha);  color: var(--color-danger); }
.badge-info    { background: var(--color-info-alpha);    color: var(--color-info); }
.badge-neutral { background: var(--border-color); color: var(--text-secondary); }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--sp-4) 0;
}

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--sp-12);
  text-align: center; color: var(--text-muted);
  gap: var(--sp-4);
}
.empty-state svg { opacity: 0.4; }
.empty-state p { font-size: var(--text-sm); }
