:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --primary: #ff7043;
    --primary-dark: #ff5722;
    --text: #1f2933;
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-nav .brand a {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}

.top-nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.top-nav li.user {
    font-size: 0.95rem;
    color: var(--muted);
}

.btn {
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.page-content {
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

.hero-card {
    max-width: 960px;
    margin: 0 auto 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.hero-card h1 {
    margin-top: 0;
    font-size: 2rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.filter-bar input,
.filter-bar .select-control {
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    flex: 1;
    min-width: 180px;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.recipe-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: stretch;
    transition: transform 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-4px);
}

.recipe-card img {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    object-fit: cover;
    background: #e2e8f0;
}

.recipe-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.recipe-card h3 {
    margin: 0;
    font-size: 1.1rem;
}

.tag {
    background: rgba(255, 112, 67, 0.15);
    color: var(--primary-dark);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.meta {
    color: var(--muted);
    font-size: 0.9rem;
}

.form-card {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    font-size: 1rem;
    width: 100%;
}

.select-control {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%),
        linear-gradient(to right, #fff, #fff);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%, 100% 0;
    background-size: 8px 8px, 8px 8px, 2.5rem 100%;
    background-repeat: no-repeat;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    font-size: 1rem;
    width: 100%;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.select-control:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.select-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.18);
}

.table-section {
    margin-top: 2rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.dynamic-table,
.steps-list {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--border);
}

.dynamic-table th,
.dynamic-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.dynamic-table tr:last-child td {
    border-bottom: none;
}

.dynamic-table input,
.steps-list textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
}

.steps-list textarea {
    min-height: 80px;
    resize: vertical;
}

.action-cell {
    width: 120px;
    text-align: right;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.flash {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

.flash.error {
    background: rgba(248, 113, 113, 0.18);
    color: #991b1b;
}

.auth-card {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin-top: 0;
}

.auth-card .form-group {
    margin-bottom: 1rem;
}

.responsive-image {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .top-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .recipe-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .recipe-card img {
        width: 100%;
        height: 180px;
    }

    .action-cell {
        text-align: left;
    }
}
