﻿/* =============================================================
   Retail Forms – styling
   Οργάνωση σε ενότητες, χωρίς αλλαγή συμπεριφοράς.
   ============================================================= */

/* -------------------------------------------------------------
   0. Theme variables
   ------------------------------------------------------------- */
:root {
    --rs-blue: #4D71B5; /* μπλε για τα recolorable (mask) icons */
    --rs-dodger: dodgerblue; /* primary button background */
    --rs-selected: red; /* selected-state highlight */
}

/* -------------------------------------------------------------
   1. Buttons
   ------------------------------------------------------------- */
.rsparambutton {
    background-color: var(--rs-dodger);
    color: white;
    border: 1px solid blue;
    padding: 8px 16px;
    min-width: 110px;
}

.rsPaymButton {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    color: black !important;
    min-height: 100px;
    font-size: 2rem !important;
    font-weight: bold !important;
}

.rssaleitemdesignbutton {
    background-color: var(--rs-dodger);
    color: black !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 14px !important;
    width: 140px !important;
    min-width: 140px;
    height: 80px !important;
    min-height: 80px;
    overflow: hidden;
    text-align: center;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.15;
}

.rssaleitembutton {
    background-color: var(--rs-dodger);
    color: black !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    width: 140px;
    min-width: 140px;
    height: 80px;
    min-height: 80px;
    overflow: hidden;
    text-align: center;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.15;
}

    .rssaleitembutton.k-icon-button,
    .rssaleitembutton.k-button-icon,
    .rssaleitembutton.k-button.k-icon-button {
        width: 140px !important;
        min-width: 140px !important;
        height: 80px !important;
        min-height: 80px !important;
    }

    .rssaleitembutton .button-text,
    .rssaleitembutton .k-button-text {
        display: block;
        width: 100%;
        max-width: 100%;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        text-align: center;
        line-height: 1.15;
    }

.rssalestagbutton {
    display: block;
    width: 100%;
    height: 50%;
    box-sizing: border-box;
    color: black !important;
    text-wrap-mode: wrap !important;
    margin-right: 0 !important;
}

/* Pending-transactions button with a count badge */
.rs-pending-tagbtn-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.rs-pending-tagbtn-wrap .rssalestagbutton {
    width: 100%;
}

.rs-pending-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 11px;
    background: #6c757d;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    pointer-events: none;
}

.rs-pending-badge.rs-blink {
    background: #dc3545;
    animation: rs-pending-blink 1s steps(1, end) infinite;
}

@keyframes rs-pending-blink {
    50% {
        background: transparent;
        color: transparent;
    }
}

/* -------------------------------------------------------------
   2. Panels
   ------------------------------------------------------------- */
.rspanel,
.rsSalespanel,
.rsPaymentPanel,
.rsPaymentMethodsPanel,
.rsCurrencyPanel,
.rsWholeSalePanel {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Accessory (child) rows in the sales details grid — italic to distinguish
   them from their parent lines. */
.rs-accessory-row,
.rs-accessory-row td {
    font-style: italic;
}

/* The line the last added item landed on (retail sales grid). Selection still wins, so the
   operator can tell a selected line from the highlighted one. */
.rs-sales-details .k-grid tr.rs-last-added-row:not(.k-selected) > td {
    background-color: rgba(255, 193, 7, 0.32) !important;
}

.rs-sales-details .k-grid tr.rs-last-added-row > td:first-child {
    box-shadow: inset 4px 0 0 #f0a500 !important;
}

/* Locked accessory lines (AllowDeleteAccessoryIte != 1): no selection, no click-to-edit. */
.rs-locked-row,
.rs-locked-row td {
    pointer-events: none;
    opacity: 0.75;
}

.rspanel .ep-panel__content .flex-container {
    background: transparent !important;
    border-radius: 4px;
    column-gap: 5px;
    row-gap: 0;
    margin-left: 5%;
    margin-right: 5%;
    vertical-align: bottom;
}

/* spacing overrides — κατεβαίνουν σε όλα τα παιδιά */
.rsCurrencyPanel {
    --mdPadding: 0;
    --ep-cell-padding-md: 0;
    --ep-cell-padding-sm: 0;
    --controlPadding: 0;
    --generalPadding: 0; /* αν θες να φύγει και το εξωτερικό 16px padding του panel body */
}

/* Και το τελικό σημείο που κάνει το scroll */
/*.rsCurrencyPanel .ep-panel__body {
    overflow-y: auto;
}*/

/* -------------------------------------------------------------
   3. Invoice / payment summary
   ------------------------------------------------------------- */
.rs-invoice-discount-label,
.rs-invoice-discount-value {
    font-style: normal;
}

.rs-payment-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: start;
    column-gap: 28px;
    row-gap: 8px;
    width: 100%;
    padding: 12px 16px 4px;
    font-size: 1.05rem !important;
    border: none !important;
    border-top: 1px solid rgba(128, 128, 128, 0.25) !important;
}

    .rs-payment-summary > div {
        line-height: 1.35;
    }

    /* Label hugs the left edge, amount the right — a full-width receipt row. */
    .rs-payment-summary .rs-summary-label {
        text-align: left;
        opacity: 0.7;
        font-weight: 400;
    }

    .rs-payment-summary .amount {
        text-align: right;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

    /* Full-width rule that groups discounts apart from the payment totals. */
    .rs-payment-summary .rs-summary-divider {
        grid-column: 1 / -1;
        height: 1px;
        margin: 4px 0;
        background: rgba(128, 128, 128, 0.25);
    }

    /* Balance still due — the headline figure, so it is enlarged and highlighted
       while positive and turns green once the receipt is fully settled. */
    .rs-payment-summary .rs-balance,
    .rs-payment-summary .rs-balance-label {
        font-size: 1.3rem;
        line-height: 1.2;
    }

    .rs-payment-summary .rs-balance {
        color: #e0a400;
    }

    .rs-payment-summary .rs-balance-paid {
        color: #33b56a;
    }

    .rs-payment-summary .rs-balance-label {
        opacity: 1;
        font-weight: 600;
    }

    /* Centre placement (under the payments grid): right-align the labels too. */
    .rs-payment-summary.rs-labels-right .rs-summary-label {
        text-align: right;
    }

    /* Payment totals (BuildPaymentCollectionPanel): every row the same, larger size. */
    .rs-payment-summary.rs-payment-collection {
        font-size: 1.4rem !important;
    }

        .rs-payment-summary.rs-payment-collection .rs-balance,
        .rs-payment-summary.rs-payment-collection .rs-balance-label {
            font-size: inherit;
        }

/* -------------------------------------------------------------
   4. Icons – generic sizing
   ------------------------------------------------------------- */
.rs-icon-xl {
    font-size: 2.25rem !important;
}

.rs-icon-l {
    font-size: 1.75rem !important;
}

.rs-icon-green {
    color: green !important;
    font-weight: bold !important;
}

.rs-icon-red {
    color: red !important;
    font-weight: bold !important;
    animation: red-flash 0.6s infinite alternate !important;
}

@keyframes red-flash {
    from {
        color: red !important;
        opacity: 1;
    }

    to {
        color: yellow !important;
        opacity: 0.2;
    }
}

/* -------------------------------------------------------------
   5. Icons – blue mask icons (recolorable via background-color)
   ------------------------------------------------------------- */
.rs-svg-quantity_blue-icon,
.rs-svg-cash_blue-icon,
.rs-svg-Ribbons_blue-icon {
    width: 3rem !important;
    height: 2.75rem !important;
    background-color: var(--rs-blue);
    transition: background-color 0.15s ease;
    -webkit-mask-position: center center;
    mask-position: center center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

    .rs-svg-quantity_blue-icon.selected,
    .rs-svg-cash_blue-icon.selected,
    .rs-svg-Ribbons_blue-icon.selected {
        background-color: var(--rs-selected);
    }

.rs-svg-quantity_blue-icon {
    -webkit-mask-image: url('../svg/RetailFormsIcons/RightToolBarIcons/quantity_blue.svg');
    mask-image: url('../svg/RetailFormsIcons/RightToolBarIcons/quantity_blue.svg');
}

.rs-svg-cash_blue-icon {
    -webkit-mask-image: url('../svg/RetailFormsIcons/RightToolBarIcons/cash_blue.svg');
    mask-image: url('../svg/RetailFormsIcons/RightToolBarIcons/cash_blue.svg');
}

.rs-svg-Ribbons_blue-icon {
    -webkit-mask-image: url('../svg/RetailFormsIcons/RightToolBarIcons/Ribbons_blue.svg');
    mask-image: url('../svg/RetailFormsIcons/RightToolBarIcons/Ribbons_blue.svg');
}

/* -------------------------------------------------------------
   6. Icons – left toolbar actions
   ------------------------------------------------------------- */
.rs-svg-cancel-icon,
.rs-svg-Delete_item-icon,
.rs-svg-edit_item-icon,
.rs-svg-Increase_quantity-icon,
.rs-svg-decrease_quantity-icon {
    width: 2.25rem !important;
    height: 2rem !important;
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
}

.rs-svg-cancel-icon {
    background-image: url('../svg/RetailFormsIcons/LeftToolBarIcons/cancel.svg');
}

.rs-svg-Delete_item-icon {
    background-image: url('../svg/RetailFormsIcons/LeftToolBarIcons/Delete_item.svg');
}

.rs-svg-edit_item-icon {
    background-image: url('../svg/RetailFormsIcons/LeftToolBarIcons/edit_item.svg');
}

.rs-svg-Increase_quantity-icon {
    background-image: url('../svg/RetailFormsIcons/LeftToolBarIcons/Increase_quantity.svg');
}

.rs-svg-decrease_quantity-icon {
    background-image: url('../svg/RetailFormsIcons/LeftToolBarIcons/decrease_quantity.svg');
}

/* -------------------------------------------------------------
   7. Icons – cash (κέρματα & χαρτονομίσματα)
   ------------------------------------------------------------- */

/* Κέρματα: τετράγωνα 6rem */
.rs-svg-cent01-icon,
.rs-svg-cent02-icon,
.rs-svg-cent05-icon,
.rs-svg-cent10-icon,
.rs-svg-cent20-icon,
.rs-svg-cent50-icon,
.rs-svg-euro01-icon,
.rs-svg-euro02-icon {
    width: 6rem !important;
    height: 6rem !important;
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
}

.rs-svg-cent01-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_01_cent.svg');
}

.rs-svg-cent02-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_02_cent.svg');
}

.rs-svg-cent05-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_05_cent.svg');
}

.rs-svg-cent10-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_10_cent.svg');
}

.rs-svg-cent20-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_20_cent.svg');
}

.rs-svg-cent50-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_50_cent.svg');
}

.rs-svg-euro01-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_1_euro.svg');
}

.rs-svg-euro02-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_2_euro.svg');
}

/* Χαρτονομίσματα: ορθογώνια ~2:1, 8rem × 4rem (πιο μεγάλα από τα κέρματα) */
.rs-svg-euro05-icon,
.rs-svg-euro10-icon,
.rs-svg-euro20-icon,
.rs-svg-euro50-icon,
.rs-svg-euro100-icon,
.rs-svg-euro200-icon {
    width: 8rem !important;
    height: 4rem !important;
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
}

.rs-svg-euro05-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_5_euro.svg');
}

.rs-svg-euro10-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_10_euro.svg');
}

.rs-svg-euro20-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_20_euro.svg');
}

.rs-svg-euro50-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_50_euro.svg');
}

.rs-svg-euro100-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_100_euro.svg');
}

.rs-svg-euro200-icon {
    background-image: url('../svg/RetailFormsIcons/PaymentIcons/cash_200_euro.svg');
}

/* -------------------------------------------------------------
   8. Currency panel – coin buttons layout
   ------------------------------------------------------------- */

/* Wrapper: γέμισε τη στήλη, χωρίς margin */
.rsCurrencyPanel .ep-button.ep-control {
    margin: 0 !important;
    width: 100% !important;
}

/* Το κουμπί: γέμισε τον wrapper */
.rsCurrencyPanel .rs-coin-button.k-button {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
}

/* Το k-button-text να απλωθεί όλο το πλάτος */
.rsCurrencyPanel .rs-coin-button .k-button-text {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Η εικόνα: γέμισε το πλάτος, κράτα αναλογίες */
.rsCurrencyPanel .rs-coin-button .k-icon {
    /*width: 4rem !important;*/ /* σταθερό μέγεθος κέρματος */
    /*height: 4rem !important;*/
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* -------------------------------------------------------------
   9. Sales items tab & payment methods grid
   ------------------------------------------------------------- */
.rssalesItemsTab .k-tabstrip-items-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
}

.rssalesItemsTab .k-tabstrip-items {
    display: flex;
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

    .rssalesItemsTab .k-tabstrip-items .k-link,
    .rssalesItemsTab .k-tabstrip-items .k-tabstrip-item .k-link,
    .rssalesItemsTab .k-tabstrip-items .k-item .k-link {
        font-size: 1.1rem;
        padding: 0.9rem 1.4rem;
        min-height: 52px;
        font-weight: bold !important;
    }

.rssalesItemsTab .ep-layout.flex-container:not(.direction-column),
.rsPaymentMethodsPanel .ep-layout.flex-container:not(.direction-column) {
    display: grid !important;
    grid-template-columns: repeat(var(--rs-bpr, 6), 1fr) !important;
    gap: 0.5rem !important;
    justify-content: unset !important;
}

    .rssalesItemsTab .ep-layout.flex-container:not(.direction-column) > .ep-layout-item,
    .rsPaymentMethodsPanel .ep-layout.flex-container:not(.direction-column) > .ep-layout-item {
        flex: unset !important;
        width: unset !important;
        max-width: unset !important;
        min-width: 0 !important;
    }

        .rssalesItemsTab .ep-layout.flex-container:not(.direction-column) > .ep-layout-item .rssaleitembutton,
        .rsPaymentMethodsPanel .ep-layout.flex-container:not(.direction-column) > .ep-layout-item .rssaleitembutton {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
        }

.rssalesItemsTab .flex-container:not(.direction-column) > .ep-layout-item > .ep-control,
.rsPaymentMethodsPanel .flex-container:not(.direction-column) > .ep-layout-item > .ep-control {
    margin-right: 0 !important;
}

/* -------------------------------------------------------------
   10. Numpad (sales page)
   ------------------------------------------------------------- */
.rs-numpad-display {
    height: 36px;
    width: 100%;
    border: none;
    outline: none;
    text-align: center;
    font-size: 1.1rem;
    margin: 6px 0 10px 0;
    background: transparent;
}

.rs-numpad-display-border {
    height: 3rem !important;
    width: 100%;
    text-align: center;
    font-size: 2rem;
    border: 2px solid #2411e4;
    margin: 6px 0 10px 0;
    background: transparent;
}

/* Input + Clear button on the same row */
.rs-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

    .rs-input-row .rs-numpad-display-border {
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
        margin: 6px 0 10px 0;
    }

    .rs-input-row .rs-clear-button,
    .rs-input-row .rs-clear-button.k-button {
        flex: 0 0 auto;
        height: 3rem !important;
        min-height: 3rem !important;
        box-sizing: border-box;
        margin: 6px 0 10px 0;
        white-space: nowrap;
    }

.rs-payment-name-display {
    height: 2.5rem !important;
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
    border: none;
    margin: 6px 0 0 0;
    background: transparent;
}

.rs-numpad-grid {
    display: grid;
    /* allow columns to shrink without overflowing fixed-width children */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    /* let rows grow to fill available space when container permits */
    grid-auto-rows: minmax(56px, 1fr);
}

.rs-numpad-grid-twoCols {
    display: grid;
    /* allow columns to shrink without overflowing fixed-width children */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    /* let rows grow to fill available space when container permits */
    grid-auto-rows: minmax(56px, 1fr);
}

/* Make the accept/return button full width below the grid */
.rs-numpad-grid + .rssalestagbutton,
.rs-numpad-grid ~ .rssalestagbutton {
    margin-top: 10px;
    width: 100%;
}

/* Ensure RSFlexButton inside grid expands to fill cell */
.rs-numpad-grid button,
.rs-numpad-grid .k-button,
.rs-numpad-grid .rssaleitembutton {
    /* fill the grid cell, use 100% height so grid-auto-rows controls sizing */
    width: 100%;
    height: 100%;
    min-height: 40px;
    box-sizing: border-box;
    /* allow long text to wrap inside the button instead of expanding the cell */
    min-width: 0;
}

/* make sure direct children of the grid don't keep a fixed min-width from the outer layout */
.rs-numpad-grid > * {
    min-width: 0;
}

/* -------------------------------------------------------------
   11. Misc
   ------------------------------------------------------------- */
.rs-hidden-barcode-input {
    position: fixed;
    opacity: 0;
    width: 1px;
    height: 1px;
    border: none;
    outline: none;
    pointer-events: none;
    left: -1000px;
    top: -1000px;
}


/* -------------------------------------------------------------
   12. Wholesale Totals Panel
   ------------------------------------------------------------- */
.rs-doc-summary {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.rs-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 6px 10px;
}

    .rs-summary-row:not(:last-child) {
        border-bottom: 1px solid #ededed;
    }

.rs-summary-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rs-summary-total {
    border-top: 1px solid #c9c9c9;
}

/* -------------------------------------------------------------
   11. Wrap text in grid column headers (wholesale details grid)
   ------------------------------------------------------------- */
.rsWholeSalePanel .k-grid .k-column-title {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    line-height: 1.2;
    vertical-align:central;
}

.rsWholeSalePanel .k-grid .k-cell-inner > .k-link {
    white-space: normal;
    height: auto;
    align-items: flex-start;
}

.rsWholeSalePanel .k-grid .k-table-th {
    vertical-align: central;
    white-space: normal;
}

/* -------------------------------------------------------------
   13. Splash / busy overlay
   ------------------------------------------------------------- */
.rs-splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.rs-splash-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 32px 48px;
    min-width: 320px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.rs-splash-spinner {
    width: 56px;
    height: 56px;
    border: 6px solid #d0d0d0;
    border-top-color: var(--rs-dodger);
    border-radius: 50%;
    animation: rs-splash-spin 0.9s linear infinite;
}

@keyframes rs-splash-spin {
    to {
        transform: rotate(360deg);
    }
}

.rs-splash-message {
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    color: #222;
}

/* ── Input-text dialog (ws-input-text-dialog) ─────────────────────────────────
   The framework dialog puts the TextBox and an EmptySpace side by side in one
   layout row, so the input ends up at roughly half the dialog width. Stretch it
   across the whole dialog instead.

   Every rule is gated on .ep-textbox / .ep-emptyspace being present, so the
   message and confirm dialogs — which share .ep-message-dialog but contain
   neither — are left untouched. */
.ep-message-dialog .ep-layout-item:has(.ep-textbox) {
    flex: 1 1 100%;
    width: 100%;
}

    .ep-message-dialog .ep-layout-item:has(.ep-textbox) .ep-textbox,
    .ep-message-dialog .ep-layout-item:has(.ep-textbox) .ep-control__wrapper,
    .ep-message-dialog .ep-layout-item:has(.ep-textbox) .ep-textbox__input {
        width: 100%;
    }

/* The spacer would otherwise keep claiming the rest of the row. */
.ep-message-dialog .ep-layout-item:has(> .ep-emptyspace) {
    display: none;
}

/* =============================================================
   RSFlex WebView / Mobile layout
   ============================================================= */

/*html.webview-mode,
html.webview-mode body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

    html.webview-mode #app {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    html.webview-mode .tablet-viewport {
        width: 100%;
        height: 100%;
        overflow: hidden;
        position: relative;
    }*/

    /* Login page */
    /*html.webview-mode .login-page {
        width: 100%;
        min-width: 0;
        height: 100%;
        min-height: 0;
        box-sizing: border-box;
    }*/
