* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f6f7f2;
    color: #18221a;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-screen {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;

    background: white;

    padding: 40px;

    border-radius: 24px;

    box-shadow:
        0 25px 70px
        rgba(0,0,0,.08);
}

.login-logo {
    width: 190px;
    display: block;
    margin: 0 auto 25px;
}

.login-card h1 {
    text-align: center;
    margin: 0;
}

.login-card p {
    text-align: center;
    color: #6b756b;
    margin-bottom: 30px;
}

.login-card input {
    width: 100%;
    padding: 13px 14px;

    margin-bottom: 14px;

    border:
        1px solid #dfe4dc;

    border-radius: 10px;

    outline: none;
}

.login-card input:focus {
    border-color: #315a2b;
}

.login-card .primary-btn {
    width: 100%;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.primary-btn {
    border: 0;

    background: #315a2b;

    color: white;

    padding: 11px 17px;

    border-radius: 10px;

    font-weight: 800;
}

.secondary-btn {
    background: white;

    color: #18221a;

    border:
        1px solid #dfe4dc;

    padding: 11px 17px;

    border-radius: 10px;
}

.small-btn {
    background: white;

    border:
        1px solid #dfe4dc;

    padding: 7px 11px;

    border-radius: 8px;

    font-size: 13px;
}

.close-btn {
    border: 0;

    background: transparent;

    font-size: 28px;

    line-height: 1;
}

.remove-btn {
    border: 0;

    background: transparent;

    color: #b53b2a;

    font-size: 22px;
}


/* ============================================================
   CMS
   ============================================================ */

.cms {
    min-height: 100vh;

    display: flex;
}

.sidebar {
    width: 230px;

    background: #172219;

    padding: 25px 15px;

    display: flex;

    flex-direction: column;

    gap: 6px;
}

.sidebar-logo {
    width: 165px;

    margin:
        5px auto 35px;

    filter:
        brightness(0)
        invert(1);
}

.nav-btn,
.logout-btn {
    border: 0;

    background: transparent;

    color: #c5cec4;

    text-align: left;

    padding: 12px 14px;

    border-radius: 9px;
}

.nav-btn:hover,
.nav-btn.active {
    background:
        rgba(255,255,255,.09);

    color: white;
}

.logout-btn {
    margin-top: auto;

    color: #e7a99e;
}


/* ============================================================
   CONTENT
   ============================================================ */

.content {
    flex: 1;

    min-width: 0;

    padding: 40px;
}

.page {
    max-width: 1200px;

    margin: auto;
}

.page-header {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 25px;
}

.page-header h1 {
    margin: 0 0 5px;
}

.page-header p {
    margin: 0;

    color: #6b756b;
}


/* ============================================================
   TOOLBAR
   ============================================================ */

.toolbar {
    display: flex;

    gap: 10px;

    margin-bottom: 18px;
}

.toolbar input,
.toolbar select {
    padding: 11px 13px;

    background: white;

    border:
        1px solid #dfe4dc;

    border-radius: 10px;
}

.toolbar input {
    flex: 1;
}


/* ============================================================
   PRODUCTS
   ============================================================ */

.product-list {
    background: white;

    border:
        1px solid #e5e9e2;

    border-radius: 16px;

    overflow: hidden;
}

.product-row {
    display: grid;

    grid-template-columns:
        1fr
        130px
        auto;

    align-items: center;

    gap: 20px;

    padding: 17px 20px;

    border-bottom:
        1px solid #edf0eb;
}

.product-row:last-child {
    border-bottom: 0;
}

.product-name {
    font-weight: 800;
}

.product-meta {
    color: #6b756b;

    font-size: 13px;

    margin-top: 4px;
}

.status {
    display: inline-block;

    width: max-content;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 800;
}

.status.available {
    color: #315a2b;

    background: #e5eedf;
}

.status.unavailable {
    color: #a13a29;

    background: #f7dfda;
}


/* ============================================================
   CATEGORIES / TAGS
   ============================================================ */

.category-list,
.tag-list {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0,1fr)
        );

    gap: 15px;
}

.category-item,
.tag-item {
    background: white;

    border:
        1px solid #e5e9e2;

    border-radius: 14px;

    padding: 18px;
}

.category-item strong,
.category-item span,
.tag-item strong,
.tag-item span {
    display: block;
}

.category-item span,
.tag-item span {
    color: #6b756b;

    font-size: 12px;

    margin-top: 4px;
}


/* ============================================================
   MODAL
   ============================================================ */

.modal {
    position: fixed;

    inset: 0;

    background:
        rgba(0,0,0,.45);

    z-index: 1000;

    display: grid;

    place-items: center;

    padding: 20px;
}

.modal-card {
    width: 100%;

    max-width: 700px;

    max-height: 92vh;

    overflow-y: auto;

    background: white;

    border-radius: 22px;

    padding: 25px;
}

.modal-header {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    margin-bottom: 25px;
}

.modal-header h2 {
    margin: 0;
}


/* ============================================================
   FORM
   ============================================================ */

#productForm label {
    display: block;

    font-size: 13px;

    font-weight: 700;

    margin-bottom: 17px;
}

#productForm input,
#productForm textarea,
#productForm select {
    display: block;

    width: 100%;

    margin-top: 7px;

    padding: 11px 13px;

    border:
        1px solid #dfe4dc;

    border-radius: 9px;

    outline: none;

    background: white;
}

#productForm textarea {
    resize: vertical;
}

.check-row {
    display: flex !important;

    align-items: center;

    gap: 8px;
}

.check-row input {
    width: auto !important;

    margin: 0 !important;
}


/* ============================================================
   FORM SECTIONS
   ============================================================ */

.form-section {
    margin-top: 25px;

    padding-top: 20px;

    border-top:
        1px solid #edf0eb;
}

.form-section h3 {
    margin: 0;
}

.section-title {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    margin-bottom: 12px;
}

.checkbox-grid {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}

.checkbox-grid label {
    margin: 0 !important;

    padding:
        8px 10px;

    border:
        1px solid #e0e5dd;

    border-radius: 9px;

    background: #fafbf9;
}

.checkbox-grid input {
    width: auto !important;

    display: inline !important;

    margin:
        0 5px 0 0 !important;
}


/* ============================================================
   VARIANTS / RELATED
   ============================================================ */

.variant-row,
.related-row {
    display: flex;

    gap: 8px;

    align-items: center;

    margin-bottom: 8px;
}

.variant-row input {
    margin: 0 !important;
}

.variant-name {
    flex: 1;
}

.variant-price {
    width: 100px !important;
}

.related-row select {
    flex: 1;

    margin: 0 !important;
}


/* ============================================================
   MODAL ACTIONS
   ============================================================ */

.modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 30px;

    padding-top: 20px;

    border-top:
        1px solid #edf0eb;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (
    max-width: 800px
) {

    .cms {
        display: block;
    }

    .sidebar {
        width: 100%;

        flex-direction: row;

        align-items: center;

        overflow-x: auto;

        padding: 10px;
    }

    .sidebar-logo {
        width: 105px;

        margin: 0 10px 0 0;
    }

    .nav-btn,
    .logout-btn {
        white-space: nowrap;

        flex: 0 0 auto;
    }

    .logout-btn {
        margin-top: 0;
    }

    .content {
        padding: 20px 15px;
    }

    .page-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .category-list,
    .tag-list {
        grid-template-columns: 1fr;
    }

    .product-row {
        grid-template-columns:
            1fr auto;
    }

    .product-row .status {
        grid-column: 2;
        grid-row: 1;
    }

    .product-row .small-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
    }

}

@media (
    max-width: 500px
) {

    .modal-card {
        padding: 18px;

        border-radius: 17px;
    }

    .login-card {
        padding: 25px;
    }

}