/* ============================================================================
   SPURA HUB v3 — Base Styles (Reset + Typography + Utilities)
   ============================================================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ───────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink-950);
    letter-spacing: -.02em;
}
h1 { font-size: 1.75rem; letter-spacing: -.03em; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { margin-bottom: 0.5rem; }

a { color: var(--brand-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-700); text-decoration: underline; }

/* ── Utility Classes ──────────────────────────────────────────────────── */

.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.text-lg       { font-size: 1.125rem; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }
.text-danger   { color: var(--danger-500); }
.text-success  { color: var(--success-600); }
.text-warning  { color: var(--warning-600); }
.text-brand    { color: var(--brand-600); }
.text-link     { color: var(--brand-600); }
.text-link:hover { text-decoration: underline; }
.font-mono     { font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; }
.tabular-nums  { font-variant-numeric: tabular-nums; }

/* ── Layout Utilities ─────────────────────────────────────────────────── */

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }
.ml-auto { margin-left: auto; }

/* ── Form Elements ────────────────────────────────────────────────────── */

.form-input {
    display: block;
    width: 100%;
    padding: 0.5625rem 0.875rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(var(--brand-500-rgb), .12), var(--shadow-xs);
}
.form-input:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-600);
    margin-bottom: 0.375rem;
    letter-spacing: -.005em;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}
.form-error {
    font-size: 0.75rem;
    color: var(--danger-500);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Select */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='%2394A3B8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

/* ── Badges ───────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 0.71875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: .01em;
}
.badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.badge-success { background: var(--success-50);  color: var(--success-600); }
.badge-warning { background: var(--warning-50);  color: var(--warning-600); }
.badge-danger  { background: var(--danger-50);   color: var(--danger-600); }
.badge-info    { background: var(--info-50);     color: var(--info-600); }
.badge-neutral { background: var(--bg-secondary); color: var(--text-secondary); }
.badge-brand   { background: var(--brand-50);    color: var(--brand-700); }

/* ── Alerts ───────────────────────────────────────────────────────────── */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
}
.alert-success { background: var(--success-50); border-color: var(--success-500); color: var(--success-600); }
.alert-danger  { background: var(--danger-50);  border-color: var(--danger-500);  color: var(--danger-600); }
.alert-warning { background: var(--warning-50); border-color: var(--warning-500); color: var(--warning-600); }
.alert-info    { background: var(--info-50);    border-color: var(--info-500);    color: var(--info-600); }

/* ── Avatar ───────────────────────────────────────────────────────────── */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
    color: white;
    flex-shrink: 0;
    font-size: 0.8125rem;
    letter-spacing: -.01em;
}
.avatar-sm { width: 26px; height: 26px; font-size: 0.6875rem; }
.avatar-md { width: 32px; height: 32px; font-size: 0.8125rem; }
.avatar-lg { width: 40px; height: 40px; font-size: 1rem; }
.avatar-xl { width: 52px; height: 52px; font-size: 1.25rem; }

/* ── Progress Bar ─────────────────────────────────────────────────────── */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* ── Empty State ──────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
}
.empty-state-icon {
    width: 44px; height: 44px;
    color: var(--text-muted);
    margin: 0 auto 1rem;
    opacity: .6;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -.01em;
    margin-bottom: 0.375rem;
}
.empty-state-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 340px;
    margin: 0 auto .875rem;
}
