:root {
    --primary: #c30000;
    /* Professional Culinary Blue */
    --primary-dim: #c30000b6;
    --bg-dark: #09090b;
    --bg-card: #18181b;
    --bg-card2: #272727;
    --bg-card-hover: #c30000b6;
    --text-main: #fafafa;
    --text-muted: #696969;
    --tag-good:var(--success);
    --tag-bad:var(--danger);
    --border-subtle: #272727;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#image-change-input {
    display: none;
}

.logo-svg {
    height: 64px;
    width: auto;
    fill: var(--primary);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    display: flex;
    height: 100vh;
}

.app-container.login-mode .sidebar {
    display: none;
}

.app-container.login-mode .main-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: radial-gradient(circle at center, #2a0f0f 0%, #09090b 100%);
}

.app-container.login-mode .top-bar {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #2a0f0ff2;
    border-radius: 0 24px 24px 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    margin: 1rem 0rem 1rem 0rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    transform: translateY(-2px);
    background: var(--primary-dim);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-dim);
    color: var(--text-main);
}

.user-profile {
    margin-top: auto;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--bg-dark);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.role {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.glass-panel {
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.75rem;
}

/* Components */
.btn {
    margin: 0 1rem 0 1rem;
    height: 30px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    line-height: 1;
}

.btn i,
.btn svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    padding: 1rem;
    margin: 0.5rem;
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--primary-dim);
    /* Darker blue */
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    margin: 0.5rem;
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--danger);
    color: white !important;
    padding: 1rem;
    margin: 0.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #dc2626;
    /* Darker red */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 0 1rem 0 1rem;
    margin-left: 0.5rem;
    height: 36px;
    font-size: 0.8rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
}

/* Recipe editor header tweaks */
.header-center {
    display: flex;
    flex-direction: column;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

.header-actions button {
    margin: 0;
}

.btn-sm {
    gap: 0.3rem;
    line-height: 1;
}

.btn-sm i,
.btn-sm svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-sm i {
    width: 12px !important;
    height: 12px !important;
}

.btn-icon {
    background: transparent;
    margin-left: 1rem;
    margin-right: 1rem;
    border: 2px solid transparent;
    color: var(--text-muted);
    padding: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.btn-icon i,
.btn-icon svg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--danger);
    border-color: rgba(187, 35, 35, 0.2);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* Search & Filter Input */
.table-search {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.table-search::placeholder {
    color: var(--text-muted);
}

.table-search:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0.75rem 0;
    line-height: 1.0rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th.sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--text-main);
}

.data-table tr {
    transition: background 0.2s;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.p-4 {
    padding: 1.75rem;
}

.w-100 {
    width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

.data-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

/* Base Spacing Utilities */
.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-top: 1rem;

}

.mb-4 {
    margin-bottom: 1.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.p-4 {
    padding: 1.75rem;
}

.w-100 {
    width: 100%;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.border-bottom {
    border-bottom: 1px solid var(--border-subtle);
}

.pb-3 {
    padding-bottom: 1rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1.5rem;
}

/* Typography Utilities */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.sidebar-panels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

.table-input,
input,
select,
textarea {
    background: rgb(20, 20, 20);
    border: 2px solid var(--border-subtle);
    color: rgb(255, 255, 255);
    padding: 0.5rem;
    border-radius: 6px;
    width: 100%;
    font-family: 'Inter', sans-serif;
    /* Match UI font */
    line-height: 1.5;
    /* Resizing */
    resize: none;
    overflow: hidden;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.recipe-card {
    background: var(--bg-card2);
    border-radius: 16px;
    border: 2px solid var(--border-subtle);
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.23s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.recipe-card:hover {
    transform: translateY(-6px);
    border: 2px solid var(--primary);
}

.category-group {
    margin-bottom: 3rem;
}

.category-header {
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.category-tag {
    background: var(--primary-dim);
    color: var(--text-main);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge.red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Layouts */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.editor-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

.main-editor {
    min-height: 80vh;
}

.meta-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.method-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-num {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.editor-table th {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

.editor-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.ing-input {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    padding: 0.25rem 0.5rem;
    color: white;
    width: 100%;
}

/* Dark theme select dropdown styling */
select.ing-input {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border: 2px solid var(--border-subtle) !important;
}

/* Style the dropdown options in dark mode */
select.ing-input option {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 0.5rem;
    margin: 0.5rem;
    border: none;
}

/* Hover state for select options */
select.ing-input option:hover {
    background-color: var(--bg-card-hover);
    margin: 0.25rem;
    padding: 0.25rem;
    color: var(--text-main);
}

/* Selected option styling */
select.ing-input option:checked {
    background: linear-gradient(var(--primary), var(--primary));
    background-color: var(--primary);
    color: var(--bg-dark);
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
}

.dropdown-trigger {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.dropdown-trigger:hover {
    background: #f63b3b;
    border-color: var(--primary-dim);
}

.dropdown-trigger:focus {
    outline: 2px solid #3b82f6;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dropdown-option {
    padding: 0.75rem 1rem;
    width: auto;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s;
    margin: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0.5rem;
}

.dropdown-option:hover {
    background: var(--bg-card-hover);
    color: #ffffff;
    padding-left: 1.25rem;
}

.dropdown-option[data-value=""] {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.25rem;
}

.dropdown-option[data-value=""]:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* Scrollbar styling for dropdown menu */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.ing-qty {
    width: 70px !important;
}

.conflict-marker {
    color: var(--warning);
    cursor: help;
    font-size: 1.2rem;
    position: relative;
    top: 2px;
}

.ing-input:focus,
.method-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.recipe-card {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.recipe-image {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--bg-card);
    flex-shrink: 0;
}

.recipe-card-header {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 3px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.allergen-tag {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 99px;
    font-size: 0.7rem;
    padding: 2px 8px;
    display: inline-block;
}

.drop-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: 20px;
    padding: 4rem 2rem;
    transition: all 0.2s;
}

.drop-zone.active {
    border-color: var(--primary);
    background: var(--primary-dim);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(251, 191, 36, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.title-input {
    font-size: 2rem;
    font-weight: 700;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0;
    width: auto;
    font-family: 'Outfit', sans-serif;
}

.title-input:focus {
    border-bottom-color: var(--primary);
    outline: none;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.method-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-num {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.method-input {
    min-height: 25px;
    resize: vertical;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

/* Spacing cleanup */
.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* Upload Queue */
.upload-queue {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.queue-item {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.queue-item.active {
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-dim);
}

.queue-badge {
    background: var(--primary-dim);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ============================================================================
   RECIPE EDITOR STYLES
   ============================================================================ */

/* Main Editor Layout Grid */
.recipe-editor-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 1.5rem;
    padding: 1.5rem;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.recipe-editor-layout.pantry-visible {
    grid-template-columns: 250px 1fr 300px 250px;
}

/* Editor Header - Recipe Title, Image, Basic Info */
/* restrict the header to the centre column of the layout grid */
.editor-header {
    grid-column: 2 / 3;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
}

.header-top {
    display: flex;
    justify-content: flex-start;
    /* align items to the left */
    align-items: flex-start;
    /* keeps everything aligned at the top */
    gap: 1.5rem;
}

.header-left {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex: 1;
    /* allows left section to take up remaining space */
    position: relative;
    /* needed for the camera icon overlay */
}

.header-actions {
    display: flex;
    flex-direction: column;
    /* stack vertically */
    gap: 0.5rem;
    /* spacing between buttons */
    align-items: flex-end;
    /* align to the right edge */
}

.header-actions button {
    width: 160px;
    /* consistent width for both buttons */
}


/* Compact header variant (two-column: image | title + meta) */
.editor-header.compact-header .header-top.new-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    /* Stretch to align heights if needed */
    gap: 2rem;
    width: 100%;
    max-width: 100%;
}

.editor-header.compact-header .header-left-pane {
    flex-shrink: 0;
}

.editor-header.compact-header .header-right-pane {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 1rem;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
}

.editor-header.compact-header .header-right-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.editor-header.compact-header .recipe-title-input {
    flex-grow: 1;
    font-size: 1.5rem;
    font-weight: 900;
    width: 100%;
}

.editor-header.compact-header .recipe-image {
    width: 160px;
    height: 160px;
    border-radius: 12px;
}

.editor-header.compact-header .header-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-header.compact-header .header-meta-compact {
    display: flex;
    flex-basis: 100%;
    gap: 1rem;
    align-items: flex-start;
    padding-top: 1rem;
}

.editor-header.compact-header .meta-dropdowns {
    display: flex;
    flex: 4 1 0%;
    gap: 0.5rem;
}

.editor-header.compact-header .meta-numbers {
    display: flex;
    flex: 1 1 0%;
    min-width: 0;
    gap: 0.5rem;
}

.editor-header.compact-header .header-meta-compact .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.editor-header.compact-header .header-meta-compact .form-group label {
    white-space: nowrap;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Special styling for Scale Yield */
.editor-header.compact-header .header-meta-compact .form-group.scale-yield label {
    color: var(--primary);
    font-weight: 600;
}

.editor-header.compact-header .header-meta-compact .form-group.scale-yield input {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
}

/* Position action buttons at top-right of the header box */
.editor-header .actions {
    display: flex;
    gap: 8px;
    z-index: 5;
    white-space: nowrap;
}

.recipe-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.recipe-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
}

.recipe-image:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-dim);
}

.btn-change-image {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
}

/* Custom Dropdown Additional Styles */
.dropdown-option-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-user-select: none;
    user-select: none;
    margin: 0.25rem 0.5rem;
    border-radius: 6px;
}

.dropdown-option-checkbox:hover {
    background: var(--bg-card-hover);
    padding-left: 1.25rem;
}

.dropdown-option-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-title-input {
    font-size: 1.8rem;
    font-weight: 900;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary);
    color: var(--text-main);
    padding: 0.5rem 0;

    /* Add these for expansion + wrapping */
    flex: 1;
    /* fills remaining space */
    resize: none;
    min-width: 0;
    /* allows flex shrink/wrap */
    white-space: normal;
    /* allows wrapping */
    word-break: break-word;
    /* breaks long words */
    line-height: 1.3;
    /* nicer readability */
}

.recipe-title-input:focus {
    border-color: var(--primary);
    outline: none;
}

.description-input {
    min-height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

.description-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.header-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.header-meta>div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-meta label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.header-meta select,
.header-meta input {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

.header-meta select:focus,
.header-meta input:focus {
    border-color: var(--primary);
    background: grey;
    outline: none;
}

.header-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.header-bottom>div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-bottom label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.header-bottom input {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
}

.header-bottom input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

/* Main Content Area */
.editor-main {
    grid-column: 1 / 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Section Styling */
.ingredients-section,
.methods-section,
.plating-section {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
}

.ingredients-section>h2,
.methods-section>h2,
.plating-section>h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.ingredients-container,
.methods-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.empty-message {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Ingredient Row */
.ingredient-row {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s;
}

.ingredient-row:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.ingredient-main {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.qty-input,
.unit-select,
.ingredient-name-input,
.brand-input,
.cost-input,
.notes-input {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.qty-input {
    width: 80px;
}

.unit-select {
    width: 70px;
}

.ingredient-name-input {
    flex: 1;
    min-width: 150px;
}

.brand-input {
    width: 120px;
}

.cost-input {
    width: 90px;
}

.ingredient-secondary {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.allergen-display {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.allergen-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
}

.no-allergens {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-pantry-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pantry-link:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-pantry-link.linked {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-pantry-unlink,
.btn-remove-ingredient {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pantry-unlink:hover,
.btn-remove-ingredient:hover {
    background: var(--danger);
    color: rgb(179, 32, 32);
}

.ingredient-notes {
    width: 100%;
}

.notes-input {
    width: 100%;
}

/* Method Row */
.method-row {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: all 0.2s;
}

.method-row:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.method-number {
    background: var(--primary);
    color: var(--bg-dark);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.method-text {
    flex: 1;
    min-height: 80px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

.method-text:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.btn-remove-method {
    padding: 0.5rem 0.8rem;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-method:hover {
    background: var(--danger);
    color: white;
}

/* Plating Section */
.plating-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plating-image {
    width: 100%;
    max-height: 250px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s;
}

.plating-image:hover {
    border-color: var(--primary);
}

.btn-change-plating-image {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.plating-description-input {
    min-height: 100px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

.plating-description-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

/* Action Buttons */
.editor-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-add-ingredient,
.btn-add-method {
    width: 100%;
    margin-top: 0.5rem;
}

/* Economic Engine Sidebar */
.economic-sidebar {
    grid-column: 3;
    grid-row: 1 / -1;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.economic-sidebar.hidden {
    display: none;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 1rem;
    margin: 0;
}

.btn-toggle-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.btn-toggle-sidebar:hover {
    color: var(--text-main);
}

.sidebar-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metrics-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
}

.metrics-section h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.875rem;
}

.metric.highlight {
    background: rgba(59, 130, 246, 0.05);
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.25rem -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.metric-label {
    color: var(--text-muted);
}

.metric-value {
    color: var(--text-main);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

#sales-price-input {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-main);
    text-align: left;
}

#sales-price-input:focus {
    border-color: var(--primary);
    outline: none;
}

.health-status {
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid rgba(59, 130, 246, 0.3);
    margin-top: 1rem;
}

.status-indicator {
    text-align: center;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
}

/* Pantry Sidebar */
.pantry-sidebar {
    grid-column: 4;
    grid-row: 1 / -1;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 0;
    max-height: calc(100vh - 100px);
}

.pantry-sidebar.hidden {
    display: none;
}

.pantry-sidebar .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.pantry-sidebar .sidebar-header h3 {
    font-size: 1rem;
    margin: 0;
}

.btn-toggle-pantry {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.btn-toggle-pantry:hover {
    color: var(--text-main);
}

.pantry-sidebar .sidebar-content {
    overflow-y: auto;
}

.pantry-search {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    width: calc(100% - 1.5rem);
    margin: 0 0.75rem;
}

.pantry-search:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.pantry-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
}

.pantry-option {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.pantry-option:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.pantry-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .recipe-editor-layout {
        grid-template-columns: 1fr 300px;
    }

    .economic-sidebar,
    .pantry-sidebar {
        grid-column: 2;
        grid-row: auto;
    }

    .pantry-sidebar {
        display: none;
    }

    .pantry-sidebar.visible {
        display: flex;
    }
}

@media (max-width: 768px) {
    .recipe-editor-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .editor-header {
        grid-column: 1;
    }

    .editor-main {
        grid-column: 1;
    }

    .economic-sidebar,
    .pantry-sidebar {
        grid-column: 1;
        position: relative;
        max-height: none;
    }

    .header-top {
        grid-template-columns: 1fr;

    }

    .ingredient-main {
        flex-direction: column;
        gap: 0.5rem;
    }

    .qty-input,
    .unit-select,
    .ingredient-name-input,
    .brand-input,
    .cost-input {
        width: 100%;
    }

    .ingredient-secondary {
        width: 100%;
        gap: 0.5rem;
    }

    .btn-pantry-link,
    .btn-pantry-unlink,
    .btn-remove-ingredient {
        flex: 1;
        min-width: 100px;
    }

    .header-bottom {
        grid-template-columns: 1fr;
    }
}

/* Select options */
select option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

/* Input focus states */
input:focus,
textarea:focus,
select:focus {
    transition: all 0.2s;
}

/* ============================================================================
 * Pantry Add Modal
 * ============================================================================ */
.pantry-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: pantryFadeIn 0.2s ease;
}

@keyframes pantryFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pantry-modal {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 16px;
    width: 520px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: pantrySlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pantrySlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pantry-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.pantry-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.pantry-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pantry-modal-row {
    display: flex;
    gap: 1rem;
}

.pantry-modal-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pantry-modal-field label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pantry-modal-field input,
.pantry-modal-field select {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.pantry-modal-field input:focus,
.pantry-modal-field select:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.pantry-modal-allergens {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.allergen-checkbox {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.allergen-checkbox:hover {
    border-color: var(--primary);
    color: white;
}

.allergen-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
}

.allergen-checkbox:has(input:checked) {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.pantry-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   MENU ENGINEER STYLES
   ============================================================ */

/* Main Layout */
.menu-engineer-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 85vh;
    margin: -1.5rem;
    /* Negate parent padding for full-bleed feel */
}

/* Top Bar: Navigation, Title, and Economics */
.me-top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.me-top-left,
.me-top-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.me-economics-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    border: 2px solid var(--border-subtle);
}

.me-eco-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.me-eco-label {
    color: var(--text-muted);
}

.me-eco-value {
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* Main Editor Area */
.me-main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.me-editor-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

/* Right Sidebar Container */
.me-right-sidebars {
    width: 320px;
    border-left: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.me-right-sidebars.collapsed {
    width: 0;
    border-left: none;
}

.me-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.me-sidebar-tab {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.me-sidebar-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.me-sidebar-panel {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: none;
}

.me-sidebar-panel.active {
    display: block;
}

/* Sidebar Toggle Button */
.me-toggle-sidebar-btn {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 101;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.me-toggle-sidebar-btn:hover {
    transform: scale(1.1);
}

/* List/Gallery View */
.menu-engineer-list {
    padding: 2rem;
}

.menu-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.menu-card {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-subtle);
}

.menu-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Existing utility updates */
.me-title-input {
    background: transparent !important;
    border-bottom: 2px solid var(--primary) !important;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    font-family: 'Outfit', sans-serif !important;
    color: white !important;
    padding: 0 !important;
    outline: none;
    padding-inline-start: 0.5rem !important;
}

.me-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.me-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-subtle);
    border-radius: 16px;
    padding: 0.5rem 1rem 0.5rem 1rem;
    margin-top: 0.5rem;
}

.me-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.me-item-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.me-tag {
    color: var(--tag-good);
}

/* New Utilities & Module Styles */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.font-mono {
    font-family: monospace;
}

.cursor-pointer {
    cursor: pointer;
}

.w-full {
    width: 100%;
}

.me-list-header {
    margin-bottom: 1.5rem;
}

.me-empty-state {
    padding: 3rem;
}

.me-empty-icon {
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.me-empty-icon i {
    width: 48px;
    height: 48px;
}

.me-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.me-card-title {
    margin: 0;
    font-size: 1.1rem;
}

.me-card-badge {
    font-size: 0.7rem;
}

.me-card-stats {
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.me-card-stats i {
    width: 14px;
    height: 14px;
}

.me-card-actions {
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.me-section-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.me-section-title {
    font-size: 1.25rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: white;
    border-bottom: 2px solid var(--primary);
}

.me-section-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.me-section-margin-badge {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.me-item-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
}

.me-item-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.me-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
}

.me-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100%;
}

.me-item-price-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.me-item-price-input {
    width: 70px;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--primary);
}

.me-sidebar-search {
    margin-bottom: 1rem;
}

.me-rep-cat-header {
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.me-rep-group {
    margin-bottom: 1.25rem;
}

.me-rep-item {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-subtle);
}

.me-rep-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.me-branding-color-preview {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.me-color-input {
    width: 40px;
    height: 30px;
    padding: 2px;
    border: none;
    cursor: pointer;
}

.me-eco-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.me-eco-total {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.me-eco-section-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.spice-mild i[data-lucide="flame"],
.spice-mild {
    color: #FFD700;
    /* yellow */
}

.spice-medium i[data-lucide="flame"],
.spice-medium {
    color: #FFA500;
    /* orange */
}

.spice-hot i[data-lucide="flame"],
.spice-hot {
    color: #FF4500;
    /* red-orange */
}

.spice-extra-hot i[data-lucide="flame"],
.spice-extra-hot {
    color: #FF0000;
    /* red */
}

.pantry-modal-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.nutrition-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nutrition-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nutrition-field .input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
}

.nutrition-field input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 0.5rem !important;
    font-size: 0.9rem !important;
    color: var(--text-main) !important;
    width: 60px;
}

.nutrition-field .unit {
    padding: 0 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border-subtle);
}

/*PRINT STYLES
/* print.css - A4 kitchen make sheet */
@page { size: A4; margin: 18mm; }

@media print {
  :root {
    --primary: #c30000;
    --border-subtle: #27272a;
  }

  /* Base */
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-family: 'Inter', sans-serif;
    font-size: 11pt;
    line-height: 1.15;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    margin: 0;
    padding: 0;
  }

  /* Hide app chrome */
  .sidebar, .top-bar, nav, .no-print, button, .btn, .controls { display: none !important; }

  /* Container */
  .make-sheet {
    width: 100%;
    max-width: 210mm;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  header.make-sheet-header {
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 2px solid #000;
  }

  h1 {
    font-size: 18pt;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #000;
  }

  .meta {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 10px;
  }

  .meta img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border: 1px solid #000;
    display: block;
  }

  .meta .meta-list p {
    margin: 2px 0;
    font-size: 10pt;
  }

  /* Ingredients table */
  .ingredients-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 10pt;
  }

  .ingredients-table th,
  .ingredients-table td {
    border: 1px solid #000;
    padding: 6px;
    text-align: left;
    vertical-align: top;
  }

  .ingredients-table th {
    background: #f0f0f0;
    font-weight: 700;
  }

  /* Methods / steps */
  .method-step {
    margin-bottom: 8px;
    font-size: 10pt;
    page-break-inside: avoid;
  }

  /* Keep logical blocks together */
  .ingredient-row, .method-step, .meta { page-break-inside: avoid; }

  /* Small utilities */
  .muted { color: #333; font-size: 9.5pt; }
  .small { font-size: 9pt; }

  /* Avoid printing backgrounds that printers may drop */
  * { background: transparent !important; box-shadow: none !important; }

  /* Prevent orphan headings */
  h2 { page-break-after: avoid; page-break-inside: avoid; }

  /* Footer (optional) */
  footer.make-sheet-footer {
    margin-top: 8px;
    font-size: 9pt;
    color: #333;
  }
}
