/* PBusiness (PRAJZ) custom styles */

/* Navbar company logo: show cleanly with rounded corners (not a sharp box) */
.navbar .navbar-brand img.logo,
.navbar-logo-container img.logo {
    border-radius: 8px;
    object-fit: contain;
}

/*
 * Navbar version badge ("v9.1.7") vertical alignment.
 *
 * Root cause (verified in live DOM, viewport 1440x900):
 *   Stock Espo renders the badge as <div id="nav-show-extensions">v9.1.7</div>
 *   inside <li data-item="espoVersion">. The inner div carries an INLINE
 *   `height:100%` while its <li> collapses to content height (~21px) instead
 *   of the 45px navbar row. Result: the div lands at y=0 (cy=11), i.e. ~12px
 *   ABOVE the vertically-centered search box / help / power icons (cy=23).
 *
 * Fix: force the <li> to stretch to the full 45px row and flex-center its
 * content, and neutralize the inner div's collapsing inline `height:100%`.
 * Measured after fix: badge cy=23 == icon row cy=23 (delta ~1px vs search).
 *
 * NOTE: the reason a previous copy of this rule "did not work" for the user
 * was NOT the CSS itself but browser caching — Espo busts custom cssList URLs
 * with `?r=<appTimestamp>`, and appTimestamp had gone stale, so returning
 * browsers kept the pre-fix cached file. `command.php rebuild` bumps
 * appTimestamp and forces a refetch. !important below hardens against theme
 * overrides.
 */
.navbar .navbar-nav > li[data-item="espoVersion"] {
    display: flex !important;
    align-items: center !important;
    align-self: stretch !important;
}

.navbar #nav-show-extensions {
    height: auto !important;
    align-self: center !important;
    position: static !important;
    top: auto !important;
}

/*
 * Validation tooltip (A4) — keep it visible above the fixed header.
 *
 * Root cause: Bootstrap `.popover` (used by Espo for the "Pole je povinné"
 * validation message) ships z-index:1600, but the fixed side-navbar is raised
 * to z-index:2150 !important. When a required field near the top fails
 * validation, its popover renders UNDER the header and looks clipped/hidden.
 *
 * Fix: lift the validation popover above the navbar (2150) while staying below
 * true overlays. Also give form fields a scroll-margin-top so any scroll (native
 * or JS, see records/base onInvalid override) lands the field BELOW the ~45px
 * fixed header instead of behind it.
 */
.popover {
    z-index: 2200 !important;
}

.record .cell,
.record .field,
.panel-body .cell,
.panel-body .field {
    scroll-margin-top: 70px;
}

/*
 * Prázdné middle panely tabů (tabBreak bez polí, např. Opportunity "Doklady a nabídky"
 * / "Realizace a provize") renderují prázdný rám. Reálné panely mají třídu .headered,
 * prázdné ne — skryjeme jen ty bez hlavičky a bez buněk. Zůstává tab bar + dolní panely.
 */
.middle > .panel.panel-default:not(.headered):not(:has(.cell)) {
    display: none !important;
}
