/* Shared controls for the application, cashier and standalone reports.
 * Legacy screens have deeply nested overrides, so visual properties are
 * intentionally authoritative here. Layout, visibility and handlers stay local.
 */
@font-face {
    font-family: 'Tinkoff Sans';
    src: url('../fonts/tinkoff-sans/TinkoffSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
:root {
    --app-button-radius: 6px;
    --app-button-blue: #2e75ad;
    --app-button-blue-hover: #245e8b;
    --app-button-green: #338547;
    --app-button-red: #c73f3f;
    --app-button-line: #b9c9d7;
    --app-button-text: #24445d;
    --app-button-focus: #1d5eaa;
    --app-button-font: 'Tinkoff Sans', Arial, sans-serif;
}

/* All standard actions, including the unclassed submit controls in reports. */
body :is(.btn, .ui-button, .kassa-fns-upload-button, :where(button:not([class]), input[type="submit"], input[type="button"], input[type="reset"])) {
    box-sizing: border-box;
    min-height: 34px !important;
    padding: 7px 13px !important;
    border: 1px solid var(--app-button-line) !important;
    border-radius: var(--app-button-radius) !important;
    background: #fff !important;
    color: var(--app-button-text) !important;
    font-family: var(--app-button-font) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 18px !important;
    text-align: center;
    text-decoration: none !important;
    vertical-align: middle;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
body :is(.btn, .ui-button, :where(button:not([class]), input[type="submit"], input[type="button"], input[type="reset"])):hover {
    background: #eef4f8 !important;
    border-color: #8aa8be !important;
}
body .btn-primary,
body .kassa-fns-upload-button {
    background: var(--app-button-blue) !important;
    border-color: var(--app-button-blue) !important;
    color: #fff !important;
}
body .btn-primary:hover,
body .kassa-fns-upload-button:hover {
    background: var(--app-button-blue-hover) !important;
    border-color: var(--app-button-blue-hover) !important;
}
body :is(.btn-success, .btn-color-green) {
    background: var(--app-button-green) !important;
    border-color: var(--app-button-green) !important;
    color: #fff !important;
}
body :is(.btn-success, .btn-color-green):hover {
    background: #286a38 !important;
    border-color: #286a38 !important;
}
body .btn-danger {
    background: var(--app-button-red) !important;
    border-color: var(--app-button-red) !important;
    color: #fff !important;
}
body .btn-danger:hover {
    background: #a72f2f !important;
    border-color: #a72f2f !important;
}
body .btn-info {
    background: #257b92 !important;
    border-color: #257b92 !important;
    color: #fff !important;
}
body .btn-info:hover { background: #1d6174 !important; border-color: #1d6174 !important; }
body :is(.btn-warning, .btn-color-yellow) {
    background: #f4c76b !important;
    border-color: #d6a84e !important;
    color: #533a0c !important;
}
body :is(.btn-warning, .btn-color-yellow):hover { background: #ebba54 !important; border-color: #c49435 !important; }
body :is(.btn-sm, .btn-group-sm > .btn) {
    min-height: 30px !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
}
body :is(.btn-xs, .btn-group-xs > .btn) {
    min-height: 26px !important;
    padding: 3px 7px !important;
    font-size: 12px !important;
}
body :is(.btn-lg, .btn-group-lg > .btn) {
    min-height: 42px !important;
    padding: 10px 18px !important;
    font-size: 16px !important;
    line-height: 20px !important;
}
body .btn-link, body .btn-link:hover {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--app-button-blue) !important;
}
body .btn .glyphicon { font-size: 1em; vertical-align: baseline; }

/* Keep adjoining controls joined, and keep compact embedded icons compact. */
body .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle),
body .input-group-btn > .btn:not(:first-child):not(:last-child),
body .app-search-box .btn { border-radius: 0 !important; }
body .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-radius: 6px 0 0 6px !important; }
body .btn-group > .btn:last-child:not(:first-child),
body .btn-group > .dropdown-toggle:not(:first-child),
body .input-group-btn:last-child > .btn:last-child,
body .app-search-box .btn:last-child { border-radius: 0 6px 6px 0 !important; }
body .input-group-btn:first-child > .btn:first-child { border-radius: 6px 0 0 6px !important; }

/* One tab shape and one active state, for Bootstrap, Spry and custom tabs. */
body :is(.nav-tabs > li > a, .TabbedPanelsTab, .contractor-finance-tab-button, .kassa-tab-button) {
    box-sizing: border-box;
    min-height: 36px !important;
    padding: 8px 14px !important;
    border: 1px solid var(--app-button-line) !important;
    border-radius: var(--app-button-radius) !important;
    background: #fff !important;
    color: var(--app-button-text) !important;
    font-family: var(--app-button-font) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 18px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer;
}
body :is(.nav-tabs > li > a, .TabbedPanelsTab, .contractor-finance-tab-button, .kassa-tab-button):hover {
    border-color: #8aa8be !important;
    background: #eef4f8 !important;
}
body :is(.nav-tabs > li.active > a, .TabbedPanelsTabSelected, .contractor-finance-tab-button.is-active, .kassa-tab-button.active),
body :is(.nav-tabs > li.active > a, .TabbedPanelsTabSelected, .contractor-finance-tab-button.is-active, .kassa-tab-button.active):hover {
    background: var(--app-button-blue) !important;
    border-color: var(--app-button-blue) !important;
    color: #fff !important;
}
body .nav-tabs:not(.rules-tabs) { padding-bottom: 10px; }
body .nav-tabs:not(.rules-tabs) > li { margin: 0 6px 0 0; }
body .nav-tabs:not(.rules-tabs) > li > a { margin-right: 0; }
body .TabbedPanelsTab { margin-right: 6px; margin-bottom: 6px; }
body .contractor-finance-tab-button.is-active > span { background: #fff; color: var(--app-button-blue); }
body .kassa-tab-danger { box-shadow: inset 0 -3px var(--app-button-red) !important; }
body .kassa-tab-warning { box-shadow: inset 0 -3px #c58b19 !important; }

/* Selection in the service picker and search scopes must remain visible. */
body :is(.service-catalog-card .service-catalog-price, .service-catalog-addon-row .btn, .service-catalog-variant-row .btn):not(.is-selected) {
    background: #eef4f8 !important;
    border-color: var(--app-button-line) !important;
    color: var(--app-button-text) !important;
}
body :is(.service-catalog-card .btn, .service-catalog-addon-row .btn, .service-catalog-variant-row .btn).is-selected {
    background: var(--app-button-green) !important;
    border-color: var(--app-button-green) !important;
    color: #fff !important;
}
body .btn.is-active, body .btn.active, body .app-search-scope.is-active {
    box-shadow: inset 0 0 0 2px currentColor !important;
}
body .app-search-scope.is-active {
    background: #e2eff9 !important;
    border-color: var(--app-button-blue) !important;
    color: #1c5987 !important;
}

/* Action menus and embedded +/- controls retain their own layout. */
body :is(.app-action-card, .app-filter-chip, .app-filter-pill, .app-dropdown-action-button, .service-selected-quantity button, .service-selected-heading button, .service-tree-group-button) {
    border-radius: var(--app-button-radius);
    font-family: var(--app-button-font);
    font-weight: 400;
}

/* Visible keyboard focus without a black mouse-click outline. */
body :is(.btn, button, input[type="submit"], input[type="button"], input[type="reset"], .ui-button, .nav-tabs > li > a, .TabbedPanelsTab):focus-visible {
    outline: 2px solid var(--app-button-focus) !important;
    outline-offset: 3px !important;
}
body :is(.btn, button, input[type="submit"], input[type="button"], input[type="reset"], .ui-button, .nav-tabs > li > a, .TabbedPanelsTab):focus:not(:focus-visible) {
    outline: none !important;
}
body :is(.btn, .ui-button, button, input[type="submit"], input[type="button"], input[type="reset"]):is(:disabled, .disabled, [aria-disabled="true"]),
body fieldset[disabled] .btn {
    opacity: .5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}
@media (prefers-reduced-motion: reduce) {
    body .btn { transition: none !important; }
}

/* Text on every action uses regular weight, including legacy nested labels. */
body :is(button, input[type="submit"], input[type="button"], input[type="reset"], .btn, .ui-button, [role="button"], .app-main-nav-item, .app-action-card, .app-filter-chip, .app-filter-pill, .app-dropdown-action-button, .nav-tabs > li > a, .TabbedPanelsTab, .contractor-finance-tab-button, .kassa-tab-button) {
    font-weight: 400 !important;
}
body :is(button, .btn, .ui-button, [role="button"], .app-main-nav-item, .app-action-card, .app-filter-chip, .app-filter-pill, .app-dropdown-action-button, .nav-tabs > li > a, .TabbedPanelsTab, .contractor-finance-tab-button, .kassa-tab-button) :is(span, b, strong, em, small) {
    font-weight: 400 !important;
}
