* {
    box-sizing: border-box;
}

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

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.header {
    background: #0b3558;
    color: #fff;
    padding: 14px 0;
    margin-bottom: 20px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.header h1 {
    margin: 0;
    font-size: 22px;
}

nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a,
.link-button {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.inline-form {
    margin: 0;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    padding: 20px;
    margin-bottom: 20px;
}

.narrow {
    max-width: 420px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 14px;
}

.input {
    width: 100%;
    border: 1px solid #c9d2dc;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
}

textarea.input {
    resize: vertical;
}

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

.button {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    background: #0b3558;
    color: #fff;
    text-decoration: none;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 600;
}

.button-secondary {
    background: #4b5563;
}

.button-danger {
    background: #b91c1c;
}

.button-light {
    background: #e5e7eb;
    color: #111827;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.search-form {
    display: flex;
    gap: 8px;
    margin: 10px 0 14px;
}

.search-form .input {
    max-width: 380px;
}

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

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

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

.thumb {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.validation {
    color: #b91c1c;
    font-size: 13px;
}

.success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}

.image-preview {
    margin-top: 10px;
}

.image-preview img {
    width: 220px;
    max-width: 100%;
    border-radius: 6px;
    display: block;
    margin-bottom: 8px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inline-toggle-form {
    margin: 0;
}

.hidden {
    display: none !important;
}

.input-with-action {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: grid;
    place-items: center;
    z-index: 1000;
    padding: 18px;
}

.modal {
    width: min(980px, 100%);
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
}

.help-text {
    color: #4b5563;
    font-size: 13px;
}

.html-tools {
    margin-top: 8px;
}

.html-raw-wrap {
    margin-top: 10px;
}

.html-raw {
    font-family: Consolas, "Courier New", monospace;
    min-height: 180px;
}

.recipe-preview h1 {
    margin-top: 0;
}

.preview-two-columns {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 20px;
    margin-bottom: 18px;
    align-items: start;
}

.preview-image img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.preview-empty {
    border: 1px dashed #c9d2dc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.preview-processing,
.preview-description {
    line-height: 1.5;
}

.preview-processing {
    background: #ae8648;
    color: #ffffff;
    border-radius: 8px;
    padding: 14px;
}

.preview-product-links {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-link-button {
    display: inline-block;
    background: #0b3558;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form .input {
        max-width: none;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .preview-two-columns {
        grid-template-columns: 1fr;
    }
}
