:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --primary-subtle: #ede9fe;
    --accent: #f472b6;
    --bg: #faf7ff;
    --bg-warm: #f5f0ff;
    --card-bg: #ffffff;
    --text: #1e1b4b;
    --text-secondary: #4c4678;
    --muted: #7c7494;
    --border: #e9e3f5;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.06);
    --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.08);
    --shadow-lg: 0 12px 40px rgba(124, 58, 237, 0.12);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(109, 40, 217, 0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .logo {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(255,255,255,0.15);
}

/* ---- Layout ---- */
.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* ---- Hero ---- */
.hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
    position: relative;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.15rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.hero-stat { text-align: center; }
.hero-stat .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}
.hero-stat .label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.btn-small { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-secondary {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    padding: 0.65rem 1.5rem;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.7);
    box-shadow: none;
}
.btn-fav {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 999px;
}
.btn-fav:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: #fdf2f8;
    box-shadow: none;
    transform: none;
}
.btn-fav.active {
    color: var(--accent);
    border-color: var(--accent);
    background: #fdf2f8;
}
.btn-fav.active:hover {
    color: #9f1239;
    border-color: #9f1239;
    background: #fff1f2;
}

/* ---- Page Headers ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.page-header-sub {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ---- Cat Grid ---- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.cat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
    position: relative;
}
.cat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}
.cat-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}
.cat-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}
.cat-card .breed {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cat-card .description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}
.cat-card-actions {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.cat-card-actions form { display: inline; }

/* ---- Featured Section ---- */
.featured {
    margin-top: 3rem;
}
.featured h2 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}
.featured .section-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

/* ---- Settings ---- */
.settings-panel {
    max-width: 640px;
}
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.settings-card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}
.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-warm);
    border-radius: var(--radius-sm);
}
.stat-item .number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}
.stat-item .label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ---- Forms ---- */
.cat-form {
    display: grid;
    gap: 1.25rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-width: 560px;
}
.cat-form label {
    display: grid;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.cat-form input,
.cat-form textarea {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: var(--transition);
    background: white;
}
.cat-form input:focus,
.cat-form textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.cat-form input::placeholder,
.cat-form textarea::placeholder {
    color: #b4afc5;
}

/* ---- Alerts ---- */
.alert {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}
.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}
.empty-state h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.empty-state p { margin-bottom: 1.5rem; font-size: 0.95rem; }
.empty-state a { color: var(--primary); font-weight: 600; text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: white;
}

/* ---- Section Header (legacy compat) ---- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ---- Badge / Tag ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-subtle);
    color: var(--primary);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .navbar { padding: 0 1rem; }
    .nav-links a { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
    .container { padding: 1.5rem 1rem; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }
    .cat-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
}
