:root {
    color-scheme: light;
    font-family: Vazirmatn, Tahoma, sans-serif;
    background: #f5f7f6;
}

* {
    box-sizing: border-box;
}

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

body {
    direction: rtl;
    color: #17332e;
    background: #f5f7f6;
}

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

.boot-loader, .app-loading, .center-page {
    min-height: 100vh;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 1rem;
}

    .boot-loader span, .login-logo {
        width: 64px;
        height: 64px;
        margin: auto;
        display: grid;
        place-items: center;
        border-radius: 20px;
        color: white;
        background: #176b5b;
        font-size: 1.7rem;
        font-weight: 800;
    }

#blazor-error-ui {
    display: none;
    position: fixed;
    inset-inline: 1rem;
    bottom: 1rem;
    padding: 1rem;
    background: #b3261e;
    color: white;
    z-index: 1000;
}

.vendor-shell {
    min-height: 100vh;
    padding-bottom: 84px;
}

.app-header {
    height: 64px;
    padding: 0 max(16px,env(safe-area-inset-left));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #123d36;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .app-header > div {
        display: flex;
        align-items: center;
        gap: .65rem;
    }

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #e09f3e;
    color: #17332e;
    font-weight: 900;
}

.app-content {
    width: min(100%,1100px);
    margin: auto;
    padding: 20px 16px 32px;
}

.bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    height: 72px;
    padding-bottom: env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5,1fr);
    background: white;
    box-shadow: 0 -8px 24px #17332e14;
    z-index: 20;
}

    .bottom-nav a {
        color: #61716d;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-size: .72rem;
    }

        .bottom-nav a.active {
            color: #176b5b;
            font-weight: 700;
        }

    .bottom-nav .primary-action .mud-icon-root {
        background: #176b5b;
        color: white;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        padding: 10px;
        margin-top: -20px;
        box-shadow: 0 5px 15px #176b5b55;
    }

.page-title {
    margin-bottom: 18px !important;
    font-weight: 800 !important;
}

.metric-grid, .account-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
}

.metric-card, .account-card, .profile-section, .pos-card {
    padding: 18px;
    border-radius: 16px !important;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 112px;
}

    .metric-card span {
        color: #667873;
        font-size: .8rem;
    }

    .metric-card strong {
        font-size: 1.15rem;
        color: #176b5b;
    }

.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

    .quick-grid .mud-button-root {
        min-height: 54px;
        border-radius: 13px;
    }

.shop-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.shop-card {
    padding: 16px;
    border-radius: 16px !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shop-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .shop-card-head > div {
        min-width: 0;
    }

    .shop-card-head img {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        object-fit: cover;
    }

.shop-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.empty-shops {
    min-height: 220px;
    padding: 28px;
    border-radius: 18px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
}

.nav-placeholder {
    display: block;
}

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

.account-details {
    display: flex;
    justify-content: space-between;
    color: #667873;
    font-size: .78rem;
}

.list-stack {
    display: grid;
    gap: 10px;
}

.list-card, .order-card {
    padding: 14px 16px;
    border-radius: 14px !important;
}

.list-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .list-card > div {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .list-card small, .shop-row small {
        color: #788783;
    }

.positive {
    color: #157347;
    font-weight: 700;
    direction: ltr;
}

.negative {
    color: #b3261e;
    font-weight: 700;
    direction: ltr;
}

.page-heading {
    display: grid;
    grid-template-columns: 1fr minmax(140px,220px) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.order-card {
    cursor: pointer;
    display: grid;
    gap: 12px;
}

.order-top, .order-meta, .order-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.order-meta {
    color: #667873;
    font-size: .8rem;
}

.order-bottom {
    border-top: 1px solid #edf0ef;
    padding-top: 10px;
    font-size: .82rem;
}

.profile-section {
    margin-bottom: 12px;
}

.shop-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .shop-row > div {
        display: flex;
        flex-direction: column;
    }

.sale-summary {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #edf0ef;
}

    .sale-summary.net {
        color: #176b5b;
    }

.success-receipt {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 20px;
}

.login-page, .empty-layout {
    min-height: 100vh;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 20px;
    background: radial-gradient(circle at top,#dcebe7,#f5f7f6 55%);
}

.login-card {
    width: min(100%,420px);
    border-radius: 22px !important;
}

code {
    direction: ltr;
    display: inline-block;
}

@media (min-width:768px) {
    .vendor-shell {
        padding-bottom: 0;
        padding-inline-start: 92px;
    }

    .bottom-nav {
        inset-inline-start: 0;
        inset-inline-end: auto;
        top: 64px;
        bottom: 0;
        width: 92px;
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5,84px);
        padding-top: 20px;
    }

        .bottom-nav .primary-action .mud-icon-root {
            margin-top: 0;
        }

    .metric-grid {
        grid-template-columns: repeat(4,1fr);
    }

    .account-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .shop-card-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}
