/**  =====================================================================
     app.css — HorsePlus application-wide overrides (ALL languages)
     =========================================================================
     Loaded AFTER style.css, for every user, in _AdminLayout and Login.

     style.css is the (hand-edited) Datta Able vendor theme, shared verbatim
     with DMS_ERP and SocialPlus so the estate keeps ONE shell. This file is
     the home for OUR app-wide component styles and fixes, so the vendor
     sheet can stay as close to stock as possible.

     Arabic-only rules do NOT belong here — they go in arabic.css.
     Direction (RTL) rules do NOT belong here — layouts/rtl.css owns those.

     When a rule is being copy-pasted into several views' <style> blocks,
     promote it to this file instead.

     This file was adopted from DMS_ERP (2026-10-01) when HorsePlus replaced
     its bespoke hp-portal.css shell with the estate one. Rules below the
     brand block are the estate's, unchanged — keep them in step rather than
     forking, which is the mistake styleAr.css made.
==========================================================================  **/

/* ---- Brand ----------------------------------------------------------
   The ONE place HorsePlus's brand colour lives. The vendor sheet reads
   --nav-bg-color for the navbar, header, footer bar, active nav markers,
   focus rings and ~60 other places, so this single declaration re-skins
   the whole shell.

   #055e99 is HorsePlus's existing deep blue (carried over from the
   hp-portal.css --brand-600). It is deliberately NOT the estate's shipped
   brand-blue #04a9f5, which is DMS_ERP's: a desk running both products
   must be able to tell them apart at a glance. The markup still uses the
   theme's brand-blue/header-blue/active-blue classes — those select WHICH
   vendor rules apply; this variable decides what colour they paint.  */
:root {
  --nav-bg-color: #055e99;
  --nav-bg-rgb: 5, 94, 153;
}

/* ---- The logo in the sidebar's brand panel ------------------------------
   Two images, one shown at a time (markup in _AdminLayout.cshtml):
     .hp-logo-full  horseplus-logo.png — mark + "Horse Plus" + tagline, landscape (~2.5:1), EXPANDED rail.
     .hp-logo-mark  horseplus-mark.png — the mark alone, near-square, the 80px COLLAPSED rail, where the
                    full logo's name and tagline would shrink past reading.
   Both are trimmed copies of "Horse Plus logo.png" (the master artwork, kept as delivered). If the artwork
   changes, regenerate both and re-check the sizes below.
   Sized by HEIGHT so the panel never grows taller than the header band; max-width keeps the full logo clear
   of the panel's edges in the 264px rail. The :hover selectors matter: the theme still has hover rules
   for the collapsed rail, but hover-to-expand is disabled, so the mark must stay put on hover too. */
.pcoded-navbar .header-logo .b-brand img.hp-logo-full {
  display: block;
  max-height: 60px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
}
.pcoded-navbar .header-logo .b-brand img.hp-logo-mark {
  display: none;
}
.pcoded-navbar.navbar-collapsed .header-logo .b-brand img.hp-logo-full,
.pcoded-navbar.navbar-collapsed:hover .header-logo .b-brand img.hp-logo-full {
  display: none;
}
.pcoded-navbar.navbar-collapsed .header-logo .b-brand img.hp-logo-mark,
.pcoded-navbar.navbar-collapsed:hover .header-logo .b-brand img.hp-logo-mark {
  display: block;
  max-height: 40px;
  width: auto;
}

/* ---- Account menu: an initial instead of a photo ------------------------
   The estate's header shows a photo (.img-radius) for the signed-in user.
   HorsePlus has no staff avatars, so the profile dropdown shows an initial
   in a disc of the same size instead. */
.pcoded-header .pro-head .hp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-inline-end: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 700;
}

/* Sign-out is the estate's white icon at the end of the head (.dud-logout: style.css places it, rtl.css
   mirrors it), but a <button> in a POST form where the estate has a link. Drop the browser's button look so
   it draws exactly like the link; the white ring is for the keyboard, on a background the default one
   disappears into. */
.pcoded-header .dropdown .profile-notification .pro-head .dud-logout {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.pcoded-header .dropdown .profile-notification .pro-head .dud-logout:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -6px;
}

/* The head is a row, so a name too long for one line (a full four-part Arabic name often is) wraps beside the
   disc instead of under it, and stays clear of that icon (40px wide, at the head's end). A one-line name sits
   exactly where it did. */
.pcoded-header .dropdown .profile-notification .pro-head {
  display: flex;
  align-items: center;
  padding-inline-end: 50px;
}
.pcoded-header .dropdown .profile-notification .pro-head .hp-avatar {
  flex: 0 0 auto;
}

/* The links under the head: icon before the word, the gap between them in both languages. style.css puts
   it on the physical right, which in Arabic is the menu's edge, and rtl.css does not mirror it.
   SocialPlus's rule. */
.pcoded-header .dropdown .profile-notification .pro-body li a i {
  margin-right: 0;
  margin-inline-end: 10px;
}

/* Keep pager buttons white — Bootstrap defaults the disabled prev/next background to the grey
   --bs-secondary-bg (on the inner .page-link, not the <li>). Promoted from the retired
   wwwroot/css/site.css, which the admin shell no longer loads. */
.pagination {
  --bs-pagination-disabled-bg: #fff;
}

/* ==== Sidebar: the collapsed icon rail ===================================
   The estate behaviour (SocialPlus is the reference — it solved all of this first): EVERY menu item,
   parent and child, carries an icon with a tooltip. Expanded, the rail shows icon + label. Collapsed to
   80px it shows icons only, an open group's children included, and hovering an icon floats its name
   beside it, pointing at it.

   Why this needs rules at all: the theme hides labels in the collapsed rail ONLY for top-level items
   (style.css ~2572, `> li > a > .pcoded-mtext`). A child's label is one level deeper, so it stays
   visible — and in 80px it has nowhere to go, which is why opening a group while collapsed used to
   spill clipped text out of the rail.

   Every rule below uses LOGICAL properties with !important, the SocialPlus approach: layouts/rtl.css
   loads after this file in Arabic and rewrites the submenu padding as a non-important SHORTHAND, so an
   ordinary rule here would only ever apply in English. One rule, both directions, no arabic.css twin. */

/* Expanded: children indent past their parent's icon, aligned to the reading-start side. */
.pcoded-navbar .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a {
  text-align: start;
  padding: 7px !important;
  padding-inline-start: 40px !important;
}

/* Collapsed: children become icons only, lined up under the top-level icons (7px 25px, style.css). */
.pcoded-navbar.navbar-collapsed .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a {
  padding-inline-start: 25px !important;
}
.pcoded-navbar.navbar-collapsed .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a .pcoded-mtext {
  display: none;
}

/* Collapsed: the theme's submenu bullet sits at 35px from the edge — inside the icon's box once the
   link is padded to 25px — so it lands on the glyph. Expanded it stays, as the active-child marker.
   Collapsed, the active child is marked with a tint of the brand colour instead. */
.pcoded-navbar.navbar-collapsed .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li > a:before {
  display: none;
}
.pcoded-navbar.navbar-collapsed .pcoded-inner-navbar li.pcoded-hasmenu .pcoded-submenu li.active > a {
  background: rgba(var(--nav-bg-rgb), 0.1);
  border-radius: 4px;
}

/* Collapsed: hide the group's +/x caret. With no label beside it, the theme parks it at the rail's
   edge, where in Arabic it lands on the item's own icon and reads as a stray "+". */
.pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-hasmenu > a:after {
  display: none;
}

/* Collapsed, hovered: do not dim the page. The theme's hover-expand rule is commented out in style.css
   but its companion backdrop is not, so pointing at the rail laid a 20% black overlay over the header
   and the content — exactly when someone was hovering to read a tooltip. Nothing expands, so nothing
   should dim. The mobile off-canvas backdrop (.mob-open) is untouched. (SocialPlus's fix.) */
.pcoded-navbar.navbar-collapsed:hover ~ .pcoded-header:before,
.pcoded-navbar.navbar-collapsed:hover ~ .pcoded-main-container:before {
  display: none;
}

/* ---- The collapse toggle, in the header ------------------------------------
   The estate keeps this button inside the sidebar's logo panel; HorsePlus keeps it OUTSIDE, as the
   first item of the header, against the sidebar's edge (see the note on the markup in _AdminLayout for
   why: the theme hides the in-sidebar one while collapsed). Same element (#mobile-collapse), same
   three-line shape and X animation — the theme's base .mobile-menu rules (style.css ~2194) already
   draw it in WHITE, because that base style was designed for the header; only the in-sidebar copy is
   recoloured. So nothing here touches colour, only placement.

   position: static, not the theme's absolute — that makes it an ordinary item in the header's row, so
   (a) it sits right after the sidebar edge whatever the rail's width, collapsed or expanded, and
   (b) the row mirrors with <html dir> on its own, and rtl.css's physical offsets for header
   .mobile-menu (left: 20px, layouts/rtl.css ~851) do not apply to a static element at all. */
.pcoded-header > .hp-rail-toggle {
  position: static;
  flex: 0 0 auto;
  width: 37px;
  height: 70px;
  margin-inline-start: 20px;
  margin-inline-end: 6px;
  cursor: pointer;
}

/* Below 992px the theme's phone header (.m-header) shows its own hamburger, #mobile-collapse1, which
   slides the sidebar in. Hide this one there, so there is only ever one menu button on screen. */
@media (max-width: 991.98px) {
  .pcoded-header > .hp-rail-toggle {
    display: none;
  }
}

/* ---- Both menu buttons keep their three lines, open or closed (decision 2026-10-04) ----
   The theme turns the lines into an X while the menu is open: pcoded.min.js toggles .on on every click of
   a .mobile-menu, and style.css (~2243) bends the lines whenever .on is present. This cancels that for the
   two header buttons — #mobile-collapse (desktop) and #mobile-collapse1 (the phone header) — by restating
   the theme's own three-line shape (style.css ~2211-2241) for the .on state. Look only: the script still
   toggles .on and still opens and closes the menu exactly as before.

   Why the icon no longer shows the state at all: .on flips only on a click, while pcoded's resize handler
   (togglemenu) opens and closes the menu without touching it — so the X could already say the opposite of
   what the menu was doing (snap the window to half the screen and back). The state is carried by the
   buttons' aria-expanded instead, which the layout keeps in step with the sidebar. */
.pcoded-header .mobile-menu.on span {
  background-color: #fff;
}
.pcoded-header .mobile-menu.on span:after,
.pcoded-header .mobile-menu.on span:before {
  height: 2.8px;
  transform: none;
}
.pcoded-header .mobile-menu.on span:after {
  width: 70%;
}
.pcoded-header .mobile-menu.on span:before {
  width: 40%;
}

/* ---- Tooltips: the item's name, floating beside its icon --------------------
   Brand-coloured, in Tajawal, with the end-side corners rounded so the bubble reads as attached to
   the rail — the DMS_ERP / SocialPlus styling, which both projects carry inline in their layouts and
   which is promoted here instead. Placement is "right" in the markup and Bootstrap mirrors it from
   <html dir>, so it always opens away from the rail; the layout also passes fallbackPlacements: []
   so Popper cannot flip it to "top" for the first item.

   One addition over the estate: the ARROW is coloured too. Neither reference does this, so their
   bubbles are blue with a black pointer; the arrow is the part that points at the element, and it
   should match the bubble it belongs to. Both the 5.0 placement classes and the 5.3 data attribute
   are covered, because style.css imports Bootstrap 5.0.2 CSS while the layout loads the 5.3.3 JS. */
.tooltip .tooltip-inner {
  background-color: var(--nav-bg-color);
  color: #fff;
  font-family: 'Tajawal', sans-serif;
  border-start-end-radius: 5px !important;
  border-end-end-radius: 5px !important;
}
.tooltip.bs-tooltip-end .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
  border-right-color: var(--nav-bg-color);
}
.tooltip.bs-tooltip-start .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
  border-left-color: var(--nav-bg-color);
}
.tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
  border-top-color: var(--nav-bg-color);
}
.tooltip.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-bottom-color: var(--nav-bg-color);
}

/* ---- DataTables -------------------------------------------------------
   The THREE functional rules carried over from the retired dt-skin.css. Everything else in that
   file was cosmetic and the real theme now supplies it, but these three HIDE things, so dropping
   them silently doubles up controls rather than just changing how they look.

   .dt-buttons is DataTables' own export group. Our list pages render their own toolbar (the
   excel/pdf/print/search icons) and fire the exporters programmatically, so the stock group is a
   second, unstyled set of the same three buttons sitting right under the first. */
.dt-buttons {
  display: none;
}
.nonVisibleBar {
  display: none;
}
.buttonsToHide {
  display: none !important;
}

/* Compact table density (was previously Arabic-only + inline in ~140 views) */
.table td,
.table th {
  padding: .5rem 0.3rem;
}

/* Small buttons: roomier hit area (was previously Arabic-only + inline in ~72 views) */
.btn-group-sm > .btn,
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* ---- Row actions (HorsePlus, 2026-10-05) --------------------------------
   A table's row actions are the estate's list-page buttons: small, outlined, holding only an icon that the
   tooltip names (dmsRowAction() in dms-datatable.js; server-rendered tables use the same classes). Never
   .btn-icon on a row — that is the toolbar's 45px square, and it made every line 67px tall instead of 55.
   The theme gives every .btn > i a 12px right margin (style.css ~7909) to sit between an icon and its text;
   on a lone icon it pushes the glyph 6px off-centre (in the estate too), so a row action drops it. */
.btn.hp-row-action > i {
  margin: 0;
}

/* Header action icons: inset the group from the screen edge so the outermost
   icon (the gear) lines up with the cards' edge below — cards sit 30px in
   (.pcoded-content 30px side padding; row/col gutters cancel) and the outer li
   already contributes 12px, so 18px here. LTR side; rtl.css owns the RTL side. */
.pcoded-header .navbar-nav.header-actions {
  margin-right: 18px;
}

/* Header dropdowns (notifications, the account menu) open inward from the icon's end side, in both
   directions. Bootstrap turns Popper off inside a navbar and marks the menu data-bs-popper="static", so
   placement is pure CSS; the markup's dropdown-menu-right is Bootstrap 4 and does nothing in 5 outside
   rtl.css. Without this, the English menus opened rightwards, off the screen. SocialPlus's rule. */
.pcoded-header .header-actions .dropdown-menu[data-bs-popper] {
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Collapsed sidebar, hover: keep the white logo panel at the collapsed width.

   style.css comments out the theme's own hover-expand rule (the one setting
   .pcoded-navbar.navbar-collapsed:hover to width 264px) but leaves its companion
   live: .pcoded-navbar.navbar-collapsed:hover .header-logo { width: 264px; }
   So on hover the logo panel grew to 264px inside an 80px navbar.

   .header-logo is float:left — a PHYSICAL float, not direction-aware — and nothing
   clips it, so the extra 184px always spilled to the physical right: harmlessly
   off-screen in Arabic (navbar pinned right:0) but straight over the page content
   in English (navbar pinned left:0). Pinning it to 80px makes hover match the
   collapsed state and gives both directions identical, mirrored behaviour.

   Same specificity as the style.css rule; app.css loads after it, so this wins. */
.pcoded-navbar.navbar-collapsed:hover .header-logo {
  width: 80px;
}

/* bootstrap-datepicker: days panel must be visible (was previously Arabic-only + inline in ~103 views) */
.datepicker > .datepicker-days {
  display: block;
}

/* Clickable DataTable cells */
#datatable1 tbody tr td.mypointer {
  cursor: pointer;
}

/* Inline row edit/save: the save icon starts .disabled and only lights up once
   Edit is clicked (promoted from MasterData/Finance/Currencies.cshtml <style>) */
#datatable1 tbody td a.save i.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#datatable1 tbody td a.save:not(.disabled):hover {
  opacity: 0.8;
}

/* ---- Shared dashboard components (promoted from per-view <style> blocks) ---- */

/* Stable-size Chart.js container */
.dms-chart-container {
  position: relative;
  height: 350px;
  width: 100%;
}
.dms-chart-container canvas {
  position: relative;
  z-index: 5;
}

/* Equal-height cards in a row */
.equal-height-row {
  display: flex;
  flex-wrap: wrap;
}
.equal-height-row > [class*='col-'] {
  display: flex;
  flex-direction: column;
}
.equal-height-row .card {
  flex: 1;
  margin-bottom: 25px;
}

/* Interactive icon buttons */
.action-icon {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 6px;
  text-decoration: none !important;
}
.action-icon:hover {
  transform: scale(1.5);
}
.action-icon i {
  line-height: 1;
}

/* Circular icon buttons inside a .btn-group (e.g. approve/reject in tables):
   these are independent actions, not a segmented control — separate them with
   a symmetric gap. margin:0 cancels the theme/rtl/Bootstrap margin juggling
   (rtl.css mirrors .btn margins but not the .btn-group reset, which made the
   spacing appear in Arabic only). Same look in LTR and RTL. */
.btn-group:has(> .btn.rounded-circle) {
  gap: 8px;
}
.btn-group:has(> .btn.rounded-circle) > .btn {
  margin: 0;
}

/* Scrollable tree panel (cost-center-tree.css adds scrollbar styling + mobile height on tree pages) */
.tree-container {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
}
