:root {
    --cream: #f8f2e8;
    --paper: #fffdf9;
    --ink: #291a14;
    --muted: #796c65;
    --brown: #6d3b24;
    --orange: #de6e34;
    --gold: #eebc66;
    --green: #3d795b;
    --red: #c9584d;
    --line: #eadfd3;
    --shadow: 0 16px 45px rgba(72, 43, 28, .09);
    font-family: DM Sans, sans-serif;
    color: var(--ink);
    background: var(--cream)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #fbf6ee, #f4eadc)
}

button,
input,
select {
    font: inherit
}

.shell {
    min-height: 100vh;
    max-width: 1440px;
    margin: auto
}

.sidebar {
    display: none
}

.main {
    padding: 24px 22px 104px
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px
}

.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .13em;
    color: var(--orange);
    font-weight: 700
}

.title {
    font-family: Playfair Display, serif;
    font-size: 29px;
    line-height: 1.05;
    margin: 4px 0
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: var(--brown);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: Playfair Display;
    font-weight: 800
}

.hero {
    background: var(--brown);
    color: #fff;
    border-radius: 26px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.hero:after {
    content: "✦";
    position: absolute;
    right: 16px;
    top: -24px;
    font-size: 116px;
    color: #ffffff0f
}

.hero p {
    color: #e8d7cb;
    margin: 6px 0 20px
}

.hero strong {
    font-family: Playfair Display;
    font-size: 37px
}

.hero .trend {
    display: inline-block;
    margin-left: 10px;
    background: #3f795b;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 12px
}

.quick {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0 25px
}

.quick button {
    border: 0;
    background: var(--paper);
    padding: 16px 12px;
    border-radius: 18px;
    text-align: left;
    box-shadow: var(--shadow);
    font-weight: 700;
    color: var(--ink);
    cursor: pointer
}

.quick i {
    display: block;
    font-style: normal;
    font-size: 20px;
    margin-bottom: 7px
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 12px
}

.section-head h2 {
    font-family: Playfair Display;
    font-size: 21px;
    margin: 0
}

.section-head button,
.link {
    border: 0;
    background: none;
    color: var(--orange);
    font-weight: 700;
    cursor: pointer
}

.metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px
}

.card {
    background: var(--paper);
    border: 1px solid rgba(234, 223, 211, .8);
    border-radius: 20px;
    padding: 17px;
    box-shadow: 0 8px 30px #482b1c0d
}

.metric span {
    color: var(--muted);
    font-size: 12px
}

.metric strong {
    display: block;
    font-size: 21px;
    margin: 6px 0
}

.metric small {
    color: var(--green)
}

.list {
    display: flex;
    flex-direction: column;
    gap: 9px
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--paper);
    padding: 13px;
    border-radius: 17px;
    border: 1px solid var(--line)
}

.iconbox {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: #f6e5d7;
    display: grid;
    place-items: center;
    font-size: 19px;
    flex: none
}

.row-main {
    min-width: 0;
    flex: 1
}

.row-main strong,
.row-main span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.row-main span,
.sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px
}

.amount {
    text-align: right;
    font-weight: 700
}

.amount small {
    display: block;
    color: var(--muted);
    font-weight: 400
}

.badge {
    font-size: 11px;
    border-radius: 20px;
    padding: 5px 8px;
    background: #e5f1e9;
    color: var(--green);
    font-weight: 700
}

.badge.danger {
    background: #fae5e1;
    color: var(--red)
}

.progress {
    height: 7px;
    background: #eee4da;
    border-radius: 20px;
    margin-top: 9px;
    overflow: hidden
}

.progress div {
    height: 100%;
    background: var(--orange);
    border-radius: 20px
}

.page-head {
    margin-bottom: 20px
}

.page-head p {
    margin: 6px 0;
    color: var(--muted)
}

.fab {
    position: fixed;
    right: 22px;
    bottom: 84px;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 19px;
    background: var(--orange);
    color: #fff;
    font-size: 29px;
    box-shadow: 0 10px 25px #de6e3459;
    z-index: 5;
    cursor: pointer
}

.bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    padding: 6px max(11px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom));
    display: flex;
    background: #fffdf9f0;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 10
}

.bottom button {
    flex: 1;
    border: 0;
    background: transparent;
    color: #94867e;
    font-size: 10px;
    font-weight: 600
}

.bottom button b {
    display: block;
    font-size: 20px;
    margin-bottom: 2px
}

.bottom button.active {
    color: var(--orange)
}

.form-grid {
    display: grid;
    gap: 13px
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--muted)
}

.field input,
.field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 12px;
    background: #fff;
    color: var(--ink);
    outline: none
}

.field input:focus,
.field select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px #de6e341f
}

.modal-wrap {
    position: fixed;
    inset: 0;
    background: #21140f7a;
    z-index: 50;
    display: flex;
    align-items: flex-end
}

.modal {
    background: var(--paper);
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    border-radius: 28px 28px 0 0;
    padding: 23px
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px
}

.modal h2 {
    font-family: Playfair Display;
    margin: 0
}

.close {
    border: 0;
    background: #eee5db;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px
}

.primary {
    border: 0;
    background: var(--orange);
    color: #fff;
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 700;
    width: 100%;
    margin-top: 16px;
    cursor: pointer
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px
}

.chart {
    height: 150px;
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding-top: 20px
}

.bar {
    flex: 1;
    background: linear-gradient(var(--gold), var(--orange));
    border-radius: 8px 8px 3px 3px;
    min-height: 12px;
    position: relative
}

.bar span {
    position: absolute;
    bottom: -20px;
    font-size: 10px;
    color: var(--muted);
    left: 50%;
    transform: translate(-50%)
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translate(-50%, 20px);
    background: #21140f;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: .25s;
    z-index: 99;
    white-space: nowrap
}

#toast.show {
    opacity: 1;
    transform: translate(-50%)
}

.filters {
    display: flex;
    gap: 8px;
    overflow: auto;
    margin-bottom: 15px
}

.filters button {
    white-space: nowrap;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 8px 12px;
    border-radius: 20px;
    color: var(--muted)
}

.filters button.active {
    background: var(--brown);
    border-color: var(--brown);
    color: #fff
}

.total-line {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 12px;
    font-weight: 700
}

@media(min-width:800px) {
    .shell {
        display: grid;
        grid-template-columns: 240px 1fr
    }

    .sidebar {
        display: flex;
        position: sticky;
        top: 0;
        height: 100vh;
        background: var(--brown);
        color: #fff;
        padding: 30px 20px;
        flex-direction: column
    }

    .brand {
        font-family: Playfair Display;
        font-size: 24px;
        line-height: 1.05;
        margin-bottom: 42px
    }

    .brand small {
        display: block;
        font-family: DM Sans;
        font-size: 9px;
        letter-spacing: .2em;
        color: var(--gold);
        margin-bottom: 6px
    }

    .side-nav {
        display: flex;
        flex-direction: column;
        gap: 8px
    }

    .side-nav button {
        border: 0;
        background: transparent;
        color: #d6c1b5;
        text-align: left;
        border-radius: 13px;
        padding: 12px;
        font-weight: 600
    }

    .side-nav button.active {
        background: #ffffff1f;
        color: #fff
    }

    .main {
        padding: 35px 45px 50px;
        max-width: 1100px;
        width: 100%;
        margin: auto
    }

    .bottom {
        display: none
    }

    .fab {
        bottom: 30px;
        right: 35px
    }

    .dashboard-grid {
        display: grid;
        grid-template-columns: 1.15fr .85fr;
        gap: 18px
    }

    .hero {
        grid-row: span 2
    }

    .quick,
    .metrics {
        grid-template-columns: repeat(4, 1fr)
    }

    .modal-wrap {
        align-items: center;
        justify-content: center
    }

    .modal {
        width: 520px;
        border-radius: 25px;
        max-height: 85vh
    }

    .form-grid.two {
        grid-template-columns: 1fr 1fr
    }

    .inventory-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px
    }
}

.baked-stock-card {
    min-height: 300px;
    display: flex;
    flex-direction: column
}

.baked-stock-card:after {
    content: "♨";
    top: -15px;
    right: 20px
}

.baked-stock-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    z-index: 1
}

.baked-stock-card .eyebrow {
    color: var(--gold)
}

.baked-stock-card .baked-stock-head p {
    margin: 6px 0 0
}

.baked-stock-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 20px 0 14px;
    position: relative;
    z-index: 1
}

.baked-stock-total span {
    color: #e8d7cb;
    font-size: 12px
}

.baked-stock-list {
    display: grid;
    gap: 7px;
    position: relative;
    z-index: 1;
    overflow: auto
}

.baked-stock-item {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 9px
}

.baked-stock-add-card {
    min-width: 0;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, .12);
    background: #ffffff1f;
    color: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer
}

.baked-stock-add-card span,
.baked-stock-add-card small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.baked-stock-add-card span {
    font-size: 13px;
    font-weight: 700
}

.baked-stock-add-card small {
    margin-top: 3px;
    color: #e8d7cb;
    font-size: 10px
}

.baked-stock-add-card:active {
    transform: scale(.985)
}

.baked-stock-item b {
    font-size: 18px;
    color: var(--gold)
}

.baked-stock-empty {
    font-size: 12px;
    color: #e8d7cb
}

.baked-stock-help {
    margin: 0 0 3px
}

.baked-stock-field label {
    color: var(--ink);
    font-size: 13px
}

.baked-stock-quantity {
    min-width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: none;
    background: #ffffff14;
    border-radius: 12px;
    padding: 6px
}

.baked-stock-quantity .baked-stock-edit {
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: underline;
    cursor: pointer;
    padding: 2px 4px
}

.baked-stock-quantity .baked-stock-edit:active {
    transform: scale(.96)
}

.baked-stock-conversion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5eadf;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 11px 13px
}

.baked-stock-conversion span {
    font-size: 12px;
    color: var(--muted)
}

.baked-stock-conversion strong {
    font-size: 18px;
    color: var(--brown)
}

.home-stock-summary {
    margin-bottom: 25px
}

.home-sales-chart {
    margin-top: 25px
}

@media(min-width:800px) {
    .baked-stock-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 165px
    }
}

.bottom button {
    min-width: 0;
    padding-left: 1px;
    padding-right: 1px;
    font-size: 9px
}

.bottom button b {
    font-size: 18px
}

.client-profile-link {
    display: block;
    max-width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--brown);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px
}

.client-profile-link:hover {
    color: var(--orange)
}

.client-profile-back {
    border: 0;
    background: transparent;
    color: var(--orange);
    font-weight: 800;
    padding: 0;
    margin: 0 0 16px;
    cursor: pointer
}

.client-profile-card {
    max-width: 820px
}

.client-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line)
}

.client-profile-identity {
    display: flex;
    align-items: center;
    gap: 12px
}

.client-profile-identity h2 {
    font-family: Playfair Display, serif;
    font-size: 27px;
    margin: 3px 0 0
}

.client-profile-edit {
    border: 0;
    border-radius: 12px;
    background: #f6e5d7;
    color: var(--brown);
    padding: 10px 13px;
    font-weight: 800;
    cursor: pointer
}

.client-profile-addresses {
    margin-top: 18px
}

.client-profile-addresses h3 {
    font-family: Playfair Display, serif;
    margin: 0 0 10px
}

.client-profile-addresses>div {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    background: #fbf5ed;
    border-radius: 12px;
    margin-top: 7px
}

.client-profile-addresses span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em
}

.client-profile-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 18px 0 22px
}

.client-order-count {
    color: var(--muted);
    font-size: 12px
}

.client-order-history .sale-address-text {
    font-weight: 600
}

.client-order-history .amount small {
    white-space: nowrap
}

@media(max-width:620px) {
    .client-profile-head {
        align-items: flex-start
    }

    .client-profile-edit {
        font-size: 0
    }

    .client-profile-edit:first-letter {
        font-size: 18px
    }

    .client-profile-metrics {
        grid-template-columns: 1fr 1fr
    }

    .client-profile-metrics .metric:last-child {
        grid-column: 1/-1
    }
}

.date-group-title {
    font-family: Playfair Display, serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--brown);
    margin: 20px 2px 5px;
    padding-top: 14px;
    border-top: 1px solid var(--line)
}

.date-group-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0
}

.sale-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.delete-sale {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: #fae5e1;
    color: var(--red);
    font-size: 17px;
    cursor: pointer
}

.delete-sale:hover {
    background: #f3d2cc
}

.recipe-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px
}

.recipe-actions button {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 10px;
    font-weight: 700;
    cursor: pointer
}

.edit-recipe {
    background: #f6e5d7;
    color: var(--brown)
}

.delete-recipe {
    background: #fae5e1;
    color: var(--red)
}

.duplicate-recipe {
    background: #e5f1e9 !important;
    color: var(--green) !important
}

.sale-line {
    display: grid;
    grid-template-columns: 1fr 90px 28px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    background: #fbf5ed;
    border-radius: 15px
}

.sale-line .remove-sale-line {
    width: 28px;
    height: 40px;
    border: 0;
    border-radius: 9px;
    background: #fae5e1;
    color: var(--red);
    font-size: 18px;
    cursor: pointer
}

.add-sale-line {
    width: 100%;
    border: 1px dashed var(--orange);
    background: #fff7ef;
    color: var(--orange);
    border-radius: 13px;
    padding: 11px;
    font-weight: 700;
    cursor: pointer
}

.order-products {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px
}

.sale-product-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px
}

.sale-product-label>label {
    margin: 0
}

.sale-line-options {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px
}

.special-price-toggle,
.loyalty-card-toggle-label {
    display: flex !important;
    align-items: center;
    gap: 5px;
    margin: 0 !important;
    color: var(--orange) !important;
    font-size: 10px !important;
    cursor: pointer;
    white-space: nowrap
}

.special-price-toggle input,
.loyalty-card-toggle-label input {
    appearance: none;
    width: 18px !important;
    height: 18px;
    margin: 0;
    padding: 0 !important;
    border: 1.5px solid var(--orange) !important;
    border-radius: 5px !important;
    background: #fff !important;
    display: grid;
    place-items: center;
    cursor: pointer
}

.loyalty-card-toggle-label {
    color: var(--green) !important
}

.loyalty-card-toggle-label input {
    border-color: var(--green) !important
}

.special-price-toggle input:checked {
    background: var(--orange) !important
}

.loyalty-card-toggle-label input:checked {
    background: var(--green) !important
}

.special-price-toggle input:checked:after,
.loyalty-card-toggle-label input:checked:after {
    content: "✓";
    color: #fff;
    font-size: 12px;
    font-weight: 800
}

.sale-line.custom-price-active {
    box-shadow: inset 0 0 0 1.5px var(--orange);
    background: #fff7ef
}

.sale-line.loyalty-active {
    box-shadow: inset 0 0 0 1.5px var(--green);
    background: #f1f8f3
}

.sale-order-total.custom {
    outline: 1px solid rgba(222, 110, 52, .35)
}

.sale-order-total.loyalty {
    outline: 1px solid rgba(61, 121, 91, .35);
    background: #e5f1e9;
    color: var(--green)
}

@media(max-width:520px) {
    .sale-product-label {
        align-items: flex-start;
        flex-direction: column
    }

    .sale-line-options {
        width: 100%;
        justify-content: flex-start;
        gap: 12px
    }

    .special-price-toggle,
    .loyalty-card-toggle-label {
        font-size: 9px !important
    }
}

.price-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: #21140f94;
    display: grid;
    place-items: center;
    padding: 20px
}

.price-popup {
    width: min(100%, 390px);
    background: var(--paper);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 22px 70px #21140f4d
}

.price-popup h3 {
    font-family: Playfair Display, serif;
    font-size: 24px;
    margin: 0 0 8px
}

.price-popup p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 18px
}

.price-popup-actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 9px;
    margin-top: 15px
}

.price-popup-actions button {
    border: 0;
    border-radius: 13px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer
}

.price-popup-cancel {
    background: #eee5db;
    color: var(--ink)
}

.price-popup-apply {
    background: var(--orange);
    color: #fff
}

.sale-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px;
    border-radius: 14px;
    background: #e5f1e9;
    color: var(--green)
}

.sale-order-total span {
    font-size: 12px
}

.sale-order-total strong {
    font-size: 20px
}

.sale-order-total.combo {
    background: #fff0d7;
    color: #9a541e
}

.sale-detail-link {
    display: block;
    max-width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--brown);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px
}

.sale-detail-link:hover {
    color: var(--orange)
}

.row-main .sale-address-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    color: var(--brown);
    font-weight: 700;
    margin-top: 5px
}

.sale-detail-back {
    border: 0;
    background: transparent;
    color: var(--orange);
    font-weight: 800;
    padding: 0;
    margin: 0 0 16px;
    cursor: pointer
}

.sale-detail-card {
    max-width: 760px
}

.sale-detail-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line)
}

.sale-detail-title h2 {
    font-family: Playfair Display, serif;
    font-size: 26px;
    margin: 5px 0 0
}

.sale-detail-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px
}

.sale-detail-actions>strong {
    font-size: 22px;
    color: var(--green)
}

.sale-detail-actions button {
    border: 0;
    border-radius: 12px;
    background: #f6e5d7;
    color: var(--brown);
    padding: 9px 12px;
    font-weight: 800;
    cursor: pointer
}

.sale-detail-actions button:hover {
    background: #eed5c2
}

.sale-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 17px 0 22px
}

.sale-detail-grid>div {
    background: #fbf5ed;
    border-radius: 13px;
    padding: 12px
}

.sale-detail-grid span,
.sale-detail-item span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 4px
}

.sale-detail-grid .wide {
    grid-column: 1/-1
}

.sale-detail-card h3 {
    font-family: Playfair Display, serif;
    margin: 0 0 10px
}

.sale-detail-items {
    display: grid;
    gap: 8px
}

.sale-detail-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px
}

.sale-detail-item>div:last-child {
    text-align: right
}

.sale-detail-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line)
}

.sale-detail-total strong {
    font-size: 22px;
    color: var(--green)
}

.edit-sale-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px
}

.edit-sale-status label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fbf5ed;
    border-radius: 13px;
    padding: 12px;
    color: var(--brown);
    font-size: 12px;
    font-weight: 700
}

.edit-sale-status input {
    width: 18px;
    height: 18px;
    accent-color: var(--green)
}

@media(max-width:430px) {

    .sale-detail-grid,
    .edit-sale-status {
        grid-template-columns: 1fr
    }

    .sale-detail-grid .wide {
        grid-column: auto
    }

    .sale-detail-title h2 {
        font-size: 22px
    }

    .sale-detail-actions>strong {
        font-size: 18px
    }

    .sale-detail-actions button span {
        display: none
    }
}

.production-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    padding: 5px;
    background: #efe4d8;
    border-radius: 16px
}

.production-tabs button {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 11px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer
}

.production-tabs button.active {
    background: var(--paper);
    color: var(--brown);
    box-shadow: 0 4px 14px #482b1c14
}

.unit-cost {
    color: var(--orange);
    font-weight: 700
}

.product-tools {
    display: flex;
    gap: 6px
}

.product-tools button {
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer
}

.product-tools .edit {
    background: #f6e5d7;
    color: var(--brown)
}

.product-tools .remove {
    background: #fae5e1;
    color: var(--red)
}

.drag-handle {
    flex: none;
    color: #aa9990;
    font-size: 20px;
    letter-spacing: -5px;
    padding: 10px 8px 10px 2px;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none
}

.drag-handle:active {
    cursor: grabbing
}

.sortable-product {
    transition: transform .16s, opacity .16s
}

.sortable-product.dragging {
    opacity: .45;
    border: 2px dashed var(--orange)
}

.add-recipe-item {
    border: 1px dashed var(--orange);
    background: #fff7ef;
    color: var(--orange);
    border-radius: 13px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%
}

.recipe-item {
    position: relative;
    padding: 12px;
    background: #fbf5ed;
    border-radius: 15px
}

.remove-recipe-item {
    position: absolute;
    right: -6px;
    top: -7px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    cursor: pointer
}

.add-preparation-item {
    border: 1px dashed var(--orange);
    background: #fff7ef;
    color: var(--orange);
    border-radius: 13px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%
}

.preparation-item {
    position: relative;
    padding: 12px;
    background: #fbf5ed;
    border-radius: 15px
}

.remove-preparation-item {
    position: absolute;
    right: -6px;
    top: -7px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    cursor: pointer
}

.delete-ready-product {
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: #fae5e1;
    color: var(--red);
    font-size: 17px;
    cursor: pointer
}

.delete-ready-product:hover {
    background: #f3d2cc
}

.edit-ready-product {
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: #f6e5d7;
    color: var(--brown);
    font-size: 16px;
    cursor: pointer
}

.edit-ready-product:hover {
    background: #eed5c2
}

.ready-product-tools {
    display: flex;
    gap: 6px;
    flex: none
}

.set-ready-units {
    flex: none;
    min-width: 42px;
    height: 34px;
    padding: 0 7px;
    border: 0;
    border-radius: 11px;
    background: #fff0d7;
    color: #a75a1e;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer
}

.set-ready-units:hover {
    background: #f8dfb9
}

.production-picker {
    display: flex;
    flex-direction: column;
    gap: 9px
}

.production-picker .row button {
    border: 0;
    border-radius: 11px;
    padding: 9px 12px;
    background: var(--orange);
    color: #fff;
    font-weight: 700;
    cursor: pointer
}

.production-picker .row button:disabled {
    background: #e7ddd3;
    color: #998b83
}

.picker-note {
    color: var(--muted);
    font-size: 13px;
    margin: -5px 0 14px
}

.delete-movement {
    flex: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: #fae5e1;
    color: var(--red);
    font-size: 17px;
    cursor: pointer
}

.delete-movement:hover {
    background: #f3d2cc
}

.chart .bar em {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%);
    font-style: normal;
    font-size: 9px;
    font-weight: 700;
    color: var(--brown);
    white-space: nowrap
}

.chart .bar.zero {
    opacity: .22;
    min-height: 2px !important
}

.client-addresses span {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.4
}

.client-tools {
    display: flex;
    gap: 6px;
    flex: none
}

.client-tools button {
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-weight: 800;
    cursor: pointer
}

.client-tools .edit {
    background: #f6e5d7;
    color: var(--brown)
}

.client-tools .remove {
    background: #fae5e1;
    color: var(--red)
}

.client-address-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.client-address-label label {
    margin-bottom: 6px
}

.remove-client-address {
    border: 0;
    background: #fae5e1;
    color: var(--red);
    width: 27px;
    height: 27px;
    border-radius: 9px;
    font-weight: 800;
    cursor: pointer
}

.add-client-address {
    border: 1px dashed var(--orange);
    background: #fff7ef;
    color: var(--orange);
    border-radius: 13px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%
}

@media(max-width:430px) {
    .client-row {
        align-items: flex-start
    }

    .client-tools {
        flex-direction: column
    }

    .client-tools button {
        width: 32px;
        height: 32px
    }
}

.field:has(.client-suggestions) {
    position: relative
}

.client-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 12;
    margin-top: 5px;
    padding: 6px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 15px 36px #482b1c2e;
    max-height: 230px;
    overflow: auto
}

.client-suggestions[hidden] {
    display: none
}

.client-suggestions button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 10px;
    text-align: left;
    color: var(--ink);
    cursor: pointer
}

.client-suggestions button:hover,
.client-suggestions button:focus {
    background: #f6e5d7
}

.client-suggestions button strong,
.client-suggestions button span {
    display: block
}

.client-suggestions button span {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap
}

.client-address-choices {
    display: grid;
    gap: 8px
}

.client-address-choices button {
    border: 1px solid var(--line);
    background: #fbf5ed;
    border-radius: 13px;
    padding: 12px;
    text-align: left;
    color: var(--ink);
    cursor: pointer
}

.client-address-choices button:hover {
    border-color: var(--orange);
    background: #fff7ef
}

.client-address-choices span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--orange);
    font-weight: 800;
    margin-bottom: 4px
}

.client-address-choices strong {
    display: block;
    line-height: 1.35
}

.client-address-cancel {
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 13px;
    padding: 11px;
    background: #eee5db;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer
}

.sale-submit-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 9px;
    margin-top: 16px
}

.sale-submit-actions .primary {
    margin: 0
}

.save-client-toggle {
    width: 54px;
    height: 50px;
    border: 0;
    border-radius: 14px;
    background: #2484d8;
    color: #fff;
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 20px #2484d840
}

.save-client-toggle span,
.save-client-toggle b {
    font-size: 16px
}

.save-client-toggle.active {
    background: #1267b2;
    box-shadow: 0 0 0 3px #2484d833, 0 8px 20px #2484d84d
}

.save-client-note {
    margin-top: -7px;
    text-align: right;
    color: #4d81aa;
    font-size: 10px;
    font-weight: 700
}

.order-statuses {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none
}

.status-check {
    width: 34px;
    height: 44px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.status-check span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1
}

.status-check b {
    width: 17px;
    height: 17px;
    margin-top: 4px;
    border: 2px solid #cdbeb4;
    border-radius: 5px;
    color: transparent;
    font-size: 12px;
    line-height: 13px
}

.status-check.checked {
    background: #e5f1e9;
    border-color: #b9d7c5;
    color: var(--green)
}

.status-check.checked b {
    background: var(--green);
    border-color: var(--green);
    color: #fff
}

.status-check.delivery.checked {
    background: #fff0d7;
    border-color: #efd29f;
    color: #98531e
}

.status-check.delivery.checked b {
    background: #b96a2f;
    border-color: #b96a2f;
    color: #fff
}

@media(max-width:420px) {
    .order-statuses {
        gap: 4px
    }

    .status-check {
        width: 31px
    }

    .recent-order .iconbox {
        display: none
    }
}

.cloud-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, #fff8ee, #f1e3d2)
}

.cloud-panel {
    width: min(430px, 100%);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--shadow)
}

.cloud-brand {
    font-family: Playfair Display, serif;
    font-size: 30px;
    color: var(--brown);
    margin: 3px 0 8px
}

.cloud-panel>p {
    color: var(--muted);
    margin: 0 0 24px;
    line-height: 1.5
}

.cloud-panel form {
    display: grid;
    gap: 14px
}

.cloud-panel .primary {
    margin-top: 4px
}

.cloud-link {
    border: 0;
    background: transparent;
    color: var(--orange);
    font-weight: 700;
    cursor: pointer;
    padding: 10px;
    width: 100%
}

.cloud-error {
    display: none;
    background: #fae5e1;
    color: var(--red);
    border-radius: 12px;
    padding: 11px;
    font-size: 13px
}

.cloud-error.show {
    display: block
}

.cloud-choice {
    display: grid;
    gap: 11px
}

.cloud-choice button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    text-align: left;
    color: var(--ink);
    cursor: pointer
}

.cloud-choice button strong,
.cloud-choice button span {
    display: block
}

.cloud-choice button span {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px
}

.cloud-choice button.recommended {
    border-color: var(--orange);
    background: #fff8ef
}

.cloud-user {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 20;
    border: 1px solid var(--line);
    background: #fffdf9eb;
    color: var(--brown);
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px)
}

.cloud-sync {
    position: fixed;
    right: 16px;
    bottom: 82px;
    z-index: 20;
    background: var(--brown);
    color: #fff;
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 10px;
    opacity: 0;
    transform: translateY(5px);
    transition: .2s;
    pointer-events: none
}

.cloud-sync.show {
    opacity: 1;
    transform: none
}

@media(min-width:800px) {
    .cloud-user {
        top: 18px;
        right: 20px
    }

    .cloud-sync {
        bottom: 24px
    }
}

.install-app {
    position: fixed;
    right: 16px;
    top: max(16px, env(safe-area-inset-top));
    z-index: 45;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 16px;
    background: #6d3b24;
    color: #fff;
    padding: 10px 14px;
    box-shadow: 0 10px 28px #482b1c40;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer
}

.install-app span {
    font-size: 19px
}

.install-app b {
    font-size: 12px
}

@media(min-width:900px) {
    .install-app {
        right: 24px;
        top: 20px
    }
}

@media(display-mode:standalone) {
    .install-app {
        display: none
    }
}

.nav-order-count {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    margin-left: 6px;
    place-items: center;
    border-radius: 20px;
    background: var(--orange);
    color: #fff;
    font-size: 10px
}

.online-orders-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: 17px;
    background: var(--paper);
    border: 1px solid var(--line)
}

.online-orders-toolbar>div {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-right: auto
}

.online-orders-toolbar>div strong {
    font-size: 24px;
    color: var(--orange)
}

.online-orders-toolbar>div span {
    font-size: 12px;
    color: var(--muted)
}

.online-orders-toolbar button {
    border: 0;
    border-radius: 11px;
    padding: 9px 11px;
    background: #f6e5d7;
    color: var(--brown);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer
}

.online-order {
    padding: 18px
}

.online-order.pending {
    border-left: 5px solid var(--orange)
}

.online-order.confirmed {
    border-left: 5px solid var(--green);
    opacity: .82
}

.online-order.on_the_way {
    border-left: 5px solid #3973a8
}

.online-order.cancelled {
    border-left: 5px solid var(--red);
    opacity: .62
}

.online-order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line)
}

.online-order-head h2 {
    font-family: Playfair Display, serif;
    font-size: 23px;
    margin: 3px 0 0
}

.online-order-code {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--orange)
}

.online-order-status {
    flex: none;
    border-radius: 20px;
    padding: 6px 9px;
    background: #fff0d7;
    color: #9a541e;
    font-size: 10px;
    font-weight: 800
}

.confirmed .online-order-status {
    background: #e5f1e9;
    color: var(--green)
}

.on_the_way .online-order-status {
    background: #e2effb;
    color: #285f91
}

.cancelled .online-order-status {
    background: #fae5e1;
    color: var(--red)
}

.online-order-products {
    margin: 13px 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: #fbf5ed;
    color: var(--brown);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45
}

.online-order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.online-order-grid>div {
    padding: 9px 10px;
    border-radius: 11px;
    background: #fffaf4
}

.online-order-grid .wide {
    grid-column: 1/-1
}

.online-order-grid span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em
}

.online-order-grid strong {
    display: block;
    font-size: 12px;
    line-height: 1.4
}

.online-order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--line)
}

.online-order-footer>strong {
    font-size: 22px;
    color: var(--green)
}

.online-order-footer>div {
    display: flex;
    gap: 7px
}

.online-order-footer button {
    border: 0;
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer
}

.online-order-footer button:disabled {
    opacity: .45;
    cursor: not-allowed
}

.online-order-paid {
    background: #dcefe5;
    color: var(--green)
}

.online-order-cancel,
.online-order-remove {
    background: #fae5e1;
    color: var(--red)
}

.online-order-confirm {
    background: var(--green);
    color: #fff
}

.online-order-dispatch {
    background: #3973a8;
    color: #fff
}

@media(max-width:560px) {
    .online-orders-toolbar {
        flex-wrap: wrap
    }

    .online-orders-toolbar>div {
        width: 100%
    }

    .online-order-grid {
        grid-template-columns: 1fr
    }

    .online-order-grid .wide {
        grid-column: auto
    }

    .online-order-footer {
        align-items: flex-end
    }

    .online-order-footer>div {
        flex-direction: column-reverse
    }

    .online-order-footer button {
        padding: 9px 10px
    }

    .bottom button {
        font-size: 8px
    }

    .bottom button b {
        font-size: 16px
    }
}
.unip-product{display:grid;grid-template-columns:1fr 100px 120px;gap:12px;align-items:center;border-bottom:1px solid #ddd;padding:10px 0}.unip-product .field{min-width:0}.unip-product input{width:100%}@media(max-width:540px){.unip-product{grid-template-columns:1fr 1fr}.unip-product>strong{grid-column:1/-1}}
