:root {
    --bg: #07140c;
    --sidebar: #10251a;
    --card: #10281a;
    --card-hover: #163820;
    --border: #285d36;

    --accent: #65f36b;
    --accent-dark: #3fc94d;

    --text: #ffffff;
    --text-secondary: #d9f1dc;
    --text-muted: #91b49a;

    --green: #39c85a;
    --red: #e95b62;
    --yellow: #e3c84e;
    --blue: #4c9ce8;
    --purple: #a86be2;
}


/* ========================================
   RESET
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #12351d 0%,
            #07140c 55%
        );

    color: var(--text-secondary);

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button {
    -webkit-tap-highlight-color: transparent;
}

input,
select {
    outline: none;
}


/* ========================================
   MAIN LAYOUT
======================================== */

.layout {
    display: flex;
    min-height: 100vh;
}


/* ========================================
   SIDEBAR
======================================== */

.sidebar {
    width: 260px;
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    background: var(--sidebar);

    border-right:
        1px solid var(--border);

    padding: 30px 20px;

    overflow-y: auto;

    z-index: 1000;
}


/* Sidebar logo */

.sidebar-logo {
    margin-bottom: 40px;
}

.sidebar-logo .logo-title {
    color: var(--accent);

    font-size: 26px;
    font-weight: 800;

    text-shadow:
        0 0 12px
        rgba(101, 243, 107, 0.2);
}

.sidebar-logo .logo-subtitle {
    margin-top: 5px;

    color: #b8d8bd;

    font-size: 13px;
}


/* Sidebar navigation */

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.sidebar-nav > a,
.nav-group a {
    display: block;

    padding: 11px 15px;

    border-radius: 8px;

    color: white;

    text-decoration: none;

    transition:
        background .2s,
        color .2s;
}

.sidebar-nav > a:hover,
.nav-group a:hover {
    background: #193b24;
}

.sidebar-nav a.active {
    background: var(--accent);

    color: #07140c;

    font-weight: 700;
}


/* Categories */

.nav-category {
    margin-top: 18px;
}

.category-title {
    padding-left: 15px;

    margin-bottom: 7px;

    color: #8aff8e;

    font-size: 12px;
    font-weight: 800;

    text-transform: uppercase;
}

.nav-group {
    display: flex;
    flex-direction: column;

    gap: 2px;
}

.nav-group a {
    color: #9fc3a7;

    font-size: 14px;
}


/* ========================================
   MOBILE MENU BUTTON
======================================== */

.mobile-menu-toggle {
    display: none;

    align-items: center;
    justify-content: center;

    position: absolute;

    top: 12px;
    right: 15px;

    width: 42px;
    height: 42px;

    padding: 0;

    background: #163820;

    color: var(--accent);

    border:
        1px solid var(--accent);

    border-radius: 9px;

    font-size: 22px;

    line-height: 1;

    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: #1d4728;

    box-shadow:
        0 0 15px
        rgba(101, 243, 107, .2);
}


/* ========================================
   MAIN AREA
======================================== */

.main-area {
    flex: 1;

    margin-left: 260px;

    min-width: 0;
}


/* ========================================
   TOP BAR
======================================== */

.topbar {
    width: 100%;

    padding:
        28px 35px;

    background:
        rgba(13, 36, 21, .82);

    border-bottom:
        1px solid var(--border);

    backdrop-filter:
        blur(10px);
}

.brand {
    width:
        min(1180px, 100%);

    margin: 0 auto;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;
}

.logo-title {
    color: var(--accent);

    font-size: 27px;
    font-weight: 800;

    text-shadow:
        0 0 12px
        rgba(101, 243, 107, .18);
}

.logo-subtitle {
    margin-top: 5px;

    color: #b8d8bd;

    font-size: 13px;
}

.creator {
    color: var(--text-muted);

    font-size: 14px;
}


/* ========================================
   CONTENT
======================================== */

.content {
    width:
        min(
            1180px,
            calc(100% - 70px)
        );

    margin: 0 auto;

    padding:
        45px 0 30px;
}


/* ========================================
   PAGE HEADER
======================================== */

.page-header {
    padding: 32px;

    background:
        linear-gradient(
            135deg,
            rgba(101,243,107,.10),
            rgba(181,255,101,.055)
        );

    border:
        1px solid var(--border);

    border-radius: 16px;
}

.page-subtitle {
    margin-bottom: 8px;

    color: var(--accent);

    font-size: 13px;

    font-weight: 700;

    letter-spacing: 2px;
}

.page-header h1 {
    margin-bottom: 12px;

    color: white;

    font-size:
        clamp(32px, 5vw, 46px);

    line-height: 1.15;
}

.page-header p {
    max-width: 820px;

    color: var(--text-secondary);

    line-height: 1.8;
}


/* ========================================
   SECTIONS
======================================== */

.section {
    margin-top: 32px;
}

.section > h2 {
    margin-bottom: 14px;

    padding-left: 12px;

    border-left:
        4px solid var(--accent);

    color: white;

    font-size: 19px;

    line-height: 1.3;
}


/* ========================================
   PANELS
======================================== */

.panel,
.remaining-panel {
    padding: 22px;

    background: var(--card);

    border:
        1px solid var(--border);

    border-radius: 14px;
}

.panel-title-row,
.craft-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;
}

.panel h3,
.craft-header h3,
.remaining-panel h3 {
    margin-bottom: 5px;

    color: white;

    font-size: 16px;
}

.panel p,
.craft-header p,
.remaining-heading span {
    color: var(--text-muted);

    font-size: 13px;

    line-height: 1.6;
}


/* ========================================
   BUTTON
======================================== */

.secondary-btn {
    padding:
        8px 13px;

    background: transparent;

    color: var(--text-secondary);

    border:
        1px solid var(--border);

    border-radius: 8px;

    transition: .2s;
}

.secondary-btn:hover {
    color: var(--accent);

    border-color:
        var(--accent);
}


/* ========================================
   INVENTORY
======================================== */

.input-grid {
    display: grid;

    gap: 12px;

    margin-top: 20px;
}

.input-grid.five {
    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );
}

.input-card {
    display: flex;

    flex-direction: column;

    gap: 9px;

    padding: 15px;

    background: #0b1d11;

    border:
        1px solid var(--border);

    border-radius: 11px;

    transition: .2s;
}

.input-card:focus-within {
    border-color:
        var(--accent);

    background: #0e2414;
}

.chem {
    width: 38px;
    height: 38px;

    display: grid;

    place-items: center;

    border-radius: 9px;

    color: white;

    font-weight: 800;
}

.chem.green {
    background: var(--green);
}

.chem.red {
    background: var(--red);
}

.chem.yellow {
    background: var(--yellow);
}

.chem.blue {
    background: var(--blue);
}

.chem.purple {
    background: var(--purple);
}

.field-label {
    color: white;

    font-size: 13px;

    font-weight: 600;
}

.input-card input {
    width: 100%;

    padding: 10px;

    background: #10251a;

    color: white;

    border:
        1px solid var(--border);

    border-radius: 8px;
}

.input-card input:focus {
    border-color:
        var(--accent);

    box-shadow:
        0 0 0 2px
        rgba(101,243,107,.08);
}


/* ========================================
   CHEMICAL PRICES
======================================== */

.price-grid {
    display: grid;

    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );

    gap: 10px;

    margin-top: 20px;
}

.price-card {
    padding: 13px;

    background: #0b1d11;

    border:
        1px solid var(--border);

    border-radius: 10px;
}

.price-card:focus-within {
    border-color:
        var(--accent);
}

.price-name {
    margin-bottom: 9px;

    color: white;

    font-size: 13px;

    font-weight: 600;
}

.dot {
    display: inline-block;

    width: 9px;
    height: 9px;

    margin-right: 5px;

    border-radius: 50%;
}

.dot.green {
    background: var(--green);
}

.dot.red {
    background: var(--red);
}

.dot.yellow {
    background: var(--yellow);
}

.dot.blue {
    background: var(--blue);
}

.dot.purple {
    background: var(--purple);
}

.price-input-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;

    gap: 5px;
}

.price-card input {
    min-width: 0;

    padding: 9px;

    background: #10251a;

    color: white;

    border:
        1px solid var(--border);

    border-radius: 8px;
}

.price-card input:focus {
    border-color:
        var(--accent);
}


/* ========================================
   UNIT BUTTONS
======================================== */

.unit-btn {
    padding:
        7px 8px;

    background: #10251a;

    color: var(--text-muted);

    border:
        1px solid var(--border);

    border-radius: 7px;

    white-space: nowrap;

    transition: .2s;
}

.unit-btn:hover {
    color: white;

    border-color:
        #477251;
}

.unit-btn.active {
    background:
        var(--accent);

    color:
        #07140c;

    border-color:
        var(--accent);

    font-weight: 700;
}


/* ========================================
   UNIT EXPLANATION
======================================== */

.unit-help {
    margin-top: 14px;

    padding: 12px;

    background: #0b1d11;

    border:
        1px dashed var(--border);

    border-radius: 9px;

    color: var(--text-muted);

    font-size: 12px;

    line-height: 1.7;
}

.unit-help strong {
    color: white;
}


/* ========================================
   CRAFT
======================================== */

.craft-select-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        390px;

    gap: 12px;

    margin-top: 18px;
}

.craft-select {
    width: 100%;

    padding: 11px;

    background: #0b1d11;

    color: white;

    border:
        1px solid var(--border);

    border-radius: 9px;
}

.craft-select:hover {
    border-color:
        #477251;
}

.craft-select:focus {
    border-color:
        var(--accent);

    box-shadow:
        0 0 0 2px
        rgba(101,243,107,.08);
}


/* Craft price */

.craft-price {
    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto
        auto;

    align-items: center;

    gap: 6px;
}

.craft-price > span:first-child {
    color: var(--text-muted);

    font-size: 12px;

    white-space: nowrap;
}

.craft-price input {
    min-width: 0;

    width: 100%;

    padding: 10px;

    background: #10251a;

    color: white;

    border:
        1px solid var(--border);

    border-radius: 8px;
}

.craft-price input:focus {
    border-color:
        var(--accent);

    box-shadow:
        0 0 0 2px
        rgba(101,243,107,.08);
}


/* Recipe text */

.recipe-preview {
    margin-top: 10px;

    padding:
        11px 13px;

    background: #0b1d11;

    border:
        1px dashed var(--border);

    border-radius: 8px;

    color: var(--text-muted);

    font-size: 13px;

    line-height: 1.6;
}


/* ========================================
   RESULT COMPARISON
======================================== */

.comparison-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;
}

.result-card {
    padding: 23px;

    background: var(--card);

    border:
        1px solid var(--border);

    border-radius: 14px;
}

.raw-result {
    border-color:
        #477251;
}

.craft-result {
    background:
        linear-gradient(
            135deg,
            rgba(101,243,107,.10),
            var(--card)
        );

    border-color:
        var(--accent);
}

.result-title {
    margin-bottom: 9px;

    color: white;

    font-weight: 700;
}

.result-value {
    color: var(--accent);

    font-size: 34px;

    font-weight: 800;

    line-height: 1.15;
}

.result-description {
    margin-top: 8px;

    color: var(--text-muted);

    font-size: 13px;

    line-height: 1.6;
}


/* ========================================
   REMAINING CHEM
======================================== */

.remaining-panel {
    margin-top: 12px;
}

.remaining-heading {
    margin-bottom: 14px;
}

.remaining-heading h3 {
    margin-bottom: 4px;
}

.remaining-grid {
    display: grid;

    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );

    gap: 10px;
}

.remaining-item {
    padding: 13px;

    background: #0b1d11;

    border:
        1px solid var(--border);

    border-radius: 9px;
}

.remaining-item span {
    display: block;

    color: var(--text-muted);

    font-size: 11px;

    font-weight: 600;
}

.remaining-item strong {
    display: block;

    margin-top: 4px;

    color: white;

    font-size: 16px;
}


/* ========================================
   VERDICT
======================================== */

.verdict {
    margin-top: 12px;

    padding: 16px;

    background:
        rgba(101,243,107,.07);

    border:
        1px solid var(--accent);

    border-radius: 10px;

    color: var(--text-secondary);

    font-size: 14px;

    line-height: 1.7;
}


/* ========================================
   FOOTER
======================================== */

footer {
    margin-top: 45px;

    padding-top: 20px;

    border-top:
        1px solid var(--border);

    text-align: center;

    color: var(--text-muted);

    font-size: 12px;
}

footer .disclaimer {
    margin-top: 5px;
}


/* ========================================
   MOBILE / TABLET
======================================== */

@media (max-width: 900px) {

    .layout {
        display: block;
    }


    /* -----------------------------
       MOBILE SIDEBAR
    ----------------------------- */

    .sidebar {
        width: 100%;
        height: 68px;

        position: relative;

        padding:
            12px 15px;

        border-right: none;

        border-bottom:
            1px solid var(--border);

        overflow: visible;
    }


    .sidebar-logo {
        margin: 0;
    }


    .sidebar-logo .logo-title {
        font-size: 22px;
    }


    .sidebar-logo .logo-subtitle {
        display: none;
    }


    /* Hamburger */

    .mobile-menu-toggle {
        display: flex;
    }


    /* Navigation closed */

    .sidebar-nav {
        display: none;

        position: absolute;

        top: 67px;
        left: 0;

        width: 100%;

        padding:
            14px 15px 18px;

        background:
            var(--sidebar);

        border-bottom:
            1px solid var(--border);

        box-shadow:
            0 12px 30px
            rgba(0,0,0,.3);

        z-index: 1000;
    }


    /* Navigation open */

    .sidebar-nav.mobile-open {
        display: flex;
    }


    /* -----------------------------
       MAIN
    ----------------------------- */

    .main-area {
        margin-left: 0;
    }


    .topbar {
        padding:
            20px 15px;
    }


    .brand {
        align-items: flex-start;

        flex-direction: column;

        gap: 5px;
    }


    .content {
        width:
            calc(100% - 30px);

        padding-top:
            25px;
    }


    /* -----------------------------
       GRIDS
    ----------------------------- */

    .input-grid.five,
    .price-grid,
    .remaining-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .comparison-grid {
        grid-template-columns: 1fr;
    }


    .craft-select-row {
        grid-template-columns: 1fr;
    }


    .craft-price {
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto
            auto;
    }
}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 600px) {

    .page-header {
        padding: 20px;
    }


    .page-header h1 {
        font-size: 30px;
    }


    .page-header p {
        font-size: 14px;

        line-height: 1.7;
    }


    .panel,
    .result-card,
    .remaining-panel {
        padding: 17px;
    }


    .input-grid.five,
    .price-grid,
    .remaining-grid {

        grid-template-columns: 1fr;
    }


    .price-input-row {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;
    }


    .craft-price {
        grid-template-columns:
            1fr
            minmax(0, 1fr)
            auto
            auto;
    }


    .craft-price > span:first-child {
        grid-column:
            1 / -1;
    }


    .result-value {
        font-size: 29px;
    }


    .comparison-grid {
        gap: 10px;
    }
}


/* ========================================
   VERY SMALL SCREEN
======================================== */

@media (max-width: 380px) {

    .price-input-row {
        grid-template-columns: 1fr 1fr;
    }


    .price-input-row input {
        grid-column:
            1 / -1;
    }


    .craft-price {
        grid-template-columns:
            1fr 1fr;
    }


    .craft-price > span:first-child {
        grid-column:
            1 / -1;
    }


    .craft-price input {
        grid-column:
            1 / -1;
    }
}