/* FamilyBase — Base Stylesheet (v2 — modernized) */

:root {
    --fb-primary: #3b82f6;
    --fb-primary-dark: #2563eb;
    --fb-primary-light: #dbeafe;
    --fb-primary-50: #eff6ff;
    --fb-success: #10b981;
    --fb-success-dark: #059669;
    --fb-danger: #ef4444;
    --fb-danger-light: #fef2f2;
    --fb-warning: #f59e0b;
    --fb-purple: #8b5cf6;
    --fb-gray-50: #f9fafb;
    --fb-gray-100: #f3f4f6;
    --fb-gray-200: #e5e7eb;
    --fb-gray-300: #d1d5db;
    --fb-gray-400: #9ca3af;
    --fb-gray-500: #6b7280;
    --fb-gray-600: #4b5563;
    --fb-gray-700: #374151;
    --fb-gray-800: #1f2937;
    --fb-gray-900: #111827;
    --fb-white: #ffffff;
    --fb-radius: 10px;
    --fb-radius-sm: 6px;
    --fb-radius-lg: 14px;
    --fb-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --fb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --fb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --fb-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --fb-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fb-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --fb-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--fb-font);
    background: var(--fb-gray-100);
    color: var(--fb-gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--fb-primary); text-decoration: none; transition: color var(--fb-transition); }
a:hover { color: var(--fb-primary-dark); text-decoration: none; }

/* Header */
.fb-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    height: 64px;
    background: var(--fb-white);
    border-bottom: 1px solid var(--fb-gray-200);
    box-shadow: var(--fb-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.fb-header__brand a {
    font-size: 1.3rem;
    color: var(--fb-gray-900);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.fb-header__brand strong {
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fb-header__nav {
    display: flex;
    gap: 0.15rem;
    flex: 1;
}

.fb-nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: var(--fb-radius-sm);
    color: var(--fb-gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--fb-transition);
    text-decoration: none;
    position: relative;
}
.fb-nav-link:hover {
    background: var(--fb-gray-100);
    color: var(--fb-gray-900);
    text-decoration: none;
}
.fb-nav-link--active {
    color: var(--fb-primary);
    font-weight: 600;
    background: var(--fb-primary-50);
}
.fb-nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--fb-primary);
    border-radius: 1px;
}

.fb-header__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.fb-header__user-name {
    color: var(--fb-gray-600);
    font-weight: 500;
}

/* Main */
.fb-main { padding: 1.5rem 0 3rem; }

.fb-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Breadcrumb */
.fb-breadcrumb {
    font-size: 0.8rem;
    color: var(--fb-gray-400);
    margin-bottom: 0.5rem;
}
.fb-breadcrumb a { color: var(--fb-gray-400); }
.fb-breadcrumb a:hover { color: var(--fb-primary); }
.fb-breadcrumb__sep { margin: 0 0.4rem; }

/* Headings */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--fb-gray-900);
    letter-spacing: -0.02em;
}
h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--fb-gray-800);
    letter-spacing: -0.01em;
}
h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--fb-gray-700);
}

/* Cards */
.fb-card {
    background: var(--fb-white);
    border-radius: var(--fb-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--fb-shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--fb-gray-200);
    transition: box-shadow var(--fb-transition);
}
.fb-card:hover { box-shadow: var(--fb-shadow-md); }

.fb-card ul { padding-left: 1.25rem; margin: 1rem 0; }
.fb-card li { margin-bottom: 0.5rem; color: var(--fb-gray-600); }

/* Buttons */
.fb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--fb-radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--fb-transition);
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.fb-btn--primary {
    background: linear-gradient(135deg, var(--fb-primary) 0%, var(--fb-primary-dark) 100%);
    color: var(--fb-white);
    border-color: var(--fb-primary-dark);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}
.fb-btn--primary:hover {
    background: linear-gradient(135deg, var(--fb-primary-dark) 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
}

.fb-btn--subtle {
    background: var(--fb-white);
    color: var(--fb-gray-700);
    border-color: var(--fb-gray-300);
}
.fb-btn--subtle:hover {
    background: var(--fb-gray-50);
    border-color: var(--fb-gray-400);
    text-decoration: none;
}

.fb-btn--small { padding: 0.3rem 0.75rem; font-size: 0.8rem; border-radius: var(--fb-radius-sm); }
.fb-btn--full { width: 100%; justify-content: center; }

/* Dashboard actions */
.fb-dashboard-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Forms */
.fb-form-group { margin-bottom: 1.15rem; }
.fb-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fb-gray-600);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.fb-form-group input,
.fb-form-group textarea,
.fb-form-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--fb-gray-300);
    border-radius: var(--fb-radius);
    font-size: 0.9rem;
    font-family: var(--fb-font);
    transition: all var(--fb-transition);
    background: var(--fb-white);
    color: var(--fb-gray-900);
}
.fb-form-group input:focus,
.fb-form-group textarea:focus,
.fb-form-group select:focus {
    outline: none;
    border-color: var(--fb-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.fb-form-group input::placeholder { color: var(--fb-gray-400); }

/* Alerts */
.fb-alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--fb-radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.fb-alert--error { background: var(--fb-danger-light); color: var(--fb-danger); border: 1px solid #fecaca; }
.fb-alert--success { background: #ecfdf5; color: var(--fb-success-dark); border: 1px solid #a7f3d0; }

/* Auth pages */
.fb-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf4 50%, #f5f0ff 100%);
}

.fb-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--fb-white);
    border-radius: var(--fb-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--fb-shadow-xl);
    border: 1px solid var(--fb-gray-200);
}

.fb-auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.fb-auth-logo h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--fb-primary), var(--fb-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.fb-auth-logo p {
    color: var(--fb-gray-500);
    font-size: 0.9rem;
}

.fb-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--fb-gray-500);
}

/* Error pages */
.fb-error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}
.fb-error-card h1 { font-size: 4rem; color: var(--fb-gray-300); }
.fb-error-card p { margin-bottom: 1.5rem; color: var(--fb-gray-500); }

/* Responsive */
@media (max-width: 768px) {
    .fb-header {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .fb-header__nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .fb-container { padding: 0 1rem; }
}
