/* ---------------------------------------------------------
   COLOR SYSTEM — SAGE / OLIVE THEME
--------------------------------------------------------- */
:root {
    --sage: #6B8F71;
    --sage-light: #A3BFA8;
    --sage-dark: #4E6E58;
    --neutral: #C2C5AA;
    --bg: #F6F7F2;
    --text: #333333;

    --surface: #ffffff;
    --border: #dddddd;
    --shadow: 0 2px 6px rgba(0,0,0,0.08);

    --danger: #ff6666;
    --danger-dark: #ff4d4d;
}

/* ---------------------------------------------------------
   RESET + BASE
--------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    display: flex;
}

/* ---------------------------------------------------------
   SIDEBAR
--------------------------------------------------------- */
.sidebar {
    width: 240px;
    background: var(--sage-dark);
    color: white;
    height: 100vh;
    position: fixed;
    left: -240px;
    top: 0px;
    padding:  60px 20px 20px;
    transition: 0.3s ease;
    z-index: 1000;
}

.sidebar.open {
    left: 0;
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 22px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin: 15px 0;
}

.sidebar ul li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    transition: 0.2s;
}

.sidebar ul li a:hover {
    color: var(--sage-light);
}

/* ---------------------------------------------------------
   SIDEBAR TOGGLE
--------------------------------------------------------- */
.toggle-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    background: var(--sage-dark);
    color: white;
    border: none;
    padding: 10px 14px;
    font-size: 20px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1100;
}

.toggle-btn:hover {
    background: var(--sage);
}

/* ---------------------------------------------------------
   MAIN CONTENT
--------------------------------------------------------- */
.main-content {
    margin-left: 50px;
    padding: 20px;
    width: 100%;
    transition: 0.3s ease;
}

.sidebar.open ~ .main-content {
    margin-left: 240px;
}

/* ---------------------------------------------------------
   HEADERS
--------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.page-header h1 {
    font-size: 32px;
}

/* ---------------------------------------------------------
   DASHBOARD SECTIONS
--------------------------------------------------------- */
.dashboard-section {
    background: var(--surface);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* ---------------------------------------------------------
   QUICK LINKS / DASHBOARD CARDS
--------------------------------------------------------- */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 3fr));
    gap: 15px;
}

.quick-card {
    background: var(--sage);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    box-shadow: var(--shadow);
    transition: 0.2s ease;
}

.quick-card:hover {
    background: var(--sage-light);
    color: var(--text);
}

/* ---------------------------------------------------------
   FORMS
--------------------------------------------------------- */
input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 16px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
button {
    cursor: pointer;
}

.small-btn {
    background: var(--sage);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.small-btn:hover {
    background: var(--sage-dark);
}

.save-btn {
    background: var(--sage-dark);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 8px;
    margin-top: 20px;
}

.save-btn:hover {
    background: var(--sage);
}

/* ---------------------------------------------------------
   SPACING UTILITIES
--------------------------------------------------------- */

/* Margin Top */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Margin Bottom */
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Margin Left */
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }

/* Margin Right */
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }


/* ---------------------------------------------------------
   TAGS
--------------------------------------------------------- */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    background: var(--sage-light);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.remove-tag {
    cursor: pointer;
    font-weight: bold;
}

/* ---------------------------------------------------------
   INGREDIENT ROW (GLOBAL BASE)
--------------------------------------------------------- */
.ingredient-row {
    display: grid;
    grid-template-columns: 80px 110px 1fr 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.ingredient-row input,
.ingredient-row select {
    width: 100%;
}

/* ---------------------------------------------------------
   DELETE BUTTON
--------------------------------------------------------- */
.delete-ingredient {
    background: var(--danger);
    color: white;
    border: none;
    font-size: 18px;
    border-radius: 6px;
}

.delete-ingredient:hover {
    background: var(--danger-dark);
}

/* ---------------------------------------------------------
   FRACTIONS
--------------------------------------------------------- */
.fraction-wrapper {
    margin-left: 8px;
}

.fraction-select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
}

/* ---------------------------------------------------------
   STAR / FAVOURITE BUTTON
--------------------------------------------------------- */
.star-btn {
    background: none;
    border: none;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    color: var(--sage-dark);
    transition: transform 0.15s ease, color 0.15s ease;
}

/* Hover */
.star-btn:hover {
    transform: scale(1);
}

/* Active (favourited) */
.star-btn.active {
    color: gold;
}

/* ---------------------------------------------------------
   MOBILE
--------------------------------------------------------- */
@media (max-width: 700px) {
    .ingredient-row {
        grid-template-columns: 1fr 1fr 1fr 40px;
    }
}
