:root {
    --ink: #0b1220;
    --navy: #101b31;
    --blue: #3a82ef;
    --blue-soft: #edf4ff;

    --paper: #f6f8fb;
    --white: #ffffff;

    --line: #e7ebf1;

    --muted: #7a8495;
    --muted-light: #9aa3b1;

    --green: #1c9b67;
    --green-soft: #e9f8f1;

    --red: #d84d55;
    --red-soft: #fff0f1;

    --shadow:
        0 18px 50px rgba(13, 27, 53, 0.08);
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    background: var(--paper);
    color: var(--ink);

    font-family:
        Manrope,
        Arial,
        sans-serif;

    font-size: 13px;
}


button,
input,
textarea,
select {
    font: inherit;
}


button,
select {
    cursor: pointer;
}


button {
    border: 0;
}


.hidden {
    display: none !important;
}

.icon-button:disabled {
    opacity: 0.25;
    cursor: default;
    background: #f5f6f8;
    color: #687386;
}

.icon-button:disabled:hover {
    background: #f5f6f8;
    color: #687386;
}
/* =========================================================
   PRODUCT REORDER ANIMATION
========================================================= */

.product-row-moving {
    position: relative;
    z-index: 2;
}

.product-row-moving td {
    background: #ffffff;
}

.product-row-moving .product-thumb {
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease;
}

.product-row-moving .product-thumb {
    box-shadow:
        0 8px 22px rgba(11, 18, 32, 0.10);
}


/* Slight emphasis while the row is moving */

.product-row-moving td {
    transition:
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}


/* Arrow button feedback */

.reorder-button {
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.reorder-button:active {
    transform: scale(0.88);
}


/* Prevent animation from feeling sluggish */

.product-row-moving {
    will-change: transform;
}
/* =========================================================
   COMMON
========================================================= */

.eyebrow {
    margin: 0 0 10px;

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1.8px;
}


.primary-button,
.secondary-button,
.danger-button {
    min-height: 43px;

    padding: 0 16px;

    border-radius: 9px;

    font-size: 11px;
    font-weight: 800;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


.primary-button {
    background: var(--ink);
    color: #fff;
}


.primary-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 8px 20px rgba(11, 18, 32, 0.14);
}


.primary-button:disabled,
.danger-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


.secondary-button {
    background: #f2f4f7;
    color: var(--ink);
}


.secondary-button:hover {
    background: #e9edf2;
}


.danger-button {
    background: var(--red);
    color: #fff;
}


.full-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


.form-error {
    min-height: 16px;

    margin: 0;

    color: var(--red);

    font-size: 10px;
    line-height: 1.5;
}


/* =========================================================
   INPUTS
========================================================= */

input,
textarea,
select {
    width: 100%;

    border: 1px solid #dfe4eb;
    border-radius: 9px;

    background: #fbfcfe;

    color: var(--ink);

    outline: none;

    transition:
        border 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


input,
select {
    height: 45px;
    padding: 0 13px;
}


textarea {
    padding: 12px 13px;

    resize: vertical;
}


input:focus,
textarea:focus,
select:focus {
    border-color: rgba(58, 130, 239, 0.65);

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(58, 130, 239, 0.09);
}


/* =========================================================
   LOGIN
========================================================= */

.auth-screen {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 24px;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(58, 130, 239, 0.10),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(16, 27, 49, 0.08),
            transparent 35%
        ),
        var(--paper);
}


.auth-card {
    width: min(420px, 100%);

    padding: 42px;

    background: var(--white);

    border: 1px solid var(--line);
    border-radius: 18px;

    box-shadow: var(--shadow);
}


.auth-brand {
    display: flex;
    align-items: center;

    gap: 10px;
}


.auth-brand > div {
    display: grid;
    line-height: 1;
}


.auth-brand strong {
    font:
        700 23px
        "Space Grotesk",
        sans-serif;

    letter-spacing: -1px;
}


.auth-brand small {
    margin-top: 4px;

    color: #9aa3b1;

    font-size: 7px;
    font-weight: 800;

    letter-spacing: 1.5px;
}


.brand-mark {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: var(--ink);
    color: white;

    font:
        italic 700 20px
        "Space Grotesk",
        sans-serif;
}


.auth-heading {
    margin: 62px 0 30px;
}


.auth-heading h1 {
    margin: 0;

    font:
        600 38px
        "Space Grotesk",
        sans-serif;

    letter-spacing: -1.8px;
}


.auth-heading > p:last-child {
    margin: 10px 0 0;

    color: var(--muted);

    line-height: 1.7;
}


.auth-form {
    display: grid;
    gap: 18px;
}


.auth-form label,
.form-grid label {
    display: grid;
    gap: 8px;
}


.auth-form label > span,
.form-grid label > span {
    color: #4e596b;

    font-size: 10px;
    font-weight: 800;
}


.auth-footer {
    margin: 35px 0 0;

    color: #a0a8b5;

    font-size: 9px;

    text-align: center;
}


/* =========================================================
   APPLICATION
========================================================= */

.app-shell {
    min-height: 100vh;

    display: grid;

    grid-template-columns: 235px 1fr;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    min-height: 100vh;

    position: sticky;
    top: 0;

    height: 100vh;

    padding: 28px 18px 20px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: var(--white);

    border-right: 1px solid var(--line);
}


.brand {
    display: flex;
    align-items: center;

    gap: 10px;

    color: var(--ink);

    text-decoration: none;
}


.brand > div {
    display: grid;

    line-height: 1;
}


.brand strong {
    font:
        700 17px
        "Space Grotesk",
        sans-serif;

    letter-spacing: -0.5px;
}


.brand small {
    margin-top: 4px;

    color: #9aa3b1;

    font-size: 7px;
    font-weight: 800;

    letter-spacing: 1.5px;
}


.side-navigation {
    margin-top: 58px;

    display: grid;

    gap: 5px;
}


.nav-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 13px;

    border-radius: 8px;

    background: transparent;

    color: #697386;

    font-size: 11px;
    font-weight: 800;

    text-align: left;

    text-decoration: none;
}


.nav-item:hover,
.nav-item.active {
    color: var(--ink);

    background: #f1f5fa;
}


.nav-icon {
    width: 18px;

    color: #8b95a5;

    font-size: 16px;

    text-align: center;
}


.sidebar-bottom {
    display: flex;
    align-items: center;

    gap: 10px;

    padding-top: 18px;

    border-top: 1px solid var(--line);
}


.admin-profile {
    min-width: 0;

    flex: 1;

    display: flex;
    align-items: center;

    gap: 9px;
}


.avatar {
    width: 31px;
    height: 31px;

    flex: 0 0 31px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--blue-soft);
    color: var(--blue);

    font-weight: 800;
}


.admin-profile-info {
    min-width: 0;

    display: grid;
}


.admin-profile-info strong {
    overflow: hidden;

    color: #303a4a;

    font-size: 9px;
    font-weight: 800;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.admin-profile-info small {
    margin-top: 3px;

    color: #9ba4b2;

    font-size: 8px;
}


.logout-button {
    width: 30px;
    height: 30px;

    border-radius: 7px;

    background: #f4f5f7;

    color: #7d8797;
}


.logout-button:hover {
    background: var(--red-soft);

    color: var(--red);
}


/* =========================================================
   MAIN
========================================================= */

.main-content {
    width: min(1380px, 100%);

    padding:
        44px
        clamp(24px, 4vw, 62px);
}


.topbar {
    display: flex;

    justify-content: space-between;
    align-items: end;

    gap: 20px;

    margin-bottom: 30px;
}


.topbar h1 {
    margin: 0;

    font:
        600 36px
        "Space Grotesk",
        sans-serif;

    letter-spacing: -1.8px;
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 14px;

    margin-bottom: 20px;
}


.stat-card {
    padding: 21px;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 12px;
}


.stat-label {
    color: #929baa;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 1.2px;
}


.stat-card strong {
    display: block;

    margin-top: 10px;

    font:
        600 28px
        "Space Grotesk",
        sans-serif;
}


.stat-card small {
    color: #98a1ae;

    font-size: 9px;
}


/* =========================================================
   PRODUCT TABLE
========================================================= */

.catalogue-card {
    overflow: hidden;

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 13px;
}


.catalogue-toolbar {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding: 20px;

    border-bottom: 1px solid var(--line);
}


.toolbar-title {
    display: flex;
    align-items: baseline;

    gap: 9px;
}


.toolbar-title h2 {
    margin: 0;

    font:
        600 17px
        "Space Grotesk",
        sans-serif;
}


#result-count {
    color: #9aa3b1;

    font-size: 9px;
}


.toolbar-actions {
    display: flex;

    gap: 8px;
}


.search-box {
    width: 235px;

    position: relative;
}


.search-box > span {
    position: absolute;

    top: 50%;
    left: 12px;

    color: #8c96a5;

    font-size: 17px;

    transform: translateY(-52%);

    pointer-events: none;
}


.search-box input {
    padding-left: 32px;
}


.toolbar-actions select {
    width: 130px;
}


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


table {
    width: 100%;

    min-width: 700px;

    border-collapse: collapse;
}


th {
    padding: 13px 20px;

    background: #fafbfd;

    color: #a0a8b4;

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 1.1px;

    text-align: left;
}


td {
    padding: 15px 20px;

    border-top: 1px solid #eef1f5;

    vertical-align: middle;
}


.product-cell {
    display: flex;
    align-items: center;

    gap: 12px;
}


.product-thumb {
    width: 50px;
    height: 40px;

    flex: 0 0 50px;

    overflow: hidden;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: #eef2f6;

    color: #9ba4b1;

    font-size: 9px;
}


.product-thumb img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


.product-cell strong {
    display: block;

    font-size: 11px;
    font-weight: 800;
}


.product-cell small {
    display: block;

    max-width: 320px;

    margin-top: 4px;

    overflow: hidden;

    color: #98a1af;

    font-size: 8px;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.category-text,
.price-text {
    color: #5f6a7c;

    font-size: 10px;
}


.status {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 5px 8px;

    border-radius: 99px;

    font-size: 8px;
    font-weight: 800;
}


.status::before {
    content: "";

    width: 5px;
    height: 5px;

    border-radius: 50%;
}


.status.active {
    background: var(--green-soft);

    color: var(--green);
}


.status.active::before {
    background: var(--green);
}


.status.inactive {
    background: #f0f2f5;

    color: #7e8795;
}


.status.inactive::before {
    background: #a5adba;
}


.row-actions {
    display: flex;

    justify-content: flex-end;

    gap: 5px;
}


.icon-button {
    width: 31px;
    height: 31px;

    border-radius: 7px;

    background: #f5f6f8;

    color: #687386;

    font-size: 12px;
}


.icon-button:hover {
    background: var(--blue-soft);

    color: var(--blue);
}


.icon-button.delete:hover {
    background: var(--red-soft);

    color: var(--red);
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
    padding: 65px 20px;

    text-align: center;
}


.empty-icon {
    width: 40px;
    height: 40px;

    margin: 0 auto 14px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background: #f1f4f8;

    color: #a4adba;
}


.empty-state h3 {
    margin: 0;

    font:
        600 17px
        "Space Grotesk",
        sans-serif;
}


.empty-state p {
    margin: 7px 0 0;

    color: #9ba4b2;

    font-size: 10px;
}


/* =========================================================
   MODALS
========================================================= */

.modal-backdrop {
    position: fixed;

    z-index: 100;

    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(8, 15, 28, 0.48);

    backdrop-filter: blur(8px);
}


.modal {
    width: min(620px, 100%);

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: #fff;

    border-radius: 16px;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.22);
}


.modal-header {
    display: flex;

    justify-content: space-between;
    align-items: start;

    padding: 27px 29px 22px;

    border-bottom: 1px solid var(--line);
}


.modal h2 {
    margin: 0;

    font:
        600 25px
        "Space Grotesk",
        sans-serif;

    letter-spacing: -1.2px;
}


.close-button {
    width: 31px;
    height: 31px;

    border-radius: 7px;

    background: #f3f5f7;

    color: #687386;

    font-size: 20px;
}


.close-button:hover {
    background: #e9edf2;
}


#product-form {
    padding: 25px 29px 28px;
}


.form-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 18px 14px;
}


.full-field {
    grid-column: 1 / -1;
}


.field-help {
    margin-top: -2px;

    color: #9aa3b0;

    font-size: 8px;
}


.form-grid label > span em {
    color: #a3aab5;

    font-style: normal;

    font-weight: 600;
}


/* =========================================================
   ACTIVE SWITCH
========================================================= */

.switch-field {
    display: flex !important;

    align-items: center;
    justify-content: space-between;

    padding: 13px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: #fafbfd;
}


.switch-field > span {
    display: grid;

    gap: 3px;
}


.switch-field strong {
    color: #4e596b;

    font-size: 10px;
}


.switch-field small {
    color: #9ba4b2;

    font-size: 8px;

    font-weight: 500;
}


.switch-field input {
    display: none;
}


.switch-field i {
    width: 38px;
    height: 22px;

    position: relative;

    flex: 0 0 38px;

    border-radius: 99px;

    background: #dfe4eb;

    transition: background 0.2s ease;
}


.switch-field i::after {
    content: "";

    width: 16px;
    height: 16px;

    position: absolute;

    top: 3px;
    left: 3px;

    border-radius: 50%;

    background: #fff;

    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.15);

    transition:
        transform 0.2s ease;
}


.switch-field input:checked + i {
    background: var(--green);
}


.switch-field input:checked + i::after {
    transform: translateX(16px);
}


/* =========================================================
   MODAL FOOTER
========================================================= */

.modal-footer {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 25px;

    padding-top: 20px;

    border-top: 1px solid var(--line);
}


/* =========================================================
   DELETE CONFIRMATION
========================================================= */

.confirm-modal {
    width: min(400px, 100%);

    padding: 32px;

    background: #fff;

    border-radius: 16px;

    text-align: center;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.22);
}


.danger-icon {
    width: 44px;
    height: 44px;

    margin: 0 auto 20px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--red-soft);

    color: var(--red);

    font-weight: 800;
}


.confirm-modal h2 {
    margin: 0;

    font:
        600 24px
        "Space Grotesk",
        sans-serif;
}


.confirm-modal > p:not(.eyebrow) {
    margin: 10px auto 25px;

    color: #7c8696;

    font-size: 11px;

    line-height: 1.7;
}


.confirm-actions {
    display: flex;

    justify-content: center;

    gap: 8px;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;

    z-index: 200;

    right: 24px;
    bottom: 24px;

    max-width: 320px;

    padding: 12px 15px;

    border-radius: 9px;

    background: var(--ink);

    color: white;

    font-size: 10px;
    font-weight: 700;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.18);

    opacity: 0;

    transform: translateY(10px);

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.toast.show {
    opacity: 1;

    transform: translateY(0);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .app-shell {
        grid-template-columns: 72px 1fr;
    }


    .sidebar {
        padding: 22px 12px;
    }


    .brand > div,
    .nav-item > span:last-child,
    .admin-profile-info {
        display: none;
    }


    .brand {
        justify-content: center;
    }


    .side-navigation {
        margin-top: 45px;
    }


    .nav-item {
        justify-content: center;
    }


    .sidebar-bottom {
        justify-content: center;
    }


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

}


@media (max-width: 680px) {

    .app-shell {
        display: block;
    }


    .sidebar {
        width: 100%;
        height: auto;

        min-height: 0;

        position: static;

        flex-direction: row;

        padding: 15px 18px;

        border-right: 0;

        border-bottom: 1px solid var(--line);
    }


    .side-navigation {
        display: none;
    }


    .sidebar-bottom {
        border: 0;

        padding: 0;
    }


    .admin-profile {
        display: none;
    }


    .main-content {
        padding: 28px 16px;
    }


    .topbar {
        align-items: start;
    }


    .topbar h1 {
        font-size: 30px;
    }


    .catalogue-toolbar {
        align-items: stretch;

        flex-direction: column;
    }


    .toolbar-actions {
        flex-direction: column;
    }


    .search-box,
    .toolbar-actions select {
        width: 100%;
    }


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


    .full-field {
        grid-column: auto;
    }


    .auth-card {
        padding: 30px 24px;
    }

}