* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f4f6f8;
    color: #1e293b;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #12263a;
    color: #f8fafc;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar h1 {
    margin: 0 0 8px;
    font-size: 1.4rem;
}

.sidebar p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav a {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.nav a.active,
.nav a:hover {
    background: #1d4ed8;
}

.content {
    flex: 1;
    padding: 28px;
}

.page-header h2,
.card h3,
.card h4 {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

.stat-card span {
    display: block;
    color: #64748b;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label,
.checkbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
}

.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.full {
    grid-column: 1 / -1;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    width: 100%;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: #0f766e;
    color: #fff;
    cursor: pointer;
}

.button.secondary,
.button.muted {
    background: #64748b;
}

.button.danger {
    background: #dc2626;
}

.button.small {
    padding: 8px 10px;
    font-size: 0.85rem;
}

.actions,
.inline-actions,
.bulk-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge.muted {
    background: #e2e8f0;
    color: #475569;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    margin-bottom: 12px;
}

.recipe-detail-row td {
    background: #f8fafc;
}

.recipe-detail {
    padding: 8px 0;
}

small {
    color: #64748b;
}

@media (max-width: 960px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .cards,
    .two-col,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .ingredient-row {
        grid-template-columns: 1fr;
    }
}
