:root {
    --positive-color: #4CAF50; /* Зеленый */
    --negative-color: #F44336; /* Красный */
    --neutral-color: #9E9E9E; /* Серый */
    --background-color: #FAFAFA;
    --border-color: #E0E0E0;
    --font-color: #212121;
}

button {
    margin: 0;
}

h3 {
    padding: 0;
    margin: 0;
}

.button {
    border: none;
    border-radius: 5px;
    background-color: #eeeeee;
    padding: 10px 20px;
    text-decoration: none;
    height: unset;
    color: #000000;
}

.master-body {
    background-color: #FFFFFF;
}


.master-button-link {
    background-color: transparent;
    border: none;
    color: var(--accent-color);
    padding: 0;
    margin: 0;
    font-size: 13px;
}
.master-button-secondary {
    background-color: #f9f9f9;
}
.master-button-primary {
    background-color: var(--color1-4);
    color: #FFFFFF;
}

.sidebar {
    color: white;
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    flex-shrink: 0;
    position: fixed;
    z-index: 2;
    overflow-y: auto;
    top: 0;
    bottom: 0;
    margin: unset;
    height: unset;
    border-radius: unset;
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: -400px;
    }
}


.master-page {
    width: calc(100% - 320px);
    max-width: 1024px;
    margin: auto;
    margin-left: 300px;
    margin-top: 20px;

    /*background-color: #FFFFFF;*/
    /*border: 1px solid #aaaaaa;*/
    border-radius: 10px;
    min-height: 80vh;

    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 768px) {
    .master-page {
        margin:0;
        width: 100%;
        max-width: 100%;
    }
}


.master-page-header {
    color: unset;
    text-decoration: none;

    display: flex;
    gap: 10px;
    align-items: center;
}
.master-page-header h1 {
    font-size: 22px;
}

@media (max-width: 768px) {
    .master-page-header {
        padding: 0 20px;

    }
    .master-page-header h1 {
        font-size: 18px;
    }
}


.master-header {
    width: 100%;
    /*background-color: #edeae8;*/
    padding: 10px;
    /* border: 1px solid #ccc; */
    /* border-radius: 5px; */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;

    display: flex;
    flex-direction: column;
    gap: 10px;
}
.master-header h1 {
    font-size: 22px;
    /*width: 100%;*/
}
.master-header__block {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

}
.master-header__image {
    flex-shrink: 0;
}
.master-header__image-img {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 5px;
}
.master-header__content {
    flex-grow: 1;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.master-header__title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.master-header__title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
}
.master-header__status {
    background: none;
    border: none;
    color: #000000;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.master-header__status-text {
    display: none;
}
.master-header__status-icon {
    display: inline-block;
}

@media (max-width: 768px) {
    .master-header__status-text {
        display: none;
    }

    .master-header__status-icon {
        display: inline-block;
    }

    .master-header__title {
        font-size: 16px;
    }

}

.master-header__price {
    /*margin-top: 5px;*/
    font-size: 16px;
    font-weight: 500;
    color: #555;
}
.master-header__actions {
    display: flex;
    gap: 15px;
}
.master-header__edit-btn,
.master-header__stop-btn {
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}
.master-header__edit-btn {
    background-color: #0275d8;
    color: #fff;
}
.master-header__stop-btn {
    background-color: #d9534f;
    color: #fff;
}


.master-page-period-selector__container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    background-color: var(--color4-1); /* Фон панели */
    border: 1px solid var(--color4-4); /* Рамка панели */
    border-radius: 7px; /* Скругленные края панели */
    overflow: hidden; /* Для обрезки внутренних элементов */
    padding: 0; /* Немного внутреннего отступа */
    width: 100%;
    max-width: 400px;
    margin: auto;
}
.master-page-period-selector__button {
    padding: 5px 7px;
    border-radius: 0;
    font-size: 12px;
    text-align: center;
    border: none;
    background-color: transparent;
    color: var(--color4-5);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex: 1; /* Все кнопки равной ширины */

}
.master-page-period-selector__button:hover {
    background-color: var(--color4-5);
    color: var(--color4-1);
}
.master-page-period-selector__button--active {
    background-color: var(--color4-4); /* Цвет активной кнопки */
    color: white;
    font-weight: bold;
}
.master-page-period-selector__button:first-child {
    border-radius: 5px 0 0 5px; /* Скругленные углы слева */
}
.master-page-period-selector__button:last-child {
    border-radius: 0 5px 5px 0; /* Скругленные углы справа */
}
.master-page-period-selector__button:not(:last-child) {
    border-right: 1px solid var(--color4-4); /* Разделитель между кнопками */
}



.master-chart__raise-panel {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    border: 1px solid var(--color1-4);
    background-color: var(--color1-1);
    padding: 10px;
}

@media (max-width: 768px) {
    .master-chart__raise-panel {
        border:  none;
        border-radius: 0;
        gap: 0;

        flex-direction: column;
    }
}


.master-statistics-container {
    margin: 10px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    /*margin-top: 20px;*/
}
.master-statistics-item {
    /*background: #FFFFFF;*/
    border: 1px solid #666;
    border-radius: 5px;
    padding: 6px;
    width: calc(100% / 4 - 30px);
    text-align: center;
    /*box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);*/
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.master-statistics-item[disabled] {
    /*background: #f0f0f0;*/
    opacity: 0.5;
}
.master-statistics-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    /*gap: 8px;*/
    text-align: left;
}
.master-statistics-current {
    color: #333;
    display: block;
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
}
.master-statistics-change {
    font-size: 14px;
    font-weight: 500;
    display: block;
}
.master-statistics-change.positive {
    color: green;
}
.master-statistics-change.negative {
    color: red;
}
.master-statistics-change.neutral {
    color: gray;
}
.master-statistics-label {
    font-size: 12px;
    color: #888;
    text-align: left;
    font-weight: 500;
    height: 100%;
}
.master-statistics-change--positive {
    color: var(--color4-5);
}
.master-statistics-change--negative {
    color: #FF3000;
}
.master-statistics-change--neutral {
    color: #aaaaaa;
}

@media (max-width: 768px) {
    .master-statistics-container {
        gap: 5px;
    }
    .master-statistics-item {
        width: calc(100% / 3 - 5px);
    }
}



.master-pp-container {
    /*font-family: Arial, sans-serif;*/
    /*border: 1px solid #ccc;*/
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 40px;
}
.master-pp-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    margin-bottom: 5px;
    gap: 10px;
}
.master-pp-info {
    flex-grow: 1;
    margin-left: 10px;
}
.master-pp-name {
    font-weight: bold;
}
.master-pp-name a {
    color: #337ab7;
    font-weight: 600;
}
.master-pp-dish-count {
    margin-left: auto;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    width: 30px;
}
.master-pp-dish-count div:first-child {
    font-size: 20px;
    font-weight: 500;
}
.master-pp-dish-count div:last-child {
    font-size: 8px;
}
.master-pp-group {
    padding: 5px 10px;
}
.master-pp-group:nth-child(odd) {
    background-color: #f6f6f6; /* Светлый фон */
}
.master-pp-group:nth-child(even) {
    background-color: #fbfbfb; /* Белый фон */
}
.master-pp-content {
    /*margin-left: 20px;*/
}
.master-pp-pickup-point {
    border: 1px solid #ddd;
    border-radius: 5px;
    /*padding: 5px;*/
}
.master-pp-group-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    /*margin: 5px 0;*/
    gap: 10px;
    font-size: 11px;
}
.master-pp-group-photo {
    margin-right: 10px;
    border-radius: 5px;
    width: 40px;
    flex-shrink: 0;
}
.master-pp-group-info {
    flex-grow: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}
.master-pp-actions {
    margin: 20px 10px;
}
.master-pp-group-title {
    width: 100%;
}
.master-pp-group-name {
    line-height: 1;
    font-size: 14px;
    height: 14px;
    overflow: hidden;
    font-weight: 500;
}
.master-pp-group-price {
    font-size: 12px;
}
.master-pp-group-dish-count {
    margin-left: auto;
    font-size: 20px;
    font-weight: 500;
    width: 30px;
    flex-shrink: 0;
}
.master-pp-group-status {
    font-size: 10px;
    width: 200px;
    flex-shrink: 0;
    font-weight: 600;
    text-align: right;
}
.master-pp-group-status.important {
    color: #f04e4e;
}
.master-pp-dish-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}
.master-pp-dish-table th, .master-pp-dish-table td {
    /*border: 1px solid #ddd;*/
    padding: 5px;
    text-align: center;
}
.master-pp-dish-table th {
    font-size: 10px;
    color: #777777;
}
.master-pp-dish-table tr.removed {
    text-decoration: line-through;
}
.master-pp-dish-table button {
    font-size: 11px;
    padding: 2px 5px;
}

.master-pp-toolbox-container {
    padding: 0 10px;
}
.master-pp-toolbox-container select {
    max-width: 100%;
    height: 30px;
    border-radius: 5px;
    box-shadow: rgba(0, 0, 0, 0.1) 0 1px 4px;
}

.master-pp-dish-table .mobile {
    display: none;
}
.master-pp-dish-table .desktop {
    /*display: table-row;*/
}

@media (max-width: 768px) {
    .master-pp-header {
        flex-wrap: wrap;
    }
    .master-pp-header i {
        width: 10px;
    }
    .master-pp-header .master-pp-info {
        width: calc(100% - 30px);
    }

    .master-pp-pickup-point {
        border: none;
        border-radius: unset;
        padding: 0;
        border-bottom: 1px solid #bbb;
    }
    .master-pp-actions {
        padding: 0 10px;
        margin: 20px 0;
    }
    .master-pp-group-info {
        display: block;
    }
    .master-pp-group-status {
        width: unset;

    }

    .master-pp-dish-table button {
        font-size: 11px;
        padding: 2px 5px;
        background-color: transparent;
        font-weight: 600;
        border: none;
        color: #265783;
    }

    .master-pp-group {
        padding: 5px 0;
    }

    .master-pp-dish-table tr:nth-child(4n-3),
    .master-pp-dish-table tr:nth-child(4n-2) {
        /*background-color: #f9f9f9;*/
    }

    .master-pp-dish-table tr:nth-child(4n-1),
    .master-pp-dish-table tr:nth-child(4n) {
        /*background-color: #eaeaea;*/
    }
    .master-pp-dish-table tr:nth-child(2n) {
        border-bottom: 1px solid #cccccc;
    }
    .master-pp-dish-table .mobile {
        display: table-row;
    }
    .master-pp-dish-table .mobile button {
        margin-left: 20px;
    }
    .master-pp-dish-table .mobile td {
        text-align: right;
        padding-top: 0;
    }
    .master-pp-dish-table .desktop {
        display: none;
    }
}



.master-pp-add-container {
    /*font-family: Arial, sans-serif;*/
    /*max-width: 600px;*/
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    flex-direction: column;
}
.master-pp-add-highlight {
    background-color: var(--color1-1);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}
.master-pp-add-date {
    margin-bottom: 20px;
}
.master-pp-add-dishes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.master-pp-add-dish {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.master-pp-add-checkbox {
    display: flex;
    align-items: center;
}
.master-pp-add-dish-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}
.master-pp-add-dish-info {
    flex-grow: 1;
}
.master-pp-add-dish-title {
    font-weight: bold;
}
.master-pp-add-dish-price {
    color: #555;
}
.master-pp-add-dish-quantity {
    display: flex;
    align-items: center;
    /*gap: 5px;*/
}
.master-pp-add-quantity-decrease,
.master-pp-add-quantity-increase {
    margin: 0;
    height: 40px;
    border: none;
    border-radius: 0;
    width: 30px;
    padding: 0;
}
.master-pp-add-submit {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.master-pp-add-submit:hover {
    background-color: #0056b3;
}
.master-pp-add-quantity {
    text-align: center;
    font-size: 14px;
    padding: 2px;
    width: 40px;
    font-weight: bold;
    border: none;
    border-radius: 0;
    border-top: 1px solid #dddddd;
    border-bottom: 1px solid #dddddd;
}

@media (max-width: 768px) {
    .master-pp-add-container {
        border: none;
        padding: 10px;
    }
}


.master-pp-flow {
    font-family: Arial, sans-serif;
    /*max-width: 600px;*/
    margin: 20px auto;
    width: 100%;
}

.master-pp-flow__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--color4-5);
    color: #fff;
    border-radius: 8px 8px 0 0;
}

.master-pp-flow__header h3 {
    margin: 0;
    font-size: 16px;
}

.master-pp-flow__header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.master-pp-flow-content {
    padding: 15px;
    display: none; /* Скрыто по умолчанию, регулируется JS */
    border: 1px solid var(--color4-5);
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-weight: 500;
}

.master-pp-flow-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.master-pp-flow-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--color4-5); /* Основной цвет для кружков */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.master-pp-flow-number.special {
    background-color: var(--color1-4);
}
.master-pp-flow-number.empty {
    background-color: transparent;
}

.master-pp-flow-text {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.master-pp-flow-text strong {
    color: #d9534f;
}

@media (max-width: 768px) {
    .master-pp-flow {
        padding: 0 10px;
        margin: 0;
    }

    .master-pp-flow__header h3 {
        font-size: 14px;
    }

    .master-pp-flow-step {
        /*flex-direction: column;*/
        gap: 10px;
    }

    .master-pp-flow-number {
        margin-bottom: 5px;
    }
}


/*   MASTER - CHECKOUT   */

.master-checkout-container {
    max-width: 100%;
    width: 800px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f9f9f9;
}
.master-checkout-header {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}
.master-checkout-row {
    /*margin-bottom: 15px;*/
    display: flex;
    gap: 20px;
    justify-items: center;
    align-items: baseline;
}
.master-checkout-label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    /*min-width: 100px;*/
    flex-shrink: 0;
}
.master-checkout-input {
    width: 100%;
    /*padding: 10px;*/
    border: none;
    border-radius: 5px;
    line-height: unset;
    padding: 0;
    margin: 0;
    font-weight: 600;
    background-color: transparent;
}
.master-checkout-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #FFFFFF;
}
.master-checkout-table th,
.master-checkout-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}
.master-checkout-summary {
    margin-top: 20px;
    text-align: right;
    font-size: 18px;
    font-weight: bold;
}
.master-checkout-summary span {
    display: inline-block;
    min-width: 120px;
    text-align: left;
}
.master-checkout-button {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 18px;
    color: #fff;
    background-color: var(--color1-4);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}
.master-checkout-button:hover {
    background-color: #0056b3;
}
.master-checkout-button-back {
    margin-top: 10px;
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}
.master-checkout-agreement {
    margin: 15px 0;
}
.master-checkout-success-box {
    background-color: var(--color1-1);
    border-radius: 20px;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid var(--color1-2);
}


.promotion-invoice-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.promotion-invoice-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.promotion-invoice-text {
    white-space: pre-line;
    font-size: 14px;
    color: #333;
}

.promotion-invoice-close-button {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.promotion-invoice-close-button:hover {
    background: #0056b3;
}



/*   PRO   */

.master-header-solo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}
.master-header-solo .back-button {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #007bff;
    margin-bottom: 12px;
    font-size: 16px;
}
.master-header-solo .back-button i {
    margin-right: 8px;
}
.master-header-solo .header-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #333;
}
.master-header-solo .section-toggle {
    display: flex;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
}
.master-header-solo .toggle-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}
.master-header-solo .toggle-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}
.master-header-solo .toggle-btn:hover {
    background-color: #0056b3;
    color: #fff;
}





