/* ===========================
   ÁÀÇÎÂ² ÑÒÈË² ÒÀ ÒÅÊÑÒ
   =========================== */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

code {
    color: #c02d76;
}

/* ===========================
   ÊÍÎÏÊÈ
   =========================== */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button.btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Êíîïêà çá³ëüøåííÿ ïðîäóêö³¿*/
.btn-increase {
    background-color: #28a745;
    color: white;
    border: none;
    touch-action: manipulation; /*çàïîá³ãàííÿ çóìó ïðè äàáë-êë³ê³*/
}

    .btn-increase:hover {
        background-color: #218838;
    }

/* Êíîïêà çìåíøåííÿ ïðîäóêö³¿*/
.btn-decrease {
    background-color: #dc3545;
    color: white;
    border: none;
    touch-action: manipulation; /*çàïîá³ãàííÿ çóìó ïðè äàáë-êë³ê³*/
}

    .btn-decrease:hover {
        background-color: #c82333;
    }

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ===========================
   ÊÍÎÏÊÈ Ä²É
   =========================== */
.sync-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s ease;
}

    .sync-button:hover {
        background-color: #0056b3;
    }

.add-order-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

    .add-order-btn:hover {
        background: linear-gradient(135deg, #66BB6A, #388E3C);
        transform: translateY(-2px);
    }

.btn-cancel {
    background: #ddd;
    color: #333;
}

    .btn-cancel:hover {
        background: #bbb;
    }

.btn-exit {
    background-color: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-exit:hover {
        background-color: #d0d0d0;
    }

/* ===========================
   ÂÅÐÑÒÊÀ ÒÀ ÊÎÍÒÅÉÍÅÐÈ
   =========================== */
.content {
    padding-top: 1.1rem;
}

.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* ===========================
   ÔÎÐÌÈ
   =========================== */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
}

input.form-control-lg {
    font-size: 1.2rem;
    padding: 0.5rem;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===========================
   ÂÀË²ÄÀÖ²ß
   =========================== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ===========================
   ÏÎÂ²ÄÎÌËÅÍÍß ÒÀ ÀËÅÐÒÈ
   =========================== */
.alert {
    padding: 10px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* ===========================
   ÒÀÁËÈÖ²
   =========================== */
.table-primary {
    background-color: #cce5ff !important;
}

.table-responsive {
    overflow-x: auto;
}

/* ===========================
   ÌÎÄÀËÜÍ² Â²ÊÍÀ
   =========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1000;
    overflow: hidden;
}

.modal-content {
    height: 100%;
    width: 100%;
    padding: 30px;
    padding-bottom: 90px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: manipulation; /*çàïîá³ãàííÿ çóìó ïðè äàáë-êë³ê³*/
}

@media (min-width: 768px) {
    .modal-content {
        height: auto;
        width: 420px;
        padding: 30px;
        padding-bottom: 90px;
        box-sizing: border-box;
        animation: fadeIn 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        touch-action: manipulation; /*çàïîá³ãàííÿ çóìó ïðè äàáë-êë³ê³*/
    }
}

@media (min-width: 768px) {
    .modal-overlay {
        background: rgba(0, 0, 0, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        overflow-y: auto;
        padding: 20px;
    }

    .modal-content {
        background: #fff;
        border-radius: 8px;
        width: 420px;
        max-height: 90vh;
        padding: 30px;
        box-sizing: border-box;
        animation: fadeIn 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        touch-action: manipulation; /*çàïîá³ãàííÿ çóìó ïðè äàáë-êë³ê³*/
    }
}

.modal-header {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    margin-bottom: 15px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.modal-sticky-header {
    position: sticky;
    top: -30px;
    z-index: 10;
    background-color: #fff;
    margin-left: -30px;
    margin-right: -30px;
    padding-left: 30px;
    padding-right: 30px;
    padding-top: 30px;
    padding-bottom: 15px;
}

/* ===========================
   ÅËÅÌÅÍÒÈ ÊÀÐÒÎÊ ÒÀ ÑÏÈÑÊ²Â
   =========================== */
.card-header {
    background-color: #f8f9fa;
}

.list-group-item span:first-child {
    font-weight: 500;
}

/* ===========================
   ÅËÅÌÅÍÒÈ ÀÂÒÎÐÈÇÀÖ²¯
   =========================== */
.auth {
    text-align: right;
    padding: 10px 0;
}

/* ===========================
   BLAZOR: ÏÎÂ²ÄÎÌËÅÍÍß ÏÐÎ ÏÎÌÈËÊÓ
   =========================== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ===========================
   ÅÊÐÀÍ ÇÀÂÀÍÒÀÆÅÍÍß
   =========================== */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* ===========================
   ²ÍØÅ
   =========================== */
summary {
    cursor: pointer;
    user-select: none;
}

/* ===========================
   ÂÈÏÀÄÀÞ×Å ÌÅÍÞ Ä²É
   =========================== */
.actions-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.fab-btn {
    background-color: forestgreen;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

    .fab-btn:hover {
        transform: scale(1.1);
    }

.plus {
    line-height: 0;
}

.actions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.2);
    z-index: 999;
}

.actions-list {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1001;
    animation: slide-up 0.2s ease;
}

    .actions-list button {
        padding: 10px 16px;
        font-size: 16px;
        border-radius: 30px;
        border: none;
        background-color: slategrey;
        color: white;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        transition: transform 0.2s ease;
    }

        .actions-list button:hover {
            transform: scale(1.05);
        }

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   ÂÑÏËÈÂÀÞ×² ÑÓÌÈ
   =========================== */

.float-sum {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    font-weight: bold;
    opacity: 0;
    animation: float-up 1.5s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

    .float-sum.add {
        color: #27ae60;
    }

    .float-sum.remove {
        color: #e74c3c;
    }

@keyframes float-up {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -60px);
        opacity: 0;
    }
}

/* ==== Confirm Modal Styles ==== */

.modal-confirm-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-confirm {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px 30px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    max-width: 320px;
    text-align: center;
}

    .modal-confirm h4 {
        margin: 0 0 18px 0;
        font-weight: 600;
    }

.modal-confirm-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.modal-confirm-no {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
    margin-right: 8px;
}

.modal-confirm-yes {
    background-color: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
    margin-left: 8px;
}

.modal-confirm-no:hover {
    background-color: #c0392b;
}

.modal-confirm-yes:hover {
    background-color: #27ae60;
}

@media (max-width: 480px) {
    .modal-confirm {
        width: 90%;
        padding: 20px;
    }

    .modal-confirm-actions {
        flex-direction: column;
        gap: 10px;
    }

    .modal-confirm-no,
    .modal-confirm-yes {
        margin: 0;
        width: 100%;
    }
}

/* ===========================
   ²ÍÔÎÐÌÀÐÈÂÍÅ ÏÎÂ²ÄÎÌËÅÍÍß
   =========================== */
.modal-info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-info-content {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px;
    width: 320px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.2s ease-in;
}

    .modal-info-content h4 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 1.2rem;
    }

    .modal-info-content p {
        margin: 0 0 20px;
        font-size: 1rem;
        color: #333;
    }

.modal-info-buttons {
    display: flex;
    justify-content: center;
}

.modal-info-btn-ok {
    background-color: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .modal-info-btn-ok:hover {
        background-color: #2980b9;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nav-scrollable {
    background-image: linear-gradient(180deg, #3f4449 0%, #2e3338 100%);
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 250px;
    overflow-y: auto;
    transition: transform 0.2s ease-in-out;
    z-index: 1000;
}

.collapse {
    transform: translateX(-100%);
}

.nav-scrollable.collapse {
    transform: translateX(-100%);
}

@media (min-width: 992px) {
    .nav-scrollable {
        transform: translateX(0) !important;
    }
}


.offline-message {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* ===========================
   Ô²ÊÑÎÂÀÍÀ ÏÀÍÅËÜ (ÑÓÌÀ + ÊÍÎÏÊÈ)
   =========================== */
.fixed-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: #fff;
    padding: 10px 16px;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
    box-sizing: border-box
}

    .fixed-bottom span {
        flex: 1 1 auto;
        font-size: 1.4rem;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fixed-bottom div {
        display: flex;
        gap: 0.5rem;
        flex-shrink: 0;
    }

@media (max-width: 576px) {
    .fixed-bottom {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 12px;
    }

        .fixed-bottom span {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
        }

        .fixed-bottom div {
            justify-content: center;
            width: 100%;
        }

        .fixed-bottom button {
            flex: 1;
        }
}

.btn-success {
    background-color: #28a745;
}

    .btn-success:hover {
        background-color: #218838;
    }

.btn-danger {
    background-color: #dc3545;
}

    .btn-danger:hover {
        background-color: #c82333;
    }

.btn-toggle-groups {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

    .btn-toggle-groups:focus,
    .btn-toggle-groups:active {
        outline: none !important;
        box-shadow: none !important;
    }

/* ===========================
   ÊÍÎÏÊÀ ÇÃÎÐÒÀÍÍß/ÐÎÇÃÎÐÒÀÍÍß
   =========================== */
.btn-toggle-groups {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    width: 20px;
    height: 20px;
    background-color: var(--bs-body-color, #212529);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

    .btn-toggle-groups.expanded {
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708l6-6z'/%3E%3C/svg%3E");
    }

    .btn-toggle-groups:focus,
    .btn-toggle-groups:active {
        outline: none !important;
        box-shadow: none !important;
    }


/* ===========================
   ÑÒÎÐ²ÍÊÀ ÑÈÍÕÐÎÍ²ÇÀÖ²¯
   =========================== */
.sync-page .card {
    border-radius: 12px;
}

.sync-page .table th,
.sync-page .table td {
    vertical-align: middle;
}

@media (max-width: 576px) {
    .sync-page h3 {
        font-size: 1.25rem;
    }

    .sync-page .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .sync-page .card {
        padding: 1rem;
    }
}

.sync-page .table .btn-details {
    background: none;
    border: 1px solid transparent;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-weight: inherit;
    font-size: inherit;
    border-radius: 12px;
    transition: all 0.2s ease-in-out;
}

    .sync-page .table .btn-details.text-success {
        color: var(--bs-success) !important;
        background-color: rgba(var(--bs-success-rgb), 0.15);
        border-color: rgba(var(--bs-success-rgb), 0.3);
    }

    .sync-page .table .btn-details.text-danger {
        color: var(--bs-danger) !important;
        background-color: rgba(var(--bs-danger-rgb), 0.15);
        border-color: rgba(var(--bs-danger-rgb), 0.3);
    }

    .sync-page .table .btn-details.text-success:hover,
    .sync-page .table .btn-details.text-success:focus {
        background-color: rgba(var(--bs-success-rgb), 0.25);
        outline: none;
    }

    .sync-page .table .btn-details.text-danger:hover,
    .sync-page .table .btn-details.text-danger:focus {
        background-color: rgba(var(--bs-danger-rgb), 0.25);
        outline: none;
    }

.sync-page .table .btn-details {
    text-decoration: none;
    border-bottom: 1px dotted;
}

    .sync-page .table .btn-details:hover,
    .sync-page .table .btn-details:focus {
        text-decoration: none;
        border-bottom: 1px solid;
    }

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.sync-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

